:root {
  --tk-sidebar-bg: #0f172a;
  --tk-sidebar-width: 250px;
  --tk-accent: #0d9488;
  --tk-accent-hover: #0f766e;
  --tk-danger: #dc2626;
}

/* ── Layout ───────────────────────────────────────── */
body { background: #f1f5f9; font-family: 'Inter', system-ui, sans-serif; }

.tk-sidebar {
  width: var(--tk-sidebar-width);
  min-height: 100vh;
  background: var(--tk-sidebar-bg);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
}

.tk-main {
  margin-left: var(--tk-sidebar-width);
  min-height: 100vh;
  padding: 1.5rem;
}

@media (max-width: 991px) {
  .tk-sidebar { transform: translateX(-100%); }
  .tk-sidebar.show { transform: translateX(0); }
  .tk-main { margin-left: 0; }
}

/* ── Sidebar links ────────────────────────────────── */
.tk-nav-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem 1rem;
  border-radius: .5rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  margin-bottom: .15rem;
}
.tk-nav-link:hover  { background: rgba(255,255,255,.06); color: #e2e8f0; }
.tk-nav-link.active { background: var(--tk-accent); color: #fff; }
.tk-nav-link .bi    { font-size: 1.1rem; }

/* ── Cards ────────────────────────────────────────── */
.tk-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: .875rem;
  box-shadow: 0 1px 8px rgba(15,23,42,.06);
  padding: 1.25rem;
}

.stat-card {
  border-left: 4px solid transparent;
}
.stat-card.green  { border-color: #10b981; }
.stat-card.blue   { border-color: #3b82f6; }
.stat-card.red    { border-color: #ef4444; }
.stat-card.orange { border-color: #f97316; }

/* ── Tablas ───────────────────────────────────────── */
.tk-table thead th {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 700;
  color: #475569;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.tk-table thead th:hover { background: #f1f5f9; }
.tk-table tbody tr:hover { background: #f0fdfa; }
.tk-table td { vertical-align: middle; font-size: .875rem; }

/* ── Badges ───────────────────────────────────────── */
.badge-consumable { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.badge-durable    { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.badge-low        { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.badge-ok         { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }

/* ── Buttons ──────────────────────────────────────── */
.btn-tk-primary { background: var(--tk-accent); border-color: var(--tk-accent); color: #fff; }
.btn-tk-primary:hover { background: var(--tk-accent-hover); border-color: var(--tk-accent-hover); color: #fff; }

/* ── Alert strip ──────────────────────────────────── */
.alert-strip {
  border-left: 4px solid;
  border-radius: .5rem;
  padding: .75rem 1rem;
  margin-bottom: .5rem;
  font-size: .875rem;
}
.alert-strip.low      { border-color: #ef4444; background: #fef2f2; }
.alert-strip.expired  { border-color: #f97316; background: #fff7ed; }

/* ── Scanner ──────────────────────────────────────── */
#scanner-video {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: .5rem;
  background: #000;
}
.scanner-overlay {
  position: absolute;
  inset: 0;
  border: 3px solid #facc15;
  border-radius: .5rem;
  pointer-events: none;
}

/* ── Misc ─────────────────────────────────────────── */
.mono { font-family: 'JetBrains Mono', 'Courier New', monospace; font-size: .85em; }
.page-loader { display: flex; align-items: center; justify-content: center; min-height: 200px; }
.sortable::after { content: ' ↕'; opacity: .4; font-size: .7em; }
.sort-asc::after { content: ' ↑'; opacity: 1; }
.sort-desc::after { content: ' ↓'; opacity: 1; }
