/* ================================================================
   KV Ramesh UPSC Academy — Global Design System v2.0
   Palette: Deep Teal + Scholarly Navy + Warm Gold
   Fonts: Playfair Display (headings) + Inter (UI)
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  /* Brand Colors */
  --primary:        #0C6B68;
  --primary-dark:   #084845;
  --primary-hover:  #0A5C59;
  --primary-light:  #E8F5F4;
  --primary-mid:    #C2E0DF;
  --secondary:      #1B3A5C;
  --secondary-dark: #122840;
  --secondary-light:#EEF3F8;
  --accent:         #E8A020;
  --accent-dark:    #C8881A;
  --accent-light:   #FEF3DC;

  /* Sidebar */
  --sidebar-bg:     #0A3D3D;
  --sidebar-hover:  #0C4F4F;
  --sidebar-active: #0C6B68;
  --sidebar-text:   #A8CECE;
  --sidebar-border: rgba(168,206,206,0.1);

  /* Surface */
  --white:          #FFFFFF;
  --bg:             #F4FAFA;
  --surface:        #FFFFFF;
  --surface-2:      #F0F8F8;
  --border:         #CBE5E4;
  --border-light:   #DFF0EF;

  /* Text */
  --text:           #192C2C;
  --text-muted:     #567070;
  --text-light:     #8AABAB;
  --text-inverse:   #FFFFFF;

  /* Status */
  --success:        #16A34A;
  --success-light:  #DCFCE7;
  --danger:         #DC2626;
  --danger-light:   #FEE2E2;
  --warning:        #D97706;
  --warning-light:  #FEF3C7;
  --info:           #0284C7;
  --info-light:     #E0F2FE;
  --purple:         #7C3AED;
  --purple-light:   #EDE9FE;

  /* Layout */
  --sidebar-w:      260px;
  --topbar-h:       62px;
  --radius-sm:      6px;
  --radius:         10px;
  --radius-lg:      14px;
  --radius-xl:      20px;
  --radius-full:    9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(11,110,110,0.08);
  --shadow:     0 2px 8px rgba(11,110,110,0.10), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md:  0 4px 16px rgba(11,110,110,0.12), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:  0 8px 32px rgba(11,110,110,0.14), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-xl:  0 20px 60px rgba(11,110,110,0.16), 0 8px 16px rgba(0,0,0,0.08);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  /* Transitions */
  --t-fast:  0.15s ease;
  --t-base:  0.2s ease;
  --t-slow:  0.3s ease;
}

