/* =========================
   Tipografía y paleta
   ========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

:root{
  --primary-500:#6273FF;
  --primary-50:#EEF0FE;
  --neutral-900:#0F172A;
  --neutral-700:#475569;
  --neutral-200:#E2E8F0;
  --neutral-50:#F8FAFC;
  --white:#FFFFFF;
  --ring: 0 0 0 3px rgba(98,115,255,.2);
}

/* Reset mínimo */
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial,sans-serif;
  color:var(--neutral-900);
  background:linear-gradient(180deg,var(--neutral-50),#fff);
}

/* Utilidades */
.hidden{display:none}
.md\:table-row-group{display:table-row-group}
.only-mobile{display:none}
@media (max-width:768px){ .only-mobile{display:block} }

.mt-4{margin-top:16px}
.mt-6{margin-top:24px}
.center{display:flex;justify-content:center}

/* Animación sutil */
.fade-in{animation:fade .35s ease-out both}
@keyframes fade{
  from{opacity:0; transform:translateY(6px)}
  to{opacity:1; transform:translateY(0)}
}

/* Página/Contenedor */
.tv-page{padding:24px}
.tv-container{
  max-width:1100px;
  margin:auto;
  padding:24px;
}
.tv-title{font-size:20px; font-weight:600; color:var(--neutral-900); margin:0 0 6px}
.tv-subtitle{font-size:14px; color:var(--neutral-700); margin:0}

/* Topbar */
.tv-topbar{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; padding:16px 0; border-bottom:1px solid var(--neutral-200);
}
.topbar-left .tv-title{margin:0}
.label{font-size:12px; color:var(--neutral-700); display:block; margin-bottom:6px}

/* Inputs */
.tv-input, .command-input, .tv-select{
  width:100%;
  height:48px;
  padding:0 14px;
  border:1px solid var(--neutral-200);
  border-radius:12px;
  background:var(--white);
  color:var(--neutral-900);
  outline:none;
  transition:box-shadow .2s, border-color .2s;
}
.tv-input:focus, .command-input:focus, .tv-select:focus{box-shadow:var(--ring); border-color:var(--primary-500)}
.tv-input{height:auto; padding:12px 14px; border-radius:14px}

/* Botones */
.tv-btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; height:48px; padding:0 18px;
  border-radius:9999px; border:1px solid transparent;
  font-weight:600; cursor:pointer; transition:all .2s ease;
  user-select:none;
}
.tv-btn:focus-visible{box-shadow:var(--ring)}
.tv-btn-primary{
  background:var(--primary-500); color:#fff;
  box-shadow:0 6px 16px rgba(98,115,255,.25);
}
.tv-btn-primary:hover{transform:translateY(-1px)}
.tv-btn-ghost{
  background:transparent; color:var(--neutral-900); border-color:var(--neutral-200);
}
.tv-btn-ghost:hover{background:var(--neutral-50)}

/* Cards */
.tv-card{
  background:var(--white);
  border:1px solid var(--neutral-200);
  border-radius:16px;
  padding:24px;
  box-shadow:0 6px 16px rgba(2,6,23,.04);
  transition:transform .2s ease, box-shadow .2s ease;
}
.tv-card:hover{transform:translateY(-1px); box-shadow:0 10px 24px rgba(2,6,23,.06)}
.card-title{font-size:16px; font-weight:600; margin:0 0 12px}

