/* ============================================================
   PROMUEX AGENT SERVICE — STYLESHEET v2.1
   Brand Theme: #001A57 Dark Navy Blue
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg-base:       #010c1e;
  --bg-card:       #021430;
  --bg-card-hover: #041a3e;
  --bg-input:      #021232;
  --bg-sidebar:    #001A57;
  --bg-elevated:   #0a2060;

  /* Borders */
  --border:        #0d2a6e;
  --border-light:  #1a3f8f;
  --border-glow:   rgba(37,99,235,0.35);

  /* Text */
  --text-primary:  #e8effe;
  --text-secondary:#7fa3d8;
  --text-muted:    #2c5096;

  /* Brand accent — bright blue that pops on dark navy */
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-glow:   rgba(37,99,235,0.22);
  --accent-2:      #3b82f6;
  --accent-3:      #0ea5e9;
  --accent-4:      #6366f1;

  /* Status */
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #38bdf8;

  --success-bg:    rgba(16,185,129,0.1);
  --warning-bg:    rgba(245,158,11,0.1);
  --danger-bg:     rgba(239,68,68,0.1);
  --info-bg:       rgba(56,189,248,0.1);

  /* Layout */
  --sidebar-w:           256px;
  --sidebar-w-collapsed:  64px;
  --radius:    12px;
  --radius-sm:  8px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow:        0 8px 32px rgba(0,0,0,0.55);
  --shadow-lg:     0 20px 60px rgba(0,0,0,0.65);
  --shadow-accent: 0 0 24px var(--accent-glow);

  --font-display: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --transition:      0.18s cubic-bezier(0.4,0,0.2,1);
  --transition-slow: 0.32s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-2); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-3); }

/* ── Background grid ────────────────────────────────────────── */
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(37,99,235,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37,99,235,0.04) 1px, transparent 1px);
  background-size: 52px 52px;
}
.bg-grid::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 45% at 50% -5%,
    rgba(0,26,87,0.35) 0%, transparent 65%);
}

/* ── Layout ─────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ══════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; overflow-x: hidden;
  transition: width var(--transition-slow);
  z-index: 100;
  scrollbar-width: none;
  box-shadow: 4px 0 24px rgba(0,0,0,0.4);
}
.sidebar::-webkit-scrollbar { display: none; }
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .nav-section-label,
.sidebar.collapsed .sidebar-user-info,
.sidebar.collapsed .sidebar-sign-out-text { display: none; }
.sidebar.collapsed .nav-item  { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 10px; }

.main-content {
  margin-left: var(--sidebar-w);
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  transition: margin-left var(--transition-slow);
}
.main-content.expanded { margin-left: var(--sidebar-w-collapsed); }

/* ── Brand ──────────────────────────────────────────────────── */
.sidebar-brand {
  padding: 20px 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex; align-items: center; gap: 12px;
  position: relative;
  background: rgba(0,0,0,0.15);
}
.sidebar-brand-logo {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 15px; color: #fff;
  box-shadow: 0 0 16px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}
.sidebar-brand-text { overflow: hidden; flex: 1; }
.sidebar-brand-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 14px; color: #fff; line-height: 1.2; white-space: nowrap;
}
.sidebar-brand-sub {
  font-size: 9.5px; color: rgba(255,255,255,0.4);
  text-transform: uppercase; letter-spacing: 1.8px; white-space: nowrap;
}
.sidebar-collapse-btn {
  position: absolute; right: -12px; top: 50%;
  transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-card); border: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-muted); font-size: 11px;
  transition: all var(--transition); z-index: 10;
}
.sidebar-collapse-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.sidebar.collapsed .sidebar-collapse-btn { transform: translateY(-50%) rotate(180deg); }

