/* ============================================================
   main.css — Notebook Factory Design System
   ============================================================ */

/* ── Google Fonts ──────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800;900&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-base:       #030712; /* Deep Space Obsidian */
  --bg-surface:    #090d16; /* Dark Obsidian Surface */
  --bg-card:       rgba(15, 23, 42, 0.45); /* Glassmorphic Slate */
  --bg-card-hover: rgba(30, 41, 59, 0.6);
  --bg-input:      rgba(255, 255, 255, 0.05);
  --bg-overlay:    rgba(0, 0, 0, 0.75);

  --primary:       #10B981;
  --primary-dark:  #059669;
  --primary-glow:  rgba(16, 185, 129, 0.18);
  --accent:        #6366f1; /* Premium Indigo Accent */
  --accent-dark:   #4f46e5;
  --accent-glow:   rgba(99, 102, 241, 0.15);
  --danger:        #EF4444;
  --danger-dark:   #DC2626;
  --info:          #3B82F6;
  --purple:        #8B5CF6;

  --text-primary:   #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted:     #64748B;
  --text-inverse:   #0F172A;

  --border:        rgba(255, 255, 255, 0.05);
  --border-focus:  var(--primary);

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --radius:        14px;
  --radius-sm:     8px;
  --radius-lg:     18px;

  --shadow-sm:   0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md:   0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-lg:   0 12px 40px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  --font-header:   'Outfit', sans-serif;
  --font-body:     'Plus Jakarta Sans', sans-serif;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(16, 185, 129, 0.04) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 13.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }

/* ── Typography Engine ── */
h1, h2, h3, h4, h5, h6, .kpi-value, .brand-name, .card-title, .topbar-title h1, .section-title {
  font-family: var(--font-header) !important;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ── App Shell ─────────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(16,185,129,0.08), transparent);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.brand-name { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.brand-sub  { font-size: 11px; color: var(--primary); letter-spacing: 0.5px; }

.sidebar-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary); font-size: 18px;
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.sidebar-toggle:hover { background: var(--bg-card); color: var(--text-primary); }

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}
.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid rgba(16,185,129,0.2);
}
.nav-item.active .nav-icon { filter: none; }
.nav-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }
.nav-label small { display: block; font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.nav-badge {
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
  animation: pulse 2s infinite;
}

.sidebar-footer {
  padding: 12px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.premium-avatar-container {
  position: relative;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-halo {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  padding: 1.5px;
  background: conic-gradient(from 0deg, var(--accent), var(--primary), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: halo-spin 6s linear infinite;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.15);
  pointer-events: none;
}
.premium-avatar-container:hover .avatar-halo {
  animation: halo-spin 2s linear infinite;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}
@keyframes halo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.15);
  transition: var(--transition);
}
.premium-avatar-container:hover .user-avatar {
  transform: scale(1.05);
}
.user-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 1.5px solid var(--bg-surface);
  box-shadow: 0 0 6px var(--primary);
  animation: pulse-glow-status 2s infinite;
}
@keyframes pulse-glow-status {
  0% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 4px var(--primary); }
  50% { transform: scale(1.15); opacity: 0.6; box-shadow: 0 0 8px var(--primary); }
  100% { transform: scale(0.9); opacity: 1; box-shadow: 0 0 4px var(--primary); }
}

