/* ============================================================
       DESIGN SYSTEM (Logistics/Emerald Theme)
       ============================================================ */
    :root {
      --bg: #07080a;
      --bg-2: #0e1014;
      --panel: #14171d;
      --panel-hover: #1c2028;
      --line: #22262f;
      --line-light: #2c323f;
      --ink: #f3f4f2;
      --ink-2: #cdd0d5;
      --muted: #8a8d95;
      
      /* Logistics Accent - Premium Emerald */
      --accent: #10b981;
      --accent-glow: rgba(16, 185, 129, 0.4);
      --accent-dim: rgba(16, 185, 129, 0.12);
      --accent-ink: #07080a;
      
      --success: #10b981;
      --success-dim: rgba(16, 185, 129, 0.12);
      --warning: #fbbf24;
      --warning-dim: rgba(251, 191, 36, 0.12);
      --danger: #ef4444;
      --danger-dim: rgba(239, 68, 68, 0.12);
      --info: #3b82f6;
      --info-dim: rgba(59, 130, 246, 0.12);
      
      --sidebar-w: 260px;
      --header-h: 64px;
      --r: 12px;
      --r-sm: 8px;
      --shadow: 0 8px 32px rgba(0,0,0,.4);
      --shadow-lg: 0 24px 64px rgba(0,0,0,.55);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      background: var(--bg);
      color: var(--ink);
      font-family: "Archivo", system-ui, sans-serif;
      -webkit-font-smoothing: antialiased;
      line-height: 1.5;
      overflow-x: hidden;
      min-height: 100vh;
    }
    a { color: inherit; text-decoration: none; }
    button { font-family: inherit; cursor: pointer; }
    input, select, textarea { font-family: inherit; }

    /* Scrollbars */
    ::-webkit-scrollbar { width: 6px; height: 6px; }
    ::-webkit-scrollbar-track { background: var(--bg); }
    ::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
    ::-webkit-scrollbar-thumb:hover { background: var(--muted); }

    /* ============================================================
       LOGIN SCREEN
       ============================================================ */
    #loginScreen {
      position: fixed; inset: 0; background: var(--bg);
      display: flex; align-items: center; justify-content: center; z-index: 100;
      padding: 20px;
      background-image: 
        radial-gradient(circle at 15% 25%, rgba(16, 185, 129, 0.15), transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(59, 130, 246, 0.06), transparent 45%),
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
      background-size: 100% 100%, 100% 100%, 30px 30px, 30px 30px;
    }
    
    .login-card {
      background: var(--panel);
      border: 1px solid var(--line);
      border-radius: var(--r);
      padding: 40px;
      width: 100%;
      max-width: 420px;
      box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.05);
      animation: loginIn .6s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    
    @keyframes loginIn {
      from { opacity: 0; transform: translateY(20px); }
      to { opacity: 1; transform: translateY(0); }
    }
    
    .login-logo {
      text-align: center; margin-bottom: 32px;
    }
    .login-logo img {
      height: 38px; margin: 0 auto 12px; filter: brightness(0) invert(1);
    }
    .login-logo .login-badge {
      display: inline-block; font-family: "Saira Condensed"; font-weight: 700;
      font-size: 10px; color: var(--accent); border: 1px solid var(--accent-dim);
      background: var(--accent-dim); border-radius: 99px; padding: 2px 10px;
      text-transform: uppercase; letter-spacing: .12em; margin-bottom: 12px;
    }
    .login-logo h2 {
      font-family: "Saira Condensed"; font-weight: 800; font-size: 26px;
      text-transform: uppercase; letter-spacing: .06em; line-height: 1.1;
    }
    .login-logo p { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
    
    .form-group { margin-bottom: 18px; }
    .form-group label {
      display: block; font-family: "Saira Condensed"; font-weight: 700;
      font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
      color: var(--muted); margin-bottom: 6px;
    }
    .form-input, .form-textarea {
      width: 100%; background: var(--bg-2); border: 1px solid var(--line);
      border-radius: var(--r-sm); padding: 10px 14px; color: var(--ink);
      font-size: 14px; outline: none; transition: border-color .15s;
    }
    .form-input:focus, .form-textarea:focus { border-color: var(--accent); }
    .form-textarea { resize: vertical; min-height: 80px; }
    
    .login-btn {
      width: 100%; background: var(--accent); color: var(--accent-ink);
      border: none; border-radius: var(--r-sm); padding: 12px;
      font-family: "Saira Condensed"; font-weight: 700; font-size: 15px;
      text-transform: uppercase; letter-spacing: .1em; margin-top: 10px;
      transition: all 0.2s;
    }
    .login-btn:hover { background: #14d394; transform: translateY(-1px); box-shadow: 0 4px 12px var(--accent-glow); }
    .login-btn:active { transform: translateY(0); }
    .login-error { color: var(--danger); font-size: 13px; margin-top: 12px; text-align: center; font-weight: 500; }

    /* ============================================================
       APP SHELL LAYOUT
       ============================================================ */
    #appShell { display: none; min-height: 100vh; position: relative; }
    #appShell.active { display: block; }
    
    /* Sidebar */
    .sidebar {
      position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar-w);
      background: var(--panel); border-right: 1px solid var(--line);
      display: flex; flex-direction: column; transition: transform .3s;
      z-index: 40;
    }
    .sidebar-logo {
      height: var(--header-h); padding: 0 24px; display: flex; align-items: center; gap: 8px;
      border-bottom: 1px solid var(--line);
    }
    .sidebar-logo img { height: 26px; filter: brightness(0) invert(1); }
    .sidebar-logo .s-badge {
      font-family: "Saira Condensed"; font-weight: 700; font-size: 10px;
      background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent-glow);
      padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .06em;
    }
    .sidebar-nav { flex: 1; padding: 24px 16px; overflow-y: auto; }
    .nav-section {
      font-family: "Saira Condensed"; font-weight: 700; font-size: 11px;
      text-transform: uppercase; letter-spacing: .12em; color: var(--muted);
      margin: 20px 0 8px 8px;
    }
    .nav-section:first-child { margin-top: 0; }
    .nav-item {
      display: flex; align-items: center; gap: 12px; width: 100%;
      background: none; border: none; padding: 10px 12px; border-radius: var(--r-sm);
      color: var(--ink-2); font-size: 14px; text-align: left; transition: .15s;
      font-family: inherit; margin-bottom: 2px;
    }
    .nav-item:hover { background: var(--panel-hover); color: var(--ink); }
    .nav-item.active { background: var(--accent-dim); color: var(--accent); font-weight: 600; }
    .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
    .nav-badge {
      margin-left: auto; background: var(--accent); color: var(--accent-ink);
      font-family: "Saira Condensed"; font-weight: 700; font-size: 11px;
      padding: 1px 6px; border-radius: 99px; min-width: 18px; text-align: center;
    }
    .sidebar-footer {
      padding: 16px 20px; border-top: 1px solid var(--line);
      display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.1);
    }
    .avatar {
      width: 34px; height: 34px; border-radius: 50%; background: var(--accent);
      color: var(--accent-ink); display: flex; align-items: center; justify-content: center;
      font-family: "Saira Condensed"; font-weight: 800; font-size: 16px;
    }
    .user-info { flex: 1; min-width: 0; }
    .user-name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .user-role { font-size: 11px; color: var(--muted); }
    .logout-btn {
      background: none; border: none; color: var(--muted); padding: 6px;
      border-radius: var(--r-sm); transition: .15s;
    }
    .logout-btn:hover { background: var(--panel-hover); color: var(--danger); }
    .logout-btn svg { width: 16px; height: 16px; }

    /* Main Area */
    .main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
    .topheader {
      height: var(--header-h); background: var(--panel); border-bottom: 1px solid var(--line);
      display: flex; align-items: center; justify-content: space-between; padding: 0 32px;
      position: sticky; top: 0; z-index: 30;
    }
    .page-title {
      font-family: "Saira Condensed"; font-weight: 800; font-size: 22px;
      text-transform: uppercase; letter-spacing: .06em;
    }
    .page-title span { color: var(--accent); }
    
    .header-actions { display: flex; align-items: center; gap: 16px; }
    
    /* Search Bar */
    .header-search {
      display: flex; align-items: center; gap: 10px; background: var(--bg-2);
      border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px;
      width: 240px; transition: border-color .15s, width .2s;
    }
    .header-search:focus-within { border-color: var(--accent); width: 300px; }
    .header-search svg { width: 14px; height: 14px; color: var(--muted); }
    .header-search input {
      background: none; border: none; color: var(--ink); font-size: 13px;
      outline: none; width: 100%;
    }
    
    /* Content Container */
    .content { flex: 1; padding: 32px; width: 100%; max-width: 1400px; margin: 0 auto; }
    .view { display: none; }
    .view.active { display: block; animation: fadeIn .3s ease-out; }
    
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(4px); }
      to { opacity: 1; transform: translateY(0); }
    }

    /* ============================================================
       COMPONENTS & WIDGETS
       ============================================================ */
    /* Metric Cards */
    .dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 28px; }
    .kpi-card {
      background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
      padding: 24px; display: flex; align-items: center; gap: 20px;
      box-shadow: var(--shadow); position: relative; overflow: hidden;
      transition: transform .2s, border-color .2s;
    }
    .kpi-card:hover { transform: translateY(-2px); border-color: var(--line-light); color: var(--ink); }
    .kpi-card::after {
      content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
      background: var(--line); transition: background-color .2s;
    }
    .kpi-card.accent::after { background: var(--accent); }
    .kpi-card.warning::after { background: var(--warning); }
    .kpi-card.info::after { background: var(--info); }
    
    .kpi-icon {
      width: 48px; height: 48px; border-radius: var(--r-sm);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0;
    }
    .kpi-card.accent .kpi-icon { background: var(--accent-dim); color: var(--accent); }
    .kpi-card.warning .kpi-icon { background: var(--warning-dim); color: var(--warning); }
    .kpi-card.info .kpi-icon { background: var(--info-dim); color: var(--info); }
    .kpi-icon svg { width: 22px; height: 22px; }
    .kpi-meta { flex: 1; }
    .kpi-val {
      font-family: "Saira Condensed"; font-weight: 800; font-size: 28px;
      line-height: 1.1; margin-bottom: 2px;
    }
    .kpi-label { font-size: 12px; color: var(--muted); text-transform: uppercase; font-weight: 500; }

    /* Layout Sections */
    .section-header {
      display: flex; align-items: center; justify-content: space-between;
      margin-bottom: 20px; gap: 16px;
    }
    .section-header h3 {
      font-family: "Saira Condensed"; font-weight: 800; font-size: 20px;
      text-transform: uppercase; letter-spacing: .06em;
    }
    .section-header h3 span { color: var(--accent); }
    
    /* Filter Bar */
    .filter-bar {
      display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
    }
    .filter-search {
      display: flex; align-items: center; gap: 8px; background: var(--panel);
      border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 12px;
      flex: 1; min-width: 200px; max-width: 400px;
    }
    .filter-search svg { width: 14px; height: 14px; color: var(--muted); }
    .filter-search input {
      background: none; border: none; color: var(--ink); font-size: 13.5px;
      outline: none; width: 100%;
    }
    .filter-select {
      background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
      padding: 8px 14px; color: var(--ink); font-size: 13.5px; outline: none;
      cursor: pointer;
    }
    .filter-count { font-size: 13px; color: var(--muted); margin-left: auto; }

    /* Tables/Lists Grid */
    .list-container {
      background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
      overflow: hidden; box-shadow: var(--shadow);
    }
    .list-header, .list-row {
      display: grid; padding: 14px 24px; align-items: center; gap: 16px;
    }
    .list-header {
      background: rgba(0,0,0,0.15); border-bottom: 1px solid var(--line);
      font-family: "Saira Condensed"; font-weight: 700; font-size: 12px;
      text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
    }
    .list-row {
      border-bottom: 1px solid var(--line); font-size: 14px; cursor: pointer; transition: .1s;
    }
    .list-row:last-child { border-bottom: none; }
    .list-row:hover { background: var(--panel-hover); }
    
    /* Grids definitions */
    .ship-grid { grid-template-columns: 100px 1.5fr 1fr 1fr 100px 100px 60px; }
    .deliv-grid { grid-template-columns: 100px 1.5fr 1.2fr 100px 110px 60px; }
    
    .ship-id, .deliv-id { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--accent); }
    .ship-items, .deliv-items { font-family: "Saira Condensed"; font-weight: 700; font-size: 15px; }

    /* Badges */
    .badge {
      display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 4px;
      font-family: "Saira Condensed"; font-weight: 700; font-size: 11px;
      text-transform: uppercase; letter-spacing: .04em; border: 1px solid transparent;
    }
    .badge-success { background: var(--success-dim); color: var(--success); border-color: rgba(16,185,129,.15); }
    .badge-warning { background: var(--warning-dim); color: var(--warning); border-color: rgba(251,191,36,.15); }
    .badge-danger { background: var(--danger-dim); color: var(--danger); border-color: rgba(239,68,68,.15); }
    .badge-info { background: var(--info-dim); color: var(--info); border-color: rgba(59,130,246,.15); }
    .badge-muted { background: rgba(255,255,255,0.03); color: var(--muted); border-color: var(--line); }
    .badge-accent { background: var(--accent-dim); color: var(--accent); border-color: var(--accent-glow); }

    /* Empty state */
    .empty-state {
      text-align: center; padding: 60px 40px;
    }
    .empty-state svg { width: 48px; height: 48px; color: var(--line-light); margin-bottom: 16px; }
    .empty-state h4 {
      font-family: "Saira Condensed"; font-weight: 700; font-size: 18px;
      text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px;
    }
    .empty-state p { color: var(--muted); font-size: 14px; max-width: 320px; margin: 0 auto; }

    /* Buttons */
    .btn-primary, .btn-secondary {
      display: inline-flex; align-items: center; gap: 8px; justify-content: center;
      padding: 10px 18px; border-radius: var(--r-sm); font-family: "Saira Condensed";
      font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .06em;
      transition: all .15s; border: none;
    }
    .btn-primary { background: var(--accent); color: var(--accent-ink); }
    .btn-primary:hover { background: #14d394; box-shadow: 0 4px 12px var(--accent-glow); }
    
    .btn-secondary { background: none; border: 1px solid var(--line); color: var(--ink-2); }
    .btn-secondary:hover { background: var(--panel-hover); border-color: var(--line-light); color: var(--ink); }
    
    .btn-icon {
      background: none; border: none; color: var(--muted); display: inline-flex;
      align-items: center; justify-content: center; padding: 6px; border-radius: 4px;
      transition: .15s;
    }
    .btn-icon:hover { background: var(--panel-hover); color: var(--ink); }
    .btn-icon svg { width: 16px; height: 16px; }

    /* ============================================================
       DETAIL PANEL
       ============================================================ */
    .back-btn {
      display: inline-flex; align-items: center; gap: 6px; color: var(--muted);
      font-family: "Saira Condensed"; font-weight: 600; font-size: 14px;
      text-transform: uppercase; letter-spacing: .06em; margin-bottom: 20px;
      background: none; border: none; transition: .15s; padding: 0;
    }
    .back-btn:hover { color: var(--accent); }
    .back-btn svg { width: 16px; height: 16px; }

    .detail-panel {
      background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
      box-shadow: var(--shadow-lg); overflow: hidden;
    }
    .detail-header {
      padding: 24px 28px; border-bottom: 1px solid var(--line);
      display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
      background: rgba(0,0,0,0.1);
    }
    .detail-header h3 {
      font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 22px;
    }
    
    /* Timeline */
    .status-timeline {
      display: flex; justify-content: space-between; padding: 24px 28px;
      border-bottom: 1px solid var(--line); background: rgba(0,0,0,0.05);
      flex-wrap: wrap; gap: 16px;
    }
    .st-step {
      display: flex; align-items: center; gap: 8px; flex: 1; min-width: 100px;
      position: relative;
    }
    .st-dot {
      width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-light);
      background: var(--panel); display: flex; align-items: center; justify-content: center;
      transition: .2s; color: transparent;
    }
    .st-dot svg { width: 12px; height: 12px; stroke-width: 4px; }
    .st-label {
      font-family: "Saira Condensed"; font-weight: 700; font-size: 13px;
      text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
      transition: .2s;
    }
    .st-step.done .st-dot { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
    .st-step.done .st-label { color: var(--ink); }
    .st-step.active .st-dot { border-color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
    .st-step.active .st-label { color: var(--accent); }

    .detail-meta {
      display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line);
    }
    .detail-meta-item label {
      display: block; font-family: "Saira Condensed"; font-weight: 600;
      font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
      color: var(--muted); margin-bottom: 4px;
    }
    .detail-meta-item span { font-weight: 600; font-size: 15px; }

    /* Detail items list */
    .detail-items { padding: 24px 28px; }
    .detail-item-row {
      display: flex; align-items: center; gap: 16px; padding: 12px 0;
      border-bottom: 1px solid var(--line);
    }
    .detail-item-row:last-child { border-bottom: none; }
    .detail-item-thumb {
      width: 44px; height: 44px; border-radius: var(--r-sm); background: #fff;
      padding: 4px; display: flex; align-items: center; justify-content: center;
      border: 1px solid var(--line); flex-shrink: 0;
    }
    .detail-item-thumb img { max-height: 100%; object-fit: contain; }
    
    .inv-thumb {
      width: 44px; height: 44px; border-radius: var(--r-sm); background: #fff;
      display: flex; align-items: center; justify-content: center; flex-shrink: 0;
      border: 1px solid var(--line); overflow: hidden;
    }
    .inv-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
    
    /* ============================================================
       MODAL SYSTEM
       ============================================================ */
    .modal-overlay {
      position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6);
      backdrop-filter: blur(8px); display: none; align-items: center;
      justify-content: center; z-index: 50; padding: 20px;
    }
    .modal-overlay.active { display: flex; }
    
    .modal {
      background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
      box-shadow: var(--shadow-lg); width: 100%; max-width: 500px;
      display: flex; flex-direction: column; overflow: hidden;
      animation: modalUp .3s cubic-bezier(0.16, 1, 0.3, 1) both;
    }
    @keyframes modalUp {
      from { opacity: 0; transform: scale(0.95) translateY(10px); }
      to { opacity: 1; transform: scale(1) translateY(0); }
    }
    .modal-header {
      padding: 18px 24px; border-bottom: 1px solid var(--line);
      display: flex; align-items: center; justify-content: space-between;
    }
    .modal-header h3 {
      font-family: "Saira Condensed"; font-weight: 700; font-size: 18px;
      text-transform: uppercase; letter-spacing: .06em;
    }
    .modal-close {
      background: none; border: none; color: var(--muted); font-size: 22px; line-height: 1;
      transition: .15s;
    }
    .modal-close:hover { color: var(--ink); }
    .modal-body { padding: 24px; overflow-y: auto; max-height: 70vh; }
    .modal-footer {
      padding: 16px 24px; border-top: 1px solid var(--line);
      display: flex; justify-content: flex-end; gap: 12px; background: rgba(0,0,0,0.1);
    }
    
    /* Form row */
    .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
    .form-row .form-group { margin-bottom: 0; }

    /* ============================================================
       TOASTS
       ============================================================ */
    .toast-container {
      position: fixed; bottom: 24px; right: 24px; z-index: 100;
      display: flex; flex-direction: column; gap: 10px; pointer-events: none;
    }
    .toast {
      background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
      padding: 12px 18px; display: flex; align-items: center; gap: 12px;
      box-shadow: var(--shadow-lg); pointer-events: auto; min-width: 260px;
      max-width: 400px; animation: toastIn .3s ease-out both;
    }
    @keyframes toastIn {
      from { opacity: 0; transform: translateX(30px); }
      to { opacity: 1; transform: translateX(0); }
    }
    .toast.out {
      animation: toastOut .25s ease-in both;
    }
    @keyframes toastOut {
      to { opacity: 0; transform: translateX(30px); }
    }
    .toast-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
    .toast-icon svg { width: 100%; height: 100%; }
    .toast-msg { font-size: 13.5px; font-weight: 500; flex: 1; color: var(--ink-2); }
    .toast-close {
      background: none; border: none; color: var(--muted); font-size: 18px;
      cursor: pointer; line-height: 1;
    }
    .toast-close:hover { color: var(--ink); }

    /* Dashboard Activity */
    .log-list { display: flex; flex-direction: column; gap: 10px; }
    .log-row {
      background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm);
      padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 16px;
    }
    .log-desc { font-size: 13.5px; color: var(--ink-2); }
    .log-time { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

    /* Mobile Burguer */
    .mobile-burger {
      display: none; background: none; border: none; color: var(--ink);
      padding: 6px; border-radius: 4px; transition: .1s; margin-right: 12px;
    }
    .mobile-burger:hover { background: var(--panel-hover); }
    .mobile-burger svg { width: 22px; height: 22px; }
    .mobile-overlay {
      display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
      z-index: 35;
    }
    .mobile-overlay.active { display: block; }

    /* ============================================================
       RESPONSIVE DESIGN
       ============================================================ */
    @media (max-width: 900px) {
      .sidebar { transform: translateX(-100%); z-index: 50; }
      .sidebar.open { transform: none; }
      .main { margin-left: 0; }
      .mobile-burger { display: block; }
      .mobile-overlay.active { display: block; }
      .dash-grid { grid-template-columns: 1fr; }
      .ship-grid { grid-template-columns: 80px 1.2fr 1fr 100px 50px; }
      .ship-grid .ship-ordered-col, .ship-grid .ship-items-col { display: none; }
      .deliv-grid { grid-template-columns: 80px 1.2fr 100px 50px; }
      .deliv-grid .deliv-date-col, .deliv-grid .deliv-items-col { display: none; }
      .header-search { display: none; }
      .content { padding: 20px 16px; }
    }
    
    @media (max-width: 600px) {
      .detail-meta { grid-template-columns: 1fr 1fr; }
      .status-timeline { flex-direction: column; gap: 10px; }
      .st-step { border-left: 2px solid var(--line); padding-left: 14px; }
      .st-dot { position: absolute; left: -13px; top: 0; }
    }
    
    /* ============================================================
       LIGHT MODE & THEME TOGGLE BUTTON OVERRIDES
       ============================================================ */
    .theme-toggle-btn {
      background: var(--panel); border: 1px solid var(--line);
      color: var(--ink); width: 40px; height: 40px; border-radius: var(--r-sm);
      display: flex; align-items: center; justify-content: center; transition: .18s;
      cursor: pointer;
      position: relative;
      overflow: hidden;
      flex-shrink: 0;
      min-width: 40px;
    }
    .theme-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
    .theme-toggle-btn svg { width: 20px; height: 20px; }

    :root.light-mode, html.light-mode {
      --bg: #f4f6f8;
      --bg-2: #eaedf1;
      --panel: #ffffff;
      --panel-hover: #f1f3f6;
      --line: #e1e4e9;
      --line-light: #cfd3dc;
      --ink: #0e1116;
      --ink-2: #3a3f47;
      --muted: #6e737e;
      --accent: #059669;
      --accent-glow: rgba(5, 150, 105, 0.25);
      --accent-dim: rgba(5, 150, 105, 0.08);
      --accent-ink: #ffffff;
      --success: #059669;
      --success-dim: rgba(5, 150, 105, 0.08);
      --warning: #d97706;
      --warning-dim: rgba(217, 119, 6, 0.08);
      --danger: #dc2626;
      --danger-dim: rgba(220, 38, 38, 0.08);
      --info: #2563eb;
      --info-dim: rgba(37, 99, 235, 0.08);
      --shadow: 0 8px 32px rgba(0,0,0,.06);
      --shadow-lg: 0 16px 48px rgba(0,0,0,.1);
    }
    :root.light-mode .sidebar-logo img,
    :root.light-mode .login-logo img,
    html.light-mode .sidebar-logo img,
    html.light-mode .login-logo img {
      filter: none;
    }
    :root.light-mode #loginScreen,
    html.light-mode #loginScreen {
      background-image: 
        radial-gradient(circle at 15% 25%, rgba(5, 150, 105, 0.08), transparent 50%),
        radial-gradient(circle at 85% 75%, rgba(37, 99, 235, 0.03), transparent 45%),
        linear-gradient(rgba(0, 0, 0, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.01) 1px, transparent 1px);
    }
    :root.light-mode .login-card,
    html.light-mode .login-card {
      background: var(--panel);
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    :root.light-mode .sidebar,
    html.light-mode .sidebar {
      background: var(--panel);
      border-right: 1px solid var(--line);
    }
    :root.light-mode .topheader,
    html.light-mode .topheader {
      background: rgba(255, 255, 255, 0.85);
      border-bottom: 1px solid var(--line);
    }
    :root.light-mode .sidebar-footer,
    html.light-mode .sidebar-footer {
      background: rgba(0, 0, 0, 0.02);
    }
    :root.light-mode .form-input,
    :root.light-mode .form-textarea,
    :root.light-mode .form-select,
    :root.light-mode .header-search,
    :root.light-mode .filter-search,
    html.light-mode .form-input,
    html.light-mode .form-textarea,
    html.light-mode .form-select,
    html.light-mode .header-search,
    html.light-mode .filter-search {
      background: #ffffff;
    }
    :root.light-mode .kpi-card,
    html.light-mode .kpi-card {
      background: #ffffff;
    }
    :root.light-mode .list-container,
    html.light-mode .list-container {
      background: #ffffff;
    }
    :root.light-mode .list-header,
    html.light-mode .list-header {
      background: var(--bg-2);
    }
    :root.light-mode .detail-panel,
    html.light-mode .detail-panel {
      background: #ffffff;
    }
    :root.light-mode .detail-header,
    html.light-mode .detail-header {
      background: rgba(0, 0, 0, 0.02);
    }
    :root.light-mode .status-timeline,
    html.light-mode .status-timeline {
      background: rgba(0, 0, 0, 0.01);
    }
    :root.light-mode .modal,
    html.light-mode .modal {
      background: #ffffff;
    }
    :root.light-mode .modal-footer,
    html.light-mode .modal-footer {
      background: rgba(0, 0, 0, 0.02);
    }
    :root.light-mode .toast,
    html.light-mode .toast {
      background: #ffffff;
    }
    :root.light-mode .log-row,
    html.light-mode .log-row {
      background: #ffffff;
    }
    :root.light-mode .btn-secondary,
    html.light-mode .btn-secondary {
      background: #ffffff;
    }
    :root.light-mode .btn-secondary:hover,
    html.light-mode .btn-secondary:hover {
      background: var(--bg-2);
    }

    /* Price List Selection Modal Styling */
    .pl-prod-row:hover {
      background: var(--panel-hover) !important;
    }