/* ===========================================================================
   Sevgi Pınarı ERP — the one style sheet of the application.

   HOW IT IS ORGANISED
     1. Design tokens   colours, sizes: change the look of everything from here
     2. Base            page, text, links
     3. Layout          menu (sidebar), top bar, content area
     4. Components      buttons, cards, tables, forms, badges, dialogs ...
     5. Screens         the few rules that belong to one screen only
     6. Helpers         small utility classes (.muted, .row, .stack ...)
     7. Print

   RULES
     - Phones first: every rule is written for a narrow screen, then widened
       with "@media (min-width: …)".
     - No style is written inside the HTML (the browser is told to refuse it,
       for security). Everything visual lives in this file.
     - A catalogue of all components, with the HTML to copy, is in
       docs/07-erp-design-guide.md.
   =========================================================================== */

/* ---------- 1. Design tokens ---------------------------------------------- */
:root {
    /* brand (taken from the academy logo) */
    --blue: #0f6e9e;
    --blue-dark: #0b5a82;
    --blue-soft: #e9f2f8;
    --blue-line: #cfe4f0;
    --olive: #8c9a12;
    --olive-soft: #f3f5e3;

    /* text and surfaces */
    --ink: #1f2933;
    --ink-soft: #52606d;
    --muted: #6b7680;
    --line: #e3e7eb;
    --line-strong: #cbd2d9;
    --page: #f5f7f9;
    --surface: #ffffff;
    --surface-soft: #f9fafb;

    /* meaning */
    --green: #1f8a5b;
    --green-soft: #e6f4ed;
    --amber: #b7791f;
    --amber-soft: #fdf3e0;
    --red: #c53a2d;
    --red-soft: #fbebe8;
    --violet: #6b4fbb;
    --violet-soft: #efebfa;

    /* shape */
    --radius: 12px;
    --radius-small: 8px;
    --shadow: 0 1px 2px rgba(16, 42, 67, .06), 0 4px 16px rgba(16, 42, 67, .06);
    --shadow-strong: 0 10px 40px rgba(16, 42, 67, .22);
    --focus: 0 0 0 3px rgba(15, 110, 158, .28);

    /* sizes */
    --sidebar: 264px;
    --topbar: 60px;
    --tap: 44px;            /* smallest comfortable touch target */

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

/* ---------- 2. Base --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar) + 12px); }
body {
    margin: 0;
    font: 16px/1.55 var(--font);
    color: var(--ink);
    background: var(--page);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
a { color: var(--blue-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--blue); }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
::selection { background: var(--blue-line); }

.skip-link {
    position: absolute; left: 12px; top: -60px; z-index: 100;
    background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-small);
}
.skip-link:focus { top: 12px; }

/* ---------- 3. Layout ------------------------------------------------------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: min(var(--sidebar), 86vw);
    display: flex; flex-direction: column;
    background: var(--surface); border-right: 1px solid var(--line);
    transform: translateX(-102%); transition: transform .22s ease;
    overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: env(safe-area-inset-bottom);
}
.sidebar.is-open { transform: none; box-shadow: var(--shadow-strong); }
.sidebar-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(16, 42, 67, .45); }
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 6px 18px; }
.brand img { display: block; width: 168px; height: auto; }
.nav { flex: 1; padding: 8px 10px 16px; }
.nav__group {
    margin: 16px 10px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted);
}
.nav__link {
    display: flex; align-items: center; gap: 11px; min-height: var(--tap);
    padding: 8px 10px; border-radius: var(--radius-small);
    color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 15px;
}
.nav__link:hover { background: var(--surface-soft); color: var(--ink); }
.nav__link.is-active { background: var(--blue-soft); color: var(--blue-dark); font-weight: 650; }
.nav__link .icon { flex: none; }
.nav__count {
    margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px;
    background: var(--amber); color: #fff; font-size: 12px; font-weight: 700; text-align: center;
}
.sidebar__user { border-top: 1px solid var(--line); padding: 14px 18px 16px; display: grid; gap: 2px; }
.sidebar__user-name { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user-role { color: var(--muted); font-size: 13.5px; margin-bottom: 8px; }

.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 30; height: var(--topbar);
    display: flex; align-items: center; gap: 10px; padding: 0 12px;
    background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px);
    border-bottom: 1px solid var(--line);
}
.topbar__title { font-size: 18px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 16px 12px 72px; outline: none; }

@media (min-width: 1024px) {
    .sidebar { transform: none; box-shadow: none; }
    .sidebar__close, .topbar__menu, .sidebar-backdrop { display: none !important; }
    .shell { margin-left: var(--sidebar); }
    .topbar { padding: 0 28px; }
    .topbar__title { font-size: 20px; }
    .main { padding: 24px 28px 80px; }
    .nav__link { min-height: 38px; padding: 6px 10px; }
    .nav__group { margin-top: 12px; }
}

/* Screens for people who are not signed in (sign-in page, error pages). */
.plain { min-height: 100vh; display: grid; place-items: start center; padding: 28px 14px 48px; }
.plain__box { width: 100%; max-width: 440px; display: grid; gap: 18px; }
.plain__logo { display: block; width: 230px; height: auto; margin: 0 auto; padding: 10px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); box-sizing: content-box; }
.plain__links { margin-top: 14px; text-align: center; font-size: 15px; }
.plain__foot { text-align: center; font-size: 13.5px; }
.error-code { font-size: 54px; font-weight: 750; color: var(--blue-line); line-height: 1; margin-bottom: 8px; }