/* ── Nav ────────────────────────────────────────────────────── */
.sidebar-nav { padding: 14px 10px; flex: 1; }
.nav-section { margin-bottom: 4px; }
.nav-section-label {
  font-size: 9.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.8px;
  color: rgba(255,255,255,0.28); padding: 10px 8px 4px;
  white-space: nowrap; overflow: hidden;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6); font-size: 13.5px; font-weight: 500;
  transition: all var(--transition); cursor: pointer;
  margin-bottom: 1px; position: relative;
  white-space: nowrap; text-decoration: none;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.95);
}
.nav-item.active {
  background: linear-gradient(135deg, rgba(37,99,235,0.35), rgba(59,130,246,0.2));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(59,130,246,0.3);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 7px; bottom: 7px;
  width: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 0 3px 3px 0;
}
.nav-icon { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; opacity: 0.85; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { flex: 1; }
.nav-badge {
  margin-left: auto; background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 20px; line-height: 1.4;
  animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* ── Sidebar Footer ─────────────────────────────────────────── */
.sidebar-footer { padding: 14px 10px; border-top: 1px solid rgba(255,255,255,0.07); }
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 6px;
}
.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0;
  position: relative;
}
.sidebar-user-avatar::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--success); border: 2px solid var(--bg-sidebar);
}
.sidebar-user-info { flex: 1; min-width: 0; overflow: hidden; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 11px; color: rgba(255,255,255,0.4); white-space: nowrap; }
.sidebar-sign-out {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.4); font-size: 13px;
  transition: all var(--transition); cursor: pointer; text-decoration: none;
}
.sidebar-sign-out:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* ══════════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════════ */
.topbar {
  background: rgba(2,20,48,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 62px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title {
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
  color: var(--text-primary); flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-date { font-size: 12px; color: var(--text-muted); }

.notif-btn {
  position: relative; width: 38px; height: 38px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-secondary);
  transition: all var(--transition);
}
.notif-btn:hover { border-color: var(--accent); color: var(--accent-2); box-shadow: 0 0 12px var(--accent-glow); }
.notif-count {
  position: absolute; top: -5px; right: -5px;
  background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px; border: 2px solid var(--bg-card);
}

/* Notification Dropdown */
.notif-wrapper { position: relative; }
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 340px; background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transform: translateY(-6px);
  transition: all var(--transition); z-index: 200;
}
.notif-wrapper.open .notif-dropdown { opacity: 1; pointer-events: all; transform: translateY(0); }
.notif-dropdown-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-family: var(--font-display); font-weight: 700; font-size: 14px;
  display: flex; justify-content: space-between; align-items: center;
}
.notif-dropdown-item {
  padding: 13px 18px; border-bottom: 1px solid var(--border);
  display: flex; gap: 12px; align-items: flex-start;
  transition: background var(--transition); cursor: pointer;
}
.notif-dropdown-item:last-child { border-bottom: none; }
.notif-dropdown-item:hover { background: var(--bg-card-hover); }
.notif-dropdown-item.unread { background: rgba(37,99,235,0.07); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); flex-shrink: 0; margin-top: 5px; }
.notif-dropdown-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.notif-dropdown-text strong { color: var(--text-primary); }
.notif-dropdown-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-dropdown-footer { padding: 12px 18px; text-align: center; }
.notif-dropdown-footer a { font-size: 13px; color: var(--accent-2); }
.notif-empty { padding: 32px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* ══════════════════════════════════════════════════════════════
   PAGE & CARDS
   ══════════════════════════════════════════════════════════════ */
.page-content { padding: 28px; flex: 1; }
.page-header { margin-bottom: 28px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header h1 { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--text-primary); line-height: 1.2; }
.page-header p  { color: var(--text-secondary); font-size: 13px; margin-top: 4px; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; transition: border-color var(--transition); }
.card:hover { border-color: var(--border-light); }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.card-title  { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; }
.card-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.card-body   { padding: 22px; }

/* ══════════════════════════════════════════════════════════════
   STAT CARDS
   ══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  position: relative; overflow: hidden;
  transition: all var(--transition); cursor: default;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--stat-color, var(--accent)); opacity: 0.85;
}
.stat-card::after {
  content: ''; position: absolute; top: -60px; right: -60px;
  width: 160px; height: 160px; border-radius: 50%;
  background: var(--stat-bg, var(--accent-glow)); opacity: 0.35;
  transition: all 0.4s ease;
}
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0,0,0,0.4); }
.stat-card:hover::after { opacity: 0.6; transform: scale(1.1); }
.stat-card-inner { position: relative; z-index: 1; }
.stat-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--stat-bg, var(--accent-glow));
  border: 1px solid rgba(255,255,255,0.05);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.stat-trend { display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 20px; }
.stat-trend.up  { color: var(--success); background: var(--success-bg); }
.stat-trend.down{ color: var(--danger);  background: var(--danger-bg);  }
.stat-trend.neutral { color: var(--text-muted); background: rgba(255,255,255,0.04); }
.stat-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.9px; margin-bottom: 5px; }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--text-primary); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-sub   { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.stat-sub .highlight { color: var(--stat-color, var(--accent-2)); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   CHARTS
   ══════════════════════════════════════════════════════════════ */
.chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.chart-header { padding: 18px 22px 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.chart-title  { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--text-primary); }
.chart-sub    { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.chart-legend { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.legend-item  { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend-dot   { width: 8px; height: 8px; border-radius: 50%; }
.chart-body   { padding: 0 16px 20px; }
.chart-container { position: relative; height: 220px; }

/* ══════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
.table-controls {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.table-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 12px;
  flex: 1; min-width: 180px; max-width: 300px;
}
.table-search input { background: none; border: none; outline: none; color: var(--text-primary); font-size: 13px; font-family: var(--font-body); width: 100%; }
.table-search input::placeholder { color: var(--text-muted); }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead { background: rgba(37,99,235,0.05); }
th {
  padding: 11px 16px; text-align: left;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-muted); border-bottom: 1px solid var(--border); white-space: nowrap;
}
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text-secondary); }
td { padding: 13px 16px; border-bottom: 1px solid var(--border); color: var(--text-secondary); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(37,99,235,0.04); }
td.text-primary { color: var(--text-primary); font-weight: 600; }
.td-stack { line-height: 1.3; }
.td-stack-primary { color: var(--text-primary); font-weight: 600; font-size: 13.5px; }
.td-stack-sub     { color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.badge-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }
.badge-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.2); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.2); }
.badge-info    { background: var(--info-bg);     color: var(--info);    border: 1px solid rgba(56,189,248,0.2); }
.badge-muted   { background: rgba(255,255,255,0.04); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.07); }
.badge-accent  { background: var(--accent-glow); color: var(--accent-2); border: 1px solid rgba(37,99,235,0.25); }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 600;
  border: none; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
  font-family: var(--font-body); line-height: 1;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(37,99,235,0.5); }
.btn-secondary {
  background: var(--bg-elevated); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--border-light); color: var(--text-primary); background: var(--bg-card-hover); }
.btn-success { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16,185,129,0.25); }
.btn-success:hover { background: rgba(16,185,129,0.18); box-shadow: 0 4px 14px rgba(16,185,129,0.15); }
.btn-danger  { background: var(--danger-bg);  color: var(--danger);  border: 1px solid rgba(239,68,68,0.25); }
.btn-danger:hover  { background: rgba(239,68,68,0.18);  box-shadow: 0 4px 14px rgba(239,68,68,0.15); }
.btn-warning { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245,158,11,0.25); }
.btn-warning:hover { background: rgba(245,158,11,0.18); }
.btn-sm   { padding: 5px 11px; font-size: 12px; border-radius: 6px; }
.btn-icon { padding: 9px; }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { border-color: var(--border); color: var(--text-primary); background: var(--bg-elevated); }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group  { margin-bottom: 18px; }
.form-label  { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-label span.required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 14px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-size: 13.5px; font-family: var(--font-body);
  transition: border-color var(--transition), box-shadow var(--transition); outline: none;
}
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c5096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.form-hint  { font-size: 12px; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-group { display: flex; }
.input-group-prefix, .input-group-suffix {
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 10px 14px; font-size: 13.5px; color: var(--text-muted); white-space: nowrap;
}
.input-group-prefix { border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group-suffix { border-left:  none; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-group .form-control { border-radius: 0; }
.input-group:has(.input-group-prefix) .form-control { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ══════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════ */
.alert {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px; border-radius: var(--radius-sm);
  margin-bottom: 20px; font-size: 13.5px;
}
.alert-icon { font-size: 16px; line-height: 1.4; flex-shrink: 0; }
.alert-success { background: var(--success-bg); border: 1px solid rgba(16,185,129,0.2);  color: var(--success); }
.alert-danger  { background: var(--danger-bg);  border: 1px solid rgba(239,68,68,0.2);   color: var(--danger); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(245,158,11,0.2);  color: var(--warning); }
.alert-info    { background: var(--info-bg);    border: 1px solid rgba(56,189,248,0.2);  color: var(--info); }

/* ══════════════════════════════════════════════════════════════
   MODAL
   ══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(1,12,30,0.9); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity var(--transition);
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); width: 100%; max-width: 520px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.75), 0 0 0 1px rgba(37,99,235,0.08);
  transform: translateY(24px) scale(0.97); transition: transform var(--transition);
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
}
.modal-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.modal-icon.success { background: var(--success-bg); }
.modal-icon.danger  { background: var(--danger-bg); }
.modal-icon.info    { background: var(--info-bg); }
.modal-title  { font-family: var(--font-display); font-size: 16px; font-weight: 700; flex: 1; }
.modal-close  { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 22px; padding: 4px; line-height: 1; transition: color var(--transition); }
.modal-close:hover { color: var(--text-primary); }
.modal-body   { padding: 22px 24px; }
.modal-footer { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ══════════════════════════════════════════════════════════════
   INFO GRID (modal detail rows)
   ══════════════════════════════════════════════════════════════ */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.info-item { background: var(--bg-input); border-radius: var(--radius-sm); padding: 12px 14px; }
.info-item-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 4px; }
.info-item-value { font-size: 14px; color: var(--text-primary); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   COMMISSION
   ══════════════════════════════════════════════════════════════ */
.commission-rate {
  font-family: var(--font-display); font-size: 40px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; line-height: 1;
}
.ref-code-box {
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(59,130,246,0.04));
  border: 1px solid rgba(37,99,235,0.22); border-radius: var(--radius);
  padding: 18px 22px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.ref-code-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.9px; margin-bottom: 2px; }
.ref-code-value { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--accent-2); letter-spacing: 3px; }
.commission-input {
  width: 80px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 8px; color: var(--text-primary);
  font-size: 13px; text-align: center; outline: none;
}
.commission-input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow); }