/* Tiles (menú) */
.tiles-grid{
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin-top:20px;
}
@media (max-width:768px){ .tiles-grid{grid-template-columns:1fr} }
.menu-tile{display:flex; align-items:center; gap:16px}
.menu-tile.clickable{cursor:pointer}
.tile-icon{
  width:44px; height:44px; border-radius:12px;
  background:var(--primary-50); color:var(--primary-500);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.tile-icon .icon{width:22px; height:22px}
.tile-content{flex:1}
.tile-title{font-size:16px; font-weight:600; margin:0 0 4px}
.tile-subtitle{font-size:13px; color:var(--neutral-700); margin:0}
.tile-cta .chev{width:20px; height:20px; color:var(--neutral-700)}

/* Command bar (filtros) */
.command-bar{
  display:flex; gap:12px; align-items:center; margin:16px 0 20px;
  background:var(--white); border:1px solid var(--neutral-200); border-radius:16px; padding:10px;
}
.command-item{display:flex; align-items:center; gap:8px}
.command-item .icon{width:18px; height:18px; color:var(--neutral-700)}
.flex-1{flex:1}

/* Tabla */
.table-wrap{
  width:100%; overflow:auto;
  background:var(--white); border:1px solid var(--neutral-200); border-radius:16px;
  box-shadow:0 6px 16px rgba(2,6,23,.04);
}
.inventory-table{width:100%; border-collapse:separate; border-spacing:0}
.inventory-table thead th{
  text-align:left; font-size:12px; font-weight:700; letter-spacing:.02em;
  color:var(--neutral-700); background:var(--neutral-50);
  padding:12px 14px; border-bottom:1px solid var(--neutral-200);
}
.inventory-table tbody td{
  padding:12px 14px; border-bottom:1px solid var(--neutral-200); font-size:14px; color:var(--neutral-900)
}
.inventory-table tbody tr:hover{background:rgba(15,23,42,.02)}

/* Cards mobile generadas por JS */
@media (max-width:768px){
  .card-producto, .card-inventario{
    background:var(--white); border:1px solid var(--neutral-200); border-radius:16px;
    padding:16px; box-shadow:0 4px 12px rgba(2,6,23,.04); margin-bottom:14px; font-size:14px;
  }
  .card-producto h4{margin:0 0 8px; font-size:15px}
  .card-producto label{display:block; margin-top:10px; font-weight:600; color:var(--neutral-900)}
  .card-producto input[type="number"], .card-producto select{
    width:100%; height:44px; padding:0 12px; border:1px solid var(--neutral-200);
    border-radius:12px; margin-top:6px; font-size:14px; outline:none;
  }
  .card-producto input[type="number"]:focus, .card-producto select:focus{box-shadow:var(--ring); border-color:var(--primary-500)}
}

/* Inputs en tabla generados por JS */
.inventory-table input[type="number"]{
  width:80px; height:40px; padding:0 8px; border:1px solid var(--neutral-200); border-radius:10px; text-align:center; font-size:14px; outline:none;
}
.inventory-table input[type="number"]:focus{box-shadow:var(--ring); border-color:var(--primary-500)}
.inventory-table select{
  height:40px; padding:0 10px; border:1px solid var(--neutral-200); border-radius:10px; outline:none;
}
.inventory-table select:focus{box-shadow:var(--ring); border-color:var(--primary-500)}

/* Secciones */
.tv-section{margin-top:16px}

/* Barra de acciones (sticky en mobile) */
.actions-bar{
  position:sticky; bottom:0; left:0; right:0;
  display:flex; gap:12px; justify-content:center;
  padding:16px; margin-top:20px; background:linear-gradient(180deg,transparent, #fff 35%);
  backdrop-filter: blur(6px);
  border-top:1px solid var(--neutral-200);
}
@media (max-width:768px){
  .actions-bar{position:fixed; bottom:0; left:0; right:0; box-shadow:0 -8px 20px rgba(2,6,23,.06)}
  .tv-page{padding-bottom:96px}
}

/* Reskin del .menu-button existente (conservar clase para JS) */
.menu-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height:48px;
  padding:0 18px;
  border-radius:9999px;
  font-weight:600;
  cursor:pointer;
  background:var(--primary-500);
  color:#fff;
  border:1px solid transparent;
  box-shadow:0 6px 16px rgba(98,115,255,.25);
  transition:all .2s ease;
}
.menu-button:hover{transform:translateY(-1px)}

/* ===== Secciones en el menú ===== */
.section-title{
  font-size:13px;
  font-weight:700;
  color:var(--neutral-700);
  letter-spacing:.06em;
  text-transform:uppercase;
  margin:8px 0 10px;
}

/* =========================
   Modal catálogo Comisariato
   ========================= */
.tv-modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.45);
  display:flex; /* ← Cambiado a flex */
  align-items:center;
  justify-content:center;
  z-index:9999; /* ← Z-index más alto */
  opacity:0;
  visibility:hidden;
  transition:opacity 0.2s ease, visibility 0.2s ease;
}

