/* EduSuite design system. Light-first, premium SaaS. */

:root {
  --brand-50:  #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;
  --brand-800: #1e40af;
  --accent-500: #0ea5e9;

  --ink-900: #0f172a;
  --ink-800: #1e293b;
  --ink-700: #334155;
  --ink-600: #475569;
  --ink-500: #64748b;
  --ink-400: #94a3b8;
  --ink-300: #cbd5e1;
  --ink-200: #e2e8f0;
  --ink-100: #f1f5f9;
  --ink-50:  #f8fafc;
  --white: #ffffff;

  --success-50: #ecfdf5; --success-200:#a7f3d0; --success-600: #059669; --success-700: #047857;
  --warning-50: #fffbeb; --warning-200:#fde68a; --warning-600: #d97706; --warning-700: #b45309;
  --danger-50:  #fef2f2; --danger-200: #fecaca; --danger-600:  #dc2626; --danger-700:  #b91c1c;
  --info-50:    #eff6ff; --info-200:   #bfdbfe; --info-600:    #2563eb;

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, .08), 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 4px 12px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .12), 0 4px 8px rgba(15, 23, 42, .05);
  --shadow-xl: 0 24px 56px rgba(15, 23, 42, .16);

  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px; --space-12: 48px;

  --font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  --sidebar-w: 264px;
  --topbar-h: 64px;

  --ring: 0 0 0 3px var(--brand-100);
  --transition: 150ms cubic-bezier(.4, 0, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-700);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 { margin: 0; color: var(--ink-900); font-weight: 650; letter-spacing: -.01em; line-height: 1.3; }
h1 { font-size: 24px; letter-spacing: -.02em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p  { margin: 0 0 var(--space-3); }
a  { color: var(--brand-600); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-700); text-decoration: underline; }
small { font-size: 12px; }
hr { border: 0; border-top: 1px solid var(--ink-200); margin: var(--space-6) 0; }
code, kbd, pre { font-family: var(--font-mono); font-size: .92em; }

:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; border-radius: var(--radius-xs); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: -9999px; top: 8px; z-index: 200;
  background: var(--white); color: var(--brand-700); padding: 10px 16px;
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-weight: 600;
}
.skip-link:focus { left: 12px; }

/* ---------- App shell ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--ink-200);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  transition: transform var(--transition);
}

.sidebar__brand {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-5); height: var(--topbar-h);
  border-bottom: 1px solid var(--ink-200); flex: 0 0 auto;
}
.sidebar__logo {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; letter-spacing: -.02em; flex: 0 0 auto;
  object-fit: cover; overflow: hidden;
}
.sidebar__name { font-weight: 650; color: var(--ink-900); font-size: 14px; line-height: 1.25; }
.sidebar__meta { font-size: 11px; color: var(--ink-500); text-transform: uppercase; letter-spacing: .04em; }

.sidebar__nav { flex: 1 1 auto; overflow-y: auto; padding: var(--space-4) var(--space-3) var(--space-8); }
.nav-group { margin-bottom: var(--space-5); }
.nav-group__label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-400); padding: 0 var(--space-3); margin-bottom: var(--space-2);
}
.nav-link {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 9px var(--space-3); border-radius: var(--radius-sm);
  color: var(--ink-600); font-weight: 500; font-size: 13.5px;
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: var(--ink-100); color: var(--ink-900); text-decoration: none; }
.nav-link.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.nav-link.is-active .nav-link__icon { color: var(--brand-600); }
.nav-link__icon { width: 18px; height: 18px; flex: 0 0 18px; color: var(--ink-400); }
.nav-link__badge {
  margin-left: auto; background: var(--danger-600); color: #fff;
  border-radius: var(--radius-full); font-size: 11px; font-weight: 600; padding: 1px 7px;
}

.sidebar__footer { flex: 0 0 auto; padding: var(--space-3); border-top: 1px solid var(--ink-200); }

.main { flex: 1 1 auto; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h); flex: 0 0 var(--topbar-h);
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; gap: var(--space-4);
  padding: 0 var(--space-6); position: sticky; top: 0; z-index: 50;
}
.topbar__title { font-size: 15px; font-weight: 650; color: var(--ink-900); }
.topbar__spacer { flex: 1 1 auto; }
.topbar__actions { display: flex; align-items: center; gap: var(--space-2); }

.menu-toggle { display: none; }

.content { padding: var(--space-6); flex: 1 1 auto; max-width: 1440px; width: 100%; }
.content--narrow { max-width: 860px; }

.page-head {
  display: flex; align-items: flex-start; gap: var(--space-4);
  flex-wrap: wrap; margin-bottom: var(--space-6);
}
.page-head__text { flex: 1 1 320px; min-width: 0; }
.page-head__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.page-subtitle { color: var(--ink-500); font-size: 13.5px; margin: var(--space-1) 0 0; }

.breadcrumb { display: flex; gap: var(--space-2); align-items: center; font-size: 12.5px; color: var(--ink-500); margin-bottom: var(--space-2); }
.breadcrumb a { color: var(--ink-500); }
.breadcrumb a:hover { color: var(--brand-600); }
.breadcrumb__sep { color: var(--ink-300); }

/* ---------- Cards & surfaces ---------- */