/* ── Dynamic Authority Popover Card ── */
.authority-popover {
  position: absolute;
  bottom: 68px;
  left: 12px;
  width: calc(var(--sidebar-width) - 24px);
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(25px) saturate(150%);
  -webkit-backdrop-filter: blur(25px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  box-shadow: 
    0 12px 36px rgba(0, 0, 0, 0.8),
    inset 0 1px 1px rgba(255, 255, 255, 0.03);
  z-index: 1000;
  transform: translateY(12px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}
.authority-popover.popover-open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}
.auth-popover-header {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.auth-popover-header h3 {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.auth-popover-body {
  padding: 12px 14px;
}
.user-info { min-width: 0; }
.user-name {
  font-size: 12px; font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role { font-size: 10px; font-weight: 500; }

.btn-logout {
  background: none; border: none;
  color: var(--text-muted);
  font-size: 18px; padding: 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  line-height: 1;
}
.btn-logout:hover { color: var(--danger); background: rgba(239,68,68,0.1); }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  z-index: 99;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
}
.topbar-left { display: flex; align-items: center; gap: 16px; }
.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--text-secondary); font-size: 20px;
  padding: 6px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.menu-toggle:hover { color: var(--primary); }
.topbar-title h1 { font-size: 18px; font-weight: 700; line-height: 1.2; }
.topbar-title-hi { font-size: 11px; color: var(--text-muted); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.clock {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  background: var(--bg-card);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ── Page Body ─────────────────────────────────────────────── */
.page-body {
  padding: 24px;
  flex: 1;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 
    0 4px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.03);
  transition: var(--transition);
}
.card:hover { 
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.65),
    0 0 20px rgba(99, 102, 241, 0.08);
  transform: translateY(-1.5px);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  margin-top: 2px;
}

/* ── KPI Cards ─────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.02);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: default;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  opacity: 0.85;
}
.kpi-card.green::before  { background: linear-gradient(90deg, var(--primary), #34D399); }
.kpi-card.amber::before  { background: linear-gradient(90deg, var(--primary), var(--accent)); }
.kpi-card.blue::before   { background: linear-gradient(90deg, var(--info), var(--purple)); }
.kpi-card.red::before    { background: linear-gradient(90deg, var(--danger), #EC4899); }
.kpi-card.purple::before { background: linear-gradient(90deg, var(--purple), var(--info)); }
.kpi-card:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55); 
  border-color: rgba(255, 255, 255, 0.12);
}

.kpi-icon { font-size: 28px; margin-bottom: 12px; }
.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 6px;
}
.kpi-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.kpi-label small { display: block; color: var(--text-muted); font-size: 10px; margin-top: 2px; }

/* ── Grid ──────────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { 
  background: linear-gradient(135deg, var(--primary-dark), var(--primary)); 
  color: #fff; 
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 14px var(--primary-glow);
  position: relative;
  overflow: hidden;
}
.btn-primary:hover  { 
  background: linear-gradient(135deg, var(--primary), #10B981); 
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}
.btn-primary::after {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.08), transparent);
  transform: rotate(45deg);
  transition: all 0.6s ease;
  left: -150%;
}
.btn-primary:hover::after {
  left: 150%;
}
.btn-accent   { background: var(--accent); color: var(--text-inverse); }
.btn-accent:hover   { background: var(--accent-dark); }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-danger:hover   { background: var(--danger-dark); }
.btn-ghost    { background: var(--bg-card); color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover    { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-outline  { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover  { background: var(--primary-glow); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-icon { padding: 7px; width: 34px; height: 34px; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-label .hi { font-size: 10px; color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: rgba(16,185,129,0.04);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: var(--bg-surface); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Search Bar ────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 220px;
  transition: var(--transition);
}
.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.search-bar input {
  background: none; border: none; outline: none;
  color: var(--text-primary); font-size: 13px;
  flex: 1; min-width: 0;
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); font-size: 16px; flex-shrink: 0; }

/* ── Tabs ──────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.tab-btn {
  padding: 10px 20px;
  background: none; border: none;
  color: var(--text-secondary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--text-secondary);
  vertical-align: middle;
  transition: background 0.25s ease, transform 0.25s ease;
}
td strong { color: var(--text-primary); font-weight: 600; }
tr {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
tr:hover td { 
  background: rgba(255, 255, 255, 0.015) !important;
  color: var(--text-primary);
}
tr:hover {
  transform: translateX(1.5px);
}
tr:last-child td { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 48px 24px !important;
  color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.5; }

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge-success  { background: rgba(16,185,129,0.15);  color: #10B981; border: 1px solid rgba(16,185,129,0.3); }
.badge-danger   { background: rgba(239,68,68,0.15);   color: #F87171; border: 1px solid rgba(239,68,68,0.3); }
.badge-warning  { background: rgba(245,158,11,0.15);  color: #F59E0B; border: 1px solid rgba(245,158,11,0.3); }
.badge-info     { background: rgba(59,130,246,0.15);  color: #60A5FA; border: 1px solid rgba(59,130,246,0.3); }
.badge-primary  { background: rgba(16,185,129,0.12);  color: #34D399; border: 1px solid rgba(16,185,129,0.25); }
.badge-secondary{ background: rgba(148,163,184,0.1);  color: #94A3B8; border: 1px solid rgba(148,163,184,0.2); }
.badge-purple   { background: rgba(139,92,246,0.15);  color: #A78BFA; border: 1px solid rgba(139,92,246,0.3); }

/* ── Stock Bar ─────────────────────────────────────────────── */
.stock-bar {
  width: 80px; height: 5px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.stock-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* ── Stars ─────────────────────────────────────────────────── */
.stars { color: var(--accent); font-size: 14px; letter-spacing: 1px; }

/* ── Modals ────────────────────────────────────────────────── */
.modal {
  display: none;
  position: fixed; inset: 0; z-index: 200;
  align-items: center; justify-content: center;
}
.modal.modal-open { display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}
.modal-box {
  position: relative; z-index: 1;
  background: rgba(9, 13, 22, 0.72) !important;
  backdrop-filter: blur(20px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(140%) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: var(--radius-lg);
  box-shadow: 
    0 24px 60px rgba(0, 0, 0, 0.7),
    inset 0 1px 1px rgba(255, 255, 255, 0.03);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-box-lg { max-width: 720px; }
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none;
  color: var(--text-muted); font-size: 18px;
  padding: 4px 8px; border-radius: var(--radius-sm);
  transition: var(--transition);
}
.modal-close:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; justify-content: flex-end;
  flex-wrap: wrap;
}

/* ── Toast ─────────────────────────────────────────────────── */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 360px;
  min-width: 260px;
}
.toast.toast-show { transform: translateX(0); }
.toast-success { border-left: 3px solid var(--primary); }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--accent); }
.toast-info    { border-left: 3px solid var(--info); }
.toast-icon { font-size: 16px; flex-shrink: 0; }
.toast-msg { font-size: 13px; color: var(--text-primary); }