.tv-modal-backdrop:not(.hidden){
  opacity:1;
  visibility:visible;
}

.tv-modal{
  background:#fff;
  border-radius:16px;
  box-shadow:0 12px 40px rgba(15,23,42,.25);
  width:100%;
  max-width:520px;
  padding:24px;
  position:relative;
}

.tv-modal h2{
  margin:0 0 14px;
  font-size:18px;
  font-weight:700;
}

.tv-form{
  display:grid;
  gap:16px;
}

.tv-close{
  position:absolute;
  top:12px;
  right:12px;
  border:none;
  background:#fff;
  border-radius:999px;
  border:1px solid var(--neutral-200);
  width:36px;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.modal-actions{
  margin-top:8px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

/* Botón peligro (eliminar) */
.tv-btn-danger{
  background:#fff;
  border-color:#fecaca;
  color:#b91c1c;
}
.tv-btn-danger:hover{
  background:#fff0f0;
}

/* helper para ocultar el botón "Editar catálogo" en mobile (opcional) */
.only-desktop{
  display:inline-flex;
}
@media (max-width:768px){
  .only-desktop{ display:none; }
}

/* Nombre de producto clickeable para abrir el modal */
td.clickable-prod{
  cursor:pointer;
}
td.clickable-prod:hover{
  background:rgba(148,163,184,.12);
}

/* ===== Reorden de catálogo Comisariato ===== */
#comisariato-table-container.reorder-active tbody tr{
  cursor:grab;
}
#comisariato-table-container.reorder-active tbody tr.dragging{
  opacity:.6;
  cursor:grabbing;
}
#comisariato-table-container.reorder-active tbody tr.drop-before{
  box-shadow:inset 0 3px 0 var(--primary-500);
}
#comisariato-table-container.reorder-active tbody tr.drop-after{
  box-shadow:inset 0 -3px 0 var(--primary-500);
}
.tv-row-moved{
  background:#FFF7ED !important;
  box-shadow:inset 3px 0 0 #FB923C;
}
.tv-col-idx{
  color:#64748B;
}
.tv-col-order{
  text-align:center;
}
.drag-handle{
  display:inline-flex;
  align-items:center;
  padding:0 4px;
  opacity:.7;
}
.drag-handle svg{
  width:16px;
  height:16px;
}
.btn-reorden{
  height:32px;
  padding:0 10px;
  font-size:12px;
}
.muted-dash{
  color:#cbd5e1;
}

/* ===== Dropdown catálogo Comisariato ===== */

/* Contenedor relativo para posicionar el menú */
.relative{
  position: relative;
}

/* Caja del menú */
.tv-dropdown{
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 220px;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,.18);
  padding: 4px;
  z-index: 40;
}

/* Ocultar cuando tiene .hidden (ya la usas en JS) */
.tv-dropdown.hidden{
  display: none;
}

/* Items del menú */
.tv-dropdown-item{
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: var(--neutral-900);
  cursor: pointer;
}

/* Hover del item */
.tv-dropdown-item:hover{
  background: var(--neutral-50);
}
.inventory-table .section-row td {
  font-weight: 600;
  background: #f3f4f6;
  padding-top: 0.75rem;
}


#comisariato-catalogo-main.is-reorden{
  background:var(--primary-50);
  color:var(--primary-500);
}
.btn-vitali-strong {
  background: linear-gradient(135deg, #12b886, #0ca678);
  color: white;
  padding: 12px 26px;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-vitali-strong:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.35);
}

.btn-vitali-strong:active {
  transform: translateY(0px);
  box-shadow: 0 3px 8px rgba(16, 185, 129, 0.4);
}

/* ===== Units (lb / unid) ===== */
.unit-pill{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:999px;
  font-size:12px;
  line-height:1;
  border:1px solid var(--neutral-200);
  background:#fff;
  color:var(--neutral-700);
  margin-left:8px;
  white-space:nowrap;
}

