/* ============================================================
   FERRETERÍA POS – Premium Dark UI with Reactive Animations
   ============================================================ */

/* ─── Design Tokens ─── */
:root {
  --bg-void:     #050810;
  --bg-deep:     #0a0f1e;
  --bg-surface:  #111827;
  --bg-elevated: #1a2236;
  --glass:       rgba(255, 255, 255, 0.03);
  --glass-md:    rgba(255, 255, 255, 0.05);
  --glass-hi:    rgba(255, 255, 255, 0.08);
  --border:      rgba(255, 255, 255, 0.06);
  --border-hi:   rgba(255, 255, 255, 0.12);
  --cyan:        #22d3ee;
  --cyan-glow:   rgba(34, 211, 238, 0.3);
  --purple:      #a78bfa;
  --green:       #34d399;
  --green-bg:    rgba(52, 211, 153, 0.1);
  --amber:       #fbbf24;
  --orange:      #fb923c;
  --orange-bg:   rgba(251, 146, 60, 0.1);
  --red:         #f87171;
  --red-bg:      rgba(248, 113, 113, 0.1);
  --text:        #f1f5f9;
  --text-2:      #cbd5e1;
  --text-3:      #64748b;
  --radius:      18px;
  --radius-md:   12px;
  --radius-sm:   8px;
  --ease:        cubic-bezier(.4,0,.2,1);
  --spring:      cubic-bezier(.34,1.56,.64,1);
  --fast:        0.2s;
  --med:         0.35s;
  --slow:        0.5s;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-void);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--cyan);
  color: var(--bg-void);
}

.hidden { display: none !important; }
.accent { color: var(--cyan); }

/* ─── Particle Canvas ─── */
#particleCanvas {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0.6;
}

/* ─── Gradient Mesh Background ─── */
.gradient-mesh {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(34,211,238,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 60% at 80% 80%, rgba(167,139,250,0.05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(52,211,153,0.03) 0%, transparent 50%);
  animation: meshShift 20s ease-in-out infinite alternate;
}

@keyframes meshShift {
  0%   { transform: scale(1)    rotate(0deg);   }
  50%  { transform: scale(1.05) rotate(1deg);   }
  100% { transform: scale(1)    rotate(-0.5deg);}
}

/* ─── Sidebar Accent Line ─── */
.sidebar-accent {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 3px; z-index: 10;
  background: linear-gradient(180deg, var(--cyan), var(--purple), var(--green));
  opacity: 0.5;
}

/* ═══════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════ */
.login-screen {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}

.login-card {
  position: relative;
  background: linear-gradient(165deg,
    rgba(17,24,39,0.95) 0%,
    rgba(10,15,30,0.98) 100%);
  backdrop-filter: blur(40px) saturate(1.2);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 3rem 2.5rem 2rem;
  width: 100%; max-width: 420px;
  text-align: center;
  overflow: hidden;
  animation: loginCardIn 0.8s var(--spring) both;
}

@keyframes loginCardIn {
  from {
    opacity: 0;
    transform: translateY(60px) scale(0.92) rotateX(8deg);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotateX(0);
    filter: blur(0);
  }
}

/* Glow ring behind card */
.glow-ring {
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent, var(--cyan), transparent, var(--purple), transparent);
  opacity: 0.04;
  animation: glowSpin 8s linear infinite;
  pointer-events: none;
}
@keyframes glowSpin { to { transform: rotate(360deg); } }

/* Logo */
.login-logo {
  position: relative;
  width: 72px; height: 72px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 32px var(--cyan-glow), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: logoPulse 3s ease-in-out infinite;
  cursor: default;
  transition: transform var(--med) var(--spring);
}
.login-logo:hover {
  transform: scale(1.08) rotate(-5deg);
}
.logo-icon { font-size: 34px; color: #fff; z-index: 1; }
.logo-pulse {
  position: absolute; inset: -4px;
  border-radius: 24px;
  border: 2px solid var(--cyan);
  opacity: 0;
  animation: ringPulse 3s ease-in-out infinite;
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 8px 32px var(--cyan-glow); }
  50%      { box-shadow: 0 8px 48px var(--cyan-glow), 0 0 60px rgba(34,211,238,0.15); }
}
@keyframes ringPulse {
  0%   { transform: scale(1);    opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 0;   }
}

