/* ============================================================
   CDK Admin — Pro Max Design System
   Style: Cold White Minimal — OLED Dark + Pure White Accents
   Colors: #FFFFFF primary, #09090B near-black
   Font: Inter + JetBrains Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Variables — Cold White Minimal ── */
:root {
  /* Pure White Primary */
  --primary:        #FFFFFF;
  --primary-light:  #FFFFFF;
  --primary-dark:   #E4E4E7;
  --primary-glow:   rgba(255,255,255,0.12);
  --primary-bg:     rgba(255,255,255,0.06);

  /* Subtle Accent — cool gray-white */
  --accent:         #A1A1AA;
  --accent-light:   #D4D4D8;
  --accent-glow:    rgba(161,161,170,0.2);

  /* Sidebar */
  --sidebar-bg:     #09090B;
  --sidebar-width:  240px;
  --sidebar-text:   #71717A;
  --sidebar-active: #FFFFFF;
  --sidebar-hover:  rgba(255,255,255,0.05);
  --sidebar-border: rgba(255,255,255,0.06);

  /* OLED Dark Backgrounds */
  --bg:             #09090B;
  --bg-2:           #111113;
  --bg-card:        rgba(24,24,27,0.9);
  --bg-card2:       rgba(32,32,36,0.7);
  --bg-glass:       rgba(255,255,255,0.03);
  --bg-glass-hover: rgba(255,255,255,0.06);

  /* Borders */
  --border:         rgba(255,255,255,0.1);
  --border-light:   rgba(255,255,255,0.06);
  --border-glass:   rgba(255,255,255,0.08);

  /* Text */
  --text:           #FAFAFA;
  --text-muted:     #52525B;
  --text-light:     #3F3F46;

  /* Status */
  --success:        #22C55E;
  --success-bg:     rgba(34,197,94,0.08);
  --success-border: rgba(34,197,94,0.2);
  --danger:         #EF4444;
  --danger-bg:      rgba(239,68,68,0.08);
  --danger-border:  rgba(239,68,68,0.2);
  --warning:        #EAB308;
  --warning-bg:     rgba(234,179,8,0.08);
  --warning-border: rgba(234,179,8,0.2);
  --info:           #3B82F6;
  --info-bg:        rgba(59,130,246,0.08);
  --info-border:    rgba(59,130,246,0.2);

  /* Shape */
  --radius:         12px;
  --radius-sm:      8px;
  --radius-lg:      16px;
  --radius-xl:      20px;

  /* Shadows */
  --shadow:         0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:      0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg:      0 10px 40px rgba(0,0,0,0.7);
  --shadow-glow:    0 0 20px var(--primary-glow);
  --shadow-glow-sm: 0 0 10px var(--primary-glow);

  --transition:     150ms ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Noise texture overlay for depth */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ── Layout: Sidebar + Main ── */
.admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 200ms cubic-bezier(0.4,0,0.2,1);
  border-right: 1px solid var(--sidebar-border);
}

/* Sidebar glow line */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.06), transparent);
  pointer-events: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 16px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  text-decoration: none;
}

.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-icon svg { width: 18px; height: 18px; color: #fff; }

.sidebar-brand-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  padding: 14px 10px 5px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background 150ms ease, color 150ms ease, box-shadow 150ms ease;
  cursor: pointer;
  margin-bottom: 2px;
  white-space: nowrap;
  position: relative;
}

.sidebar-link svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; transition: opacity 150ms; }

.sidebar-link:hover {
  background: var(--sidebar-hover);
  color: var(--primary-light);
}

.sidebar-link:hover svg { opacity: 1; }

.sidebar-link.active {
  background: rgba(255,255,255,0.06);
  color: var(--primary-light);
  box-shadow: inset 3px 0 0 rgba(255,255,255,0.6);
}

.sidebar-link.active svg { color: var(--primary-light); opacity: 1; }

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13px;
}

.sidebar-user-avatar {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: none;
}

