:root{ 
      --bg:#f4f6fb;
      --bg-grad-1:#f8fbff;
      --bg-grad-2:#eef3fb;
      --card:#ffffff;
      --muted:#64748b;
      --text:#0f172a;
      --blue:#2563eb;
      --purple:#7c3aed;
      --green:#16a34a;
      --orange:#f59e0b;
      --red:#ef4444;
      --gray:#e5e7eb;
      --soft:#f8fafc;
      --shadow:0 6px 20px rgba(24,39,75,0.08);
      --shadow-lg:0 12px 28px rgba(24,39,75,0.12);
      
      /* Spacing scale based on 8px */
      --space-1: 8px;
      --space-2: 16px;
      --space-3: 24px;
    }
    *{box-sizing:border-box}
    body{margin:0;background:linear-gradient(180deg,var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);color:var(--text);font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif}
    header{position:sticky;top:0;z-index:10;background:rgba(255,255,255,.82);backdrop-filter:blur(8px);border-bottom:1px solid var(--gray)}
    #topBannerStack{position:sticky;top:0;z-index:21}
    .announcement-bar{display:flex;align-items:center;gap:10px;justify-content:center;padding:8px 12px;background:linear-gradient(90deg,#fef9c3,#e9d5ff);border-bottom:1px solid var(--gray);color:#1f2937;font-weight:700;letter-spacing:.2px}
    .announcement-bar[hidden]{display:none !important}
    .announcement-icon{font-size:1rem}
    .announcement-text{font-size:.95rem}
    .countdown{display:inline-block;min-width:84px;text-align:center;padding:4px 8px;border-radius:8px;background:#ffffff;border:1px solid var(--gray);box-shadow:0 2px 6px rgba(0,0,0,.06)}
    .announcement-bar.is-alert{background:linear-gradient(90deg,#fee2e2,#fecaca);color:#7f1d1d;border-bottom-color:#fca5a5}
    .announcement-bar.is-alert .countdown{border-color:#fca5a5;box-shadow:0 2px 8px rgba(239,68,68,.12)}
    .announcement-bar.express-banner{background:linear-gradient(90deg,var(--orange),#ea580c);color:#fff;border-bottom-color:#ea580c}
    .subscription-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px;font-size:.875rem;font-weight:600}
    .subscription-banner.pending{background:#fef9c3;color:#854d0e;border-bottom:1px solid #eab308}
    .subscription-banner.inactive{background:#fee2e2;color:#991b1b;border-bottom:1px solid #fca5a5}
    main.canvas{position:relative}
    #inactivePaywall{position:absolute;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:24px}
    main.canvas.paywall-active>.tab-panel{filter:blur(5px);pointer-events:none;user-select:none;opacity:.5}
    .paywall-card{background:#fff;border:1px solid var(--gray);border-radius:20px;box-shadow:0 24px 60px rgba(24,39,75,.18);padding:40px 36px;max-width:480px;width:100%;text-align:center}
    .paywall-lock-icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;background:#fee2e2;color:#dc2626;margin-bottom:20px}
    .paywall-title{font-size:1.5rem;font-weight:800;color:var(--text);margin:0 0 10px}
    .paywall-subtitle{font-size:.9rem;color:var(--muted);margin:0 0 28px;line-height:1.5}
    .paywall-payment{background:var(--soft);border:1px solid var(--gray);border-radius:14px;padding:20px 24px;text-align:left}
    .paywall-amount-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid var(--gray)}
    .paywall-amount-label{font-size:.8rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px}
    .paywall-amount{font-size:1.5rem;font-weight:800;color:var(--text)}
    .paywall-steps{display:flex;flex-direction:column;gap:12px}
    .paywall-step{display:flex;align-items:flex-start;gap:12px;font-size:.875rem;color:var(--text);line-height:1.5}
    .paywall-step-num{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:#dc2626;color:#fff;font-size:.7rem;font-weight:700;flex-shrink:0;margin-top:1px}
    .subscription-banner-content{display:flex;align-items:center;gap:8px}
    .subscription-banner-link{background:transparent;border:1px solid currentColor;border-radius:4px;color:inherit;cursor:pointer;font-size:.75rem;font-weight:600;padding:3px 10px;white-space:nowrap;opacity:.9}
    .subscription-banner-link:hover{opacity:1}
    .container{max-width:1400px;margin:0 auto;padding:10px var(--space-2)}
    .title-row{display:flex;align-items:center;gap:var(--space-2);padding-bottom:6px;flex-wrap:nowrap;min-width:0}
    .title-left{display:flex;flex-direction:column;gap:4px;min-width:0}
    h1,.title-heading{font-size:1.35rem;margin:0;font-weight:800;letter-spacing:.1px;display:flex;gap:8px;align-items:center;white-space:nowrap;flex-shrink:0}
    h1 .dot,.title-heading .dot{width:10px;height:10px;border-radius:50%;background:linear-gradient(135deg,var(--blue),var(--purple));box-shadow:0 0 12px rgba(37,99,235,.5)}
    .kpis{display:flex;gap:6px;flex-wrap:nowrap;align-items:center;margin-left:auto}
    .kpi{background:linear-gradient(180deg,#ffffff,#fafcff);border:1px solid var(--gray);padding:4px 12px;border-radius:8px;display:flex;gap:6px;align-items:center;box-shadow:0 2px 6px rgba(24,39,75,0.05);font-size:.82rem}
    .kpi .count{font-weight:800;background:linear-gradient(135deg,var(--blue),var(--purple));-webkit-background-clip:text;background-clip:text;color:transparent}
    .account-chip{display:inline-flex;align-items:center;gap:6px;padding:3px 5px 3px 3px;border-radius:999px;background:linear-gradient(180deg,#ffffff,#f8fafc);border:1px solid rgba(229,231,235,.9);box-shadow:0 4px 12px rgba(24,39,75,.06)}
    .account-chip[hidden]{display:none !important}
    .chip-avatar{width:24px;height:24px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,var(--blue),#14b8a6);color:#fff;font-size:.7rem;font-weight:800;box-shadow:0 3px 8px rgba(37,99,235,.2);flex-shrink:0}
    .chip-text{display:flex;align-items:center;min-width:0}
    .chip-name{font-size:.78rem;font-weight:700;color:var(--text);white-space:nowrap;line-height:1}
    .chip-logout{display:inline-flex;align-items:center;justify-content:center;gap:5px;padding:5px 10px;border-radius:7px;border:1px solid #fecaca;background:#fee2e2;color:#dc2626;font-size:.7rem;font-weight:700;line-height:1;cursor:pointer;font-family:inherit;transition:all .15s ease}
    .chip-logout:hover{background:#fecaca;border-color:#f87171;color:#b91c1c;filter:none}

    /* Compact Action Bar */
    .compact-action-bar{display:flex;gap:var(--space-3);margin-top:8px;padding:10px 14px;background:linear-gradient(135deg,#ffffff,#f8fafc);border:1px solid var(--gray);border-radius:12px;box-shadow:var(--shadow)}
    .action-group{display:flex;align-items:center;gap:var(--space-2);flex:1}
    .group-header{display:flex;align-items:center;gap:var(--space-1);min-width:80px}
    .group-icon{font-size:1.1rem}
    .group-label{font-size:.8rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.3px}
    .group-dot{width:8px;height:8px;border-radius:50%;background:linear-gradient(135deg,var(--blue),var(--purple));box-shadow:0 0 8px rgba(37,99,235,.45)}
    .group-info{display:inline-flex;align-items:center;gap:6px;padding:4px 6px;border-radius:8px;background:transparent;border:none;color:var(--muted);font-size:.85rem;font-weight:600;box-shadow:none}
    .group-info::before{content:"⏰";font-size:.9rem;line-height:1;opacity:.6}
    .group-actions{display:flex;gap:var(--space-1);flex:1;justify-content:flex-end}
    .btn-segment{display:inline-flex;gap:var(--space-1);padding:4px;background:#fff;border:1px solid var(--gray);border-radius:999px;box-shadow:0 2px 8px rgba(24,39,75,.06)}
    .group-divider{width:1px;height:32px;background:linear-gradient(180deg,#e5e7eb00,#e5e7eb,#e5e7eb00);display:inline-block;margin:0 8px;border-radius:1px}
    
    /* Modern Button Styles */
    .modern-btn{display:flex;align-items:center;gap:var(--space-1);padding:var(--space-1) var(--space-2);border:none;border-radius:8px;font-size:.85rem;font-weight:600;cursor:pointer;transition:all .2s ease;position:relative;overflow:hidden;min-width:80px;justify-content:center}
    .modern-btn .btn-icon{font-size:.9rem;transition:transform .2s ease}
    .modern-btn .btn-text{transition:opacity .2s ease}
    .modern-btn:hover .btn-icon{transform:scale(1.1)}
    .modern-btn:active{transform:translateY(1px)}
    
    /* Button Variants */
    /* Data group button styles (as in screenshot) */
    .btn-import,.btn-export{background:#ffffff;border:1px solid var(--gray);color:#0f172a;border-radius:999px;box-shadow:0 2px 6px rgba(24,39,75,.08)}
    .btn-import:hover,.btn-export:hover{box-shadow:0 6px 14px rgba(24,39,75,.12);transform:translateY(-1px)}
    .btn-drive{background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff;border-radius:999px;box-shadow:0 6px 20px rgba(124,58,237,.35)}
    .btn-drive:hover{box-shadow:0 10px 28px rgba(124,58,237,.45);transform:translateY(-1px)}
    .btn-drive.disabled{background:linear-gradient(135deg,#9ca3af,#6b7280);color:#d1d5db;cursor:not-allowed;box-shadow:0 2px 6px rgba(156,163,175,.2);opacity:.6}
    .btn-drive.disabled:hover{box-shadow:0 2px 6px rgba(156,163,175,.2);transform:none}
    .btn-drive--dirty{background:linear-gradient(135deg,#f59e0b,#ea580c);color:#fff;border:1px solid rgba(255,255,255,.25);box-shadow:0 6px 20px rgba(234,88,12,.45);animation:pulse-drive-dirty 2s ease-in-out infinite}
    .btn-drive--dirty:hover{box-shadow:0 10px 28px rgba(234,88,12,.55);transform:translateY(-1px)}
    @keyframes pulse-drive-dirty{0%,100%{box-shadow:0 6px 20px rgba(234,88,12,.45)}50%{box-shadow:0 6px 28px rgba(234,88,12,.7)}}
    .save-dirty-badge{background:#ef4444;color:#fff;border-radius:10px;padding:1px 7px;font-size:11px;font-weight:700;margin-left:6px;min-width:20px;text-align:center;display:inline-block}
    .btn-primary-large{padding:12px 22px;font-size:.95rem}
    
    .btn-republish{background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff;box-shadow:0 2px 6px rgba(245,158,11,.2)}
    .btn-republish:hover{box-shadow:0 4px 12px rgba(245,158,11,.3);transform:translateY(-1px)}
    
    .btn-unpublish{background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;box-shadow:0 2px 6px rgba(239,68,68,.2)}
    .btn-unpublish:hover{box-shadow:0 4px 12px rgba(239,68,68,.3);transform:translateY(-1px)}
    
    /* File Input Integration */
    .compact-action-bar .file-input-container{position:relative;display:inline-block}
    .compact-action-bar .file-input{position:absolute;opacity:0;width:100%;height:100%;cursor:pointer}
    .compact-action-bar .file-input-label{display:none}

    .toolbar{margin-top:8px;background:var(--card);border:1px solid var(--gray);border-radius:14px;padding:8px 14px;display:flex;gap:var(--space-1);flex-wrap:wrap;box-shadow:var(--shadow)}
    .toolbar-split{justify-content:space-between;align-items:center}
    .toolbar-filters,.toolbar-actions{display:flex;gap:6px;flex-wrap:wrap;align-items:center}
    .filter-group{display:flex;gap:6px}
    select,button,.search{background:var(--soft);border:1px solid var(--gray);color:var(--text);padding:var(--space-1) var(--space-2);border-radius:12px;font-size:.95rem;outline:none}
    .search{min-width:320px;padding:5px 14px;font-size:.83rem}
    .search::placeholder{color:#94a3b8}
    button.danger{background:linear-gradient(135deg,#fb7185,#ef4444);border:none;color:#fff;cursor:pointer;font-weight:700}
    button.secondary{background:#ffffff;border:1px solid var(--gray);cursor:pointer}
    button{transition:all .2s ease}
    button:hover{filter:brightness(1.04)}

    /* Compact sober filter chips */
    .filter-divider{width:1px;background:#e2e8f0;align-self:stretch;margin:0 2px;flex-shrink:0}
    .filter-btn{padding:4px 11px;font-size:.8rem;font-weight:500;border-radius:999px;box-shadow:none;transition:all .15s ease;white-space:nowrap;display:inline-flex;align-items:center}
    .filter-btn.active{background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff;border:none;box-shadow:0 2px 8px rgba(37,99,235,.22)}
    .filter-btn[data-filter="Published"]:not(.active){background:#f0fdf4;border:1px solid #86efac;color:#166534}
    .filter-btn[data-filter="Published"]:not(.active):hover{background:#dcfce7;border-color:#4ade80;transform:none}
    .filter-btn[data-filter="Ready"]:not(.active){background:#ecfdf5;border:1px solid #6ee7b7;color:#047857}
    .filter-btn[data-filter="Ready"]:not(.active):hover{background:#d1fae5;border-color:#34d399;transform:none}
    .filter-btn[data-filter="On Hold"]:not(.active){background:#f1f5f9;border:1px solid #cbd5e1;color:#475569}
    .filter-btn[data-filter="On Hold"]:not(.active):hover{background:#e2e8f0;border-color:#94a3b8;transform:none}
    .filter-btn[data-filter="Draft"]:not(.active){background:#f8fafc;border:1px solid #cbd5e1;color:#475569}
    .filter-btn[data-filter="Draft"]:not(.active):hover{background:#f1f5f9;border-color:#94a3b8;transform:none}
    .filter-btn[data-filter="Republish"]:not(.active){background:#fff7ed;border:1px solid #fed7aa;color:#9a3412}
    .filter-btn[data-filter="Republish"]:not(.active):hover{background:#ffedd5;border-color:#fdba74;transform:none}
    .filter-btn[data-filter="Sold"]:not(.active){background:#f3e8ff;border:1px solid #d8b4fe;color:#7c3aed}
    .filter-btn[data-filter="Sold"]:not(.active):hover{background:#ede9fe;border-color:#c4b5fd;transform:none}
    .filter-btn[data-filter="Error"]:not(.active){background:#fef2f2;border:1px solid #fca5a5;color:#991b1b}
    .filter-btn[data-filter="Error"]:not(.active):hover{background:#fee2e2;border-color:#f87171;transform:none}
    .filter-btn[data-filter="PendingImg"]:not(.active){background:#fffbeb;border:1px solid #fcd34d;color:#92400e}
    .filter-btn[data-filter="PendingImg"]:not(.active):hover{background:#fef3c7;border-color:#f59e0b;transform:none}
    .filter-btn[data-filter="PendingCarfax"]:not(.active){background:#eff6ff;border:1px solid #93c5fd;color:#1e40af}
    .filter-btn[data-filter="PendingCarfax"]:not(.active):hover{background:#dbeafe;border-color:#60a5fa;transform:none}
    .filter-btn[data-filter="TopAd"]:not(.active){background:#fefce8;border:1px solid #fde047;color:#854d0e}
    .filter-btn[data-filter="TopAd"]:not(.active):hover{background:#fef9c3;border-color:#facc15;transform:none}

    /* ✨ Nuevo estilo para Republish / Unpublish */
    #republishBtn{ 
      background:linear-gradient(#fff,#fff) padding-box, linear-gradient(135deg,var(--blue),var(--purple)) border-box; 
      border:1px solid transparent; color:#0f172a; font-weight:700;
      box-shadow:0 4px 14px rgba(37,99,235,.08);
    }
    #republishBtn:hover{ box-shadow:0 8px 22px rgba(37,99,235,.16); transform:translateY(-1px); }
    #republishBtn:active{ transform:translateY(0); }
    #republishBtn::before{ content:""; margin-right:.4rem }

    #unpublishBtn{ 
      background:linear-gradient(#fff,#fff) padding-box, linear-gradient(135deg,var(--orange),var(--red)) border-box; 
      border:1px solid transparent; color:#0f172a; font-weight:700;
      box-shadow:0 4px 14px rgba(239,68,68,.08);
    }
    #unpublishBtn:hover{ box-shadow:0 8px 22px rgba(239,68,68,.16); transform:translateY(-1px); }
    #unpublishBtn:active{ transform:translateY(0); }

    /* Accesibilidad */
    #republishBtn:focus-visible, #unpublishBtn:focus-visible{ outline:3px solid rgba(37,99,235,.35); outline-offset:2px }

    .card{background:var(--card);border:1px solid var(--gray);border-radius:16px;box-shadow:var(--shadow-lg);overflow:hidden}
    .table-wrap{overflow:auto}

    /* Sortable table headers */
    th.sortable-header {
      cursor: pointer;
      user-select: none;
      transition: background-color 0.15s ease;
      position: relative;
    }

    th.sortable-header:hover {
      background-color: #f1f5f9;
    }

    th.sortable-header.active {
      background-color: #fafcff;
    }

    .sort-icon {
      display: inline-block;
      margin-left: 4px;
      color: #2563eb;
      font-weight: 700;
      min-width: 12px;
      text-align: center;
      font-size: 0.85em;
    }

    .sort-icon:empty::before {
      content: " ";
    }

    /* Table Header with Integrated Actions */
    .table-header{display:flex;justify-content:space-between;align-items:center;padding:10px 20px;border-bottom:1px solid var(--gray);background:linear-gradient(180deg,#ffffff,#fafcff)}
    .table-title{display:flex;align-items:center;gap:6px}
    .table-title-icon{color:var(--muted);opacity:.7;flex-shrink:0}
    .table-section-label{font-size:.75rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.6px}
    .table-subtitle{font-size:.85rem;color:var(--muted);margin-left:8px}
    .table-actions{display:flex;gap:var(--space-2);align-items:center;width:100%;max-width:600px;justify-content:flex-end}
    
    /* Action groups for better organization */
    .action-group-left{display:flex;gap:var(--space-1);align-items:center}
    .action-group-center{display:flex;gap:var(--space-1);align-items:center}
    .action-group-right{display:flex;gap:var(--space-1);align-items:center}
    
    /* Integrated Table Buttons */
    .btn-remove-selection,.btn-add-vehicle,.btn-republish,.btn-unpublish{display:flex;align-items:center;gap:var(--space-1);padding:var(--space-1) var(--space-2);border-radius:10px;border:none;font-size:.9rem;font-weight:600;cursor:pointer;transition:all .3s ease;position:relative;min-width:120px;justify-content:center}
    .btn-icon{font-size:1.1rem}
    .btn-text{white-space:nowrap}
    
    /* Add Vehicle Button */
    .btn-add-vehicle{background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff;box-shadow:0 3px 12px rgba(37,99,235,.25)}
    .btn-add-vehicle:hover{box-shadow:0 6px 20px rgba(37,99,235,.4);transform:translateY(-2px)}
    .btn-add-vehicle:active{transform:translateY(0)}
    
    /* Add Vehicle Inline Button */
    .btn-add-vehicle-inline{display:inline-flex;align-items:center;gap:5px;padding:5px 12px;border-radius:8px;border:1px dashed #86efac;background:#f0fdf4;color:#166534;font-size:.82rem;font-weight:600;cursor:pointer;transition:all .15s ease;font-family:inherit}
    .btn-add-vehicle-inline:hover{background:#dcfce7;border-color:#4ade80;border-style:solid}
    .btn-add-vehicle-inline:active{transform:translateY(0)}

    /* Mini Add Vehicle Button (legacy, kept for reference) */
    .btn-add-vehicle-mini{
      background: linear-gradient(135deg, var(--blue), var(--purple));
      color: #fff;
      border: none;
      border-radius: 6px;
      width: 28px;
      height: 28px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: all 0.2s ease;
      box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
    }
    
    .btn-add-vehicle-mini:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    }
    
    .btn-add-vehicle-mini:active {
      transform: translateY(0);
    }
    
    .btn-icon-mini {
      font-size: 0.8rem;
      line-height: 1;
    }
    /* High-contrast plus icon inside mini add button */
    .btn-add-vehicle-mini .icon-plus{ 
      color:#ffffff; 
      filter: drop-shadow(0 1px 1px rgba(0,0,0,.35));
    }
    
    /* Remove Selection Button */
    .btn-remove-selection{padding:5px 12px;border-radius:8px;font-size:.82rem;min-width:unset;background:var(--soft);color:var(--muted);border:1px solid var(--gray);box-shadow:none}
    .btn-remove-selection:hover:not(:disabled){background:#fee2e2;color:#b91c1c;border-color:#fecaca;box-shadow:none}
    .btn-remove-selection:disabled{opacity:.5;cursor:not-allowed;transform:none !important}

    /* Republish All Button */
    .btn-republish-all{display:flex;align-items:center;gap:5px;padding:5px 12px;border-radius:8px;border:1px solid var(--gray);font-size:.82rem;font-weight:600;cursor:pointer;transition:all .15s ease;background:var(--soft);color:var(--muted);box-shadow:none;min-width:unset;justify-content:center;font-family:inherit}
    .btn-republish-all:hover{background:#fff7ed;color:#9a3412;border-color:#fed7aa;box-shadow:none}
    
    /* Republish Button */
    .btn-republish{background:linear-gradient(135deg,#f59e0b,#d97706);color:#fff;box-shadow:0 3px 12px rgba(245,158,11,.25)}
    .btn-republish:hover{box-shadow:0 6px 20px rgba(245,158,11,.4);transform:translateY(-2px)}
    .btn-republish:active{transform:translateY(0)}
    
    /* Unpublish Button */
    .btn-unpublish{background:linear-gradient(135deg,#ef4444,#dc2626);color:#fff;box-shadow:0 3px 12px rgba(239,68,68,.25)}
    .btn-unpublish:hover{box-shadow:0 6px 20px rgba(239,68,68,.4);transform:translateY(-2px)}
    .btn-unpublish:active{transform:translateY(0)}
    
    .selected-count{background:var(--red);color:#fff;font-size:.7rem;padding:2px 6px;border-radius:10px;min-width:16px;text-align:center;margin-left:4px}

    table{width:100%;border-collapse:separate;border-spacing:0;font-size:.97rem;min-width:1100px}
    thead th{position:sticky;top:0;z-index:2;background:#f1f5f9;color:#475569;font-weight:700;text-align:left;border-bottom:1px solid var(--gray);padding:12px;white-space:nowrap}
    tbody td{border-bottom:1px solid var(--gray);padding:12px;vertical-align:middle}
    tbody tr.main:hover td{background:#f8fafc}

    /* Checkbox column */
    .col-check{width:30px;min-width:30px;max-width:30px;padding-left:8px !important;padding-right:4px !important}

    /* VIN cell with inline controls */
    .vin-cell{display:flex;align-items:center;gap:2px}
    .vin-cell .cell-vin-wrapper{flex:1;min-width:0}
    #inventoryTable th:nth-child(2),#inventoryTable td:nth-child(2){width:210px;min-width:210px}
    /* VIN header offset: aligns with VIN text which starts after caret (12px padding + 14px caret + 2px gap) */
    #inventoryTable th:nth-child(2){padding-left:28px}
    /* Center headers for numeric/status columns (all except VIN and Title) */
    #inventoryTable th:nth-child(4),
    #inventoryTable th:nth-child(5),
    #inventoryTable th:nth-child(6),
    #inventoryTable th:nth-child(9),
    #inventoryTable th:nth-child(10),
    #inventoryTable th:nth-child(11){text-align:center}
    /* Per-tenant marketplace columns: hidden when disabled in config.json (mk-hide-* toggled on the table) */
    #inventoryTable.mk-hide-kijiji .mk-kijiji,
    #inventoryTable.mk-hide-cargurus .mk-cargurus,
    #inventoryTable.mk-hide-autotrader .mk-autotrader,
    #inventoryTable.mk-hide-website .mk-website{display:none}
    .col-ad-header,.col-ad{width:36px;min-width:36px;max-width:36px;text-align:center;padding-left:4px !important;padding-right:4px !important}

    /* Caret: always visible, rotates when expanded */
    .row-caret{display:inline-flex;align-items:center;color:#9ca3af;flex-shrink:0;user-select:none;transition:transform 0.15s;line-height:0;cursor:pointer}
    .inv-row.expanded .row-caret{transform:rotate(90deg)}

    /* Checkbox: hidden by default, shown on hover or always when checked */
    .row-cb{display:none;flex-shrink:0;width:14px;height:14px;cursor:pointer;accent-color:#3b82f6;margin:0}
    .inv-row:hover .row-cb{display:inline-block}
    .inv-row.row-selected .row-cb{display:inline-block}

    /* Row selected state: light blue background, checkbox always visible */
    .inv-row.row-selected td{background:#eff6ff}

    .cell-editable{border-radius:10px;padding:8px 10px;min-width:60px;outline:none}
    .cell-editable:focus{background:#eef2ff;border:1px solid rgba(37,99,235,.35)}

    .cell-vin-wrapper{display:flex;align-items:center;gap:6px}
    .cell-vin-wrapper .cell-editable{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

    .cell-title-wrapper{display:flex;align-items:center;gap:6px}
    .cell-title-wrapper .cell-editable{flex:1;min-width:0}
    .top-ad-star{cursor:pointer;font-size:.85rem;flex-shrink:0}
    .top-ad-star.inactive{opacity:.2}
    .vin-decode-badge{font-size:11px;font-weight:600;padding:2px 8px;border-radius:20px;border:1px solid var(--blue);color:var(--blue);background:#eff6ff;cursor:pointer;white-space:nowrap;transition:all .15s;flex-shrink:0;line-height:1.6}
    .vin-decode-badge:hover:not(:disabled){background:var(--blue);color:#fff}
    .vin-decode-badge.loading{border-color:var(--gray);color:var(--muted);background:#f1f5f9;cursor:default}
    .vin-decode-badge.success{border-color:var(--green);color:var(--green);background:#f0fdf4;cursor:default}
    .vin-decode-badge.error{border-color:var(--orange);color:var(--orange);background:#fffbeb}

    .caret{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;transform:rotate(0deg);transition:transform .2s ease;opacity:.9;cursor:pointer}
    .hidden{display:none !important}
    tbody tr.main{cursor:pointer}

    .badges{display:flex;gap:6px;flex-wrap:wrap}
    .badge{font-size:.78rem;padding:6px 10px;border-radius:999px;border:1px solid transparent}
    .b-published{background:#e8f6ef;color:#147d49;border-color:#a7f3d0}
    .b-draft{background:#eef2f7;color:#334155;border-color:#cbd5e1}
    .b-republish{background:#fff7ed;color:#9a3412;border-color:#fed7aa}
    .b-error{background:#fee2e2;color:#b91c1c;border-color:#fecaca}
    .b-pending{background:#fff7ed;color:#9a3412;border-color:#fed7aa}
    .b-complete{background:#eef2ff;color:#1d4ed8;border-color:#c7d2fe}
    .b-ready{background:#ecfdf5;color:#047857;border-color:#6ee7b7}
    .b-on-hold{background:#f1f5f9;color:#64748b;border-color:#cbd5e1}
    .b-sold{background:#f3e8ff;color:#7c3aed;border-color:#d8b4fe}
    .badge-locked{cursor:not-allowed!important;opacity:.92}
    .badge-locked:hover{filter:none;transform:none}

    .icon-status-th{width:40px;text-align:center;padding:6px 4px}
    .icon-status-td{width:40px;text-align:center;padding:6px 4px;position:relative}

    /* Marketplace columns: while config.json resolves, show a shimmer skeleton
       instead of blank cells. The real header text / row badges stay in the DOM
       (hidden) so the column keeps its width and reveals when loading ends. */
    #inventoryTable.marketplace-loading .mk-col{position:relative;color:transparent}
    #inventoryTable.marketplace-loading .mk-col > *{visibility:hidden}
    #inventoryTable.marketplace-loading .mk-col::after{content:'';position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);height:10px;width:54px;border-radius:5px;background:linear-gradient(90deg,#e2e8f0 25%,#f1f5f9 50%,#e2e8f0 75%);background-size:200% 100%;animation:shimmer 1.4s infinite}
    #inventoryTable.marketplace-loading td.mk-col::after{height:8px;width:32px}
    @keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
    /* Per-marketplace column hiding (applied after config.json loads). */
    #inventoryTable.mk-hide-kijiji .mk-kijiji{display:none}
    #inventoryTable.mk-hide-cargurus .mk-cargurus{display:none}
    #inventoryTable.mk-hide-autotrader .mk-autotrader{display:none}
    #inventoryTable.mk-hide-website .mk-website{display:none}
    .icon-status-td .status-tt{display:none;position:absolute;bottom:calc(100% + 4px);left:50%;transform:translateX(-50%);background:#1e293b;color:#f1f5f9;font-size:.68rem;padding:2px 7px;border-radius:4px;white-space:nowrap;border:1px solid #334155;z-index:20;pointer-events:none}
    .icon-status-td:hover .status-tt{display:block}

    /* ARCHIVE PLACEHOLDER */
    .archive-placeholder{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:80px 24px;text-align:center}

    /* ARCHIVE TAB */
    .archive-card{border-top:3px solid #22c55e !important}
    .archive-table-header{background:linear-gradient(180deg,#f0fdf4,#f8fafc) !important;border-bottom-color:#d1fae5 !important}
    .archive-title-text{font-size:.75rem;font-weight:700;color:#15803d;text-transform:uppercase;letter-spacing:.6px}
    .archive-count-chip{font-size:.72rem;font-weight:700;color:#166534;background:#dcfce7;padding:3px 9px;border-radius:999px;margin-left:6px;border:1px solid #86efac}
    .archive-search:focus{border-color:#86efac !important;box-shadow:0 0 0 3px rgba(34,197,94,.15) !important}
    .archive-table{width:100%;border-collapse:separate;border-spacing:0;font-size:.9rem;min-width:680px}
    .archive-table thead th{position:sticky;top:0;z-index:2;background:#f0fdf4;color:#166534;font-weight:700;text-align:left;border-bottom:2px solid #bbf7d0;padding:9px 14px;white-space:nowrap;font-size:.7rem;text-transform:uppercase;letter-spacing:.5px}
    .archive-th-num{width:44px;text-align:center !important}
    .archive-table tbody td{border-bottom:1px solid #f0f9f1;padding:15px 14px;vertical-align:middle;background:#fff;transition:background .1s}
    .archive-table tbody tr:last-child td{border-bottom:none}
    .archive-table tbody tr:hover td{background:#f0fdf4}
    .archive-row-num{text-align:center;color:#94a3b8;font-size:.75rem;font-weight:600;font-variant-numeric:tabular-nums}
    .archive-vehicle-cell{display:flex;align-items:center;gap:10px}
    .archive-make-badge{width:36px;height:36px;border-radius:9px;color:#fff;font-size:.65rem;font-weight:800;display:flex;align-items:center;justify-content:center;flex-shrink:0;text-transform:uppercase;letter-spacing:.3px;box-shadow:0 3px 8px rgba(0,0,0,.18)}
    .archive-vehicle-info{display:flex;flex-direction:column;gap:2px;min-width:0}
    .archive-vehicle-title{font-size:.85rem;font-weight:600;color:var(--text);line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:320px}
    .archive-vehicle-vin{font-size:.7rem;color:#94a3b8;font-family:'Courier New',monospace;letter-spacing:.3px}
    .archive-year-pill{display:inline-block;background:#f1f5f9;color:#475569;font-size:.78rem;font-weight:700;padding:3px 10px;border-radius:999px;border:1px solid #e2e8f0}
    .archive-price{font-size:.92rem;font-weight:800;color:#15803d;font-variant-numeric:tabular-nums}
    .archive-cell-empty{color:#cbd5e1;font-size:.8rem}
    .archive-sold-chip{display:inline-flex;align-items:center;gap:5px;background:#dcfce7;color:#166534;font-size:.75rem;font-weight:600;padding:4px 10px;border-radius:999px;border:1px solid #86efac;white-space:nowrap;font-variant-numeric:tabular-nums}
    .archive-empty{padding:64px 24px;text-align:center}
    .archive-empty-icon{display:block;margin:0 auto 14px;color:#bbf7d0}
    .archive-empty-title{margin:0 0 6px;color:#475569;font-size:.95rem;font-weight:700}
    .archive-empty-sub{margin:0;font-size:.83rem;color:#94a3b8}

    /* DETAILS ROW */
    tr.details td{background:#f8fafc}
    .details-card{border:1px solid var(--gray);border-radius:14px;padding:14px;margin:6px 0;background:#ffffff;box-shadow:var(--shadow)}
    .details-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:12px}
    .details-grid .full{grid-column:1/-1}
    .form-item{display:flex;flex-direction:column;gap:6px}
    .form-item label{font-size:.82rem;color:#334155;font-weight:600}
    .form-item input,.form-item textarea, .form-item select{background:#ffffff;border:1px solid var(--gray);color:var(--text);padding:10px;border-radius:10px;outline:none}
    .form-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end;margin-top:6px}

    .footer-note{color:#64748b;font-size:.85rem;padding:12px;text-align:right}

    /* File upload styles */
    .file-input-container{position:relative;display:inline-block}
    .file-input-container-full{width:100%;margin-bottom:16px;}

    .file-input{position:absolute;opacity:0;width:100%;height:100%;cursor:pointer}
    .file-input-label{display:inline-flex;align-items:center;gap:8px;padding:10px 16px;background:var(--soft);border:1px solid var(--gray);border-radius:12px;cursor:pointer;transition:all .2s ease;font-size:.95rem}
    .file-input-label-full{width:100%;justify-content:center;}

    .file-input-label:hover{background:#ffffff;border-color:var(--blue)}
    .file-input-label.has-file{background:linear-gradient(135deg,#e8f6ef,#d1fae5);border-color:#16a34a;color:#147d49}

    /* Progress bar */
    .progress-container{display:none;margin:16px 0;background:var(--soft);border-radius:12px;overflow:hidden;border:1px solid var(--gray);padding:12px}
    #uploadProgressContainer{margin:0;border-radius:0;border-left:none;border-right:none;border-top:1px solid var(--gray);border-bottom:none;flex-shrink:0}
    .progress-bar{width:0%;height:8px;background:linear-gradient(135deg,var(--blue),var(--purple));transition:width .3s ease;border-radius:8px;box-shadow:0 2px 4px rgba(37,99,235,0.2)}
    .progress-text{font-size:.9rem;color:var(--text);margin-top:8px;font-weight:500;text-align:center}

    /* Status indicators */
    .status-indicator{display:inline-flex;align-items:center;gap:6px;padding:4px 12px;border-radius:8px;border:1px solid transparent;font-size:.82rem;font-weight:600;line-height:1.2;background:linear-gradient(180deg,#ffffff,#fafcff);box-shadow:0 2px 6px rgba(24,39,75,.05);white-space:nowrap}
    .status-indicator svg,.status-indicator .spinner{flex-shrink:0}
    .status-connected{background:#e8f6ef;color:#147d49;border-color:#b7e4ca}
    .status-disconnected{background:#fee2e2;color:#b91c1c;border-color:#fecaca}
    .status-loading{background:#fff7ed;color:#9a3412;border-color:#fed7aa}
    
    /* Status chips with new color scheme */
    .status-published{background:#ECFDF5;color:#047857;border:1px solid #A7F3D0}
    .status-pending{background:#FEF3C7;color:#92400E;border:1px solid #FCD34D}
    .status-error{background:#FEE2E2;color:#991B1B;border:1px solid #FCA5A5}
    .status-complete{background:#EFF6FF;color:#1E40AF;border:1px solid #93C5FD}
    
    /* Iconography improvements */
    .btn-icon, .group-icon {
      font-style: normal;
      font-weight: normal;
      line-height: 1;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    
    /* Mobile iconography - hide text, show only icons with tooltips */
    @media (max-width: 768px) {
      .modern-btn .btn-text,
      .btn-remove-selection .btn-text,
      .btn-republish-all .btn-text,
      .btn-add-vehicle .btn-text,
      .btn-republish .btn-text,
      .btn-unpublish .btn-text {
        display: none;
      }
      
      .modern-btn,
      .btn-remove-selection,
      .btn-republish-all,
      .btn-add-vehicle,
      .btn-republish,
      .btn-unpublish {
        min-width: 44px;
        padding: var(--space-1);
        justify-content: center;
      }
      
      .btn-icon {
        font-size: 1.2rem;
      }
    }

    /* Modal styles */
    .modal{display:none;position:fixed;top:0;left:0;width:100%;height:100%;background:rgba(0,0,0,.5);z-index:1000;backdrop-filter:blur(4px)}
    .modal-content{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--card);border-radius:16px;padding:var(--space-3);max-width:500px;width:90%;box-shadow:var(--shadow-lg)}
    .modal-content-wide{max-width:900px;width:95%;max-height:85vh;display:flex;flex-direction:column;}
    .modal-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--space-2)}
    .modal-title{font-size:1.2rem;font-weight:700;margin:0}
    .modal-close{background:none;border:none;font-size:1.5rem;cursor:pointer;color:var(--muted);padding:0;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:8px}
    .modal-close:hover{background:var(--soft);color:var(--text)}
    .modal-footer{display:flex;justify-content:flex-end;gap:10px;margin-top:var(--space-2);padding-top:var(--space-2);border-top:1px solid var(--gray)}

    /* ── Feedback modal ── */
    .feedback-intro{margin:0 0 16px;font-size:.88rem;color:var(--muted)}
    .feedback-type-btns{display:flex;gap:8px;margin-bottom:6px;flex-wrap:wrap}
    .feedback-type-btn{padding:7px 18px;border-radius:999px;border:1.5px solid var(--gray);background:var(--soft);color:#475569;font-size:.82rem;font-weight:600;cursor:pointer;font-family:inherit;transition:all .15s ease}
    .feedback-type-btn:hover{border-color:rgba(37,99,235,.4);color:var(--blue);background:rgba(37,99,235,.05)}
    .feedback-type-btn.is-active{background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff;border-color:transparent;box-shadow:0 4px 12px rgba(37,99,235,.22)}
    .feedback-textarea{width:100%;margin-top:14px;padding:10px 14px;border:1px solid var(--gray);border-radius:10px;font-family:inherit;font-size:.88rem;color:var(--text);background:var(--soft);resize:vertical;outline:none;transition:border-color .15s ease,box-shadow .15s ease;box-sizing:border-box}
    .feedback-textarea:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.1)}
    .feedback-textarea::placeholder{color:#94a3b8}
    .feedback-field-error{margin:5px 0 0;font-size:.78rem;font-weight:600;color:var(--red)}
    .feedback-field-error[hidden]{display:none!important}
    .feedback-honeypot{position:absolute;left:-9999px;opacity:0;pointer-events:none;tab-index:-1}

    .loader-overlay{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(15,23,42,.35);backdrop-filter:blur(12px);z-index:2000;opacity:0;pointer-events:none;transition:opacity .25s ease}
    .loader-overlay.is-visible{opacity:1;pointer-events:all}
    body.is-loading{overflow:hidden}
    .loader-card{display:flex;flex-direction:column;align-items:center;gap:16px;padding:32px;border-radius:20px;background:linear-gradient(180deg,#ffffff,rgba(248,250,252,.9));box-shadow:var(--shadow-lg);min-width:220px}
    .loader-spinner{position:relative;width:64px;height:64px}
    .loader-ring{position:absolute;inset:0;border-radius:50%;border:3px solid transparent;border-top-color:var(--blue);border-right-color:var(--purple);animation:loaderSpin .9s linear infinite}
    .loader-ring-delay{animation-delay:-.45s;opacity:.65}
    .loader-label{margin:0;font-weight:600;color:var(--text);font-size:1rem;text-align:center}
    @keyframes loaderSpin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}

    /* Loading spinner */
    .spinner{display:inline-block;width:16px;height:16px;border:2px solid rgba(255,255,255,0.3);border-top:2px solid #ffffff;border-radius:50%;animation:spin 1s linear infinite;vertical-align:middle;flex-shrink:0}
    .spinner.white{border:2px solid rgba(255,255,255,0.3);border-top:2px solid #ffffff}
    .spinner.blue{border:2px solid rgba(37,99,235,0.3);border-top:2px solid var(--blue)}
    @keyframes spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}

    /* Button states */
    button:disabled{opacity:.6;cursor:not-allowed;transform:none !important}
    button.loading{position:relative;color:transparent}
    button.loading::after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:16px;height:16px;border:2px solid rgba(255,255,255,.3);border-top:2px solid white;border-radius:50%;animation:spin 1s linear infinite}
    
    /* Upload button specific styles */
    .upload-btn {
      min-width: 140px;
      padding: 12px 24px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 600;
      letter-spacing: 0.5px;
      transition: all 0.3s ease;
      position: relative;
      overflow: hidden;
    }
    
    .upload-btn:hover:not(:disabled) {
      transform: translateY(-1px);
      box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
    }
    
    .upload-btn:active:not(:disabled) {
      transform: translateY(0);
    }
    
    .upload-btn:disabled {
      opacity: 0.7;
      cursor: not-allowed;
      transform: none;
      box-shadow: none;
    }
    
    .upload-btn #uploadBtnText {
      position: relative;
      z-index: 1;
    }

    /* Enhanced primary button styles for upload buttons */
    button.primary {
      background: linear-gradient(135deg, var(--blue), var(--purple));
      border: none;
      color: #fff;
      font-weight: 700;
      cursor: pointer;
      transition: all 0.3s ease;
      box-shadow: 0 3px 12px rgba(37, 99, 235, 0.25);
      position: relative;
      overflow: hidden;
    }
    
    button.primary:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
      filter: brightness(1.1);
    }
    
    button.primary:active {
      transform: translateY(0);
      box-shadow: 0 3px 12px rgba(37, 99, 235, 0.25);
    }
    
    button.primary:focus {
      outline: 3px solid rgba(37, 99, 235, 0.35);
      outline-offset: 2px;
    }

    button.primary.primary-danger {
      background: linear-gradient(135deg, #dc2626, #b91c1c);
      box-shadow: 0 3px 12px rgba(220, 38, 38, 0.25);
    }
    button.primary.primary-danger:hover {
      box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
    }
    button.primary.primary-danger:focus {
      outline: 3px solid rgba(220, 38, 38, 0.35);
    }

    button.primary.primary-sold {
      background: linear-gradient(135deg, #f59e0b, #d97706);
      box-shadow: 0 3px 12px rgba(217, 119, 6, 0.28);
    }
    button.primary.primary-sold:hover {
      box-shadow: 0 6px 20px rgba(217, 119, 6, 0.45);
    }
    button.primary.primary-sold:focus {
      outline: 3px solid rgba(217, 119, 6, 0.35);
    }
    button.primary.primary-sold-outline {
      background: #fffbeb;
      color: #92400e;
      border: 1px solid #fcd34d;
      box-shadow: none;
      font-weight: 600;
    }
    button.primary.primary-sold-outline:hover {
      background: #fef3c7;
      box-shadow: 0 2px 8px rgba(217, 119, 6, 0.18);
      filter: none;
    }
    button.primary.primary-sold-outline:focus {
      outline: 3px solid rgba(217, 119, 6, 0.28);
    }

    .sold-action-group {
      display: flex;
      align-items: center;
      margin-left: 12px;
      padding-left: 16px;
      border-left: 1.5px solid #e2e8f0;
    }

    /* Thumbnail styles */
    .thumbnail-container {
      display: none;
      background: var(--soft);
      border: 1px solid var(--gray);
      border-radius: 12px;
      padding: var(--space-2);
      flex: 1;
      overflow-y: auto;
      min-height: 0;
    }
    .thumbnail-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 10px;
    }
    .thumbnail-count {
      font-size: 0.8rem;
      color: var(--muted);
      background: var(--gray);
      padding: 2px 10px;
      border-radius: 10px;
    }

    .thumbnail-list {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
      gap: var(--space-2);
      overflow-y: auto;
      overflow-x: hidden;
      width: 100%;
    }
    
    .thumbnail-item {
      position: relative;
      background: white;
      border: 2px solid var(--gray);
      border-radius: 8px;
      padding: 6px;
      cursor: move;
      transition: all 0.2s ease;
      user-select: none;
      min-height: 120px;
      display: flex;
      flex-direction: column;
    }
    
    .thumbnail-item:hover {
      border-color: var(--blue);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    }
    
    .thumbnail-item.dragging {
      opacity: 0.5;
      transform: rotate(5deg);
      z-index: 1000;
    }
    
    .thumbnail-item.insert-before {
      border-left: 3px solid var(--blue);
      box-shadow: -4px 0 8px rgba(37, 99, 235, 0.2);
    }
    .thumbnail-item.insert-after {
      border-right: 3px solid var(--blue);
      box-shadow: 4px 0 8px rgba(37, 99, 235, 0.2);
    }
    
    .thumbnail-image {
      width: 100%;
      height: 90px;
      object-fit: cover;
      border-radius: 4px;
      display: block;
      flex-shrink: 0;
    }
    
    .thumbnail-info {
      margin-top: 4px;
      text-align: center;
      flex-grow: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-direction: column;
    }
    
    .thumbnail-order {
      position: absolute;
      top: 4px;
      left: 4px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      background: linear-gradient(135deg, var(--blue), var(--purple));
      color: white;
      border-radius: 50%;
      font-size: 0.7rem;
      font-weight: 700;
      z-index: 5;
    }
    
    .thumbnail-name {
      font-size: 0.7rem;
      color: var(--muted);
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 100%;
      text-align: center;
      margin-top: 4px;
    }
    
    .thumbnail-remove {
      position: absolute;
      top: 4px;
      right: 4px;
      width: 18px;
      height: 18px;
      padding: 0;
      box-sizing: border-box;
      line-height: 1;
      background: var(--red);
      color: white;
      border: 1px solid white;
      border-radius: 50%;
      cursor: pointer;
      font-size: 0.65rem;
      font-weight: bold;
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0.8;
      transition: all 0.2s ease;
      box-shadow: 0 2px 4px rgba(0,0,0,0.2);
      z-index: 10;
    }
    
    .thumbnail-remove:hover {
      background: #dc2626;
      transform: scale(1.15);
      box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
      .title-row{flex-direction:column;align-items:flex-start}
      .title-left{width:100%}
      .compact-action-bar{flex-direction:column;gap:12px;padding:10px 12px}
      .action-group{flex-direction:column;align-items:stretch;gap:8px}
      .group-header{justify-content:center;min-width:auto}
      .group-actions{justify-content:center;flex-wrap:wrap}
      .modern-btn .btn-text{display:none}
      .modern-btn{min-width:60px;padding:10px}
      .table-header{flex-direction:column;gap:var(--space-2);align-items:stretch;padding:var(--space-2) var(--space-2)}
      .table-title{justify-content:space-between}
      .table-actions{flex-direction:column;gap:var(--space-2);width:100%}
      .action-group-left,.action-group-center,.action-group-right{justify-content:center;flex-wrap:wrap}
      .btn-text{display:none}
      .thumbnail-list{grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));gap:8px}
      .thumbnail-item{min-height:100px}
      .thumbnail-image{height:80px}
      .drop-zone{padding:16px}
      .upload-modal-footer{flex-direction:column;gap:8px;align-items:stretch;text-align:center}
      .btn-remove-selection,.btn-republish-all,.btn-add-vehicle,.btn-republish,.btn-unpublish{padding:12px;min-width:80px;justify-content:center}
      .toolbar-split{flex-direction:column;gap:12px;align-items:stretch}
      .toolbar-actions{justify-content:center}
      .search{min-width:auto;width:100%}
      .kpis{justify-content:center}
      .modal-content{width:95%;padding:16px}
      .modal-content-wide{max-height:95vh}
    }

    .thumbnail-title{margin:0;font-size:0.95rem;color:var(--text);}
    .modal-actions{display:flex;gap:12px;justify-content:flex-end;}

    /* Upload modal layout */
    .upload-modal-body {
      flex: 1;
      display: flex;
      flex-direction: column;
      min-height: 0;
      overflow: hidden;
    }
    .upload-modal-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px var(--space-3);
      border-top: 1px solid var(--gray);
      flex-shrink: 0;
    }
    .upload-footer-hint {
      font-size: 0.82rem;
      color: var(--muted);
    }
    .kijiji-image-notice {
      display: flex;
      align-items: flex-start;
      gap: 7px;
      margin: 8px 12px 4px;
      padding: 8px 12px;
      background: #fef9c3;
      color: #854d0e;
      border: 1px solid #eab308;
      border-radius: 6px;
      font-size: 0.81rem;
      flex-shrink: 0;
    }

    /* Drop zone */
    .drop-zone {
      position: relative;
      border: 2px dashed #93c5fd;
      border-radius: 12px;
      padding: 28px;
      text-align: center;
      cursor: pointer;
      background: white;
      transition: all 0.2s ease;
      margin-bottom: var(--space-2);
      flex-shrink: 0;
    }
    .drop-zone:hover {
      border-color: var(--blue);
      background: #f0f9ff;
    }
    .drop-zone.drag-active {
      border-color: var(--blue);
      background: #eff6ff;
      box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    }
    .drop-zone .file-input {
      position: absolute;
      inset: 0;
      opacity: 0;
      cursor: pointer;
    }
    .drop-zone-content {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 4px;
      pointer-events: none;
    }
    .drop-zone-icon { font-size: 1.8rem; }
    .drop-zone-text { font-weight: 600; color: var(--blue); font-size: 0.95rem; }
    .drop-zone-hint { font-size: 0.8rem; color: var(--muted); }

    /* Compact drop zone (after file selection) */
    .drop-zone.drop-zone-compact {
      padding: 10px 16px;
      margin-bottom: 12px;
      background: #f0f9ff;
    }
    .drop-zone.drop-zone-compact .drop-zone-content {
      flex-direction: row;
      gap: 10px;
    }
    .drop-zone.drop-zone-compact .drop-zone-icon { font-size: 1.1rem; }
    .drop-zone.drop-zone-compact .drop-zone-text { font-size: 0.85rem; }
    .drop-zone.drop-zone-compact .drop-zone-hint { font-size: 0.78rem; }

    /* ── Image Gallery Modal ── */
    .gallery-modal-content {
      background: #111827;
      max-width: 960px;
      width: 95%;
      max-height: 85vh;
      display: flex;
      flex-direction: column;
      padding: 0;
      overflow: hidden;
    }
    .gallery-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      border-bottom: 1px solid #374151;
      flex-shrink: 0;
    }
    .gallery-header-info {
      display: flex;
      align-items: center;
      gap: 10px;
      min-width: 0;
    }
    .gallery-vehicle-title {
      font-weight: 700;
      font-size: 0.95rem;
      color: #f9fafb;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .gallery-vehicle-vin {
      font-size: 0.78rem;
      color: #9ca3af;
    }
    .gallery-header-actions {
      display: flex;
      align-items: center;
      gap: 10px;
      flex-shrink: 0;
    }
    .gallery-image-count {
      font-size: 0.78rem;
      color: #9ca3af;
      background: #1f2937;
      padding: 3px 10px;
      border-radius: 10px;
    }
    .gallery-upload-more-btn {
      padding: 5px 14px;
      border: 1px solid #4f46e5;
      border-radius: 6px;
      background: transparent;
      color: #a5b4fc;
      font-size: 0.8rem;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
    }
    .gallery-upload-more-btn:hover {
      background: #4f46e5;
      color: white;
    }
    .gallery-close {
      color: #9ca3af;
      background: none;
      border: none;
      font-size: 1.5rem;
      cursor: pointer;
      padding: 0;
      width: 32px;
      height: 32px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 8px;
    }
    .gallery-close:hover {
      background: #1f2937;
      color: #f9fafb;
    }
    .gallery-body {
      display: flex;
      flex: 1;
      overflow: hidden;
      min-height: 0;
    }
    .gallery-preview {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      position: relative;
      background: #0a0f1a;
      min-width: 0;
    }
    .gallery-preview-image {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
      padding: 16px;
    }
    .gallery-preview-image img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
      border-radius: 6px;
    }
    .gallery-loading-spinner {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 12px;
      color: #6b7280;
      font-size: 0.85rem;
    }
    .gallery-nav-btn {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background: rgba(255,255,255,0.1);
      border: none;
      border-radius: 50%;
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      font-size: 1.4rem;
      color: #d1d5db;
      backdrop-filter: blur(4px);
      transition: all 0.2s ease;
      z-index: 5;
    }
    .gallery-nav-btn:hover {
      background: rgba(255,255,255,0.2);
      color: white;
    }
    .gallery-nav-btn:disabled {
      opacity: 0.3;
      cursor: default;
    }
    .gallery-nav-prev { left: 12px; }
    .gallery-nav-next { right: 12px; }
    .gallery-counter {
      position: absolute;
      bottom: 12px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(0,0,0,0.6);
      padding: 4px 14px;
      border-radius: 12px;
      font-size: 0.8rem;
      color: #d1d5db;
      backdrop-filter: blur(4px);
    }
    .gallery-thumbnails {
      width: 140px;
      background: #1f2937;
      border-left: 1px solid #374151;
      overflow-y: auto;
      padding: 8px;
      flex-shrink: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .gallery-thumb {
      border: 2px solid transparent;
      border-radius: 6px;
      padding: 2px;
      cursor: pointer;
      transition: all 0.2s ease;
      flex-shrink: 0;
      position: relative;
    }
    .gallery-thumb:hover {
      border-color: #4b5563;
    }
    .gallery-thumb.active {
      border-color: #6366f1;
    }
    .gallery-thumb img {
      width: 100%;
      height: 65px;
      object-fit: cover;
      border-radius: 4px;
      display: block;
    }
    .gallery-thumb-index {
      position: absolute;
      top: 4px;
      left: 4px;
      font-size: 0.6rem;
      color: #d1d5db;
      background: rgba(0,0,0,0.5);
      padding: 1px 6px;
      border-radius: 8px;
    }
    .gallery-thumb-loading {
      width: 100%;
      height: 65px;
      background: #374151;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .gallery-thumb-loading .spinner {
      width: 16px;
      height: 16px;
      border-width: 2px;
    }

    @media (max-width: 768px) {
      .gallery-modal-content { max-height: 95vh; }
      .gallery-thumbnails { width: 100px; }
      .gallery-thumb img { height: 50px; }
      .gallery-header { flex-direction: column; gap: 8px; padding: 10px 14px; }
      .gallery-header-info { justify-content: center; }
      .gallery-header-actions { justify-content: center; flex-wrap: wrap; }
    }

    /* Modern select dropdown */
    .select-modern{
      position:relative;
      width:100%;
    }
    .select-modern-control{
      display:flex;align-items:center;justify-content:space-between;
      background:#ffffff;border:1px solid var(--gray);color:var(--text);
      padding:10px 12px;border-radius:10px;cursor:pointer;transition:all .2s ease;
      box-shadow:none;
      font-family: Arial, sans-serif;
      font-size:13.333px;
      font-weight:400;
      line-height:1.4;
      letter-spacing:normal;
    }
    .select-modern-control::after{
      content:"";width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:6px solid #64748b; margin-left:8px;
    }
    .select-modern.is-open .select-modern-control::after{ transform:rotate(180deg) }
    .select-modern-control:hover{ border-color:var(--blue); box-shadow:0 2px 8px rgba(37,99,235,.08) }
    .select-modern.is-open .select-modern-control, .select-modern-control:focus{ border-color:var(--blue); box-shadow:0 0 0 3px rgba(37,99,235,.15) }
    .select-modern-value{font-family: Arial, sans-serif; font-size:13.333px; font-weight:400; line-height:1.4 }
    .select-modern-menu{
      position:absolute;z-index:20;left:0;right:0;margin-top:6px;background:#ffffff;border:1px solid var(--gray);border-radius:10px;box-shadow:var(--shadow);
      max-height:260px;overflow:auto;display:none;
    }
    .select-modern.is-open .select-modern-menu{ display:block }
    .select-modern-option{ padding:10px 12px; cursor:pointer; font-family: Arial, sans-serif; font-size:13.333px; font-weight:400; line-height:1.4 }
    .select-modern-option:hover{ background:#f8fafc }
    .select-modern-option.selected{ background:#eef2ff; color:#1d4ed8 }
    .select-modern-value.select-placeholder{ color:#94a3b8; font-style:italic }

    /* Required Field Indicators */
    .cell-required-missing {
      border: 2px solid var(--red) !important;
      background-color: #fef2f2 !important;
      box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2) !important;
    }

    .cell-required-missing:focus {
      border-color: var(--red) !important;
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    }

    /* Title length warning (>64 chars = Kijiji truncation risk) */
    .cell-title-too-long {
      border: 2px solid var(--red) !important;
      background-color: #fef2f2 !important;
      box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2) !important;
    }
    .cell-title-too-long:focus {
      border-color: var(--red) !important;
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    }
    .textarea-too-long {
      border: 2px solid var(--red) !important;
      background-color: #fef2f2 !important;
      box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.2) !important;
    }
    .textarea-too-long:focus {
      border-color: var(--red) !important;
      box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
    }
    .title-length-warning {
      flex-shrink: 0;
      font-size: 0.7rem;
      font-weight: 700;
      color: #fff;
      background: var(--red);
      border-radius: 50%;
      width: 16px;
      height: 16px;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: default;
    }

    .textarea-label-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .textarea-char-count {
      font-size: 0.72rem;
      font-weight: 600;
      color: var(--red);
      white-space: nowrap;
    }

    .required-indicator {
      color: var(--red);
      font-weight: bold;
      margin-left: 4px;
      font-size: 0.9em;
    }

    /* Validation Status Indicators */
    .validation-status {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 2px 6px;
      border-radius: 4px;
      font-size: 0.75rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .validation-status.valid {
      background-color: #dcfce7;
      color: #166534;
      border: 1px solid #bbf7d0;
    }

    .validation-status.invalid {
      background-color: #fef2f2;
      color: #991b1b;
      border: 1px solid #fecaca;
    }

    .validation-status.warning {
      background-color: #fef3c7;
      color: #92400e;
      border: 1px solid #fde68a;
    }

    /* Required Field Summary */
    .validation-summary {
      background: linear-gradient(135deg, #fef2f2, #fee2e2);
      border: 1px solid #fecaca;
      border-radius: 8px;
      padding: 12px;
      margin: 8px 0;
    }

    .validation-summary h4 {
      margin: 0 0 8px 0;
      color: #991b1b;
      font-size: 0.9rem;
      font-weight: 600;
    }

    .validation-summary ul {
      margin: 0;
      padding-left: 16px;
      color: #7f1d1d;
      font-size: 0.85rem;
    }

    .validation-summary li {
      margin: 2px 0;
    }

    /* Enhanced Table Headers for Required Fields */
    th.required-header {
      position: relative;
    }

    /* Pulse animation for error highlighting */
    @keyframes pulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.05); }
      100% { transform: scale(1); }
    }

    /* ── Top Navigation Bar ── */
    .top-nav {
      background: rgba(255,255,255,0.98);
      border-top: 1px solid rgba(229,231,235,0.7);
      border-bottom: 1px solid rgba(229,231,235,0.7);
    }
    .top-nav-inner {
      max-width: 1400px;
      margin: 0 auto;
      padding: 0 var(--space-2);
      display: flex;
      align-items: center;
      gap: 2px;
      height: 40px;
    }
    .nav-tab {
      display: flex;
      align-items: center;
      gap: 7px;
      padding: 7px 16px;
      font-size: 0.85rem;
      font-weight: 600;
      color: var(--muted);
      border: none;
      border-radius: 10px;
      background: none;
      cursor: pointer;
      font-family: inherit;
      transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
      white-space: nowrap;
      position: relative;
      letter-spacing: 0.01em;
    }
    .nav-tab:hover {
      color: #1e40af;
      background: rgba(37,99,235,0.07);
    }
    .nav-tab.active {
      color: #1d4ed8;
      background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(124,58,237,0.09));
      box-shadow: 0 1px 4px rgba(37,99,235,0.14), inset 0 0 0 1px rgba(37,99,235,0.14);
    }
    .tab-icon {
      font-size: 0.95rem;
      line-height: 1;
      opacity: 0.85;
    }
    .nav-tab.active .tab-icon {
      opacity: 1;
    }

    .nav-badge {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-width: 17px;
      height: 17px;
      padding: 0 4px;
      background: linear-gradient(135deg, #f59e0b, #ef4444);
      color: #fff;
      border-radius: 9999px;
      font-size: 0.62rem;
      font-weight: 800;
      animation: navBadgePulse 2s ease-in-out infinite;
    }
    @keyframes navBadgePulse {
      0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
      50%       { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(245,158,11,0); }
    }

    .nav-right {
      margin-left: auto;
      display: flex;
      align-items: center;
    }

    .nav-feedback {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 14px;
      font-size: 0.8rem;
      font-weight: 600;
      color: var(--muted);
      border: 1px solid var(--gray);
      border-radius: 9999px;
      background: var(--soft);
      cursor: pointer;
      font-family: inherit;
      transition: all 0.2s ease;
    }
    .nav-feedback:hover {
      color: var(--blue);
      border-color: rgba(37,99,235,0.4);
      background: rgba(37,99,235,0.05);
      box-shadow: 0 2px 8px rgba(37,99,235,0.1);
    }

    .group-info-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 10px;
      border-radius: 8px;
      border: 1px dashed rgba(37,99,235,0.35);
      color: var(--blue);
      font-size: 0.85rem;
      font-weight: 600;
      background: rgba(37,99,235,0.04);
      cursor: pointer;
      transition: all 0.2s ease;
      font-family: inherit;
      text-decoration: none;
    }
    .group-info-link:hover {
      background: rgba(37,99,235,0.1);
      border-color: var(--blue);
      transform: translateY(-1px);
    }
    .group-info-icon {
      display: inline-flex;
      align-items: center;
      color: #6b7280;
      margin-right: 4px;
    }

    /* ═══════════════════════════════════════════════
       Tab Panels
       ═══════════════════════════════════════════════ */
    .tab-panel { display: block; }
    .tab-panel[hidden] { display: none !important; }
    #panel-inventory-controls[hidden] { display: none !important; }
    .reports-rc-detail[hidden] { display: none !important; }

    /* ═══════════════════════════════════════════════
       Reports Tab — Sidebar + Timeline Layout
       ═══════════════════════════════════════════════ */
    .reports-layout { display: flex; gap: 20px; align-items: flex-start; padding-top: 20px; }

    /* ── Sidebar ── */
    .reports-sidebar { width: 240px; flex-shrink: 0; position: sticky; top: 160px; display: flex; flex-direction: column; gap: 14px; }
    .reports-side-card { background: rgba(255,255,255,.92); border-radius: 16px; padding: 18px; border: 1px solid rgba(148,163,184,.2); box-shadow: 0 4px 14px rgba(24,39,75,.06); }
    .reports-side-title { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0 0 12px; }

    .reports-kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .reports-kpi { text-align: center; padding: 10px 4px; border-radius: 10px; background: rgba(248,250,252,.7); }
    .reports-kpi-value { font-size: 1.1rem; font-weight: 800; display: block; background: linear-gradient(135deg, var(--blue), var(--purple)); -webkit-background-clip: text; background-clip: text; color: transparent; }
    .reports-kpi-label { font-size: .65rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

    /* Sparkline */
    .reports-sparkline { display: flex; align-items: flex-end; gap: 3px; height: 56px; overflow: hidden; }
    .reports-spark-bar { flex: 1; min-width: 8px; border-radius: 3px 3px 0 0; transition: all .15s ease; position: relative; }
    .reports-spark-bar:hover { filter: brightness(1.15); }
    .reports-spark-bar--healthy { background: linear-gradient(180deg, var(--blue), var(--purple)); opacity: .7; }
    .reports-spark-bar--healthy:hover { opacity: 1; }
    .reports-spark-bar--attention { background: linear-gradient(180deg, #fbbf24, #f59e0b); opacity: .8; }
    .reports-spark-bar--error { background: linear-gradient(180deg, #fb7185, #ef4444); opacity: .85; }
    .reports-spark-bar .reports-spark-tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: #1e1b4b; color: #fff; font-size: .65rem; font-weight: 600; padding: 3px 7px; border-radius: 5px; white-space: nowrap; z-index: 10; }
    .reports-spark-bar:hover .reports-spark-tip { display: block; }

    /* Sidebar filters */
    .reports-side-filters { display: flex; flex-direction: column; gap: 4px; }
    .reports-side-filter { border: none; background: transparent; padding: 8px 12px; border-radius: 10px; font-size: .82rem; font-weight: 600; color: #475569; cursor: pointer; text-align: left; transition: all .15s ease; display: flex; justify-content: space-between; align-items: center; font-family: inherit; }
    .reports-side-filter:hover { background: rgba(248,250,252,.8); }
    .reports-side-filter.is-active { background: linear-gradient(135deg, var(--blue), var(--purple)); color: #fff; box-shadow: 0 4px 12px rgba(79,70,229,.18); }
    .reports-filter-count { font-size: .72rem; opacity: .65; }

    /* ── Timeline column ── */
    .reports-timeline-col { flex: 1; min-width: 0; }
    .reports-search-bar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
    .reports-search-input { flex: 1; background: var(--soft); border: 1px solid var(--gray); color: var(--text); padding: 8px 14px; border-radius: 10px; font-size: .85rem; outline: none; font-family: inherit; }
    .reports-search-input::placeholder { color: #94a3b8; }
    .reports-count-chip { font-size: .8rem; font-weight: 600; color: #475569; padding: 5px 10px; border-radius: 999px; background: rgba(148,163,184,.12); white-space: nowrap; }

    /* Timeline rail */
    .reports-timeline { position: relative; padding-left: 20px; }
    .reports-timeline::before { content: ""; position: absolute; top: 8px; left: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, rgba(148,163,184,.35), transparent); }

    /* Run card */
    .reports-run-card { position: relative; margin-bottom: 16px; padding: 18px 20px; border-radius: 16px; background: rgba(255,255,255,.95); border: 1px solid rgba(148,163,184,.2); box-shadow: 0 3px 10px rgba(24,39,75,.05); transition: transform .15s ease, box-shadow .15s ease; }
    .reports-run-card:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(15,23,42,.08); }
    .reports-run-card::before { content: ""; position: absolute; top: 24px; left: -14px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; background: linear-gradient(135deg, var(--blue), var(--purple)); box-shadow: 0 0 0 4px rgba(59,130,246,.12); }
    .reports-run-card[data-status="attention"]::before { background: linear-gradient(135deg, #fbbf24, #f59e0b); box-shadow: 0 0 0 4px rgba(251,191,36,.14); }
    .reports-run-card[data-status="error"]::before { background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 0 0 4px rgba(248,113,113,.16); }

    /* Card header */
    .reports-rc-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
    .reports-rc-date { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
    .reports-rc-time { font-size: .78rem; color: #64748b; margin: 2px 0 0; }
    .reports-status-chip { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
    .reports-status-chip--healthy { background: rgba(34,197,94,.1); color: #166534; }
    .reports-status-chip--attention { background: rgba(250,204,21,.14); color: #92400e; }
    .reports-status-chip--error { background: rgba(239,68,68,.12); color: #b91c1c; }

    /* Stats row */
    .reports-rc-stats { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
    .reports-rc-stat { display: flex; align-items: baseline; gap: 4px; }
    .reports-rc-stat-value { font-size: .95rem; font-weight: 700; color: var(--text); }
    .reports-rc-stat-label { font-size: .72rem; font-weight: 500; color: var(--muted); }

    /* Channel pills */
    .reports-rc-channels { display: flex; gap: 8px; flex-wrap: wrap; }
    .reports-ch-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; font-size: .78rem; font-weight: 600; border: 1px solid rgba(148,163,184,.18); background: rgba(248,250,252,.8); }
    .reports-ch-pill-name { color: var(--text); }
    .reports-ch-pill-stat { color: var(--muted); }
    .reports-ch-pill--pub .reports-ch-pill-stat { color: #166534; }
    .reports-ch-pill--skip .reports-ch-pill-stat { color: #475569; }
    .reports-ch-pill--err .reports-ch-pill-stat { color: #b91c1c; }
    .reports-express-chip {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 12px;
      border-radius: 10px;
      font-size: .78rem;
      font-weight: 700;
      color: #92400e;
      background: rgba(245,158,11,.12);
      border: 1px solid rgba(245,158,11,.4);
    }
    .reports-express-chip svg { width: 13px; height: 13px; display: block; }

    /* Toggle */
    .reports-rc-toggle { border: 0; background: none; color: var(--blue); font-size: .78rem; font-weight: 600; cursor: pointer; padding: 6px 0; margin-top: 6px; display: inline-flex; align-items: center; gap: 4px; transition: color .15s ease; font-family: inherit; }
    .reports-rc-toggle:hover { color: var(--purple); }
    .reports-toggle-arrow { display: inline-block; transition: transform .2s ease; font-size: .65rem; }
    .reports-rc-toggle.is-open .reports-toggle-arrow { transform: rotate(180deg); }

    /* Detail panel */
    .reports-rc-detail { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(248,250,252,.7); border: 1px solid rgba(148,163,184,.15); display: grid; gap: 14px; }
    .reports-detail-label { font-size: .75rem; font-weight: 700; color: var(--text); margin: 0 0 6px; }
    .reports-dur-row { display: flex; flex-wrap: wrap; gap: 6px; }
    .reports-dur-pill { background: #fff; border-radius: 8px; padding: 5px 10px; border: 1px solid rgba(148,163,184,.18); font-size: .78rem; display: inline-flex; gap: 6px; }
    .reports-dur-name { font-weight: 600; color: #475569; }
    .reports-dur-val { font-weight: 700; color: var(--text); }
    .reports-obs-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; font-size: .78rem; font-weight: 600; margin-bottom: 4px; }
    .reports-obs-item--info { background: rgba(59,130,246,.08); color: #1d4ed8; }
    .reports-obs-item--warning { background: rgba(250,204,21,.1); color: #92400e; }
    .reports-obs-item--error { background: rgba(239,68,68,.1); color: #b91c1c; }
    .reports-obs-ok { padding: 6px 10px; border-radius: 8px; background: rgba(34,197,94,.08); color: #166534; font-size: .78rem; font-weight: 600; }
    .reports-vin-grid { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
    .reports-vin-pill { background: #fff; border: 1px solid rgba(99,102,241,.18); border-radius: 999px; padding: 3px 10px; font-size: .72rem; font-weight: 600; color: #312e81; letter-spacing: .03em; }
    .reports-vin-pill--republished { background: #fffbeb; border-color: rgba(245,158,11,.3); color: #92400e; }
    .sk-reports-kpi { height: 52px; border-radius: 10px; }
    .sk-reports-spark { height: 56px; border-radius: 8px; }
    .sk-reports-filter { height: 36px; border-radius: 10px; }
    .sk-reports-card { border-radius: 16px; padding: 18px; background: rgba(255,255,255,.92); border: 1px solid rgba(148,163,184,.2); box-shadow: 0 4px 14px rgba(24,39,75,.06); display: flex; flex-direction: column; gap: 10px; }
    .sk-reports-chip { height: 22px; border-radius: 999px; }
    .sk-reports-stat { height: 10px; border-radius: 4px; }

    /* Empty */
    .reports-empty { text-align: center; padding: 40px 20px; border-radius: 16px; background: rgba(255,255,255,.9); border: 1px dashed rgba(148,163,184,.3); color: #475569; font-size: .9rem; font-weight: 500; }

    @media (max-width: 900px) {
      .reports-layout { flex-direction: column; }
      .reports-sidebar { width: 100%; position: relative; top: 0; flex-direction: row; flex-wrap: wrap; gap: 10px; }
      .reports-side-card { flex: 1; min-width: 180px; }
      .reports-timeline { padding-left: 0; }
      .reports-timeline::before { display: none; }
      .reports-run-card::before { display: none; }
    }
    @media (max-width: 640px) {
      .reports-rc-stats { gap: 10px; }
      .reports-rc-channels { gap: 6px; }
      .reports-sidebar { flex-direction: column; }
      .reports-side-card { min-width: auto; }
    }

    /* ═══════════════════════════════════════════════
       Schedule Tab
       ═══════════════════════════════════════════════ */
    .schedule-layout {
      display: flex;
      gap: 24px;
      align-items: flex-start;
      padding-top: 24px;
    }
    .schedule-sidebar {
      width: 220px;
      flex-shrink: 0;
      position: sticky;
      top: 160px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .schedule-side-card {
      background: rgba(255,255,255,.92);
      border-radius: 16px;
      padding: 18px;
      border: 1px solid rgba(148,163,184,.2);
      box-shadow: 0 4px 14px rgba(24,39,75,.06);
    }
    .schedule-side-title {
      font-size: .7rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .08em;
      margin: 0 0 12px;
    }
    .schedule-countdown-display { text-align: center; padding: 4px 0 6px; }
    .schedule-countdown {
      font-size: 1.9rem;
      font-weight: 800;
      letter-spacing: .04em;
      background: linear-gradient(135deg, var(--blue), var(--purple));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      line-height: 1.1;
      font-variant-numeric: tabular-nums;
    }
    .schedule-countdown-sub { font-size: .78rem; font-weight: 600; color: var(--muted); margin-top: 6px; }
    .schedule-week-stats { display: flex; gap: 10px; }
    .schedule-week-stat { flex: 1; text-align: center; padding: 10px 4px; border-radius: 10px; background: rgba(248,250,252,.7); }
    .schedule-week-value {
      display: block;
      font-size: 1.5rem;
      font-weight: 800;
      background: linear-gradient(135deg, var(--blue), var(--purple));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
    }
    .schedule-week-value--muted { background: none; color: var(--muted); }
    .schedule-week-label { font-size: .65rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
    .btn-save-schedule {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      padding: 12px 22px;
      border: 1px solid rgba(255,255,255,.16);
      border-radius: 999px;
      background: linear-gradient(135deg, var(--blue), var(--purple));
      color: #fff;
      font-size: .95rem;
      font-weight: 700;
      cursor: pointer;
      transition: all .2s ease;
      box-shadow: 0 6px 20px rgba(124,58,237,.35);
      font-family: inherit;
    }
    .btn-save-schedule .btn-icon { width: 18px; height: 18px; }
    .btn-save-schedule .btn-icon svg { display: block; width: 100%; height: 100%; }
    .btn-save-schedule:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(124,58,237,.45); }
    .btn-save-schedule:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 0 2px 6px rgba(156,163,175,.2); }
    .btn-reset-schedule {
      background: none;
      border: none;
      color: var(--muted);
      font-size: .8rem;
      font-weight: 600;
      cursor: pointer;
      text-align: center;
      padding: 4px 0;
      font-family: inherit;
      text-decoration: underline;
      text-decoration-style: dotted;
      transition: color .15s ease;
    }
    .btn-reset-schedule:hover { color: var(--text); }

    .express-side-summary {
      font-size: .82rem;
      color: var(--muted);
      margin: 0 0 12px;
      text-align: center;
    }
    .btn-express-run {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      width: 100%;
      padding: 12px 22px;
      border: 1px solid rgba(255,255,255,.16);
      border-radius: 999px;
      background: linear-gradient(135deg, var(--orange), #ea580c);
      color: #fff;
      font-size: .95rem;
      font-weight: 700;
      cursor: pointer;
      font-family: inherit;
      transition: transform .15s ease, box-shadow .15s ease;
      box-shadow: 0 6px 20px rgba(245,158,11,.35);
    }
    .btn-express-run .btn-icon { width: 18px; height: 18px; }
    .btn-express-run .btn-icon svg { display: block; width: 100%; height: 100%; }
    .btn-express-run:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(245,158,11,.45); }
    .btn-express-run:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 0 2px 6px rgba(156,163,175,.2); }
    .express-side-status {
      font-size: .78rem;
      color: var(--muted);
      text-align: center;
      margin: 10px 0 0;
      min-height: 1.1em;
    }
    .schedule-info-callout {
      display: flex;
      align-items: flex-start;
      gap: 10px;
      padding: 12px 16px;
      margin-bottom: 16px;
      background: var(--color-info-bg, #e8f4fd);
      border-left: 3px solid var(--color-info, #2196f3);
      border-radius: 4px;
      font-size: 0.9rem;
      color: var(--text-muted, #555);
    }
    .schedule-info-icon { flex-shrink: 0; }

    .schedule-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; }
    .schedule-feed { display: flex; flex-direction: column; gap: 10px; }

    .schedule-day-row {
      display: flex;
      align-items: center;
      gap: 16px;
      background: rgba(255,255,255,.88);
      border: 1px solid rgba(229,231,235,.8);
      border-radius: 14px;
      padding: 14px 18px 14px 0;
      box-shadow: 0 2px 8px rgba(24,39,75,.05);
      transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
      overflow: hidden;
    }
    .schedule-day-row:hover { box-shadow: 0 6px 18px rgba(24,39,75,.09); transform: translateY(-1px); }
    .schedule-day-accent {
      width: 5px;
      align-self: stretch;
      border-radius: 0 4px 4px 0;
      flex-shrink: 0;
      background: linear-gradient(180deg, var(--blue), var(--purple));
      transition: background .2s ease;
    }
    .schedule-day-row.is-disabled .schedule-day-accent { background: var(--gray); }
    .schedule-day-row[data-modified="true"] .schedule-day-accent { background: linear-gradient(180deg, #f59e0b, #d97706); }
    .schedule-day-row.is-next { border-color: rgba(37,99,235,.35); box-shadow: 0 4px 18px rgba(37,99,235,.12), 0 0 0 1px rgba(37,99,235,.12); }

    .schedule-day-info { display: flex; flex-direction: column; gap: 2px; min-width: 110px; }
    .schedule-day-label { font-size: .95rem; font-weight: 700; color: var(--text); }
    .schedule-day-row.is-disabled .schedule-day-label { color: var(--muted); }
    .schedule-day-type { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
    .schedule-day-type--weekend { color: #7c3aed; }
    .schedule-day-row.is-disabled .schedule-day-type { color: #cbd5e1; }

    .schedule-toggle { display: inline-flex; align-items: center; cursor: pointer; flex-shrink: 0; }
    .schedule-toggle-input { position: absolute; opacity: 0; width: 0; height: 0; }
    .schedule-toggle-track { width: 40px; height: 22px; border-radius: 999px; background: #e2e8f0; position: relative; transition: background .2s ease; display: block; }
    .schedule-toggle-input:checked + .schedule-toggle-track { background: linear-gradient(135deg, var(--blue), var(--purple)); }
    .schedule-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); transition: transform .2s ease; }
    .schedule-toggle-input:checked + .schedule-toggle-track .schedule-toggle-thumb { transform: translateX(18px); }

    .schedule-time-select {
      flex: 1;
      max-width: 160px;
      padding: 8px 30px 8px 12px;
      border: 1px solid var(--gray);
      border-radius: 10px;
      background: var(--soft);
      color: var(--text);
      font-size: .88rem;
      font-weight: 600;
      outline: none;
      cursor: pointer;
      font-family: inherit;
      transition: border-color .15s ease, box-shadow .15s ease;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 10px center;
    }
    .schedule-time-select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
    .schedule-time-select:disabled { opacity: .45; cursor: not-allowed; }

    .schedule-next-chip {
      font-size: .65rem;
      font-weight: 800;
      letter-spacing: .06em;
      padding: 3px 9px;
      border-radius: 999px;
      background: linear-gradient(135deg, var(--blue), var(--purple));
      color: #fff;
      flex-shrink: 0;
      animation: navBadgePulse 2s ease-in-out infinite;
    }
    .schedule-day-row[data-modified="true"] .schedule-day-label::after {
      content: " ●";
      color: #f59e0b;
      font-size: .55rem;
      vertical-align: super;
    }

    @media (max-width: 768px) {
      .schedule-layout { flex-direction: column; }
      .schedule-sidebar { width: 100%; position: relative; top: 0; flex-direction: row; flex-wrap: wrap; gap: 10px; }
      .schedule-side-card { flex: 1; min-width: 160px; }
      .btn-save-schedule, .btn-reset-schedule { flex: 1 1 100%; }
      .schedule-time-select { max-width: 130px; }
    }

    /* ═══════════════════════════════════════════════
       Novedades (Changelog) Tab
       ═══════════════════════════════════════════════ */
    .news-layout {
      display: flex;
      gap: 24px;
      align-items: flex-start;
      padding-top: 24px;
    }

    /* ── Sidebar ── */
    .news-sidebar {
      width: 220px;
      flex-shrink: 0;
      position: sticky;
      top: 160px;
      display: flex;
      flex-direction: column;
      gap: 14px;
    }
    .news-side-card {
      background: rgba(255,255,255,.92);
      border-radius: 16px;
      padding: 18px;
      border: 1px solid rgba(148,163,184,.2);
      box-shadow: 0 4px 14px rgba(24,39,75,.06);
    }
    .news-side-title {
      font-size: .7rem;
      font-weight: 700;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .08em;
      margin: 0 0 12px;
    }
    .news-side-stat {
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 12px 0;
    }
    .news-side-stat-value {
      font-size: 2rem;
      font-weight: 800;
      background: linear-gradient(135deg, var(--blue), var(--purple));
      -webkit-background-clip: text;
      background-clip: text;
      color: transparent;
      line-height: 1;
    }
    .news-side-stat-label {
      font-size: .72rem;
      font-weight: 600;
      color: var(--muted);
      text-transform: uppercase;
      letter-spacing: .04em;
      margin-top: 4px;
    }
    .news-type-legend {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .news-legend-row {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: .8rem;
      font-weight: 500;
      color: #475569;
    }
    .news-legend-dot {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    /* ── Feed column ── */
    .news-feed { flex: 1; min-width: 0; }
    .news-version-group { margin-bottom: 36px; }
    .news-version-header {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 16px;
    }
    .news-version-tag {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 14px;
      background: linear-gradient(135deg, var(--blue), var(--purple));
      color: #fff;
      border-radius: 999px;
      font-size: .78rem;
      font-weight: 800;
      letter-spacing: .04em;
      box-shadow: 0 4px 12px rgba(37,99,235,.25);
    }
    .news-version-date {
      font-size: .8rem;
      font-weight: 600;
      color: var(--muted);
    }
    .news-version-divider {
      flex: 1;
      height: 1px;
      background: linear-gradient(90deg, var(--gray), transparent);
    }
    .news-new-badge {
      display: inline-flex;
      align-items: center;
      padding: 3px 10px;
      background: linear-gradient(135deg, #f59e0b, #ef4444);
      color: #fff;
      border-radius: 999px;
      font-size: .65rem;
      font-weight: 800;
      letter-spacing: .04em;
      animation: navBadgePulse 2s ease-in-out infinite;
    }

    .news-entry {
      display: flex;
      gap: 14px;
      padding: 14px 16px;
      background: rgba(255,255,255,.85);
      border: 1px solid rgba(229,231,235,.8);
      border-radius: 12px;
      margin-bottom: 10px;
      box-shadow: 0 2px 8px rgba(24,39,75,.05);
      transition: box-shadow .2s ease, transform .2s ease;
    }
    .news-entry:hover {
      box-shadow: 0 6px 18px rgba(24,39,75,.10);
      transform: translateY(-1px);
    }
    .news-entry-icon {
      width: 36px;
      height: 36px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }
    .news-entry-icon.feat     { background: linear-gradient(135deg, #ede9fe, #ddd6fe); color: #6d28d9; }
    .news-entry-icon.fix      { background: linear-gradient(135deg, #dcfce7, #bbf7d0); color: #15803d; }
    .news-entry-icon.refactor { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; }
    .news-entry-icon.perf     { background: linear-gradient(135deg, #e0f2fe, #bae6fd); color: #0369a1; }

    .news-entry-body { flex: 1; min-width: 0; }
    .news-entry-title {
      font-size: .92rem;
      font-weight: 700;
      color: var(--text);
      margin: 0 0 4px;
      display: flex;
      align-items: center;
      gap: 8px;
      flex-wrap: wrap;
    }
    .news-type-chip {
      display: inline-flex;
      align-items: center;
      padding: 2px 8px;
      border-radius: 6px;
      font-size: .67rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .05em;
      flex-shrink: 0;
    }
    .news-type-chip.feat     { background: #ede9fe; color: #6d28d9; }
    .news-type-chip.fix      { background: #dcfce7; color: #15803d; }
    .news-type-chip.refactor { background: #fef3c7; color: #b45309; }
    .news-type-chip.perf     { background: #e0f2fe; color: #0369a1; }
    .news-type-chip.test     { background: #f1f5f9; color: #475569; }

    .news-entry-desc {
      font-size: .83rem;
      color: #475569;
      margin: 0;
      line-height: 1.5;
    }
    ul.news-entry-desc {
      padding-left: 1.2rem;
    }

    .news-entry-media {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-top: 12px;
    }
    .news-entry-media img {
      display: block;
      width: 100%;
      max-width: 640px;
      height: auto;
      border-radius: 8px;
      border: 1px solid rgba(229,231,235,.9);
      box-shadow: 0 2px 8px rgba(24,39,75,.06);
    }
    .news-entry-media-caption {
      font-size: .72rem;
      color: #94a3b8;
      margin: 0;
    }

    @media (max-width: 768px) {
      .news-layout { flex-direction: column; }
      .news-sidebar { width: 100%; position: relative; top: 0; }
    }

/* ── Skeleton loading ── */
@keyframes sk-shimmer { 0% { background-position: -600px 0 } 100% { background-position: 600px 0 } }
.sk { display:inline-block; background:linear-gradient(90deg,#e5e7eb 25%,#f1f5f9 50%,#e5e7eb 75%); background-size:1200px 100%; animation:sk-shimmer 1.6s infinite linear; border-radius:4px; }
.sk-round { border-radius:999px !important; }
@keyframes sk-spin { to { transform: rotate(360deg); } }
.sk-spinner { display:inline-block; width:9px; height:9px; border:1.5px solid #93c5fd; border-top-color:var(--blue); border-radius:50%; animation:sk-spin 0.7s linear infinite; vertical-align:middle; margin-right:4px; }
.card.table-wrap { position:relative; }
@keyframes sk-wave { 0% { transform:translateX(-100%) } 100% { transform:translateX(200%) } }
.sk-wave-overlay { position:absolute; inset:0; pointer-events:none; overflow:hidden; border-radius:16px; z-index:1; }
.sk-wave-overlay::after { content:''; position:absolute; inset:0; background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.6) 40%,rgba(255,255,255,.8) 50%,rgba(255,255,255,.6) 60%,transparent 100%); animation:sk-wave 1.6s ease-in-out infinite; }

/* Tablet and mobile fit fixes. Desktop rules above stay unchanged. */
@media (max-width: 1199px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  .container {
    width: 100%;
    max-width: none;
    padding-left: 16px;
    padding-right: 16px;
  }

  .title-row {
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
  }

  h1,
  .title-heading {
    width: 100%;
    font-size: clamp(1.2rem, 3.2vw, 2rem);
    white-space: normal;
    line-height: 1.12;
  }

  .kpis {
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .kpis > * {
    flex: 0 0 auto;
  }

  .top-nav {
    margin-left: -16px;
    margin-right: -16px;
  }

  .top-nav-inner {
    max-width: none;
    height: auto;
    min-height: 44px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 16px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .nav-tab {
    flex: 0 0 auto;
  }

  .nav-right {
    display: none;
  }

  .compact-action-bar {
    gap: 12px;
    overflow: hidden;
  }

  .action-group {
    min-width: 0;
  }

  .group-header {
    flex-wrap: wrap;
    min-width: 0;
  }

  .group-info-link {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .group-actions {
    flex: 0 0 auto;
  }

  .toolbar {
    overflow: hidden;
  }

  .toolbar-filters {
    min-width: 0;
    width: 100%;
  }

  .filter-group {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table {
    min-width: 920px;
    font-size: .9rem;
  }

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

  #inventoryTable th:nth-child(2),
  #inventoryTable td:nth-child(2) {
    width: 190px;
    min-width: 190px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  h1,
  .title-heading {
    font-size: 1.38rem;
  }

  .kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .kpis > * {
    min-width: 0;
  }

  .account-chip {
    grid-column: span 2;
    max-width: none;
    width: 100%;
  }

  .chip-name {
    max-width: 84px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #tenantSelectorWrap {
    grid-column: span 1;
    min-width: 0;
  }

  #tenantSelectorWrap select {
    max-width: 100% !important;
    min-width: 0;
  }

  .kpi,
  .status-indicator {
    width: 100%;
    justify-content: center;
    padding: 5px 8px;
    font-size: .78rem;
  }

  .kpi span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #connectionStatus {
    grid-column: span 2;
  }

  .top-nav {
    margin-left: -14px;
    margin-right: -14px;
  }

  .top-nav-inner {
    overflow: visible;
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav-tab {
    padding: 7px 12px;
    font-size: .82rem;
  }

  .compact-action-bar {
    padding: 10px 12px;
  }

  .action-group {
    gap: 12px;
  }

  .group-header {
    min-width: 0;
  }

  .group-info-link {
    max-width: 260px;
  }

  .btn-primary-large {
    padding: 10px 16px;
    font-size: .84rem;
  }

  .toolbar {
    padding: 8px 10px;
  }

  .toolbar-filters {
    display: grid;
    grid-template-columns: minmax(0, max-content) minmax(0, max-content) minmax(0, 1fr);
    gap: 6px;
    align-items: center;
  }

  .filter-group {
    overflow: visible;
  }

  .filter-btn {
    padding: 4px 9px;
    font-size: .72rem;
  }

  .search {
    width: 100%;
    min-width: 0;
    padding: 5px 10px;
    font-size: .76rem;
  }

  .table-header {
    padding: 8px 12px;
  }

  .table-actions {
    max-width: 360px;
    gap: 8px;
  }

  .btn-add-vehicle-inline,
  .btn-remove-selection,
  .btn-republish-all {
    padding: 5px 9px;
    font-size: .74rem;
  }

  table {
    min-width: 0;
    table-layout: fixed;
    font-size: .78rem;
  }

  thead th,
  tbody td {
    padding: 9px 5px;
  }

  #inventoryTable th:nth-child(1),
  #inventoryTable td:nth-child(1) {
    width: 28px;
  }

  #inventoryTable th:nth-child(2),
  #inventoryTable td:nth-child(2) {
    width: 165px;
    min-width: 165px;
  }

  #inventoryTable th:nth-child(3),
  #inventoryTable td:nth-child(3) {
    width: 205px;
  }

  #inventoryTable th:nth-child(4),
  #inventoryTable td:nth-child(4) {
    width: 52px;
  }

  #inventoryTable th:nth-child(5),
  #inventoryTable td:nth-child(5) {
    width: 68px;
  }

  #inventoryTable th:nth-child(6),
  #inventoryTable td:nth-child(6) {
    width: 68px;
  }

  #inventoryTable th:nth-child(7),
  #inventoryTable td:nth-child(7),
  #inventoryTable th:nth-child(8),
  #inventoryTable td:nth-child(8) {
    width: 28px;
  }

  #inventoryTable th:nth-child(9),
  #inventoryTable td:nth-child(9),
  #inventoryTable th:nth-child(10),
  #inventoryTable td:nth-child(10) {
    width: 72px;
  }

  #inventoryTable .cell-editable {
    padding: 6px 5px;
    min-width: 0;
  }

  .cell-title-wrapper .cell-editable {
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .badge {
    padding: 5px 8px;
    font-size: .7rem;
  }

  #inventoryTable tr.details td {
    padding: 8px 10px 12px;
  }

  .details-card {
    width: 100%;
    margin: 0;
    padding: 12px;
    overflow: hidden;
  }

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

  .details-grid .full {
    grid-column: 1 / -1;
  }

  .form-item {
    min-width: 0;
  }

  .form-item input,
  .form-item textarea,
  .form-item select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .form-actions {
    justify-content: flex-start;
    gap: 8px;
  }

  .form-actions button {
    flex: 1 1 180px;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  header .container {
    padding-top: 8px;
  }

  .title-row {
    gap: 8px;
  }

  h1,
  .title-heading {
    font-size: 1.18rem;
  }

  .kpi,
  .status-indicator {
    padding: 4px 9px;
    font-size: .76rem;
  }

  .kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    overflow: visible;
    padding-bottom: 0;
  }

  .kpis > * {
    min-width: 0;
  }

  .account-chip {
    grid-column: span 2;
    max-width: none;
    width: 100%;
    justify-content: flex-start;
  }

  .chip-name {
    max-width: 86px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #tenantSelectorWrap {
    grid-column: span 1;
    min-width: 0;
  }

  #tenantSelectorWrap select {
    max-width: 100% !important;
    min-width: 0;
  }

  .kpi,
  .status-indicator {
    justify-content: center;
    width: 100%;
  }

  .kpi span:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #connectionStatus {
    grid-column: 1 / -1;
  }

  .top-nav {
    margin-left: -12px;
    margin-right: -12px;
  }

  .top-nav-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-left: 12px;
    padding-right: 12px;
    overflow: visible;
  }

  .nav-tab {
    width: 100%;
    min-width: 0;
    justify-content: center;
    padding: 7px 12px;
    font-size: .8rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .compact-action-bar {
    padding: 10px;
  }

  .action-group,
  .group-header {
    align-items: stretch;
  }

  .group-header {
    display: grid;
    grid-template-columns: auto auto auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    justify-content: stretch;
  }

  .group-info-link {
    flex: initial;
    min-width: 0;
    justify-content: center;
  }

  .group-actions {
    justify-content: center;
  }

  .btn-drive {
    width: 96px;
    min-width: 96px;
    height: 38px;
  }

  .toolbar {
    padding: 8px 10px;
  }

  .toolbar-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .filter-divider {
    display: none;
  }

  .filter-btn {
    padding: 4px 10px;
    font-size: .76rem;
  }

  .search {
    min-width: 0;
    width: 100%;
    font-size: .78rem;
  }

  .card.table-wrap {
    overflow: visible;
  }

  .table-header {
    padding: 10px 12px;
  }

  .table-actions,
  .action-group-left {
    width: 100%;
  }

  .action-group-left {
    justify-content: flex-start;
  }

  .btn-add-vehicle-inline,
  .btn-remove-selection,
  .btn-republish-all {
    min-width: 42px;
    height: 36px;
    padding: 8px 10px;
  }

  .btn-add-vehicle-inline {
    flex: 1 1 auto;
    justify-content: center;
  }

  #inventoryTable {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: separate;
  }

  #inventoryTable thead {
    display: none;
  }

  #inventoryTable tbody {
    display: grid;
    gap: 10px;
    padding: 10px;
    background: #f8fafc;
  }

  #inventoryTable tr.main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--gray);
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(24,39,75,.05);
  }

  #inventoryTable tr.main:hover td {
    background: transparent;
  }

  #inventoryTable tr.main td {
    display: flex;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
    align-items: center;
  }

  #inventoryTable tr.main td::before {
    content: attr(data-mobile-label);
    flex: 0 0 72px;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }

  #inventoryTable tr.main td:nth-child(1) {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    min-width: 22px;
  }

  #inventoryTable tr.main td:nth-child(1)::before,
  #inventoryTable tr.main td:nth-child(7)::before,
  #inventoryTable tr.main td:nth-child(8)::before {
    content: none;
  }

  #inventoryTable tr.main td:nth-child(2),
  #inventoryTable tr.main td:nth-child(3) {
    grid-column: 1 / -1;
    width: auto;
    min-width: 0;
  }

  #inventoryTable tr.main td:nth-child(4),
  #inventoryTable tr.main td:nth-child(5),
  #inventoryTable tr.main td:nth-child(6),
  #inventoryTable tr.main td:nth-child(9),
  #inventoryTable tr.main td:nth-child(10) {
    grid-column: 1 / -1;
  }

  #inventoryTable tr.main td:nth-child(7),
  #inventoryTable tr.main td:nth-child(8) {
    grid-column: auto;
    justify-content: center;
  }

  #inventoryTable tr.main td:nth-child(2)::before { content: "VIN"; }
  #inventoryTable tr.main td:nth-child(3)::before { content: "Title"; }
  #inventoryTable tr.main td:nth-child(4)::before { content: "Year"; }
  #inventoryTable tr.main td:nth-child(5)::before { content: "Odometer"; }
  #inventoryTable tr.main td:nth-child(6)::before { content: "Price"; }
  #inventoryTable tr.main td:nth-child(9)::before { content: "Kijiji"; }
  #inventoryTable tr.main td:nth-child(10)::before { content: "Website"; }

  #inventoryTable .cell-editable {
    flex: 1;
    min-width: 0;
    padding: 6px 8px;
    font-size: .9rem;
  }

  .vin-cell,
  .cell-title-wrapper,
  .cell-vin-wrapper {
    flex: 1;
    min-width: 0;
  }

  .cell-title-wrapper .cell-editable {
    line-height: 1.35;
    overflow-wrap: anywhere;
  }

  .row-cb {
    display: inline-block;
  }

  .icon-status-td {
    width: auto;
  }

  .badges {
    flex: 1;
  }

  .badge {
    padding: 5px 9px;
    font-size: .74rem;
  }

  #inventoryTable tr.details {
    display: block;
  }

  #inventoryTable tr.details.hidden {
    display: none !important;
  }

  #inventoryTable tr.details td {
    display: block;
    padding: 0 10px 10px;
    border: 0;
    background: #f8fafc;
  }

  .details-card {
    margin: 0;
    padding: 12px;
  }

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