/* ══════════════════════════════════════════════════════════════
   PAGINATION
   ══════════════════════════════════════════════════════════════ */
.pagination { display: flex; gap: 5px; align-items: center; margin-top: 20px; justify-content: center; }
.page-link {
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  font-size: 13px; font-weight: 500; transition: all var(--transition);
}
.page-link:hover  { border-color: var(--accent); color: var(--accent-2); }
.page-link.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 2px 10px var(--accent-glow); }

/* ══════════════════════════════════════════════════════════════
   ACTIVITY FEED
   ══════════════════════════════════════════════════════════════ */
.activity-feed { padding: 0 22px; }
.activity-item { display: flex; 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: 8px;
  background: var(--bg-input); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.activity-icon.success { background: var(--success-bg); border-color: rgba(16,185,129,0.2); }
.activity-icon.warning { background: var(--warning-bg); border-color: rgba(245,158,11,0.2); }
.activity-icon.danger  { background: var(--danger-bg);  border-color: rgba(239,68,68,0.2); }
.activity-icon.info    { background: var(--info-bg);    border-color: rgba(56,189,248,0.2); }
.activity-content { flex: 1; min-width: 0; }
.activity-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ══════════════════════════════════════════════════════════════
   TOP AGENT CARD
   ══════════════════════════════════════════════════════════════ */
.top-agent-card { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.top-agent-card:last-child { border-bottom: none; }
.top-agent-rank { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-input); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-muted); flex-shrink: 0; }
.top-agent-rank.gold { background: rgba(245,158,11,0.12); color: var(--warning); }
.top-agent-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; flex-shrink: 0; }
.top-agent-info { flex: 1; min-width: 0; }
.top-agent-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.top-agent-sub  { font-size: 11.5px; color: var(--text-muted); }
.top-agent-amount { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--success); white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════
   SEGMENT TABS
   ══════════════════════════════════════════════════════════════ */
