/* ==========================================================================
   STEM IoT Admin - Enterprise SaaS Dashboard Design System
   Style: Dark Obsidian Sidebar + Frosted Glass Surfaces + High-Contrast Tables
   Typography: Plus Jakarta Sans & JetBrains Mono
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
  /* Brand Palettes */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.25);
  --cyan: #06b6d4;
  --cyan-glow: rgba(6, 182, 212, 0.25);

  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-text: #047857;

  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-text: #b45309;

  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;

  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-text: #0369a1;

  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --purple-text: #6d28d9;

  /* Neutrals */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #93c5fd;

  --text-dark: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Sidebar Dark Theme Tokens */
  --sidebar-bg: #090d16;
  --sidebar-surface: #0f172a;
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-text: #94a3b8;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.05);
  --sidebar-active-bg: rgba(37, 99, 235, 0.16);
  --sidebar-width: 260px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 2px 4px -1px rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.1), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 40px -8px rgba(15, 23, 42, 0.16);

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-dark);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   LAYOUT STRUCTURE
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* ==========================================================================
   SIDEBAR (Obsidian Dark Glass)
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-header .logo-mark {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 14px var(--primary-glow);
  flex-shrink: 0;
}

.sidebar-header h2 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.sidebar-header p {
  font-size: 11.5px;
  color: var(--cyan);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

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

.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-nav a:hover {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-nav a.active {
  background: var(--sidebar-active-bg);
  color: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 16px -2px var(--primary-glow);
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--cyan);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--cyan);
}

.sidebar-nav a .nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: var(--sidebar-text);
  transition: color var(--transition-fast);
}

.sidebar-nav a.active .nav-icon,
.sidebar-nav a:hover .nav-icon {
  color: var(--cyan);
}

.sidebar-nav a .nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--sidebar-border);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #334155, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.user-avatar::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: var(--success);
  border-radius: var(--radius-full);
  border: 1.5px solid var(--sidebar-bg);
}

.user-meta .name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}

.user-meta .role {
  font-size: 11.5px;
  color: var(--sidebar-text);
}

.logout-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
}

/* ==========================================================================
   MAIN CONTENT & TOPBAR
   ========================================================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-dark);
  padding: 6px;
  border-radius: var(--radius-sm);
}

.menu-toggle:hover {
  background: var(--bg-surface-alt);
}

.page-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-dark);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-content {
  padding: 28px;
  flex: 1;
}

/* Live Sync Indicator Pill */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--success-bg);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--success-text);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: var(--success);
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: var(--radius-full);
  background: var(--success);
  opacity: 0.4;
  animation: dotPulse 1.8s infinite;
}

@keyframes dotPulse {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* ==========================================================================
   STAT CARDS (Enterprise Metric Intelligence)
   ========================================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.7);
    opacity: 0.4;
  }
}

.stat-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  padding: 22px 20px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 6px 16px -2px rgba(15, 23, 42, 0.04);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease;
  position: relative;
  overflow: hidden;
}

/* Top Accent Line */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3.5px;
  background: linear-gradient(90deg, #94a3b8, #cbd5e1);
  transition: opacity 0.25s ease;
  z-index: 2;
}

