/* ============================================================
   EMI 360 — Brand Stylesheet
   Ekphatthana Microfinance Institution
   Version 1.0 | April 2026
   ============================================================ */

/* ── Fonts ───────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Lao:wght@400;500;600;700&family=DM+Sans:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ── CSS Variables ───────────────────────────────────────── */
:root {
  /* Brand colors */
  --navy:        #17335E;
  --navy-dark:   #0f2240;
  --navy-light:  #1e4070;
  --green:       #49C18E;
  --green-light: #e5f8f0;
  --green-dark:  #35a575;
  --orange:      #F15A26;
  --orange-light:#fff0eb;
  --purple:      #655CA8;
  --purple-light:#f0eefb;
  --lime:        #8DC640;
  --lime-light:  #f2f9e6;
  --red:         #E53935;
  --red-light:   #fdecea;
  --yellow:      #FFC107;
  --yellow-light:#fff8e1;

  /* UI Neutrals */
  --bg:          #f0f2f7;
  --bg-card:     #ffffff;
  --border:      #dde2ed;
  --border-light:#eef0f6;
  --text:        #16213a;
  --text-2:      #4a5568;
  --text-3:      #8a96a8;
  --text-inv:    #ffffff;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(23,51,94,0.07);
  --shadow:      0 2px 8px rgba(23,51,94,0.09);
  --shadow-md:   0 4px 16px rgba(23,51,94,0.10);
  --shadow-lg:   0 8px 32px rgba(23,51,94,0.12);

  /* Radii */
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  /* Sidebar */
  --sidebar-w:   230px;
  --header-h:    60px;

  /* Typography */
  --font:        'DM Sans', 'Noto Sans Lao', sans-serif;
  --font-mono:   'DM Mono', monospace;
  --font-lao:    'Noto Sans Lao', sans-serif;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; }

