/* dealer detail shared — invoice-detail & order-detail pages */

/* variables & reset */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img, svg {
    image-rendering: -webkit-optimize-contrast;
}

:root {
    --primary: #0265a1;
    --primary-dark: #004d80;
    --primary-light: #e6f0f8;
    --secondary: #1A1A2E;
    --accent: #00D4AA;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --white: #FFFFFF;

    /* design-system grays based on #414042 */
    --text-base: #414042;
    --text-secondary: rgba(65,64,66,0.7);
    --text-muted: rgba(65,64,66,0.6);
    --ring: rgba(65,64,66,0.2);
    --ring-light: rgba(65,64,66,0.1);

    /* legacy gray scale, kept for header/nav/footer compat */
    --gray-50: #f5f7fa;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    --font-main: 'Montserrat', Helvetica, Arial, sans-serif;
    --font-heading: 'Titillium Web', Helvetica, Arial, sans-serif;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    --radius: 6px;
    --radius-lg: 6px;
    --radius-xl: 6px;
    --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-base);
    background: var(--gray-50);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

/* header */
.header {
    background: #f5f7fa;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 24px;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    transition: height 0.3s ease;
}

.header.scrolled .header-top { height: 46px; }
.header.scrolled .logo img { height: 30px; }
.header.scrolled .logo-text { display: none; }
.header.scrolled .search-wrapper input { padding: 8px 16px 8px 40px; font-size: 13px; }
.header.scrolled .user-avatar { width: 28px; height: 28px; font-size: 11px; }
.header.scrolled .user-name { display: none; }
.header.scrolled .lang-dropdown-btn { padding: 5px 10px; font-size: 12px; }

.logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.logo img {
    height: 42px;
    width: auto;
    transition: height 0.3s ease;
}

.logo-text {
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease;
}

.logo-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    color: #1A1A2E;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 11px;
    font-weight: 500;
    color: #0265a1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-wrapper { position: relative; }

.search-wrapper input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-family: var(--font-main);
    background: var(--gray-50);
    transition: var(--transition);
}

.search-wrapper input:focus {
    outline: none;
    border-color: #0265a1;
    background: var(--white);
    box-shadow: 0 0 0 3px #e6f0f8;
}

.search-wrapper input::placeholder { color: var(--gray-400); }

.search-wrapper svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-dropdown-wrapper {
    position: relative;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px 6px 6px;
    background: var(--gray-100);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.user-dropdown:hover { background: var(--gray-200); }

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--white, #ffffff);
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown-wrapper:hover .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    transition: background 0.2s ease;
}

.user-dropdown-menu a:hover {
    background: #F3F4F6;
    color: #0265a1;
}

.user-dropdown-menu a svg {
    width: 18px;
    height: 18px;
    color: #6B7280;
}

.user-dropdown-menu a:hover svg {
    color: #0265a1;
}

.user-dropdown-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 0;
}

.user-dropdown-menu a.logout-link {
    color: #DC2626;
}

.user-dropdown-menu a.logout-link svg {
    color: #DC2626;
}

.user-dropdown-menu a.logout-link:hover {
    background: rgba(220, 38, 38, 0.05);
    color: #DC2626;
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0265a1, #004d80);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 13px;
    font-weight: 600;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

/* navigation */
.nav-wrapper {
    background: #0265a1;
    width: 100%;
}

.nav {
    display: flex;
    gap: 4px;
    padding: 12px 24px;
    max-width: 1600px;
    margin: 0 auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-family: 'Montserrat', Helvetica, Arial, Lucida, sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #FFFFFF;
    text-decoration: none;
    border-radius: var(--radius);
    transition: var(--transition);
}

.nav-link:hover { background: rgba(255, 255, 255, 0.15); color: #FFFFFF; }
.nav-link.active { background: rgba(255, 255, 255, 0.2); color: #FFFFFF; }
.nav-link svg { width: 18px; height: 18px; }

/* main layout */
.main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    flex: 1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* topbar */
.topbar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 18px;
    box-shadow: 0 0 0 1px var(--ring-light), var(--shadow-sm);
}
.topbar__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}
.hLeft { min-width: 0; flex: 1; }
.hLeft h1 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-base);
    margin: 0;
}

