/* Volmet.online - Main Styles with Dark Mode */
:root {
    /* Light mode (default) */
    --color0: #092c40;
    --color1: #0e4463;
    --color2: #df122a;
    --color2-hover: #c9051c;
    --color3: #12a6df;
    --color3-hover: #0794cc;
    --color4: #252525;
    --white: #fff;
    --bg-color: #f5f7fa;
    --bg-card: #fff;
    --border-color: #e0e0e0;
    --text-color: #252525;
    --text-muted: #666;
    --shadow: 0 0 0.5rem rgba(0,0,0,0.2);
    --radius: 0.3rem;
    --sidebar-width: 240px;
    --input-bg: #fff;

    /* Accent colors - use for UI elements */
    --accent-blue: #12a6df;
    --accent-blue-hover: #0794cc;
    --accent-blue-light: #e3f4fc;
    --accent-green: #10b981;
    --accent-green-hover: #059669;
    --accent-green-light: #d1fae5;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fef3c7;

    /* Secondary backgrounds */
    --bg-secondary: #f0f4f8;
    --bg-hover: #e8ecf0;
}

/* Dark mode */
[data-theme="dark"] {
    --color0: #0a1929;
    --color1: #12a6df;
    --color4: #e0e0e0;
    --white: #1a2332;
    --bg-color: #0a1929;
    --bg-card: #1a2332;
    --border-color: #2d3748;
    --text-color: #e0e0e0;
    --text-muted: #a0aec0;
    --shadow: 0 0 0.5rem rgba(0,0,0,0.4);
    --input-bg: #2d3748;

    /* Dark mode accent colors */
    --accent-blue: #38bdf8;
    --accent-blue-hover: #0ea5e9;
    --accent-blue-light: #1e3a5f;
    --accent-green: #34d399;
    --accent-green-hover: #10b981;
    --accent-green-light: #1e3a3a;
    --accent-amber: #fbbf24;
    --accent-amber-light: #3d2e0a;

    /* Secondary backgrounds */
    --bg-secondary: #1a2332;
    --bg-hover: #2d3748;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Custom scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color1);
}

::-webkit-scrollbar-corner {
    background: var(--bg-color);
}

/* Firefox scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--text-muted) var(--bg-color);
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Rubik', sans-serif;
    font-weight: 400;
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.6;
    background: var(--bg-color);
    transition: background 0.3s, color 0.3s;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.7em 1.4em;
    border: none;
    border-radius: var(--radius);
    font-size: 1em;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    box-shadow: var(--shadow);
}

.btn:hover {
    box-shadow: none;
}

.btn-primary {
    background: var(--color2);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color2-hover);
}

.btn-login {
    background: var(--color3);
    color: #fff;
}

.btn-login:hover {
    background: var(--color3-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--bg-color);
}

.btn-large {
    padding: 1em 2em;
    font-size: 1.1em;
}

.btn-full {
    width: 100%;
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--bg-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-color);
}

.theme-toggle .icon-sun {
    display: none;
}

.theme-toggle .icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Landing Page */
.landing-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: url('/images/background-top.jpg') no-repeat center top,
                url('/images/background-bottom.jpg') no-repeat center bottom;
    background-size: cover;
    overflow: hidden;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.8rem;
    transition: background 0.3s ease-in-out;
}

.header.scroll {
    background: rgba(255,255,255,0.95);
}

[data-theme="dark"] .header.scroll {
    background: rgba(26,35,50,0.95);
}

.header-inner {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

.nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.hero-content {
    text-align: center;
}

.hero-logo-link {
    display: inline-block;
    margin-bottom: 2rem;
}

.hero-logo {
    height: 100px;
    width: auto;
}

.hero-content h1 {
    font-size: 3em;
    font-weight: 700;
    color: var(--color1);
    margin-bottom: 2rem;
    line-height: 1.1;
}

/* Footer */
.footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.85em;
    color: var(--text-muted);
    flex-shrink: 0;
}

.footer a {
    color: var(--color2);
    text-decoration: underline;
    transition: color 0.15s;
}

.footer a:hover {
    color: var(--color2-hover);
}

/* Login Page */
.login-page {
    min-height: 100vh;
    background: var(--bg-color);
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.login-branding {
    background: linear-gradient(135deg, #092c40 0%, #0e4463 100%);
    padding: 40px;
    display: flex;
    flex-direction: column;
    color: #fff;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    width: fit-content;
    transition: background 0.2s;
}

.btn-back:hover {
    background: rgba(255,255,255,0.2);
}

.btn-back svg {
    width: 20px;
    height: 20px;
}

.branding-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.logo-large img {
    height: 80px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* Login Panel */
.login-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
    background: var(--bg-card);
}

.login-panel h1 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--color1);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1em;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color3);
    box-shadow: 0 0 0 3px rgba(18, 166, 223, 0.1);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group select,