/* Title */
.login-title {
  font-size: 1.8rem; font-weight: 800;
  margin-bottom: 0.3rem;
  letter-spacing: -0.02em;
}
.title-word, .title-accent {
  display: inline-block;
  animation: titleReveal 0.6s var(--spring) both;
  animation-delay: var(--delay);
}
.title-accent {
  color: var(--cyan);
  margin-left: 6px;
}
@keyframes titleReveal {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0);    filter: blur(0);   }
}

.login-subtitle {
  font-size: 0.88rem; color: var(--text-3); margin-bottom: 2rem;
  animation: fadeUp 0.6s var(--ease) 0.35s both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Input Groups */
.input-group {
  position: relative; margin-bottom: 1.1rem;
  animation: fadeUp 0.5s var(--ease) both;
}
#userGroup { animation-delay: 0.4s; }
#passGroup { animation-delay: 0.5s; }

.input-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--text-3);
  transition: color var(--fast) var(--ease), transform var(--med) var(--spring);
}
.input-group input {
  width: 100%; padding: 0.85rem 1rem 0.85rem 50px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--glass);
  color: var(--text);
  font-size: 0.95rem; font-family: inherit;
  transition: all var(--fast) var(--ease);
}
.input-group input::placeholder { color: var(--text-3); }

.input-line {
  position: absolute; bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--purple));
  border-radius: 2px;
  transition: all var(--med) var(--ease);
}

.input-group input:focus {
  outline: none;
  border-color: var(--cyan);
  background: rgba(34,211,238,0.03);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.08);
}
.input-group input:focus ~ .input-line {
  width: 100%; left: 0;
}
.input-group:focus-within .input-icon {
  color: var(--cyan);
  transform: translateY(-50%) scale(1.15);
}

/* Primary Button */
.btn-primary {
  position: relative; overflow: hidden;
  width: 100%; padding: 0.9rem; margin-top: 0.5rem;
  border: none; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--cyan) 0%, #0891b2 100%);
  color: #fff; font-weight: 700; font-size: 0.95rem; font-family: inherit;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  box-shadow: 0 4px 20px var(--cyan-glow);
  transition: all var(--med) var(--ease);
  animation: fadeUp 0.5s var(--ease) 0.6s both;
}
.btn-primary:hover {
  transform: translateY(-3px) scale(1.01);
  box-shadow: 0 8px 32px var(--cyan-glow);
}
.btn-primary:active {
  transform: translateY(-1px) scale(0.99);
}
.btn-arrow {
  transition: transform var(--fast) var(--ease);
}
.btn-primary:hover .btn-arrow {
  transform: translateX(4px);
}

/* Ripple effect */
.btn-ripple {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transform: scale(0);
  pointer-events: none;
}
.btn-ripple.active {
  animation: rippleOut 0.6s ease-out;
}
@keyframes rippleOut {
  to { transform: scale(4); opacity: 0; }
}

/* Error */
.error-msg {
  margin-top: 0.8rem; font-size: 0.85rem; color: var(--red);
  min-height: 1.2em;
}
.error-msg:not(:empty) {
  animation: shakeError 0.5s var(--ease);
}
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(7px);  }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(5px);  }
  75% { transform: translateX(-3px); }
}

/* Login card shake on error */
.login-card.shake {
  animation: shakeCard 0.5s var(--ease);
}
@keyframes shakeCard {
  0%, 100% { transform: translateX(0) rotate(0);      }
  20%      { transform: translateX(-10px) rotate(-1deg);}
  40%      { transform: translateX(10px) rotate(1deg);  }
  60%      { transform: translateX(-6px) rotate(-0.5deg);}
  80%      { transform: translateX(6px) rotate(0.5deg); }
}