/* status chips */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    background: rgba(2,101,161,0.1);
    color: var(--text-base);
    white-space: nowrap;
    box-shadow: 0 0 0 1px rgba(2,101,161,0.25);
    border: none;
}
.chip .dot {
    width: 8px; height: 8px; border-radius: 50%;
    display: inline-block;
}
.chip.open .dot { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.chip.paid .dot { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.chip.completed .dot { background: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.chip.shipped .dot { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,.18); animation: blink 1.5s infinite; }
.chip.held .dot { background: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.chip.pending_review .dot { background: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.18); animation: blink 1.5s infinite; }
.chip.confirmed .dot { background: #10B981; box-shadow: 0 0 0 3px rgba(16,185,129,.18); }
.chip.rejected .dot { background: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.chip.submitted .dot { background: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }

.hMeta {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}
.hMeta strong { color: var(--text-secondary); font-weight: 600; }
.hMeta .sep { opacity: .5; margin: 0 8px; }

.hRight {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.total {
    text-align: right;
}
.total .lbl {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
}
.total .val {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-base);
    font-variant-numeric: tabular-nums;
    letter-spacing: -.3px;
}
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font-main);
    color: var(--primary);
    background: var(--white);
    border: 1px solid var(--gray-200);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}
.btn:hover { border-color: var(--primary); background: var(--gray-50); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* tiles row (facts bar) */
.tiles {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.tile {
    flex: 1 1 0;
    min-width: 130px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: 0 0 0 1px var(--ring-light), var(--shadow-sm);
    transition: background 150ms ease, box-shadow 150ms ease;
    cursor: default;
}
.tile:hover {
    background: rgba(2,101,161,0.06);
    box-shadow: 0 0 0 1px rgba(2,101,161,0.25), var(--shadow-sm);
}
.tile .t-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: rgba(2,101,161,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
}
.tile .t-icon svg {
    width: 18px;
    height: 18px;
}
.tile .t-text {
    min-width: 0;
}
.tile .t-lbl {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    line-height: 1.3;
}
.tile .t-val {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-base);
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}

/* panels */
.panel {
    background: var(--white);
    border-left: 2px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px var(--ring), var(--shadow-sm);
    overflow: hidden;
}
.panelHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    background: rgba(2,101,161,0.05);
    border-bottom: 1px solid var(--ring-light);
}
.panelHeader h2 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-base);
    margin: 0;
}
.panelBody { padding: 18px; }

/* address panels */
.address { line-height: 1.6; font-size: 13px; color: var(--text-secondary); }
.address strong { display: block; font-weight: 700; color: var(--text-base); margin-bottom: 2px; }
.address .sub { color: var(--text-muted); font-size: 12px; font-weight: 500; }

/* kv table (key-value) */
.kvTable {
    width: 100%;
    border-collapse: collapse;
}
.kvTable td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--ring-light);
    font-size: 13px;
    vertical-align: top;
}
.kvTable tr:last-child td { border-bottom: none; }
.kvTable td:first-child {
    color: var(--text-muted);
    font-weight: 600;
    width: 160px;
    white-space: nowrap;
}
.kvTable td:last-child {
    font-weight: 700;
    color: var(--text-base);
}

/* items table (line items) */
.tableWrap { overflow-x: auto; }
.items {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
}
.items th, .items td {
    padding: 11px 14px;
    border-bottom: 1px solid var(--ring-light);
    text-align: left;
    vertical-align: top;
    font-size: 13px;
}
.items th {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    font-weight: 700;
    background: rgba(2,101,161,0.1);
    position: sticky;
    top: 0;
    z-index: 1;
}
.items tbody tr:hover td { background: rgba(2,101,161,0.06); }
.num { text-align: right; white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.part {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 700;
    font-size: 12px;
    color: var(--primary);
}
.desc { color: var(--text-secondary); }
.lineTotalRow {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 14px;
    padding: 12px 18px;
    border-top: 1px solid var(--ring-light);
    background: rgba(2,101,161,0.05);
    font-weight: 700;
    font-size: 14px;
}
.lineTotalRow .lbl { color: var(--text-muted); font-weight: 600; }
.lineTotalRow .val { color: var(--text-base); font-variant-numeric: tabular-nums; }

/* summary table (financial) */
.sumTable {
    width: 100%;
    border-collapse: collapse;
}
.sumTable td {
    padding: 10px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--ring-light);
}
.sumTable tr:last-child td { border-bottom: none; }
.sumTable td:first-child {
    color: var(--text-muted);
    font-weight: 600;
}
.sumTable td:last-child {
    text-align: right;
    font-weight: 700;
    color: var(--text-base);
    font-variant-numeric: tabular-nums;
}
.sumTotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(2,101,161,0.1);
    border-radius: var(--radius);
    font-weight: 800;
    box-shadow: 0 0 0 1px rgba(2,101,161,0.3);
}
.sumTotal .lbl { color: var(--primary-dark); font-size: 13px; }
.sumTotal .val { font-size: 18px; color: var(--primary-dark); font-variant-numeric: tabular-nums; }

