/* =========================================================================
   ScholarDesk — student management
   ========================================================================= */

:root {
    --bg: #f6f3ee;
    --surface: #ffffff;
    --surface-soft: #faf7f2;
    --line: #ebe5db;
    --line-strong: #ded6c9;
    --ink: #1b1830;
    --ink-soft: #453f60;
    --muted: #7d7791;
    --muted-2: #aaa3bc;
    --brand: #6d4aff;
    --brand-2: #b445f5;
    --brand-dark: #5a34ee;
    --brand-soft: #f2edff;
    --green: #0c9b7a;
    --green-soft: #e4f8f1;
    --amber: #c77404;
    --amber-soft: #fdf2df;
    --red: #e0314f;
    --red-soft: #fdecef;
    --blue: #2f6df6;
    --blue-soft: #eaf1ff;
    --teal: #0f9d8f;
    --teal-soft: #e3f7f4;
    --shadow-xs: 0 1px 2px rgba(58, 42, 97, .06);
    --shadow-sm: 0 1px 3px rgba(58, 42, 97, .05), 0 10px 24px -14px rgba(58, 42, 97, .18);
    --shadow-md: 0 22px 50px -22px rgba(46, 32, 84, .3);
    --radius: 18px;
    --radius-sm: 12px;
    --sidebar-width: 262px;
    --sidebar-bg: #191734;
    --sidebar-bg-2: #221d44;
    --sidebar-text: #c9c5e2;
    --sidebar-muted: #8b86af;
    --sidebar-line: rgba(255, 255, 255, .09);
    --font: "Segoe UI", "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background-color: var(--bg);
    background-image:
        radial-gradient(900px 520px at 88% -12%, rgba(180, 69, 245, .1), transparent 62%),
        radial-gradient(760px 460px at -6% 8%, rgba(15, 157, 143, .09), transparent 62%),
        radial-gradient(680px 420px at 50% 118%, rgba(199, 116, 4, .07), transparent 65%);
    background-attachment: fixed;
    color: var(--ink);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-dark);
}

img,
svg {
    display: block;
}

h1, h2, h3, h4, p {
    margin: 0;
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.icon {
    flex: 0 0 auto;
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12.5px;
}

.nowrap {
    white-space: nowrap;
}

.text-right {
    text-align: right;
}

.mono {
    font-variant-numeric: tabular-nums;
}

:focus-visible {
    outline: 3px solid rgba(109, 74, 255, .32);
    outline-offset: 2px;
}

/* -------------------------------------------------------------------------
   Shell & sidebar
   ---------------------------------------------------------------------- */

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    padding: 22px 16px 18px;
    background:
        radial-gradient(340px 220px at 115% -8%, rgba(180, 69, 245, .38), transparent 70%),
        radial-gradient(280px 240px at -25% 104%, rgba(15, 157, 143, .26), transparent 70%),
        linear-gradient(180deg, var(--sidebar-bg), var(--sidebar-bg-2));
    border-right: 1px solid rgba(255, 255, 255, .07);
    box-shadow: 8px 0 40px -30px rgba(20, 15, 50, .9);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 2px 8px 24px;
    color: #fff;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-radius: 13px;
    box-shadow: 0 10px 22px -10px rgba(109, 74, 255, .95);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-text strong {
    font-size: 17px;
    letter-spacing: -.3px;
}

.brand-text small {
    color: var(--sidebar-muted);
    font-size: 11.5px;
    letter-spacing: .2px;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-label {
    padding: 0 12px;
    margin: 6px 0 7px;
    color: var(--sidebar-muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.nav-label-spaced {
    margin-top: 24px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    border-radius: 11px;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.nav-link .icon {
    color: var(--sidebar-muted);
    transition: color .15s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, .07);
}

.nav-link:hover .icon {
    color: #fff;
}

.nav-link.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(109, 74, 255, .98), rgba(180, 69, 245, .88));
    box-shadow: 0 14px 26px -16px rgba(109, 74, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .25);
    font-weight: 600;
}

.nav-link.is-active .icon {
    color: #fff;
}

.sidebar-foot {
    margin-top: auto;
    padding-top: 18px;
}

.sidebar-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--sidebar-line);
    border-radius: 13px;
}

.sidebar-note .icon {
    color: #c3aeff;
}

.sidebar-note div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-note strong {
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-note span {
    color: var(--sidebar-muted);
    font-size: 10.5px;
}

.sidebar-overlay {
    display: none;
}

.main {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
}

/* -------------------------------------------------------------------------
   Topbar & page frame
   ---------------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 82px;
    padding: 14px 32px;
    background: rgba(246, 243, 238, .84);
    border-bottom: 1px solid rgba(235, 229, 219, .9);
    box-shadow: 0 14px 34px -30px rgba(46, 32, 84, .7);
    backdrop-filter: blur(14px);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -.45px;
    line-height: 1.25;
}

.topbar-title p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12.5px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-date {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: var(--shadow-xs);
}

.mobile-menu {
    display: none !important;
}

.page {
    max-width: 1440px;
    margin: 0 auto;
    padding: 26px 32px 64px;
}

/* -------------------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    padding: 0 15px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    box-shadow: var(--shadow-xs);
    transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn:hover {
    color: var(--brand-dark);
    background: #fffdff;
    border-color: #cbbcf5;
    box-shadow: 0 8px 18px -14px rgba(109, 74, 255, .8);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
    box-shadow: 0 12px 24px -12px rgba(109, 74, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .22);
}

.btn-primary:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--brand-dark), #a336e8);
    border-color: transparent;
    box-shadow: 0 14px 26px -12px rgba(109, 74, 255, 1);
}

.btn-danger {
    color: var(--red);
    background: var(--surface);
    border-color: #f6ccd5;
}

.btn-danger:hover {
    color: #fff;
    background: linear-gradient(135deg, #f2556f, var(--red));
    border-color: transparent;
    box-shadow: 0 12px 22px -12px rgba(224, 49, 79, .9);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.btn-ghost:hover {
    background: var(--surface-soft);
    border-color: transparent;
}

.btn-sm {
    height: 34px;
    padding: 0 11px;
    font-size: 12px;
    border-radius: 8px;
}

.btn-block {
    width: 100%;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    color: var(--muted);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: color .15s ease, background .15s ease, border-color .15s ease, transform .15s ease;
}

.icon-btn:hover {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: #ddd2ff;
    transform: translateY(-1px);
}

.icon-btn.danger:hover {
    color: var(--red);
    background: var(--red-soft);
    border-color: #f2ccd1;
}

.btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------------------
   Cards
   ---------------------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-pad {
    padding: 22px;
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.card-head.borderedless {
    border-bottom: 0;
    padding-bottom: 0;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: -.15px;
}

.card-title .icon {
    color: var(--brand);
}

.card-subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.card-body {
    padding: 22px;
}

.card-body.tight {
    padding: 18px 22px;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.section-gap {
    margin-top: 20px;
}

.form-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 20px;
    align-items: start;
}

.form-layout > .card {
    overflow: hidden;
}

.form-layout .side-stack {
    position: sticky;
    top: 104px;
}

/* -------------------------------------------------------------------------
   Stat cards
   ---------------------------------------------------------------------- */

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.stat-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-card.stat-violet { background-image: radial-gradient(280px 130px at 105% -10%, rgba(109, 74, 255, .13), transparent 70%); }
.stat-card.stat-teal   { background-image: radial-gradient(280px 130px at 105% -10%, rgba(15, 157, 143, .14), transparent 70%); }
.stat-card.stat-amber  { background-image: radial-gradient(280px 130px at 105% -10%, rgba(199, 116, 4, .15), transparent 70%); }
.stat-card.stat-blue   { background-image: radial-gradient(280px 130px at 105% -10%, rgba(47, 109, 246, .13), transparent 70%); }
.stat-card.stat-rose   { background-image: radial-gradient(280px 130px at 105% -10%, rgba(224, 49, 79, .12), transparent 70%); }

.stat-label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .015em;
}