.login-footer {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 1.5rem;
  font-size: 0.72rem; color: var(--text-3); opacity: 0.6;
  animation: fadeUp 0.5s var(--ease) 0.7s both;
}
.footer-icon { font-size: 14px; }

/* ═══════════════════════════════════════════
   APP SCREEN
   ═══════════════════════════════════════════ */
.app-screen {
  position: relative; z-index: 1;
  min-height: 100vh;
  padding: 0 2rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Top Bar */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem 0; margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  animation: slideDown 0.6s var(--spring) both;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0);     }
}

.topbar-left { display: flex; align-items: center; gap: 0.8rem; }

.topbar-logo-wrap {
  width: 42px; height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px var(--cyan-glow);
  transition: transform var(--med) var(--spring);
}
.topbar-logo-wrap:hover { transform: rotate(-8deg) scale(1.05); }
.topbar-logo { font-size: 22px; color: #fff; }

.topbar-title {
  font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em;
}
.topbar-sub {
  font-size: 0.72rem; color: var(--text-3); margin-top: 1px;
}

.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

/* Status Badge */
.status-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.38rem 0.85rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.01em;
  transition: all var(--med) var(--ease);
  cursor: default;
}
.status-badge.live {
  background: var(--green-bg); color: var(--green);
  border: 1px solid rgba(52,211,153,0.2);
}
.status-badge.offline {
  background: var(--orange-bg); color: var(--orange);
  border: 1px solid rgba(251,146,60,0.2);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50%      { opacity: 0.5; box-shadow: 0 0 0 4px transparent; }
}

/* Glass button */
.btn-glass {
  width: 38px; height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--fast) var(--ease);
  position: relative;
  overflow: hidden;
}
.btn-glass .material-icons-round { font-size: 19px; transition: transform var(--med) var(--spring); }
.btn-glass:hover {
  background: var(--glass-hi);
  color: var(--cyan);
  border-color: rgba(34,211,238,0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.btn-glass:hover .material-icons-round { transform: scale(1.1); }
.btn-glass:active { transform: translateY(0); }
.btn-glass.btn-danger:hover { color: var(--red); border-color: rgba(248,113,113,0.3); }

/* Spinning refresh icon */
.btn-glass.spinning .material-icons-round {
  animation: spinRefresh 0.8s var(--ease);
}
@keyframes spinRefresh { to { transform: rotate(360deg); } }

/* ─── Stats Grid ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, var(--glass-md), transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem 1.4rem;
  display: flex; align-items: flex-start; gap: 1rem;
  cursor: default;
  transition: all var(--med) var(--ease);
  /* Staggered entrance */
  opacity: 0;
  transform: translateY(24px) scale(0.96);
  animation: statCardIn 0.6s var(--spring) both;
}
.stat-card[data-index="0"] { animation-delay: 0.1s; }
.stat-card[data-index="1"] { animation-delay: 0.18s; }
.stat-card[data-index="2"] { animation-delay: 0.26s; }
.stat-card[data-index="3"] { animation-delay: 0.34s; }

@keyframes statCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

.stat-glow {
  position: absolute; top: -20px; right: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--glow-color);
  opacity: 0;
  filter: blur(30px);
  transition: opacity var(--slow) var(--ease);
  pointer-events: none;
}
.stat-card:hover .stat-glow { opacity: 0.15; }

.stat-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.stat-icon-wrap {
  width: 44px; height: 44px; min-width: 44px;
  border-radius: var(--radius-md);
  background: var(--icon-bg);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--med) var(--spring);
}
.stat-card:hover .stat-icon-wrap { transform: scale(1.1) rotate(-5deg); }
.stat-icon-wrap .material-icons-round { font-size: 22px; color: var(--text-2); }