/* shipment cards & track drawer */
.shipList { display: grid; gap: 12px; }
.shipCard {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 0 0 1px var(--ring);
}
.shipRow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    font-size: 13px;
    flex-wrap: wrap;
}
.shipRow strong { color: var(--text-base); }
.shipRow .sub { color: var(--text-muted); font-size: 12px; }
.shipRow .btn { padding: 7px 12px; font-size: 12px; }

.trackDrawer {
    border-top: 1px solid var(--ring-light);
    background: var(--gray-50);
    padding: 16px;
}
.trackDrawer[hidden] { display: none; }

.trackGrid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 16px;
}
.trackMap {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    min-height: 300px;
    position: relative;
    background: #eef2f7;
}
.trackMap .leaflet-container { height: 100%; min-height: 300px; }
.trackMap-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: var(--gray-400);
    font-size: 13px;
    font-weight: 600;
}

.trackTimeline {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px;
}
.trackTimeline::-webkit-scrollbar { width: 4px; }
.trackTimeline::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }

.event {
    display: flex;
    gap: 12px;
    padding: 10px 0;
    position: relative;
}
.event:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 11px;
    top: 34px;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}
.event .dot {
    width: 24px; height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--gray-200);
    background: var(--white);
    z-index: 1;
}
.event .dot-inner {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gray-300);
}
.event:first-child .dot {
    border-color: var(--primary);
    background: var(--primary-light);
}
.event:first-child .dot-inner { background: var(--primary); }
.event.delivered .dot { border-color: #10B981; background: #d1fae5; }
.event.delivered .dot-inner { background: #10B981; }

.event-content { flex: 1; min-width: 0; }
.event-desc {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-base);
    line-height: 1.4;
}
.event-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.tracking-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.tracking-status-badge .status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.tracking-status-badge.delivered { background: #d1fae5; color: #065f46; }
.tracking-status-badge.delivered .status-dot { background: #10B981; }
.tracking-status-badge.in-transit { background: #dbeafe; color: #1e40af; }
.tracking-status-badge.in-transit .status-dot { background: #3b82f6; animation: blink 1.5s infinite; }
.tracking-status-badge.picked-up { background: #fef3c7; color: #92400e; }
.tracking-status-badge.picked-up .status-dot { background: #f59e0b; }
.tracking-status-badge.exception { background: #fee2e2; color: #991b1b; }
.tracking-status-badge.exception .status-dot { background: #ef4444; }
.tracking-status-badge.unknown { background: #f3f4f6; color: #4b5563; }
.tracking-status-badge.unknown .status-dot { background: #9ca3af; }

.tracking-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px 20px;
    color: var(--text-muted);
    font-size: 13px;
}
.tracking-loading .spinner { width: 24px; height: 24px; border-width: 2px; }

.tracking-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    color: #991b1b;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
}
.tracking-error svg { width: 20px; height: 20px; flex-shrink: 0; }

.mapToggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    margin-bottom: 10px;
}

/* empty state */
.empty {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 16px;
    border: 1px dashed var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-50);
    color: var(--text-muted);
}
.empty strong { color: var(--text-base); }
.empty .icon {
    width: 30px; height: 30px; border-radius: 10px;
    display: grid; place-items: center;
    flex: 0 0 auto;
}
.empty .icon svg { width: 16px; height: 16px; }

/* loading & error states */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
}

.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 200;
    background: rgba(249, 250, 251, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: loaderFadeIn 0.3s ease;
}

.page-loader.active {
    display: flex;
}

@keyframes loaderFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.loader-ring {
    position: relative;
    width: 90px;
    height: 90px;
}

.loader-ring > svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 90px;
    height: 90px;
    animation: loaderRotate 1.4s linear infinite;
}

.loader-ring circle {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke: var(--primary);
    stroke-dasharray: 150;
    stroke-dashoffset: 40;
    animation: loaderDash 1.4s ease-in-out infinite;
}

@keyframes loaderRotate {
    100% { transform: rotate(360deg); }
}

@keyframes loaderDash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

.loader-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 54px;
    height: auto;
    animation: loaderPulse 1.4s ease-in-out infinite;
}

@keyframes loaderPulse {
    0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.92); }
    50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

.loader-text {
    margin-top: 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.loader-dots::after {
    content: '';
    animation: loaderDots 1.5s steps(4, end) infinite;
}

@keyframes loaderDots {
    0% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-muted);
}

.error-state {
    text-align: center;
    padding: 80px 20px;
}

.error-state svg {
    width: 80px;
    height: 80px;
    color: var(--danger);
    margin-bottom: 20px;
}

.error-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-base);
    margin-bottom: 8px;
}

.error-state p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.error-retry-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: var(--transition);
}