.card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
}
.card__head {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--ink-200);
  display: flex; align-items: center; gap: var(--space-4); flex-wrap: wrap;
}
.card__head h2, .card__head h3 { flex: 1 1 auto; }
.card__body { padding: var(--space-6); }
.card__body--flush { padding: 0; }
.card__foot {
  padding: var(--space-4) var(--space-6); border-top: 1px solid var(--ink-200);
  background: var(--ink-50); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap;
}
/* A card whose action cannot be undone. The tint is the warning, so the button
   is not the only thing distinguishing it from an ordinary panel. */
.card--danger { border-color: var(--danger-200); }
.card--danger .card__head { border-bottom-color: var(--danger-200); }
.card--danger .card__foot { background: var(--danger-50); border-top-color: var(--danger-200); }

.grid { display: grid; gap: var(--space-5); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: var(--space-5); }
.row { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }

/* ---------- Stats ---------- */

.stat {
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg); padding: var(--space-5);
  box-shadow: var(--shadow-xs); transition: box-shadow var(--transition), transform var(--transition);
}
.stat:hover { box-shadow: var(--shadow); }
.stat__label { font-size: 12.5px; color: var(--ink-500); font-weight: 500; display: flex; align-items: center; gap: var(--space-2); }
.stat__value { font-size: 28px; font-weight: 680; color: var(--ink-900); letter-spacing: -.02em; margin-top: var(--space-2); line-height: 1.1; }
.stat__meta { font-size: 12px; color: var(--ink-500); margin-top: var(--space-2); }
.stat__icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600);
  float: right; margin: -2px 0 0 var(--space-3);
}
.stat__icon--success { background: var(--success-50); color: var(--success-600); }
.stat__icon--warning { background: var(--warning-50); color: var(--warning-700); }
.stat__icon--danger  { background: var(--danger-50);  color: var(--danger-600); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--brand-600); color: #fff;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background var(--transition), box-shadow var(--transition), border-color var(--transition), color var(--transition);
}
.btn:hover { background: var(--brand-700); text-decoration: none; color: #fff; }
.btn:focus-visible { box-shadow: var(--ring); }
.btn:disabled, .btn.is-disabled { opacity: .55; cursor: not-allowed; }

.btn--secondary { background: var(--white); color: var(--ink-700); border-color: var(--ink-300); }
.btn--secondary:hover { background: var(--ink-50); color: var(--ink-900); border-color: var(--ink-400); }
.btn--ghost { background: transparent; color: var(--ink-600); }
.btn--ghost:hover { background: var(--ink-100); color: var(--ink-900); }
.btn--danger { background: var(--danger-600); }
.btn--danger:hover { background: var(--danger-700); color: #fff; }
.btn--danger-soft { background: var(--danger-50); color: var(--danger-700); border-color: var(--danger-200); }
.btn--danger-soft:hover { background: #fee2e2; color: var(--danger-700); }
.btn--success { background: var(--success-600); }
.btn--success:hover { background: var(--success-700); color: #fff; }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--lg { padding: 12px 22px; font-size: 15px; }
.btn--block { width: 100%; }
.btn--icon { padding: 7px; }
.btn__icon { width: 16px; height: 16px; }

.btn-group { display: inline-flex; gap: var(--space-2); }

/* ---------- Forms ---------- */

.form-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--full { grid-column: 1 / -1; }
/* Used across the fee, exam, library and HR forms: a field that spans the grid,
   and the row of buttons that ends one. */
.field--wide { grid-column: 1 / -1; }
.field--actions {
  grid-column: 1 / -1; flex-direction: row; align-items: center;
  gap: var(--space-3); flex-wrap: wrap; padding-top: var(--space-2);
  border-top: 1px solid var(--ink-200);
}

.label { font-size: 13px; font-weight: 600; color: var(--ink-800); display: flex; align-items: center; gap: 6px; }
.label__req { color: var(--danger-600); }
.hint { font-size: 12px; color: var(--ink-500); }

.input, .select, .textarea {
  width: 100%; padding: 9px 12px; font: inherit; font-size: 14px;
  color: var(--ink-900); background: var(--white);
  border: 1px solid var(--ink-300); border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-400); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-400); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: var(--ring); }
.input:disabled, .select:disabled, .textarea:disabled, .input[readonly] {
  background: var(--ink-100); color: var(--ink-500); cursor: not-allowed; border-color: var(--ink-200);
}
.textarea { min-height: 96px; resize: vertical; }
.select {
  appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748b'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 11.17l3.71-3.94a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}

.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--danger-600); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px var(--danger-200); }
.field__error { font-size: 12px; color: var(--danger-700); font-weight: 500; }

.input-group { display: flex; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group__addon {
  display: inline-flex; align-items: center; padding: 0 12px;
  background: var(--ink-100); border: 1px solid var(--ink-300); border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--ink-600); font-size: 13px; white-space: nowrap;
}

.check { display: flex; align-items: flex-start; gap: var(--space-3); cursor: pointer; font-size: 13.5px; }
.check input[type="checkbox"], .check input[type="radio"] {
  width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--brand-600); cursor: pointer; flex: 0 0 auto;
}
.check__text strong { display: block; color: var(--ink-800); font-weight: 600; }
.check__text span { color: var(--ink-500); font-size: 12.5px; }

.switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 40px; height: 22px; border-radius: var(--radius-full); background: var(--ink-300);
  position: relative; transition: background var(--transition); flex: 0 0 auto;
}
.switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: var(--shadow-xs); transition: transform var(--transition);
}
.switch input:checked + .switch__track { background: var(--brand-600); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-size: 13px; font-weight: 650; color: var(--ink-800); margin-bottom: var(--space-2); }

.locked-field {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--ink-100); border: 1px dashed var(--ink-300); border-radius: var(--radius-sm);
  padding: 9px 12px; color: var(--ink-600); font-size: 14px;
}
.locked-field__icon { width: 15px; height: 15px; color: var(--ink-400); flex: 0 0 auto; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-500);
  padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--ink-200);
  background: var(--ink-50); white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table td { padding: var(--space-4); border-bottom: 1px solid var(--ink-100); vertical-align: middle; color: var(--ink-700); }
.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: var(--ink-50); }
.table tbody tr:last-child td { border-bottom: 0; }
.table td.is-numeric, .table th.is-numeric { text-align: right; font-variant-numeric: tabular-nums; }
.table td.is-actions { text-align: right; white-space: nowrap; }
.table__primary { font-weight: 600; color: var(--ink-900); }
.table__muted { color: var(--ink-500); font-size: 12.5px; }

.person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.avatar {
  width: 34px; height: 34px; border-radius: var(--radius-full); flex: 0 0 34px;
  background: var(--brand-100); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 650; font-size: 12.5px; overflow: hidden;
}
.avatar--lg { width: 56px; height: 56px; flex-basis: 56px; font-size: 18px; }
.avatar--sm { width: 26px; height: 26px; flex-basis: 26px; font-size: 11px; }
.person__text { min-width: 0; }
.person__name { font-weight: 600; color: var(--ink-900); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__meta { font-size: 12px; color: var(--ink-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Badges & pills ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: var(--radius-full);
  font-size: 11.5px; font-weight: 600; line-height: 1.7;
  background: var(--ink-100); color: var(--ink-700); white-space: nowrap;
}
.badge--success { background: var(--success-50); color: var(--success-700); }
.badge--warning { background: var(--warning-50); color: var(--warning-700); }
.badge--danger  { background: var(--danger-50);  color: var(--danger-700); }
.badge--info    { background: var(--info-50);    color: var(--info-600); }
.badge--brand   { background: var(--brand-50);   color: var(--brand-700); }
.badge--outline { background: transparent; border: 1px solid var(--ink-300); color: var(--ink-600); }
.badge--muted   { background: var(--ink-100);    color: var(--ink-600); }
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-full);
  background: var(--ink-100); color: var(--ink-700); font-size: 12px; font-weight: 500;
}

/* ---------- Alerts & toasts ---------- */

.alert {
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-4); border-radius: var(--radius);
  border: 1px solid var(--ink-200); background: var(--white);
  font-size: 13.5px; margin-bottom: var(--space-5);
}
.alert__icon { width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; }
.alert__body { flex: 1 1 auto; min-width: 0; }
.alert__title { font-weight: 650; color: var(--ink-900); margin-bottom: 2px; }
.alert--success { background: var(--success-50); border-color: var(--success-200); color: var(--success-700); }
.alert--warning { background: var(--warning-50); border-color: var(--warning-200); color: var(--warning-700); }
.alert--danger  { background: var(--danger-50);  border-color: var(--danger-200);  color: var(--danger-700); }
.alert--info    { background: var(--info-50);    border-color: var(--info-200);    color: var(--info-600); }
.alert--success .alert__title, .alert--warning .alert__title,
.alert--danger .alert__title, .alert--info .alert__title { color: inherit; }

