/* ═══════════════════════════════════════════════════════════════════════════
   CEHPOINT VPN — Professional Design System
   Designed at senior UX level. Not AI template boilerplate.
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,400;14..32,500;14..32,600;14..32,700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── DESIGN TOKENS ──────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:             #08090E;
  --sidebar-bg:     #0C0D15;
  --card-bg:        #0F1119;
  --card-hover:     #131721;
  --surface-2:      #171D2C;

  /* Borders */
  --border:         #1A2035;
  --border-light:   #232D48;

  /* Brand */
  --primary:        #4F6EF7;
  --primary-h:      #6281FA;
  --primary-dim:    rgba(79,110,247,0.10);
  --primary-glow:   rgba(79,110,247,0.18);

  /* Semantic */
  --success:        #10B981;
  --success-bg:     rgba(16,185,129,0.08);
  --danger:         #EF4444;
  --danger-bg:      rgba(239,68,68,0.08);
  --warning:        #F59E0B;
  --warning-bg:     rgba(245,158,11,0.08);
  --info:           #38BDF8;
  --info-bg:        rgba(56,189,248,0.08);
  --online:         #22C55E;

  /* Text */
  --text:           #DDE3EF;
  --text-muted:     #7B8FB4;
  --text-dim:       #36446A;

  /* Layout */
  --sidebar-w:      244px;
  --radius:         8px;
  --radius-lg:      10px;
  --radius-sm:      5px;
  --t:              0.14s ease;
  --shadow:         0 4px 24px rgba(0,0,0,0.55);
}

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

html { font-size: 14px; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
input, button, select, textarea { font-family: inherit; }
img, svg { display: block; }

::selection { background: rgba(79,110,247,0.25); }

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

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

/* ── SIDEBAR ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-icon {
  width: 30px;
  height: 30px;
  background: var(--primary);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon svg { color: #fff; width: 15px; height: 15px; }

.brand-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-sub { display: none; }
.brand-text h2 { font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: -0.02em; }
.brand-text span { display: none; }

/* Nav */
.sidebar-nav { flex: 1; padding: 8px 8px; overflow-y: auto; }

.nav-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-dim);
  padding: 14px 8px 5px;
  display: block;
  user-select: none;
}

/* Both .nav-link (new) and .nav-item (old alias) */
.nav-link, .nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  margin-bottom: 1px;
  font-size: 13px;
  font-weight: 500;
  transition: color var(--t), background var(--t);
  position: relative;
  line-height: 1.3;
}

.nav-link svg, .nav-item svg {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  stroke-width: 1.75;
  color: var(--text-dim);
  transition: color var(--t);
}

.nav-link:hover, .nav-item:hover {
  color: var(--text);
  background: rgba(255,255,255,0.035);
}

.nav-link:hover svg, .nav-item:hover svg { color: var(--text-muted); }

.nav-link.active, .nav-item.active {
  color: #fff;
  background: var(--primary-dim);
}

.nav-link.active::before, .nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 65%;
  background: var(--primary);
  border-radius: 0 3px 3px 0;
}

.nav-link.active svg, .nav-item.active svg { color: var(--primary-h); }

.nav-link span, .nav-item span { flex: 1; }

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 8px 8px 10px;
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: default;
  transition: background var(--t);
}

.sidebar-user:hover { background: rgba(255,255,255,0.03); }

.sidebar-user .avatar-sm {
  width: 26px;
  height: 26px;
  background: var(--primary-dim);
  border: 1px solid rgba(79,110,247,0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--primary-h);
  flex-shrink: 0;
  text-transform: uppercase;
}

/* ── MAIN CONTENT ────────────────────────────────────────────────────────── */
.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ── TOPBAR ──────────────────────────────────────────────────────────────── */
.topbar {
  height: 50px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 22px;
  gap: 12px;
  flex-shrink: 0;
  background: rgba(8,9,14,0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  font-size: 12px;
  color: var(--text-dim);
}

.conn-status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 20px;
}