.error-retry-btn:hover {
    background: var(--primary-dark);
}

/* language dropdown */
.language-dropdown { position: relative; }

.lang-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
    transition: var(--transition);
}

.lang-dropdown-btn:hover { border-color: var(--primary); background: var(--white); }
.language-dropdown.open .lang-dropdown-btn { border-color: var(--primary); background: var(--white); }
.globe-icon { color: var(--primary); }
.dropdown-arrow { transition: transform 0.2s ease; color: var(--gray-400); }
.language-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

.lang-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.language-dropdown.open .lang-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 13px;
    color: var(--gray-700);
    transition: background 0.2s ease;
    text-align: left;
}

.lang-option:first-child { border-radius: var(--radius) var(--radius) 0 0; }
.lang-option:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.lang-option:hover { background: var(--gray-100); }
.lang-option.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.lang-flag { font-size: 18px; line-height: 1; }
.lang-name { flex: 1; }

/* notification */
.notification {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 16px 20px;
    background: var(--gray-800);
    color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xl);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification.show { transform: translateY(0); opacity: 1; }
.notification-success { background: var(--success); }
.notification-error { background: var(--danger); }

/* mobile hamburger button (injected by dealer-mobile-nav.js) */
.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: var(--radius);
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 110;
}

.mobile-menu-btn span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-700);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
    position: absolute;
}

.mobile-menu-btn span:nth-child(1) { transform: translateY(-7px); }
.mobile-menu-btn span:nth-child(2) { transform: translateY(0); }
.mobile-menu-btn span:nth-child(3) { transform: translateY(7px); }

/* animate to X when open */
.mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg); }

/* mobile nav overlay */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-overlay.visible {
    opacity: 1;
}

/* responsive */

@media (max-width: 1100px) {
    .tiles { flex-wrap: wrap; }
    .tile { min-width: calc(33.333% - 8px); }
}

@media (max-width: 992px) {
    .header-search { display: none; }
}

@media (max-width: 980px) {
    .topbar__row { flex-direction: column; }
    .hRight { width: 100%; justify-content: flex-start; }
    .trackGrid { grid-template-columns: 1fr; }
}