.unit-pill-muted{
  opacity:.7;
}

/* Alineación bonita para celdas numéricas con unidad */
.inventory-table td.num{
  text-align:right;
  font-variant-numeric: tabular-nums;
  white-space:nowrap;
}
.pres-cell{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.pres-main{
  font-weight:600;
}
.pres-sub{
  font-size:12px;
  color:var(--neutral-700);
  opacity:.75;
}
.qty-unit{
  font-size:12px;
  color:var(--neutral-700);
  margin-left:6px;
  text-transform:uppercase;
}

/* Opcional: sticky header en tablas (se siente más pro) */
.table-wrap .inventory-table thead th{
  position:sticky;
  top:0;
  z-index:2;
}

.tv-uom{
  display:flex;
  align-items:center;
  gap:8px;
}
.uom-pill{
  font-size:12px;
  padding:4px 8px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  opacity:.85;
  white-space:nowrap;
}
/* =========================
   Modo de captura (FULL/PATCH)
   ========================= */
.tv-mode-card{ border-radius:16px; }
.tv-mode-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.tv-mode-title{ margin:0; font-weight:700; font-size:14px; }
.tv-mode-subtitle{ margin:4px 0 0; font-size:13px; color:var(--neutral-700); }

.tv-mode-toggle{
  display:inline-flex;
  border:1px solid var(--neutral-200);
  border-radius:9999px;
  background:var(--neutral-50);
  padding:4px;
  gap:6px;
}
.tv-mode-btn{
  height:36px;
  padding:0 12px;
  border-radius:9999px;
  border:1px solid transparent;
  background:transparent;
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  color:var(--neutral-900);
}
.tv-mode-btn.is-active{
  background:var(--primary-500);
  color:#fff;
  box-shadow:0 6px 16px rgba(98,115,255,.18);
}
.tv-mode-help{
  margin-top:12px;
  font-size:13px;
  color:var(--neutral-700);
  background:var(--neutral-50);
  border:1px solid var(--neutral-200);
  border-radius:12px;
  padding:10px 12px;
}
.tv-mode-badge{
  display:inline-flex;
  margin-left:8px;
  font-size:12px;
  padding:2px 8px;
  border-radius:999px;
  background:var(--primary-50);
  color:var(--primary-500);
  border:1px solid var(--neutral-200);
  white-space:nowrap;
}

/* Banner reorden */
.tv-banner{
  margin-top:10px;
  font-size:12px;
  padding:10px 12px;
  border-radius:12px;
  background:#fff7ed;
  border:1px solid #fed7aa;
  color:#9a3412;
}

/* Live status */
.tv-live-status{
  margin-top:10px;
  font-size:12px;
  color:var(--neutral-700);
}
.tv-live-status span{
  font-weight:700;
  color:var(--neutral-900);
}

/* Actions bar mejorada */
.tv-actions-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.tv-actions-left{ display:flex; flex-direction:column; gap:6px; }
.tv-actions-metric{
  display:flex;
  align-items:baseline;
  gap:10px;
}
.tv-actions-label{ font-size:12px; color:var(--neutral-700); font-weight:600; }
.tv-actions-value{ font-size:18px; font-weight:800; color:var(--neutral-900); }
.tv-actions-note{
  font-size:12px;
  color:var(--neutral-700);
}
.tv-actions-right{
  display:flex;
  gap:10px;
  align-items:center;
}

@media (max-width:768px){
  .tv-mode-head{ flex-direction:column; align-items:stretch; }
  .tv-mode-toggle{ width:100%; justify-content:space-between; }
  .tv-actions-bar{
    flex-direction:column;
    align-items:stretch;
  }
  .tv-actions-right{
    width:100%;
  }
  .tv-actions-right button{
    flex:1;
  }
}

/* =========================
   MEJORAS UX/UI LIVE
   ========================= */

/* Skeleton Loading */
.skeleton-row td {
  padding: 12px 14px;
}
.skeleton-text {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  height: 16px;
}
.skeleton-text.short { width: 60%; }
.skeleton-text.num { width: 40px; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Row Update Animation */
.row-updated {
  animation: highlightRow 2s ease-out;
}

@keyframes highlightRow {
  0%, 100% { background-color: transparent; }
  10% { background-color: rgba(52, 211, 153, 0.3); }
}

/* Stock Levels */
.stock-critical {
  background-color: rgba(239, 68, 68, 0.08) !important;
}
.stock-critical td:first-child {
  font-weight: 600;
  color: #dc2626;
}
.stock-low {
  background-color: rgba(251, 191, 36, 0.08);
}
.stock-low td:first-child {
  font-weight: 600;
  color: #d97706;
}
.stock-ok td.num {
  color: #059669;
  font-weight: 600;
}

/* Status Badge (SSE Connection) */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid;
}
.status-connected {
  background: rgba(52, 211, 153, 0.12);
  color: #059669;
  border-color: rgba(52, 211, 153, 0.3);
}
.status-reconnecting {
  background: rgba(251, 191, 36, 0.12);
  color: #d97706;
  border-color: rgba(251, 191, 36, 0.3);
}
.status-disconnected {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.3);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.status-reconnecting::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.5s infinite;
}