/* ── Typography ──────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.2; }
h2 { font-size: 1.375rem; font-weight: 600; line-height: 1.3; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 0.9375rem; font-weight: 600; }
p  { color: var(--text-2); }
.lao { font-family: var(--font-lao); }
.mono { font-family: var(--font-mono); }

/* ── Layout ──────────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: var(--green);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; color: white; letter-spacing: -0.5px;
  flex-shrink: 0;
}
.sidebar-logo-text { color: white; }
.sidebar-logo-name  { font-size: 15px; font-weight: 700; line-height: 1.1; }
.sidebar-logo-sub   { font-size: 10px; opacity: 0.55; letter-spacing: 0.3px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

.nav-section-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  padding: 14px 20px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  font-weight: 500;
  border-radius: 0;
  transition: all 0.15s;
  cursor: pointer;
  white-space: nowrap;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  color: white;
  background: rgba(255,255,255,0.06);
}
.nav-item.active {
  color: var(--green);
  background: rgba(73,193,142,0.12);
  border-left-color: var(--green);
}
.nav-item .nav-icon { font-size: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--orange);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--navy-light);
  display: flex; align-items: center; justify-content: center;
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name  { color: white; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role  { color: rgba(255,255,255,0.45); font-size: 10.5px; }
.btn-logout {
  padding: 5px;
  color: rgba(255,255,255,0.4);
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.btn-logout:hover { color: var(--orange); }

/* ── Main Content ────────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top Header ──────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-size: 16px; font-weight: 600; flex: 1; }
.topbar-meta  { font-size: 12px; color: var(--text-3); }
.topbar-date  { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }

/* ── Page Content ────────────────────────────────────────── */
.page {
  flex: 1;
  padding: 24px 28px;
  display: none;
}
.page.active { display: block; }
.page-header {
  margin-bottom: 22px;
}
.page-header h2 { font-size: 1.25rem; color: var(--text); }
.page-header p  { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ── Period Toggle (1Y / 3Y / 5Y / All) ─────────────────── */
.period-btn {
  background: transparent;
  color: #17335E;
  padding: 5px 10px;
  font-size: 11px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}
.period-btn.active {
  background: #49C18E;
  color: #17335E;
}
.period-btn:hover:not(.active) {
  background: rgba(255,255,255,0.5);
}

/* ── Form Select (alias for .form-control on <select>) ──── */
.form-select {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a96a8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.form-select:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(23,51,94,0.08);
}

/* ── Financial Statements Table (BS, P&L) ─────────────────── */
.fs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.fs-table tbody td {
  padding: 6px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
}
.fs-table tbody tr:last-child td { border-bottom: none; }
.fs-table tbody tr:hover td      { background: var(--bg); }
.fs-table .indent {
  padding-left: 28px;
  color: var(--text-3);
  font-size: 11.5px;
}
.fs-table .fs-section td {
  background: var(--bg);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 14px;
}
.fs-table .fs-subtotal td { background: var(--green-light); }
.fs-table .fs-total td {
  background: #e8ecf5;
  border-top: 2px solid var(--navy);
  border-bottom: 1px solid var(--navy);
  color: var(--navy);
}

/* ── Ratio RAG Grid ───────────────────────────────────────── */
.ratios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}
.ratio-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border-left: 3px solid var(--text-3);
  transition: transform 0.15s, box-shadow 0.15s;
}
.ratio-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.ratio-card-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  margin-bottom: 5px;
}
.ratio-card-value {
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  letter-spacing: -0.5px;
}
.ratio-card.rag-green                   { background: var(--green-light);  border-left-color: var(--green); }
.ratio-card.rag-green .ratio-card-value { color: var(--green-dark); }
.ratio-card.rag-amber                   { background: var(--yellow-light); border-left-color: var(--yellow); }
.ratio-card.rag-amber .ratio-card-value { color: #b7860a; }
.ratio-card.rag-red                     { background: var(--red-light);    border-left-color: var(--red); }
.ratio-card.rag-red .ratio-card-value   { color: var(--red); }
.ratio-card.rag-na                      { background: var(--bg);           border-left-color: var(--text-3); }

/* ── KPI Cards Grid ──────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: var(--shadow-md); }
.kpi-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.kpi-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
  font-family: var(--font-mono);
  letter-spacing: -1px;
}
.kpi-card-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 5px;
}
.kpi-card-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  margin-top: 6px;
}
.trend-up   { background: var(--green-light); color: var(--green-dark); }
.trend-down { background: var(--red-light);   color: var(--red); }
.trend-flat { background: var(--border-light); color: var(--text-3); }

/* KPI card accent bar */
.kpi-card.accent-green { border-top: 3px solid var(--green); }
.kpi-card.accent-navy  { border-top: 3px solid var(--navy); }
.kpi-card.accent-orange{ border-top: 3px solid var(--orange); }
.kpi-card.accent-purple{ border-top: 3px solid var(--purple); }
.kpi-card.accent-lime  { border-top: 3px solid var(--lime); }

/* ── Content Grid ────────────────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.content-grid.col-3 { grid-template-columns: 1fr 1fr 1fr; }
.content-grid.col-1-2 { grid-template-columns: 1fr 2fr; }
.content-grid.col-2-1 { grid-template-columns: 2fr 1fr; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-light);
}
.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.card-subtitle {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}
.card-body { padding: 18px 20px; }
.card-body-flush { padding: 0; }
.card-actions { display: flex; gap: 8px; align-items: center; }

/* ── Chart Container ─────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 220px;
}
.chart-wrap.tall  { height: 280px; }
.chart-wrap.short { height: 160px; }

/* ── Table ───────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
thead th {
  background: var(--bg);
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 9px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--bg); }
td.num { text-align: right; font-family: var(--font-mono); font-size: 12px; }
td.bold { font-weight: 600; color: var(--text); }

/* ── Badges / Pills ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-green  { background: var(--green-light);  color: var(--green-dark); }
.badge-orange { background: var(--orange-light); color: var(--orange); }
.badge-red    { background: var(--red-light);    color: var(--red); }
.badge-navy   { background: #e8ecf5;             color: var(--navy); }
.badge-purple { background: var(--purple-light); color: var(--purple); }
.badge-yellow { background: var(--yellow-light); color: #b7860a; }

/* BOL Class badges */
.bol-A { background: var(--green-light);  color: var(--green-dark); }
.bol-B { background: var(--yellow-light); color: #8a6500; }
.bol-C { background: var(--orange-light); color: #c0400a; }
.bol-D { background: var(--red-light);    color: var(--red); }
.bol-E { background: #2d0a0a;             color: #ff8080; }

/* ── Progress Bar ────────────────────────────────────────── */
.progress-wrap { margin-bottom: 14px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 5px;
  color: var(--text-2);
}
.progress-label strong { color: var(--text); }
.progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 10px;
  background: var(--green);
  transition: width 0.6s ease;
}
.progress-fill.orange { background: var(--orange); }
.progress-fill.red    { background: var(--red); }
.progress-fill.navy   { background: var(--navy); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: 1.5px solid transparent;
  line-height: 1;
}
.btn-primary {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}
.btn-primary:hover { background: var(--navy-dark); }
.btn-green {
  background: var(--green);
  color: white;
  border-color: var(--green);
}
.btn-green:hover { background: var(--green-dark); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--navy); background: var(--bg); }
.btn-sm { padding: 4px 10px; font-size: 11.5px; }
.btn-full { width: 100%; justify-content: center; padding: 11px 14px; font-size: 14px; }

/* ── Form Elements ───────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}
.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: white;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(23,51,94,0.08);
}
.form-control::placeholder { color: var(--text-3); }
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 24 24' fill='none' stroke='%238a96a8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

/* ── Divider ─────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border-light); margin: 18px 0; }

/* ── Loading States ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--border) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-3);
  font-size: 12px;
  gap: 8px;
}

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast Notifications ─────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--text);
  color: white;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease;
  max-width: 320px;
}
.toast.success { background: var(--green-dark); }
.toast.error   { background: var(--red); }
.toast.warning { background: #e09b00; }
@keyframes slideInRight {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Login Page ──────────────────────────────────────────── */
body.login-body {
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  overflow: hidden;
}
.login-bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(73,193,142,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(101,92,168,0.06) 0%, transparent 50%),
    var(--navy);
  z-index: 0;
}
.login-wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  padding: 24px;
}
.login-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-xl);
  padding: 36px 36px 30px;
  backdrop-filter: blur(12px);
  animation: fadeInUp 0.4s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 30px;
}
.login-logo-icon {
  width: 48px; height: 48px;
  background: var(--green);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: white;
  letter-spacing: -1px;
  box-shadow: 0 4px 14px rgba(73,193,142,0.35);
}
.login-logo-name { color: white; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.login-logo-sub  { color: rgba(255,255,255,0.45); font-size: 11px; margin-top: 1px; }

.login-card .form-group label { color: rgba(255,255,255,0.6); }
.login-card .form-control {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.12);
  color: white;
}
.login-card .form-control:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(73,193,142,0.15);
  background: rgba(255,255,255,0.10);
}
.login-card .form-control::placeholder { color: rgba(255,255,255,0.25); }