.segment-tabs { display: flex; gap: 2px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; width: fit-content; }
.segment-tab { padding: 6px 14px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: all var(--transition); border: none; background: transparent; }
.segment-tab.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
.segment-tab:hover:not(.active) { color: var(--text-secondary); }

/* ══════════════════════════════════════════════════════════════
   PROGRESS
   ══════════════════════════════════════════════════════════════ */
.progress { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 3px; transition: width 1s ease; }
.progress-bar.accent  { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }

/* ══════════════════════════════════════════════════════════════
   AUTH PAGE
   ══════════════════════════════════════════════════════════════ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative; overflow: hidden;
}
.auth-page::before {
  content: ''; position: fixed; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(0,26,87,0.5) 0%, transparent 65%);
  pointer-events: none;
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 40px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(37,99,235,0.08);
  position: relative;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo-icon {
  width: 60px; height: 60px; border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800;
  font-size: 22px; color: #fff; margin: 0 auto 12px;
  box-shadow: 0 0 28px rgba(37,99,235,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}
.auth-logo h1  { font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-primary); }
.auth-logo p   { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.auth-title    { font-family: var(--font-display); font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.auth-subtitle { color: var(--text-secondary); font-size: 14px; margin-bottom: 28px; }
.auth-footer   { text-align: center; margin-top: 20px; font-size: 13px; color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════
   UTILITIES
   ══════════════════════════════════════════════════════════════ */