.stat-value {
    margin-top: 7px;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.9px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.stat-note {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 9px;
    color: var(--muted);
    font-size: 11.5px;
}

.stat-note strong {
    color: var(--green);
    font-weight: 600;
}

.stat-note.warn strong {
    color: var(--amber);
}

.stat-note.danger strong {
    color: var(--red);
}

.stat-tile {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: #fff;
    border-radius: 14px;
}

.tile-indigo {
    background: linear-gradient(135deg, #6d4aff, #b445f5);
    box-shadow: 0 12px 20px -12px rgba(109, 74, 255, .95);
}

.tile-green {
    background: linear-gradient(135deg, #14b894, #0c9b7a);
    box-shadow: 0 12px 20px -12px rgba(12, 155, 122, .9);
}

.tile-amber {
    background: linear-gradient(135deg, #f9a825, #ea7c0c);
    box-shadow: 0 12px 20px -12px rgba(234, 124, 12, .85);
}

.tile-red {
    background: linear-gradient(135deg, #f4556e, #e0314f);
    box-shadow: 0 12px 20px -12px rgba(224, 49, 79, .9);
}

.tile-blue {
    background: linear-gradient(135deg, #4d86ff, #2f6df6);
    box-shadow: 0 12px 20px -12px rgba(47, 109, 246, .9);
}

.tile-teal {
    background: linear-gradient(135deg, #17b3a4, #0f9d8f);
    box-shadow: 0 12px 20px -12px rgba(15, 157, 143, .9);
}

/* -------------------------------------------------------------------------
   Badges, avatars, people, pills
   ---------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 10.5px;
    font-weight: 650;
    letter-spacing: .015em;
    line-height: 1.5;
    border-radius: 999px;
    white-space: nowrap;
}

.badge-green { color: var(--green); background: var(--green-soft); }
.badge-amber { color: var(--amber); background: var(--amber-soft); }
.badge-red   { color: var(--red); background: var(--red-soft); }
.badge-blue  { color: var(--blue); background: var(--blue-soft); }
.badge-indigo{ color: var(--brand-dark); background: var(--brand-soft); }
.badge-gray  { color: var(--muted); background: #f2eee7; }

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
    white-space: nowrap;
}

.pill .icon {
    color: var(--muted-2);
}

.avatar {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 38px;
    height: 38px;
    color: var(--brand-dark);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .02em;
    background: linear-gradient(145deg, #f0ebff, #e3daff);
    border: 1px solid #ddd2ff;
    border-radius: 12px;
}

.avatar.avatar-green { color: #0a7a60; background: linear-gradient(145deg, #e7f9f3, #cff3e8); border-color: #c3eee1; }
.avatar.avatar-amber { color: #9a5a04; background: linear-gradient(145deg, #fdf4e3, #fbe7c4); border-color: #f5dfb8; }
.avatar.avatar-blue  { color: #2b5fd9; background: linear-gradient(145deg, #ecf2ff, #d9e6ff); border-color: #d0deff; }
.avatar.avatar-rose  { color: #c81f43; background: linear-gradient(145deg, #ffedf1, #ffd9e1); border-color: #ffcede; }
.avatar-lg {
    width: 68px;
    height: 68px;
    font-size: 21px;
    border-radius: 19px;
}

.person {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.person-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.35;
}

.person-text strong {
    overflow: hidden;
    font-size: 13px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-text span {
    color: var(--muted);
    font-size: 11px;
}

/* -------------------------------------------------------------------------
   Tables
   ---------------------------------------------------------------------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table.data-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

.data-table th {
    padding: 11px 18px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .065em;
    text-align: left;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fcfaf6, #f7f3ec);
    border-bottom: 1px solid var(--line);
}

.data-table td {
    padding: 13px 18px;
    font-size: 12.5px;
    vertical-align: middle;
    border-bottom: 1px solid #f3eee6;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr {
    transition: background .12s ease;
}

.data-table tbody tr:hover {
    background: #fbf8ff;
}

.data-table .cell-main {
    font-weight: 600;
    color: var(--ink);
}

.data-table .cell-sub {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 11px;
}

.data-table .amount {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.data-table .amount.negative {
    color: var(--red);
}

.data-table .amount.positive {
    color: var(--green);
}

.data-table .row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}

.data-table th:last-child,
.data-table td:last-child {
    text-align: right;
}

.empty-cell {
    padding: 46px 20px !important;
    text-align: center;
}

/* -------------------------------------------------------------------------
   Forms
   ---------------------------------------------------------------------- */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 20px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field-span-2 {
    grid-column: 1 / -1;
}

.field label,
.field-label {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
}

.field label .req {
    color: var(--red);
    font-weight: 500;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    color: var(--ink);
    font-size: 13px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field textarea {
    min-height: 88px;
    resize: vertical;
    line-height: 1.5;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted-2);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #b9a6ff;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, .14);
}

.field input:disabled,
.field select:disabled {
    color: var(--muted);
    background: var(--surface-soft);
}

.field .hint {
    margin-top: -1px;
    color: var(--muted);
    font-size: 11px;
}

.field .error {
    color: var(--red);
    font-size: 11.5px;
    font-weight: 500;
}

.field.has-error input,
.field.has-error select,
.field.has-error textarea {
    border-color: #eaa2aa;
    background: #fffafa;
}

.form-section {
    padding: 24px;
}

.form-section + .form-section {
    border-top: 1px solid var(--line);
}

.form-section-head {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 20px;
}

.section-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 11px;
}

/* Give each form section its own accent colour */
.form-section:nth-of-type(1) .section-icon { color: #6d4aff; background: #f2edff; }
.form-section:nth-of-type(2) .section-icon { color: #0c9b7a; background: #e4f8f1; }
.form-section:nth-of-type(3) .section-icon { color: #c77404; background: #fdf2df; }
.form-section:nth-of-type(4) .section-icon { color: #e0314f; background: #fdecef; }
.form-section:nth-of-type(5) .section-icon { color: #2f6df6; background: #eaf1ff; }
.form-section:nth-of-type(6) .section-icon { color: #0f9d8f; background: #e3f7f4; }

.form-section-head h2 {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.15px;
}

.form-section-head p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11.5px;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    padding: 18px 24px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
}

.form-actions.between {
    justify-content: space-between;
}

.form-error-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 16px;
    margin-bottom: 20px;
    color: #8c1c27;
    font-size: 12.5px;
    background: var(--red-soft);
    border: 1px solid #f6d5d9;
    border-radius: 11px;
}

.form-error-box .icon {
    margin-top: 1px;
    color: var(--red);
}

.form-error-box ul {
    margin: 4px 0 0;
    padding-left: 17px;
}

.search-box {
    position: relative;
    min-width: 0;
    display: flex;
    align-items: center;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    transition: border-color .14s ease, box-shadow .14s ease;
}

.search-box:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent);
}

.search-box .icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--muted-2);
    transform: translateY(-50%);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 10px 38px 10px 44px;
    font-size: 14px;
    background: transparent;
    border: 0;
    border-radius: 11px;
    box-shadow: none;
}

.search-box input:focus {
    border: 0;
    box-shadow: none;
}

.search-box input::-webkit-search-cancel-button {
    width: 15px;
    height: 15px;
    margin-right: 4px;
    cursor: pointer;
    opacity: .55;
}

.search-box input::-webkit-search-cancel-button:hover {
    opacity: 1;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(280px, 2.6fr) repeat(4, minmax(118px, 1fr)) auto;
    align-items: end;
    gap: 12px;
}

.filter-grid.fees-filter {
    grid-template-columns: minmax(250px, 2.2fr) repeat(3, minmax(105px, 1fr)) minmax(220px, 1.2fr) auto;
}

.filter-grid .search-box {
    min-height: 46px;
}

.date-range {
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.date-range input {
    min-width: 0;
    padding-right: 5px;
    padding-left: 6px;
    font-size: 11.5px;
}

.date-range > span {
    flex: 0 0 auto;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.filter-card {
    padding: 16px 18px;
}

.filter-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding-top: 13px;
    color: var(--muted);
    font-size: 11.5px;
    border-top: 1px solid var(--line);
}

/* -------------------------------------------------------------------------
   Dashboard
   ---------------------------------------------------------------------- */

.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.collection-layout {
    display: flex;
    align-items: center;
    gap: 26px;
    padding: 24px 22px;
}

.donut {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 134px;
    height: 134px;
    border-radius: 50%;
    background: conic-gradient(
        from -90deg,
        var(--brand) 0%,
        var(--brand-2) calc(var(--pct, 0) * 1%),
        #f1ece4 calc(var(--pct, 0) * 1%)
    );
    box-shadow: 0 18px 34px -22px rgba(109, 74, 255, .85);
}

.donut::before {
    position: absolute;
    width: 98px;
    height: 98px;
    content: "";
    background: var(--surface);
    border-radius: 50%;
}

.donut-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.15;
}

.donut-center strong {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -.7px;
}

.donut-center span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.legend {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.legend-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 11.5px;
    white-space: nowrap;
}

.dot {
    width: 8px;
    height: 8px;
    background: var(--brand);
    border-radius: 50%;
}

.dot.muted-dot {
    background: #dfe2ee;
}

.legend-value {
    font-size: 12.5px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.collection-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 22px;
    color: var(--muted);
    font-size: 11.5px;
    background: var(--surface-soft);
    border-top: 1px solid var(--line);
    border-radius: 0 0 var(--radius) var(--radius);
}

.collection-foot strong {
    color: var(--ink);
    font-weight: 650;
}

.batch-name {
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.batch-name strong {
    font-size: 12.5px;
    font-weight: 600;
}

.batch-name span {
    color: var(--muted);
    font-size: 10.5px;
}

.progress {
    width: 100%;
    height: 7px;
    overflow: hidden;
    background: #f1ece4;
    border-radius: 99px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    border-radius: inherit;
    transition: width .4s ease;
}

.progress-bar.bar-green {
    background: linear-gradient(90deg, #10b981, #059669);
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 120px;
}

.progress-row .progress {
    min-width: 66px;
}

.progress-row span {
    color: var(--muted);
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------------------
   Student profile
   ---------------------------------------------------------------------- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.back-link:hover {
    color: var(--brand);
}

.profile-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(760px 190px at 102% -14%, rgba(180, 69, 245, .16), transparent 64%),
        radial-gradient(520px 170px at -8% 112%, rgba(15, 157, 143, .13), transparent 64%),
        var(--surface);
    box-shadow: var(--shadow-sm);
}

.profile-card::before {
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    content: "";
    background: linear-gradient(180deg, var(--brand), var(--brand-2) 55%, var(--teal));
}

.profile-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    padding: 25px 26px;
}

.profile-id {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.profile-name h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.2;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.profile-meta .meta-sep {
    width: 3px;
    height: 3px;
    background: var(--muted-2);
    border-radius: 50%;
}

.profile-meta span {
    color: var(--muted);
    font-size: 12px;
}

.fee-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.fee-summary-card {
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.fee-summary-card span {
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
}

.fee-summary-card strong {
    display: block;
    margin-top: 5px;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: -.6px;
    font-variant-numeric: tabular-nums;
}

.fee-summary-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 10.5px;
}

.fee-summary-card.balance {
    background: linear-gradient(135deg, #fff8ea, #fff);
    border-color: #f2ddb4;
}

.fee-summary-card.balance strong {
    color: var(--amber);
}

.fee-summary-card.paid {
    background: linear-gradient(135deg, #eefaf6, #fff);
    border-color: #c8efe2;
}

.fee-summary-card.paid strong {
    color: var(--green);
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(290px, 1fr);
    gap: 20px;
    margin-top: 20px;
    align-items: start;
}

.side-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.detail-list {
    display: flex;
    flex-direction: column;
}

.detail-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 12px 0;
    border-bottom: 1px dashed #eaecf4;
}

.detail-row:first-child {
    padding-top: 0;
}

.detail-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.detail-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11.5px;
}

.detail-label .icon {
    color: var(--muted-2);
}

.detail-value {
    color: var(--ink-soft);
    font-size: 12.5px;
    font-weight: 550;
    text-align: right;
    overflow-wrap: anywhere;
}

.fee-overview {
    padding: 20px 22px;
}

.fee-overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 15px;
}

.fee-overview-head h3 {
    font-size: 13px;
    font-weight: 700;
}

.fee-overview-head .percent {
    color: var(--brand);
    font-size: 13px;
    font-weight: 700;
}

.fee-overview-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 11px;
    color: var(--muted);
    font-size: 11px;
}

.fee-overview-foot strong {
    color: var(--ink-soft);
    font-weight: 600;
}

.payment-form {
    padding: 20px 22px;
}

.payment-form .form-grid {
    gap: 14px;
}

.payment-form .field input,
.payment-form .field select,
.payment-form .field textarea {
    min-height: 40px;
    font-size: 12.5px;
}

.payment-form .field textarea {
    min-height: 64px;
}

.payment-form .form-actions {
    padding: 16px 0 0;
    margin-top: 16px;
    background: transparent;
    border-top: 1px solid var(--line);
    border-radius: 0;
}

.balance-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: var(--muted);
    font-size: 11px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.balance-note strong {
    color: var(--ink);
    font-size: 12px;
}

.ledger-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
}

.ledger-head h3 {
    font-size: 14px;
    font-weight: 700;
}

.ledger-head span {
    color: var(--muted);
    font-size: 11.5px;
}

.ledger-receipt {
    font-family: "Cascadia Mono", "Consolas", monospace;
    font-size: 11px;
    color: var(--muted);
}

.ledger-note {
    display: block;
    max-width: 190px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-actions {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
}

/* -------------------------------------------------------------------------
   Empty states, tabs, structure page
   ---------------------------------------------------------------------- */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 42px 22px;
    text-align: center;
}

.empty-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 3px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-radius: 15px;
    box-shadow: 0 14px 24px -16px rgba(109, 74, 255, .95);
}

.empty-state h3 {
    font-size: 13.5px;
    font-weight: 700;
}

.empty-state p {
    max-width: 340px;
    color: var(--muted);
    font-size: 12px;
}

.empty-state .btn {
    margin-top: 8px;
}

.tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px;
    margin-bottom: 20px;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-xs);
}

.tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    border-radius: 8px;
    transition: color .15s ease, background .15s ease;
}

.tab:hover {
    color: var(--ink);
    background: var(--surface-soft);
}

.tab.is-active {
    color: var(--brand-dark);
    background: linear-gradient(135deg, var(--brand-soft), #fbf5ff);
    box-shadow: inset 0 0 0 1px rgba(109, 74, 255, .12);
}

.tab-count {
    padding: 1px 6px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, .8);
    border-radius: 99px;
}

.tab.is-active .tab-count {
    color: var(--brand-dark);
    background: rgba(255, 255, 255, .9);
}

.structure-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.sticky-card {
    position: sticky;
    top: 104px;
}

.structure-form {
    padding: 22px;
}

.structure-form .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
}