.toast-host {
  position: fixed; top: 16px; right: 16px; z-index: 300;
  display: flex; flex-direction: column; gap: var(--space-2); max-width: min(380px, calc(100vw - 32px));
}
.toast {
  display: flex; gap: var(--space-3); align-items: flex-start;
  background: var(--white); border: 1px solid var(--ink-200); border-left: 3px solid var(--brand-600);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: var(--space-4); font-size: 13.5px; animation: toast-in 220ms cubic-bezier(.2,.8,.2,1);
}
.toast--success { border-left-color: var(--success-600); }
.toast--danger  { border-left-color: var(--danger-600); }
.toast--warning { border-left-color: var(--warning-600); }
.toast__close { margin-left: auto; background: 0; border: 0; cursor: pointer; color: var(--ink-400); padding: 0; font-size: 18px; line-height: 1; }

@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Empty & loading states ---------- */

.empty { text-align: center; padding: var(--space-12) var(--space-6); }
.empty__icon {
  width: 52px; height: 52px; margin: 0 auto var(--space-4);
  border-radius: var(--radius); background: var(--ink-100); color: var(--ink-400);
  display: grid; place-items: center;
}
.empty__title { font-size: 15px; font-weight: 650; color: var(--ink-800); margin-bottom: var(--space-2); }
.empty__text { color: var(--ink-500); max-width: 420px; margin: 0 auto var(--space-5); font-size: 13.5px; }

.skeleton {
  background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-200) 37%, var(--ink-100) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-xs);
}
.skeleton--text { height: 12px; margin-bottom: 8px; }
.skeleton--title { height: 20px; width: 40%; margin-bottom: 14px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Filters & pagination ---------- */

.filters {
  display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: flex-end;
  padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--ink-200); background: var(--white);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.filters .field { flex: 0 1 190px; }
.filters .field--search { flex: 1 1 260px; }

.search {
  position: relative;
}
.search .input { padding-left: 36px; }
.search__icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-400); pointer-events: none;
}

.pagination {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  padding: var(--space-4) var(--space-6); border-top: 1px solid var(--ink-200);
}
.pagination__info { color: var(--ink-500); font-size: 13px; flex: 1 1 auto; }
.pagination__links { display: flex; gap: 4px; }
.pagination__link {
  min-width: 34px; height: 34px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ink-200); border-radius: var(--radius-sm);
  color: var(--ink-600); font-size: 13px; font-weight: 500; background: var(--white);
}
.pagination__link:hover { background: var(--ink-50); text-decoration: none; color: var(--ink-900); }
.pagination__link.is-active { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination__link.is-disabled { opacity: .45; pointer-events: none; }

/* ---------- Tabs ---------- */

.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--ink-200); margin-bottom: var(--space-6); overflow-x: auto; }
.tab {
  padding: 10px var(--space-4); font-size: 13.5px; font-weight: 550; color: var(--ink-500);
  border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px;
}
.tab:hover { color: var(--ink-800); text-decoration: none; }
.tab.is-active { color: var(--brand-700); border-bottom-color: var(--brand-600); font-weight: 650; }

/* ---------- Dropdown ---------- */

.dropdown { position: relative; display: inline-block; }
.dropdown__menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; z-index: 80;
  background: var(--white); border: 1px solid var(--ink-200); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); padding: 6px; display: none;
}
.dropdown.is-open .dropdown__menu { display: block; }
.dropdown__item {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  padding: 8px 10px; border-radius: var(--radius-xs); border: 0; background: 0;
  font: inherit; font-size: 13.5px; color: var(--ink-700); text-align: left; cursor: pointer;
}
.dropdown__item:hover { background: var(--ink-100); color: var(--ink-900); text-decoration: none; }
.dropdown__item--danger { color: var(--danger-600); }
.dropdown__item--danger:hover { background: var(--danger-50); color: var(--danger-700); }
.dropdown__sep { height: 1px; background: var(--ink-200); margin: 6px 0; }
.dropdown__head { padding: 8px 10px; border-bottom: 1px solid var(--ink-200); margin-bottom: 6px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: var(--space-4);
  backdrop-filter: blur(2px);
}
.modal-backdrop.is-open { display: flex; }
.modal {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-xl);
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  animation: modal-in 180ms cubic-bezier(.2,.8,.2,1);
}
.modal--wide { max-width: 720px; }
.modal__head { padding: var(--space-5) var(--space-6); border-bottom: 1px solid var(--ink-200); }
.modal__body { padding: var(--space-6); }
.modal__foot { padding: var(--space-4) var(--space-6); border-top: 1px solid var(--ink-200); display: flex; gap: var(--space-3); justify-content: flex-end; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Auth screens ---------- */

.auth {
  min-height: 100vh; display: grid; grid-template-columns: 1fr;
  background:
    radial-gradient(1100px 520px at 12% -12%, var(--brand-50), transparent 62%),
    radial-gradient(900px 460px at 105% 108%, #e0f2fe, transparent 58%),
    var(--ink-50);
  padding: var(--space-6);
  place-items: center;
}
.auth__card {
  width: 100%; max-width: 428px;
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg);
  padding: var(--space-8);
}
.auth__brand { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); margin-bottom: var(--space-6); text-align: center; }
.auth__logo {
  width: 52px; height: 52px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--brand-600), var(--accent-500));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 19px;
  box-shadow: var(--shadow); overflow: hidden; object-fit: cover;
}
.auth__title { font-size: 21px; }
.auth__subtitle { color: var(--ink-500); font-size: 13.5px; margin: 0; }
.auth__form { display: flex; flex-direction: column; gap: var(--space-4); }
.auth__foot { margin-top: var(--space-6); text-align: center; font-size: 13px; color: var(--ink-500); }
.auth__divider {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--ink-400); font-size: 12px; margin: var(--space-5) 0;
}
.auth__divider::before, .auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--ink-200); }