/* tablet breakpoint */
@media (max-width: 768px) {
    html { font-size: 14px; }
    .header-inner { padding: 0 16px; }
    .header-top { height: 60px; }
    .logo-text { display: none; }
    /* phones: swap the full logo for the compact favicon mark.
       body-prefixed to beat the per-page inline .logo img rules. */
    body .logo img {
        content: url("../images/Magictilt_FavIconNew-Transparent.jpg");
        height: 40px;
        width: 40px;
        border-radius: 8px;
    }
    .user-name { display: none; }
    .main { padding: 16px; }

    /* show hamburger, hide desktop nav */
    .mobile-menu-btn { display: flex; }

    /* NOTE: the mobile nav drawer / overlay / .nav / .nav-link rules live in the
       single authoritative block further down (the `@media (max-width:768px)`
       around the `.nav-wrapper { z-index:400 }` rule). They were duplicated here
       with `body .nav-wrapper { z-index:100 }`, whose higher specificity beat the
       z-400 rule and dropped the drawer BELOW the z-399 scrim — making the open
       drawer untappable. Removed to leave one source of truth. */

    /* topbar */
    .topbar { padding: 16px; }
    .topbar__row { flex-direction: column; gap: 12px; }
    .hRight { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .total .val { font-size: 22px; }

    /* tiles */
    .tile { min-width: calc(50% - 6px); }

    /* panels */
    .panelHeader { padding: 12px 14px; }
    .panelBody { padding: 14px; }

    /* kv table */
    .kvTable td:first-child { width: auto; white-space: normal; }

    /* cart preview — full-width on mobile */
    .cart-preview {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        transform: translateY(100%);
    }

    .cart-btn-wrapper:hover .cart-preview,
    .cart-preview.show {
        transform: translateY(0);
    }

    /* user dropdown — click-based via JS .open class */
    .user-dropdown-menu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* buttons — larger touch targets */
    .btn { min-height: 44px; padding: 10px 16px; }
    .form-btn { min-height: 44px; }

    /* summary table */
    .sumTotal { flex-direction: column; text-align: center; gap: 4px; }
    .sumTotal .val { font-size: 20px; }

    /* shipment cards */
    .shipRow { flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 720px) {
    .tile { min-width: calc(50% - 6px); }
}

/* mobile breakpoint */
@media (max-width: 500px) {
    .tiles { flex-direction: column; }
    .tile { min-width: 100%; }

    /* header compact */
    .header-top { height: 56px; }
    .logo img { height: 32px; }
    .header-actions { gap: 8px; }

    /* nav drawer narrower */
    body .nav-wrapper { width: 260px; }

    /* stack buttons */
    .hRight { flex-direction: column; align-items: stretch; }
    .btn { width: 100%; justify-content: center; }

    /* Topbar */
    .topbar { padding: 12px; margin-bottom: 12px; }
    .hLeft h1 { font-size: 20px; }

    /* Panels */
    .panelHeader { padding: 10px 12px; flex-direction: column; gap: 8px; align-items: flex-start; }
    .panelBody { padding: 12px; }

    .lineTotalRow { padding: 10px 12px; gap: 8px; flex-wrap: wrap; }

    /* Notification repositioned for small screens */
    .notification { right: 12px; left: 12px; bottom: 12px; }
}

/* ── Shared modal responsive ── */
@media (max-width: 768px) {
    .modal-overlay { padding: 12px; }
    .modal { max-width: 100%; }
    .modal-header { padding: 16px; }
    .modal-body { padding: 16px; }
    .modal-footer { padding: 12px 16px; flex-wrap: wrap; }
    .modal-footer .form-btn { flex: 1; min-width: 0; }
    .modal-form-row { grid-template-columns: 1fr; }
}

/* ── Shared page-banner responsive ── */
@media (max-width: 768px) {
    .page-banner {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 20px 16px;
    }
    .page-banner-content h1 { font-size: 22px; }
    .page-banner-actions { width: 100%; flex-direction: column; }
    .banner-btn { width: 100%; justify-content: center; }
}

/* ── Shared filters responsive ── */
@media (max-width: 768px) {
    .filters-row { flex-direction: column; gap: 10px; }
    .filter-input { min-width: 100%; }
}

@media (max-width: 500px) {
    .status-grid { grid-template-columns: 1fr; gap: 10px; }
    .status-card { padding: 14px; }
    .status-value { font-size: 20px; }
}

/* Entry animations */
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.stagger > * { animation: fadeUp 800ms cubic-bezier(.25,.1,.25,1) both; }
.stagger > *:nth-child(1) { animation-delay: 100ms; }
.stagger > *:nth-child(2) { animation-delay: 250ms; }
.stagger > *:nth-child(3) { animation-delay: 400ms; }
.stagger > *:nth-child(4) { animation-delay: 550ms; }
.stagger > *:nth-child(5) { animation-delay: 700ms; }
.stagger > *:nth-child(6) { animation-delay: 850ms; }
@media (prefers-reduced-motion: reduce) { * { animation-duration: 1ms !important; transition-duration: 1ms !important; } }

/* ════════════════════════════════════════════════════════════════
   MOBILE UX — shared primitives
   Breakpoint contract: 1024px tablet · 768px tablet pivot · 480px phone.
   Colors use existing CSS vars, so dark mode is inherited automatically.
   ════════════════════════════════════════════════════════════════ */

/* Visibility helpers — opt-in show/hide by viewport */
.mobile-only { display: none; }
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    .mobile-only { display: revert; }
    .mobile-only.is-flex { display: flex; }
}

/* Form-grid utilities — collapse to one column on small screens */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 600px) {
    .form-grid-2,
    .form-grid-3 { grid-template-columns: 1fr; }
}

/* Horizontal-scroll affordance for wide tables that should not reflow */
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Data tables collapse into compact cards per page (each page styles its own
   row layout under @media max-width:768px). Shared helper to visually hide the
   header row when a table reflows — add class="cards-on-mobile" to the table. */
@media (max-width: 768px) {
    .cards-on-mobile thead {
        position: absolute;
        width: 1px; height: 1px;
        padding: 0; margin: -1px;
        overflow: hidden; clip: rect(0 0 0 0);
        white-space: nowrap; border: 0;
    }
}

/* Tablet grid coverage — fill the 768–1024px dead zone */
@media (max-width: 1024px) {
    .tile { min-width: calc(50% - 8px); }
}

/* Form ergonomics on touch devices — ≥16px inputs stop iOS zoom-on-focus */
@media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea { font-size: 16px; }
}

/* Modal — fit viewport, scroll body, survive the on-screen keyboard */
@media (max-width: 768px) {
    .modal {
        max-height: 92dvh;
        display: flex;
        flex-direction: column;
    }
    .modal-body {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto;
    }
}

/* Reclaim horizontal space on small phones */
@media (max-width: 480px) {
    .main { padding: 12px; }
    .panelBody { padding: 12px; }
}

