:root {
  --navy: #1c1b17;
  --blue: #e31e24;
  --blue-2: #f0443e;
  --blue-soft: #fff0ef;
  --ink: #1c1b17;
  --muted: #746f64;
  --line: #ebe3d2;
  --surface: #ffffff;
  --background: #fff9ee;
  --green: #16a56f;
  --green-soft: #e7f8f1;
  --amber: #d69f00;
  --amber-soft: #fff7d6;
  --red: #d3131b;
  --red-soft: #ffebe9;
  --shadow: 0 18px 50px rgba(56, 42, 19, .09);
  --shadow-sm: 0 7px 24px rgba(56, 42, 19, .08);
  --radius: 18px;
  --sidebar: 252px;
  color-scheme: light;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  z-index: 30;
  display: flex;
  flex-direction: column;
  padding: 24px 16px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 8%, rgba(227, 30, 36, .38), transparent 30%),
    radial-gradient(circle at 92% 88%, rgba(255, 206, 0, .16), transparent 30%),
    linear-gradient(165deg, #292720 0%, #1c1b17 58%, #11100e 100%);
  box-shadow: 8px 0 32px rgba(28, 27, 23, .18);
}

.brand { display: flex; gap: 12px; align-items: center; padding: 4px 10px 24px; }
.brand-mark { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; overflow: hidden; background: #fff9e8; box-shadow: inset 0 0 0 1px rgba(255,206,0,.42), 0 7px 16px rgba(0,0,0,.12); }
.brand-mark img { width: 28px; height: 38px; object-fit: contain; }
.brand strong { display: block; font-size: 17px; letter-spacing: -.2px; }
.brand small { display: block; margin-top: 2px; color: rgba(255,255,255,.66); font-size: 11px; }
.brand-wordmark { display: block; white-space: nowrap; line-height: 1; text-transform: none; }
.brand-tagline { display: block; margin-top: 4px; white-space: nowrap; font-size: 9px !important; font-weight: 800; letter-spacing: -.1px; }
.brand-tagline b { color: #e31e24; font: inherit; }
.brand-tagline em { color: #ffce00; font: inherit; font-style: normal; }

.nav-list { display: flex; flex-direction: column; gap: 4px; overflow: auto; scrollbar-width: none; }
.nav-item { width: 100%; border: 0; border-radius: 12px; padding: 10px 12px; display: flex; gap: 12px; align-items: center; text-align: left; color: rgba(255,255,255,.72); background: transparent; transition: .2s ease; }
.nav-item:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-item.active { color: #fff; background: rgba(227,30,36,.22); box-shadow: inset 3px 0 0 #ffce00, inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-item svg { width: 20px; height: 20px; flex: 0 0 20px; }
.nav-item span { font-size: 13px; font-weight: 600; }
.nav-badge { margin-left: auto; min-width: 21px; height: 21px; border-radius: 999px; padding: 0 6px; display: grid; place-items: center; font-size: 10px; color: #1c1b17; background: #ffce00; }

.sidebar-user { width: 100%; margin-top: auto; padding: 13px; border: 0; display: flex; gap: 10px; align-items: center; border-radius: 14px; color: #fff; text-align: left; background: rgba(255,255,255,.09); transition: .2s ease; }
.sidebar-user:hover { background: rgba(255,255,255,.15); }
.sidebar-user > svg { width: 16px; margin-left: auto; color: rgba(255,255,255,.55); }
.avatar { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--blue); background: var(--blue-soft); }
.sidebar-user strong { display: block; font-size: 12px; }
.sidebar-user small { display: block; color: rgba(255,255,255,.62); font-size: 10px; margin-top: 3px; }

.main { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { height: 76px; padding: 0 34px; position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(255,249,238,.9); backdrop-filter: blur(18px); border-bottom: 1px solid rgba(235,227,210,.82); }
.topbar-title h1 { margin: 0; font-size: 22px; letter-spacing: -.45px; }
.topbar-title p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; gap: 10px; align-items: center; }
.global-search { position: relative; width: min(300px, 30vw); }
.global-search svg { position: absolute; left: 12px; top: 50%; width: 17px; transform: translateY(-50%); color: #8793a5; }
.global-search input { width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px 0 38px; color: var(--ink); background: #fff; outline: none; box-shadow: 0 4px 14px rgba(19, 47, 79, .03); }
.global-search input:focus { border-color: #ef938f; box-shadow: 0 0 0 3px rgba(227,30,36,.10); }
.icon-btn { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; position: relative; display: grid; place-items: center; color: var(--blue); background: #fff; }
.icon-btn svg { width: 18px; }
.icon-btn .dot { position: absolute; right: 8px; top: 7px; width: 7px; height: 7px; border-radius: 50%; border: 2px solid #fff; background: var(--red); }

.page { max-width: 1600px; margin: 0 auto; padding: 26px 34px 110px; animation: page-in .24s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } }
.section-head { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.section-head h2 { margin: 0; font-size: 18px; letter-spacing: -.3px; }
.section-head p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.btn { min-height: 39px; border: 0; border-radius: 11px; padding: 0 15px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; font-weight: 700; transition: transform .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--blue-2), var(--blue)); box-shadow: 0 8px 20px rgba(227,30,36,.20); }
.btn-secondary { color: var(--blue); background: var(--blue-soft); }
.btn-light { color: var(--ink); border: 1px solid var(--line); background: #fff; }
.btn-danger { color: var(--red); background: var(--red-soft); }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .72fr); gap: 18px; margin-bottom: 18px; }
.revenue-card { min-height: 220px; padding: 25px 27px; position: relative; overflow: hidden; color: #fff; border-radius: 24px; background:
  radial-gradient(circle at 86% 22%, rgba(255,206,0,.34), transparent 24%),
  linear-gradient(135deg, #2a2822, #171612); box-shadow: 0 24px 55px rgba(28,27,23,.22); }
.revenue-card::after { content: ""; position: absolute; width: 290px; height: 290px; right: -75px; bottom: -170px; border: 42px solid rgba(255,255,255,.06); border-radius: 50%; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.revenue-card .eyebrow { color: rgba(255,255,255,.7); }
.revenue-value { margin-top: 9px; color: #fff; font-size: clamp(30px, 3vw, 43px); font-weight: 800; letter-spacing: -1.4px; }
.trend { margin-left: 9px; vertical-align: middle; font-size: 11px; color: #6ce1ad; }
.trend.negative { color: #ff9b9b; }
.mini-chart { height: 96px; margin-top: 10px; display: flex; align-items: stretch; gap: 7px; }
.chart-bar-button { min-width: 32px; max-width: 40px; height: 100%; padding: 0; position: relative; flex: 1; display: grid; grid-template-rows: minmax(0,1fr) 14px; gap: 5px; border: 0; color: rgba(255,255,255,.7); background: transparent; cursor: pointer; }
.chart-bar-track { min-height: 0; display: flex; align-items: flex-end; }
.bar { width: 100%; min-height: 4px; border-radius: 5px 5px 2px 2px; background: rgba(255,255,255,.32); transition: filter .16s ease, transform .16s ease, background .16s ease; }
.bar.active { background: #ffce00; box-shadow: 0 0 20px rgba(255,206,0,.45); }
.chart-month { font-size: 9px; line-height: 14px; text-align: center; }
.chart-tooltip { padding: 5px 7px; position: absolute; z-index: 4; left: 50%; bottom: calc(100% - 2px); border: 1px solid rgba(255,255,255,.18); border-radius: 7px; color: #1c1b17; background: #fff7dc; box-shadow: 0 8px 20px rgba(0,0,0,.2); font-size: 9px; font-weight: 800; line-height: 1; white-space: nowrap; opacity: 0; pointer-events: none; transform: translate(-50%,5px); transition: opacity .15s ease, transform .15s ease; }
.chart-bar-button:hover .chart-tooltip, .chart-bar-button:focus-visible .chart-tooltip { opacity: 1; transform: translate(-50%,0); }
.chart-bar-button:hover .bar, .chart-bar-button:focus-visible .bar { filter: brightness(1.3); transform: scaleX(1.08); background: #ffce00; }
.chart-bar-button:focus-visible { outline: 2px solid #ffce00; outline-offset: 3px; border-radius: 7px; }
.dashboard-report-shortcut { border: 0; cursor: pointer; }

.today-card { min-height: 220px; padding: 22px; border-radius: 24px; color: var(--ink); background: var(--surface); box-shadow: var(--shadow-sm); }
.today-card h3 { margin: 0; font-size: 15px; }
.attendance-ring-wrap { margin-top: 20px; display: flex; gap: 22px; align-items: center; }
.ring { --value: 78; width: 104px; height: 104px; border-radius: 50%; position: relative; display: grid; place-items: center; background: conic-gradient(var(--blue) calc(var(--value)*1%), #f1e7d5 0); }
.ring::after { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: #fff; }
.ring-content { z-index: 1; text-align: center; }
.ring-content strong { display: block; font-size: 22px; }
.ring-content small { color: var(--muted); font-size: 9px; }
.legend { display: grid; gap: 10px; }
.legend-row { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 10px; }
.legend-row strong { color: var(--ink); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 13px; margin-bottom: 24px; }
.stat-card { padding: 17px; min-height: 118px; border: 1px solid rgba(228,235,244,.8); border-radius: var(--radius); background: #fff; box-shadow: 0 6px 24px rgba(31,58,91,.04); }
.dashboard-link { width: 100%; position: relative; appearance: none; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease; }
.dashboard-link:hover { transform: translateY(-3px); border-color: rgba(227,30,36,.24); box-shadow: 0 16px 34px rgba(31,58,91,.12); }
.dashboard-link:active { transform: translateY(-1px); }
.dashboard-link:focus-visible { outline: 3px solid rgba(227,30,36,.32); outline-offset: 3px; }
.dashboard-link-dark { border: 0; }
.revenue-card.dashboard-link, .student-welcome-card.dashboard-link { color: #fff; }
.dashboard-link-dark:focus-visible { outline-color: #ffce00; }
.dashboard-link > * { position: relative; z-index: 1; }
.dashboard-link-hint { width: 28px; height: 28px; position: absolute; z-index: 2; top: 13px; right: 13px; display: grid; place-items: center; border-radius: 9px; color: var(--blue); background: var(--blue-soft); opacity: .78; transition: transform .16s ease, opacity .16s ease; }
.dashboard-link-hint svg { width: 15px; height: 15px; }
.dashboard-link-dark .dashboard-link-hint { color: #fff; background: rgba(255,255,255,.13); }
.dashboard-link:hover .dashboard-link-hint { transform: translateX(2px); opacity: 1; }
.stat-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.stat-icon svg { width: 18px; }
.stat-card.warn .stat-icon { color: var(--amber); background: var(--amber-soft); }
.stat-card.danger .stat-icon { color: var(--red); background: var(--red-soft); }
.stat-card.success .stat-icon { color: var(--green); background: var(--green-soft); }
.stat-number { margin-top: 13px; font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.stat-label { margin-top: 3px; color: var(--muted); font-size: 10px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; }
.card { border: 1px solid rgba(228,235,244,.9); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.card-head { min-height: 58px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.card-head h3 { margin: 0; font-size: 14px; }
.card-body { padding: 18px; }

.schedule-list, .activity-list, .notification-list { display: grid; gap: 10px; }
.schedule-item { padding: 12px; display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; border-radius: 13px; background: #f8fafd; }
.schedule-time { color: var(--blue); font-size: 11px; font-weight: 800; }
.schedule-item strong { display: block; font-size: 12px; }
.schedule-item small { color: var(--muted); font-size: 10px; }
.group-tag { border-radius: 8px; padding: 5px 8px; color: var(--blue); background: var(--blue-soft); font-size: 9px; font-weight: 800; }
.student-row { min-height: 58px; padding: 9px 0; display: flex; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); }
.student-row:last-child { border-bottom: 0; }
.student-info { min-width: 0; flex: 1; }
.student-info strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.student-info small { color: var(--muted); font-size: 9px; }
.row-date { color: var(--muted); font-size: 9px; }

.status { width: fit-content; border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 800; white-space: nowrap; }
.status.active, .status.paid, .status.present { color: var(--green); background: var(--green-soft); }
.status.passive, .status.overdue, .status.absent { color: var(--red); background: var(--red-soft); }
.status.pending, .status.late { color: #b97600; background: var(--amber-soft); }
.status.excused { color: var(--blue); background: var(--blue-soft); }

.filters { margin-bottom: 16px; padding: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.field-inline { position: relative; min-width: 180px; flex: 1; }
.field-inline svg { position: absolute; left: 12px; top: 50%; width: 16px; transform: translateY(-50%); color: var(--muted); }
.field-inline input, .field-inline select, .select-control { width: 100%; height: 39px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink); background: #fbfcfe; outline: none; }
.field-inline.has-icon input { padding-left: 37px; }
.field-inline input:focus, .field-inline select:focus, .select-control:focus { border-color: #91bbea; box-shadow: 0 0 0 3px rgba(10,79,163,.08); }

.table-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 12px 15px; color: var(--muted); background: #f8fafd; font-size: 9px; font-weight: 800; letter-spacing: .35px; text-align: left; text-transform: uppercase; }
.data-table td { padding: 13px 15px; border-top: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
.data-table tr { transition: background .15s ease; }
.data-table tbody tr:hover { background: #fbfdff; }
.person-cell { display: flex; gap: 10px; align-items: center; min-width: 170px; }
.person-cell .avatar { width: 34px; height: 34px; font-size: 10px; }
.person-cell strong { display: block; font-size: 11px; }
.person-cell small { color: var(--muted); font-size: 9px; }
.action-btn { width: 31px; height: 31px; border: 0; border-radius: 9px; display: inline-grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.action-btn svg { width: 14px; }

.mobile-list { display: none; }
.mobile-person-card { padding: 14px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); }
.mobile-person-top { display: flex; gap: 10px; align-items: center; }
.mobile-person-meta { margin-top: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.meta-cell { padding: 9px; border-radius: 10px; color: var(--muted); background: #f8fafd; font-size: 9px; }
.meta-cell strong { display: block; margin-top: 3px; color: var(--ink); font-size: 10px; }
.mobile-payment-status { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 9px; }

.attendance-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.attendance-row { min-height: 64px; padding: 10px 14px; display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
.attendance-row:last-child { border-bottom: 0; }
.attendance-actions { display: flex; gap: 6px; }
.attendance-btn { min-width: 34px; height: 32px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: 14px; }
.attendance-btn:hover { background: #f6f9fd; }
.attendance-btn.selected-present { color: var(--green); border-color: #9cdfc6; background: var(--green-soft); }
.attendance-btn.selected-absent { color: var(--red); border-color: #f5adb5; background: var(--red-soft); }
.attendance-btn.selected-late { color: var(--amber); border-color: #f4d18e; background: var(--amber-soft); }
.attendance-btn.selected-excused { color: var(--blue); border-color: #a5c8ed; background: var(--blue-soft); }
.summary-stack { display: grid; gap: 12px; }
.summary-panel { padding: 17px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.summary-panel h3 { margin: 0 0 15px; font-size: 13px; }
.summary-line { padding: 9px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); font-size: 10px; }
.summary-line:last-child { border-bottom: 0; }
.summary-line span { color: var(--muted); }
.summary-line strong { font-size: 11px; }

.teacher-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.teacher-card { padding: 18px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.teacher-top { display: flex; gap: 12px; align-items: center; }
.teacher-top .avatar { width: 44px; height: 44px; }
.teacher-top h3 { margin: 0; font-size: 13px; }
.teacher-top p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.teacher-stats { margin-top: 16px; padding-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border-top: 1px solid var(--line); }
.teacher-stat span { display: block; color: var(--muted); font-size: 8px; }
.teacher-stat strong { display: block; margin-top: 3px; font-size: 11px; }
.progress { height: 6px; margin-top: 15px; overflow: hidden; border-radius: 999px; background: #eaf0f7; }
.progress > span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--blue-2), #4da6f5); }
.teacher-actions { margin-top: 14px; display: flex; gap: 8px; }

.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.report-card { padding: 19px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.report-card .stat-icon { margin-bottom: 16px; }
.report-card h3 { margin: 0; font-size: 13px; }
.report-card p { min-height: 34px; margin: 7px 0 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.report-value { margin-bottom: 12px; font-size: 20px; font-weight: 800; }
.report-period-label { margin-bottom: 14px; padding: 9px 12px; display: inline-flex; gap: 7px; align-items: center; border-radius: 10px; color: var(--blue); background: var(--blue-soft); font-size: 10px; font-weight: 800; }
.report-period-label svg { width: 15px; height: 15px; }
.report-summary-grid { margin-bottom: 19px; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.report-summary-grid .stat-card { min-height: 108px; padding: 13px; }
.report-summary-grid .stat-number { font-size: 17px; }
.report-detail-section + .report-detail-section { margin-top: 22px; }
.report-detail-section h3 { margin: 0; font-size: 13px; }
.report-detail-section > p { margin: 5px 0 12px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.report-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; }
.report-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.report-table th { padding: 10px 12px; color: var(--muted); background: #f8fafd; font-size: 8px; font-weight: 800; letter-spacing: .3px; text-align: left; text-transform: uppercase; }
.report-table td { padding: 11px 12px; border-top: 1px solid var(--line); font-size: 9px; vertical-align: middle; }
.report-table tbody tr:hover { background: #fffaf0; }
.report-person-link { padding: 0; border: 0; color: var(--blue); background: transparent; font: inherit; font-weight: 800; text-align: left; text-decoration: underline; text-decoration-color: rgba(227,30,36,.25); text-underline-offset: 3px; cursor: pointer; }
.report-person-link:hover, .report-person-link:focus-visible { color: var(--red); }
.report-cell-note { margin-top: 4px; display: block; color: var(--muted); font-size: 8px; }
.report-debt { color: var(--red); }
.report-footnote { margin: 13px 0 0; color: var(--muted); font-size: 8px; line-height: 1.55; }
.finance-overview { margin-bottom: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }

.calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; }
.calendar-card { padding: 20px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.calendar-head { margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
.calendar-head h3 { margin: 0; font-size: 14px; }
.calendar-nav { display: flex; gap: 6px; }
.calendar-nav button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); background: #fff; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar-day-name { padding: 7px 0; color: var(--muted); font-size: 9px; font-weight: 800; text-align: center; }
.calendar-day { min-height: 72px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 10px; background: #fff; }
.calendar-day.dim { color: #b6bfcb; background: #fafbfd; }
.calendar-day.today { color: #fff; border-color: var(--blue); background: var(--blue); }
.day-event { width: 6px; height: 6px; margin-top: 7px; display: block; border-radius: 50%; background: var(--amber); }
.calendar-day.today .day-event { background: #8fe0bc; }
.event-card { padding: 13px; display: grid; grid-template-columns: 8px 1fr; gap: 10px; border-radius: 12px; background: #f8fafd; }
.event-line { width: 4px; border-radius: 999px; background: var(--blue); }
.event-card strong { display: block; font-size: 11px; }
.event-card p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.notification-card { padding: 15px; display: flex; gap: 13px; align-items: flex-start; border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); }
.notification-icon { width: 38px; height: 38px; flex: 0 0 auto; border-radius: 12px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.notification-icon.warn { color: var(--amber); background: var(--amber-soft); }
.notification-icon.danger { color: var(--red); background: var(--red-soft); }
.notification-icon.success { color: var(--green); background: var(--green-soft); }
.notification-icon svg { width: 18px; }
.notification-content { flex: 1; }
.notification-content strong { display: block; font-size: 11px; }
.notification-content p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.notification-time { color: var(--muted); font-size: 9px; white-space: nowrap; }

.settings-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
.settings-nav { height: fit-content; padding: 8px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.settings-nav button { width: 100%; min-height: 42px; border: 0; border-radius: 10px; padding: 0 12px; display: flex; align-items: center; gap: 10px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; text-align: left; }
.settings-nav button.active { color: var(--blue); background: var(--blue-soft); }
.settings-nav svg { width: 16px; }
.settings-card { padding: 20px; border-radius: var(--radius); background: #fff; box-shadow: var(--shadow-sm); }
.settings-card h3 { margin: 0; font-size: 14px; }
.settings-card > p { margin: 6px 0 20px; color: var(--muted); font-size: 10px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-group { display: grid; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label { color: #59677b; font-size: 9px; font-weight: 800; }
.form-control { width: 100%; min-height: 41px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink); background: #fbfcfe; outline: none; }
textarea.form-control { min-height: 82px; padding-top: 10px; resize: vertical; }
.form-control:focus { border-color: #91bbea; box-shadow: 0 0 0 3px rgba(10,79,163,.08); }
.form-control[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 3px rgba(229,74,87,.09); }
.field-error { min-height: 12px; color: var(--red); font-size: 9px; line-height: 1.35; }
.form-actions { margin-top: 18px; display: flex; justify-content: flex-end; gap: 10px; }
.calculation-note { margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; text-align: center; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(8,24,43,.55); backdrop-filter: blur(6px); animation: fade-in .18s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal { width: min(660px, 100%); max-height: calc(100vh - 38px); overflow: auto; border-radius: 22px; background: #fff; box-shadow: 0 32px 90px rgba(4,24,49,.28); animation: modal-in .22s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.modal.sm { width: min(470px, 100%); }
.modal.lg { width: min(880px, 100%); }
.modal-head { min-height: 66px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-close { width: 34px; height: 34px; border: 0; border-radius: 10px; color: var(--muted); background: #f4f6f9; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-footer { padding: 15px 20px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid var(--line); }
.profile-hero { padding: 18px; display: flex; gap: 14px; align-items: center; border-radius: 16px; background: linear-gradient(135deg, #f0f6ff, #f8fbff); }
.profile-hero .avatar { width: 58px; height: 58px; font-size: 16px; }
.profile-hero h3 { margin: 0; font-size: 16px; }
.profile-hero p { margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.profile-tabs { margin: 17px 0; display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.profile-tab { min-height: 36px; padding: 0 11px; border: 0; border-bottom: 2px solid transparent; color: var(--muted); background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; }
.profile-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.liability-banner { margin: 0 0 16px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #f1c45b; border-radius: 14px; color: #5f4300; background: #fff6d8; }
.liability-banner div { min-width: 0; display: grid; gap: 4px; }
.liability-banner strong, .liability-banner span { overflow-wrap: anywhere; }
.liability-banner b { font-size: 26px; line-height: 1; }
.liability-banner small { font-size: 9px; font-weight: 800; text-transform: uppercase; }
.liability-banner.compact { margin: 10px 0 0; padding: 10px 12px; align-items: flex-start; }
.profile-actions, .panel-head, .form-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.profile-actions { margin-top: 14px; justify-content: flex-start; }
.panel-head { margin-bottom: 14px; }
.panel-head h3, .panel-head p { margin: 0; }
.panel-head p { margin-top: 4px; color: var(--muted); font-size: 10px; }
.feature-record { margin-bottom: 9px; padding: 13px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.feature-record > div:first-child { min-width: 0; flex: 1; display: grid; gap: 4px; }
.feature-record strong, .feature-record small, .feature-record p { overflow-wrap: anywhere; }
.feature-record small { color: var(--muted); font-size: 9px; }
.feature-record p { margin: 2px 0 0; color: var(--text-soft); font-size: 10px; }
.feature-record > div:nth-child(2) { display: grid; justify-items: end; gap: 4px; }
.form-section-title { margin-top: 4px; padding-top: 13px; border-top: 1px solid var(--line); display: grid; gap: 3px; }
.form-section-title small { color: var(--muted); font-size: 10px; font-weight: 400; }
.service-record { align-items: flex-start; }
.service-payment-history { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 6px; }
.service-payment-history button, .service-payment-history span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--text-soft); background: var(--cream); font: inherit; font-size: 9px; }
.service-payment-history button { cursor: pointer; }
.service-payment-history button:hover, .service-payment-history button:focus-visible { border-color: var(--red); color: var(--red); outline: none; }
.liability-number { flex: 0 0 auto !important; text-align: center; }
.liability-number b { font-size: 23px; }
.progress-card { margin-bottom: 14px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-radius: 14px; color: #fff; background: linear-gradient(135deg, #282720, #50400b); }
.progress-card > div { min-width: 0; display: grid; gap: 5px; }
.progress-card span, .progress-card small { color: #e9e3ce; font-size: 9px; }
.progress-card strong { font-size: 18px; overflow-wrap: anywhere; }
.safe-note { padding: 11px 13px; border-left: 3px solid var(--amber); border-radius: 8px; color: var(--text-soft); background: #fff9e8; font-size: 10px; line-height: 1.55; }
.migration-notice { margin: 16px 22px 0; padding: 12px 14px; display: flex; gap: 8px; flex-wrap: wrap; border: 1px solid #f1c45b; border-radius: 12px; color: #5f4300; background: #fff6d8; font-size: 10px; }
.confirm-check { min-height: 44px; display: flex; align-items: flex-start; gap: 10px; color: var(--text-soft); font-size: 10px; line-height: 1.45; cursor: pointer; }
.confirm-check input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--red); }
.text-success { color: var(--green); }
.category-list { display: grid; gap: 8px; }
.category-row { width: 100%; min-height: 54px; padding: 10px 12px; display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #fff; text-align: left; cursor: pointer; }
.category-row > span:first-child { min-width: 0; flex: 1; display: grid; gap: 3px; }
.category-row small { color: var(--muted); }
.category-row svg { width: 16px; color: var(--muted); }
.report-filter { margin: 14px 0; max-width: 240px; display: grid; gap: 6px; }
.report-filter label { font-size: 10px; font-weight: 800; }
.teacher-payment-chart { height: 230px; padding: 20px 10px 0; display: flex; align-items: stretch; gap: 10px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #faf9f5; }
.teacher-payment-bar { min-width: 92px; flex: 1 0 92px; padding: 0; display: grid; grid-template-rows: 26px 1fr 36px; align-items: end; justify-items: center; gap: 5px; border: 0; color: var(--text); background: transparent; cursor: pointer; }
.teacher-payment-bar i { width: min(58px, 70%); min-height: 8px; display: block; border-radius: 9px 9px 3px 3px; background: linear-gradient(180deg, var(--red), #8f160e); transition: transform .18s ease; }
.teacher-payment-bar:hover i, .teacher-payment-bar:focus-visible i { transform: translateY(-4px); }
.teacher-payment-bar:focus-visible { outline: 3px solid rgba(223, 39, 27, .25); outline-offset: 2px; }
.teacher-bar-value { font-size: 10px; font-weight: 900; white-space: nowrap; }
.teacher-payment-bar small { max-width: 88px; min-height: 32px; font-size: 9px; font-weight: 800; overflow-wrap: anywhere; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-item { padding: 11px; border-radius: 11px; background: #f8fafd; }
.detail-item span { display: block; color: var(--muted); font-size: 8px; }
.detail-item strong { display: block; margin-top: 4px; font-size: 10px; }

.toast { min-width: 250px; max-width: min(360px, calc(100vw - 30px)); padding: 13px 15px; position: fixed; z-index: 150; right: 22px; bottom: 22px; display: flex; gap: 10px; align-items: center; border-radius: 13px; color: #fff; background: #17304f; box-shadow: 0 18px 50px rgba(5,23,44,.3); font-size: 11px; animation: toast-in .25s ease-out; }
@keyframes toast-in { from { transform: translateY(15px); opacity: 0; } }
.toast.success { background: #087850; }
.toast.error { background: #b83240; }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.empty svg { width: 35px; color: #aab9cc; }
.empty strong { display: block; margin-top: 10px; color: var(--ink); font-size: 12px; }
.empty p { margin: 5px auto 0; max-width: 330px; font-size: 10px; line-height: 1.6; }
.mobile-bottom-nav { display: none; }
.mobile-fab { display: none; }

.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.15fr) minmax(460px, .85fr); background: #fff; }
.login-visual { min-height: 100vh; padding: 42px clamp(40px, 7vw, 104px); position: relative; overflow: hidden; display: flex; flex-direction: column; color: #fff; background:
  radial-gradient(circle at 78% 20%, rgba(255,206,0,.28), transparent 28%),
  radial-gradient(circle at 16% 86%, rgba(227,30,36,.24), transparent 34%),
  linear-gradient(145deg, #2d2b24 0%, #1c1b17 54%, #11100e 100%); }
.login-visual::before { content: ""; position: absolute; width: 520px; height: 520px; right: -185px; bottom: -160px; border: 62px solid rgba(255,255,255,.055); border-radius: 50%; }
.login-visual::after { content: ""; position: absolute; width: 240px; height: 240px; right: 10%; top: 20%; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; box-shadow: 0 0 0 42px rgba(255,255,255,.025), 0 0 0 84px rgba(255,255,255,.018); }
.login-brand, .login-mobile-brand { position: relative; z-index: 1; display: flex; gap: 12px; align-items: center; }
.login-brand .brand-mark, .login-mobile-brand .brand-mark { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: #fff9e8; box-shadow: inset 0 0 0 1px rgba(255,206,0,.45), 0 8px 20px rgba(0,0,0,.14); }
.login-brand .brand-mark img, .login-mobile-brand .brand-mark img { width: 30px; height: 41px; }
.login-brand strong { display: block; font-size: 19px; }
.login-brand small { display: block; margin-top: 3px; color: rgba(255,255,255,.65); font-size: 10px; }
.login-copy { max-width: 620px; margin: auto 0; position: relative; z-index: 1; }
.login-kicker { padding: 7px 11px; display: inline-flex; border: 1px solid rgba(255,206,0,.28); border-radius: 999px; color: #ffdc52; background: rgba(255,206,0,.08); font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; }
.login-copy h1 { margin: 25px 0 18px; font-size: clamp(38px, 5vw, 66px); line-height: 1.03; letter-spacing: -2.4px; }
.login-copy h1 em { color: #ffce00; font-style: normal; }
.login-copy p { max-width: 510px; margin: 0; color: rgba(255,255,255,.7); font-size: 14px; line-height: 1.75; }
.login-features { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px 24px; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 700; }
.login-features span { display: flex; gap: 7px; align-items: center; }
.login-features svg { width: 16px; color: #ffce00; }
.login-panel { min-height: 100vh; padding: 40px clamp(34px, 6vw, 88px); display: grid; place-items: center; background: #fff; }
.login-box { width: min(420px, 100%); }
.login-mobile-brand { display: none; margin-bottom: 34px; color: var(--ink); }
.login-mobile-brand .brand-tagline em { color: #d69f00; }
.login-box > h2 { margin: 8px 0 5px; font-size: 29px; letter-spacing: -.8px; }
.login-subtitle { margin: 0 0 25px; color: var(--muted); font-size: 11px; }
.login-box form { display: grid; gap: 15px; }
.login-input { position: relative; }
.login-input > svg { width: 17px; position: absolute; z-index: 1; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.login-input .form-control { height: 48px; padding-left: 42px; background: #f9fbfd; }
.login-submit { width: 100%; height: 47px; margin-top: 3px; }
.login-submit svg { margin-left: auto; }
.login-error { min-height: 15px; color: var(--red); font-size: 10px; text-align: center; }
.password-change-note { margin: 0 0 16px; color: var(--muted); line-height: 1.6; }
.field-hint { display: block; margin-top: 10px; color: var(--muted); line-height: 1.5; }
.demo-divider { margin: 22px 0 13px; display: flex; align-items: center; gap: 10px; color: #9aa6b6; font-size: 9px; white-space: nowrap; }
.demo-divider::before, .demo-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.demo-accounts { display: grid; gap: 8px; }
.demo-account { width: 100%; min-height: 56px; border: 1px solid var(--line); border-radius: 13px; padding: 8px 11px; display: flex; gap: 10px; align-items: center; color: var(--ink); text-align: left; background: #fff; transition: .18s ease; }
.demo-account:hover { border-color: #efaaa6; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.demo-account > svg { width: 15px; margin-left: auto; color: #a0adbd; }
.demo-account-icon { width: 36px; height: 36px; flex: 0 0 auto; border-radius: 10px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); }
.demo-account-icon.teacher { color: #8b61d6; background: #f2edff; }
.demo-account-icon.student { color: var(--green); background: var(--green-soft); }
.demo-account-icon svg { width: 17px; }
.demo-account strong { display: block; font-size: 10px; }
.demo-account small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.login-note { margin: 13px 0 0; color: var(--muted); font-size: 8px; line-height: 1.7; text-align: center; }

.teacher-hero-summary { margin-top: 35px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; position: relative; z-index: 1; }
.teacher-hero-summary span { padding: 11px; border-radius: 12px; background: rgba(255,255,255,.09); }
.teacher-hero-summary small { display: block; color: rgba(255,255,255,.6); font-size: 8px; }
.teacher-hero-summary strong { display: block; margin-top: 5px; font-size: 11px; }
.student-welcome-card { margin-bottom: 18px; padding: 29px; min-height: 188px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; color: #fff; border-radius: 24px; background: radial-gradient(circle at 78% 15%,rgba(255,206,0,.34),transparent 25%),linear-gradient(135deg,#2a2822,#171612); box-shadow: 0 24px 55px rgba(28,27,23,.20); }
.student-welcome-card::after { content:""; width: 240px; height: 240px; position:absolute; right:-75px; bottom:-155px; border:34px solid rgba(255,255,255,.06); border-radius:50%; }
.student-welcome-copy { position: relative; z-index: 1; }
.student-welcome-copy .eyebrow { color: rgba(255,255,255,.65); }
.student-welcome-copy h2 { margin: 10px 0 7px; font-size: 27px; letter-spacing: -.7px; }
.student-welcome-copy p { margin: 0; color: rgba(255,255,255,.7); font-size: 11px; }
.student-quick-meta { margin-top: 24px; display: flex; gap: 18px; color: rgba(255,255,255,.74); font-size: 10px; }
.student-quick-meta span { display:flex; gap:7px; align-items:center; }
.student-quick-meta svg { width:15px; }
.student-level-badge { width: 100px; height: 100px; position: relative; z-index:1; flex:0 0 auto; border:1px solid rgba(255,255,255,.18); border-radius:28px; display:grid; place-content:center; text-align:center; background:rgba(255,255,255,.1); backdrop-filter:blur(8px); }
.student-level-badge small { color:rgba(255,255,255,.65); font-size:8px; text-transform:uppercase; }
.student-level-badge strong { margin-top:3px; font-size:31px; }
.student-stat-grid { grid-template-columns: repeat(4,1fr); }
.stat-name { font-size: 16px; }
.next-lesson-card { padding: 13px; display:flex; gap:14px; align-items:center; border-radius:14px; background:#f8fafd; }
.next-lesson-date { width:48px; height:52px; flex:0 0 auto; border-radius:12px; display:grid; place-content:center; text-align:center; color:#fff; background:var(--blue); }
.next-lesson-date strong { font-size:17px; line-height:1; }
.next-lesson-date small { margin-top:3px; font-size:8px; }
.payment-history-row, .account-row { min-height: 62px; padding: 10px 0; display:flex; gap:11px; align-items:center; border-bottom:1px solid var(--line); }
.payment-history-row:last-child, .account-row:last-child { border-bottom:0; }
.payment-history-icon { width:38px; height:38px; flex:0 0 auto; border-radius:11px; display:grid; place-items:center; color:var(--blue); background:var(--blue-soft); }
.payment-history-icon svg { width:17px; }
.account-list { max-height: 480px; overflow:auto; }
.account-passwords { margin-top:16px; padding:12px; border-radius:11px; background:var(--amber-soft); }

.lifecycle-shortcuts { margin: -3px 0 14px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.filter-chip { min-height: 40px; flex: 0 0 auto; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); background: #fff; font-size: 10px; font-weight: 750; }
.filter-chip b { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; color: var(--ink); background: #f4efe5; font-size: 9px; }
.filter-chip.active { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); }
.filter-chip.active b { color: #fff; background: var(--blue); }
.status.lifecycle-applicant { color: #6b5d31; background: #fff5cb; }
.status.lifecycle-trial { color: #7147ad; background: #f2eaff; }
.status.lifecycle-trial-no-show, .status.lifecycle-trial-not-converted, .status.lifecycle-stopped { color: var(--red); background: var(--red-soft); }
.status.lifecycle-frozen { color: #8b6700; background: var(--amber-soft); }
.status.lifecycle-completed { color: #075f48; background: var(--green-soft); }
.group-grid, .group-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.group-card, .group-management-card { min-width: 0; padding: 17px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); border-top: 4px solid var(--group-color, var(--blue)); }
.group-card-head { display: flex; gap: 10px; align-items: flex-start; }
.group-card-head > div { min-width: 0; flex: 1; }
.group-card-head h3 { margin: 0; font-size: 14px; }
.group-card-head p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.group-color-swatch, .group-dot { width: 12px; height: 12px; flex: 0 0 auto; margin-top: 3px; border-radius: 50%; background: var(--group-color, var(--blue)); }
.group-dot { display: inline-block; margin: 0 7px 0 0; background: var(--group-color, var(--blue)); }
.group-card-meta, .group-facts { margin: 15px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.group-card-meta span, .group-facts span { min-width: 0; padding: 9px; border-radius: 10px; background: #faf7f0; }
.group-card-meta small, .group-card-meta strong, .group-facts small, .group-facts strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.group-card-meta small, .group-facts small { color: var(--muted); font-size: 8px; }
.group-card-meta strong, .group-facts strong { margin-top: 3px; font-size: 10px; white-space: nowrap; }
.group-card-actions, .row-actions, .profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.trial-metrics { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.trial-metrics .stat-card { min-height: 108px; }
.data-table td small, .report-table td small { display: block; margin-top: 4px; color: var(--muted); }
.monthly-attendance-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 15px; background: #fff; box-shadow: var(--shadow-sm); scrollbar-gutter: stable; }
.monthly-attendance-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; font-size: 10px; }
.monthly-attendance-table th, .monthly-attendance-table td { min-width: 51px; height: 50px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: center; background: #fff; }
.monthly-attendance-table th { height: 55px; position: sticky; z-index: 5; top: 0; color: var(--muted); background: #faf7f0; font-size: 9px; }
.monthly-attendance-table th span, .monthly-attendance-table th small { display: block; }
.monthly-attendance-table .sticky-number { width: 52px; min-width: 52px; position: sticky; z-index: 7; left: 0; }
.monthly-attendance-table .sticky-student { width: 170px; min-width: 170px; position: sticky; z-index: 6; left: 52px; text-align: left; box-shadow: 7px 0 12px rgba(56,42,19,.04); }
.monthly-attendance-table thead .sticky-number, .monthly-attendance-table thead .sticky-student { z-index: 9; background: #f5efe4; }
.monthly-attendance-table tr.repeated-absence td { background: #fff8f6; }
.monthly-attendance-table tr.repeated-absence .sticky-number, .monthly-attendance-table tr.repeated-absence .sticky-student { background: #fff1ee; }
.attendance-grid-cell { width: 38px; height: 38px; border: 1px solid #ded8cc; border-radius: 10px; color: #8d887e; background: #faf8f4; font-weight: 900; text-transform: lowercase; }
.attendance-grid-cell:hover:not(:disabled), .attendance-grid-cell:focus-visible { outline: 3px solid rgba(227,30,36,.16); border-color: var(--blue); }
.attendance-grid-cell.present { color: #087850; border-color: #a7dfcc; background: var(--green-soft); }
.attendance-grid-cell.absent { color: var(--red); border-color: #f0b1ae; background: var(--red-soft); }
.attendance-grid-cell.late { color: #986f00; border-color: #eed578; background: var(--amber-soft); }
.attendance-grid-cell.excused { color: #61429b; border-color: #d8c4f2; background: #f2eaff; }
.attendance-grid-cell.edited { box-shadow: inset 0 0 0 2px currentColor; }
.attendance-grid-cell:disabled { cursor: not-allowed; opacity: .48; }
.student-name-button, .report-person-link { padding: 0; border: 0; color: var(--blue); background: transparent; text-align: left; font-weight: 750; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.student-name-button:hover, .report-person-link:hover { text-decoration-color: currentColor; }
.phone-cell { min-width: 145px; display: flex; gap: 7px; align-items: center; justify-content: space-between; white-space: nowrap; }
.whatsapp-btn { color: #087850; background: var(--green-soft); font-weight: 900; }
.attendance-legend, .attendance-summary-bar { margin: 11px 0; padding: 10px 12px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); }
.attendance-legend small { margin-left: auto; max-width: 520px; color: var(--muted); line-height: 1.5; }
.attendance-code { padding: 6px 8px; border-radius: 8px; font-weight: 900; }
.attendance-code b { margin-left: 3px; font-size: 8px; font-weight: 700; }
.attendance-code.present { color: #087850; background: var(--green-soft); }
.attendance-code.absent { color: var(--red); background: var(--red-soft); }
.attendance-code.late { color: #986f00; background: var(--amber-soft); }
.attendance-code.excused { color: #61429b; background: #f2eaff; }
.attendance-summary-bar span { color: var(--muted); font-size: 9px; }
.attendance-summary-bar b { margin-left: 3px; color: var(--ink); font-size: 11px; }
.correction-field { min-width: 310px; flex: 1; }
.correction-field span { flex: 0 0 auto; color: var(--muted); font-size: 9px; }
.text-success { color: var(--green); }
.text-danger, .danger-text { color: var(--red) !important; }
.lifecycle-trend-card { margin-top: 15px; }
.trend-legend { display: flex; gap: 12px; font-size: 8px; font-weight: 800; }
.trend-legend span::before { content: ""; width: 8px; height: 8px; margin-right: 4px; display: inline-block; border-radius: 2px; background: currentColor; }
.trend-legend .active { color: var(--green); }
.trend-legend .new { color: var(--blue); }
.trend-legend .stopped { color: var(--red); }
.lifecycle-trend { height: 220px; padding: 12px 6px 0; display: grid; grid-template-columns: repeat(6, minmax(72px, 1fr)); gap: 10px; overflow-x: auto; }
.lifecycle-trend-month { min-width: 72px; height: 100%; padding: 0 4px 8px; border: 0; display: grid; grid-template-rows: 1fr auto; gap: 7px; color: var(--muted); background: transparent; }
.lifecycle-trend-month:hover { background: #faf7f0; }
.trend-bars { min-height: 150px; display: flex; gap: 3px; align-items: end; justify-content: center; }
.trend-bars i { width: 18px; min-height: 4px; position: relative; border-radius: 5px 5px 1px 1px; background: currentColor; }
.trend-bars i.active { color: var(--green); }
.trend-bars i.new { color: var(--blue); }
.trend-bars i.stopped { color: var(--red); }
.trend-bars b { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); color: var(--ink); font-size: 8px; font-style: normal; }
.teacher-lifecycle-breakdown, .teacher-payment-summary { margin-top: 15px; }
.calendar-day { border: 0; text-align: left; }
.calendar-day.selected { box-shadow: inset 0 0 0 2px var(--blue); background: var(--blue-soft); }
.calendar-day small { float: right; color: var(--blue); font-size: 8px; }
.calendar-upcoming { width: 100%; border: 0; text-align: left; }
.notification-card.read { opacity: .62; background: #f8f7f3; }
.notification-card.read strong::after { content: " · oxundu"; color: var(--green); font-size: 8px; }
.weekday-picker { border: 0; padding: 0; margin: 0; }
.weekday-picker legend { margin-bottom: 7px; font-size: 9px; font-weight: 750; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 7px; }
.weekday-picker label { min-height: 40px; display: inline-flex; align-items: center; }
.weekday-picker input { position: absolute; opacity: 0; }
.weekday-picker span { padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 9px; }
.weekday-picker input:checked + span { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.timeline-list { position: relative; display: grid; gap: 10px; }
.timeline-item { display: grid; grid-template-columns: 16px 1fr; gap: 9px; }
.timeline-item > i { width: 10px; height: 10px; margin-top: 3px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 2px #f0b0ae; }
.timeline-item strong, .timeline-item small, .timeline-item p { display: block; }
.timeline-item small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.timeline-item p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }
.subsection-title { margin: 20px 0 10px; font-size: 12px; }
.confirm-check { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 9px; line-height: 1.5; }
.confirm-check input { margin-top: 2px; }
.settings-group-row { width: 100%; border: 0; text-align: left; }
.color-input { min-height: 45px; padding: 5px; }

@media (max-width: 1250px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .teacher-grid { grid-template-columns: repeat(2, 1fr); }
  .group-grid, .group-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trial-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 980px) {
  :root { --sidebar: 82px; }
  .sidebar { padding-inline: 12px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > div:last-child, .nav-item span, .nav-badge, .sidebar-user > div:last-child { display: none; }
  .nav-item { justify-content: center; padding-inline: 0; }
  .sidebar-user { justify-content: center; padding: 9px; }
  .content-grid, .hero-grid { grid-template-columns: 1fr; }
  .today-card { min-height: 180px; }
  .report-grid { grid-template-columns: repeat(2, 1fr); }
  .calendar-layout, .attendance-layout { grid-template-columns: 1fr; }
  .summary-stack { grid-template-columns: repeat(2, 1fr); }
  .login-page { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .login-panel { min-height: 100vh; }
  .login-mobile-brand { display: flex; }
  .student-stat-grid { grid-template-columns: repeat(2,1fr); }
  .group-grid, .group-card-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --radius: 16px; }
  body { background: #fff9ee; }
  .sidebar { display: none; }
  .main { margin-left: 0; }
  .topbar { height: 68px; padding: 0 17px; background: rgba(255,249,238,.94); }
  .topbar-title h1 { font-size: 19px; }
  .topbar-title p { font-size: 10px; }
  .global-search { display: none; }
  .page { padding: 18px 15px 96px; }
  .hero-grid { gap: 13px; }
  .revenue-card { min-height: 204px; padding: 21px; border-radius: 21px; }
  .mini-chart { gap: 4px; }
  .today-card { min-height: 190px; padding: 18px; border-radius: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { min-height: 110px; padding: 14px; }
  .stat-number { font-size: 20px; }
  .content-grid { grid-template-columns: 1fr; gap: 13px; }
  .section-head { align-items: flex-start; }
  .section-head .toolbar .btn-light { display: none; }
  .btn { min-height: 44px; }
  .icon-btn, .action-btn, .modal-close { width: 44px; height: 44px; }
  .data-table { display: none; }
  .table-card { border: 0; overflow: visible; background: transparent; box-shadow: none; }
  .mobile-list { display: grid; gap: 10px; }
  .filters { padding: 10px; }
  .field-inline { min-width: calc(50% - 6px); }
  .field-inline:first-child { min-width: 100%; }
  .teacher-grid, .report-grid, .finance-overview { grid-template-columns: 1fr; }
  .report-summary-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .summary-stack { grid-template-columns: 1fr; }
  .calendar-layout { grid-template-columns: 1fr; }
  .calendar-card { padding: 13px; }
  .calendar-day { min-height: 49px; padding: 5px; }
  .settings-layout { grid-template-columns: 1fr; }
  .settings-nav { display: flex; gap: 5px; overflow-x: auto; }
  .settings-nav button { width: auto; flex: 0 0 auto; }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal, .modal.sm, .modal.lg { width: 100%; max-height: 92vh; border-radius: 23px 23px 0 0; }
  .modal-body { padding: 17px; }
  .attendance-row { align-items: flex-start; flex-wrap: wrap; }
  .attendance-row .student-info { min-width: 160px; }
  .attendance-actions { width: 100%; justify-content: flex-end; }
  .attendance-btn { min-height: 44px; flex: 1; }
  .mobile-bottom-nav { height: 66px; position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr); padding: 5px 7px max(5px, env(safe-area-inset-bottom)); border-top: 1px solid #ebe3d2; background: rgba(255,255,255,.97); backdrop-filter: blur(16px); box-shadow: 0 -7px 26px rgba(56,42,19,.08); }
  .mobile-nav-item { border: 0; border-radius: 11px; display: grid; place-items: center; gap: 1px; color: #8b97a7; background: transparent; font-size: 8px; font-weight: 700; }
  .mobile-nav-item svg { width: 19px; height: 19px; }
  .mobile-nav-item.active { color: var(--blue); background: var(--blue-soft); }
  .mobile-fab { width: 50px; height: 50px; position: fixed; z-index: 49; right: 16px; bottom: 79px; border: 0; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--blue-2), var(--blue)); box-shadow: 0 12px 30px rgba(227,30,36,.28); }
  .mobile-fab svg { width: 21px; }
  .toast { right: 15px; bottom: 78px; }
  .login-panel { padding: 28px 22px; place-items: start center; }
  .login-box { padding-top: 18px; }
  .login-mobile-brand .brand-mark { background:#fff9e8; }
  .student-welcome-card { min-height: 220px; padding: 22px; align-items:flex-start; }
  .student-welcome-copy h2 { max-width: 210px; font-size:22px; }
  .student-level-badge { width:76px; height:76px; border-radius:22px; }
  .student-level-badge strong { font-size:24px; }
  .student-quick-meta { flex-direction:column; gap:8px; margin-top:20px; }
  .teacher-hero-summary { grid-template-columns:1fr 1fr; margin-top:22px; }
  .teacher-hero-summary span:last-child { grid-column:1/-1; }
  .next-lesson-card { align-items:flex-start; flex-wrap:wrap; }
  .mobile-more-grid .report-card { min-height: 112px; }
  .feature-record { align-items: flex-start; flex-wrap: wrap; }
  .feature-record > div:first-child { flex-basis: calc(100% - 80px); }
  .feature-record .btn { width: 100%; }
  .liability-banner { align-items: flex-start; }
  .profile-tabs { margin-left: -17px; margin-right: -17px; padding: 0 17px; }
  .progress-card { align-items: flex-start; flex-direction: column; }
  .panel-head { align-items: flex-start; }
  .panel-head .btn { width: 100%; }
  .teacher-payment-chart { height: 210px; padding-inline: 6px; }
  .teacher-payment-bar { min-width: 78px; flex-basis: 78px; }
  .report-filter { max-width: none; }
  .lifecycle-shortcuts { margin-inline: -15px; padding-inline: 15px; }
  .trial-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .monthly-attendance-page .section-head .toolbar .btn-primary { display: inline-flex; }
  .attendance-filters .field-inline, .correction-field { min-width: 100%; }
  .attendance-legend { align-items: flex-start; }
  .attendance-legend small { width: 100%; margin-left: 0; }
  .monthly-attendance-scroll { border-radius: 12px; }
  .monthly-attendance-table .sticky-student { width: 132px; min-width: 132px; }
  .group-card-actions .btn { flex: 1; }
  .lifecycle-trend { margin-inline: -8px; }
}

@media print {
  .sidebar, .topbar-actions, .mobile-bottom-nav, .mobile-fab, .toolbar { display: none !important; }
  .main { margin: 0; }
  .topbar { position: static; padding: 0; background: #fff; }
  .page { padding: 12px 0; }
  body { background: #fff; }
  .card, .table-card, .report-card, .stat-card { box-shadow: none; break-inside: avoid; }
}