.structure-form .field input,
.structure-form .field select {
    min-height: 40px;
    font-size: 12.5px;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 9px;
}

.check-row input {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    accent-color: var(--brand);
}

.check-row label {
    color: var(--ink-soft);
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
}

.check-row label strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
}

.check-row label span {
    color: var(--muted);
    font-size: 10.5px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.inline-form select,
.inline-form input[type="search"],
.inline-form input[type="text"] {
    width: auto;
    min-height: 34px;
    padding: 5px 10px;
    color: var(--ink);
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    box-shadow: var(--shadow-xs);
}

.inline-form select:focus,
.inline-form input:focus {
    outline: none;
    border-color: #b9a6ff;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, .14);
}

/* -------------------------------------------------------------------------
   Pagination
   ---------------------------------------------------------------------- */

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 20px;
    border-top: 1px solid var(--line);
}

.pagination-info {
    color: var(--muted);
    font-size: 11.5px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-link {
    display: grid;
    place-items: center;
    min-width: 31px;
    height: 31px;
    padding: 0 7px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 7px;
}

.page-link:hover {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: #dfe2ff;
}

.page-link.is-active {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent;
    box-shadow: 0 10px 18px -12px rgba(109, 74, 255, .95);
}

.page-link.is-disabled {
    pointer-events: none;
    opacity: .4;
}

/* -------------------------------------------------------------------------
   Toasts
   ---------------------------------------------------------------------- */

.toast-stack {
    position: fixed;
    top: 92px;
    right: 26px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 9px;
    width: min(390px, calc(100vw - 32px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    color: var(--ink-soft);
    font-size: 12.5px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--brand);
    border-radius: 10px;
    box-shadow: var(--shadow-md);
    animation: toast-in .25s ease both;
}

.toast.toast-success { border-left-color: var(--green); }
.toast.toast-error { border-left-color: var(--red); }
.toast.toast-info { border-left-color: var(--blue); }

.toast-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 26px;
    height: 26px;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 8px;
}

.toast-success .toast-icon { color: var(--green); background: var(--green-soft); }
.toast-error .toast-icon { color: var(--red); background: var(--red-soft); }
.toast-info .toast-icon { color: var(--blue); background: var(--blue-soft); }

.toast > span:nth-child(2) {
    flex: 1;
    padding-top: 2px;
}

.toast-close {
    padding: 2px;
    color: var(--muted-2);
    background: transparent;
    border: 0;
}

.toast-close:hover {
    color: var(--ink);
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* -------------------------------------------------------------------------
   Receipt
   ---------------------------------------------------------------------- */

.receipt-body {
    background: #f1ece4;
}

.receipt-shell {
    max-width: 880px;
    margin: 0 auto;
    padding: 28px 20px 60px;
}

.receipt-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.receipt-toolbar .back-link {
    margin-bottom: 0;
}

.receipt-sheet {
    padding: 46px 52px;
    background: var(--surface);
    border: 1px solid #e1e3ec;
    border-radius: 6px;
    box-shadow: 0 20px 50px -26px rgba(23, 30, 53, .3);
}

.receipt-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 26px;
    padding-bottom: 22px;
    border-bottom: 2px solid var(--ink);
}

.receipt-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.receipt-logo {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-radius: 13px;
}

.receipt-brand h1 {
    font-size: 21px;
    font-weight: 800;
    letter-spacing: -.5px;
    line-height: 1.2;
}

.receipt-brand p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10.5px;
}