/* Keep the header on a single row on phones. The language switcher's full
   label ("English"/"Español" + arrow) was pushing the header past the
   viewport and causing horizontal scroll — collapse it to its globe icon
   (tapping still opens the language menu). overflow-x:clip is a sticky-safe
   net (it doesn't create a scroll container, so the sticky header still works,
   and tables keep their own internal horizontal scroll). */
@media (max-width: 768px) {
    html { overflow-x: clip; }
    .header-actions { gap: 8px; }
    #languageToggleContainer .lang-dropdown-btn { padding: 8px; gap: 0; }
    #languageToggleContainer .lang-dropdown-btn .current-lang-text,
    #languageToggleContainer .lang-dropdown-btn .dropdown-arrow { display: none; }
}

/* Phones: language switcher + dark-mode toggle relocate to the footer
   (moved there by dealer-mobile-nav.js). Hidden by default; shown ≤768px. */
.footer-mobile-controls { display: none; }
@media (max-width: 768px) {
    .footer-mobile-controls {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
        padding: 16px;
        border-top: 1px solid var(--gray-200);
        flex-wrap: wrap;
    }
    /* there's room in the footer — restore the full language label */
    .footer-mobile-controls #languageToggleContainer { margin: 0; }
    .footer-mobile-controls #languageToggleContainer .lang-dropdown-btn { padding: 8px 14px; gap: 8px; }
    .footer-mobile-controls #languageToggleContainer .lang-dropdown-btn .current-lang-text,
    .footer-mobile-controls #languageToggleContainer .lang-dropdown-btn .dropdown-arrow { display: inline; }
    /* dropdown sits at the bottom of the page, so open it upward */
    .footer-mobile-controls #languageToggleContainer .lang-dropdown-menu {
        top: auto;
        bottom: calc(100% + 6px);
        right: auto;
        left: 0;
    }
}

/* footer */
.site-footer {
    background: #f5f7fa;
    border-top: 1px solid #e2e6ec;
    margin-top: 2rem;
}

.site-footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Main footer grid: logo | sitemap columns | social */
.site-footer__grid {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 3rem;
    padding: 2.5rem 0 2rem;
    align-items: start;
}

/* Team-portal footer: site map removed, only logo + payments/social remain */
.site-footer__grid--no-nav {
    grid-template-columns: 1fr auto;
}

/* Logo column */
.site-footer__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.site-footer__logo img {
    height: 34px;
    width: auto;
}

.site-footer__logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.3px;
}

