/* ==========================================================================
   ORDERBOARD - Global Styles
   ========================================================================== */

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover);
}

img {
    max-width: 100%;
}

button,
input,
select,
textarea {
    font: inherit;
}

/* ==========================================================================
   THEME - Light (Default)
   ========================================================================== */

:root {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #f8fafc;
    --text-main: #1e293b;
    --text-heading: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-input: #cbd5e1;
    --header-bg: #0f172a;
    --header-hover: #1e293b;
    --header-border: #1e293b;
    --link: #2563eb;
    --link-hover: #1d4ed8;
    --table-hover: #f8fafc;
    --input-bg: #ffffff;
    --danger: #dc2626;
    --warning: #d97706;
    --success: #16a34a;
    --info: #0891b2;
    --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* ==========================================================================
   THEME - Dark
   ========================================================================== */

[data-theme="dark"] {
    --bg-main: #0f172a;
    --bg-surface: #1e293b;
    --bg-surface-secondary: #273449;
    --text-main: #e2e8f0;
    --text-heading: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-input: #475569;
    --header-bg: #020617;
    --header-hover: #1e293b;
    --header-border: #1e293b;
    --link: #60a5fa;
    --link-hover: #93c5fd;
    --table-hover: #273449;
    --input-bg: #1e293b;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #22c55e;
    --info: #06b6d4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    color: white;
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-title {
    margin: 0;
    flex-shrink: 0;
}

.site-title a {
    display: block;
    color: white;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.site-title a:hover {
    color: white;
}

/* ==========================================================================
   MAIN NAV
   ========================================================================== */

.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.main-nav > a,
.nav-dropdown-btn,
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    min-height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.main-nav > a:hover,
.nav-dropdown-btn:hover,
.theme-toggle:hover {
    background: var(--header-hover);
    color: white;
}

/* ==========================================================================
   DROPDOWN
   ========================================================================== */

.nav-dropdown {
    position: relative;
    flex-shrink: 0;
}

.nav-dropdown-btn {
    width: auto;
}

/* Hidden by default */
.nav-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 190px;
    padding: 5px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
    overflow: hidden;
    z-index: 2000;
}

/* Show when open */
.nav-dropdown.open > .nav-dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-dropdown-content a {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-dropdown-content a:hover {
    background: var(--bg-surface-secondary);
    color: var(--link);
}

.dropdown-arrow {
    margin-left: 5px;
    font-size: 11px;
    transition: transform 0.15s ease;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   THEME BUTTON
   ========================================================================== */

.theme-toggle {
    margin-left: 4px;
}

/* ==========================================================================
   MAIN CONTENT
   ========================================================================== */

.main-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px 60px;
    overflow-x: hidden;
}

/* ==========================================================================
   PAGE HEADER
   ========================================================================== */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.page-header h2 {
    margin: 0;
    color: var(--text-heading);
    font-size: 28px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.page-description {
    margin: 6px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==========================================================================
   SECTIONS
   ========================================================================== */

section {
    margin-bottom: 24px;
    padding: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.content-section {
    scroll-margin-top: 80px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.section-header h3 {
    margin: 0;
    color: var(--text-heading);
    font-size: 18px;
    font-weight: 700;
}

.section-description {
    margin: 4px 0 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 9px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

/* ==========================================================================
   DASHBOARD - FIXED FOR MOBILE
   ========================================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    width: 100%;
}

.dashboard-card {
    display: block;
    padding: 18px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.dashboard-card:hover {
    color: inherit;
    border-color: var(--border-input);
    box-shadow: 0 5px 15px rgba(15, 23, 42, 0.07);
    transform: translateY(-1px);
}

.dashboard-card h3 {
    margin: 0;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
}

.big-number {
    margin: 10px 0 8px;
    color: var(--text-heading);
    font-size: 30px;
    font-weight: 800;
    line-height: 1.1;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.card-link {
    color: var(--link);
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================================================
   ATTENTION
   ========================================================================== */

.overdue {
    background: #fff1f2 !important;
}

[data-theme="dark"] .overdue {
    background: #7f1d1d !important;
}

.overdue:hover {
    background: #ffe4e6 !important;
}

[data-theme="dark"] .overdue:hover {
    background: #991b1b !important;
}

.danger {
    color: var(--danger);
}

.deadline-days {
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.overdue-days {
    color: var(--danger);
}

.upcoming-days {
    color: var(--warning);
}

/* ==========================================================================
   TABLES
   ========================================================================== */

.responsive-table {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 7px;
    -webkit-overflow-scrolling: touch;
}

.responsive-table table {
    border: 0;
    width: 100%;
    min-width: 620px;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-surface);
}

th,
td {
    padding: 11px 13px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}

th {
    background: var(--bg-surface-secondary);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

td {
    color: var(--text-main);
    font-size: 14px;
    overflow-wrap: anywhere;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr {
    transition: background-color 0.12s ease;
}

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

td a {
    font-weight: 600;
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.status-modeling {
    background: #ede9fe;
    color: #6d28d9;
}

.status-print {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-paint {
    background: #fef3c7;
    color: #b45309;
}

.status-done {
    background: #dcfce7;
    color: #15803d;
}

.status-not-shipped {
    background: #f1f5f9;
    color: #475569;
}

.status-packaged {
    background: #e0f2fe;
    color: #0369a1;
}

.status-shipped {
    background: #cffafe;
    color: #0e7490;
}

.status-delivered {
    background: #dcfce7;
    color: #15803d;
}

[data-theme="dark"] .status-modeling {
    background: #4c1d95;
    color: #c4b5fd;
}

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

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

[data-theme="dark"] .status-done {
    background: #14532d;
    color: #86efac;
}

[data-theme="dark"] .status-not-shipped {
    background: #334155;
    color: #cbd5e1;
}

[data-theme="dark"] .status-packaged {
    background: #0c4a6e;
    color: #7dd3fc;
}

[data-theme="dark"] .status-shipped {
    background: #155e75;
    color: #67e8f9;
}

[data-theme="dark"] .status-delivered {
    background: #14532d;
    color: #86efac;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

form p {
    margin: 0 0 17px;
}

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
}

input,
select,
textarea {
    display: block;
    width: 100%;
    max-width: 650px;
    padding: 10px 12px;
    color: var(--text-main);
    background: var(--input-bg);
    border: 1px solid var(--border-input);
    border-radius: 7px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--text-muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

input[type="checkbox"] {
    display: inline-block;
    width: auto;
    max-width: none;
    margin-right: 6px;
}

input[type="file"] {
    padding: 8px;
}

.errorlist {
    margin: 5px 0 8px;
    padding-left: 20px;
    color: #b91c1c;
    font-size: 13px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 15px;
    border: 0;
    border-radius: 7px;
    background: #2563eb;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.3;
    transition: background-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

button:hover,
.button:hover {
    background: #1d4ed8;
    color: white;
    box-shadow: 0 3px 8px rgba(37, 99, 235, 0.18);
}

button:active,
.button:active {
    transform: translateY(1px);
}

button:focus,
.button:focus {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.button.secondary,
button.secondary {
    background: #64748b;
}

.button.secondary:hover,
button.secondary:hover {
    background: #475569;
}

.button.success,
button.success {
    background: #16a34a;
}

.button.success:hover,
button.success:hover {
    background: #15803d;
}

.button.warning,
button.warning {
    background: #d97706;
}

.button.warning:hover,
button.warning:hover {
    background: #b45309;
}

.danger-button {
    background: #dc2626;
}

.danger-button:hover {
    background: #b91c1c;
}

/* ==========================================================================
   BUTTON GROUP
   ========================================================================== */

.button-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* ==========================================================================
   FILTERS
   ========================================================================== */

.order-filters {
    margin-bottom: 24px;
}

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

.filter-search {
    width: 100%;
}

.filter-search input {
    width: 100%;
    max-width: none;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.filter-grid > div {
    min-width: 0;
}

.filter-grid input,
.filter-grid select {
    max-width: none;
}

.filter-date-section {
    padding-top: 17px;
    border-top: 1px solid var(--border);
}

.filter-section-title {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.date-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.date-filter-group {
    min-width: 0;
}

.date-filter-label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.date-filter-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.date-filter-inputs input {
    width: 100%;
    max-width: none;
    min-width: 0;
}

.date-filter-inputs span {
    color: var(--text-muted);
    font-size: 12px;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==========================================================================
   MESSAGES
   ========================================================================== */

.messages {
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.message {
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 8px;
    color: #065f46;
    font-size: 14px;
}

[data-theme="dark"] .message {
    background: #14532d;
    border-color: #166534;
    color: #86efac;
}

/* ==========================================================================
   CUSTOMER SEARCH
   ========================================================================== */

#customer-results {
    width: 100%;
    max-width: 650px;
    margin-top: -10px;
    margin-bottom: 15px;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.customer-result {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: var(--bg-surface);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
}

.customer-result:last-child {
    border-bottom: 0;
}

.customer-result:hover {
    background: var(--bg-surface-secondary);
    color: var(--link-hover);
}

#selected-customer {
    width: 100%;
    max-width: 650px;
    padding: 14px;
    margin-bottom: 15px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-input);
    border-radius: 8px;
}

#selected-customer p {
    margin-top: 0;
}

/* ==========================================================================
   PHOTOS
   ========================================================================== */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.photo-card {
    min-width: 0;
    padding: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: var(--shadow);
}

.photo-card img {
    display: block;
    width: 100%;
    height: 200px;
    margin-bottom: 10px;
    object-fit: cover;
    border-radius: 6px;
}

/* ==========================================================================
   ORDER DETAIL
   ========================================================================== */

.order-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.order-summary-item {
    padding: 14px;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.order-summary-item .label {
    margin-bottom: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.order-summary-item .value {
    color: var(--text-heading);
    font-size: 16px;
    font-weight: 700;
}

/* ==========================================================================
   ACTIVITY
   ========================================================================== */

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-item p {
    margin: 0;
}

.activity-time {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

/* ==========================================================================
   EMPTY STATE
   ========================================================================== */

.empty-state {
    padding: 30px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.empty-state p {
    margin: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}

.footer-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 24px;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.footer-inner p {
    margin: 0;
}

/* ==========================================================================
   PRINT PAGE
   ========================================================================== */

.print-page.orientation-portrait {
    width: 210mm;
    height: 297mm;
    min-width: 210mm;
    min-height: 297mm;
    max-width: 210mm;
    max-height: 297mm;
}

.print-page.orientation-landscape {
    width: 297mm;
    height: 210mm;
    min-width: 297mm;
    min-height: 210mm;
    max-width: 297mm;
    max-height: 210mm;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(var(--label-rows, 3), minmax(0, 1fr));
}

.print-page.orientation-landscape .shipping-label {
    padding: calc(3mm * var(--label-scale));
    gap: calc(1.5mm * var(--label-scale));
}

.print-page.orientation-landscape.labels-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    --label-scale: 1.3;
}

.print-page.orientation-landscape.labels-5,
.print-page.orientation-landscape.labels-6 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    --label-scale: 1;
}

.print-page.orientation-landscape.labels-7,
.print-page.orientation-landscape.labels-8 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    --label-scale: 0.85;
}

.print-page.orientation-landscape .label-top-section {
    max-height: calc(25mm * var(--label-scale));
}

.print-page.orientation-landscape .image-placeholder {
    min-height: calc(10mm * var(--label-scale));
}

@media print {
    @page landscape {
        size: A4 landscape;
        margin: 0;
    }

    .print-page.orientation-landscape {
        width: 297mm !important;
        height: 210mm !important;
        min-width: 297mm !important;
        min-height: 210mm !important;
        max-width: 297mm !important;
        max-height: 210mm !important;
        page: landscape;
    }
}

/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1000px) {
    .header-inner {
        padding-left: 18px;
        padding-right: 18px;
        gap: 18px;
    }

    .main-nav {
        gap: 2px;
    }

    .main-nav > a,
    .nav-dropdown-btn,
    .theme-toggle {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 13px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .main-content {
        padding-left: 18px;
        padding-right: 18px;
    }
}

/* ==========================================================================
   MOBILE - FIXED
   ========================================================================== */

@media (max-width: 700px) {
    html {
        scroll-padding-top: 20px;
    }

    .site-header {
        position: relative;
    }

    .header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px;
    }

    .site-title {
        text-align: center;
    }

    .site-title a {
        font-size: 21px;
    }

    .main-nav {
        width: 100%;
        margin-left: 0;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        flex-shrink: 0;
    }

    .main-nav > a,
    .nav-dropdown-btn,
    .theme-toggle {
        width: 100%;
        height: 42px;
        min-height: 42px;
        padding: 8px 6px;
        background: rgba(255, 255, 255, 0.06);
        text-align: center;
        font-size: 13px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-nav > a:hover,
    .nav-dropdown-btn:hover,
    .theme-toggle:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-content {
        display: none;
        position: static;
        width: 100%;
        margin-top: 4px;
        padding: 4px;
        background: var(--bg-surface);
        border: 1px solid var(--border);
        border-radius: 6px;
        box-shadow: none;
    }

    .nav-dropdown.open > .nav-dropdown-content {
        display: flex;
        flex-direction: column;
    }

    .nav-dropdown-content a {
        min-height: 40px;
        color: var(--text-main);
        justify-content: center;
        text-align: center;
        white-space: nowrap;
    }

    .nav-dropdown-content a:hover {
        background: var(--bg-surface-secondary);
        color: var(--link);
    }

    .theme-toggle {
        margin-left: 0;
    }

    .main-content {
        padding: 20px 12px 40px;
        overflow-x: hidden;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .page-header h2 {
        font-size: 24px;
    }

    section {
        padding: 16px;
        margin-bottom: 18px;
        overflow-x: hidden;
    }

    /* FIXED: Dashboard cards - 2 columns, no overflow */
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
    }

    .dashboard-card {
        padding: 14px 12px;
        width: 100%;
        min-width: 0;
    }

    .dashboard-card h3 {
        font-size: 12px;
    }

    .big-number {
        font-size: 24px;
        margin: 8px 0 6px;
    }

    .card-link {
        font-size: 11px;
    }

    .responsive-table {
        border-radius: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .responsive-table table {
        min-width: 620px;
        width: 100%;
    }

    th,
    td {
        padding: 9px 10px;
    }

    input,
    select,
    textarea {
        max-width: none;
        font-size: 16px; /* prevents iOS zoom */
    }

    button,
    .button {
        min-height: 44px;
    }

    .filter-grid {
        grid-template-columns: 1fr;
    }

    .date-filter-grid {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .photo-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .photo-card {
        padding: 8px;
    }

    .photo-card img {
        height: 150px;
    }

    .button-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .button-group .button,
    .button-group button {
        width: 100%;
    }
}

/* ==========================================================================
   SMALL PHONES
   ========================================================================== */

@media (max-width: 480px) {
    .main-content {
        padding: 15px 8px 30px;
    }

    section {
        padding: 13px;
    }

    /* FIXED: Single column on very small phones */
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .dashboard-card {
        padding: 14px 12px;
    }

    .dashboard-card h3 {
        font-size: 12px;
    }

    .big-number {
        font-size: 26px;
    }

    .card-link {
        font-size: 12px;
    }

    .photo-grid {
        grid-template-columns: 1fr;
    }

    .photo-card img {
        height: auto;
        max-height: 300px;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .filter-actions {
        grid-template-columns: 1fr;
    }

    .main-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    .main-nav > a,
    .nav-dropdown-btn,
    .theme-toggle {
        font-size: 12px;
        padding: 6px 4px;
        height: 40px;
        min-height: 40px;
    }
}

/* ==========================================================================
   VERY SMALL PHONES
   ========================================================================== */

@media (max-width: 350px) {
    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .main-nav {
        grid-template-columns: 1fr;
    }

    .date-filter-inputs {
        grid-template-columns: 1fr;
    }

    .date-filter-inputs span {
        display: none;
    }
}

/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }
}

/* ==========================================================================
   PRINTING PAGE
   ========================================================================== */

.printing-page {
    width: 100%;
}

.printing-controls {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.printing-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.printing-controls-header h3 {
    margin: 0 0 6px 0;
    color: var(--text-heading);
}

.printing-help {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

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

/* Settings */
.printing-settings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.printing-setting {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.printing-setting-wide {
    grid-column: 1 / -1;
}

.printing-setting label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.printing-setting input,
.printing-setting select,
.shipment-search input,
.shipment-status-filter select {
    width: 100%;
    max-width: none;
}

/* Shipment selection */
.shipment-selection {
    border-top: 1px solid var(--border);
    padding-top: 22px;
}

.shipment-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.shipment-selection-header h3 {
    margin: 0;
    color: var(--text-heading);
}

#selected-count {
    color: var(--text-muted);
    font-size: 14px;
}

.shipment-filters {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.shipment-search,
.shipment-status-filter {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.shipment-search label,
.shipment-status-filter label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.shipment-selection-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.shipment-selection-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 10px;
}

.shipment-selection-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    background: var(--bg-surface);
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.shipment-selection-item:hover {
    background: var(--bg-surface-secondary);
    border-color: var(--border-input);
}

.shipment-selection-item:has(.shipment-checkbox:checked) {
    border-color: var(--link);
    background: var(--bg-surface-secondary);
}

.shipment-selection-item input {
    margin-top: 3px;
    flex-shrink: 0;
}

.shipment-selection-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
    width: 100%;
}

.shipment-selection-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.shipment-selection-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-heading);
}

.shipment-selection-main span {
    color: var(--text-secondary);
    font-size: 13px;
}

.shipment-selection-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.shipment-status {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-surface-secondary);
}

.filtered-empty-state {
    padding: 20px 0;
}

/* Preview section */
.printing-preview-section {
    margin-top: 30px;
}

.preview-header {
    margin-bottom: 16px;
}

.preview-header h3 {
    margin: 0 0 4px 0;
    color: var(--text-heading);
}

.preview-header p {
    margin: 0;
    color: var(--text-muted);
}

.print-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    direction: ltr;
    width: 100%;
}

.empty-preview {
    width: 100%;
    min-height: 250px;
    border: 2px dashed var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: var(--bg-surface);
}

/* ==========================================================================
   A4 PRINT LABELS (always light + pure black text)
   ========================================================================== */

.print-page {
    --label-scale: 1;
    width: 210mm;
    height: 297mm;
    min-width: 210mm;
    min-height: 297mm;
    max-width: 210mm;
    max-height: 297mm;
    box-sizing: border-box;
    padding: 10mm;
    background: #ffffff;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(var(--label-rows, 3), minmax(0, 1fr));
    gap: 6mm;
    direction: rtl;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.print-page.orientation-landscape {
    width: 297mm !important;
    height: 210mm !important;
    min-width: 297mm !important;
    min-height: 210mm !important;
    max-width: 297mm !important;
    max-height: 210mm !important;
}

.print-page.orientation-landscape.labels-4 {
    --label-scale: 1.4;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.print-page.orientation-landscape.labels-5,
.print-page.orientation-landscape.labels-6 {
    --label-scale: 1.2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.print-page.orientation-landscape.labels-7,
.print-page.orientation-landscape.labels-8 {
    --label-scale: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
}

.print-page.labels-4 {
    --label-scale: 1.18;
}

.print-page.labels-5,
.print-page.labels-6 {
    --label-scale: 1;
}

.print-page.labels-7,
.print-page.labels-8 {
    --label-scale: 0.84;
}

.shipping-label {
    --font-size-px: 10px;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    background: #ffffff;
    border: 2px solid #222222;
    border-radius: 8px;
    padding: calc(3mm * var(--label-scale));
    direction: rtl;
    text-align: right;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    font-family: Tahoma, Arial, sans-serif;
    gap: calc(1.5mm * var(--label-scale));
    color: #000000;
}

/* Force pure black text on everything inside the label */
.shipping-label,
.shipping-label * {
    color: #000000 !important;
}

.shipping-label-header {
    border-bottom: 1px solid #cccccc;
    padding-bottom: calc(1.5mm * var(--label-scale));
    margin-bottom: calc(0.5mm * var(--label-scale));
    flex-shrink: 0;
}

.shipping-label-brand {
    font-size: calc(var(--font-size-px) * 0.75);
    color: #444444 !important;
    letter-spacing: 0.3px;
    margin-bottom: calc(1mm * var(--label-scale));
    direction: rtl;
    text-align: right;
}

.shipping-label-title {
    font-size: calc(var(--font-size-px) * 1.1);
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    max-height: calc(12mm * var(--label-scale));
    overflow: hidden;
    color: #000000 !important;
}

.label-top-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: calc(1.5mm * var(--label-scale));
    flex-shrink: 0;
    max-height: calc(45mm * var(--label-scale));
    overflow: hidden;
}

.shipping-label.layout-no-image .sender-box {
    max-height: calc(45mm * var(--label-scale));
    overflow: hidden;
}

.label-box {
    border: 1px solid #cccccc;
    border-radius: 4px;
    padding: calc(1.5mm * var(--label-scale));
    background: #fafafa;
    overflow: hidden;
    min-height: 0;
}

.label-box-title {
    font-size: calc(var(--font-size-px) * 0.9);
    font-weight: 700;
    margin-bottom: calc(1mm * var(--label-scale));
    color: #111111 !important;
}

.sender-box {
    display: flex;
    flex-direction: column;
}

.sender-box .label-info-row:last-child {
    flex: 1;
    min-height: 0;
}

.sender-box .label-info-row:last-child .label-value {
    max-height: none;
    overflow-y: auto;
}

.image-box {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    overflow: hidden;
    border: none;
    padding: 0;
    background: transparent;
}

.image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    min-height: calc(20mm * var(--label-scale));
    border: 1px dashed #cccccc;
    border-radius: 4px;
    background: #ffffff;
}

.receiver-box {
    flex: 1;
    border: 1px solid #cccccc;
    border-radius: 4px;
    padding: calc(1.5mm * var(--label-scale));
    background: #fafafa;
    overflow: hidden;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.receiver-box .label-info-row:last-child {
    flex: 1;
    min-height: 0;
}

.receiver-box .label-info-row:last-child .label-value {
    max-height: none;
    overflow-y: auto;
}

.label-info-row {
    font-size: var(--font-size-px);
    line-height: 1.35;
    margin-bottom: calc(0.8mm * var(--label-scale));
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    align-items: flex-start;
    min-height: 0;
}

.label-caption {
    font-weight: 600;
    flex-shrink: 0;
    color: #111111 !important;
}

.label-value {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    min-width: 0;
    max-height: calc(15mm * var(--label-scale));
    overflow: hidden;
    color: #000000 !important;
}

/* Responsive for printing controls */
@media (max-width: 1000px) {
    .printing-controls-header {
        flex-direction: column;
    }

    .printing-actions {
        width: 100%;
    }

    .shipment-filters {
        grid-template-columns: 1fr;
    }

    .print-preview {
        align-items: flex-start;
        overflow-x: auto;
    }

    .print-page {
        flex-shrink: 0;
    }

    .printing-settings {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .printing-settings {
        grid-template-columns: 1fr;
    }

    .printing-setting-wide {
        grid-column: auto;
    }

    .shipment-selection-list {
        grid-template-columns: 1fr;
    }

    .printing-actions {
        flex-direction: column;
    }

    .printing-actions .button {
        width: 100%;
    }

    .shipment-selection-actions {
        flex-direction: column;
    }

    .shipment-selection-actions .button {
        width: 100%;
    }
}

/* Print media */
@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    @page landscape {
        size: A4 landscape;
        margin: 0;
    }

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        width: 100%;
        background: #ffffff !important;
    }

    body {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print,
    .site-header,
    .site-footer,
    .messages,
    nav,
    header,
    footer {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: none !important;
    }

    .printing-page {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .printing-preview-section {
        margin: 0 !important;
        padding: 0 !important;
    }

    .print-preview {
        display: block !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        direction: ltr;
    }

    .print-page {
        width: 210mm !important;
        height: 297mm !important;
        min-width: 210mm !important;
        min-height: 297mm !important;
        max-width: 210mm !important;
        max-height: 297mm !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        padding: 10mm !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(var(--label-rows, 3), minmax(0, 1fr)) !important;
        gap: 6mm !important;
        background: #ffffff !important;
        box-shadow: none !important;
        overflow: hidden !important;
        page-break-after: always !important;
        break-after: page !important;
    }

    .print-page.orientation-landscape {
        width: 297mm !important;
        height: 210mm !important;
        min-width: 297mm !important;
        min-height: 210mm !important;
        max-width: 297mm !important;
        max-height: 210mm !important;
        page: landscape !important;
    }

    .print-page.orientation-landscape.labels-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    }

    .print-page.orientation-landscape.labels-5,
    .print-page.orientation-landscape.labels-6 {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    }

    .print-page.orientation-landscape.labels-7,
    .print-page.orientation-landscape.labels-8 {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        grid-template-rows: repeat(2, minmax(0, 1fr)) !important;
    }

    .print-page:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }

    .shipping-label {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
        border: 1.5px solid #000000 !important;
        border-radius: 0 !important;
        overflow: hidden !important;
        background: #ffffff !important;
        color: #000000 !important;
    }

    /* Final force for print */
    .shipping-label,
    .shipping-label * {
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ==========================================================================
   AUTHENTICATION
   ========================================================================== */

.auth-container {
    min-height: calc(100vh - 220px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 30px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.auth-header {
    margin-bottom: 24px;
    text-align: center;
}

.auth-header h2 {
    margin: 0;
    color: var(--text-heading);
    font-size: 26px;
    font-weight: 750;
}

.auth-header p {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
}

.form-container {
    width: 100%;
}

.form-field {
    margin-bottom: 18px;
}

.form-field label {
    margin-bottom: 7px;
}

.form-field input {
    width: 100%;
    max-width: none;
}

.form-container button[type="submit"] {
    width: 100%;
    margin-top: 5px;
}

.message-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

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

/* Login button shown in the navigation when logged out */

.login-nav-button {
    background: #2563eb !important;
    color: #ffffff !important;
}

.login-nav-button:hover {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}

/* ==========================================================================
   HEADER ACCOUNT / NAVIGATION LAYOUT
   ========================================================================== */

.header-inner {
    display: flex;
    align-items: center;
    width: 100%;
}

/* ==========================================================================
   ACCOUNT DROPDOWN (solid, simple)
   ========================================================================== */

.header-account {
    margin-left: 28px;
    position: relative;
    flex-shrink: 0;
}

.account-dropdown {
    position: relative;
}

.account-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.account-button:hover {
    background: var(--header-hover);
    color: white;
}

.account-icon {
    font-size: 16px;
}

.account-name {
    white-space: nowrap;
}

/* The dropdown panel itself */
.account-dropdown-content {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 210px;
    padding: 5px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.18);
    z-index: 3000;
}

.account-dropdown-content.open {
    display: block;
}

/* Header inside the dropdown */
.account-dropdown-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}

.account-dropdown-header strong {
    display: block;
    font-size: 14px;
    color: var(--text-heading);
}

.account-dropdown-header span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-muted);
}

.account-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Links */
.account-dropdown-content a {
    display: block;
    padding: 9px 12px;
    border-radius: 6px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.account-dropdown-content a:hover {
    background: var(--bg-surface-secondary);
    color: var(--link);
}

/* Logout button */
.account-logout-button {
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.account-logout-button:hover {
    background: #fee2e2;
}

[data-theme="dark"] .account-logout-button:hover {
    background: #7f1d1d;
}

/* Mobile */
@media (max-width: 700px) {
    .header-account {
        margin-left: 0;
        width: 100%;
    }

    .account-dropdown {
        width: 100%;
    }

    .account-button {
        width: 100%;
        justify-content: center;
        background: rgba(255, 255, 255, 0.06);
        height: 42px;
    }

    .account-button:hover {
        background: rgba(255, 255, 255, 0.12);
    }

    .account-dropdown-content {
        position: static;
        width: 100%;
        margin-top: 4px;
        box-shadow: none;
        background: var(--bg-surface);
    }

    .account-dropdown-content a,
    .account-logout-button {
        text-align: center;
    }
}

/* ==========================================================================
   EXPORT PAGE STYLES - Theme-aware
   ========================================================================== */

.export-checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.checkbox-option:hover {
    border-color: var(--border-input);
    background-color: var(--bg-surface-secondary);
}

.checkbox-option input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    accent-color: var(--link);
}

.checkbox-option span {
    font-size: 0.875rem;
    font-weight: 500;
}

.export-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    background-color: var(--bg-surface);
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.export-section-header {
    margin-bottom: 1.5rem;
}

.export-section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.export-section-header .form-help {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.export-columns {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.export-columns h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 0.75rem;
}

.export-column-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.export-column-grid .checkbox-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.813rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-field label {
    font-weight: 500;
    font-size: 0.813rem;
    color: var(--text-secondary);
}

.form-field input,
.form-field select {
    width: 100%;
    max-width: none;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-input);
    border-radius: 0.375rem;
    background-color: var(--input-bg);
    color: var(--text-main);
    font-size: 0.875rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-field input:hover,
.form-field select:hover {
    border-color: var(--text-muted);
}

.form-field input:focus,
.form-field select:focus {
    outline: none;
    border-color: var(--link);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

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

.form-field select {
    cursor: pointer;
}

.form-field select option {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

.form-help {
    font-size: 0.813rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

[data-theme="dark"] .checkbox-option {
    background-color: var(--bg-surface);
    border-color: var(--border);
}

[data-theme="dark"] .checkbox-option:hover {
    background-color: var(--bg-surface-secondary);
    border-color: var(--border-input);
}

[data-theme="dark"] .export-section {
    background-color: var(--bg-surface);
    border-color: var(--border);
}

[data-theme="dark"] .form-field input,
[data-theme="dark"] .form-field select {
    background-color: var(--input-bg);
    border-color: var(--border-input);
    color: var(--text-main);
}

[data-theme="dark"] .form-field select option {
    background-color: var(--bg-surface);
    color: var(--text-main);
}

[data-theme="dark"] .form-field input::placeholder {
    color: var(--text-muted);
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.form-section {
    margin-bottom: 1rem;
}

.form-section h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .export-column-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .export-checkbox-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .form-actions .button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .export-checkbox-grid {
        grid-template-columns: 1fr;
    }

    .export-section {
        padding: 1rem;
    }
}