.form-group textarea {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1em;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}

.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color3);
    box-shadow: 0 0 0 3px rgba(18, 166, 223, 0.1);
}

.form-group .form-hint {
    font-size: 0.85em;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-control {
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1em;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-color);
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--color3);
    box-shadow: 0 0 0 3px rgba(18, 166, 223, 0.1);
}

/* Wizard styles */
.wizard-view {
    background: var(--bg-color);
}

/* Compact wizard form styles */
.wizard-view .form-group {
    gap: 4px;
    margin-bottom: 12px;
}

.wizard-view .form-group:last-child {
    margin-bottom: 0;
}

.wizard-view .form-group label {
    font-size: 0.875rem;
    font-weight: 500;
}

.wizard-view .form-control,
.wizard-view .form-group input,
.wizard-view .form-group select,
.wizard-view .form-group textarea {
    padding: 10px 12px;
    font-size: 0.9rem;
}

.wizard-view .form-hint {
    font-size: 0.75rem;
    margin-top: 2px;
}

.wizard-view textarea {
    resize: vertical;
    min-height: 50px;
}

.wizard-step-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.wizard-step-label {
    font-size: 0.75em;
    color: var(--text-muted);
    text-align: center;
    flex: 1;
}

.wizard-step-label.active {
    color: var(--accent-blue);
    font-weight: 600;
}

.wizard-step-label.completed {
    color: var(--accent-green);
}

/* Calendar widget */
.calendar-widget {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 16px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-header button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--text-color);
    font-size: 1.2em;
}

.calendar-header span {
    font-weight: 600;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.calendar-day-header {
    font-size: 0.75em;
    color: var(--text-muted);
    padding: 8px 0;
    font-weight: 600;
}

.calendar-day {
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.2s;
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.selected {
    background: var(--accent-blue);
    color: white;
}

.calendar-day.today {
    border: 2px solid var(--accent-blue);
}

.calendar-day.other-month {
    color: var(--text-muted);
}

.password-wrapper {
    position: relative;
}

.password-wrapper input {
    width: 100%;
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.password-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
}

[data-theme="dark"] .error-message {
    background: #7f1d1d;
    color: #fecaca;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* Loader */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Dashboard */
.dashboard {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo-dashboard {
    height: 36px;
    width: auto;
}

[data-theme="dark"] .logo-dashboard {
    filter: brightness(0) invert(1);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.current-group {
    background: var(--color1);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Group Switcher (Dev only) */
.group-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #fef3c7;
    border-radius: var(--radius);
    border: 1px dashed #f59e0b;
}

[data-theme="dark"] .group-switcher {
    background: #78350f;
    border-color: #d97706;
}

.switcher-label {
    font-size: 11px;
    font-weight: 600;
    color: #92400e;
    text-transform: uppercase;
}

[data-theme="dark"] .switcher-label {
    color: #fcd34d;
}

.group-btn {
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid #d97706;
    background: var(--bg-card);
    color: #92400e;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

[data-theme="dark"] .group-btn {
    color: #fcd34d;
}

.group-btn:hover {
    background: #fef3c7;
}

[data-theme="dark"] .group-btn:hover {
    background: #92400e;
}

.group-btn.active {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}

/* Dashboard Layout */
.dashboard-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 20px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--bg-color);
}

.nav-item.active {
    background: var(--color1);
    color: #fff;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-text {
    font-size: 14px;
    font-weight: 500;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-header {
    padding: 24px 32px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.content-header h1 {
    font-size: 1.5em;
    font-weight: 600;
    color: var(--color1);
}

.content-body {
    flex: 1;
    padding: 32px;
    background: var(--bg-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Placeholder Content */
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    color: var(--text-muted);
}

.placeholder-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
    color: var(--border-color);
}

.placeholder-icon svg {
    width: 100%;
    height: 100%;
}

.placeholder-content h2 {
    font-size: 1.5em;
    color: var(--color1);
    margin-bottom: 8px;
}

.placeholder-content p {
    font-size: 1em;
}

.dev-info {
    margin-top: 16px;
    padding: 8px 16px;
    background: #fef3c7;
    border-radius: var(--radius);
    font-size: 14px;
    color: #92400e;
}

[data-theme="dark"] .dev-info {
    background: #78350f;
    color: #fcd34d;
}

/* Responsive */
@media (max-width: 768px) {
    .login-container {
        grid-template-columns: 1fr;
    }

    .login-branding {
        display: none;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .hero-logo {
        height: 70px;
    }

    .header {
        padding: 1rem;
    }

    .logo img {
        height: 40px;
    }

    .sidebar {
        width: 60px;
    }

    .nav-text {
        display: none;
    }

    .nav-item {
        justify-content: center;
        padding: 12px;
    }

    .group-switcher {
        display: none;
    }
}

/* Header scroll effect */
@media (min-width: 769px) {
    .header.scroll .logo img {
        height: 40px;
    }
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
    flex-shrink: 0;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.tab-btn:hover {
    color: var(--color1);
}

.tab-btn.active {
    color: var(--color1);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color1);
}

.tab-btn .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    margin-left: 8px;
    background: var(--border-color);
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.tab-btn.active .badge {
    background: var(--color1);
    color: #fff;
}

/* Data Table */
.data-table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: auto;
    flex: 1;
    min-height: 0;
}

/* Sticky header */
.data-table.sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-color);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table tr:hover {
    background: var(--bg-color);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table td {
    color: var(--text-color);
}

/* Status badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.status-waiting {
    background: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .status-waiting {
    background: #78350f;
    color: #fcd34d;
}

.status-active {
    background: #dbeafe;
    color: #1e40af;
}

[data-theme="dark"] .status-active {
    background: #1e3a5f;
    color: #93c5fd;
}

.status-open {
    background: #fee2e2;
    color: #dc2626;
}

[data-theme="dark"] .status-open {
    background: #7f1d1d;
    color: #fecaca;
}

.status-closed {
    background: #d1fae5;
    color: #065f46;
}

[data-theme="dark"] .status-closed {
    background: #064e3b;
    color: #6ee7b7;
}

/* Table actions */
.table-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--color1);
    border-color: var(--color1);
    color: #fff;
}

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--text-color);
}

/* Toolbar */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.toolbar-left {
    display: flex;
    gap: 12px;
    align-items: center;
}

.toolbar-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-color);
    min-width: 250px;
}

