/* ============================================================
   INT — Interest Ledger Calculator
   assets/css/app.css  |  Inter font  |  3 switchable themes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* ── CSS Variables — Slate (default) ──────────────────── */
:root {
  --primary:        #334155;
  --primary-dark:   #1e293b;
  --primary-light:  #e2e8f0;
  --primary-text:   #1e293b;
  --accent:         #475569;

  --bg:             #f8fafc;
  --surface:        #ffffff;
  --surface-2:      #f1f5f9;
  --border:         #e2e8f0;
  --border-dark:    #cbd5e1;

  --text:           #0f172a;
  --text-2:         #475569;
  --text-3:         #94a3b8;

  --success:        #059669;
  --success-light:  #d1fae5;
  --success-text:   #065f46;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --danger-text:    #991b1b;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --warning-text:   #92400e;
  --info:           #2563eb;
  --info-light:     #dbeafe;
  --info-text:      #1d4ed8;

  /* Row colours for ledger statement */
  --row-disbursement:   #f0fdf4;
  --row-repayment:      #eff6ff;
  --row-capitalisation: #fafafa;
  --row-ratechange:     #fffbeb;
  --row-penal:          #fff1f2;
  --row-memo:           #ffffff;

  --sidebar-w:    220px;
  --topbar-h:     56px;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow:       0 1px 3px rgba(0,0,0,0.08);
  --font:         'Inter', system-ui, sans-serif;
}

/* ── Emerald theme ──────────────────────────────────────── */
[data-theme="emerald"] {
  --primary:       #059669;
  --primary-dark:  #047857;
  --primary-light: #d1fae5;
  --primary-text:  #065f46;
  --accent:        #10b981;
}

/* ── Teal theme ─────────────────────────────────────────── */
[data-theme="teal"] {
  --primary:       #0d9488;
  --primary-dark:  #0f766e;
  --primary-light: #ccfbf1;
  --primary-text:  #0f766e;
  --accent:        #14b8a6;
}

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

html { font-size: 15px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout — Desktop Shell ─────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-brand {
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}

.sidebar-brand-title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.04em;
}

.sidebar-brand-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.55);
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 10px 8px;
}

.sidebar-label {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 12px 8px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: rgba(255,255,255,0.72);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 1px;
}

.nav-item:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.nav-item.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 500;
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.85;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,0.12);
}

/* Theme switcher dots in sidebar */
.theme-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.theme-switcher-label {
  font-size: 9px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, transform 0.1s;
}

.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active { border-color: #fff; }
.theme-dot[data-t="slate"]   { background: #334155; }
.theme-dot[data-t="emerald"] { background: #059669; }
.theme-dot[data-t="teal"]    { background: #0d9488; }

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 9px;
  color: rgba(255,255,255,0.45);
}

.mobile-view-link {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  margin-bottom: 8px;
  padding: 4px 0;
}

.mobile-view-link:hover { color: rgba(255,255,255,0.8); text-decoration: none; }

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

/* ── Topbar ─────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.topbar-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-left: 8px;
  font-weight: 400;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

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

/* ── Cards ──────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-sm { padding: 14px 16px; }

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

/* ── Stat cards ─────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.2;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, opacity 0.15s, transform 0.1s;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }
.btn:hover  { text-decoration: none; }

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

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--border-dark);
}
.btn-outline:hover { background: var(--primary-light); color: var(--primary-text); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

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

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 5px;
}

.form-required::after { content: ' *'; color: var(--danger); }

.form-control {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
  line-height: 1.5;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(51,65,85,0.12);
}

.form-control::placeholder { color: var(--text-3); }

select.form-control { cursor: pointer; }

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.form-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

.form-error {
  font-size: 11px;
  color: var(--danger);
  margin-top: 4px;
}

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

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

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

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

thead th {
  background: var(--surface-2);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th.num { text-align: right; }

tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}

tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--surface-2); }

/* Statement row colour coding */
.row-disbursement td  { background: var(--row-disbursement); }
.row-repayment td     { background: var(--row-repayment); }
.row-capitalisation td { background: var(--row-capitalisation); color: var(--text-2); font-style: italic; }
.row-ratechange td    { background: var(--row-ratechange); }
.row-penal td         { background: var(--row-penal); }
.row-memo td          { color: var(--text-2); font-style: italic; }

/* ── Collapsible year/month rows ────────────────────────── */
.year-row td {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  padding: 8px 14px;
}

.month-row td {
  background: var(--primary-light);
  color: var(--primary-text);
  font-weight: 500;
  font-size: 11px;
  cursor: pointer;
  user-select: none;
  padding: 6px 14px;
}

.year-toggle, .month-toggle {
  display: inline-block;
  width: 14px;
  text-align: center;
  margin-right: 6px;
  transition: transform 0.2s;
}

.collapsed .year-toggle,
.collapsed .month-toggle { transform: rotate(-90deg); }

/* ── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-success  { background: var(--success-light); color: var(--success-text); }
.badge-danger   { background: var(--danger-light);  color: var(--danger-text); }
.badge-warning  { background: var(--warning-light); color: var(--warning-text); }
.badge-info     { background: var(--info-light);    color: var(--info-text); }
.badge-neutral  { background: var(--surface-2);     color: var(--text-2); }
.badge-primary  { background: var(--primary-light); color: var(--primary-text); }
.badge-locked   { background: #fef3c7; color: #92400e; }

/* ── Flash messages ─────────────────────────────────────── */
.flash {
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
  border-left: 4px solid;
}

.flash-success { background: var(--success-light); color: var(--success-text); border-color: var(--success); }
.flash-error   { background: var(--danger-light);  color: var(--danger-text);  border-color: var(--danger); }
.flash-warning { background: var(--warning-light); color: var(--warning-text); border-color: var(--warning); }
.flash-info    { background: var(--info-light);    color: var(--info-text);    border-color: var(--info); }

/* ── Search & filter bar ────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-wrap input {
  padding-left: 34px;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  width: 15px;
  height: 15px;
}

/* ── Party / client directory cards ─────────────────────── */
.party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.party-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
}

.party-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
}

.party-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.party-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.party-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.party-type {
  font-size: 11px;
  color: var(--text-3);
}

.party-ledger-count {
  font-size: 12px;
  color: var(--text-2);
}

.party-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* ── Ledger statement collapsible ───────────────────────── */
.stmt-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.stmt-total {
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 12px 14px;
}

.stmt-total-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.stmt-total-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* ── Audit log ──────────────────────────────────────────── */
.audit-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.audit-item {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.audit-item:last-child { border-bottom: none; }

.audit-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 4px;
}

.audit-who {
  font-weight: 600;
  color: var(--text);
}

.audit-what { color: var(--text-2); }
.audit-time { color: var(--text-3); margin-top: 2px; }

.audit-change {
  margin-top: 4px;
  background: var(--surface-2);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text-2);
}