.flex          { display: flex; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-0  { margin-bottom: 0 !important; } .mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; } .mb-24 { margin-bottom: 24px; }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-muted   { color: var(--text-muted); } .text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }   .text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }   .text-info    { color: var(--info); }
.text-sm   { font-size: 12.5px; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.w-full    { width: 100%; }
.overflow-hidden { overflow: hidden; }
.grid-2    { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3    { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: 20px; }
.divider   { height: 1px; background: var(--border); margin: 20px 0; }

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 44px; margin-bottom: 14px; opacity: 0.35; }
.empty-state h3 { font-size: 15px; color: var(--text-secondary); margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ══════════════════════════════════════════════════════════════
   HAMBURGER / MOBILE OVERLAY
   ══════════════════════════════════════════════════════════════ */
.hamburger {
  display: none; background: none; border: none;
  color: var(--text-secondary); cursor: pointer; font-size: 20px;
  padding: 4px; margin-right: 4px;
}
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }
.counter { font-variant-numeric: tabular-nums; }

/* ══════════════════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes badge-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}
.fade-in { animation: fadeIn 0.35s ease-out; }

.stats-grid .stat-card:nth-child(1) { animation: fadeIn 0.4s ease-out 0.05s both; }
.stats-grid .stat-card:nth-child(2) { animation: fadeIn 0.4s ease-out 0.10s both; }
.stats-grid .stat-card:nth-child(3) { animation: fadeIn 0.4s ease-out 0.15s both; }
.stats-grid .stat-card:nth-child(4) { animation: fadeIn 0.4s ease-out 0.20s both; }
.stats-grid .stat-card:nth-child(5) { animation: fadeIn 0.4s ease-out 0.25s both; }
.stats-grid .stat-card:nth-child(6) { animation: fadeIn 0.4s ease-out 0.30s both; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.5); }
  .main-content { margin-left: 0 !important; }
  .hamburger { display: block; }
  .sidebar-collapse-btn { display: none; }
}
@media (max-width: 768px) {
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .auth-card { padding: 28px 20px; }
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
}