/* ── Kanban Board ──────────────────────────────────────────── */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: start;
}
.kanban-col {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.kanban-col-header {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.kanban-col-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
}
.kanban-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: var(--transition);
}
.kanban-card:hover { border-color: rgba(255,255,255,0.15); box-shadow: var(--shadow-sm); }
.kanban-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.kanban-card-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Timeline ──────────────────────────────────────────────── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 20px;
  border-left: 2px solid var(--border);
}
.timeline-item {
  position: relative;
  padding: 0 0 20px 20px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px; top: 4px;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-surface);
}
.timeline-item.done::before   { background: var(--primary); }
.timeline-item.active::before { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.timeline-item.pending::before{ background: var(--text-muted); }
.timeline-label { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.timeline-date  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Alert Items ───────────────────────────────────────────── */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 10px;
  transition: var(--transition);
}
.alert-item:hover { background: var(--bg-card); }
.alert-item.critical { border-left: 3px solid var(--danger); }
.alert-item.low      { border-left: 3px solid var(--accent); }
.alert-item.info     { border-left: 3px solid var(--info); }
.alert-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.alert-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.alert-time  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ── Progress Bar ──────────────────────────────────────────── */
.progress-bar {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 0.5s ease;
}

/* ── Stat Row ──────────────────────────────────────────────── */
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.stat-row:last-child { border-bottom: none; }
.stat-label { font-size: 12px; color: var(--text-secondary); }
.stat-value { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ── Section Header ────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ── Toolbar ───────────────────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* ── Login Page ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  position: relative;
  overflow: hidden;
}
.login-bg-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.08), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  animation: modal-in 0.3s ease;
}
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-brand-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px var(--primary-glow);
}
.login-brand h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-brand p  { font-size: 12px; color: var(--text-muted); }

