:root {
  --ink: #111827;
  --ink-muted: #6B7280;
  --line: #E5E7EB;
  --off-white: #FAFAFA;
  --danger: #DC2626;

  /* Categorical palette — distinct hues, independent of the accent */
  --cat-msa: #2563EB;
  --cat-clinical: #DB2777;
  --cat-courses: #D97706;
  --cat-ergotrax: #059669;
  --cat-home: #7C3AED;

  --bg: var(--off-white);
  --surface: #FFFFFF;
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --border: var(--line);
  --accent: #059669;
  --accent-contrast: #FFFFFF;
  --accent-tint: rgba(5, 150, 105, 0.12);

  --font-display: 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'Cascadia Code', monospace;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;
}

:root[data-theme="dark"] {
  --bg: #0B0C0C;
  --surface: #18191A;
  --text: #F5F5F5;
  --text-muted: #9CA3AF;
  --border: #2A2B2C;
  --accent: #10B981;
  --accent-contrast: #0B0C0C;
  --accent-tint: rgba(16, 185, 129, 0.16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition: background .2s ease, color .2s ease;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Login ---------- */
.login-screen {
  position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  padding: 24px; z-index: 100;
}
.login-card {
  background: var(--surface); color: var(--text); border-radius: var(--radius);
  padding: 32px 28px; width: 100%; max-width: 340px; text-align: center;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.08);
}
.login-logo { font-family: var(--font-display); font-weight: 800; font-size: 20px; margin-bottom: 6px; }
.login-sub { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.login-card input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  margin-bottom: 12px; font-size: 15px; background: var(--bg); color: var(--text);
}
.login-card button[type="submit"] {
  width: 100%; padding: 12px; border-radius: var(--radius-sm); border: none;
  background: var(--accent); color: var(--accent-contrast); font-weight: 700; font-size: 15px;
}
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* ---------- App shell ---------- */
.app { max-width: 720px; margin: 0 auto; padding-bottom: 90px; min-height: 100%; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 17px; letter-spacing: -0.2px; }
.topbar-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: var(--radius-pill); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.icon-btn.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }

.tabs {
  display: flex; gap: 4px; padding: 4px 16px 0; overflow-x: auto;
}
.tab {
  flex: 1; padding: 10px 8px; border: none; background: transparent; color: var(--text-muted);
  font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.filters { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: 6px 12px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600;
  white-space: nowrap; display: flex; align-items: center; gap: 6px; opacity: 0.55;
}
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; }
.chip-msa::before { background: var(--cat-msa); }
.chip-clinical::before { background: var(--cat-clinical); }
.chip-courses::before { background: var(--cat-courses); }
.chip-ergotrax::before { background: var(--cat-ergotrax); }
.chip-home::before { background: var(--cat-home); }
.chip.active { opacity: 1; color: var(--text); border-color: var(--text); }

main#views { padding: 4px 16px 24px; }
.view { display: none; }
.view.active { display: block; }
.view-azkar { margin: 4px -16px -24px; height: calc(100vh - 220px); min-height: 480px; }
.azkar-frame { width: 100%; height: 100%; border: 0; border-radius: 12px; }