.stat-value {
  display: block; font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text), var(--text-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  display: block; font-size: 0.72rem; color: var(--text-3);
  margin-top: 3px; font-weight: 500;
}

/* Mini sparkline decoration */
.stat-sparkline {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 30px;
  opacity: 0.08;
  pointer-events: none;
}

/* ─── Table Card ─── */
.table-card {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, rgba(17,24,39,0.8), rgba(10,15,30,0.92));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  animation: statCardIn 0.6s var(--spring) 0.4s both;
}

.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
  margin-bottom: 1.2rem;
}
.table-title-group { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.table-title {
  font-size: 1rem; font-weight: 700;
  display: flex; align-items: center; gap: 0.5rem;
}
.table-title .material-icons-round { color: var(--cyan); font-size: 22px; }
.table-count {
  font-size: 0.72rem; color: var(--text-3);
  background: var(--glass-md);
  padding: 3px 10px; border-radius: 20px;
  font-weight: 500;
}

/* Search Box */
.search-box {
  position: relative; width: 280px;
  transition: all var(--med) var(--ease);
}
.search-box:focus-within {
  width: 320px;
}
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 18px; color: var(--text-3);
  transition: color var(--fast) var(--ease);
}
.search-box:focus-within .search-icon { color: var(--cyan); }

.search-box input {
  width: 100%; padding: 0.6rem 2.5rem 0.6rem 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--glass);
  color: var(--text);
  font-size: 0.85rem; font-family: inherit;
  transition: all var(--fast) var(--ease);
}
.search-box input::placeholder { color: var(--text-3); }
.search-box input:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34,211,238,0.08);
  background: rgba(34,211,238,0.02);
}

.clear-search {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: var(--glass-hi); color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--fast) var(--ease);
}
.clear-search .material-icons-round { font-size: 14px; }
.clear-search:hover { background: rgba(248,113,113,0.2); color: var(--red); }

/* Spinner */
.spinner-wrap {
  display: flex; flex-direction: column; align-items: center;
  gap: 0.8rem; padding: 2.5rem 0;
  color: var(--text-3); font-size: 0.82rem; font-weight: 500;
}
.spinner-ring {
  width: 44px; height: 44px; position: relative;
  border-radius: 50%;
  border: 3px solid var(--glass-hi);
  border-top-color: var(--cyan);
  animation: spinSmooth 0.9s linear infinite;
}
.spinner-inner {
  position: absolute; inset: 4px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: var(--purple);
  animation: spinSmooth 1.4s linear infinite reverse;
}
@keyframes spinSmooth { to { transform: rotate(360deg); } }

/* Empty State */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  animation: fadeUp 0.4s var(--ease);
}
.empty-icon { font-size: 52px; color: var(--text-3); opacity: 0.2; display: block; margin-bottom: 0.8rem; }
.empty-title { font-size: 1rem; font-weight: 600; color: var(--text-2); margin-bottom: 0.3rem; }
.empty-sub { font-size: 0.82rem; color: var(--text-3); }

/* Table */
.table-scroll { overflow-x: auto; }

#inventoryTable {
  width: 100%; border-collapse: separate; border-spacing: 0; min-width: 560px;
}
#inventoryTable th {
  padding: 0.7rem 1rem;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-hi);
  text-align: left;
  position: sticky; top: 0;
  background: var(--bg-surface);
  white-space: nowrap;
}
.th-content {
  display: inline-flex; align-items: center; gap: 4px;
}

#inventoryTable td {
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  transition: background var(--fast) var(--ease);
}
#inventoryTable tbody tr {
  transition: all var(--fast) var(--ease);
  cursor: default;
}
#inventoryTable tbody tr:hover {
  background: var(--glass-hi);
}
#inventoryTable tbody tr:hover td {
  border-bottom-color: rgba(34,211,238,0.08);
}