/* Subtle Ambient Corner Aura */
.stat-card::after {
  content: '';
  position: absolute;
  top: -24px;
  right: -24px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0.12;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 0;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -4px rgba(15, 23, 42, 0.09), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.stat-card:hover::after {
  opacity: 0.22;
  transform: scale(1.18);
}

/* Color Themes: Green */
.stat-card:has(.stat-icon.green)::before,
.stat-card.stat-card-green::before {
  background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}
.stat-card:has(.stat-icon.green)::after,
.stat-card.stat-card-green::after {
  background: radial-gradient(circle, #10b981 0%, transparent 70%);
}
.stat-card:has(.stat-icon.green):hover,
.stat-card.stat-card-green:hover {
  border-color: rgba(16, 185, 129, 0.42);
  box-shadow: 0 14px 28px -4px rgba(16, 185, 129, 0.16), 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* Color Themes: Blue */
.stat-card:has(.stat-icon.blue)::before,
.stat-card.stat-card-blue::before {
  background: linear-gradient(90deg, #2563eb 0%, #60a5fa 100%);
}
.stat-card:has(.stat-icon.blue)::after,
.stat-card.stat-card-blue::after {
  background: radial-gradient(circle, #2563eb 0%, transparent 70%);
}
.stat-card:has(.stat-icon.blue):hover,
.stat-card.stat-card-blue:hover {
  border-color: rgba(37, 99, 235, 0.42);
  box-shadow: 0 14px 28px -4px rgba(37, 99, 235, 0.16), 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* Color Themes: Orange */
.stat-card:has(.stat-icon.orange)::before,
.stat-card.stat-card-orange::before {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
}
.stat-card:has(.stat-icon.orange)::after,
.stat-card.stat-card-orange::after {
  background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
}
.stat-card:has(.stat-icon.orange):hover,
.stat-card.stat-card-orange:hover {
  border-color: rgba(245, 158, 11, 0.42);
  box-shadow: 0 14px 28px -4px rgba(245, 158, 11, 0.16), 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* Color Themes: Purple */
.stat-card:has(.stat-icon.purple)::before,
.stat-card.stat-card-purple::before {
  background: linear-gradient(90deg, #8b5cf6 0%, #c084fc 100%);
}
.stat-card:has(.stat-icon.purple)::after,
.stat-card.stat-card-purple::after {
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
}
.stat-card:has(.stat-icon.purple):hover,
.stat-card.stat-card-purple:hover {
  border-color: rgba(139, 92, 246, 0.42);
  box-shadow: 0 14px 28px -4px rgba(139, 92, 246, 0.16), 0 4px 12px rgba(15, 23, 42, 0.04);
}

/* Color Themes: Red */
.stat-card:has(.stat-icon.red)::before,
.stat-card.stat-card-red::before {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}
.stat-card:has(.stat-icon.red)::after,
.stat-card.stat-card-red::after {
  background: radial-gradient(circle, #ef4444 0%, transparent 70%);
}
.stat-card:has(.stat-icon.red):hover,
.stat-card.stat-card-red:hover {
  border-color: rgba(239, 68, 68, 0.42);
  box-shadow: 0 14px 28px -4px rgba(239, 68, 68, 0.16), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease;
  position: relative;
  z-index: 1;
}

.stat-card:hover .stat-icon {
  transform: translateY(-2px) scale(1.08);
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2.2px;
}

.stat-icon.green {
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.28);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.16);
}

.stat-icon.blue {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: #2563eb;
  border: 1px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.16);
}

.stat-icon.orange {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.28);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.16);
}

.stat-icon.purple {
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.28);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.16);
}

.stat-icon.red {
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.28);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.16);
}

.stat-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.stat-info h3 {
  font-size: clamp(21px, 1.55vw, 26px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
  line-height: 1.18;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}

.stat-info p {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 9px;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3.5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.28);
  transition: all 0.2s ease;
  white-space: nowrap;
  max-width: 100%;
}

.stat-trend::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.stat-trend.up {
  background: #ecfdf5;
  color: #047857;
  border-color: rgba(16, 185, 129, 0.3);
}

.stat-trend.down {
  background: #fef2f2;
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.3);
}

.stat-trend.down::before {
  animation: pulseDot 1.8s infinite ease-in-out;
}

/* ==========================================================================
   CARDS & PANELS
   ========================================================================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.01em;
}

.card-body {
  padding: 24px;
}

.card-body.no-padding {
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */
.table-responsive,
.table-wrapper {
  width: 100%;
  overflow-x: auto;
}

.table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.table thead,
.data-table thead {
  background: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border);
}

.table th,
.data-table th {
  padding: 12px 18px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.table td,
.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-secondary);
}

.table tbody tr,
.data-table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover,
.data-table tbody tr:hover {
  background: #f8fafc;
}

.table tbody tr:last-child td,
.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Table cells */
.product-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 2px;
  flex-shrink: 0;
}

.product-cell .info h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.product-cell .info span {
  font-size: 11.5px;
  color: var(--text-light);
  font-family: 'JetBrains Mono', monospace;
}

/* Table Action Buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn svg {
  width: 15px;
  height: 15px;
}

.action-btn.view:hover {
  background: var(--info-bg);
  border-color: rgba(2, 132, 199, 0.3);
  color: var(--info);
}

.action-btn.edit:hover {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--warning-text);
}

.action-btn.delete:hover,
.action-btn.cancel:hover {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger-text);
}

.action-btn.pdf:hover,
.action-btn.print:hover {
  background: #ecfdf5;
  border-color: rgba(5, 150, 105, 0.35);
  color: #059669;
}

.action-btn.check-done {
  color: #059669;
  border-color: #a7f3d0;
  background: #f0fdf4;
}

.action-btn.check-done:hover {
  background: #dcfce7;
  border-color: #059669;
  color: #047857;
  transform: scale(1.06);
}

.action-btn.check-done.active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
}

.action-btn.check-done.active:hover {
  background: #047857;
  border-color: #047857;
  color: #ffffff;
}

/* ==========================================================================
   STATUS BADGES
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
}

.badge-success {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-success .badge-dot {
  background: #10b981;
}

.badge-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-warning .badge-dot {
  background: #f59e0b;
}

.badge-danger {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.badge-danger .badge-dot {
  background: #ef4444;
}

.badge-info {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid rgba(2, 132, 199, 0.25);
}

.badge-info .badge-dot {
  background: #0284c7;
}

.badge-purple {
  background: #f5f3ff;
  color: #6d28d9;
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-purple .badge-dot {
  background: #8b5cf6;
}

.badge-gray {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-gray .badge-dot {
  background: #94a3b8;
}

.badge-dark {
  background: #0f172a;
  color: #ffffff;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-secondary {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: var(--bg-surface-alt);
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-info {
  background: var(--info);
  color: #ffffff;
}

.btn-info:hover {
  background: #0369a1;
}

.btn-success {
  background: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: var(--warning);
  color: #ffffff;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: var(--radius-sm);
}

.btn-sm svg {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   FILTER TOOLBAR
   ========================================================================== */