/* Dark mode */
[data-theme="dark"] {
  --bg:           #0E1A1A;
  --surface:      #152222;
  --surface-2:    #1C2E2E;
  --border:       #253A3A;
  --border-light: #1E3030;
  --text:         #E0F0F0;
  --text-muted:   #7AADAD;
  --text-light:   #4A8080;
  --white:        #152222;
  --primary-light:#0F3535;
  --secondary-light:#0F1E2E;
  --accent-light: #2A1E08;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-ui); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: var(--font-ui); }
ul, ol { list-style: none; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4, h5, h6 { color: var(--secondary); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.7rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { line-height: 1.7; }

.font-display { font-family: var(--font-display); }
.font-mono    { font-family: var(--font-mono); }

/* ── DASHBOARD SHELL ── */
.app-shell    { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--t-slow);
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-logo {
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--sidebar-border);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-logo-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0; overflow: hidden;
}
.sidebar-logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-logo-name { font-size: 0.95rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-logo-sub  { font-size: 0.62rem; color: var(--sidebar-text); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 1px; }

.sidebar-nav { flex: 1; padding: 10px 0 16px; }
.nav-section {
  padding: 12px 20px 4px;
  font-size: 0.64rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.12em; color: rgba(168,206,206,0.4);
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; color: var(--sidebar-text);
  font-size: 0.84rem; font-weight: 500;
  border-left: 3px solid transparent;
  transition: all var(--t-fast); cursor: pointer;
  position: relative;
}
.nav-item:hover  { background: var(--sidebar-hover); color: #fff; border-left-color: rgba(255,255,255,0.2); }
.nav-item.active { background: var(--sidebar-active); color: #fff; border-left-color: var(--accent); }
.nav-item .icon  { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--accent); color: var(--secondary);
  font-size: 0.6rem; font-weight: 800; padding: 2px 6px;
  border-radius: var(--radius-full); min-width: 18px; text-align: center;
}
.sidebar-footer {
  padding: 14px 20px; border-top: 1px solid var(--sidebar-border);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.sidebar-user-name  { font-size: 0.82rem; font-weight: 600; color: #fff; }
.sidebar-user-role  { font-size: 0.68rem; color: var(--sidebar-text); }

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

/* TOPBAR */
.topbar {
  background: var(--white); 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: 14px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.page-title   { font-size: 1rem; font-weight: 700; color: var(--secondary); }
.breadcrumb   { font-size: 0.75rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.hamburger {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 7px 9px; cursor: pointer;
  color: var(--text-muted); font-size: 1rem; line-height: 1;
}

/* PAGE BODY */
.page-body { padding: 24px; flex: 1; }
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
}
.page-header-left h1 { font-size: 1.4rem; margin-bottom: 2px; }
.page-header-left p  { font-size: 0.85rem; color: var(--text-muted); }

/* SIDEBAR OVERLAY (mobile) */
.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.55); z-index: 199;
}

/* ── CARDS ── */
.card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title  { font-size: 0.95rem; font-weight: 700; color: var(--secondary); }
.card-body   { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); }

/* STAT CARDS */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 16px; }
.stat-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 18px 20px; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 14px;
  transition: transform var(--t-base), box-shadow var(--t-base);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 50px; height: 50px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; flex-shrink: 0;
}
.si-teal   { background: var(--primary-light); color: var(--primary); }
.si-navy   { background: var(--secondary-light); color: var(--secondary); }
.si-gold   { background: var(--accent-light); color: var(--accent); }
.si-green  { background: var(--success-light); color: var(--success); }
.si-red    { background: var(--danger-light); color: var(--danger); }
.si-purple { background: var(--purple-light); color: var(--purple); }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--secondary); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 3px; font-weight: 500; }
.stat-change { font-size: 0.72rem; margin-top: 4px; font-weight: 600; }
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); font-size: 0.875rem;
  font-weight: 600; border: none; cursor: pointer;
  transition: all var(--t-fast); text-decoration: none; white-space: nowrap;
  font-family: var(--font-ui); line-height: 1.4;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: var(--secondary-dark); color: #fff; }