.institution-card {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4); border: 1px solid var(--ink-200); border-radius: var(--radius);
  background: var(--ink-50); margin-bottom: var(--space-5);
}
.institution-card__logo {
  width: 42px; height: 42px; border-radius: var(--radius-sm); flex: 0 0 42px;
  background: var(--brand-100); color: var(--brand-700);
  display: grid; place-items: center; font-weight: 700; overflow: hidden;
}
.institution-card__name { font-weight: 650; color: var(--ink-900); }
.institution-card__meta { font-size: 12.5px; color: var(--ink-500); }

.password-field { position: relative; }
.password-field .input { padding-right: 44px; }
.password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: 0; border: 0; cursor: pointer; color: var(--ink-400);
  padding: 6px; border-radius: var(--radius-xs); line-height: 0;
}
.password-toggle:hover { color: var(--ink-700); background: var(--ink-100); }

.copy-field {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--ink-900); color: #e2e8f0; border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: var(--font-mono); font-size: 13px; word-break: break-all;
}
.copy-field button { margin-left: auto; background: rgba(255,255,255,.12); border: 0; color: #fff; cursor: pointer; padding: 4px 10px; border-radius: var(--radius-xs); font-size: 12px; font-family: var(--font); }
.copy-field button:hover { background: rgba(255,255,255,.22); }

/* ---------- Permission matrix ---------- */

.perm-module {
  border: 1px solid var(--ink-200); border-radius: var(--radius); margin-bottom: var(--space-3); overflow: hidden;
}
.perm-module__head {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); background: var(--ink-50); border-bottom: 1px solid var(--ink-200);
}
.perm-module__title { font-weight: 650; color: var(--ink-800); font-size: 13.5px; flex: 1 1 auto; }
.perm-module__body { padding: var(--space-4); display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* ---------- Audit trail ---------- */

.audit-row { border-bottom: 1px solid var(--ink-100); padding: var(--space-4) var(--space-6); }
.audit-row:last-child { border-bottom: 0; }
.audit-row__head { display: flex; gap: var(--space-3); align-items: baseline; flex-wrap: wrap; }
.audit-row__action { font-weight: 650; color: var(--ink-900); font-size: 13.5px; }
.audit-row__desc { color: var(--ink-700); font-size: 13.5px; margin-top: 4px; }
.audit-row__meta {
  display: flex; gap: var(--space-4); flex-wrap: wrap;
  color: var(--ink-500); font-size: 12px; margin-top: var(--space-2);
}
.audit-row__meta span { display: inline-flex; align-items: center; gap: 5px; }
.audit-diff {
  margin-top: var(--space-3); background: var(--ink-50); border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm); padding: var(--space-3); font-size: 12.5px; overflow-x: auto;
}
.audit-diff table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 12px; }
.audit-diff td { padding: 3px 8px; vertical-align: top; }
.audit-diff .k { color: var(--ink-500); white-space: nowrap; }
.audit-diff .old { color: var(--danger-700); text-decoration: line-through; }
.audit-diff .new { color: var(--success-700); }

.mono { font-family: var(--font-mono); font-size: 12.5px; }
.text-muted { color: var(--ink-500); }
.text-danger { color: var(--danger-700); }
.text-success { color: var(--success-700); }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); } .mt-5 { margin-top: var(--space-5); } .mt-6 { margin-top: var(--space-6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--space-2); } .mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); } .mb-5 { margin-bottom: var(--space-5); } .mb-6 { margin-bottom: var(--space-6); }

/* ---------- Platform console accent ---------- */