/* ---------- Calendar ---------- */
.calendar-header { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.calendar-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.calendar-dow {
  display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  color: var(--text-muted); font-size: 11px; font-weight: 600; margin-bottom: 4px;
}
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1 / 1; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); padding: 4px; display: flex; flex-direction: column; gap: 3px;
  position: relative; overflow: hidden;
}
.cal-cell.out { opacity: 0.35; }
.cal-cell.today { border-color: var(--accent); border-width: 2px; }
.cal-cell.selected { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-daynum { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.cal-cell.today .cal-daynum { color: var(--accent); font-weight: 700; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; margin-top: auto; }
.cal-dot { width: 6px; height: 6px; border-radius: 50%; }

.day-panel {
  margin-top: 16px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.day-panel-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.day-panel-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; }

/* ---------- Event list / cards ---------- */
.event-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.event-card {
  display: flex; gap: 10px; align-items: flex-start; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px;
}
.event-stripe { width: 4px; align-self: stretch; border-radius: 2px; flex-shrink: 0; }
.event-body { flex: 1; min-width: 0; }
.event-title { font-weight: 700; font-size: 14.5px; }
.event-title.done { text-decoration: line-through; color: var(--text-muted); }
.event-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.event-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.event-cat { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.3px; }
.event-notes { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }
.event-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
  background: var(--accent-tint); color: var(--accent);
}
.event-actions { display: flex; gap: 4px; flex-shrink: 0; }
.event-actions button {
  border: none; background: transparent; color: var(--text-muted); font-size: 15px;
  width: 28px; height: 28px; border-radius: var(--radius-sm);
}
.event-actions button:hover { background: var(--bg); }
.someday-check {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border);
  flex-shrink: 0; margin-top: 2px; display: flex; align-items: center; justify-content: center;
  background: var(--surface);
}
.someday-check.checked { background: var(--accent); border-color: var(--accent); color: #fff; font-size: 12px; }
.hint { color: var(--text-muted); font-size: 13px; margin: 8px 0 0; }
.empty-state { color: var(--text-muted); font-size: 13.5px; text-align: center; padding: 32px 0; }

/* ---------- Settings ---------- */
.settings-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.settings-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.settings-form input, .settings-form select {
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14.5px; font-weight: 500;
}
.switch-row { flex-direction: row !important; align-items: center; justify-content: space-between; }
.switch-row input { width: 20px; height: 20px; }
.settings-actions { display: flex; gap: 10px; margin-top: 4px; }
.settings-status { font-size: 13px; color: var(--accent); min-height: 18px; }
.settings-divider { height: 1px; background: var(--border); margin: 24px 0; }
.backup-actions h3 { font-family: var(--font-display); font-size: 15px; margin: 0 0 10px; }
.backup-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.file-btn { display: inline-block; }

button.secondary {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px;
}
button.danger {
  background: transparent; border: 1px solid var(--danger); color: var(--danger);
  padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13.5px;
}
.settings-form button[type="submit"] {
  background: var(--accent); color: var(--accent-contrast); border: none;
  padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 700; font-size: 13.5px;
}

/* ---------- FAB ---------- */
.fab {
  position: fixed; bottom: 24px; right: 24px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast); border: none; font-size: 28px; font-weight: 400;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); z-index: 20;
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: flex-end;
  justify-content: center; z-index: 50;
}
.modal-sheet {
  background: var(--bg); width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
@media (min-width: 560px) {
  .modal-backdrop { align-items: center; }
  .modal-sheet { border-radius: var(--radius); max-height: 88vh; }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; }
.modal-header span { font-family: var(--font-display); font-weight: 700; font-size: 17px; }
.modal-sheet label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text-muted); }
.optional { font-weight: 400; text-transform: none; font-size: 11px; }
.modal-sheet input[type="text"],
.modal-sheet input[type="date"],
.modal-sheet input[type="time"],
.modal-sheet input[type="number"],
.modal-sheet select,
.modal-sheet textarea {
  padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14.5px; width: 100%;
}
.modal-sheet textarea { resize: vertical; }

.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: 8px 12px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 600;
}
.seg-btn.active { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.seg-days { gap: 4px; }
.seg-btn-sm { padding: 6px 0; width: 34px; text-align: center; }

.field-group { display: flex; flex-direction: column; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.inline-num { display: flex; align-items: center; gap: 8px; }
.inline-num input { width: 70px; }
.byday-row { display: flex; align-items: center; gap: 10px; }
.byday-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }

.modal-actions { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.modal-actions .spacer { flex: 1; }
.modal-actions button[type="submit"] {
  background: var(--accent); color: var(--accent-contrast); border: none;
  padding: 11px 20px; border-radius: var(--radius-sm); font-weight: 700; font-size: 14px;
}

@media (max-width: 380px) {
  .tab { font-size: 12px; padding: 10px 4px; }
  .brand-name { font-size: 15px; }
}

/* ---------- Finance Tab Styles ---------- */
.fin-view-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fin-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
}

/* KPI Row */
.fin-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 560px) {
  .fin-kpi-row {
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
  }
}

.fin-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fin-kpi-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-kpi-val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-kpi-val.fin-danger {
  color: var(--danger);
}

.fin-kpi-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Progress bar */
.fin-progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.fin-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

/* Badges */
.fin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  text-transform: capitalize;
}

.fin-badge-paid {
  background: var(--accent-tint);
  color: var(--accent);
}

.fin-badge-partial {
  background: rgba(217, 119, 6, 0.14);
  color: #D97706;
}

.fin-badge-overdue {
  background: rgba(220, 38, 38, 0.14);
  color: var(--danger);
}

.fin-badge-unpaid {
  background: rgba(107, 114, 128, 0.14);
  color: var(--text-muted);
}

.fin-badge-overpaid {
  background: var(--accent-tint);
  color: var(--accent);
}