/* Quick Stats Dashboard */
.quick-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(2,6,23,.08);
}
.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary-500);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 12px;
  color: var(--neutral-700);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.stat-warning .stat-value {
  color: #d97706;
}
.stat-critical .stat-value {
  color: #dc2626;
}
.stat-success .stat-value {
  color: #059669;
}

/* Search Improvements */
.search-wrapper {
  position: relative;
  flex: 1;
}
.search-wrapper .clear-search {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--neutral-700);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}
.search-wrapper .clear-search.visible {
  opacity: 1;
  visibility: visible;
}
.search-wrapper .clear-search:hover {
  background: var(--neutral-100);
}
.search-wrapper input.searching {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

/* Time Relative */
.time-relative {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.time-relative[title]:hover {
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
}
.toast {
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(2,6,23,.12);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideIn 0.3s ease-out;
}
.toast.closing {
  animation: slideOut 0.3s ease-in forwards;
}
.toast-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.toast-success .toast-icon {
  background: rgba(52, 211, 153, 0.15);
  color: #059669;
}
.toast-warning .toast-icon {
  background: rgba(251, 191, 36, 0.15);
  color: #d97706;
}
.toast-error .toast-icon {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}
.toast-info .toast-icon {
  background: rgba(98, 115, 255, 0.15);
  color: var(--primary-500);
}
.toast-content {
  flex: 1;
}
.toast-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--neutral-900);
  margin: 0 0 4px;
}
.toast-message {
  font-size: 13px;
  color: var(--neutral-700);
  margin: 0;
}
.toast-close {
  background: transparent;
  border: none;
  color: var(--neutral-700);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
}
.toast-close:hover {
  background: var(--neutral-100);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* View Mode Toggle */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--neutral-200);
  border-radius: 10px;
  background: var(--white);
}
.view-mode-btn {
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-700);
  transition: all 0.2s;
}
.view-mode-btn.active {
  background: var(--primary-500);
  color: white;
}
.view-mode-btn:hover:not(.active) {
  background: var(--neutral-50);
}

/* Compact View */
.live-container.compact-view .inventory-table td {
  padding: 8px 10px;
  font-size: 13px;
}
.live-container.compact-view .inventory-table td:last-child {
  display: none;
}

/* Export Button */
.export-dropdown {
  position: relative;
}
.export-menu {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 180px;
  background: var(--white);
  border: 1px solid var(--neutral-200);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12);
  padding: 6px;
  z-index: 50;
}
.export-item {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--neutral-900);
  display: flex;
  align-items: center;
  gap: 8px;
}
.export-item:hover {
  background: var(--neutral-50);
}

/* Stock Warning Icon */
.stock-warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fef3c7;
  color: #d97706;
  font-size: 12px;
  font-weight: 700;
  margin-right: 4px;
}

/* Loading State */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--neutral-200);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Responsive improvements */
@media (max-width: 768px) {
  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
  }
}
