/* ═══════════════════════════════════════════════════════
   Sailoors Finance — Design System
   Font: IBM Plex Sans Arabic
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

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

:root {
  --sidebar-bg:   #0f0f23;
  --sidebar-w:    240px;
  --accent:       #e8001c;
  --accent-muted: rgba(232,0,28,0.12);
  --success:      #16a34a;
  --success-bg:   #f0fdf4;
  --warning:      #d97706;
  --warning-bg:   #fffbeb;
  --danger:       #dc2626;
  --danger-bg:    #fef2f2;
  --info:         #0284c7;
  --info-bg:      #eff6ff;
  --bg:           #f0f4f8;
  --card:         #ffffff;
  --topbar:       #ffffff;
  --text:         #1e2532;
  --text-2:       #5a6478;
  --text-3:       #94a3b8;
  --border:       #e2e8f0;
  --border-2:     #f1f5f9;
  --radius-sm:    6px;
  --radius:       10px;
  --radius-lg:    14px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.07),0 1px 2px rgba(0,0,0,0.05);
  --shadow:       0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:    0 8px 30px rgba(0,0,0,0.12);
  --topbar-h:     60px;
}

html { font-size: 14px; }

body {
  font-family: 'IBM Plex Sans Arabic', 'Tajawal', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  direction: rtl;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── SIDEBAR ──────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; right: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.sidebar-logo-icon, .logo-icon {
  width: 34px; height: 34px;
  background: var(--accent);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: #fff;
  flex-shrink: 0;
}
.sidebar-logo-text, .logo-text-wrap { flex: 1; overflow: hidden; }
.sidebar-logo-name, .logo-name {
  display: block; font-size: 15px; font-weight: 700;
  color: #fff; letter-spacing: -0.3px; white-space: nowrap;
}
.sidebar-logo-sub, .logo-sub {
  display: block; font-size: 10px;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.2px; text-transform: uppercase; margin-top: 1px;
}

/* Scrollable nav */
.sidebar-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0 20px; }
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Section label */
.nav-section-label {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.25);
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 14px 18px 6px;
}

/* Top-level direct link */
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.55);
  text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background 0.15s, color 0.15s;
  border-right: 3px solid transparent;
  cursor: pointer;
}
.nav-link:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); }
.nav-link.active {
  background: var(--accent-muted);
  color: #fff;
  border-right-color: var(--accent);
}
.nav-link .ni { font-size: 16px; opacity: 0.7; flex-shrink: 0; width: 20px; text-align: center; }
.nav-link.active .ni { opacity: 1; }

/* Group (collapsible) */
.nav-group {}
.nav-group-toggle {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 18px;
  color: rgba(255,255,255,0.55);
  font-size: 13.5px; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: background 0.15s, color 0.15s;
  border-right: 3px solid transparent;
  list-style: none;
  border: none; background: none; width: 100%; text-align: right;
  font-family: inherit;
}
.nav-group-toggle:hover { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.85); }
.nav-group.open .nav-group-toggle,
.nav-group-toggle.open { color: rgba(255,255,255,0.85); }
.nav-group-toggle .ni { font-size: 16px; opacity: 0.7; flex-shrink: 0; width: 20px; text-align: center; }
.nav-group-toggle.open .ni { opacity: 1; }
.nav-group-toggle .nav-label { flex: 1; text-align: right; }
.nav-arrow, .chevron {
  width: 14px; height: 14px; flex-shrink: 0;
  color: rgba(255,255,255,0.3);
  transition: transform 0.2s;
  margin-right: auto; margin-left: 0;
}
.nav-group.open .chevron,
.nav-group-toggle.open .nav-arrow,
.nav-group-toggle.open .chevron { transform: rotate(180deg); }

.nav-group-left {
  display: flex; align-items: center; gap: 10px; flex: 1;
}

.nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.nav-group.open .nav-icon,
.nav-link.active .nav-icon { opacity: 1; }

.nav-group-body {
  overflow: hidden; max-height: 0;
  transition: max-height 0.25s ease;
  background: rgba(0,0,0,0.15);
}
.nav-group.open .nav-group-body,
.nav-group-body.open { max-height: 400px; }

