:root {
  color-scheme: light;
  --bg: #f3f7f6;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --surface-mint: #eaf7f3;
  --line: #dfeae7;
  --line-soft: #ebf1ef;
  --text: #173d38;
  --text-2: #526f6a;
  --text-3: #80938f;
  --brand: #117b70;
  --brand-2: #1b9586;
  --brand-dark: #0d5e56;
  --brand-soft: #daf0eb;
  --blue: #427fa5;
  --blue-soft: #e5f0f7;
  --amber: #a87516;
  --amber-soft: #fff2d9;
  --danger: #b94741;
  --danger-soft: #ffedeb;
  --success: #137869;
  --success-soft: #dcf2ec;
  --shadow-sm: 0 4px 14px rgba(22, 72, 64, .05);
  --shadow-md: 0 14px 40px rgba(20, 70, 62, .10);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --sidebar: 248px;
  --focus: 0 0 0 3px rgba(27, 149, 134, .22);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { color: inherit; font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
input, select, textarea { outline: none; }
input:focus, select:focus, textarea:focus, button:focus-visible, [tabindex]:focus-visible { box-shadow: var(--focus); }
a { color: var(--brand); }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#i-grid path { fill: currentColor; stroke: none; }
[hidden] { display: none !important; }

.login-view {
  min-height: 100vh;
  padding: 28px clamp(24px, 5vw, 72px) 48px;
  overflow: hidden;
  background:
    radial-gradient(circle at 8% 92%, rgba(59, 177, 157, .12), transparent 29%),
    radial-gradient(circle at 92% 12%, rgba(71, 137, 168, .10), transparent 27%),
    #f6faf9;
}
.login-brand, .sidebar-brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { position: relative; display: grid; width: 42px; height: 42px; place-items: center; overflow: hidden; border-radius: 14px; background: linear-gradient(145deg, #20a18f, #0d6d63); color: #fff; box-shadow: 0 8px 20px rgba(17, 123, 112, .22); font-size: 18px; font-weight: 750; }
.brand-mark::after { position: absolute; right: -12px; bottom: -14px; width: 35px; height: 35px; border: 7px solid rgba(255,255,255,.18); border-radius: 50%; content: ""; }
.brand-mark span { z-index: 1; }
.brand-mark--large { width: 48px; height: 48px; border-radius: 16px; }
.login-brand strong, .sidebar-brand strong { display: block; letter-spacing: .02em; font-size: 18px; }
.login-brand div:last-child > span, .sidebar-brand div:last-child > span { display: block; margin-top: 1px; color: var(--text-3); font-size: 11px; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px); min-height: calc(100vh - 110px); align-items: center; gap: clamp(48px, 9vw, 140px); max-width: 1220px; margin: 0 auto; }
.login-intro { max-width: 650px; padding-left: clamp(0px, 2vw, 28px); }
.eyebrow, .mini-kicker, .topbar-eyebrow { color: var(--brand); letter-spacing: .16em; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.login-intro h1 { margin: 24px 0 22px; color: #133e38; letter-spacing: -.045em; font-size: clamp(46px, 5.2vw, 74px); font-weight: 720; line-height: 1.13; }
.login-intro > p { max-width: 560px; margin: 0; color: var(--text-2); font-size: 17px; line-height: 1.9; }
.intro-points { display: flex; gap: 22px; margin-top: 56px; }
.intro-points div { display: flex; min-width: 135px; flex-direction: column; gap: 8px; padding-top: 13px; border-top: 1px solid #cee0dc; color: #365c56; font-size: 13px; font-weight: 600; }
.point-index { color: var(--brand-2); font-size: 10px; letter-spacing: .1em; }
.login-card { padding: 42px; border: 1px solid rgba(201, 221, 216, .86); border-radius: 26px; background: rgba(255,255,255,.92); box-shadow: 0 28px 80px rgba(24, 77, 68, .12); backdrop-filter: blur(12px); }
.login-card__header { margin-bottom: 28px; }
.login-card h2 { margin: 8px 0 5px; letter-spacing: -.02em; font-size: 27px; }
.login-card__header p, .login-help { margin: 0; color: var(--text-3); font-size: 12px; }
.login-help { margin-top: 20px; text-align: center; }
.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > span, .field-label { color: #3c5c57; font-size: 12px; font-weight: 650; }
.field input, .field select, .field textarea, .input, .select {
  width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d9e5e2; border-radius: 11px; background: #fbfdfc; transition: border-color .18s, box-shadow .18s, background .18s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: #b9d1cc; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand-2); background: #fff; }
.field textarea { min-height: 92px; resize: vertical; }
.field-error { margin-top: -3px; color: var(--danger); font-size: 11px; }
.field-help { margin-top: -2px; color: var(--text-3); font-size: 10px; line-height: 1.55; }
.field input:disabled { border-style: dashed; background: #f1f6f4; color: var(--text-2); cursor: not-allowed; }
.family-phone-notice { border-color: #c9ded9; background: var(--surface-mint); color: #315d57; line-height: 1.65; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 62px; }
.text-button { border: 0; background: transparent; color: var(--brand); font-size: 12px; font-weight: 650; }
.password-wrap .text-button { position: absolute; top: 50%; right: 7px; padding: 7px; transform: translateY(-50%); }
.form-alert { margin-bottom: 18px; padding: 10px 12px; border: 1px solid #f1cbc7; border-radius: 10px; background: var(--danger-soft); color: #943d37; font-size: 12px; }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; padding: 8px 14px; border: 1px solid transparent; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 650; transition: transform .15s, box-shadow .15s, border-color .15s, background .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button svg { width: 16px; height: 16px; }
.button--primary { background: linear-gradient(135deg, var(--brand-2), var(--brand)); color: #fff; box-shadow: 0 7px 16px rgba(17, 123, 112, .18); }
.button--secondary { border-color: #cfe3df; background: var(--surface-mint); color: var(--brand-dark); }
.button--plain { border-color: var(--line); color: var(--text-2); }
.button--danger { border-color: #f0d1ce; background: var(--danger-soft); color: var(--danger); }
.button--wide { width: 100%; min-height: 46px; }
.login-submit { margin-top: 6px; }
.icon-button { display: inline-grid; width: 38px; height: 38px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text-2); }
.icon-button:hover { border-color: #bdd7d2; background: var(--surface-mint); color: var(--brand); }
.icon-button--danger:hover { border-color: #efcbc8; background: var(--danger-soft); color: var(--danger); }

.app-view { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; top: 0; bottom: 0; left: 0; display: flex; width: var(--sidebar); flex-direction: column; padding: 24px 16px 16px; border-right: 1px solid #dfe9e7; background: rgba(251,253,252,.96); backdrop-filter: blur(12px); }
.sidebar-brand { padding: 0 10px 26px; }
.main-nav { display: flex; min-height: 0; flex: 1; flex-direction: column; gap: 4px; overflow-y: auto; }
.nav-item { position: relative; display: flex; width: 100%; min-height: 43px; align-items: center; gap: 12px; padding: 9px 12px; border: 0; border-radius: 11px; background: transparent; color: #5c7772; text-align: left; }
.nav-item::before { position: absolute; top: 12px; bottom: 12px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); content: ""; opacity: 0; }
.nav-item:hover { background: #f0f6f4; color: #315d57; }
.nav-item.is-active { background: #e4f3ef; color: var(--brand-dark); font-weight: 680; }
.nav-item.is-active::before { opacity: 1; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item span:nth-child(2) { flex: 1; }
.nav-count { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 6px; border-radius: 999px; background: #fff0d2; color: #906715; font-size: 10px; font-weight: 750; }
.nav-label { margin: 18px 12px 7px; color: #99a9a6; letter-spacing: .12em; font-size: 9px; font-weight: 750; }
.sidebar-profile { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 13px 10px 3px; border-top: 1px solid var(--line-soft); }
.avatar { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border-radius: 12px; background: linear-gradient(145deg, #d8f1eb, #c2e4dc); color: var(--brand-dark); font-weight: 750; }
.sidebar-profile__copy { min-width: 0; flex: 1; }
.sidebar-profile__copy strong, .sidebar-profile__copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-profile__copy strong { font-size: 12px; }
.sidebar-profile__copy span { margin-top: 2px; color: var(--text-3); font-size: 10px; }
.sidebar-profile .icon-button { width: 32px; height: 32px; border: 0; background: transparent; }

.workspace { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; z-index: 20; top: 0; display: flex; min-height: 74px; align-items: center; gap: 14px; padding: 12px clamp(20px, 3vw, 38px); border-bottom: 1px solid rgba(218,231,228,.88); background: rgba(244,248,247,.88); backdrop-filter: blur(13px); }
.topbar > div:nth-child(2) { flex: 1; }
.topbar h1 { margin: 1px 0 0; letter-spacing: -.02em; font-size: 23px; line-height: 1.2; }
.topbar-eyebrow { letter-spacing: .12em; font-size: 9px; }
.topbar-actions { display: flex; align-items: center; gap: 9px; }
.sync-state { display: flex; align-items: center; gap: 7px; margin-right: 4px; color: var(--text-3); font-size: 11px; }
.sync-dot { width: 7px; height: 7px; border-radius: 50%; background: #27a791; box-shadow: 0 0 0 4px rgba(39,167,145,.1); }
.sync-state.is-error .sync-dot { background: var(--danger); box-shadow: 0 0 0 4px rgba(185,71,65,.1); }
.content { max-width: 1500px; margin: 0 auto; padding: 26px clamp(20px, 3vw, 38px) 70px; outline: none; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.page-head h2 { margin: 0; letter-spacing: -.025em; font-size: 25px; }
.page-head p { max-width: 620px; margin: 6px 0 0; color: var(--text-3); }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card { border: 1px solid rgba(216,230,227,.96); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.card-head { display: flex; min-height: 60px; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid var(--line-soft); }
.card-head h3 { margin: 0; font-size: 14px; }
.card-head p { margin: 3px 0 0; color: var(--text-3); font-size: 11px; }
.card-body { padding: 18px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; min-height: 132px; overflow: hidden; padding: 20px; }
.metric-card::after { position: absolute; right: -18px; bottom: -28px; width: 88px; height: 88px; border: 18px solid rgba(42,161,143,.06); border-radius: 50%; content: ""; }
.metric-card--amber::after { border-color: rgba(195,139,38,.07); }
.metric-card--blue::after { border-color: rgba(66,127,165,.07); }
.metric-label { display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 11px; }
.metric-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 9px; background: var(--surface-mint); color: var(--brand); }
.metric-icon svg { width: 15px; height: 15px; }
.metric-value { display: block; margin-top: 16px; color: #17453f; font-size: 28px; font-weight: 740; letter-spacing: -.035em; }
.metric-note { display: block; margin-top: 5px; color: var(--text-3); font-size: 10px; }
.workflow-callout { display: flex; align-items: center; gap: 13px; margin: -2px 0 18px; padding: 14px 16px; border: 1px solid #c9e8e2; border-radius: 14px; background: #f0faf7; }
.workflow-callout__mark { flex: none; padding: 6px 9px; border-radius: 9px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 750; }
.workflow-callout > span:nth-child(2) { min-width: 0; flex: 1; }
.workflow-callout strong, .workflow-callout small { display: block; }
.workflow-callout strong { color: #20534c; font-size: 12px; }
.workflow-callout small { margin-top: 3px; color: var(--text-3); font-size: 10px; }
.attendance-scope { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 11px 14px; border: 1px solid #cfe7e2; border-radius: 12px; background: #f4faf8; }
.attendance-scope span { padding: 4px 7px; border-radius: 7px; background: var(--surface-mint); color: var(--brand); font-size: 9px; font-weight: 700; }
.attendance-scope strong { color: #27544e; font-size: 12px; }
.attendance-scope small { color: var(--text-3); font-size: 10px; }
.attendance-helper { margin: -6px 0 16px; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 11px; background: rgba(255,255,255,.65); color: var(--text-3); font-size: 10px; }
.attendance-helper summary { cursor: pointer; color: #436b65; font-weight: 650; }
.attendance-helper p { margin: 8px 0 2px; line-height: 1.6; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .75fr); gap: 18px; }
.stack { display: grid; gap: 18px; align-content: start; }
.timeline-list, .task-list { display: grid; }
.timeline-item { display: grid; grid-template-columns: 78px 10px minmax(0, 1fr) auto; align-items: center; gap: 13px; min-height: 72px; padding: 11px 18px; border-bottom: 1px solid var(--line-soft); }
.timeline-item:last-child, .task-item:last-child { border-bottom: 0; }
.timeline-time strong, .timeline-time span { display: block; }
.timeline-time strong { color: #315b55; font-size: 12px; }
.timeline-time span { margin-top: 3px; color: var(--text-3); font-size: 9px; }
.timeline-rail { width: 8px; height: 8px; border: 2px solid #cae9e2; border-radius: 50%; background: var(--brand-2); }
.item-title { display: block; color: #214943; font-size: 12px; font-weight: 680; }
.item-meta { display: block; margin-top: 4px; color: var(--text-3); font-size: 10px; }
.item-next { display: block; margin-top: 5px; color: var(--brand); font-size: 10px; font-weight: 680; }
.task-item { display: flex; min-height: 64px; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.task-mark { display: grid; width: 34px; height: 34px; flex: none; place-items: center; border-radius: 11px; background: var(--surface-mint); color: var(--brand); font-size: 11px; font-weight: 750; }
.task-mark--amber { background: var(--amber-soft); color: var(--amber); }
.task-copy { min-width: 0; flex: 1; }
.task-action { border: 0; background: transparent; color: var(--brand); font-size: 11px; font-weight: 680; }

.status { display: inline-flex; min-height: 23px; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 999px; background: #edf2f1; color: #617772; font-size: 9px; font-weight: 700; white-space: nowrap; }
.status::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.status--success { background: var(--success-soft); color: var(--success); }
.status--warning { background: var(--amber-soft); color: var(--amber); }
.status--danger { background: var(--danger-soft); color: var(--danger); }
.status--info { background: var(--blue-soft); color: var(--blue); }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #edf3f1; }
.segmented button { min-width: 46px; min-height: 31px; padding: 5px 10px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-size: 11px; }
.segmented button.is-active { background: #fff; color: var(--brand-dark); box-shadow: 0 2px 8px rgba(28,77,70,.08); font-weight: 700; }
.date-nav { display: flex; align-items: center; gap: 7px; }
.date-nav strong { min-width: 175px; text-align: center; }
.filter-input { min-width: 190px; min-height: 38px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; top: 50%; left: 11px; width: 15px; height: 15px; color: #91a39f; transform: translateY(-50%); }
.search-wrap input { padding-left: 34px; }

.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.data-table th { height: 42px; padding: 9px 13px; border-bottom: 1px solid var(--line); background: #f7faf9; color: #758b87; font-size: 9px; font-weight: 700; letter-spacing: .035em; text-align: left; white-space: nowrap; }
.data-table td { min-height: 54px; padding: 12px 13px; border-bottom: 1px solid var(--line-soft); color: #395b56; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdfc; }
.cell-main, .cell-sub { display: block; }
.cell-main { color: #244d47; font-weight: 650; }
.cell-sub { margin-top: 3px; color: var(--text-3); font-size: 9px; }
.money { color: #146f66; font-variant-numeric: tabular-nums; font-weight: 700; }
.action-group { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.table-action { padding: 5px 7px; border: 0; border-radius: 7px; background: transparent; color: var(--brand); font-size: 10px; font-weight: 650; }
.table-action:hover { background: var(--surface-mint); }
.table-action--danger { color: var(--danger); }
.table-action--danger:hover { background: var(--danger-soft); }

.schedule-week { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); min-width: 930px; border-top: 1px solid var(--line-soft); }
.week-column { min-height: 520px; border-right: 1px solid var(--line-soft); }
.week-column:last-child { border-right: 0; }
.week-head { position: sticky; top: 0; z-index: 2; padding: 13px 10px; border-bottom: 1px solid var(--line-soft); background: #f8fbfa; text-align: center; }
.week-head strong, .week-head span { display: block; }
.week-head strong { font-size: 12px; }
.week-head span { margin-top: 2px; color: var(--text-3); font-size: 9px; }
.week-head.is-today { background: #e9f6f2; color: var(--brand-dark); }
.week-events { display: grid; gap: 7px; padding: 9px; }
.schedule-event { width: 100%; padding: 9px; border: 1px solid #cee4df; border-left: 3px solid var(--brand-2); border-radius: 9px; background: #f0f8f6; color: #315851; text-align: left; }
.schedule-event:hover { border-color: #9bc9c0; background: #e7f5f1; }
.schedule-event strong, .schedule-event span { display: block; }
.schedule-event strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.schedule-event span { margin-top: 3px; color: #6c8580; font-size: 9px; }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(110px, 1fr)); min-width: 800px; }
.month-weekday { padding: 10px; border-bottom: 1px solid var(--line); background: #f7faf9; color: var(--text-3); font-size: 9px; font-weight: 700; text-align: center; }
.month-day { min-height: 122px; padding: 9px; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: #fff; }
.month-day:nth-child(7n) { border-right: 0; }
.month-day.is-muted { background: #fafcfc; color: #acb9b6; }
.month-day.is-today { box-shadow: inset 0 0 0 2px #57b9aa; }
.month-date { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 10px; font-weight: 700; }
.month-count { color: var(--brand); font-size: 8px; }
.month-event { display: block; width: 100%; margin-top: 4px; overflow: hidden; padding: 4px 5px; border: 0; border-radius: 5px; background: var(--surface-mint); color: #2f625b; font-size: 8px; text-align: left; text-overflow: ellipsis; white-space: nowrap; }

.tabs { display: flex; gap: 5px; margin-bottom: 15px; padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #edf3f1; width: fit-content; }
.tab { min-height: 32px; padding: 5px 14px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-size: 11px; }
.tab.is-active { background: #fff; color: var(--brand-dark); box-shadow: 0 2px 8px rgba(28,77,70,.08); font-weight: 700; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell .avatar { width: 33px; height: 33px; border-radius: 10px; font-size: 11px; }
.progress { height: 6px; overflow: hidden; border-radius: 999px; background: #e8efed; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-2), #57bbaa); }
.stat-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(280px, .65fr); gap: 18px; }
.bar-list { display: grid; gap: 16px; }
.bar-row__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 7px; }
.bar-row__head strong { font-size: 11px; }
.bar-row__head span { color: var(--brand-dark); font-size: 11px; font-weight: 700; }
.bar-row__meta { display: flex; justify-content: space-between; margin-top: 5px; color: var(--text-3); font-size: 9px; }
.money-summary { padding: 22px; background: linear-gradient(140deg, #164f47, #14776c); color: #fff; }
.money-summary__label { color: rgba(255,255,255,.65); font-size: 10px; }
.money-summary__total { display: block; margin: 5px 0 18px; font-size: 30px; font-weight: 740; letter-spacing: -.03em; }
.money-summary__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.money-summary__grid div { padding: 9px; border-radius: 9px; background: rgba(255,255,255,.08); }
.money-summary__grid span, .money-summary__grid strong { display: block; }
.money-summary__grid span { color: rgba(255,255,255,.6); font-size: 8px; }
.money-summary__grid strong { margin-top: 4px; font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .42fr); gap: 18px; }
.settings-section + .settings-section { margin-top: 18px; }
.setting-row { display: flex; min-height: 68px; align-items: center; gap: 16px; padding: 13px 18px; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: 0; }
.setting-row__copy { min-width: 0; flex: 1; }
.setting-row__copy strong, .setting-row__copy span { display: block; }
.setting-row__copy strong { font-size: 12px; }
.setting-row__copy span { margin-top: 3px; color: var(--text-3); font-size: 9px; }
.setting-row .field { width: min(270px, 46%); margin: 0; }
.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cdd9d6; transition: .2s; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); content: ""; transition: .2s; }
.switch input:checked + span { background: var(--brand-2); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.info-panel { padding: 20px; }
.info-panel h3 { margin: 0 0 8px; font-size: 14px; }
.info-panel p { margin: 0; color: var(--text-3); font-size: 10px; line-height: 1.7; }
.info-list { display: grid; gap: 10px; margin-top: 18px; }
.info-list div { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding-top: 10px; border-top: 1px solid var(--line-soft); font-size: 10px; }
.configured { color: var(--success); font-weight: 700; }
.not-configured { color: var(--amber); font-weight: 700; }

.import-layout { display: grid; }
.import-layout > section + section, .import-detail + section { border-top: 1px solid var(--line); }
.import-summary { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 10px; }
.import-summary div { padding: 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: var(--surface-soft); }
.import-summary span, .import-summary strong { display: block; }
.import-summary span { color: var(--text-3); font-size: 9px; }
.import-summary strong { margin-top: 5px; color: var(--brand-dark); font-size: 14px; }
.import-summary .import-number--danger { color: var(--danger); }
.import-issues { min-width: 210px; }
.import-issues span { display: block; color: var(--text-3); font-size: 9px; line-height: 1.55; }
.import-issues span.is-error { color: var(--danger); }
.table-note { margin: 0; padding: 10px 14px; border-top: 1px solid var(--line-soft); color: var(--text-3); font-size: 9px; }

.guardian-tabs { max-width: 100%; overflow-x: auto; }
.teacher-device-card { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 18px; }
.teacher-device-card .state-icon { margin: 0; }
.teacher-device-card strong { display: block; margin-bottom: 5px; font-size: 14px; }
.teacher-device-card p { max-width: 620px; margin: 0 0 18px; color: var(--text-3); line-height: 1.75; }

.state-card { display: grid; min-height: 280px; place-items: center; align-content: center; padding: 38px; border: 1px dashed #cfdfdc; border-radius: var(--radius); background: rgba(255,255,255,.66); text-align: center; }
.state-icon { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 12px; border-radius: 15px; background: var(--surface-mint); color: var(--brand); }
.state-icon svg { width: 23px; height: 23px; }
.state-card strong { font-size: 13px; }
.state-card p { max-width: 420px; margin: 6px 0 15px; color: var(--text-3); font-size: 11px; }
.spinner { width: 28px; height: 28px; margin-bottom: 15px; border: 3px solid #dcebe8; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { overflow: hidden; border-radius: 8px; background: linear-gradient(90deg, #eef3f2 25%, #f8faf9 50%, #eef3f2 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(14, 42, 38, .46); backdrop-filter: blur(3px); }
.modal { width: min(620px, 100%); max-height: min(88vh, 860px); overflow: hidden; border: 1px solid rgba(218,232,229,.9); border-radius: 20px; background: #fff; box-shadow: 0 32px 100px rgba(11, 44, 39, .24); }
.modal--wide { width: min(820px, 100%); }
.modal--small { width: min(440px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 20px 22px 16px; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head p { margin: 4px 0 0; color: var(--text-3); font-size: 10px; }
.modal-body { max-height: calc(88vh - 150px); overflow-y: auto; padding: 20px 22px; }
.modal-footer { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line-soft); background: #fbfcfc; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .field--full { grid-column: 1 / -1; }
.form-section-title { grid-column: 1 / -1; margin: 4px 0 14px; padding-bottom: 7px; border-bottom: 1px solid var(--line-soft); color: var(--text-2); font-size: 10px; font-weight: 750; letter-spacing: .06em; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.check-card { display: flex; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--text-2); font-size: 11px; }
.confirm-icon { display: grid; width: 45px; height: 45px; place-items: center; margin-bottom: 14px; border-radius: 14px; background: var(--amber-soft); color: var(--amber); }
.confirm-icon svg { width: 23px; height: 23px; }
.confirm-copy { color: var(--text-2); font-size: 12px; line-height: 1.75; }

.toast-region { position: fixed; z-index: 200; top: 20px; right: 20px; display: grid; width: min(360px, calc(100vw - 40px)); gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid #cfe3de; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: var(--shadow-md); color: #315851; font-size: 11px; pointer-events: auto; animation: toast-in .22s ease-out; }
.toast::before { display: grid; width: 20px; height: 20px; flex: none; place-items: center; border-radius: 50%; background: var(--success-soft); color: var(--success); content: "✓"; font-size: 10px; font-weight: 800; }
.toast--error { border-color: #efcfcc; }
.toast--error::before { background: var(--danger-soft); color: var(--danger); content: "!"; }
.toast strong { display: block; margin-bottom: 2px; }
.toast span { color: var(--text-3); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.mobile-only { display: none; }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .stat-layout, .settings-grid { grid-template-columns: 1fr; }
  .settings-grid > .stack { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .login-view { padding: 22px; }
  .login-layout { display: block; min-height: 0; max-width: 480px; padding-top: 55px; }
  .login-intro { display: none; }
  .sidebar { transform: translateX(-102%); transition: transform .22s ease; }
  .sidebar.is-open { transform: translateX(0); box-shadow: 20px 0 60px rgba(17,54,49,.2); }
  .sidebar-scrim { position: fixed; z-index: 25; inset: 0; background: rgba(14,42,38,.35); }
  .workspace { margin-left: 0; }
  .mobile-only { display: inline-grid; }
  .content { padding: 20px 16px 60px; }
  .topbar { min-height: 66px; padding: 10px 16px; }
  .topbar h1 { font-size: 20px; }
  .sync-state { display: none; }
  .page-head { align-items: stretch; flex-direction: column; }
  .page-actions { justify-content: flex-start; }
  .settings-grid > .stack { grid-template-columns: 1fr; }
  .setting-row { align-items: flex-start; flex-wrap: wrap; }
  .setting-row .field { width: 100%; }
}

@media (max-width: 560px) {
  .login-card { padding: 30px 22px; border-radius: 20px; }
  .login-layout { padding-top: 38px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 116px; padding: 15px; }
  .metric-value { font-size: 23px; }
  .form-grid, .check-grid { grid-template-columns: 1fr; }
  .form-grid .field--full { grid-column: auto; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-group { width: 100%; }
  .filter-input, .search-wrap { width: 100%; }
  .date-nav { justify-content: space-between; }
  .date-nav strong { min-width: 0; flex: 1; }
  .page-actions .button { flex: 1; }
  .modal-backdrop { align-items: end; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: 22px 22px 0 0; }
  .modal-body { max-height: calc(92vh - 145px); }
  .money-summary__grid { grid-template-columns: 1fr; }
  .import-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workflow-callout { align-items: flex-start; flex-wrap: wrap; }
  .workflow-callout .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