.sidebar-user-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #CBD5E1;
  font-weight: 500;
}

/* ── Main Content ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  background: rgba(8,8,16,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  padding: 0 24px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-body {
  padding: 24px;
  flex: 1;
  background-image:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(255,255,255,0.03) 0%, transparent 60%);
}

/* ── Flash Messages ── */
.flash-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  backdrop-filter: blur(10px);
}

.flash-alert.success {
  background: var(--success-bg);
  color: var(--accent-light);
  border-color: var(--success-border);
}

.flash-alert.error {
  background: var(--danger-bg);
  color: #FDA4AF;
  border-color: var(--danger-border);
}

.flash-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.6;
  padding: 0;
  line-height: 1;
  font-size: 16px;
}

.flash-close:hover { opacity: 1; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
  background: rgba(255,255,255,0.02);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.card-body {
  padding: 20px;
}

.card-body.p-0 { padding: 0; }

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  background: rgba(255,255,255,0.02);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  text-align: center;
  font-size: 13px;
}

/* ── KPI Stat Cards ── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

.stat-card:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow-sm);
  transform: translateY(-2px);
  border-color: var(--border);
}

.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.stat-icon svg { width: 22px; height: 22px; }

.stat-icon.purple {
  background: rgba(255,255,255,0.07);
  color: #FAFAFA;
}
.stat-icon.green {
  background: rgba(16,185,129,0.15);
  color: var(--accent-light);
  box-shadow: 0 0 12px rgba(16,185,129,0.2);
}
.stat-icon.blue {
  background: rgba(56,189,248,0.15);
  color: var(--info);
  box-shadow: 0 0 12px rgba(56,189,248,0.2);
}
.stat-icon.orange {
  background: rgba(245,158,11,0.15);
  color: var(--warning);
  box-shadow: 0 0 12px rgba(245,158,11,0.2);
}

.stat-body { flex: 1; min-width: 0; }

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 11px 16px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
  font-size: 13.5px;
  color: var(--text);
}

.table tbody tr:last-child td { border-bottom: none; }

.table tbody tr {
  transition: background 150ms ease;
}

.table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
}

.badge-success {
  background: var(--success-bg);
  color: var(--accent-light);
  border-color: var(--success-border);
}
.badge-danger {
  background: var(--danger-bg);
  color: #FDA4AF;
  border-color: var(--danger-border);
}
.badge-warning {
  background: var(--warning-bg);
  color: #FCD34D;
  border-color: var(--warning-border);
}
.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border-color: var(--info-border);
}
.badge-purple {
  background: var(--primary-bg);
  color: var(--primary-light);
  border-color: rgba(255,255,255,0.1);
}
.badge-gray {
  background: rgba(255,255,255,0.06);
  color: var(--text-muted);
  border-color: var(--border-light);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background 150ms ease, box-shadow 150ms ease, transform 150ms ease, border-color 150ms ease;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active { transform: translateY(1px); }

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: #FFFFFF;
  color: #09090B;
  border-color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.btn-primary:hover {
  background: #E4E4E7;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  color: #09090B;
  text-decoration: none;
}

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border-color: var(--border-light);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--border);
  color: var(--text);
  text-decoration: none;
}

.btn-danger {
  background: rgba(244,63,94,0.1);
  color: #FDA4AF;
  border-color: var(--danger-border);
}
.btn-danger:hover {
  background: rgba(244,63,94,0.2);
  border-color: var(--danger);
  text-decoration: none;
}

.btn-warning {
  background: rgba(245,158,11,0.1);
  color: #FCD34D;
  border-color: var(--warning-border);
}
.btn-warning:hover {
  background: rgba(245,158,11,0.2);
  border-color: var(--warning);
  text-decoration: none;
}

.btn-success {
  background: rgba(16,185,129,0.1);
  color: var(--accent-light);
  border-color: var(--success-border);
}
.btn-success:hover {
  background: rgba(16,185,129,0.2);
  border-color: var(--accent);
  text-decoration: none;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-sm svg { width: 13px; height: 13px; }

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* ── Forms ── */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #CBD5E1;
  margin-bottom: 6px;
}