.nav-sub-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 18px 7px 18px;
  padding-right: 46px;
  color: rgba(255,255,255,0.42);
  text-decoration: none; font-size: 13px; font-weight: 400;
  transition: color 0.15s, background 0.15s;
  border-right: 3px solid transparent;
}
.nav-sub-link::before {
  content: '';
  width: 4px; height: 4px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0; opacity: 0.5;
}
.nav-sub-link:hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.04); }
.nav-sub-link.active {
  color: #fff; background: rgba(232,0,28,0.1);
  border-right-color: var(--accent);
}
.nav-sub-link.active::before { opacity: 1; background: var(--accent); }

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding: 12px 16px;
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
}
.sidebar-avatar, .sf-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.sidebar-user-info, .sf-info { flex: 1; overflow: hidden; min-width: 0; }
.sidebar-user-name, .sf-name { display: block; font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role, .sf-role { display: block; font-size: 10.5px; color: rgba(255,255,255,0.35); }
.sf-logout {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,0.35); padding: 4px;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  transition: color 0.15s;
}
.sf-logout:hover { color: var(--accent); }

/* ── MAIN WRAPPER ─────────────────────────────────────── */
.main-wrapper {
  margin-right: var(--sidebar-w);
  flex: 1; display: flex; flex-direction: column; min-height: 100vh;
}

/* ── TOPBAR ───────────────────────────────────────────── */
.topbar {
  background: var(--topbar);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2); font-weight: 500;
}
.topbar-breadcrumb strong { color: var(--text); font-weight: 600; }
.topbar-breadcrumb span { color: var(--text-3); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-date { font-size: 12px; color: var(--text-3); padding: 4px 10px; }
.sidebar-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 8px;
  color: var(--text-2); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--text); }
.btn-logout {
  display: flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--border);
  color: var(--text-2); padding: 6px 14px;
  border-radius: var(--radius-sm); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 500;
  transition: all 0.15s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }

/* ── CONTENT ──────────────────────────────────────────── */
.content { padding: 24px; flex: 1; }