/* ── CONTENT AREA ────────────────────────────────────────────────────────── */
.content-area {
  padding: 22px 26px;
  flex: 1;
}

/* ── PAGE HEADER ─────────────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.page-header-left p {
  color: var(--text-muted);
  font-size: 12.5px;
  margin-top: 3px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* ── CARDS ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  gap: 10px;
  min-height: 46px;
}

.card-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-header-left h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.card-header svg {
  color: var(--text-dim);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.card-header-actions { display: flex; align-items: center; gap: 6px; }

.card-body { padding: 16px; }
.card-body.p0 { padding: 0; }

/* ── STATS GRID ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px 14px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--t);
}

.stat-card:hover { border-color: var(--border-light); }

/* Top accent line (2px) */
.stat-card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.stat-card-accent.primary { background: var(--primary); }
.stat-card-accent.success { background: var(--success); }
.stat-card-accent.warning { background: var(--warning); }
.stat-card-accent.danger  { background: var(--danger); }
.stat-card-accent.info    { background: var(--info); }

.stat-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.stat-icon svg { width: 15px; height: 15px; }

.stat-icon.primary { background: var(--primary-dim); color: var(--primary-h); }
.stat-icon.success { background: var(--success-bg);  color: var(--success); }
.stat-icon.warning { background: var(--warning-bg);  color: var(--warning); }
.stat-icon.danger  { background: var(--danger-bg);   color: var(--danger); }
.stat-icon.info    { background: var(--info-bg);     color: var(--info); }
.stat-icon.online  { background: rgba(34,197,94,0.1); color: var(--online); }

.stat-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.stat-value.sm { font-size: 18px; letter-spacing: -0.025em; }
.stat-value.xs { font-size: 14px; letter-spacing: -0.01em; font-weight: 600; }

.stat-detail { font-size: 11.5px; color: var(--text-muted); }

.stat-bar {
  height: 3px;
  background: var(--border);
  border-radius: 4px;
  margin-top: 10px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.stat-bar-fill.primary { background: var(--primary); }
.stat-bar-fill.success { background: var(--success); }
.stat-bar-fill.warning { background: var(--warning); }
.stat-bar-fill.danger  { background: var(--danger); }

/* ── TABLES ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  background: var(--card-bg);
}

.table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.035);
  color: var(--text-muted);
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background var(--t); }
.table tbody tr:hover td { background: rgba(255,255,255,0.018); }
.table td strong { color: var(--text); font-weight: 600; }

/* ── BUTTONS ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  height: 30px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: all var(--t);
  white-space: nowrap;
  line-height: 1;
  letter-spacing: -0.01em;
}

.btn svg { width: 13px; height: 13px; flex-shrink: 0; stroke-width: 2; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-h); border-color: var(--primary-h); }

.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover { background: #0EA572; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover { background: #DC2626; }

.btn-warning {
  background: var(--warning);
  color: #0A0A0A;
  border-color: var(--warning);
  font-weight: 600;
}
.btn-warning:hover { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover {
  background: var(--card-hover);
  color: var(--text);
  border-color: var(--border-light);
}

.btn-icon {
  padding: 0;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
}
.btn-icon:hover { color: var(--text); background: var(--card-hover); border-color: var(--border-light); }
.btn-icon svg { width: 14px; height: 14px; }

.btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-lg { height: 36px; padding: 0 18px; font-size: 13.5px; }
.btn-block { width: 100%; }

.btn:disabled { opacity: 0.4; pointer-events: none; }

/* ── BADGES ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.4;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-primary { background: var(--primary-dim); color: var(--primary-h); }
.badge-neutral { background: rgba(255,255,255,0.055); color: var(--text-muted); }

/* ── STATUS DOT ──────────────────────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot.online  { background: var(--online); }
.status-dot.offline { background: var(--text-dim); }
.status-dot.warning { background: var(--warning); }
.status-dot.pulse {
  animation: dot-pulse 2.2s cubic-bezier(0.4,0,0.6,1) infinite;
}

@keyframes dot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.5); }
  50%       { box-shadow: 0 0 0 5px rgba(34,197,94,0); }
}

/* ── FORMS ───────────────────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-group { display: flex; flex-direction: column; gap: 4px; }

.form-group label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.form-group small, small, .form-hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.4;
}

.input, .select, .textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  height: 34px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color var(--t), box-shadow var(--t);
  outline: none;
}

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

.input::placeholder { color: var(--text-dim); }
.select { cursor: pointer; }
.textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 80px; line-height: 1.5; }

.input-with-icon { position: relative; }
.input-with-icon .input { padding-left: 32px; }
.input-with-icon .input-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  display: flex;
  align-items: center;
}
.input-with-icon .input-icon svg { width: 14px; height: 14px; }

.form-actions { display: flex; gap: 7px; padding-top: 4px; }

/* ── ALERTS ──────────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid transparent;
  margin-bottom: 12px;
}
.alert svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px; }
.alert-success { background: var(--success-bg); border-color: rgba(16,185,129,0.18); color: #6EE7B7; }
.alert-danger  { background: var(--danger-bg);  border-color: rgba(239,68,68,0.18);  color: #FCA5A5; }
.alert-warning { background: var(--warning-bg); border-color: rgba(245,158,11,0.18); color: #FCD34D; }
.alert-info    { background: var(--info-bg);    border-color: rgba(56,189,248,0.18); color: #7DD3FC; }

/* ── TOASTS ──────────────────────────────────────────────────────────────── */
.flash-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 340px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius);
  font-size: 12.5px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  pointer-events: all;
  animation: toast-in 0.18s ease;
}

