*, *::before, *::after { box-sizing: border-box; }
  html, body { min-height: 100%; overflow-x: hidden; }
  body { font-family: 'Sora', sans-serif; background: #f8fafc; color: #0f172a; overflow-y: auto; }
  #app-shell, #main-content { min-height: 100vh; }
  #main-content { overflow-y: auto; }
  .mono { font-family: 'DM Mono', monospace; }

  /* Scrollbar */
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: #f1f5f9; }
  ::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

  /* Animations */
  @keyframes slideIn { from { opacity:0; transform:translateY(-12px); } to { opacity:1; transform:translateY(0); } }
  @keyframes fadeIn  { from { opacity:0; } to { opacity:1; } }
  @keyframes scaleIn { from { opacity:0; transform:scale(.94); } to { opacity:1; transform:scale(1); } }
  @keyframes pulse2  { 0%,100% { opacity:1; } 50% { opacity:.5; } }
  @keyframes shimmer { 0% { background-position:-200% 0; } 100% { background-position:200% 0; } }
  @keyframes toastIn { from { opacity:0; transform:translateX(100%); } to { opacity:1; transform:translateX(0); } }
  @keyframes toastOut{ from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(100%); } }

  .animate-slide-in   { animation: slideIn .35s cubic-bezier(.16,1,.3,1) both; }
  .animate-fade-in    { animation: fadeIn .25s ease both; }
  .animate-scale-in   { animation: scaleIn .3s cubic-bezier(.16,1,.3,1) both; }
  .animate-pulse2     { animation: pulse2 2s ease-in-out infinite; }
  .animate-toast-in   { animation: toastIn .4s cubic-bezier(.16,1,.3,1) both; }
  .animate-toast-out  { animation: toastOut .3s ease forwards; }

  /* Stagger children */
  .stagger > * { animation: slideIn .35s cubic-bezier(.16,1,.3,1) both; }
  .stagger > *:nth-child(1) { animation-delay:.05s; }
  .stagger > *:nth-child(2) { animation-delay:.1s; }
  .stagger > *:nth-child(3) { animation-delay:.15s; }
  .stagger > *:nth-child(4) { animation-delay:.2s; }
  .stagger > *:nth-child(5) { animation-delay:.25s; }
  .stagger > *:nth-child(6) { animation-delay:.3s; }

  /* Glass card */
  .glass { background: rgba(255,255,255,.9); backdrop-filter: blur(12px); border: 1px solid rgba(0,0,0,.05); box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05); }
  .glass-hover:hover { background: #ffffff; border-color: rgba(14,165,233,.2); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); transition: all .2s; }

  /* Glow effects */
  .glow-amber { box-shadow: 0 0 20px rgba(14,165,233,.15); }
  .glow-amber-sm { box-shadow: 0 0 10px rgba(14,165,233,.2); }
  .glow-red { box-shadow: 0 0 20px rgba(239,68,68,.1); }
  .glow-green { box-shadow: 0 0 20px rgba(34,197,94,.1); }

  /* Sidebar */
  .sidebar { width: 260px; transition: width .3s cubic-bezier(.16,1,.3,1); }
  .sidebar.collapsed { width: 72px; }
  .sidebar.collapsed .sidebar-header { flex-direction: column; padding: 1rem 0; gap: 0.75rem; justify-content: center; }
  .sidebar.collapsed .sidebar-toggle-btn { margin: 0 auto; }
  .sidebar.collapsed .sidebar-logo-icon { transform: scale(0.9); transition: transform 0.3s; }
  .sidebar.collapsed .nav-label, .sidebar.collapsed .sidebar-logo-text { display: none; }
  .sidebar.collapsed .nav-item { justify-content: center; }
  .sidebar.collapsed .nav-item .nav-icon { margin: 0; }

  /* Nav item */
  .nav-item { display:flex; align-items:center; gap:.75rem; padding:.6rem .9rem; border-radius:.5rem;
    cursor:pointer; transition: all .18s; color:#64748b; font-size:.875rem; font-weight:500; position:relative; }
  .nav-item:hover { background: rgba(14,165,233,.05); color:#0ea5e9; }
  .nav-item.active { background: rgba(14,165,233,.08); color:#0ea5e9; }
  .nav-item.active::before { content:''; position:absolute; left:0; top:20%; bottom:20%; width:3px;
    background:#0ea5e9; border-radius:0 2px 2px 0; }

  /* Form inputs */
  .form-input { background: #ffffff; border: 1px solid #e2e8f0;
    color: #0f172a; border-radius:.5rem; padding:.6rem .9rem; font-size:.875rem; width:100%;
    transition: border-color .18s, box-shadow .18s; outline:none; font-family:'Sora',sans-serif; }
  .form-input:focus { border-color:#0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.1); }
  .form-input option { background: #ffffff; }
  select.form-input { cursor:pointer; }

  /* Buttons */
  .btn { display:inline-flex; align-items:center; gap:.5rem; padding:.55rem 1.1rem;
    border-radius:.5rem; font-size:.875rem; font-weight:600; cursor:pointer;
    transition: all .18s; border:none; font-family:'Sora',sans-serif; }
  .btn-primary { background:#0ea5e9; color:#ffffff; }
  .btn-primary:hover { background:#0284c7; box-shadow: 0 4px 12px rgba(14,165,233,.25); transform:translateY(-1px); }
  .btn-secondary { background:#ffffff; color:#475569; border:1px solid #e2e8f0; }
  .btn-secondary:hover { background:#f8fafc; border-color:#cbd5e1; }
  .btn-danger { background:rgba(239,68,68,.15); color:#f87171; border:1px solid rgba(239,68,68,.2); }
  .btn-danger:hover { background:rgba(239,68,68,.25); }
  .btn-ghost { background:transparent; color:#94a3b8; }
  .btn-ghost:hover { color:#e2e8f0; background:rgba(255,255,255,.05); }
  .btn-sm { padding:.35rem .75rem; font-size:.8rem; }
  .btn:disabled { opacity:.5; cursor:not-allowed; transform:none !important; }

  /* Badge */
  .badge { display:inline-flex; align-items:center; gap:.3rem; padding:.2rem .6rem;
    border-radius:9999px; font-size:.72rem; font-weight:600; }
  .badge-amber { background:rgba(14,165,233,.1); color:#0369a1; border:1px solid rgba(14,165,233,.15); }
  .badge-green { background:rgba(34,197,94,.1); color:#15803d; border:1px solid rgba(34,197,94,.15); }
  .badge-red   { background:rgba(239,68,68,.1);  color:#b91c1c; border:1px solid rgba(239,68,68,.15); }
  .badge-blue  { background:rgba(59,130,246,.1); color:#1d4ed8; border:1px solid rgba(59,130,246,.15); }
  .badge-purple{ background:rgba(168,85,247,.1); color:#7e22ce; border:1px solid rgba(168,85,247,.15); }

  /* Table */
  .data-table { width:100%; border-collapse:collapse; font-size:.855rem; table-layout:auto; min-width:100%; }
  .data-table thead th, .data-table tbody td { min-width:100px; padding:.75rem 1rem; }
  .data-table thead th { text-align:left; color:#64748b; font-weight:600;
    font-size:.75rem; text-transform:uppercase; letter-spacing:.05em;
    border-bottom:1px solid #f1f5f9; }
  .data-table tbody td { border-bottom:1px solid #f8fafc;
    color:#334155; vertical-align:middle; }
  .data-table tbody tr { transition:background .15s; }
  .data-table tbody tr:hover { background:#f8fafc; }
  .data-table tbody tr:last-child td { border-bottom:none; }

  /* Stat card */
  .stat-card { padding:1.25rem 1.5rem; border-radius:.75rem; }
  .stat-card .value { font-size:2rem; font-weight:700; font-family:'DM Mono',monospace; line-height:1.1; }
  .stat-card .label { font-size:.78rem; color:#64748b; font-weight:500; margin-bottom:.25rem; }
  .stat-card .change { font-size:.78rem; font-weight:600; }

  /* Shift indicator */
  .shift-dot { width:8px; height:8px; border-radius:50%; display:inline-block; animation: pulse2 2s infinite; }
  .shift-morning { background:#0ea5e9; box-shadow:0 0 8px rgba(14,165,233,.4); }
  .shift-night   { background:#6366f1; box-shadow:0 0 8px rgba(99,102,241,.4); }

  /* Modal overlay */
  .modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.7); backdrop-filter:blur(4px);
    z-index:50; display:flex; align-items:center; justify-content:center; padding:1rem; }
  .modal-box { background:#ffffff; border:1px solid #e2e8f0; border-radius:1.25rem;
    width:min(620px,100%); max-width:620px; max-height:92vh; overflow:hidden; display:flex; flex-direction:column;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); animation: scaleIn .3s cubic-bezier(.16,1,.3,1) both; }
  .modal-header { display:flex; justify-content:space-between; align-items:flex-start; gap:1rem; padding:1.25rem 1.5rem 0.75rem; }
  .modal-title { font-size:1.1rem; font-weight:700; color:#0f172a; }
  .modal-subtitle { color:#64748b; font-size:.9rem; line-height:1.5; margin-top:.25rem; }
  .modal-body { padding:0 1.5rem 1rem; overflow:auto; }
  .modal-footer { padding:0 1.5rem 1.25rem; display:flex; flex-wrap:wrap; gap:.75rem; justify-content:flex-end; align-items:center; }
  .modal-footer .btn { min-width:120px; }
  .modal-card-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; }
  .modal-card { background:#f8fafc; border:1px solid #e2e8f0; border-radius:.85rem; padding:1rem; }
  .modal-card .label { font-size:.75rem; text-transform:uppercase; letter-spacing:.08em; color:#64748b; margin-bottom:.5rem; }
  .modal-card .value { font-size:1.75rem; font-weight:700; color:#0f172a; line-height:1.1; }

  /* Toast */
  #toast-container { position:fixed; top:1.25rem; right:1.25rem; z-index:100;
    display:flex; flex-direction:column; gap:.5rem; pointer-events:none; }
  .toast { display:flex; align-items:center; gap:.75rem; padding:.75rem 1rem;
    border-radius:.6rem; min-width:260px; max-width:360px; pointer-events:all;
    font-size:.855rem; font-weight:500; border:1px solid rgba(0,0,0,.05); box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1); }
  .toast-success { background:#0f2418; color:#4ade80; border-color:rgba(34,197,94,.2); }
  .toast-error   { background:#200e0e; color:#f87171; border-color:rgba(239,68,68,.2); }
  .toast-info    { background:#0e1825; color:#60a5fa; border-color:rgba(59,130,246,.2); }
  .toast-warn    { background:#1f1506; color:#fbbf24; border-color:rgba(245,158,11,.2); }

  /* Login */
  .login-bg { background: radial-gradient(ellipse at 30% 50%, rgba(14,165,233,.05) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 20%, rgba(99,102,241,.04) 0%, transparent 50%),
              #f8fafc; }

  /* Print */
  @media print {
    body { background:#fff !important; color:#000 !important; font-size:11pt; }
    .no-print, #sidebar, #toast-container, #login-screen, #app-shell, .modal-overlay, #confirm-dialog { display:none !important; }
    #print-area { display:block !important; padding:0 !important; }
    .print-only { display:block !important; }
    .print-section { page-break-inside:avoid; }
    table { width:100%; border-collapse:collapse; font-size:9pt; }
    th, td { border:1px solid #ccc !important; padding:4px 8px !important; color:#000 !important; }
    th { background:#f5f5f5 !important; font-weight:bold; }
    h1, h2, h3 { color:#000 !important; }
    .glass, .stat-card { background:#fff !important; border:1px solid #ddd !important; }
  }
  .print-only { display:none; }



  /* Responsive */
  @media (max-width:768px) {
    .sidebar { position:fixed; top:0; left:0; bottom:0; z-index:40; transform:translateX(-100%); transition:transform .3s; }
    .sidebar.mobile-open { transform:translateX(0); }
    #main-content { margin-left:0 !important; }
    .modal-box { max-width:95vw; width:100%; border-radius:1rem; }
    .modal-header { flex-direction:column; align-items:stretch; padding:1rem 1rem 0.75rem; }
    .modal-body { padding:0 1rem 1rem; }
    .modal-footer { padding:0 1rem 1rem; justify-content:stretch; }
    .modal-footer .btn { width:100%; }
    .modal-card-grid { grid-template-columns:1fr; }
    .section-title { font-size:1rem; }
    .section-sub { font-size:.75rem; }
    .btn { width:100%; justify-content:center; }
    .btn + .btn { margin-top:.5rem; }
    .data-table { font-size:.82rem; table-layout:auto; min-width:100%; }
    .data-table thead th, .data-table tbody td { min-width:90px; padding:.5rem .75rem; font-size:.78rem; white-space:nowrap; }
    .overflow-x-auto { overflow-x:auto !important; -webkit-overflow-scrolling:touch; }
  }

  /* Skeleton loader */
  .skeleton { background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size:200% 100%; animation: shimmer 1.5s infinite; border-radius:.375rem; }

  /* Progress bar */
  .progress-bar { height:4px; border-radius:2px; background:#e2e8f0; overflow:hidden; }
  .progress-fill { height:100%; border-radius:2px; background:#0ea5e9; transition:width .5s ease; }

  /* Tooltip */
  [data-tip] { position:relative; }
  [data-tip]::after { content:attr(data-tip); position:absolute; bottom:110%; left:50%;
    transform:translateX(-50%); background:#1e2940; color:#e2e8f0; font-size:.73rem;
    padding:.25rem .6rem; border-radius:.35rem; white-space:nowrap; pointer-events:none;
    opacity:0; transition:opacity .2s; z-index:10; }
  [data-tip]:hover::after { opacity:1; }

  /* Search input */
  .search-wrap { position:relative; }
  .search-wrap input { padding-left:2.25rem; }
  .search-wrap .search-icon { position:absolute; left:.75rem; top:50%; transform:translateY(-50%); color:#4b5563; }

  /* Tab */
  .tab-btn { padding:.5rem 1rem; border-radius:.4rem; font-size:.85rem; font-weight:500;
    cursor:pointer; transition:all .18s; color:#64748b; border:none; background:transparent; font-family:'Sora',sans-serif; }
  .tab-btn.active { background:rgba(245,158,11,.12); color:#f59e0b; }
  .tab-btn:hover:not(.active) { color:#cbd5e1; background:rgba(255,255,255,.04); }

  /* Section header */
  .section-title { font-size:1.1rem; font-weight:700; color:#0f172a; }
  .section-sub   { font-size:.8rem; color:#64748b; }

  /* Divider */
  .divider { height:1px; background:rgba(255,255,255,.06); }

  /* Chip */
  .chip { display:inline-flex; align-items:center; gap:.3rem; padding:.25rem .65rem;
    border-radius:.375rem; background:#f1f5f9; color:#475569; font-size:.78rem; border:1px solid #e2e8f0; }

  /* Mobile-friendly table display */
  .table-cards { display:none; }
  .table-cards.mobile-view { display:flex; flex-direction:column; gap:1rem; }
  .table-card { background:#ffffff; border:1px solid #e2e8f0; border-radius:.75rem; padding:1.25rem;
    display:grid; grid-template-columns:1fr 1fr; gap:1rem; box-shadow:0 1px 2px rgba(0,0,0,.05); }
  .table-card.lg { grid-template-columns:repeat(3,1fr); }
  .table-card-row { display:flex; flex-direction:column; }
  .table-card-label { font-size:.7rem; text-transform:uppercase; letter-spacing:.08em; color:#64748b; margin-bottom:.4rem; font-weight:600; }
  .table-card-value { font-size:1rem; font-weight:600; color:#0f172a; }
  .table-card-value.mono { font-family:'DM Mono',monospace; }
  .table-card-value.highlight { color:#0ea5e9; }
  .table-card-value.red { color:#ef4444; }
  .table-card-value.green { color:#22c55e; }
  .table-card-value.amber { color:#f59e0b; }

  /* Low stock display - mobile compact */
  .low-stock-chips { display:flex; flex-wrap:wrap; gap:.5rem; }
  .low-stock-brief { max-height:3.5rem; overflow:hidden; }
  .low-stock-brief.expanded { max-height:none; }

  /* Product card list */
  .product-cards { display:none; gap:1rem; }
  .product-cards.show { display:flex; flex-direction:column; }
  .product-card { background:#ffffff; border:1px solid #e2e8f0; border-radius:.75rem; padding:1rem;
    display:flex; justify-content:space-between; align-items:flex-start; cursor:pointer; transition:all .2s; }
  .product-card:hover { border-color:#0ea5e9; box-shadow:0 4px 12px rgba(14,165,233,.1); }
  .product-card-info { flex:1; }
  .product-card-name { font-weight:600; color:#0f172a; margin-bottom:.25rem; }
  .product-card-meta { font-size:.8rem; color:#64748b; display:flex; gap:1rem; flex-wrap:wrap; }
  .product-card-actions { display:flex; gap:.5rem; }

  /* Stock entry card list */
  .entry-cards { display:none; flex-direction:column; gap:1rem; }
  .entry-cards.show { display:flex; }
  .entry-card { background:#ffffff; border:1px solid #e2e8f0; border-radius:.75rem; padding:1rem; }
  .entry-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:.75rem; border-bottom:1px solid #f1f5f9; padding-bottom:.75rem; }
  .entry-card-title { font-weight:600; color:#0f172a; }
  .entry-card-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:1rem; }
  .entry-card-item { display:flex; flex-direction:column; }
  .entry-card-label { font-size:.7rem; text-transform:uppercase; letter-spacing:.05em; color:#64748b; margin-bottom:.3rem; font-weight:500; }
  .entry-card-value { font-size:.95rem; font-weight:600; color:#0f172a; font-family:'DM Mono',monospace; }

  @media (max-width:768px) {
    .table-desktop { display:none; }
    .table-cards { display:flex; flex-direction:column; gap:1rem; }
    .product-cards { display:flex; flex-direction:column; gap:1rem; }
    .entry-cards { display:flex; flex-direction:column; gap:1rem; }
  }