/* Flash message */
.flash-msg {
  margin: 0 24px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 8px;
}
.flash-success { background: var(--success-bg); color: #14532d; border: 1px solid #bbf7d0; }
.flash-error   { background: var(--danger-bg);  color: #7f1d1d; border: 1px solid #fecaca; }
.flash-info    { background: var(--info-bg);    color: #1e40af; border: 1px solid #bfdbfe; }

/* ── PAGE HEADER ─────────────────────────────────────── */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; }

/* ── SIDEBAR NAV ─────────────────────────────────────── */
.sidebar-nav { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px 0 16px; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* ── CARDS ────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.card:last-child { margin-bottom: 0; }
.card-sm { padding: 14px 18px; }
.card-lg { padding: 28px; }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.card-title {
  font-size: 14px; font-weight: 700; color: var(--text);
}
.card-action { font-size: 12.5px; color: var(--text-2); text-decoration: none; transition: color 0.15s; }
.card-action:hover { color: var(--accent); }

/* Utility: link-accent */
.link-accent { color: var(--accent); text-decoration: none; font-weight: 600; }
.link-accent:hover { text-decoration: underline; }

/* page-sub */
.page-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ── KPI GRID ─────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 14px; margin-bottom: 20px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-card::after {
  content: '';
  position: absolute; top: 0; right: 0;
  width: 100%; height: 3px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.kpi-card.red::after    { background: var(--accent); }
.kpi-card.green::after  { background: var(--success); }
.kpi-card.orange::after { background: var(--warning); }
.kpi-card.blue::after   { background: var(--info); }
.kpi-card.purple::after { background: #7c3aed; }

.kpi-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.kpi-card.red    .kpi-icon { background: rgba(232,0,28,0.1); }
.kpi-card.green  .kpi-icon { background: rgba(22,163,74,0.1); }
.kpi-card.orange .kpi-icon { background: rgba(217,119,6,0.1); }
.kpi-card.blue   .kpi-icon { background: rgba(2,132,199,0.1); }
.kpi-card.purple .kpi-icon { background: rgba(124,58,237,0.1); }

.kpi-value { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; letter-spacing: -0.5px; }
.kpi-label { font-size: 12px; color: var(--text-2); margin-top: 4px; font-weight: 500; }
.kpi-change { font-size: 11.5px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.kpi-change.up   { color: var(--success); }
.kpi-change.down { color: var(--danger); }
.kpi-change.neutral { color: var(--text-3); }

/* ── QUICK ACTIONS ────────────────────────────────────── */
.quick-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.qa-card {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none;
  color: var(--text); font-size: 13.5px; font-weight: 600;
  transition: all 0.15s; box-shadow: var(--shadow-sm);
  flex: 1; min-width: 160px;
}
.qa-card:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--shadow); transform: translateY(-1px); }
.qa-card .qa-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: var(--accent-muted); color: var(--accent);
  flex-shrink: 0;
}

/* ── DASHBOARD GRID ───────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 16px; margin-bottom: 20px;
}
.chart-container { position: relative; height: 240px; }

/* ── TABLES ───────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th {
  text-align: right; padding: 10px 14px;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc; white-space: nowrap;
}
tbody td {
  padding: 11px 14px; border-bottom: 1px solid var(--border-2);
  color: var(--text); vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background 0.1s; }
tbody tr:hover { background: #f8fafc; }
.td-muted { color: var(--text-2); font-size: 12px; }
.td-bold  { font-weight: 600; }

/* ── BADGES ───────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-draft     { background: #f1f5f9; color: #475569; }
.badge-sent      { background: #eff6ff; color: #1d4ed8; }
.badge-paid      { background: var(--success-bg); color: #15803d; }
.badge-partial   { background: var(--warning-bg); color: #92400e; }
.badge-overdue   { background: var(--danger-bg); color: #b91c1c; }
.badge-cancelled { background: #f8fafc; color: #94a3b8; }
.badge-new       { background: #ede9fe; color: #6d28d9; }

/* ── BUTTONS ──────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: 1; }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-info     { background: var(--info); color: #fff; }
.btn-outline  { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost    { background: transparent; color: var(--text-2); border: none; }
.btn-sm       { padding: 5px 11px; font-size: 12.5px; }
.btn-lg       { padding: 11px 22px; font-size: 14.5px; }
.btn-icon     { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }

/* ── FORMS ────────────────────────────────────────────── */
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.7px;
  margin-bottom: 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 5px;
}
.form-label .req { color: var(--danger); margin-right: 2px; }
.form-hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.form-control {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: #fff; transition: border-color 0.15s, box-shadow 0.15s;
  direction: rtl; line-height: 1.5;
}
.form-control:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232,0,28,0.1);
}
.form-control.is-invalid { border-color: var(--danger); }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; display: block; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

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

/* Legacy compat */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }

/* ── INVOICE LINE ITEMS ───────────────────────────────── */
.items-wrapper { overflow-x: auto; }
.items-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.items-table thead th {
  background: #f8fafc; padding: 9px 12px;
  font-size: 11px; font-weight: 700; color: var(--text-3);
  border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap;
}
.items-table tbody td { padding: 7px 10px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table .col-desc  { min-width: 260px; }
.items-table .col-num   { width: 85px; }
.items-table .col-price { width: 120px; }
.items-table .col-disc  { width: 75px; }
.items-table .col-total { width: 110px; font-weight: 600; color: var(--text); }
.items-table .col-del   { width: 38px; text-align: center; }

/* ── TOTALS BLOCK ─────────────────────────────────────── */
.totals-block { max-width: 300px; margin-right: auto; }
.totals-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; font-size: 13.5px;
  border-bottom: 1px solid var(--border-2);
}
.totals-row:last-child { border-bottom: none; }
.totals-label { color: var(--text-2); font-weight: 500; }
.totals-grand { font-size: 17px; font-weight: 800; color: var(--text); }

/* ── INVOICE VIEW ─────────────────────────────────────── */
.inv-view-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 18px;
}
.info-row {
  display: flex; gap: 10px; padding: 7px 0;
  border-bottom: 1px solid var(--border-2); font-size: 13.5px;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-2); min-width: 130px; flex-shrink: 0; }
.info-value { color: var(--text); font-weight: 500; }

/* ── FILTERS BAR ──────────────────────────────────────── */
.filters-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.filters-bar .form-control { padding: 7px 12px; font-size: 13px; }

/* ── STATUS TABS ──────────────────────────────────────── */
.status-tabs {
  display: flex; gap: 2px;
  border-bottom: 2px solid var(--border); margin-bottom: 0;
}
.status-tab {
  padding: 8px 16px; font-size: 12.5px; font-weight: 600;
  color: var(--text-2); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}
