:root {
  color-scheme: light;
  --bg: #f7f7fb;
  --surface: #fff;
  --text: #1d1930;
  --muted: #686477;
  --line: #e9e7f0;
  --primary: #613aca;
  --primary-dark: #4d2ba8;
  --primary-soft: #f0eafd;
  --green: #20714e;
  --green-soft: #e7f7ee;
  --orange: #994b16;
  --orange-soft: #fff1e0;
  --red: #ae344b;
  --red-soft: #fff0f2;
  --radius: 15px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid #9474ef; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.17; }
h1 { letter-spacing: -.047em; font-size: clamp(2rem, 4vw, 2.65rem); font-weight: 750; }
h2 { font-size: 1.2rem; letter-spacing: -.024em; }
h3 { font-size: 1rem; letter-spacing: -.016em; }
strong { font-weight: 680; }
small { font-size: .82rem; }
.app-shell { display: grid; grid-template-columns: 227px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 25px 16px 17px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: flex; gap: 11px; align-items: center; padding: 1px 5px; margin-bottom: 34px; white-space: nowrap; }
.brand strong, .brand small, .sidebar-foot strong, .sidebar-foot .lock-link { display: block; }
.brand strong { letter-spacing: -.026em; font-size: 1.05rem; }
.brand small { color: var(--muted); margin-top: 1px; }
.brand-mark { background: var(--primary); color: white; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; box-shadow: 0 3px 8px #613aca30; }
.navigation { display: grid; gap: 5px; }
.navigation a { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; color: #5d586e; font-weight: 580; font-size: .93rem; }
.navigation a:hover, .navigation a[aria-current] { color: #542bb7; background: var(--primary-soft); }
.navigation a[aria-current] { font-weight: 700; }
.sidebar-foot { border-top: 1px solid var(--line); padding: 16px 4px 1px; margin-top: auto; display: flex; gap: 10px; align-items: center; font-size: .9rem; }
.sidebar-foot .lock-link { color: var(--muted); font-size: .85rem; }
.sidebar-foot .lock-link:hover { color: var(--primary); text-decoration: underline; }
.private-icon { width: 36px; height: 36px; background: #f1ecfb; color: var(--primary); border-radius: 50%; display: grid; place-items: center; }
.workspace { min-width: 0; }
.topbar { height: 68px; padding: 0 35px; background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.breadcrumb { display: flex; gap: 11px; align-items: center; font-size: .9rem; color: var(--muted); }
.breadcrumb .i-grid { transform: scale(.78); }
.breadcrumb strong { color: var(--text); }
.crumb-separator { color: #a8a3b5; }
.top-date { color: #5e596e; font-size: .9rem; }
.content { max-width: 1500px; padding: 32px 35px 44px; margin: 0 auto; outline: none; }
.hero { position: relative; isolation: isolate; display: flex; gap: 20px; align-items: flex-end; justify-content: space-between; overflow: hidden; padding: 29px 29px 31px; border-radius: 20px; color: #fff; background: linear-gradient(108deg, #41238d, #5934af 58%, #6c48c1); }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: repeating-radial-gradient(ellipse at 92% 108%, transparent 0 19px, #efe6ff28 20px 21px, transparent 22px 38px); mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
.hero::after { content: ""; width: 10px; height: 10px; border-radius: 50%; position: absolute; top: 22%; left: 69%; background: #decdff; box-shadow: 65px 37px 0 -2px #b798ec, 112px -16px 0 -3px #ebdcff; z-index: -1; }
.hero p { color: #f2eaff; margin-top: 10px; max-width: 510px; }
.hero .eyebrow { display: block; color: #e5d7ff; font-size: .86rem; font-weight: 650; margin-bottom: 7px; }
.hero .button { color: #4b269b; background: #fff; border-color: #fff; }
.hero .button:hover { background: #f1e9ff; border-color: #f1e9ff; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 15px; margin: 25px 0 14px; }
.section-heading p, .page-heading p { color: var(--muted); margin-top: 5px; }
.page-heading { display: flex; gap: 18px; align-items: flex-end; justify-content: space-between; margin-bottom: 23px; }
.page-heading .label { margin-bottom: 7px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid transparent; border-radius: 9px; background: var(--primary); color: #fff; padding: 9px 14px; min-height: 42px; font-size: .9rem; font-weight: 670; white-space: nowrap; line-height: 1.25; }
.button:hover { background: var(--primary-dark); }
.button.secondary { background: white; color: #423653; border-color: #ded9ea; }
.button.secondary:hover { background: #f7f2ff; border-color: #c8b9ea; }
.button.danger { background: var(--red); }
.button.danger:hover { background: #8f273d; }
.button.small { padding: 6px 10px; min-height: 34px; }
.text-button { color: #542bb7; padding: 4px 0; background: none; border: 0; font-size: .9rem; font-weight: 680; text-align: left; }
.text-button:hover { text-decoration: underline; }
.text-button.danger-text { color: var(--red); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 22px; }
.stat, .panel, .export-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 7px #24184905; }
.stat { display: grid; align-content: start; gap: 7px; padding: 16px; min-height: 137px; }
.stat-icon, .empty-icon, .export-icon { display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 10px; width: 35px; height: 35px; }
.stat-icon.green { color: var(--green); background: var(--green-soft); }
.stat-icon.orange { color: var(--orange); background: var(--orange-soft); }
.stat-icon.blue { color: #375fb0; background: #e9effd; }
.stat .stat-label { color: #5f5a70; font-size: .9rem; }
.stat strong { font-size: clamp(1.26rem, 2.1vw, 1.77rem); letter-spacing: -.038em; line-height: 1.12; overflow-wrap: anywhere; }
.panel-header { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 18px 19px; border-bottom: 1px solid var(--line); }
.panel-header p { margin-top: 4px; font-size: .91rem; color: var(--muted); }
.panel-header .button { flex-shrink: 0; }
.panel-body { padding: 19px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .93rem; }
th { color: #656074; font-size: .85rem; font-weight: 660; background: #faf9fc; white-space: nowrap; }
th, td { padding: 10px 15px; border-bottom: 1px solid #efedf4; }
th:first-child, td:first-child { padding-left: 19px; }
tr:last-child td { border-bottom: 0; }
td.amount, th.amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td.actions { text-align: right; white-space: nowrap; }
td.actions .text-button + .text-button { margin-left: 10px; }
.student-link { display: inline-flex; align-items: center; gap: 8px; }
.avatar { flex: 0 0 31px; height: 31px; width: 31px; display: inline-grid; place-items: center; border-radius: 50%; background: #efe9fb; color: #613aab; font-size: .76rem; font-weight: 740; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 20px; font-size: .8rem; font-weight: 690; white-space: nowrap; color: #514961; background: #f0edf5; }
.badge.paid, .badge.active { background: var(--green-soft); color: var(--green); }
.badge.part-paid { background: var(--orange-soft); color: var(--orange); }
.badge.unpaid { background: var(--red-soft); color: var(--red); }
.empty { min-height: 185px; display: grid; justify-items: center; align-content: center; padding: 21px; text-align: center; gap: 7px; }
.empty-icon, .export-icon { width: 45px; height: 45px; border-radius: 13px; margin-bottom: 4px; }
.empty p { color: var(--muted); font-size: .9rem; max-width: 364px; }
.empty .button { margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; padding: 15px 19px; border-bottom: 1px solid var(--line); align-items: center; }
.toolbar .search { min-width: 205px; max-width: 320px; flex: 1 1 210px; }
.toolbar .count { margin-left: auto; color: var(--muted); font-size: .87rem; }
input, select { width: 100%; border: 1px solid #dcd7e8; border-radius: 8px; padding: 8px 10px; min-height: 41px; color: var(--text); background: white; font-size: .93rem; }
input::placeholder { color: #777184; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, #625975 50%), linear-gradient(135deg, #625975 50%, transparent 50%); background-position: calc(100% - 15px) 57%, calc(100% - 10px) 57%; background-size: 5px 5px; background-repeat: no-repeat; }
.toolbar select, .month-control input { width: auto; }
.month-control { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.month-control input { min-width: 128px; padding-inline: 8px; }
.month-control button { min-width: 32px; padding-inline: 7px; font-size: 1.15rem; }
.filter-label { font-size: .9rem; font-weight: 650; }
.exports-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.export-card { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.export-card p { color: var(--muted); margin-bottom: 7px; }
.export-card .export-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: auto; }
.profile-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin: 0; }
.profile-details dt { color: var(--muted); font-size: .84rem; }
.profile-details dd { margin: 4px 0 0; font-weight: 680; overflow-wrap: anywhere; }
.profile-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.spaced { margin-top: 19px; }
.loading { color: var(--muted); padding: 24px 0; }
dialog { width: min(100% - 26px, 545px); padding: 0; max-height: min(90vh, 780px); border: 1px solid #ded6ec; border-radius: 18px; color: var(--text); box-shadow: 0 20px 75px #20123f42; }
dialog::backdrop { background: #21183675; }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 21px; background: white; border-bottom: 1px solid var(--line); }
.dialog-head p { color: var(--muted); font-size: .89rem; margin-top: 4px; }
.close { background: #f5f1fa; color: #554869; display: grid; place-items: center; font-size: 1.28rem; border: 0; border-radius: 8px; width: 34px; height: 34px; line-height: 1; }
.close:hover { background: #eee5fb; }
.dialog-body { padding: 17px 21px 21px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
label.field { display: grid; gap: 5px; align-content: start; font-size: .91rem; font-weight: 640; }
.field small { color: var(--muted); font-weight: 400; }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.form-actions .start { margin-right: auto; }
.form-error { padding: 7px 9px; margin-top: 12px; border-radius: 7px; background: var(--red-soft); color: #922337; font-size: .9rem; }
.notice { color: var(--muted); font-size: .9rem; margin: 10px 0 0; }
.history-summary { display: flex; flex-wrap: wrap; gap: 7px 16px; margin-bottom: 14px; font-size: .9rem; }
.history-summary span { display: inline-grid; gap: 2px; color: var(--muted); }
.history-summary strong { color: var(--text); }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 9px 0; }
.history-list small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 2; bottom: 20px; right: 20px; max-width: calc(100vw - 40px); border-radius: 10px; color: #fff; background: #30244e; padding: 10px 14px; box-shadow: 0 6px 18px #251b3b30; font-size: .94rem; }
.muted { color: var(--muted); }
.icon { position: relative; display: inline-block; flex: 0 0 17px; width: 17px; height: 17px; color: inherit; font-style: normal; }
.icon::before, .icon::after { position: absolute; content: ''; box-sizing: border-box; }
.i-book::before { inset: 2px 0 2px; border: 1.5px solid; border-radius: 3px 3px 2px 2px; }
.i-book::after { top: 3px; left: 8px; height: 11px; border-left: 1.5px solid; }
.i-grid::before { width: 6px; height: 6px; background: currentColor; border-radius: 1px; top: 1px; left: 1px; box-shadow: 9px 0, 0 9px, 9px 9px; }
.i-people::before { top: 1px; left: 5px; width: 7px; height: 7px; border: 1.5px solid; border-radius: 50%; }
.i-people::after { bottom: 1px; left: 2px; width: 13px; height: 7px; border: 1.5px solid; border-radius: 7px 7px 2px 2px; }
.i-wallet::before { inset: 3px 1px 2px; border: 1.5px solid; border-radius: 3px; }
.i-wallet::after { border: 1.5px solid; width: 7px; height: 5px; top: 7px; right: 0; border-radius: 2px; background: inherit; }
.i-download::before { width: 7px; height: 7px; border-right: 1.5px solid; border-bottom: 1.5px solid; transform: rotate(45deg); left: 5px; top: 4px; }
.i-download::after { inset: 9px 1px 0; border: 1.5px solid; border-top: 0; border-radius: 0 0 3px 3px; }
.i-plus::before { top: 8px; left: 3px; width: 11px; border-top: 1.6px solid; }
.i-plus::after { top: 3px; left: 8px; height: 11px; border-left: 1.6px solid; }
.i-lock::before { inset: 7px 3px 1px; border: 1.5px solid; border-radius: 2px; }
.i-lock::after { inset: 2px 5px 9px; border: 1.5px solid; border-bottom: 0; border-radius: 6px 6px 0 0; }
.i-check::before { left: 4px; top: 2px; width: 7px; height: 11px; border: solid; border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.i-clock::before { inset: 1px; border: 1.5px solid; border-radius: 50%; }
.i-clock::after { top: 4px; left: 8px; height: 5px; width: 4px; border: solid; border-width: 0 0 1.5px 1.5px; }
@media (max-width: 980px) {
  .app-shell { grid-template-columns: 186px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .topbar, .content { padding-inline: 23px; }
  .stat { padding: 12px; }
}
@media (max-width: 730px) {
  .app-shell { display: block; }
  .sidebar { position: static; height: auto; padding: 11px 13px 8px; border: 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; }
  .brand { margin: 0; padding: 0; }
  .brand-mark { width: 37px; height: 37px; }
  .navigation { grid-row: 2; grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .navigation a { justify-content: center; gap: 5px; padding: 8px 4px; min-height: 43px; font-size: .83rem; }
  .navigation .icon { transform: scale(.85); }
  .sidebar-foot { padding: 0; border: 0; margin: 0; font-size: .82rem; }
  .sidebar-foot .private-icon, .sidebar-foot strong { display: none; }
  .topbar { display: none; }
  .content { padding: 16px 13px 29px; }
  .hero { padding: 20px 17px; border-radius: 14px; align-items: flex-start; flex-direction: column; gap: 13px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stat { min-height: 110px; }
  .stat-icon { height: 30px; width: 30px; }
  .section-heading { margin-top: 18px; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; margin-bottom: 15px; gap: 10px; }
  .panel-header, .panel-body, .toolbar { padding-inline: 12px; }
  .profile-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 460px) {
  .navigation .icon { display: none; }
  .exports-grid { grid-template-columns: 1fr; gap: 10px; }
  .section-heading { flex-wrap: wrap; gap: 9px; }
  .section-heading p { display: none; }
  .panel-header { flex-wrap: wrap; }
  .toast { right: 12px; bottom: 12px; }
  .dialog-head, .dialog-body { padding-inline: 14px; }
}
@media (max-width: 630px) {
  .table-wrap { padding: 0 11px; }
  table { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  tbody { display: block; }
  tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; padding: 12px 1px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border: 0; }
  tbody td, tbody td:first-child, tbody td.amount, tbody td.actions { display: block; padding: 0; border: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  tbody td:first-child, tbody td.actions { grid-column: 1 / -1; }
  tbody td:first-child { font-weight: 700; font-size: 1rem; }
  tbody td:not(:first-child):not(.actions)::before { display: block; content: attr(data-label); color: var(--muted); font-size: .8rem; }
  tbody td.actions { margin-top: 1px; }
  tbody td.actions .text-button { min-height: 38px; }
}

.access-actions { display: grid; gap: 3px; }
.sidebar-foot .lock-link { text-align: left; border: 0; padding: 0; background: none; }
.app-shell[data-locked] { grid-template-columns: minmax(0, 1fr); }
.app-shell[data-locked] .sidebar, .app-shell[data-locked] .topbar { display: none; }
.app-shell[data-locked] .content { max-width: 490px; margin: 10vh auto 0; }
.access-panel { text-align: center; padding: min(7vw, 32px); }
.access-panel .brand-mark { margin: 0 auto 15px; }
.access-panel h1 { font-size: clamp(1.65rem, 5vw, 2.18rem); }
.access-panel p { margin-top: 10px; color: var(--muted); }
.access-panel .button { margin-top: 15px; }
