/* ═══════════════════════════════════════════════════════════════════════════
   WZATCO Spare Parts — Global Stylesheet
   Color Palette: "Circuit Blue"
   ─────────────────────────────────────────────────────────────────────────── */

/* ── CSS Custom Properties (Circuit Blue Palette) ─────────────────────────── */
:root {
  /* Primary Base — Deep Space */
  --primary:          #0F172A;
  --primary-light:    #1E293B;
  --primary-mid:      #334155;

  /* Primary Accent — Electric Cyan */
  --accent:           #06B6D4;
  --accent-dark:      #0E7490;
  --accent-light:     rgba(6, 182, 212, 0.15);
  --accent-glow:      rgba(6, 182, 212, 0.25);

  /* Secondary — Circuit Grey */
  --secondary:        #64748B;
  --secondary-light:  #94A3B8;
  --secondary-dark:   #475569;

  /* Status */
  --success:          #10B981;
  --success-bg:       #D1FAE5;
  --success-text:     #065F46;
  --warning:          #F59E0B;
  --warning-bg:       #FEF3C7;
  --warning-text:     #92400E;
  --danger:           #EF4444;
  --danger-bg:        #FEE2E2;
  --danger-text:      #991B1B;
  --info:             #3B82F6;
  --info-bg:          #EFF6FF;
  --info-text:        #1E40AF;

  /* Surfaces */
  --bg:               #F1F5F9;
  --surface:          #FFFFFF;
  --surface-hover:    #F8FAFC;
  --border:           #E2E8F0;
  --border-dark:      #CBD5E1;

  /* Typography */
  --text:             #0F172A;
  --text-soft:        #475569;
  --text-muted:       #94A3B8;
  --text-white:       #FFFFFF;

  /* Sidebar specifics */
  --sidebar-bg:       #0F172A;
  --sidebar-hover:    #1E293B;
  --sidebar-border:   rgba(255,255,255,0.06);
  --sidebar-text:     #94A3B8;
  --sidebar-active-bg: rgba(6, 182, 212, 0.12);
  --sidebar-active-border: #06B6D4;
  --sidebar-active-text:   #06B6D4;

  /* Layout */
  --sidebar-width:    220px;
  --topbar-height:    56px;

  /* Radii */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);

  /* Transition */
  --t: all 0.15s ease;
}

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

html, body { height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── Scrollbar ───────────────────────────────────────────────────────────── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-dark); border-radius: var(--r-full); }
::-webkit-scrollbar-thumb:hover { background: var(--secondary); }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-shell   { display: flex; height: 100vh; overflow: hidden; }
.main-wrap   { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.page-body   { flex: 1; overflow-y: auto; padding: 24px; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: transform 0.3s ease;
  z-index: 40;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-brand-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.sidebar-brand-icon svg { width: 18px; height: 18px; color: #fff; }
.sidebar-brand-text .app-name {
  font-size: 14px; font-weight: 700; color: #fff; letter-spacing: -0.01em; line-height: 1.2;
}
.sidebar-brand-text .app-sub {
  font-size: 10px; color: var(--secondary); font-weight: 400; letter-spacing: 0.02em;
}

/* Nav scroll area */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 8px;
}

.nav-group { margin-bottom: 2px; }

.nav-group-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #3D5166;
  padding: 12px 10px 5px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sidebar-text);
  transition: var(--t);
  margin-bottom: 1px;
  border-left: 2px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}
.nav-link:hover {
  background: var(--sidebar-hover);
  color: #CBD5E1;
}
.nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  border-left-color: var(--sidebar-active-border);
  font-weight: 600;
}
.nav-link .nav-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: 0.7;
}
.nav-link.active .nav-icon { opacity: 1; }
.nav-link .nav-label { flex: 1; }
.nav-link .view-tag {
  font-size: 9px;
  background: #1E293B;
  color: #475569;
  padding: 2px 6px;
  border-radius: var(--r-full);
  border: 1px solid #334155;
  flex-shrink: 0;
}

.nav-divider {
  height: 1px;
  background: var(--sidebar-border);
  margin: 8px 4px;
}

/* User profile at bottom */
.sidebar-footer {
  padding: 10px 8px 12px;
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  cursor: default;
}
.sidebar-avatar {
  width: 30px; height: 30px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12px; font-weight: 600; color: #E2E8F0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 10px; color: #475569; text-transform: capitalize;
  margin-top: 1px;
}
.sidebar-logout-btn {
  width: 26px; height: 26px;
  background: none; border: none;
  color: #3D5166;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  transition: var(--t);
  flex-shrink: 0;
}
.sidebar-logout-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.sidebar-logout-btn svg { width: 14px; height: 14px; }

/* ═══════════════════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.page-title { font-size: 16px; font-weight: 600; color: var(--text); }

/* Mobile toggle */
.sidebar-toggle {
  display: none;
  width: 32px; height: 32px;
  background: none; border: none;
  color: var(--secondary);
  border-radius: var(--r-md);
  align-items: center; justify-content: center;
  transition: var(--t);
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }
.sidebar-toggle svg { width: 18px; height: 18px; }