.search-input:focus {
    outline: none;
    border-color: var(--color3);
}

.search-input::placeholder {
    color: var(--text-muted);
}

/* MRN/Invoice link style */
.mrn-link,
.inv-link {
    color: var(--color3);
    font-weight: 600;
    cursor: pointer;
}

.mrn-link:hover,
.inv-link:hover {
    text-decoration: underline;
}

/* Country badge */
.country-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* Text utilities */
.text-muted {
    color: var(--text-muted);
}

/* VDD Export View */
.vdd-export-view {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.loading-state .loader {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid var(--border-color);
    border-top-color: var(--color3);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 14px;
    margin-right: auto;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    padding: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-muted);
}

.sidebar-footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-footer a:hover {
    color: var(--color3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-large {
    max-width: 1000px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

/* Detail grid */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.detail-section {
    background: var(--bg-color);
    border-radius: var(--radius);
    padding: 16px;
}

.detail-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color1);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 13px;
}

.detail-row span:first-child {
    color: var(--text-muted);
}

.detail-row strong {
    color: var(--text-color);
}

/* Items table wrapper */
.items-table-wrapper {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 12px;
}

.items-table {
    font-size: 12px;
}

.items-table th,
.items-table td {
    padding: 8px 10px;
}

/* Badge warning */
.badge-warning {
    background: #f59e0b;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.text-warning {
    color: #f59e0b;
}

/* Responsive table */
.data-table-wrapper {
    overflow-x: auto;
}

.data-table th,
.data-table td {
    white-space: nowrap;
}

/* Detail View */
.detail-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
    flex-shrink: 0;
}

.detail-header h2 {
    flex: 1;
    font-size: 1.25em;
    font-weight: 600;
    color: var(--color1);
    margin: 0;
}

.detail-actions {
    display: flex;
    gap: 8px;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.15s;
}

.btn-back:hover {
    background: var(--bg-color);
    border-color: var(--color1);
    color: var(--color1);
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.detail-items-section {
    margin-top: 24px;
}

.detail-items-section h3 {
    margin-bottom: 12px;
    font-size: 1em;
    font-weight: 600;
    color: var(--text-color);
}

.detail-items-section .items-table-wrapper {
    max-height: 400px;
    overflow: auto;
}

.error-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--color2);
}

.text-success {
    color: #22c55e;
}

.text-warning {
    color: #f59e0b;
}

/* Pending row highlight */
.pending-row {
    background: #fef3c7;
}

[data-theme="dark"] .pending-row {
    background: #78350f;
}