.form-control,
.form-select {
  width: 100%;
  padding: 9px 13px;
  font-size: 13.5px;
  color: var(--text);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
  outline: none;
  font-family: inherit;
  line-height: 1.5;
}

.form-control::placeholder { color: var(--text-light); }

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
  background: rgba(255,255,255,0.07);
}

.form-control[readonly] {
  background: rgba(255,255,255,0.03);
  color: var(--text-muted);
  cursor: default;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-select option {
  background: #0F0F1E;
  color: var(--text);
}

textarea.form-control { resize: vertical; min-height: 80px; }

.form-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.form-check-input {
  width: 16px; height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.form-switch .form-check-input {
  width: 36px; height: 20px;
}

.form-check-label {
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
}

.input-group {
  display: flex;
  gap: 0;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ── Search Bar ── */
.search-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
}

.search-bar .row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
  list-style: none;
  padding: 0;
}

.page-item .page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  text-decoration: none;
  transition: all 150ms ease;
  cursor: pointer;
}

.page-item .page-link:hover {
  background: var(--primary-bg);
  color: var(--primary-light);
  border-color: var(--border);
}

.page-item.active .page-link {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: none;
}

/* ── Code ── */
code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--primary-light);
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.1);
}

/* ── Divider ── */
hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 20px 0;
}

/* ── Steps (create wizard) ── */
.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  overflow: hidden;
}

.step-card-header {
  padding: 13px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-number {
  width: 22px; height: 22px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: none;
}

.step-card-body { padding: 18px 20px; }

/* ── Config option cards ── */
.config-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 10px;
}

.config-item:last-child { margin-bottom: 0; }

/* ── Slider ── */
input[type="range"] {
  accent-color: var(--primary);
  cursor: pointer;
}

/* ── Sidebar toggle (mobile) ── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
}

/* ── Login Page ── */
.login-page {
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -20%, rgba(255,255,255,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 80% 80%, rgba(16,185,129,0.1) 0%, transparent 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
}

.login-logo {
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  box-shadow: none;
}

.login-logo svg { width: 28px; height: 28px; color: #fff; }

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Utility ── */
.text-muted  { color: var(--text-muted) !important; }
.text-small  { font-size: 12px; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.fw-600      { font-weight: 600; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.d-flex { display: flex; }
.align-items-center { align-items: center; }
.justify-content-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex-grow-1 { flex: 1; }
.w-100 { width: 100%; }
.d-inline { display: inline; }
.d-none { display: none !important; }

/* ── Grid ── */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.col { flex: 1; min-width: 0; }
.col-auto { flex: 0 0 auto; }
.col-2 { flex: 0 0 calc(16.666% - 8px); }
.col-3 { flex: 0 0 calc(25% - 12px); }
.col-4 { flex: 0 0 calc(33.333% - 11px); }
.col-6 { flex: 0 0 calc(50% - 8px); }
.col-8 { flex: 0 0 calc(66.666% - 6px); }
.col-12 { flex: 0 0 100%; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: flex;
  }
  .col-3, .col-4, .col-6, .col-8 {
    flex: 0 0 100%;
  }
  .page-body { padding: 16px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 22px; }
}

@media (max-width: 480px) {
  .login-card { padding: 28px 20px; }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ── Spinner ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alert ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  border: 1px solid transparent;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.alert-success { background: var(--success-bg); color: var(--accent-light); border-color: var(--success-border); }
.alert-danger  { background: var(--danger-bg);  color: #FDA4AF;             border-color: var(--danger-border); }
.alert-warning { background: var(--warning-bg); color: #FCD34D;             border-color: var(--warning-border); }
.alert-info    { background: var(--info-bg);    color: var(--info);         border-color: var(--info-border); }

/* ── 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); }

/* ── Selection ── */
::selection { background: rgba(255,255,255,0.1); color: #fff; }