.fin-badge-archived {
  background: rgba(107, 114, 128, 0.14);
  color: var(--text-muted);
  font-size: 10px;
}

/* Filters */
.fin-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.fin-filter-row select {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
}

.fin-filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-left: auto;
  cursor: pointer;
}

/* Hierarchy Tree */
.fin-uni-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fin-uni-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.fin-uni-header {
  padding: 12px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.fin-uni-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-uni-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}

.fin-uni-kpis {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}

.fin-uni-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fin-course-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fin-course-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  padding: 2px 0;
}

.fin-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  gap: 10px;
}

.fin-group-row:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.fin-group-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fin-group-name {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-group-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.fin-group-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.fin-group-numbers {
  font-size: 12.5px;
  font-family: var(--font-mono);
  font-weight: 600;
}

.fin-mini-bar {
  width: 70px;
}

/* Monthly Bar Chart */
.fin-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.fin-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.fin-chart-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14.5px;
}

.fin-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 90px;
  padding-bottom: 22px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.fin-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}

.fin-chart-bar-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.fin-chart-bar {
  width: 100%;
  max-width: 20px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease, background 0.15s ease;
  min-height: 2px;
}

.fin-chart-col:hover .fin-chart-bar {
  filter: brightness(1.15);
}

.fin-chart-lbl {
  position: absolute;
  bottom: -20px;
  font-size: 9.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* Needs attention / recent payments sections */
.fin-side-by-side {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 560px) {
  .fin-side-by-side {
    grid-template-columns: 1fr 1fr;
  }
}

.fin-panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.fin-panel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fin-attention-item, .fin-recent-pay-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  margin-bottom: 6px;
  cursor: pointer;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.fin-attention-item:hover, .fin-recent-pay-item:hover {
  border-color: var(--accent);
}

.fin-item-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fin-item-title {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-item-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.fin-item-side {
  text-align: right;
  flex-shrink: 0;
}

.fin-item-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
}

/* Groups View */
.fin-section-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fin-section-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
}

.fin-groups-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 560px) {
  .fin-groups-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.fin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.fin-card:hover {
  border-color: var(--accent);
}

.fin-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.fin-card-title {
  font-weight: 700;
  font-size: 14.5px;
}

.fin-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.fin-card-numbers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  font-family: var(--font-mono);
  margin-top: 4px;
}

/* Group Detail View */
.fin-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.fin-detail-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-detail-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
}

.fin-detail-actions {
  display: flex;
  gap: 6px;
}

/* Student Table / Cards */
.fin-student-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.fin-student-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease;
  gap: 10px;
}

.fin-student-row:hover {
  border-color: var(--accent);
}

.fin-student-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fin-student-name {
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fin-student-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.fin-student-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.fin-student-figures {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.fin-student-figures .fee {
  font-weight: 600;
}

.fin-student-figures .left {
  font-size: 11px;
  color: var(--text-muted);
}

/* Student Sheet Modal */
.fin-student-sheet {
  max-width: 540px;
  gap: 14px;
}

.fin-sheet-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fin-sheet-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.fin-sheet-kpi-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.fin-sheet-kpi-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
}

.fin-sheet-kpi-lbl {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.fin-sheet-kpi-val {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 14px;
}

.fin-sheet-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.fin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fin-section-header h4 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
}

.fin-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Installments List & Split Helper */
.fin-split-helper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.fin-input-xs {
  width: 50px !important;
  padding: 4px 6px !important;
  font-size: 13px !important;
}

.fin-input-sm {
  width: auto !important;
  padding: 4px 8px !important;
  font-size: 12.5px !important;
}

.fin-btn-sm {
  padding: 6px 12px !important;
  font-size: 12px !important;
}

.fin-installments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fin-installment-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-installment-row input[type="date"] {
  flex: 1;
}

.fin-installment-row input[type="number"] {
  width: 120px;
}

.fin-warning-banner {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: rgba(217, 119, 6, 0.12);
  color: #D97706;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

/* Payments List */
.fin-payments-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fin-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
}

.fin-payment-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.fin-payment-date {
  font-family: var(--font-mono);
  font-weight: 600;
}

.fin-payment-details {
  font-size: 11px;
  color: var(--text-muted);
}

.fin-payment-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-payment-amt {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 13.5px;
  color: var(--accent);
}

.fin-fast-payment-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
}

.fin-fast-pay-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.fin-fast-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fin-fast-pay-grid input {
  padding: 6px 10px !important;
  font-size: 13px !important;
}

.fin-fast-payment-box button {
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  align-self: flex-end;
}