.pending-row:hover {
    background: #fde68a;
}

[data-theme="dark"] .pending-row:hover {
    background: #92400e;
}

/* Loading inline indicator */
.loading-inline {
    color: var(--text-muted);
    font-style: italic;
}

/* Small loading state */
.loading-state.small {
    padding: 20px;
}

.loading-state.small .loader {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
}

.loading-state.small p {
    font-size: 13px;
}

/* Detail info bar */
.detail-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.detail-info-bar .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.detail-info-bar .info-item span {
    color: var(--text-muted);
}

.detail-info-bar .info-item strong {
    color: var(--text-color);
}

/* Detail tabs */
.detail-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0;
}

.detail-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-tab-btn:hover {
    color: var(--color1);
}

.detail-tab-btn.active {
    color: var(--color1);
}

.detail-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color1);
}

.tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--border-color);
    color: var(--text-muted);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
}

.tab-badge.loaded {
    background: var(--color1);
    color: #fff;
}

/* Detail tab content */
.detail-tab-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* PDF preview */
.pdf-preview {
    flex: 1;
    display: flex;
    min-height: 0;
    margin-bottom: 8px;
}

.pdf-preview iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 280px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fff;
}

/* VDD preview */
.vdd-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-bottom: 8px;
}

.vdd-preview .vdd-info {
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    font-size: 14px;
    flex-shrink: 0;
}

.vdd-preview iframe {
    flex: 1;
    width: 100%;
    height: 100%;
    min-height: calc(100vh - 320px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: #fff;
}

/* T2 preview in VDD detail */
.t2-preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.t2-preview-section .t2-info {
    flex-shrink: 0;
    padding: 8px 12px;
    background: var(--bg-color);
    border-radius: var(--radius);
}

/* HS stats bar */
.hs-stats-bar {
    display: flex;
    gap: 24px;
    padding: 12px 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin: 16px 0;
}

.hs-stats-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.hs-stats-bar .stat-item span {
    color: var(--text-muted);
}

/* HS table wrapper */
.hs-table-wrapper {
    flex: 1;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-card);
}

/* Sticky columns for VDD table */
.data-table.sticky-cols th:nth-child(1),
.data-table.sticky-cols td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 5;
    background: var(--bg-card);
}

.data-table.sticky-cols th:nth-child(2),
.data-table.sticky-cols td:nth-child(2) {
    position: sticky;
    left: 140px;
    z-index: 5;
    background: var(--bg-card);
}

.data-table.sticky-cols thead th:nth-child(1),
.data-table.sticky-cols thead th:nth-child(2) {
    z-index: 15;
    background: var(--bg-color);
}

.data-table.sticky-cols td:nth-child(1)::after,
.data-table.sticky-cols td:nth-child(2)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}

.data-table.sticky-cols td {
    position: relative;
}

/* Sortable column headers */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 20px !important;
}

.sortable:hover {
    color: var(--color1);
}

.sortable::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-muted);
    opacity: 0.5;
}

.sortable.asc::after {
    border-top: none;
    border-bottom: 5px solid var(--color1);
    opacity: 1;
}

.sortable.desc::after {
    border-top: 5px solid var(--color1);
    opacity: 1;
}

/* Dashboard stats grid */
.dashboard-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.stats-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.stats-card.clickable {
    cursor: pointer;
}

.stats-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stats-card h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.stats-row:last-child {
    border-bottom: none;
}

.stats-row .label {
    color: var(--text-muted);
    font-size: 14px;
}

.stats-row .value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color1);
}

.stats-row .value.waiting {
    color: #f59e0b;
}

.stats-row .value.open {
    color: #dc2626;
}

.stats-row .value.closed {
    color: #22c55e;
}

/* Dohledy styles */
.dohledy-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.dohledy-stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.dohledy-stat {
    padding: 12px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
}

.dohledy-stat:hover {
    transform: translateY(-2px);
}

.dohledy-stat.active {
    border: 2px solid var(--color1);
}

.dohledy-stat .count {
    font-size: 24px;
    font-weight: 700;
    color: var(--color1);
}

.dohledy-stat .label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dohledy-stat.open .count {
    color: #f59e0b;
}

.dohledy-stat.answered .count {
    color: #3b82f6;
}

.dohledy-stat.closed .count {
    color: #22c55e;
}

/* Dohled form */
.dohled-form {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

.dohled-form h4 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--color1);
}

.dohled-form .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.dohled-form select,
.dohled-form textarea {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    font-family: inherit;
    background: var(--input-bg);
    color: var(--text-color);
}

.dohled-form textarea {
    min-height: 80px;
    resize: vertical;
}