.status-tab:hover { color: var(--text); }
.status-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── PAGINATION ───────────────────────────────────────── */
.pagination-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-2);
}
.pagination { display: flex; gap: 4px; }
.page-link {
  padding: 5px 11px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 12.5px;
  color: var(--text-2); text-decoration: none; background: var(--card);
  transition: all 0.12s;
}
.page-link:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ── ALERTS ───────────────────────────────────────────── */
.alert {
  padding: 10px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; margin-bottom: 14px;
}
.alert-success { background: var(--success-bg); color: #14532d; border: 1px solid #bbf7d0; }
.alert-error   { background: var(--danger-bg);  color: #7f1d1d; border: 1px solid #fecaca; }
.alert-info    { background: var(--info-bg);    color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: var(--warning-bg); color: #78350f; border: 1px solid #fde68a; }

/* ── LOGIN ────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; background: #0a0a1a;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background-image: radial-gradient(circle at 20% 80%, rgba(232,0,28,0.08) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(15,15,35,0.9) 0%, transparent 50%);
}
.login-card {
  background: #fff; border-radius: var(--radius-lg);
  padding: 40px 36px; width: 100%; max-width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}
.login-logo, .login-brand {
  text-align: center; margin-bottom: 28px;
  display: flex; align-items: center; gap: 14px; justify-content: center;
}
.login-logo-icon, .login-brand-icon {
  width: 52px; height: 52px; background: var(--accent);
  border-radius: 14px; display: flex; align-items: center;
  justify-content: center; font-size: 26px; color: #fff;
  flex-shrink: 0;
}
.login-brand-text { text-align: right; }
.login-logo-name, .login-brand-name { font-size: 20px; font-weight: 700; color: var(--text); }
.login-logo-sub, .login-brand-sub  { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.login-error {
  background: var(--danger-bg); border: 1px solid #fecaca;
  color: #b91c1c; padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px; text-align: center;
}

/* ── CLIENT AVATAR ────────────────────────────────────── */
.client-avatar {
  width: 34px; height: 34px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.av-red    { background: #e8001c; }
.av-blue   { background: #0284c7; }
.av-green  { background: #16a34a; }
.av-purple { background: #7c3aed; }
.av-orange { background: #d97706; }
.av-teal   { background: #0d9488; }

/* ── DIVIDERS & SPACERS ───────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mt-4 { margin-top: 28px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.mb-4 { margin-bottom: 28px; }

/* ── FLEX UTILS ───────────────────────────────────────── */
.d-flex       { display: flex; }
.flex-col     { flex-direction: column; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.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-wrap { flex-wrap: wrap; }
.text-muted   { color: var(--text-2); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-accent  { color: var(--accent); }
.text-sm      { font-size: 12px; }
.text-xs      { font-size: 11px; }
.fw-600       { font-weight: 600; }
.fw-700       { font-weight: 700; }
.w-100        { width: 100%; }
.text-end     { text-align: left; }

/* ── ERROR PAGE ───────────────────────────────────────── */
.error-page { text-align: center; padding: 80px 20px; }
.error-code { font-size: 80px; font-weight: 700; color: var(--border); line-height: 1; }
.error-msg  { font-size: 18px; color: var(--text-2); margin-top: 12px; }

/* ── STAT MINI ────────────────────────────────────────── */
.stat-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border-2); }
.stat-row:last-child { border-bottom: none; }
.stat-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stat-label { flex: 1; font-size: 13px; color: var(--text-2); }
.stat-value { font-size: 13.5px; font-weight: 600; color: var(--text); }
.stat-pct   { font-size: 11.5px; color: var(--text-3); min-width: 36px; text-align: left; }

/* ── PROGRESS BAR ─────────────────────────────────────── */
.progress { height: 5px; background: var(--border-2); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; transition: width 0.6s ease; }

/* ── SECTION WRAPPER ──────────────────────────────────── */
.section { margin-bottom: 20px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-size: 14.5px; font-weight: 700; color: var(--text); }

/* ── EMPTY STATE ──────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 50px 20px;
  color: var(--text-3);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state-text { font-size: 14px; }
.empty-state-link { color: var(--accent); text-decoration: none; font-weight: 600; }