/* Row animation */
#inventoryTable tbody tr {
  animation: rowReveal 0.4s var(--spring) both;
}
@keyframes rowReveal {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* Article name */
.article-name {
  font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.article-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cyan); opacity: 0.5;
  transition: transform var(--med) var(--spring);
}
tr:hover .article-dot {
  transform: scale(1.8);
  opacity: 1;
}

/* Category badge */
.cat-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px; border-radius: 20px;
  font-size: 0.76rem; font-weight: 600;
  border: 1px solid;
  transition: all var(--fast) var(--ease);
}
.cat-lacteos      { background: rgba(96,165,250,0.06);  color: #60a5fa; border-color: rgba(96,165,250,0.15); }
.cat-carnes       { background: rgba(248,113,113,0.06); color: #f87171; border-color: rgba(248,113,113,0.15); }
.cat-bebidas      { background: rgba(34,211,238,0.06);  color: var(--cyan); border-color: rgba(34,211,238,0.15); }
.cat-panaderia    { background: rgba(251,191,36,0.06);  color: var(--amber); border-color: rgba(251,191,36,0.15); }
.cat-frutas       { background: rgba(52,211,153,0.06);  color: var(--green); border-color: rgba(52,211,153,0.15); }
.cat-abarrotes    { background: rgba(251,146,60,0.06);  color: var(--orange); border-color: rgba(251,146,60,0.15); }
.cat-limpieza     { background: rgba(167,139,250,0.06); color: var(--purple); border-color: rgba(167,139,250,0.15); }
.cat-higiene      { background: rgba(244,114,182,0.06); color: #f472b6; border-color: rgba(244,114,182,0.15); }
.cat-botanas      { background: rgba(253,224,71,0.06);  color: #fde047; border-color: rgba(253,224,71,0.15); }
.cat-congelados   { background: rgba(147,197,253,0.06); color: #93c5fd; border-color: rgba(147,197,253,0.15); }
.cat-default      { background: var(--glass-md); color: var(--text-2); border-color: var(--border); }

tr:hover .cat-badge { transform: scale(1.03); }

/* Price */
.price-cell {
  font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--text);
}
.price-sign { color: var(--text-3); font-weight: 400; margin-right: 1px; }

/* Stock chip */
.stock-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 11px; border-radius: 20px;
  font-weight: 600; font-size: 0.8rem;
  transition: all var(--fast) var(--ease);
}
.stock-chip.good { background: var(--green-bg); color: var(--green); }
.stock-chip.low  { background: var(--orange-bg); color: var(--orange); }
.stock-chip.out  { background: var(--red-bg); color: var(--red); }

.stock-icon { font-size: 13px; }
tr:hover .stock-chip { transform: scale(1.05); }

/* Stock bar */
.stock-bar-wrap {
  width: 60px; height: 4px; border-radius: 4px;
  background: var(--glass-hi);
  margin-top: 4px;
  overflow: hidden;
}
.stock-bar {
  height: 100%; border-radius: 4px;
  transition: width 0.8s var(--ease);
}
.stock-bar.good { background: var(--green); }
.stock-bar.low  { background: var(--orange); }
.stock-bar.out  { background: var(--red); }

/* Footer */
.app-footer {
  text-align: center; padding: 2.5rem 0 1rem;
  animation: fadeUp 0.5s var(--ease) 0.6s both;
}
.footer-content {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--text-3); opacity: 0.5;
}
.footer-lock { font-size: 14px; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .app-screen { padding: 0 1rem 1.5rem; }
  .topbar { flex-wrap: wrap; gap: 0.8rem; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; }
  .stat-card { padding: 1rem; }
  .stat-value { font-size: 1.2rem; }
  .table-toolbar { flex-direction: column; align-items: stretch; }
  .search-box, .search-box:focus-within { width: 100%; }
  .table-card { padding: 1rem; }
  .login-card { padding: 2.5rem 1.8rem 1.5rem; }
  .sidebar-accent { display: none; }
}
@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr; }
  .topbar-sub { display: none; }
}