/* Icon button */
.icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md);
  background: none; border: none;
  color: var(--secondary);
  transition: var(--t);
  text-decoration: none;
  position: relative;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }

/* User menu button */
.user-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 10px 4px 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  cursor: pointer;
  transition: var(--t);
}
.user-btn:hover { background: var(--bg); }
.user-btn-avatar {
  width: 26px; height: 26px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.user-btn-name { font-size: 12.5px; font-weight: 500; color: var(--text); }
.user-btn svg  { width: 12px; height: 12px; color: var(--text-muted); }

/* Dropdown */
.dropdown-wrap { position: relative; }
.dropdown {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 8px);
  width: 196px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  overflow: hidden;
}
.dropdown.open { display: block; }
.dropdown-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.dropdown-header .d-name  { font-size: 12.5px; font-weight: 600; color: var(--text); }
.dropdown-header .d-email { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 14px;
  font-size: 13px; color: var(--text);
  transition: var(--t);
}
.dropdown-item:hover { background: var(--surface-hover); }
.dropdown-item svg { width: 14px; height: 14px; color: var(--secondary); flex-shrink: 0; }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: var(--danger-bg); }
.dropdown-item.danger svg { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 3px 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer; transition: var(--t);
  white-space: nowrap; line-height: 1;
  text-decoration: none;
}
.btn-primary   { background: var(--accent);   color: #fff; border-color: var(--accent);   }
.btn-primary:hover   { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-secondary { background: var(--surface);  color: var(--text);  border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); }
.btn-danger    { background: var(--danger);   color: #fff; border-color: var(--danger);   }
.btn-danger:hover    { background: #DC2626; border-color: #DC2626; }
.btn-success   { background: var(--success);  color: #fff; border-color: var(--success);  }
.btn-outline   { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-light); }
.btn-sm   { padding: 5px 11px; font-size: 12px; border-radius: var(--r-sm); }
.btn-lg   { padding: 11px 22px; font-size: 14px; }
.btn-icon { padding: 7px; }
.btn svg  { width: 14px; height: 14px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group  { margin-bottom: 16px; }
.form-label  {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--text);
  margin-bottom: 5px;
}
.form-label.required::after { content: ' *'; color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 13px; color: var(--text);
  background: var(--surface);
  transition: var(--t);
  outline: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.12);
}
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 80px; }
/* Original <select> hidden only after JS wraps it inside .custom-select */
.custom-select > select { display: none; }

/* ══════════════════════════════════════════════════════════════════════════
   CUSTOM SELECT COMPONENT
   Replaces native <select> with a fully-styled dropdown.
   Structure injected by JS:
     .custom-select
       button.cs-trigger[type=button]
         span.cs-value
         svg.cs-arrow
       .cs-dropdown
         .cs-option[.placeholder-opt][.selected][.focused]
       select (original, hidden)
   ══════════════════════════════════════════════════════════════════════════ */

.custom-select {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* ── Trigger button ───────────────────────────────────────────────────── */
.cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px 9px 12px;
  background: #FAFCFF;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--r-md);
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: var(--t);
  text-align: left;
  outline: none;
  line-height: 1.4;
  min-height: 38px;
}
.cs-trigger:hover:not(.open) {
  border-color: #94A3B8;
  background-color: #EEF6FF;
}
.cs-trigger.open,
.cs-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.15);
  background: var(--surface);
}
.cs-trigger.is-placeholder .cs-value {
  color: var(--text-muted);
  font-style: italic;
}
.cs-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-arrow {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--accent-dark);
  transition: transform 0.18s ease;
}
.cs-trigger.open .cs-arrow { transform: rotate(180deg); }

/* ── Dropdown panel ───────────────────────────────────────────────────── */
.cs-dropdown {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: 0 10px 32px rgba(15,23,42,0.14), 0 2px 8px rgba(15,23,42,0.06);
  z-index: 600;
  max-height: 240px;
  overflow-y: auto;
  padding: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-dark) transparent;
}
.cs-dropdown.open { display: block; }
/* Flip above when near bottom of screen */
.cs-dropdown.above {
  top: auto;
  bottom: calc(100% + 5px);
}