.receipt-address {
    max-width: 280px;
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.6;
    text-align: right;
}

.receipt-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0 16px;
}

.receipt-title-row h2 {
    color: var(--brand-dark);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.receipt-no {
    display: flex;
    flex-direction: column;
    text-align: right;
    line-height: 1.4;
}

.receipt-no span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.receipt-no strong {
    font-family: "Cascadia Mono", "Consolas", monospace;
    font-size: 12.5px;
    color: var(--ink);
}

.paid-stamp {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    color: var(--green);
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    background: var(--green-soft);
    border: 1px solid #bdecd8;
    border-radius: 5px;
    transform: rotate(-2deg);
}

.receipt-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 17px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.receipt-info-block h3 {
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.receipt-info-block p {
    color: var(--ink-soft);
    font-size: 11.5px;
    line-height: 1.65;
}

.receipt-info-block p strong {
    color: var(--ink);
    font-size: 12.5px;
}

.receipt-amount-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.receipt-amount-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.receipt-amount-label + p {
    margin-top: 5px;
    max-width: 390px;
    color: var(--ink-soft);
    font-size: 10.5px;
    font-style: italic;
    line-height: 1.5;
}

.receipt-amount {
    color: var(--ink);
    font-size: 31px;
    font-weight: 800;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.receipt-table {
    width: 100%;
    margin-top: 18px;
    border-collapse: collapse;
}

.receipt-table th {
    padding: 8px 6px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-align: left;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
}

.receipt-table th:last-child,
.receipt-table td:last-child {
    text-align: right;
}

.receipt-table td {
    padding: 10px 6px;
    color: var(--ink-soft);
    font-size: 11.5px;
    border-bottom: 1px solid #f3eee6;
}

.receipt-table td strong {
    color: var(--ink);
    font-weight: 600;
}

.receipt-table tr.total-row td {
    padding-top: 12px;
    font-weight: 700;
    border-bottom: 0;
}

.receipt-table tr.total-row td:last-child {
    font-size: 13px;
}

.receipt-summary {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

.receipt-summary-box {
    width: 290px;
}

.receipt-summary-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 5px 0;
    color: var(--muted);
    font-size: 11px;
}

.receipt-summary-row strong {
    color: var(--ink-soft);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.receipt-summary-row.grand {
    padding-top: 9px;
    margin-top: 5px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 700;
    border-top: 1px solid var(--ink);
}

.receipt-summary-row.grand strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
}

.receipt-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 30px;
    padding-top: 30px;
    margin-top: 18px;
    border-top: 1px solid var(--line);
}

.receipt-note {
    max-width: 360px;
    color: var(--muted);
    font-size: 9.5px;
    line-height: 1.6;
}

.receipt-note strong {
    display: block;
    margin-bottom: 2px;
    color: var(--ink-soft);
    font-size: 10px;
}

.signature {
    min-width: 170px;
    padding-top: 30px;
    border-top: 1px solid var(--ink-soft);
    color: var(--muted);
    font-size: 9.5px;
    text-align: center;
}

.receipt-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 16px;
    margin-top: 24px;
    color: var(--muted-2);
    font-size: 8.5px;
    border-top: 1px dashed var(--line);
}

/* -------------------------------------------------------------------------
   Installer
   ---------------------------------------------------------------------- */

.install-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 34px 18px;
    background:
        radial-gradient(760px 440px at 8% -6%, rgba(109, 74, 255, .18), transparent 62%),
        radial-gradient(680px 420px at 96% 6%, rgba(180, 69, 245, .16), transparent 60%),
        radial-gradient(700px 480px at 50% 116%, rgba(15, 157, 143, .15), transparent 62%),
        var(--bg);
}

.install-wrap {
    width: min(690px, 100%);
}

.install-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 18px;
    justify-content: center;
}

.install-card {
    padding: 36px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 30px 70px -35px rgba(23, 30, 53, .3);
}

.install-card h1 {
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.7px;
}

.install-card > p {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
}

.install-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 24px 0;
}