.demo-credentials {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 20px;
}
.demo-credentials h4 { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.demo-credential {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 4px;
}
.demo-credential:hover { background: var(--bg-card-hover); }
.demo-cred-role { font-size: 12px; font-weight: 600; color: var(--text-primary); min-width: 160px; }
.demo-cred-info { font-size: 11px; color: var(--text-muted); font-family: monospace; }

/* ── Print Invoice ─────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin-left: 0 !important; }
  body { background: white; color: black; }
  .card { border: 1px solid #ddd; background: white; }
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeInUp 0.3s ease; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kanban-board { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-width: 260px; }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-toggle { display: block; }
  .sidebar-overlay.open { display: block; }

  .main-content { margin-left: 0; }
  .menu-toggle  { display: block; }
  .topbar { padding: 0 16px; }
  .page-body { padding: 16px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kanban-board { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
  .search-bar { min-width: 160px; }
  .clock { display: none; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .modal-box { width: 95%; }
  .login-card { padding: 28px 20px; }
}

/* ── Supplier Rating ───────────────────────────────────────── */
.rating-input { display: flex; gap: 4px; }
.rating-input input { display: none; }
.rating-input label {
  font-size: 22px; cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}
.rating-input label:hover,
.rating-input input:checked ~ label { color: var(--accent); }

/* ── Divider ───────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ── Info Row ──────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.info-item { }
.info-item-label { font-size: 11px; color: var(--text-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
.info-item-value { font-size: 13px; color: var(--text-primary); font-weight: 500; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Highlight ─────────────────────────────────────────────── */
.text-primary   { color: var(--primary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-danger    { color: var(--danger) !important; }
.text-muted     { color: var(--text-muted) !important; }
.text-right     { text-align: right; }
.fw-bold        { font-weight: 700; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ============================================================
   Inventory Compact Executive Layout (Screen-Efficient CSS)
   ============================================================ */
#tab-raw, #tab-fg {
  font-size: 13px;
}

/* Page spacing compression */
.page-body {
  padding: 12px 16px !important; /* Compresses overall container padding */
}

.tabs {
  margin-bottom: 12px !important;
}

.tab-btn {
  padding: 6px 14px !important;
  font-size: 12px !important;
}

/* KPI Summary Cards compression */
.kpi-grid {
  gap: 8px !important;
  margin-bottom: 12px !important;
}

.kpi-card {
  padding: 8px 12px !important;
  border-radius: 8px !important;
}

.kpi-icon {
  font-size: 18px !important;
  margin-bottom: 4px !important;
}

.kpi-value {
  font-size: 18px !important;
  margin-bottom: 2px !important;
  letter-spacing: -0.5px;
}

.kpi-label {
  font-size: 10.5px !important;
}

.kpi-label small {
  font-size: 8.5px !important;
  margin-top: 1px !important;
}

/* Section header and toolbar compression */
.section-header {
  margin-bottom: 8px !important;
}

.section-title {
  font-size: 13.5px !important;
}

.section-title small {
  font-size: 10px !important;
}

.toolbar {
  margin-bottom: 8px !important;
  gap: 6px !important;
}

.toolbar .search-bar {
  padding: 5px 10px !important;
  min-width: 160px !important;
  height: 30px !important;
}

.toolbar .search-bar input {
  font-size: 12px !important;
}

.toolbar .form-control {
  padding: 5px 10px !important;
  font-size: 12px !important;
  height: 30px !important;
  width: auto !important;
}

.card {
  padding: 8px 12px !important;
  border-radius: 8px !important;
}

/* Table Grid Spacing & Typography Compacting */
#raw-table, #fg-table {
  width: 100% !important;
}

#raw-table th, #fg-table th {
  padding: 6px 8px !important;
  font-size: 9.5px !important;
  letter-spacing: 0.2px !important;
  line-height: 1.2 !important;
}

#raw-table td, #fg-table td {
  padding: 5px 8px !important;
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  border-bottom: 1px solid rgba(255,255,255,0.03) !important;
}