@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.toast svg { width: 13.5px; height: 13.5px; flex-shrink: 0; margin-top: 1px; }
.toast-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 0 0 6px;
  flex-shrink: 0;
  transition: color var(--t);
}
.toast-close:hover { color: var(--text); }

.toast-success { border-color: rgba(16,185,129,0.22); }
.toast-success svg { color: var(--success); }
.toast-error   { border-color: rgba(239,68,68,0.22); }
.toast-error   svg { color: var(--danger); }
.toast-warning { border-color: rgba(245,158,11,0.22); }
.toast-warning svg { color: var(--warning); }
.toast-info    { border-color: rgba(56,189,248,0.22); }
.toast-info    svg { color: var(--info); }

/* ── TABS ────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
  margin-bottom: -1px;
  white-space: nowrap;
}

.tab-btn svg { width: 13px; height: 13px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--primary-h); border-bottom-color: var(--primary); }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── SEARCH ──────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}
.search-input-wrap .input { padding-left: 32px; }
.search-input-wrap svg {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
  width: 14px;
  height: 14px;
}

/* ── AVATAR ──────────────────────────────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
  border-radius: 7px;
  color: #fff;
  font-size: 13px;
  width: 34px;
  height: 34px;
}
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; border-radius: 5px; }
.avatar-md { width: 34px; height: 34px; font-size: 13px;   border-radius: 7px; }
.avatar-lg { width: 46px; height: 46px; font-size: 16px;   border-radius: 9px; }

/* ── CODE / LOG VIEWER ───────────────────────────────────────────────────── */
.log-viewer {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 11.5px;
  line-height: 1.7;
  padding: 14px 16px;
  background: #05060A;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow-x: auto;
  max-height: 52vh;
  overflow-y: auto;
  white-space: pre;
  color: #6E7FA6;
}