.btn-accent    { background: var(--accent); color: var(--secondary); font-weight: 700; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-outline   { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-ghost     { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-whatsapp  { background: #25D366; color: #fff; }
.btn-whatsapp:hover { background: #1da851; }
.btn-sm  { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg  { padding: 13px 28px; font-size: 1rem; }
.btn-xl  { padding: 16px 36px; font-size: 1.05rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; border-radius: var(--radius); }
.btn-icon-sm { padding: 5px; width: 28px; height: 28px; font-size: 0.75rem; justify-content: center; border-radius: 6px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 0.75rem; font-weight: 700;
  color: var(--secondary); margin-bottom: 6px;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 10px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 0.9rem; color: var(--text); background: var(--white);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  outline: none; font-family: var(--font-ui);
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12,107,104,0.12); }
.form-control:disabled { background: var(--bg); cursor: not-allowed; opacity: 0.7; }
.form-control::placeholder { color: var(--text-light); }
select.form-control { cursor: pointer; 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='%23567070' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.74rem; color: var(--text-muted); margin-top: 5px; }
.form-error { font-size: 0.74rem; color: var(--danger); margin-top: 5px; }
.form-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.input-group { position: relative; }
.input-icon  { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.95rem; pointer-events: none; }
.input-group .form-control { padding-left: 36px; }
.input-suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }

/* ── TABLES ── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.855rem; }
.table th {
  background: var(--primary-light); color: var(--primary-dark);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 11px 16px; text-align: left;
  border-bottom: 2px solid var(--border); white-space: nowrap;
}
.table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  color: var(--text); vertical-align: middle;
}
.table tr:hover td { background: var(--primary-light); }
.table tr:last-child td { border-bottom: none; }
.table-striped tr:nth-child(even) td { background: var(--surface-2); }

/* ── BADGES ── */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: var(--radius-full); font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.badge-success  { background: var(--success-light); color: var(--success); }
.badge-danger   { background: var(--danger-light);  color: var(--danger); }
.badge-warning  { background: var(--warning-light); color: var(--warning); }
.badge-info     { background: var(--info-light);    color: var(--info); }
.badge-primary  { background: var(--primary-light); color: var(--primary); }
.badge-secondary{ background: var(--secondary-light);color:var(--secondary); }
.badge-purple   { background: var(--purple-light);  color: var(--purple); }
.badge-accent   { background: var(--accent-light);  color: var(--accent-dark); }

/* ── ALERTS ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius); font-size: 0.875rem;
  margin-bottom: 16px; border-left: 4px solid; display: flex;
  align-items: flex-start; gap: 10px; line-height: 1.5;
}
.alert-success { background: var(--success-light); border-color: var(--success); color: #166534; }
.alert-danger  { background: var(--danger-light);  border-color: var(--danger);  color: #991b1b; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #92400e; }
.alert-info    { background: var(--info-light);    border-color: var(--info);    color: #075985; }

/* ── AVATARS ── */
.avatar {
  border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.av-xs  { width: 24px; height: 24px; font-size: 0.6rem; }
.av-sm  { width: 32px; height: 32px; font-size: 0.75rem; }
.av-md  { width: 40px; height: 40px; font-size: 0.9rem; }
.av-lg  { width: 56px; height: 56px; font-size: 1.2rem; }
.av-xl  { width: 80px; height: 80px; font-size: 1.6rem; }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,61,61,0.55);
  z-index: 500; display: flex; align-items: center; justify-content: center;
  padding: 16px; opacity: 0; visibility: hidden;
  transition: opacity var(--t-slow), visibility var(--t-slow);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--white); border-radius: var(--radius-xl);
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.94) translateY(8px);
  transition: transform var(--t-slow);
}
.modal-overlay.open .modal { transform: scale(1) translateY(0); }
.modal-sm  { max-width: 380px; }
.modal-lg  { max-width: 680px; }
.modal-xl  { max-width: 860px; }
.modal-header { padding: 18px 24px 15px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body   { padding: 20px 24px; }
.modal-footer { padding: 15px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; background: var(--surface-2); border-radius: 0 0 var(--radius-xl) var(--radius-xl); }
.modal-close  { background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 1.3rem; padding: 2px; line-height: 1; transition: color var(--t-fast); }
.modal-close:hover { color: var(--danger); }

/* ── TABS ── */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
  padding: 10px 18px; font-size: 0.85rem; font-weight: 600;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; cursor: pointer; white-space: nowrap;
  transition: all var(--t-fast); background: none; border-top: none;
  border-left: none; border-right: none; font-family: var(--font-ui);
}
.tab:hover  { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── PROGRESS ── */
.progress { height: 8px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: var(--radius-full); transition: width 0.5s ease; }
.progress-bar.gold   { background: linear-gradient(90deg, var(--accent), var(--accent-dark)); }
.progress-bar.green  { background: linear-gradient(90deg, var(--success), #15803d); }
.progress-bar.danger { background: linear-gradient(90deg, var(--danger), #b91c1c); }

/* ── NOTIFICATIONS ── */
.notif-btn {
  position: relative; background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px; cursor: pointer;
  color: var(--text-muted); font-size: 1.05rem; transition: all var(--t-fast);
  line-height: 1;
}
.notif-btn:hover { background: var(--primary-light); color: var(--primary); }
.notif-dot {
  position: absolute; top: 5px; right: 5px;
  width: 8px; height: 8px; background: var(--danger);
  border-radius: 50%; border: 2px solid var(--white);
}

/* ── SEARCH ── */
.search-wrap { position: relative; }
.search-wrap input {
  padding: 8px 12px 8px 34px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 0.85rem; width: 220px;
  outline: none; transition: all var(--t-base); font-family: var(--font-ui);
  color: var(--text); background: var(--white);
}
.search-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(12,107,104,0.1); width: 280px; }
.search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.85rem; pointer-events: none; }

/* ── USER MENU ── */
.user-btn {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 10px; border-radius: var(--radius);
  border: 1px solid var(--border); transition: all var(--t-fast);
  background: var(--white);
}
.user-btn:hover { background: var(--primary-light); }
.user-btn-name { font-size: 0.82rem; font-weight: 600; color: var(--secondary); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 52px 24px; }
.empty-icon  { font-size: 2.8rem; margin-bottom: 14px; opacity: 0.35; }
.empty-state h3 { color: var(--text-muted); font-weight: 600; margin-bottom: 8px; font-size: 1rem; }
.empty-state p  { font-size: 0.85rem; color: var(--text-light); max-width: 280px; margin: 0 auto 16px; }

/* ── SPINNER ── */
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.75s linear infinite; }
.spinner-dark { border-color: var(--border); border-top-color: var(--primary); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST ── */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--secondary); color: #fff; padding: 12px 18px;
  border-radius: var(--radius); font-size: 0.875rem; box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px; max-width: 360px;
  animation: toastIn 0.3s ease; border-left: 4px solid var(--accent);
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ── MOBILE BOTTOM NAV ── */
.bottom-nav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid var(--border);
  z-index: 150; padding: 6px 0 max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}
.bottom-nav-inner { display: flex; justify-content: space-around; }
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 12px; color: var(--text-muted); font-size: 0.6rem; font-weight: 600;
  cursor: pointer; border-radius: var(--radius-sm); transition: color var(--t-fast);
  text-decoration: none; border: none; background: none; font-family: var(--font-ui);
}
.bnav-item .bnav-icon { font-size: 1.25rem; }
.bnav-item.active { color: var(--primary); }

/* ── UTILITIES ── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.justify-end     { justify-content: flex-end; }
.flex-wrap     { flex-wrap: wrap; }
.flex-1        { flex: 1; }
.gap-1         { gap: 4px; }
.gap-2         { gap: 8px; }
.gap-3         { gap: 12px; }
.gap-4         { gap: 16px; }
.gap-6         { gap: 24px; }
.grid-2        { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3        { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-4        { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.mt-1  { margin-top: 4px; }   .mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }  .mt-6  { margin-top: 24px; }
.mb-2  { margin-bottom: 8px; } .mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }.mb-8  { margin-bottom: 32px; }
.p-4   { padding: 16px; }      .p-6   { padding: 24px; }
.py-2  { padding-top: 8px; padding-bottom: 8px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-sm     { font-size: 0.85rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.1rem; }
.text-muted  { color: var(--text-muted); }
.text-primary{ color: var(--primary); }
.text-success{ color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning{ color: var(--warning); }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rounded    { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }
.hidden { display: none !important; }
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-mid); }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 260px; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .hamburger { display: flex; align-items: center; }
  .main-content { margin-left: 0; }
  .page-body { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .bottom-nav { display: block; }
  .main-content { padding-bottom: 70px; }
  .search-wrap input { width: 150px; }
  .search-wrap input:focus { width: 190px; }
  .page-header { flex-direction: column; }
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; position: fixed; bottom: 0; left: 0; right: 0; max-height: 90vh; }
  .modal-overlay { align-items: flex-end; }
}

@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .topbar { padding: 0 14px; }
}

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .bottom-nav, .btn, .modal-overlay { display: none !important; }
  .main-content { margin-left: 0; }
  body { background: white; }
}