/* ---------- 4. Components --------------------------------------------------- */

/* --- page head: title on the left, main action on the right --- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.page-head__text { flex: 1 1 260px; min-width: 0; }
.page-head__title { font-size: 20px; }
.page-head__hint { color: var(--muted); font-size: 14.5px; margin-top: 2px; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- buttons --- */
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 9px 16px; border-radius: var(--radius-small);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    font-weight: 600; font-size: 15px; line-height: 1.2; text-decoration: none; cursor: pointer;
    transition: background .12s, border-color .12s, color .12s; white-space: nowrap;
}
.button:hover { background: var(--surface-soft); color: var(--ink); border-color: var(--muted); }
.button--primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button--primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.button--danger { background: var(--red); border-color: var(--red); color: #fff; }
.button--danger:hover { background: #a82f24; border-color: #a82f24; color: #fff; }
.button--danger-ghost { color: var(--red); border-color: transparent; background: transparent; }
.button--danger-ghost:hover { background: var(--red-soft); color: var(--red); border-color: transparent; }
.button--ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
.button--ghost:hover { background: var(--line); border-color: transparent; }
.button--good { background: var(--green); border-color: var(--green); color: #fff; }
.button--good:hover { background: #17704a; border-color: #17704a; color: #fff; }
.button--small { min-height: 36px; padding: 6px 11px; font-size: 14px; }
.button--block { width: 100%; }
.button[disabled], .button.is-busy { opacity: .6; cursor: default; pointer-events: none; }
.icon-button {
    display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); flex: none;
    border: 0; border-radius: var(--radius-small); background: transparent; color: var(--ink-soft); cursor: pointer;
}
.icon-button:hover { background: var(--line); color: var(--ink); }
.icon { flex: none; }

/* --- cards --- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px;
}
.card--narrow { max-width: 440px; margin-left: auto; margin-right: auto; width: 100%; padding: 22px; }
.card--center { text-align: center; }
.card--flush { padding: 0; overflow: hidden; }
.card--tint { background: var(--blue-soft); border-color: var(--blue-line); box-shadow: none; }
.card--warn { background: var(--amber-soft); border-color: #f1ddb0; box-shadow: none; }
.card__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.card--flush > .card__head { padding: 14px 16px 0; }
.card__title { font-size: 17px; flex: 1; min-width: 0; }
.card__title + .muted { margin-top: 4px; }
.card > * + * { margin-top: 12px; }
.card > .card__head + * { margin-top: 0; }
@media (min-width: 768px) { .card { padding: 20px; } .card--flush { padding: 0; } .card--flush > .card__head { padding: 18px 20px 0; } }

/* --- number tiles --- */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; display: block; color: inherit; text-decoration: none;
}
a.stat:hover { border-color: var(--blue-line); color: inherit; }
.stat__label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat__value { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin-top: 2px; overflow-wrap: anywhere; }
.stat__hint { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat--good .stat__value { color: var(--green); }
.stat--warn .stat__value { color: var(--amber); }
.stat--bad .stat__value { color: var(--red); }
@media (min-width: 768px) { .stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; } .stat { padding: 16px 18px; } .stat__value { font-size: 26px; } }

/* three small figures side by side inside a card (total / paid / left) */
.figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.figure { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius-small); padding: 8px 10px; min-width: 0; }
.figure__label { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.figure__value { font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.figure__hint { color: var(--muted); font-size: 12.5px; }
.figure--good .figure__value { color: var(--green); } .figure--bad .figure__value { color: var(--red); } .figure--warn .figure__value { color: var(--amber); }
@media (min-width: 640px) { .figure { padding: 10px 14px; } .figure__value { font-size: 20px; } }

/* --- toolbar: search box and filters above a list --- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar__search { position: relative; flex: 1 1 220px; min-width: 0; }
.toolbar__search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.toolbar__search .input { padding-left: 40px; }
.toolbar .select { width: auto; flex: 0 1 auto; max-width: 100%; }
.toolbar__count { color: var(--muted); font-size: 14px; margin-left: auto; }

/* --- tables: a real table on wide screens, a list of cards on phones --- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th {
    text-align: left; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); background: var(--surface-soft); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-soft); }
.table .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table__main { font-weight: 600; color: var(--ink); text-decoration: none; }
a.table__main:hover { color: var(--blue); text-decoration: underline; }
a .icon, .button .icon { vertical-align: -4px; }
.table__sub { display: block; color: var(--muted); font-size: 13.5px; font-weight: 400; }
.table__actions { text-align: right; white-space: nowrap; }
.table__actions .button { margin-left: 4px; }
.table th a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.table th a:hover { color: var(--ink); }
.table th .sort { font-size: 10px; }
@media (max-width: 767px) {
    .table--cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .table--cards, .table--cards tbody, .table--cards tr, .table--cards td { display: block; width: 100%; }
    .table--cards tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
    .table--cards tr:last-child { border-bottom: 0; }
    .table--cards td { padding: 2px 0; border: 0; text-align: left; }
    .table--cards td[data-label] { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
    .table--cards td[data-label]::before { content: attr(data-label); color: var(--muted); flex: none; }
    .table--cards td.num { text-align: right; }
    .table--cards .table__actions { text-align: left; padding-top: 8px; }
    .table--cards .table__actions .button { margin: 0 6px 0 0; }
    .table--cards td:empty { display: none; }
}

/* --- badges (small coloured labels for a status) --- */
.badge {
    display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
    font-size: 12.5px; font-weight: 650; line-height: 1.5; white-space: nowrap;
    background: var(--line); color: var(--ink-soft);
}
.badge--ok { background: var(--green-soft); color: var(--green); }
.badge--warn { background: var(--amber-soft); color: var(--amber); }
.badge--bad { background: var(--red-soft); color: var(--red); }
.badge--info { background: var(--blue-soft); color: var(--blue-dark); }
.badge--violet { background: var(--violet-soft); color: var(--violet); }

/* --- forms --- */
.form { display: grid; gap: 14px; }
.form-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .field--wide { grid-column: 1 / -1; } }
.field { display: grid; gap: 5px; min-width: 0; }
.field__label { font-weight: 600; font-size: 14.5px; }
.field__label .req { color: var(--red); }
.field__hint { color: var(--muted); font-size: 13.5px; }
.field__error { color: var(--red); font-size: 13.5px; font-weight: 600; }
.input, .select, .textarea {
    width: 100%; min-height: var(--tap); padding: 9px 12px; border-radius: var(--radius-small);
    border: 1px solid var(--line-strong); background: var(--surface); font-size: 16px; /* 16px stops phones zooming in */
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--red); background: var(--red-soft); }
.input--money { text-align: right; font-variant-numeric: tabular-nums; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.form-actions--split { justify-content: space-between; }
@media (max-width: 479px) { .form-actions .button { flex: 1 1 auto; } }

/* check boxes and radio buttons shown as full-width rows that are easy to tap */
.checks { display: grid; gap: 8px; }
.checks--inline { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.check {
    display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 8px 12px;
    border: 1px solid var(--line-strong); border-radius: var(--radius-small); background: var(--surface); cursor: pointer;
}
.check input { width: 19px; height: 19px; accent-color: var(--blue); flex: none; margin: 0; }
.check:has(input:checked) { border-color: var(--blue); background: var(--blue-soft); }
.check:has(input:focus-visible) { box-shadow: var(--focus); }

/* --- messages --- */
.alert { padding: 11px 14px; border-radius: var(--radius-small); border: 1px solid transparent; font-size: 15px; }
.alert--error { background: var(--red-soft); border-color: #f2c9c3; color: #8f2a20; }
.alert--success { background: var(--green-soft); border-color: #bfe3d0; color: #17603f; }
.alert--info { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-dark); }
.alert--warn { background: var(--amber-soft); border-color: #f1ddb0; color: #8a5a12; }
.toasts { display: grid; gap: 8px; margin-bottom: 14px; }
.toast {
    display: flex; align-items: center; gap: 10px; justify-content: space-between;
    padding: 4px 4px 4px 14px; border-radius: var(--radius-small); border: 1px solid transparent; font-weight: 550;
}
.toast--success { background: var(--green-soft); border-color: #bfe3d0; color: #17603f; }
.toast--error { background: var(--red-soft); border-color: #f2c9c3; color: #8f2a20; }
.toast--info { background: var(--blue-soft); border-color: var(--blue-line); color: var(--blue-dark); }
.toast.is-leaving { opacity: 0; transition: opacity .3s; }

/* --- tabs --- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: var(--tap); padding: 8px 14px;
    color: var(--ink-soft); text-decoration: none; font-weight: 600; font-size: 15px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--blue-dark); border-bottom-color: var(--blue); }

/* --- details list (label / value pairs on a profile) --- */
.dl { display: grid; gap: 10px 20px; }
.dl > div { min-width: 0; }
.dl dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.dl dd { margin: 1px 0 0; overflow-wrap: anywhere; }
@media (min-width: 640px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dl .dl__wide { grid-column: 1 / -1; } }
@media (min-width: 1024px) { .dl--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* --- empty state --- */
.empty { text-align: center; padding: 34px 16px; color: var(--muted); }
.empty__title { color: var(--ink); font-weight: 650; font-size: 16px; margin-bottom: 4px; }
.empty .button { margin-top: 14px; }

/* --- progress bar (uses the browser's own <progress> element) --- */
.progress { width: 100%; height: 8px; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); appearance: none; display: block; }
.progress::-webkit-progress-bar { background: var(--line); }
.progress::-webkit-progress-value { background: var(--blue); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--blue); border-radius: 999px; }
.progress--good::-webkit-progress-value { background: var(--green); }
.progress--good::-moz-progress-bar { background: var(--green); }
.progress--warn::-webkit-progress-value { background: var(--amber); }
.progress--warn::-moz-progress-bar { background: var(--amber); }
.progress--bad::-webkit-progress-value { background: var(--red); }
.progress--bad::-moz-progress-bar { background: var(--red); }
.progress--violet::-webkit-progress-value { background: var(--violet); }
.progress--violet::-moz-progress-bar { background: var(--violet); }

/* --- dialog (forms open in it) --- */
.dialog {
    width: min(640px, 100vw); max-width: 100vw; max-height: 92vh; padding: 0; border: 0; color: inherit;
    border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-strong);
    margin: auto 0 0; /* slides up from the bottom on phones */
}
.dialog::backdrop { background: rgba(16, 42, 67, .5); }
.dialog[open] { display: flex; flex-direction: column; }
.dialog__head { display: flex; align-items: center; gap: 10px; padding: 10px 8px 10px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.dialog__title { font-size: 17px; flex: 1; }
.dialog__body { padding: 18px; overflow-y: auto; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
.dialog__body .page-head { display: none; } /* the dialog shows its own title */
.dialog--confirm { width: min(420px, 100vw); }
.confirm__text { margin: 8px 0 14px; color: var(--ink-soft); }
.dialog.is-loading .dialog__body { min-height: 120px; opacity: .5; }
@media (min-width: 640px) { .dialog { margin: auto; border-radius: var(--radius); } }

/* --- review cards (pre-registrations, payment declarations, scholarship requests) --- */
.review { display: grid; gap: 12px; }
.review__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.review__card.is-done { box-shadow: none; background: var(--surface-soft); }
.review__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 8px; }
.review__name { font-weight: 650; font-size: 16.5px; }
.review__when { color: var(--muted); font-size: 13.5px; margin-left: auto; }
.review__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* --- chips (quick filters) --- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 5px 13px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft);
    font-size: 14px; font-weight: 600; text-decoration: none;
}
.chip:hover { border-color: var(--muted); color: var(--ink); }
.chip.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip__count { font-weight: 700; opacity: .8; }

/* --- attendance marks: four buttons per student, one is selected --- */
.segmented { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-strong); border-radius: var(--radius-small); overflow: hidden; background: var(--surface); }
.segmented label { position: relative; display: grid; place-items: center; min-height: 40px; padding: 4px 10px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); cursor: pointer; border-left: 1px solid var(--line-strong); text-align: center; }
.segmented label:first-child { border-left: 0; }
.segmented input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segmented label:has(input:focus-visible) { box-shadow: inset var(--focus); }
.segmented label:has(input:checked) { color: #fff; }
.segmented label.is-present:has(input:checked) { background: var(--green); }
.segmented label.is-late:has(input:checked) { background: var(--amber); }
.segmented label.is-excused:has(input:checked) { background: var(--violet); }
.segmented label.is-absent:has(input:checked) { background: var(--red); }
.field > .segmented { display: grid; }
@media (max-width: 767px) { .field > .segmented label { min-height: var(--tap); } }

/* --- simple charts drawn with SVG --- */
.chart { display: block; width: 100%; height: auto; }
.chart text { font: 12px var(--font); fill: var(--muted); }
.legend { display: grid; gap: 6px; font-size: 14px; }
.legend__item { display: flex; align-items: center; gap: 8px; }
.legend__dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend__value { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.dot-1 { background: #0f6e9e; } .dot-2 { background: #8c9a12; } .dot-3 { background: #b7791f; } .dot-4 { background: #6b4fbb; }
.dot-5 { background: #1f8a5b; } .dot-6 { background: #c53a2d; } .dot-7 { background: #52606d; } .dot-8 { background: #d18ab5; }
.fill-1 { fill: #0f6e9e; } .fill-2 { fill: #8c9a12; } .fill-3 { fill: #b7791f; } .fill-4 { fill: #6b4fbb; }
.fill-5 { fill: #1f8a5b; } .fill-6 { fill: #c53a2d; } .fill-7 { fill: #52606d; } .fill-8 { fill: #d18ab5; }
.stroke-1 { stroke: #0f6e9e; } .stroke-2 { stroke: #8c9a12; } .stroke-3 { stroke: #b7791f; } .stroke-4 { stroke: #6b4fbb; }
.stroke-5 { stroke: #1f8a5b; } .stroke-6 { stroke: #c53a2d; } .stroke-7 { stroke: #52606d; } .stroke-8 { stroke: #d18ab5; }

/* --- pagination --- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 14px; }

/* ---------- 5. Screens ------------------------------------------------------ */
.grid-2 { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2--wide-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }

.profile-head { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }
.profile-head > .grow { flex: 1 1 200px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); display: grid; place-items: center; font-weight: 700; font-size: 19px; flex: none; }
.profile-head__name { font-size: 20px; font-weight: 700; }
.profile-head__meta { color: var(--muted); font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

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

/* the printable fee statement (Ödemeler > Ekstre) */
.statement { max-width: 760px; }
.linkbox .input { font-family: var(--mono); font-size: 14px; }

/* ---------- 6. Helpers ------------------------------------------------------ */
.muted { color: var(--muted); }
.small { font-size: 14px; }
.strong { font-weight: 650; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .94em; }
.text-right { text-align: right; }
.text-good { color: var(--green); } .text-warn { color: var(--amber); } .text-bad { color: var(--red); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row--between { justify-content: space-between; }
.stack { display: grid; gap: 12px; }
.stack--small { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.mt { margin-top: 16px; }
.inline-form { display: inline; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } }
@media (min-width: 768px) { .only-mobile { display: none !important; } }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 7. Print -------------------------------------------------------- */
@media print {
    .sidebar, .topbar, .toasts, .page-head__actions, .toolbar, .table__actions, .button, .tabs { display: none !important; }
    .shell { margin: 0; }
    body { background: #fff; }
    .card, .stat { box-shadow: none; }
    .main { padding: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