.dohled-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* Dohled list */
.dohled-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.dohled-item {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 16px;
    border-left: 4px solid var(--border-color);
}

.dohled-item.open {
    border-left-color: #f59e0b;
}

.dohled-item.answered {
    border-left-color: #3b82f6;
}

.dohled-item.closed {
    border-left-color: #22c55e;
}

.dohled-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.dohled-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

.dohled-item-text {
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 8px;
}

.dohled-item-footer {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.dohled-responses {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.dohled-response {
    background: var(--bg-color);
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    font-size: 13px;
}

.dohled-response:last-child {
    margin-bottom: 0;
}

/* Verification tab */
.verification-section {
    padding: 16px;
}

.verification-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.verification-status.success {
    background: #d1fae5;
    border: 1px solid #22c55e;
}

.verification-status.error {
    background: #fee2e2;
    border: 1px solid #dc2626;
}

.verification-status.pending {
    background: #fef3c7;
    border: 1px solid #f59e0b;
}

[data-theme="dark"] .verification-status.success {
    background: #064e3b;
}

[data-theme="dark"] .verification-status.error {
    background: #7f1d1d;
}

[data-theme="dark"] .verification-status.pending {
    background: #78350f;
}

.verification-icon {
    width: 32px;
    height: 32px;
}

.verification-details {
    flex: 1;
}

.verification-btn {
    margin-top: 16px;
}

/* Hide content header for certain views */
.content-header.hidden {
    display: none;
}

/* Customer Portal Badge Styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-open {
    background: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .badge-open {
    background: #78350f;
    color: #fcd34d;
}

.badge-closed {
    background: #d1fae5;
    color: #065f46;
}

[data-theme="dark"] .badge-closed {
    background: #064e3b;
    color: #6ee7b7;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .badge-cancelled {
    background: #7f1d1d;
    color: #fca5a5;
}

.badge-active {
    background: #dbeafe;
    color: #1e40af;
}

[data-theme="dark"] .badge-active {
    background: #1e3a8a;
    color: #93c5fd;
}

/* Customer Portal Card Styles */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.875rem;
}

.info-row span {
    color: var(--text-muted);
}

/* Customer Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.data-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.data-table tbody tr:hover {
    background: var(--bg-hover);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

/* Customer Portal - Additional Styles */
/* PDF Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content.pdf-modal {
    width: 900px;
    height: 85vh;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    flex: 1;
    font-size: 1.125rem;
}

.modal-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    padding: 0;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #f0f0f0;
}

[data-theme="dark"] .pdf-iframe {
    background: #1a1a1a;
}

/* Sortable Headers */
.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.data-table th.sortable:hover {
    background: var(--bg-hover);
}

.sort-icon {
    margin-left: 4px;
    font-size: 0.75rem;
    opacity: 0.5;
}

.sort-icon.sort-active {
    opacity: 1;
    color: var(--accent-blue);
}

/* Detail View Styles */
.detail-view {
    padding: 0;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.detail-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.detail-header-actions {
    display: flex;
    gap: 8px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.detail-card h4 {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.875rem;
}

.detail-row span {
    color: var(--text-muted);
}

.detail-section {
    margin-top: 24px;
}

.detail-section h4 {
    margin: 0 0 12px 0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.detail-totals {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    max-width: 300px;
    margin-left: auto;
}

.detail-totals .detail-row {
    padding: 4px 0;
}

.detail-totals .detail-row.total {
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
    padding-top: 12px;
    font-size: 1.125rem;
}

/* Country Badge */
.country-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Warning Row */
.row-warning {
    background: rgba(239, 68, 68, 0.08);
}

[data-theme="dark"] .row-warning {
    background: rgba(239, 68, 68, 0.15);
}

/* Table Actions */
.table-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
}

/* Customer View */
.customer-view {
    padding: 0;
}

/* Data Table Wrapper with vertical scroll */
.data-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 280px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.data-table.sticky-header thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary);
}

/* Order detail items table */
.detail-section-table {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.detail-section-table h4 {
    flex-shrink: 0;
}

.order-items-table {
    flex: 1;
    min-height: 200px;
    max-height: calc(100vh - 380px);
}

.order-items-table tbody tr:last-child td {
    padding-bottom: 16px;
}

/* Ensure detail view has proper scroll behavior */
.detail-view .detail-header {
    flex-shrink: 0;
}

.detail-view .detail-grid {
    flex-shrink: 0;
}

.detail-view .detail-section-table {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px;
}

.pagination-info {
    color: var(--text-muted);
    font-size: 0.875rem;
}