.platform .sidebar { background: var(--ink-900); border-right-color: #1e293b; }
.platform .sidebar__brand { border-bottom-color: #1e293b; }
.platform .sidebar__name { color: #f8fafc; }
.platform .sidebar__meta { color: #64748b; }
.platform .sidebar__footer { border-top-color: #1e293b; }
.platform .nav-group__label { color: #475569; }
.platform .nav-link { color: #cbd5e1; }
.platform .nav-link:hover { background: #1e293b; color: #fff; }
.platform .nav-link.is-active { background: var(--brand-600); color: #fff; }
.platform .nav-link.is-active .nav-link__icon { color: #fff; }
.platform .nav-link__icon { color: #64748b; }
.platform .sidebar__logo { background: linear-gradient(135deg, #6366f1, #0ea5e9); }

.support-banner {
  background: var(--warning-600); color: #fff; padding: 8px var(--space-6);
  font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: var(--space-3);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-xl); }
  .sidebar.is-open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 55; display: none; }
  .sidebar-backdrop.is-open { display: block; }
}

@media (max-width: 640px) {
  .content { padding: var(--space-4); }
  .card__head, .card__body, .filters, .pagination { padding-left: var(--space-4); padding-right: var(--space-4); }
  .auth__card { padding: var(--space-6); }
  .page-head { margin-bottom: var(--space-5); }
  h1 { font-size: 21px; }
  .stat__value { font-size: 24px; }
  .table th, .table td { padding: var(--space-3); }
  .topbar { padding: 0 var(--space-4); }
}

@media print {
  .sidebar, .topbar, .page-head__actions, .pagination, .filters { display: none !important; }
  .main { margin-left: 0; }
  .card { border: 1px solid #ddd; box-shadow: none; }
  body { background: #fff; }
}

/* ---------- Sidebar account menu ---------- */

.user-menu {
  width: 100%;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}
.user-menu__text { min-width: 0; text-align: left; flex: 1 1 auto; }
.user-menu__name {
  display: block; font-weight: 600; color: var(--ink-900); font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-menu__role { display: block; font-size: 11.5px; color: var(--ink-500); }
.platform .user-menu__name { color: #f1f5f9; }
.platform .user-menu__role { color: #64748b; }
.platform .dropdown__menu { background: var(--white); }

.dropdown__menu--up { left: 0; right: 0; bottom: calc(100% + 6px); top: auto; }
.dropdown__name { font-weight: 600; color: var(--ink-900); font-size: 13px; }
.dropdown__email { font-size: 11.5px; color: var(--ink-500); word-break: break-all; }

.field-full { grid-column: 1 / -1; }
.w-full { width: 100%; }
.flex-1 { flex: 1 1 auto; }
.gap-2 { gap: var(--space-2); }
.hidden { display: none; }
.list-reset { list-style: none; margin: 0; padding: 0; }
.divide-y > * + * { border-top: 1px solid var(--ink-100); }
.detail-list { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: var(--space-3) var(--space-5); font-size: 13.5px; }
.detail-list dt { color: var(--ink-500); }
.detail-list dd { margin: 0; color: var(--ink-800); font-weight: 500; word-break: break-word; }
.bar { height: 6px; border-radius: var(--radius-full); background: var(--ink-200); overflow: hidden; }
.bar__fill { height: 100%; background: var(--brand-600); border-radius: var(--radius-full); }

/* A form that sits inside a table cell alongside other controls, and a
   disclosure that reveals one (used where an action needs a reason typed in
   before it will go through). */
.inline-form { display: inline-flex; gap: var(--space-2); align-items: center; vertical-align: middle; }
.inline-form + .inline-form, .inline-form + .inline-details { margin-left: var(--space-2); }

.inline-details { display: inline-block; vertical-align: middle; position: relative; }
.inline-details > summary { list-style: none; cursor: pointer; display: inline-flex; }
.inline-details > summary::-webkit-details-marker { display: none; }
.inline-details[open] > summary { background: var(--ink-100); color: var(--ink-900); }
.inline-details > form {
  position: absolute; right: 0; z-index: 20; margin-top: var(--space-2);
  display: flex; gap: var(--space-2); align-items: center;
  min-width: 260px; padding: var(--space-3);
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
}

/* Model output and prompts: preserve the line breaks the model wrote, wrap long
   lines rather than scrolling the page sideways. */
.pre-wrap {
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
  font: inherit; margin: 0; color: var(--ink-800); line-height: 1.65;
}

/* A photograph in place of initials. Cropped to the circle rather than squashed,
   so a portrait and a landscape shot both look deliberate. */
.avatar--photo { object-fit: cover; padding: 0; background: var(--ink-100); }

/* ---------- Timetable planner ----------
   A two-pane layout: the subjects to place on the left, the week on the right.
   The pane scrolls with the page on a phone and sticks beside the grid on a
   desktop, because on a laptop you want the palette in view while you work down
   the week, and on a phone you want the week to have the whole screen. */

.planner {
  display: grid; gap: var(--space-5);
  grid-template-columns: 1fr;
}
@media (min-width: 1100px) {
  .planner { grid-template-columns: 300px minmax(0, 1fr); align-items: start; }
  .planner__palette { position: sticky; top: calc(var(--topbar-h) + var(--space-4)); }
}

.planner__palette {
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs);
  padding: var(--space-4); max-height: calc(100vh - var(--topbar-h) - var(--space-8));
  overflow-y: auto;
}
.planner__palette h2 { font-size: 14px; margin: 0 0 var(--space-1); }
.planner__hint { font-size: 12px; color: var(--ink-500); margin: 0 0 var(--space-4); line-height: 1.5; }

/* A subject to place. Draggable, but also a real button so it can be reached
   with a keyboard — the planner must not need a mouse. */
.planner__card {
  display: flex; align-items: center; gap: var(--space-3); width: 100%;
  text-align: left; cursor: grab; font: inherit;
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius); padding: 10px var(--space-3);
  margin-bottom: var(--space-2); transition: var(--transition);
}
.planner__card:hover { border-color: var(--brand-300); box-shadow: var(--shadow-sm); }
.planner__card:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--brand-500); }
.planner__card.is-picked {
  border-color: var(--brand-500); background: var(--brand-50); box-shadow: var(--ring);
}
.planner__card:active { cursor: grabbing; }

.planner__swatch {
  width: 10px; height: 34px; border-radius: var(--radius-full);
  background: var(--brand-400); flex-shrink: 0;
}
.planner__card-body { min-width: 0; flex: 1; }
.planner__card-name {
  font-weight: 600; font-size: 13.5px; color: var(--ink-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.planner__card-meta {
  font-size: 11.5px; color: var(--ink-500);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Placed-versus-wanted. A subject that needs five periods a week and has two
   should say so while the grid is being built, not at the end. */
.planner__count {
  font-size: 11px; font-weight: 700; color: var(--ink-500);
  background: var(--ink-100); border-radius: var(--radius-full);
  padding: 2px 8px; flex-shrink: 0;
}
.planner__card.is-complete .planner__count { background: var(--success-50); color: #15803d; }
.planner__card.is-over-allocated .planner__count { background: var(--danger-50); color: #b91c1c; }

/* ---- the week ---- */

.planner__grid-wrap {
  background: var(--white); border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-xs); overflow: hidden;
}
.planner__scroll { overflow-x: auto; }

.planner__grid { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 720px; }
.planner__grid th, .planner__grid td { border-bottom: 1px solid var(--ink-200); }
.planner__grid thead th {
  background: var(--ink-50); font-size: 11.5px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink-500); font-weight: 700;
  padding: var(--space-3); text-align: left; position: sticky; top: 0; z-index: 1;
}
.planner__period {
  padding: var(--space-3); vertical-align: top; width: 130px;
  background: var(--ink-50); border-right: 1px solid var(--ink-200);
}
.planner__period-name { font-weight: 600; font-size: 13px; color: var(--ink-800); }
.planner__period-time { font-size: 11.5px; color: var(--ink-500); font-family: var(--font-mono); }

.planner__cell {
  padding: var(--space-2); vertical-align: top; height: 74px;
  border-right: 1px solid var(--ink-100); position: relative;
  transition: var(--transition); cursor: default;
}
.planner__cell:last-child { border-right: 0; }
.planner__cell[data-break="1"] { background: repeating-linear-gradient(
  45deg, var(--ink-50), var(--ink-50) 8px, var(--white) 8px, var(--white) 16px); }

/* While a subject is held: what is possible, and what is not. */
.planner__cell.is-open { background: var(--success-50); cursor: pointer; }
.planner__cell.is-over { background: var(--brand-100); box-shadow: inset 0 0 0 2px var(--brand-500); }
.planner__cell.is-blocked { background: var(--ink-100); cursor: not-allowed; opacity: .55; }
.planner__cell:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--brand-500); }

.planner__cell.is-filled { background: var(--white); }
.planner__cell.is-clash { background: var(--danger-50); box-shadow: inset 3px 0 0 #b91c1c; }
.planner__cell.is-saving { opacity: .5; }

.planner__subject { display: block; font-weight: 600; font-size: 13px; color: var(--ink-800); }
.planner__teacher { display: block; font-size: 11.5px; color: var(--ink-500); margin-top: 2px; }
.planner__empty { color: var(--ink-300); font-size: 13px; }

.planner__clear {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  border: 0; border-radius: var(--radius-full); background: transparent;
  color: var(--ink-400); font-size: 15px; line-height: 1; cursor: pointer;
  opacity: 0; transition: var(--transition);
}
.planner__cell:hover .planner__clear, .planner__clear:focus-visible { opacity: 1; }
.planner__clear:hover { background: var(--danger-50); color: #b91c1c; }

.planner__status {
  min-height: 20px; font-size: 12.5px; color: var(--ink-500);
  padding: var(--space-2) 0 0;
}
.planner__status.is-ok { color: #15803d; }
.planner__status.is-warn { color: #b45309; }
.planner__status.is-error { color: #b91c1c; }
.planner__status.is-info { color: var(--brand-700); }

/* ---------- Leave picker ----------
   Calendar on the left, the decision on the right. Two panes on a laptop, one
   column on a phone — where the calendar comes first, because on a phone the
   date is what you came to choose. */

.leave-picker { display: grid; gap: var(--space-5); grid-template-columns: 1fr; }
@media (min-width: 900px) { .leave-picker { grid-template-columns: minmax(0, 320px) minmax(0, 1fr); } }

.cal { border: 1px solid var(--ink-200); border-radius: var(--radius-lg); padding: var(--space-4); background: var(--white); }
.cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.cal__month { font-weight: 700; font-size: 14px; color: var(--ink-800); }
.cal__nav {
  width: 30px; height: 30px; border: 1px solid var(--ink-200); background: var(--white);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--ink-600);
  font-size: 15px; line-height: 1; transition: var(--transition);
}
.cal__nav:hover { background: var(--ink-50); border-color: var(--ink-300); }
.cal__nav:focus-visible { outline: none; box-shadow: var(--ring); }

.cal__weekdays, .cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal__weekdays span {
  text-align: center; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-400); padding-bottom: var(--space-2);
}

.cal__day {
  position: relative; aspect-ratio: 1; border: 0; background: transparent;
  border-radius: var(--radius-sm); font: inherit; font-size: 13px; color: var(--ink-700);
  cursor: pointer; transition: var(--transition);
}
.cal__day:hover { background: var(--ink-100); }
.cal__day:focus-visible { outline: none; box-shadow: var(--ring); }
.cal__day.is-outside { color: var(--ink-300); }
.cal__day.is-off { color: var(--ink-400); background: var(--ink-50); }
.cal__day.is-today { font-weight: 700; box-shadow: inset 0 0 0 1px var(--brand-400); }

.cal__day.is-in-range { background: var(--brand-50); color: var(--brand-800); }
.cal__day.is-in-range.is-off { background: var(--ink-100); color: var(--ink-400); text-decoration: line-through; }
.cal__day.is-start, .cal__day.is-end { background: var(--brand-600); color: var(--white); font-weight: 700; }
.cal__day.is-start.is-off, .cal__day.is-end.is-off { background: var(--brand-600); color: var(--white); text-decoration: none; }

/* A public holiday, marked so a range that crosses one is obvious. */
.cal__dot {
  position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 4px; border-radius: var(--radius-full); background: var(--accent-500);
}
.cal__day.is-start .cal__dot, .cal__day.is-end .cal__dot { background: var(--white); }

.cal__legend { display: flex; gap: var(--space-4); margin-top: var(--space-3); font-size: 11.5px; color: var(--ink-500); }
.cal__legend span { display: flex; align-items: center; gap: 5px; }
.cal__key { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---- balances ---- */

.leave-balance {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: 10px var(--space-3); border: 1px solid var(--ink-200);
  border-radius: var(--radius); margin-bottom: var(--space-2); background: var(--white);
}
.leave-balance__name { font-weight: 600; font-size: 13px; color: var(--ink-800); }
.leave-balance__meta { font-size: 11.5px; color: var(--ink-500); }
.leave-balance__left { font-size: 18px; font-weight: 700; color: var(--ink-900); line-height: 1; }
.leave-balance__unit { font-size: 11px; color: var(--ink-400); }
.leave-balance .bar { margin-top: 6px; }

.leave-summary {
  border: 1px solid var(--ink-200); border-left: 3px solid var(--brand-500);
  border-radius: var(--radius); padding: var(--space-3); background: var(--brand-50);
  font-size: 13px; line-height: 1.7; color: var(--ink-700); margin-bottom: var(--space-4);
}
.leave-summary__hint { color: var(--ink-500); }
.leave-summary__muted { color: var(--ink-500); font-size: 12px; }
.leave-summary__ok { color: #15803d; font-weight: 600; }
.leave-summary__over { color: #b91c1c; font-weight: 600; }

/* Bar tones, so a balance that is nearly gone looks like it. */
.bar__fill--brand { background: var(--brand-500); }
.bar__fill--warning { background: #f59e0b; }
.bar__fill--danger { background: #ef4444; }