/* Center sitemap columns */
.site-footer__nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.site-footer__nav-group h4 {
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.site-footer__nav-group a {
    display: block;
    font-size: 13px;
    color: #374151;
    text-decoration: none;
    padding: 4px 0;
    transition: color 0.2s ease;
}

.site-footer__nav-group a:hover {
    color: #0265a1;
}

/* Right column: payments + social */
.site-footer__right {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

/* Payment logos */
.site-footer__payments {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.site-footer__payments-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.site-footer__payments-row img {
    height: 80px;
    width: auto;
}

.site-footer__payments-ach {
    height: 17px;
    width: auto;
    border-radius: 3px;
}

/* Social column */
.site-footer__social {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.site-footer__social a {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.site-footer__social a:hover {
    opacity: 0.75;
}

.site-footer__social a img {
    width: 20px;
    height: 20px;
}

/* Bottom bar */
.site-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    border-top: 1px solid #e2e6ec;
}

.site-footer__copyright {
    color: #9ca3af;
    font-size: 12px;
    margin: 0;
}

.site-footer__legal {
    display: flex;
    gap: 1.5rem;
}

.site-footer__legal a {
    color: #9ca3af;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer__legal a:hover {
    color: #374151;
}

/* Footer Responsive — minimal mobile footer.
   The sitemap link columns duplicate the hamburger menu, so hide them on phones
   to cut the scroll; keep brand, social, payment badges, and the legal bottom bar,
   all centered. */
@media (max-width: 768px) {
    .site-footer__inner { padding: 0 16px; }
    .site-footer__grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
        padding: 1.75rem 0 1.25rem;
        justify-items: center;
        text-align: center;
    }
    /* drop the sitemap columns on mobile (already in the ☰ menu) */
    .site-footer__nav { display: none; }

    .site-footer__logo { justify-content: center; }

    .site-footer__right {
        flex-direction: column-reverse; /* social row on top, payment badges below */
        align-items: center;
        gap: 14px;
    }
    .site-footer__social {
        flex-direction: row;
        gap: 18px;
    }
    .site-footer__social a { width: 40px; height: 40px; } /* touch target */
    .site-footer__payments {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    .site-footer__payments-row {
        flex-direction: row;
        gap: 8px;
    }

    .site-footer__bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

/* ── Persistent Cart Icon (injected by dealer-cart-icon.js) ── */
.cart-btn { position: relative; }
.cart-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 20px; height: 20px; padding: 0 6px;
    background: var(--danger); color: var(--white);
    font-size: 11px; font-weight: 700; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
}
.cart-btn-wrapper { position: relative; }
.cart-preview {
    position: absolute; top: calc(100% + 10px); right: 0; width: 320px;
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: all 0.2s ease; z-index: 1000;
}
.cart-btn-wrapper:hover .cart-preview {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.cart-preview-header {
    padding: 14px 16px; border-bottom: 1px solid var(--gray-100);
    font-weight: 600; color: var(--gray-800);
    display: flex; justify-content: space-between; align-items: center;
}
.cart-preview-count { font-weight: 400; color: var(--gray-500); font-size: 13px; }
.cart-preview-items { max-height: 280px; overflow-y: auto; }
.cart-preview-empty { padding: 40px 16px; text-align: center; color: var(--gray-500); font-size: 14px; }
.cart-preview-item { padding: 12px 16px; border-bottom: 1px solid var(--gray-100); }
.cart-preview-item:last-child { border-bottom: none; }
.cart-preview-item-info { flex: 1; min-width: 0; }
.cart-preview-item-name {
    font-size: 13px; font-weight: 500; color: var(--gray-800);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.cart-preview-item-sku { font-size: 11px; color: var(--gray-400); margin-bottom: 8px; }
.cart-preview-item-row { display: flex; align-items: center; gap: 12px; }
.cart-preview-qty {
    display: flex; align-items: center; gap: 0;
    border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden;
}
.cart-preview-qty span {
    width: 32px; text-align: center; font-size: 13px; font-weight: 500;
    border-left: 1px solid var(--gray-200); border-right: 1px solid var(--gray-200); padding: 4px 0;
}
.cart-preview-item-price { font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; flex: 1; text-align: right; }
.cart-preview-footer {
    padding: 14px 16px; border-top: 1px solid var(--gray-100);
    background: var(--gray-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.cart-preview-total { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 14px; color: var(--gray-600); }
.cart-preview-total strong { color: var(--gray-800); }
.cart-preview-btn {
    display: block; width: 100%; padding: 10px;
    background: #0265a1; color: var(--white); text-align: center;
    text-decoration: none; border-radius: var(--radius);
    font-size: 14px; font-weight: 600; transition: var(--transition);
}
.cart-preview-btn:hover { background: #004d80; }

/* Dealer portal mobile shell
   These overrides sit in the shared stylesheet because most dealer pages repeat
   header/nav CSS inline. Keep selectors broad enough to catch those pages, but
   scoped to portal layout classes so the public site is untouched. */
.mobile-menu-btn,
.nav-overlay {
    display: none;
}

@media (max-width: 768px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        min-width: 0;
    }

    .header {
        z-index: 300;
    }

    .header-inner {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 14px !important;
    }

    .header-top {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        height: 64px !important;
        min-height: 64px;
        align-items: center;
    }

    .header-top.has-mobile-nav {
        grid-template-columns: 44px minmax(0, 1fr) auto;
    }

    .mobile-menu-btn {
        width: 44px;
        height: 44px;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        border: 1px solid var(--gray-200, #e5e7eb);
        border-radius: 6px;
        background: var(--white, #fff);
        color: #0265a1;
        cursor: pointer;
        flex-shrink: 0;
        box-shadow: var(--shadow-sm, 0 1px 2px rgb(0 0 0 / 0.05));
    }

    .mobile-menu-btn span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .mobile-menu-btn.open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .mobile-menu-btn.open span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .logo {
        min-width: 0;
        gap: 10px !important;
    }

    .logo img {
        height: 34px !important;
        max-width: 145px;
        object-fit: contain;
    }

    .logo-text {
        min-width: 0;
    }

    .logo-title,
    .logo-subtitle {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .logo-title {
        font-size: 13px !important;
    }

    .logo-subtitle {
        font-size: 10px !important;
    }

    .header-search {
        display: none !important;
    }

    .header-actions {
        min-width: 0;
        gap: 6px !important;
        justify-content: flex-end;
    }

    .header-btn,
    .theme-toggle-btn,
    .lang-dropdown-btn,
    .cart-btn,
    .user-dropdown {
        min-width: 40px;
        min-height: 40px;
    }

    .header-btn,
    .user-dropdown {
        padding: 6px !important;
    }

    .header-btn span,
    .user-name,
    .lang-label,
    .lang-dropdown-btn span:not(.flag-icon) {
        display: none !important;
    }

    .user-dropdown-menu,
    .cart-preview,
    .language-menu,
    .language-dropdown-menu {
        right: 0 !important;
        left: auto !important;
        width: min(320px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        z-index: 1200 !important;
    }

    .user-dropdown-menu.open,
    .cart-preview.show {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        display: none;
        background: rgba(17, 24, 39, 0.42);
        opacity: 0;
        transition: opacity 0.2s ease;
        z-index: 399;
    }

    .nav-overlay.visible {
        display: block;
        opacity: 1;
    }

    .nav-wrapper {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(86vw, 340px) !important;
        max-width: 340px !important;
        height: 100dvh;
        overflow-y: auto;
        overscroll-behavior: contain;
        background: #0265a1 !important;
        box-shadow: 18px 0 40px rgba(0, 0, 0, 0.2);
        transform: translateX(-105%);
        transition: transform 0.24s ease;
        z-index: 400;
        padding-top: 12px;
    }

    .nav-wrapper.open {
        transform: translateX(0);
    }

    .nav {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 4px !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 12px !important;
        overflow: visible !important;
    }

    .nav-link {
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 13px 14px !important;
        border-radius: 6px !important;
        white-space: normal !important;
        line-height: 1.25 !important;
    }

    .nav-link svg {
        flex: 0 0 auto;
    }

    .nav-dropdown-wrapper,
    .nav-dropdown {
        width: 100% !important;
    }

    .nav-dropdown-menu {
        position: static !important;
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        margin: 2px 0 8px !important;
        padding: 4px !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 6px !important;
        background: rgba(255, 255, 255, 0.08) !important;
        box-shadow: none !important;
    }

    .nav-dropdown-item {
        align-items: center !important;
        gap: 10px !important;
        min-height: 42px;
        padding: 10px 12px !important;
        color: #fff !important;
        border-radius: 5px !important;
        white-space: normal !important;
    }

    .nav-dropdown-item svg {
        color: currentColor !important;
        flex-shrink: 0;
    }

    .nav-dropdown-item.active,
    .nav-dropdown-item:hover {
        color: #fff !important;
        background: rgba(255, 255, 255, 0.16) !important;
    }

    .main,
    main,
    .dashboard-main,
    .content-area,
    .account-main,
    .checkout-main,
    .cart-main,
    .parts-main,
    .orders-main,
    .invoices-main,
    .resources-main,
    .service-main {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        overflow-x: clip;
    }

    .container,
    .page-container,
    .dashboard-container,
    .content-container {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .page-banner,
    .page-header,
    .summary,
    .topbar,
    .panel,
    .card,
    .dashboard-card,
    .filters-card,
    .checkout-card,
    .cart-card {
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .page-banner,
    .page-header,
    .topbar__row,
    .summary {
        align-items: stretch !important;
    }

    .page-banner-actions,
    .page-header-actions,
    .summary-actions,
    .filters-row,
    .filter-row,
    .toolbar,
    .actions-row,
    .button-row {
        width: 100% !important;
        min-width: 0 !important;
        flex-wrap: wrap !important;
    }

    .page-banner-actions > *,
    .page-header-actions > *,
    .summary-actions > *,
    .filters-row > *,
    .filter-row > * {
        min-width: 0 !important;
    }

    .status-grid,
    .kpi-row,
    .stats-grid,
    .quick-actions,
    .quick-actions-grid,
    .main-grid,
    .cards-grid,
    .parts-grid,
    .resource-grid,
    .form-grid,
    .checkout-grid,
    .cart-grid,
    .address-grid {
        grid-template-columns: 1fr !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .table-wrap,
    .table-wrapper,
    .table-container,
    .tableWrap,
    .orders-table-wrap,
    .invoices-table-wrap {
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    table {
        max-width: 100%;
    }

    input,
    select,
    textarea,
    button {
        max-width: 100%;
    }

    .modal,
    .product-modal,
    .drawer,
    .slide-panel {
        max-width: 100vw !important;
    }
}

@media (max-width: 480px) {
    .header-inner {
        padding: 0 10px !important;
    }

    .header-top {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .header-top.has-mobile-nav {
        grid-template-columns: 42px minmax(0, 1fr) auto;
    }

    .mobile-menu-btn {
        width: 42px;
        height: 42px;
    }

    .logo img {
        max-width: 118px;
    }

    .header-actions {
        gap: 4px !important;
    }

    .user-avatar {
        width: 30px !important;
        height: 30px !important;
        font-size: 11px !important;
    }

    .cart-preview,
    .user-dropdown-menu,
    .language-menu,
    .language-dropdown-menu {
        position: fixed !important;
        top: 58px !important;
        right: 10px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
    }
}
