:root {
  --primary: #125c63;
  --accent: #f0a202;
  --ink: #17202a;
  --muted: #667085;
  --line: #d9e2e7;
  --surface: #ffffff;
  --soft: #f4f8f9;
  --danger: #b42318;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--ink); background: var(--soft); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }
.hidden { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(145deg, #f7fbfb, #eef5ef); }
.login-panel { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 34px; box-shadow: 0 24px 80px rgba(18,92,99,.12); }
.brand-mark { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; background: var(--primary); color: #fff; font-weight: 800; overflow: hidden; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
h1, h2, h3, p { margin-top: 0; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 14px; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #fff; }
textarea { resize: vertical; }
.readonly-field { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; color: var(--ink); background: #f8fbfc; display: flex; align-items: center; font-weight: 700; }
.primary { background: var(--primary); color: #fff; border-radius: 8px; padding: 12px 16px; font-weight: 700; }
.ghost { background: #fff; color: var(--primary); border: 1px solid var(--line); border-radius: 8px; padding: 10px 13px; }
.danger-button { background: var(--danger); color: #fff; border-radius: 8px; padding: 12px 16px; font-weight: 800; }
.error { color: var(--danger); min-height: 18px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { background: #fbfdfd; border-right: 1px solid var(--line); padding: 22px; display: flex; flex-direction: column; gap: 22px; }
.sidebar-brand { display: flex; gap: 12px; align-items: center; }
.sidebar-brand span, #userBadge { display: block; color: var(--muted); font-size: 13px; }
nav { display: grid; gap: 6px; }
nav button { text-align: left; background: transparent; padding: 11px 12px; border-radius: 8px; color: var(--ink); }
nav button.active { background: color-mix(in srgb, var(--primary), white 88%); color: var(--primary); font-weight: 800; }
.workspace { min-width: 0; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.status-pill { background: #eef8f0; color: #067647; border: 1px solid #b7e3c1; padding: 8px 12px; border-radius: 999px; font-size: 13px; }
.tab { display: none; }
.tab.active { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 14px; }
.metric-grid article, .panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px; }
.metric-grid span { color: var(--muted); font-size: 13px; }
.metric-grid strong { display: block; font-size: 30px; margin-top: 8px; }
.grid-form { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: end; }
.grid-form label:first-child { grid-row: span 2; }
.withdrawal-form { grid-template-columns: 150px minmax(360px, 1fr) 180px 300px; align-items: end; }
.withdrawal-form label:first-child { grid-row: auto; }
.withdrawal-form label { min-width: 0; }
.withdrawal-form .readonly-field,
.withdrawal-form select,
.withdrawal-form button { min-height: 54px; }
.withdrawal-form .readonly-field { justify-content: center; padding-inline: 10px; font-size: 14px; }
.withdrawal-form .student-name-field input { min-height: 62px; font-size: 24px; font-weight: 800; }
.withdrawal-form .student-name-field input::placeholder { color: #98a2b3; font-weight: 600; }
.split { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
.split.active { display: grid; }
.danger { border-color: #fecaca; background: #fffafa; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; min-width: 640px; background: #fff; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
th { background: #f8fbfc; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; gap: 6px; }
.table-actions button { padding: 7px 9px; border-radius: 8px; background: #eef4f5; color: var(--primary); }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.check input { width: auto; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.logo-preview { max-width: 180px; max-height: 180px; margin-top: 18px; border-radius: 8px; border: 1px solid var(--line); }
#toast { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .metric-grid, .grid-form, .split.active { grid-template-columns: 1fr; }
  .withdrawal-form { grid-template-columns: 1fr; }
  .workspace { padding: 16px; }
}