.log-line-error { color: #FCA5A5; }
.log-line-warn  { color: #FCD34D; }
.log-line-ok    { color: #6EE7B7; }
.log-line-info  { color: #7DD3FC; }

.code-block {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 12px;
  background: #05060A;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  line-height: 1.65;
  color: #6EE7B7;
  position: relative;
}

.code-copy-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 7px;
  background: rgba(255,255,255,0.07);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-size: 10.5px;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--t);
}
.code-copy-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* ── USER PROFILE ────────────────────────────────────────────────────────── */
.user-profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
}

.user-profile-info h2 { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; }
.user-profile-info p  { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }

.user-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0;
}

.user-meta-item {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  border-right: 1px solid rgba(255,255,255,0.04);
}

.user-meta-item:nth-child(2n) { border-right: none; }

.user-meta-item label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.user-meta-item span { font-size: 13px; color: var(--text-muted); }
.user-meta-item span.empty { color: var(--text-dim); font-style: italic; }

/* ── AUDIT TRAIL ─────────────────────────────────────────────────────────── */
.audit-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 12.5px;
  transition: background var(--t);
}
.audit-item:hover { background: rgba(255,255,255,0.012); }
.audit-item:last-child { border-bottom: none; }

.audit-ts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 130px;
  margin-top: 2px;
}

.audit-action {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
}

/* ── STAT BAR ────────────────────────────────────────────────────────────── */
.stat-bar { height: 3px; background: var(--border); border-radius: 4px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

/* ── MODAL ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.72);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(3px);
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow);
  animation: modal-in 0.18s ease;
  overflow: hidden;
}

@keyframes modal-in {
  from { transform: scale(0.97) translateY(-4px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.modal-body  { padding: 16px; }
.modal-footer {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
  padding: 11px 16px;
  border-top: 1px solid var(--border);
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-dim);
}
.empty-state-icon {
  width: 42px;
  height: 42px;
  background: var(--card-hover);
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.empty-state-icon svg { width: 18px; height: 18px; color: var(--text-dim); }
.empty-state h3 { font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 5px; }
.empty-state p  { font-size: 12px; max-width: 280px; margin: 0 auto; line-height: 1.5; }

/* ── LOGIN PAGE ──────────────────────────────────────────────────────────── */
.login-root {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.login-left {
  flex: 1;
  display: none;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  border-right: 1px solid var(--border);
  background: var(--sidebar-bg);
}

.login-card-wrap {
  flex: 0 0 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card { width: 100%; max-width: 360px; }

.login-logo {
  width: 46px;
  height: 46px;
  background: var(--primary);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.login-logo svg { color: #fff; width: 22px; height: 22px; }

.login-card h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}

.login-card p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 24px;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 11px;
}

/* ── SIDEBAR TOGGLE (mobile) ─────────────────────────────────────────────── */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--t);
}
.sidebar-toggle:hover { border-color: var(--border-light); color: var(--text); }
.sidebar-toggle svg { width: 14px; height: 14px; }

/* ── UTILITY ─────────────────────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-dim     { color: var(--text-dim); }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-info    { color: var(--info) !important; }
.text-primary { color: var(--primary-h) !important; }
.font-mono    { font-family: 'JetBrains Mono', 'Consolas', monospace; }
.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.fw-600       { font-weight: 600; }
.flex         { display: flex; align-items: center; }
.gap-2        { gap: 8px; }
.gap-3        { gap: 12px; }
.mt-1         { margin-top: 6px; }
.mt-2         { margin-top: 12px; }
.ml-auto      { margin-left: auto; }
.inline-form  { display: inline; }
.divider      { height: 1px; background: var(--border); margin: 14px 0; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (min-width: 900px) {
  .login-left { display: flex; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -244px;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: left 0.22s ease;
  }
  .sidebar.open { left: 0; }
  .sidebar-toggle { display: flex; }
  .content-area { padding: 14px 15px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
}

/* ── COMPATIBILITY ALIASES ──────────────────────────────────────── */
.stat-card-accent.online { background: var(--online); }
.stat-icon.online { background: rgba(34,197,94,0.08); color: var(--online); }

/* login-left — keep flex on wider screens */
@media (min-width: 900px) { .login-left { display: flex; } }