.filter-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.search-field {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-field input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-field svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  width: 16px;
  height: 16px;
}

.filter-select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-dark);
  background: #ffffff;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==========================================================================
   FORMS & MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 22, 0.65);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
  padding: 20px;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(12px) scale(0.97);
  transition: all var(--transition-normal);
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-backdrop.show .modal {
  transform: translateY(0) scale(1);
}

.modal.modal-lg {
  max-width: 760px;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-dark);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger-text);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: #ffffff;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition-fast);
  background: #ffffff;
  color: var(--text-dark);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.product-image-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.product-image-preview-item {
  position: relative;
  width: 88px;
  height: 72px;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}

.product-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 16px;
  line-height: 18px;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ==========================================================================
   ACTIVITY FEED & DASHBOARD WIDGETS
   ========================================================================== */
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-info h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 3px;
}

.cart-item-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.activity-icon.order {
  background: #eff6ff;
  color: var(--primary);
}

.activity-icon.alert {
  background: #fffbeb;
  color: var(--warning);
}

.activity-text p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.activity-text small {
  font-size: 11.5px;
  color: var(--text-light);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.empty-state p {
  font-size: 13px;
}

/* ==========================================================================
   TOAST NOTIFICATIONS
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #090d16;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-xl);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  animation: toastSlideUp 200ms ease-out;
}

.toast.success {
  border-color: rgba(16, 185, 129, 0.4);
}

.toast.error {
  border-color: rgba(239, 68, 68, 0.4);
}

@keyframes toastSlideUp {
  from {
    transform: translateY(16px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ==========================================================================
   LOGIN PAGE (Dark Aurora Luxury)
   ========================================================================== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 10%, rgba(37, 99, 235, 0.15), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1), transparent 40%),
    #090d16;
  padding: 24px;
}

.login-card {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  color: #ffffff;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo .logo-mark {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.sidebar-header img.logo-mark,
.login-logo img.logo-mark {
  object-fit: contain;
  background: #ffffff;
  box-shadow: none;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
}

.login-logo p {
  color: #94a3b8;
  font-size: 13.5px;
}

.login-card .form-group label {
  color: #e2e8f0;
}

.login-card .form-control {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.login-card .form-control:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

.login-card .btn-primary {
  width: 100%;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  margin-top: 8px;
}

.login-hint {
  margin-top: 20px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.login-hint code {
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}

/* ==========================================================================
   UTILITY & HELPER CLASSES
   ========================================================================== */
.flex {
  display: flex;
}

.justify-between {
  justify-content: space-between;
}

.align-center {
  align-items: center;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.font-bold {
  font-weight: 700;
}

.text-xs {
  font-size: 11.5px;
}

.text-sm {
  font-size: 13px;
}

.text-gray {
  color: var(--text-muted);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning-text);
}

.text-success {
  color: var(--success-text);
}

.text-primary {
  color: var(--primary);
}

.filters-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  background: #ffffff;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.text-lg {
  font-size: 16px;
  font-weight: 700;
}

.font-medium {
  font-weight: 500;
}

.outOfStock {
  color: var(--danger);
  font-weight: 700;
}

.cart-item-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #ffffff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.login-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: center;
}

.toast-icon {
  font-weight: 800;
  font-size: 15px;
  margin-right: 4px;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .row {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   PRODUCT SPECS & SUITABLE FOR BUILDER
   ========================================================================== */
.specs-builder-card {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 14px;
  margin-bottom: 14px;
}

.spec-chip {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
}

.spec-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--info-bg);
  transform: translateY(-1px);
}

.spec-row-item {
  display: grid;
  grid-template-columns: 1fr 1.3fr 32px;
  gap: 8px;
  align-items: center;
}

.spec-row-remove {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid #fee2e2;
  background: #fef2f2;
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition-fast);
  padding: 0;
  line-height: 1;
}

.spec-row-remove:hover {
  background: #ef4444;
  color: #ffffff;
  border-color: #ef4444;
}