.login-error {
  background: rgba(229,57,53,0.15);
  border: 1px solid rgba(229,57,53,0.3);
  color: #ff8a80;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 14px;
}
.login-footer {
  text-align: center;
  margin-top: 22px;
  color: rgba(255,255,255,0.3);
  font-size: 11px;
  line-height: 1.7;
}
.login-footer .lao { color: rgba(255,255,255,0.2); font-size: 10.5px; }
.login-version {
  text-align: center;
  margin-top: 16px;
  color: rgba(255,255,255,0.2);
  font-size: 10.5px;
}

/* ── Alert Banner ────────────────────────────────────────── */
.alert {
  display: flex;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.alert-warning { background: var(--yellow-light); border-left: 3px solid var(--yellow); color: #6b4c00; }
.alert-danger  { background: var(--red-light);    border-left: 3px solid var(--red);    color: #8a0a0a; }
.alert-info    { background: #e8f0fe;             border-left: 3px solid #1a73e8;       color: #174ea6; }
.alert-success { background: var(--green-light);  border-left: 3px solid var(--green);  color: #1a5c3a; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content-grid { grid-template-columns: 1fr; }
  .content-grid.col-3 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: span 1; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page { padding: 16px; }
  .topbar { padding: 0 16px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .login-card { padding: 24px 20px; }
}

/* ── Utility ─────────────────────────────────────────────── */
.flex   { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.text-sm  { font-size: 11.5px; }
.text-xs  { font-size: 10.5px; }
.text-muted { color: var(--text-3); }
.text-navy  { color: var(--navy); }
.text-green { color: var(--green-dark); }
.text-orange{ color: var(--orange); }
.text-red   { color: var(--red); }
.fw-600  { font-weight: 600; }
.fw-700  { font-weight: 700; }
.w-full  { width: 100%; }
.truncate { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hidden { display: none !important; }