/* ── Option items ─────────────────────────────────────────────────────── */
.cs-option {
  padding: 8px 11px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  user-select: none;
}
.cs-option:hover,
.cs-option.focused {
  background: var(--accent-light);
  color: var(--accent-dark);
}
.cs-option.selected {
  background: rgba(6,182,212,0.1);
  color: var(--accent-dark);
  font-weight: 600;
}
.cs-option.placeholder-opt {
  color: var(--text-muted);
  font-style: italic;
}
.cs-option.placeholder-opt:hover { background: #F1F5F9; color: var(--text-soft); }

/* ── Separator / group label inside dropdown ──────────────────────────── */
.cs-separator {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.cs-group-label {
  padding: 5px 11px 2px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

/* Fallback: browsers/pages that don't run JS still see a basic styled select */
.no-js .form-select {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  background-color: #FAFCFF;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230E7490' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 15px;
  padding-right: 36px;
  border-color: var(--border-dark);
}

.form-hint  { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 11px; color: var(--danger);     margin-top: 4px; }
.form-input.is-invalid  { border-color: var(--danger); }
.form-input.is-valid    { border-color: var(--success); }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xs);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card-header .card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.card-body    { padding: 20px; }
.card-footer  { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-hover); }

/* KPI card */
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  transition: var(--t);
}
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kpi-icon {
  width: 40px; height: 40px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.kpi-icon svg  { width: 20px; height: 20px; }
.kpi-value     { font-size: 28px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 5px; }
.kpi-label     { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi-trend     { font-size: 11px; margin-top: 8px; display: flex; align-items: center; gap: 3px; }
.trend-up      { color: var(--success); }
.trend-down    { color: var(--danger); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLE
   ═══════════════════════════════════════════════════════════════════════════ */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  background: var(--surface);
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  background: #F8FAFC;
  padding: 10px 14px;
  text-align: left;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--secondary);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text);
  vertical-align: middle;
}
.data-table tbody tr:last-child td    { border-bottom: none; }
.data-table tbody tr:hover  td        { background: var(--surface-hover); }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES / STATUS
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger-text);  }
.badge-info    { background: var(--info-bg);    color: var(--info-text);    }
.badge-accent  { background: rgba(6,182,212,.12); color: var(--accent-dark); }
.badge-grey    { background: #F1F5F9; color: #475569; }

/* ═══════════════════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  font-size: 13px;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-error,
.alert-danger  { background: var(--danger-bg);  border: 1px solid #FECACA;  color: var(--danger-text);  }
.alert-success { background: var(--success-bg); border: 1px solid #BBF7D0;  color: var(--success-text); }
.alert-warning { background: var(--warning-bg); border: 1px solid #FDE68A;  color: var(--warning-text); }
.alert-info    { background: var(--info-bg);    border: 1px solid #BFDBFE;  color: var(--info-text);    }
.alert-accent  { background: rgba(6,182,212,.08); border: 1px solid rgba(6,182,212,.2); color: var(--accent-dark); }

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 22px; flex-wrap: wrap;
}
.page-header-left h1    { font-size: 20px; font-weight: 700; color: var(--text); }
.page-header-left p     { font-size: 13px; color: var(--text-muted); margin-top: 3px; }
.page-header-actions    { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   GRID HELPERS
   ═══════════════════════════════════════════════════════════════════════════ */

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   AUTH PAGES (login, forgot-password, reset-password)
   ═══════════════════════════════════════════════════════════════════════════ */

.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #060D1F 0%, #0F172A 50%, #071525 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle at 25% 30%, rgba(6,182,212,0.06) 0%, transparent 50%),
                    radial-gradient(circle at 75% 70%, rgba(14,116,144,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: var(--surface);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative; z-index: 1;
}
.auth-card-accent { height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }
.auth-card-body   { padding: 32px; }
.auth-brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-brand-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 8px 24px rgba(6,182,212,0.35);
}
.auth-brand-icon svg { width: 28px; height: 28px; color: #fff; }
.auth-brand-name { font-size: 20px; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.auth-brand-sub  { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.auth-title      { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-subtitle   { font-size: 13px; color: var(--text-muted); margin-bottom: 22px; }
.auth-footer     { text-align: center; margin-top: 20px; }
.auth-footer a   { font-size: 13px; color: var(--accent); font-weight: 500; }
.auth-footer a:hover { color: var(--accent-dark); }

/* Password eye toggle */
.input-group { position: relative; }
.input-group .form-input { padding-right: 42px; }
.input-eye-btn {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  transition: var(--t);
}
.input-eye-btn:hover { color: var(--text); }
.input-eye-btn svg   { width: 16px; height: 16px; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.6);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 500px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-shrink: 0;
}
.modal-title  { font-size: 15px; font-weight: 600; color: var(--text); }
.modal-close  {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-md); border: none;
  background: var(--bg); color: var(--secondary);
  cursor: pointer; transition: var(--t);
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-close svg   { width: 14px; height: 14px; }
.modal-body   { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════════════════════════════════ */

.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.gap-1 { gap: 4px; }  .gap-2 { gap: 8px; }  .gap-3 { gap: 12px; }  .gap-4 { gap: 16px; }
.flex-1   { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0  { min-width: 0; }
.w-full   { width: 100%; }
.mt-1 { margin-top: 4px; }  .mt-2 { margin-top: 8px; }  .mt-3 { margin-top: 12px; }  .mt-4 { margin-top: 16px; }  .mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; } .mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.text-sm { font-size: 12px; }  .text-xs { font-size: 11px; }
.font-medium  { font-weight: 500; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }
.text-muted   { color: var(--text-muted); }
.text-soft    { color: var(--text-soft); }
.text-accent  { color: var(--accent); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger  { color: var(--danger); }
.truncate     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-only      { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .sidebar { position: fixed; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-wrap { margin-left: 0 !important; }
  .sidebar-toggle { display: flex !important; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-body { padding: 16px; }
  .topbar { padding: 0 14px; }
}