.install-detail {
    padding: 13px 15px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.install-detail span {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.install-detail strong {
    display: block;
    margin-top: 3px;
    font-family: "Cascadia Mono", "Consolas", monospace;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.install-list {
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.install-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 7px 0;
    color: var(--ink-soft);
    font-size: 12px;
}

.install-list .icon {
    margin-top: 2px;
    color: var(--green);
}

.install-error {
    padding: 14px 16px;
    margin-bottom: 18px;
    color: #8c1c27;
    font-size: 12px;
    line-height: 1.6;
    background: var(--red-soft);
    border: 1px solid #f6d5d9;
    border-radius: 10px;
}

.install-error code {
    padding: 1px 4px;
    font-size: 11px;
    background: #fff;
    border-radius: 4px;
}

.install-success-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
    color: var(--green);
    background: var(--green-soft);
    border-radius: 15px;
}

/* -------------------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------------- */

@media screen and (max-width: 1180px) {
    .stat-grid,
    .stat-grid.cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-grid {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .filter-grid.fees-filter {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }

    .filter-grid .search-box,
    .filter-grid.fees-filter .search-box {
        grid-column: 1 / -1;
    }

    .filter-actions {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }
}

@media screen and (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
        box-shadow: var(--shadow-md);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        background: rgba(15, 20, 40, .34);
        opacity: 0;
        visibility: hidden;
        transition: opacity .2s ease, visibility .2s ease;
    }

    .sidebar-overlay.is-visible {
        opacity: 1;
        visibility: visible;
    }

    .main {
        margin-left: 0;
    }

    .mobile-menu {
        display: inline-grid !important;
    }

    .topbar {
        min-height: 74px;
        padding: 12px 22px;
    }

    .page {
        padding: 22px 22px 56px;
    }

    .dash-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .structure-grid,
    .form-layout {
        grid-template-columns: 1fr;
    }

    .sticky-card,
    .form-layout .side-stack {
        position: static;
    }
}

@media screen and (max-width: 760px) {
    .topbar-date {
        display: none;
    }

    .topbar-title h1 {
        font-size: 18px;
    }

    .topbar-title p {
        display: none;
    }

    .topbar {
        gap: 10px;
        padding: 11px 16px;
        min-height: 68px;
    }

    .topbar-actions {
        gap: 7px;
    }

    .topbar-actions .btn {
        height: 36px;
        padding: 0 11px;
        font-size: 12px;
    }

    .page {
        padding: 18px 16px 48px;
    }

    .stat-grid,
    .fee-summary-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 17px;
    }

    .stat-value {
        font-size: 24px;
    }

    .collection-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 20px;
    }

    .donut {
        align-self: center;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .field-span-2 {
        grid-column: auto;
    }

    .filter-grid,
    .filter-grid.fees-filter {
        grid-template-columns: 1fr 1fr;
    }

    .filter-grid > * {
        grid-column: auto;
    }

    .filter-grid .search-box,
    .filter-actions {
        grid-column: 1 / -1;
    }

    .form-section,
    .card-pad,
    .card-body,
    .form-section {
        padding: 18px;
    }

    .card-head {
        padding: 17px 18px;
    }

    .form-actions {
        padding: 15px 18px;
    }

    .profile-main {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .profile-name h2 {
        font-size: 19px;
    }

    .receipt-sheet {
        padding: 26px 22px;
    }

    .receipt-header,
    .receipt-title-row,
    .receipt-footer {
        flex-direction: column;
    }

    .receipt-address,
    .receipt-no {
        text-align: left;
    }

    .receipt-info-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .receipt-amount-box {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .receipt-summary {
        justify-content: stretch;
    }

    .receipt-summary-box {
        width: 100%;
    }

    .install-card {
        padding: 26px 20px;
    }

    .install-details {
        grid-template-columns: 1fr;
    }

    .toast-stack {
        top: 80px;
        right: 16px;
    }

    .pagination-bar {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media screen and (max-width: 480px) {
    .filter-grid,
    .filter-grid.fees-filter {
        grid-template-columns: 1fr;
    }

    .btn-group {
        width: 100%;
    }

    .pagination .page-link {
        min-width: 29px;
    }
}

/* -------------------------------------------------------------------------
   Authentication screens
   ---------------------------------------------------------------------- */

.auth-body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 28px 20px;
    background:
        radial-gradient(760px 480px at 12% -10%, rgba(109, 74, 255, .22), transparent 62%),
        radial-gradient(700px 460px at 94% 4%, rgba(180, 69, 245, .18), transparent 60%),
        radial-gradient(680px 460px at 50% 116%, rgba(15, 157, 143, .15), transparent 62%),
        var(--bg);
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    width: min(1060px, 100%);
    min-height: 640px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 26px;
    box-shadow: 0 40px 90px -50px rgba(28, 20, 60, .55);
}

.auth-aside {
    display: flex;
    flex-direction: column;
    padding: 40px 42px;
    color: #ece9ff;
    background:
        radial-gradient(440px 300px at 112% -10%, rgba(180, 69, 245, .5), transparent 66%),
        radial-gradient(360px 300px at -20% 108%, rgba(15, 157, 143, .3), transparent 68%),
        linear-gradient(160deg, #191734, #241d4b 62%, #1a2340);
}

.sa-auth-aside {
    background:
        radial-gradient(440px 300px at 112% -10%, rgba(224, 49, 79, .38), transparent 66%),
        radial-gradient(360px 300px at -20% 108%, rgba(199, 116, 4, .3), transparent 68%),
        linear-gradient(160deg, #1b1730, #2a1c34 62%, #231a26);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    color: #fff;
}

.auth-brand:hover {
    color: #fff;
}

.auth-brand span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.auth-brand strong {
    font-size: 17px;
    letter-spacing: -.3px;
}

.auth-brand small {
    color: rgba(236, 233, 255, .62);
    font-size: 11.5px;
}

.auth-copy {
    margin: auto 0;
    padding: 44px 0;
}

.auth-copy h1 {
    margin: 18px 0 14px;
    color: #fff;
    font-size: clamp(32px, 4.2vw, 46px);
    font-weight: 800;
    line-height: 1.06;
    letter-spacing: -1.6px;
}

.auth-copy > p {
    max-width: 380px;
    color: rgba(236, 233, 255, .74);
    font-size: 13px;
    line-height: 1.7;
}

.auth-points {
    display: grid;
    gap: 9px;
    margin: 26px 0 0;
    padding: 0;
    list-style: none;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(236, 233, 255, .82);
    font-size: 12.5px;
}

.auth-points .icon {
    color: #7ff0cf;
}

.auth-foot {
    color: rgba(236, 233, 255, .45);
    font-size: 10.5px;
    letter-spacing: .03em;
}

.auth-panel {
    display: grid;
    place-items: center;
    padding: 44px 40px;
}

.auth-card {
    width: min(392px, 100%);
}

.auth-card-head {
    margin-bottom: 22px;
}

.auth-card-head h2 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.6px;
}

.auth-card-head p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12.5px;
}

.auth-card .field {
    margin-bottom: 15px;
}

.auth-input {
    position: relative;
}

.auth-input .icon {
    position: absolute;
    top: 50%;
    left: 13px;
    z-index: 1;
    color: var(--muted-2);
    transform: translateY(-50%);
    pointer-events: none;
}

.auth-input input {
    width: 100%;
    padding-left: 41px;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 13px;
    margin-bottom: 16px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.5;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.auth-alert-error {
    color: #8c1c27;
    background: var(--red-soft);
    border-color: #f6d5d9;
}

.auth-alert-success {
    color: #07624d;
    background: var(--green-soft);
    border-color: #bdecd8;
}

.auth-alert .icon {
    flex: 0 0 auto;
    margin-top: 2px;
}

.auth-submit {
    margin-top: 6px;
}

.auth-switch {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.auth-switch a {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
}

@media (max-width: 880px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .auth-aside {
        padding: 30px 28px;
    }

    .auth-copy {
        padding: 28px 0 8px;
    }

    .auth-copy h1 {
        font-size: 32px;
    }

    .auth-points,
    .auth-aside .auth-foot {
        display: none;
    }

    .auth-panel {
        padding: 32px 26px;
    }
}

/* -------------------------------------------------------------------------
   Signed-in user, impersonation & organization profile
   ---------------------------------------------------------------------- */

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    margin-top: 10px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--sidebar-line);
    border-radius: 12px;
}

.sidebar-user .avatar {
    width: 30px;
    height: 30px;
    font-size: 10.5px;
}

.sidebar-user-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.sidebar-user-text strong {
    overflow: hidden;
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-text span {
    overflow: hidden;
    color: var(--sidebar-muted);
    font-size: 9.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user .icon-btn {
    margin-left: auto;
    color: var(--sidebar-text);
}

.sidebar-user .icon-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.impersonation-bar {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 15px;
    margin-bottom: 18px;
    color: #6b4a08;
    font-size: 12px;
    background: var(--amber-soft);
    border: 1px solid #f2d9ab;
    border-radius: 12px;
}

.impersonation-bar > span {
    flex: 1;
}

.impersonation-bar .btn {
    flex: 0 0 auto;
}

.settings-section {
    padding-top: 20px;
    margin-top: 22px;
    border-top: 1px solid var(--line);
}

.settings-section-head {
    margin-bottom: 14px;
}

.settings-section-head h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}

.settings-section-head p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
}

.print-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.print-option {
    position: relative;
    display: block;
}

.print-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.print-option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    height: 100%;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.print-option:hover .print-option-card {
    border-color: var(--line-strong);
}

.print-option input:checked + .print-option-card {
    background: var(--brand-soft);
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(109, 74, 255, .13);
}

.print-option input:focus-visible + .print-option-card {
    outline: 3px solid rgba(109, 74, 255, .32);
    outline-offset: 2px;
}

.print-page {
    position: relative;
    flex: 0 0 auto;
    width: 36px;
    height: 46px;
    padding: 7px 6px;
    background: #fff;
    border: 1.5px solid var(--line-strong);
    border-radius: 3px;
}

.print-page span {
    display: block;
    height: 2px;
    margin-bottom: 4px;
    background: var(--line-strong);
    border-radius: 2px;
}

.print-page span:nth-child(2) {
    width: 72%;
}

.print-page span:nth-child(3) {
    width: 88%;
}

.print-page span:nth-child(4) {
    width: 60%;
}

.print-page-half {
    background: linear-gradient(180deg, #fff 0 50%, #f4f0ff 50% 100%);
}

.print-page-half span:nth-child(3) {
    display: none;
}

.print-page-half::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 3px;
    left: 3px;
    border-top: 1.5px dashed var(--brand);
}

.print-option-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.print-option-text strong {
    font-size: 12.5px;
}

.print-option-text small {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.45;
}

.print-option-check {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-left: auto;
    color: #fff;
    background: var(--brand);
    border-radius: 50%;
    opacity: 0;
    transition: opacity .15s ease;
}

.print-option input:checked + .print-option-card .print-option-check {
    opacity: 1;
}

.receipt-preview-frame {
    position: relative;
    padding: 0;
    transition: padding .2s ease;
}

.receipt-preview-frame.is-half .receipt-preview-sheet {
    padding: 30px 34px 24px;
    background: linear-gradient(180deg, #fff 0 50%, #fbf9ff 50% 100%);
}

.receipt-preview-frame.is-half .receipt-preview-sheet::after {
    content: "Half of A4 · cut line";
    display: block;
    padding-top: 12px;
    margin-top: 16px;
    color: var(--brand);
    font-size: 8.5px;
    font-weight: 700;
    letter-spacing: .1em;
    text-align: center;
    text-transform: uppercase;
    border-top: 1.5px dashed rgba(109, 74, 255, .45);
}

.receipt-preview-frame.is-half .receipt-brand h1 {
    font-size: 17px;
}

.receipt-preview-frame.is-half .receipt-amount {
    font-size: 24px;
}

.preview-note {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 13px 15px;
    margin-top: 16px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.preview-note > span {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 9px;
}

.preview-note p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.preview-note strong {
    color: var(--ink-soft);
}

.receipt-layout-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 600;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 7px;
}

/* -------------------------------------------------------------------------
   Super admin
   ---------------------------------------------------------------------- */

.brand-mark-admin {
    background: linear-gradient(135deg, #e6a23c, #e0314f);
    box-shadow: 0 10px 22px -10px rgba(224, 49, 79, .85);
}

.sa-app .sidebar {
    background:
        radial-gradient(340px 220px at 115% -8%, rgba(224, 49, 79, .32), transparent 70%),
        radial-gradient(280px 240px at -25% 104%, rgba(199, 116, 4, .22), transparent 70%),
        linear-gradient(180deg, #1b1730, #241b33);
}

.sa-guide {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.sa-guide-stack {
    grid-template-columns: 1fr;
}

.sa-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 13px;
}

.sa-guide-step strong {
    display: block;
    font-size: 12.5px;
}

.sa-guide-step p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.org-hero {
    padding: 22px 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.org-hero-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.org-hero-main h2 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.org-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 15px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 11.5px;
}

.org-hero-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.org-hero-address {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 7px;
    color: var(--muted);
    font-size: 11.5px;
}

.stack-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.control-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-row {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px;
    color: var(--ink-soft);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 11px;
    transition: border-color .15s ease, background .15s ease;
}

.control-row:hover {
    color: var(--ink);
    background: #fff;
    border-color: var(--line-strong);
}

.control-row > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.control-row strong {
    font-size: 12px;
}

.control-row span:not(.stat-tile) {
    color: var(--muted);
    font-size: 10.5px;
}

.control-row > .icon {
    margin-left: auto;
    color: var(--muted-2);
}

.danger-card {
    border-color: #f3d3d8;
}

.danger-card .card-title {
    color: var(--red);
}

.app-dialog {
    width: min(430px, calc(100% - 32px));
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 30px 80px -30px rgba(23, 18, 45, .55);
}

.app-dialog::backdrop {
    background: rgba(24, 20, 45, .45);
    backdrop-filter: blur(2px);
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.dialog-head h3 {
    font-size: 16px;
    font-weight: 700;
}

/* -------------------------------------------------------------------------
   Installer additions
   ---------------------------------------------------------------------- */

.install-wrap-wide {
    width: min(820px, 100%);
}

.install-section {
    padding-top: 18px;
    margin-top: 20px;
    border-top: 1px solid var(--line);
}

.install-section h2 {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
}

.install-section > p {
    margin: 3px 0 12px;
    color: var(--muted);
    font-size: 11.5px;
}

.install-actions {
    display: flex;
    gap: 10px;
}

.install-actions .btn {
    flex: 1;
    justify-content: center;
}

.install-code {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 18px;
    background: var(--brand-soft);
    border: 1px solid #ddd2ff;
    border-radius: 10px;
}

.install-code span {
    color: var(--brand-dark);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.install-code strong {
    font-family: "Cascadia Mono", "Consolas", monospace;
    font-size: 13px;
}

@media (max-width: 760px) {
    .print-options {
        grid-template-columns: 1fr;
    }

    .sa-guide {
        grid-template-columns: 1fr;
    }

    .org-hero-main {
        flex-direction: column;
    }
}

/* -------------------------------------------------------------------------
   Licenses, renewal & plans
   ---------------------------------------------------------------------- */

.license-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 14px;
    color: var(--ink-soft);
    font-size: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.license-banner > div {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    line-height: 1.5;
}

.license-banner strong {
    font-size: 12.5px;
}

.license-banner span {
    color: var(--muted);
    font-size: 11.5px;
}

.license-banner .btn {
    flex: 0 0 auto;
}

.license-banner.is-expiring {
    color: #6b4a08;
    background: var(--amber-soft);
    border-color: #f0d6a8;
}

.license-banner.is-expiring strong {
    color: #6b4a08;
}

.license-banner.is-expiring span {
    color: #8a6419;
}

.license-banner.is-expired {
    color: #8c1c27;
    background: var(--red-soft);
    border-color: #f6d5d9;
}

.license-banner.is-expired strong {
    color: #8c1c27;
}

.license-banner.is-expired span {
    color: #a33a48;
}

.license-banner.is-maintenance {
    color: #1d4ed8;
    background: var(--blue-soft);
    border-color: #cbdcff;
}

.license-banner.is-maintenance strong {
    color: #1d4ed8;
}

.license-banner.is-maintenance span {
    color: #3c63b5;
}

.renewal-dialog {
    width: min(560px, calc(100% - 32px));
    padding: 22px;
}

.renewal-dialog .dialog-head {
    align-items: flex-start;
}

.renewal-dialog .dialog-head > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.renewal-dialog .dialog-head h3 {
    display: flex;
    align-items: center;
    gap: 7px;
}

.renewal-dialog-body .renewal-card {
    box-shadow: none;
}

.renewal-card {
    padding: 24px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.renewal-card.is-expired {
    border-color: #f0c9cf;
}

.renewal-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.renewal-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.renewal-card-head h2 {
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.6px;
}

.renewal-card-head p {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11.5px;
}

.renewal-amount-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
}

.renewal-amount-row > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.renewal-amount-row span:first-child {
    color: var(--muted);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.renewal-amount-row strong {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.renewal-body {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 24px;
    padding-top: 18px;
}

.renewal-qr {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.renewal-qr img {
    width: 100%;
    max-width: 220px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
}

.renewal-qr-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 24px 16px;
    color: var(--muted);
    font-size: 10.5px;
    text-align: center;
    background: var(--surface-soft);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
}

.renewal-qr-empty strong {
    color: var(--ink-soft);
    font-size: 12px;
}

.renewal-steps h3 {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
}

.renewal-steps ol {
    margin: 0;
    padding-left: 18px;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.7;
}

.renewal-steps li::marker {
    color: var(--brand);
    font-weight: 700;
}

.renewal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding-top: 14px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 10.5px;
    border-top: 1px dashed var(--line);
}

.renewal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.renewal-hero {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px 24px;
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.renewal-hero.is-expired {
    background: linear-gradient(180deg, #fff, var(--red-soft));
    border-color: #f0c9cf;
}

.renewal-hero-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 50px;
    height: 50px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-radius: 14px;
}

.renewal-hero.is-expired .renewal-hero-icon {
    background: linear-gradient(135deg, #e0314f, #c77404);
}

.renewal-hero h2 {
    margin: 6px 0 5px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.5px;
}

.renewal-hero p {
    max-width: 720px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.renewal-help {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    margin-top: 18px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.renewal-help > div {
    flex: 1;
}

.renewal-help strong {
    font-size: 12.5px;
}

.renewal-help p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.6;
}

.renewal-help code {
    padding: 1px 5px;
    font-size: 11px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.renewal-help .btn {
    flex: 0 0 auto;
    align-self: center;
}

@media (max-width: 700px) {
    .renewal-body {
        grid-template-columns: 1fr;
    }

    .renewal-card-head,
    .license-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .license-banner .btn {
        width: 100%;
        justify-content: center;
    }
}

.license-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.license-summary > div {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 10px 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.license-summary > div:last-child {
    grid-column: 1 / -1;
}

.license-summary span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.license-summary strong {
    font-size: 13px;
}

.license-summary small {
    color: var(--muted);
    font-size: 10px;
}

.license-renew-form .btn-block {
    margin-top: 12px;
}

/* Plan manager (super admin) */

.plans-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.plan-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.plan-card-head {
    padding: 18px 20px;
    background: linear-gradient(160deg, #fff, var(--surface-soft));
    border-bottom: 1px solid var(--line);
}

.plan-card-head h2 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.35px;
}

.plan-card-head p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 10px;
}

.plan-price strong {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
}

.plan-price span {
    color: var(--muted);
    font-size: 10.5px;
}

.plan-card-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 20px 20px;
}

.plan-qr-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--surface-soft);
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
}

.plan-qr-preview img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 7px;
}

.plan-qr-preview .renewal-qr-empty {
    padding: 10px;
    border: 0;
    background: transparent;
}

.plan-qr-preview span {
    color: var(--muted);
    font-size: 10.5px;
    line-height: 1.5;
}

.plan-card-body .field {
    margin: 0;
}

@media (max-width: 1000px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------------------------
   Print
   ---------------------------------------------------------------------- */

@media print {
    @page {
        size: A4 portrait;
        margin: 12mm;
    }

    body {
        background: #fff !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    .sidebar,
    .topbar,
    .receipt-toolbar,
    .toast-stack,
    .sidebar-overlay {
        display: none !important;
    }

    .main {
        margin-left: 0 !important;
    }

    .receipt-shell {
        max-width: none;
        padding: 0;
    }

    .receipt-sheet {
        padding: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .receipt-body {
        background: #fff;
    }

    .receipt-footer {
        page-break-inside: avoid;
    }

    /*
     | A printed A4 page is only ~700px wide in CSS pixels, so without these
     | overrides the responsive (max-width) rules would collapse the receipt
     | into the stacked mobile layout. The receipt keeps its two-column
     | structure on paper.
     */
    .receipt-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start;
        justify-content: space-between;
        gap: 26px;
    }

    .receipt-brand {
        align-items: center;
    }

    .receipt-address {
        max-width: 290px;
        font-style: normal;
        text-align: right !important;
    }

    .receipt-title-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
    }

    .receipt-no {
        text-align: right !important;
    }

    .receipt-info-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 30px;
    }

    .receipt-amount-box {
        display: flex !important;
        flex-direction: row !important;
        align-items: center;
        justify-content: space-between;
    }

    .receipt-summary {
        justify-content: flex-end;
    }

    .receipt-summary-box {
        width: 300px;
    }

    .receipt-footer {
        display: flex;
        align-items: flex-end;
        justify-content: space-between;
    }

    .receipt-bottom {
        display: flex;
        justify-content: space-between;
    }

    .receipt-info-block,
    .receipt-amount-box,
    .receipt-summary-box {
        page-break-inside: avoid;
    }

    /*
     | Half A4 mode: the receipt is compacted into the top half of a portrait
     | A4 sheet. 297 mm of height minus 24 mm of page margins leaves 136 mm
     | per half, so the sheet is capped at 134 mm to guarantee one page.
     */
    body.receipt-layout-half .receipt-shell {
        padding: 0;
    }

    body.receipt-layout-half .receipt-sheet {
        height: 134mm;
        padding: 0;
        overflow: hidden;
        page-break-after: avoid;
        page-break-inside: avoid;
    }

    body.receipt-layout-half .receipt-header {
        padding-bottom: 9px;
        border-bottom-width: 1.5px;
    }

    body.receipt-layout-half .receipt-logo {
        width: 37px;
        height: 37px;
        border-radius: 9px;
    }

    body.receipt-layout-half .receipt-logo .icon {
        width: 18px;
        height: 18px;
    }

    body.receipt-layout-half .receipt-brand h1 {
        font-size: 16px;
        letter-spacing: -.2px;
    }

    body.receipt-layout-half .receipt-brand p {
        font-size: 9px;
    }

    body.receipt-layout-half .receipt-address {
        max-width: 250px;
        font-size: 9px;
        line-height: 1.45;
    }

    body.receipt-layout-half .receipt-title-row {
        padding: 9px 0 7px;
    }

    body.receipt-layout-half .receipt-title-row h2 {
        font-size: 10px;
    }

    body.receipt-layout-half .receipt-no span {
        font-size: 7.5px;
    }

    body.receipt-layout-half .receipt-no strong {
        font-size: 10px;
    }

    body.receipt-layout-half .paid-stamp {
        padding: 3px 7px;
        font-size: 8px;
    }

    body.receipt-layout-half .receipt-info-grid {
        gap: 20px;
        padding: 9px 0;
    }

    body.receipt-layout-half .receipt-info-block h3 {
        margin-bottom: 4px;
        font-size: 8px;
    }

    body.receipt-layout-half .receipt-info-block p {
        font-size: 9.8px;
        line-height: 1.45;
    }

    body.receipt-layout-half .receipt-info-block p strong {
        font-size: 10.2px;
    }

    body.receipt-layout-half .receipt-amount-box {
        padding: 8px 0;
    }

    body.receipt-layout-half .receipt-amount-label {
        font-size: 8px;
    }

    body.receipt-layout-half .receipt-amount-label + p {
        margin-top: 2px;
        max-width: 360px;
        font-size: 8.5px;
    }

    body.receipt-layout-half .receipt-amount {
        font-size: 23px;
        letter-spacing: -.5px;
    }

    body.receipt-layout-half .receipt-summary {
        padding-top: 4px;
    }

    body.receipt-layout-half .receipt-summary-box {
        width: 250px;
    }

    body.receipt-layout-half .receipt-summary-row {
        padding: 3px 0;
        font-size: 9px;
    }

    body.receipt-layout-half .receipt-summary-row.grand {
        padding-top: 6px;
        margin-top: 4px;
        font-size: 9.5px;
    }

    body.receipt-layout-half .receipt-summary-row.grand strong {
        font-size: 10px;
    }

    body.receipt-layout-half .receipt-footer {
        padding-top: 10px;
        margin-top: 8px;
    }

    body.receipt-layout-half .receipt-note {
        max-width: 360px;
        font-size: 8px;
        line-height: 1.45;
    }

    body.receipt-layout-half .receipt-note strong {
        font-size: 8.5px;
    }

    body.receipt-layout-half .signature {
        min-width: 150px;
        padding-top: 16px;
        font-size: 8px;
    }

    body.receipt-layout-half .receipt-bottom {
        padding-top: 6px;
        margin-top: 9px;
        font-size: 7px;
    }
}

/* -------------------------------------------------------------------------
   Teachers & attendance
   ---------------------------------------------------------------------- */

.att-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.att-strip-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 20px;
    background: var(--surface-soft);
    border-bottom: 1px solid var(--line);
}

.att-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    background: #f5f2ec;
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
}

.att-chip strong {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.att-present { color: #0a7a60; background: #e7f9f3; border-color: #c6eee1; }
.att-absent  { color: #c8233d; background: #fdedf0; border-color: #f8d0d9; }
.att-late    { color: #a45f04; background: #fdf3e1; border-color: #f5dfb9; }
.att-half    { color: #2b5fd9; background: #ecf2ff; border-color: #d3e1ff; }
.att-leave   { color: #6b6480; background: #f1eee9; border-color: #e3ddd3; }
.att-none    { color: var(--muted); background: #f7f4ef; border-color: #eae3d9; }

.attendance-sheet .attend-select {
    width: 100%;
    min-width: 152px;
    min-height: 38px;
    padding: 7px 10px;
    color: var(--ink);
    font-size: 12.5px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.attendance-sheet .attend-select:focus {
    outline: none;
    border-color: #b9a6ff;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, .14);
}

.attend-select.s-present  { color: #0a7a60; background: #f3fdf9; border-color: #a9e6d3; }
.attend-select.s-absent   { color: #c8233d; background: #fff7f9; border-color: #f1bcc7; }
.attend-select.s-late     { color: #a45f04; background: #fffbf2; border-color: #efcf99; }
.attend-select.s-half_day { color: #2b5fd9; background: #f6faff; border-color: #bed4ff; }
.attend-select.s-leave    { color: #6b6480; background: #faf8f5; border-color: #ddd6ca; }

.attendance-sheet .sheet-note {
    width: 100%;
    min-width: 180px;
    min-height: 38px;
    padding: 7px 10px;
    color: var(--ink);
    font-size: 12.5px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
}

.attendance-sheet .sheet-note:focus {
    outline: none;
    border-color: #b9a6ff;
    box-shadow: 0 0 0 3px rgba(109, 74, 255, .14);
}

.staff-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
    padding: 18px 22px;
}

.staff-strip-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.reg-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.reg-table th,
.reg-table td {
    padding: 8px 6px;
    font-size: 11.5px;
    text-align: center;
}

.reg-table thead th {
    vertical-align: bottom;
}

.reg-day {
    min-width: 34px;
}

.reg-day small {
    display: block;
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 600;
}

.reg-off {
    background: #f7f4ef !important;
}

.reg-table .reg-name {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 190px;
    text-align: left;
    background: var(--surface);
}

.reg-table thead .reg-name {
    z-index: 4;
    background: linear-gradient(180deg, #fcfaf6, #f7f3ec);
}

.reg-table tbody tr:hover .reg-name {
    background: #fbf8ff;
}

.reg-name a {
    font-size: 12.5px;
    font-weight: 600;
}

.reg-name small {
    display: block;
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
}

.reg-total {
    min-width: 42px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.reg-present  { color: #0a7a60; background: #eafaf4; font-weight: 700; }
.reg-absent   { color: #c8233d; background: #fdedf0; font-weight: 700; }
.reg-late     { color: #a45f04; background: #fdf6e8; font-weight: 700; }
.reg-half_day { color: #2b5fd9; background: #eff4ff; font-weight: 700; }
.reg-leave    { color: #6b6480; background: #f3f1ec; font-weight: 700; }
.reg-none     { color: #c8c2b6; }

.reg-table tr.row-inactive td,
.reg-table tr.row-inactive th {
    opacity: .62;
}

/* -------------------------------------------------------------------------
   Super admin: keep the long navigation scrollable
   ---------------------------------------------------------------------- */

.sa-app .sidebar .nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .24) transparent;
}

.sa-app .sidebar .nav::-webkit-scrollbar {
    width: 8px;
}

.sa-app .sidebar .nav::-webkit-scrollbar-track {
    background: transparent;
}

.sa-app .sidebar .nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .22);
    border-radius: 99px;
}

.sa-app .sidebar-foot {
    margin-top: 0;
}

/* Organization branding assets */
.settings-asset {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--surface-soft);
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
}

.settings-asset-preview {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
}

.settings-asset-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.settings-asset-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.settings-asset-body strong {
    font-size: 12.5px;
}

.settings-asset-body small {
    color: var(--muted);
    font-size: 11px;
}

.settings-asset-body input[type="file"] {
    padding: 6px;
    font-size: 12px;
}

.settings-asset-remove {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--red);
    font-size: 11.5px;
}

.settings-asset-remove input {
    width: auto;
    min-height: 0;
}

/* Receipt branding extras */
.receipt-logo img {
    display: block;
    max-width: 58px;
    max-height: 58px;
    object-fit: contain;
}

.receipt-qr-box {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.receipt-qr-box img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.receipt-bank {
    display: grid;
    gap: 2px;
    font-size: 12px;
    line-height: 1.6;
}

.receipt-terms {
    margin-top: 12px;
    padding-top: 10px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    border-top: 1px dashed var(--line);
    white-space: pre-line;
}

.license-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
    border-radius: 999px;
    text-decoration: none;
}

.license-chip.is-active {
    color: var(--green);
    background: var(--green-soft);
}

.license-chip.is-warning {
    color: var(--amber);
    background: var(--amber-soft);
}

.license-chip.is-expired {
    color: var(--red);
    background: var(--red-soft);
}

/* Super admin provider switches and delivery list */
.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.check-inline input {
    width: auto;
    min-height: 0;
}

.report-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.report-list li {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 9px;
    border-bottom: 1px solid var(--line);
}

.report-list li:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.report-list strong {
    display: block;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.report-list small {
    color: var(--muted);
    font-size: 11px;
}

/* Compact extra blocks when printing to the top half of A4 */
@media print {
    body.receipt-layout-half .receipt-qr-box {
        gap: 8px;
        margin-top: 6px;
        padding: 6px 8px;
    }

    body.receipt-layout-half .receipt-qr-box img {
        width: 48px;
        height: 48px;
    }

    body.receipt-layout-half .receipt-bank {
        gap: 0;
        font-size: 8px;
        line-height: 1.4;
    }

    body.receipt-layout-half .receipt-bank .muted {
        display: none;
    }

    body.receipt-layout-half .receipt-terms {
        margin-top: 5px;
        padding-top: 5px;
        font-size: 7.5px;
        line-height: 1.4;
    }
}