#raw-table td strong, #fg-table td strong {
  font-size: 11.5px !important;
}

#raw-table td .badge, #fg-table td .badge {
  padding: 1px 6px !important;
  font-size: 9px !important;
  border-radius: 4px !important;
}

#raw-table td .stock-bar, #fg-table td .stock-bar {
  width: 45px !important;
  height: 4px !important;
  margin-top: 2px !important;
}

#raw-table td .btn-group .btn, #fg-table td .btn-group .btn {
  padding: 2px !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 10px !important;
  border-radius: 4px !important;
}

#raw-table tfoot tr td, #fg-table tfoot tr td {
  padding: 6px 8px !important;
  font-size: 11.5px !important;
}

/* ── Modern Spacious Dashboard Cockpit Grid ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Premium Cloud Status Pulse & Interactive Star Rating ── */
.cloud-status {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  cursor: pointer;
  transition: var(--transition);
}
.cloud-status.active {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--primary);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.1);
}
.cloud-status.local {
  border-color: rgba(245, 158, 11, 0.35);
  color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}
.cloud-status .cloud-pulse {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  top: 4px; right: 4px;
}
.cloud-status.active .cloud-pulse {
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
  animation: pulse-glow 2s infinite;
}
.cloud-status.local .cloud-pulse {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* Star Rating Component */
.rating-stars-container {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
.rating-star-btn {
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}
.rating-star-btn.hovered, .rating-star-btn.selected {
  color: #f59e0b;
  text-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  transform: scale(1.15);
}

/* Generic Sticky Table Headers within wrappers */
.table-wrapper {
  max-height: 480px;
  overflow-y: auto;
  border-radius: var(--radius-sm);
}
.table-wrapper table th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #090d16 !important;
  box-shadow: inset 0 -1px 0 var(--border);
}

/* ── Premium Glowing KPI Cards ── */
.kpi-card {
  position: relative;
  overflow: hidden;
}
.kpi-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  margin-bottom: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  transition: var(--transition);
}
.kpi-card.green .kpi-icon-wrapper {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--primary);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}
.kpi-card.blue .kpi-icon-wrapper {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.2);
  color: var(--info);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}
.kpi-card.purple .kpi-icon-wrapper {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
  color: var(--purple);
  box-shadow: 0 0 15px rgba(139, 92, 246, 0.1);
}
.kpi-card.red .kpi-icon-wrapper {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.1);
}

.kpi-card:hover .kpi-icon-wrapper {
  transform: scale(1.08) rotate(2deg);
}