.audit-old { color: var(--danger); text-decoration: line-through; margin-right: 6px; }
.audit-new { color: var(--success); }

/* ── Lock overlay ───────────────────────────────────────── */
.lock-overlay {
  text-align: center;
  padding: 60px 24px;
}

.lock-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.lock-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.lock-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}

.lock-form {
  max-width: 280px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-3);
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 6px;
}

.empty-sub { font-size: 13px; }

/* ── Pagination ─────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
}

.page-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-2);
  font-family: var(--font);
  transition: background 0.15s;
}

.page-btn:hover    { background: var(--surface-2); }
.page-btn.active   { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.modal-header {
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 0 4px;
}

.modal-body  { padding: 20px; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Login page ─────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.login-brand {
  text-align: center;
  margin-bottom: 28px;
}

.login-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--primary);
  border-radius: 12px;
  margin-bottom: 12px;
}

.login-brand-mark span {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.login-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
}

.login-sub {
  font-size: 12px;
  color: var(--text-3);
}

.login-dest-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

/* ── Mobile styles ──────────────────────────────────────── */
.mob-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  max-width: 480px;
  margin: 0 auto;
}

.mob-topbar {
  background: var(--primary);
  color: #fff;
  padding: 0 14px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.mob-topbar-title { font-size: 14px; font-weight: 600; }
.mob-topbar-page  { font-size: 11px; opacity: 0.7; }

.mob-desktop-link {
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 10px;
  border-radius: 20px;
}

.mob-content {
  flex: 1;
  padding: 14px;
  padding-bottom: 80px;
}

.mob-tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.mob-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 4px;
  font-size: 10px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.15s;
  border: none;
  background: none;
  cursor: pointer;
  font-family: var(--font);
}

.mob-tab:hover    { color: var(--primary); text-decoration: none; }
.mob-tab.active   { color: var(--primary); font-weight: 500; }

.mob-tab-icon { width: 22px; height: 22px; }

.mob-tab.hero {
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  margin: 6px 4px;
  padding: 6px 4px;
}

.mob-tab.hero:hover { color: #fff; opacity: 0.9; }

.mob-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 10px;
  overflow: hidden;
}

.mob-card-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mob-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s;
}

.mob-row:last-child { border-bottom: none; }
.mob-row:hover { background: var(--surface-2); text-decoration: none; color: inherit; }

.mob-row-title { font-size: 13px; font-weight: 500; color: var(--text); }
.mob-row-sub   { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.mob-row-right { margin-left: auto; text-align: right; }
.mob-row-val   { font-size: 13px; font-weight: 600; color: var(--primary); }
.mob-row-date  { font-size: 10px; color: var(--text-3); }

.mob-hero-strip {
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
}

.mob-hero-date { font-size: 11px; opacity: 0.7; margin-bottom: 4px; }
.mob-hero-val  { font-size: 24px; font-weight: 700; }
.mob-hero-label { font-size: 12px; opacity: 0.75; margin-top: 2px; }

.mob-qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.mob-qa-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s;
}

.mob-qa-card:hover { border-color: var(--primary); text-decoration: none; color: inherit; }
.mob-qa-icon { font-size: 20px; margin-bottom: 6px; }
.mob-qa-label { font-size: 12px; font-weight: 500; color: var(--text); }
.mob-qa-sub   { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* ── Utilities ──────────────────────────────────────────── */
.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-2); }
.text-small  { font-size: 12px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none; }
.w-full { width: 100%; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page { padding: 14px; }
}

@media print {
  .sidebar, .topbar, .btn, .filter-bar, .pagination { display: none !important; }
  .main { margin-left: 0; }
  .page { padding: 0; }
  .table-wrap { border: none; }
}