.kpi-card.green .kpi-value {
  text-shadow: 0 0 15px rgba(16, 185, 129, 0.25);
}
.kpi-card.blue .kpi-value {
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}
.kpi-card.purple .kpi-value {
  text-shadow: 0 0 15px rgba(139, 92, 246, 0.25);
}
.kpi-card.red .kpi-value {
  text-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

/* Dashboard Cockpit Greeting Banner */
.cockpit-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.35), rgba(9, 13, 22, 0.55));
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.02);
}
.cockpit-greeting h2 {
  font-size: 17px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.cockpit-greeting p {
  font-size: 11.5px;
  color: var(--text-secondary);
}

/* ============================================================
   Elite Factory Command Center Dashboard Styles
   ============================================================ */

/* ── Live Operational Status Bar ── */
.dash-status-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.status-pill {
  background: rgba(15, 23, 42, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  transition: var(--transition);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.01);
}
.status-pill:hover {
  background: rgba(30, 41, 59, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}
.status-pill-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.status-pill-title {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
}
.status-pill-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-beacon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: relative;
}
.status-beacon.green {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: beacon-glow 1.8s infinite;
}
.status-beacon.amber {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: beacon-glow 1.8s infinite;
}
.status-beacon.blue {
  background: var(--info);
  box-shadow: 0 0 10px var(--info);
}
.status-beacon.purple {
  background: var(--purple);
  box-shadow: 0 0 10px var(--purple);
}
.status-beacon.red {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: beacon-glow 1.5s infinite;
}
@keyframes beacon-glow {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ── Interactive Factory Intelligence Hub (Glass Tabs) ── */
.intel-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px !important;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  margin-bottom: 20px;
}
.intel-hub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.intel-hub-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.intel-hub-title small {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.glass-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  gap: 4px;
}
.glass-tab-btn {
  padding: 6px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.glass-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.03);
}
.glass-tab-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  box-shadow: 0 4px 12px var(--accent-glow);
}

.tab-pane {
  display: none;
}
.tab-pane.active {
  display: block;
  animation: tab-switch-fade 0.3s ease;
}
@keyframes tab-switch-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Customer Initials Avatar ── */
.customer-avatar-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}
.customer-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
}

/* ── Active Production Timeline Progress ── */
.active-runs-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
}
.active-run-card {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: var(--transition);
}
.active-run-card:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.06);
}
.active-run-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.active-run-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--text-primary);
}
.active-run-meta {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
}
.active-run-progress-bar {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}
.active-run-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.active-run-progress-fill.in_progress {
  background: linear-gradient(90deg, var(--accent), #818cf8);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
}
.active-run-progress-fill.qc {
  background: linear-gradient(90deg, var(--purple), #a78bfa);
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}
.active-run-progress-fill.planned {
  background: linear-gradient(90deg, var(--info), #60a5fa);
}

/* ── Compact Sidebar Feeds ── */
.sidebar-feed-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.012);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  margin-bottom: 8px;
}
.sidebar-feed-card:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.07);
  transform: translateX(1.5px);
}
.sidebar-feed-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.sidebar-feed-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-feed-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-feed-subtitle {
  font-size: 10.5px;
  color: var(--text-secondary);
}
.sidebar-feed-action {
  font-size: 10px;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.15);
  transition: var(--transition);
  text-align: center;
  align-self: center;
}
.sidebar-feed-action:hover {
  background: var(--primary);
  color: #fff;
}

/* ── Hologram Vector Animations ── */
.hologram-svg {
  display: block;
  pointer-events: none;
}
.float-anim {
  animation: hologram-float 3.5s ease-in-out infinite;
}
@keyframes hologram-float {
  0% { transform: translateY(1px); }
  50% { transform: translateY(-1.5px); }
  100% { transform: translateY(1px); }
}

.spin-clockwise {
  animation: spin-cw 12s linear infinite;
}
@keyframes spin-cw {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spin-counterclockwise {
  animation: spin-ccw 8s linear infinite;
}
@keyframes spin-ccw {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.pulse-ring-anim {
  animation: ring-scale-glow 2.5s ease-out infinite;
}
@keyframes ring-scale-glow {
  0% { transform: scale(0.85); opacity: 0.8; stroke-width: 0.8px; }
  50% { transform: scale(1.05); opacity: 0.3; stroke-width: 1.2px; }
  100% { transform: scale(0.85); opacity: 0.8; stroke-width: 0.8px; }
}

.laser-sweep {
  animation: sweep-y 3s ease-in-out infinite;
}
@keyframes sweep-y {
  0% { transform: translateY(-3px); opacity: 0.4; }
  50% { transform: translateY(3px); opacity: 0.9; }
  100% { transform: translateY(-3px); opacity: 0.4; }
}

.radar-spin {
  animation: radar-sweep 4s linear infinite;
}
@keyframes radar-sweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
