:root {
  color-scheme: light;
  --ink: #18181b;
  --muted: #71717a;
  --soft: #f4f4f5;
  --paper: #f7f7f8;
  --card: rgba(255, 255, 255, .92);
  --line: #e7e7ea;
  --dark: #19191c;
  --dark-soft: #27272a;
  --red: #ef312f;
  --red-dark: #d92523;
  --red-soft: #fff0ef;
  --violet: #7657d5;
  --violet-soft: #f0ecff;
  --mint: #148a68;
  --mint-soft: #e7f7f1;
  --amber: #b66a05;
  --amber-soft: #fff6df;
  --shadow: 0 16px 44px rgba(21, 21, 24, .06), 0 2px 6px rgba(21, 21, 24, .03);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--paper); }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 72% -10%, #fff 0, transparent 32%), var(--paper); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 20; width: 250px;
  display: flex; flex-direction: column; padding: 28px 18px 22px;
  color: white; background: linear-gradient(165deg, #1d1d20 0%, #111113 100%);
  border-right: 1px solid rgba(255,255,255,.06);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 30px; }
.brand-mark, .login-mark {
  width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto;
  border-radius: 14px; background: var(--red); color: white; font-size: 15px; font-weight: 900; letter-spacing: -.06em;
  box-shadow: 0 9px 24px rgba(239,49,47,.27);
}
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-size: 16px; letter-spacing: -.02em; }
.brand-copy small { color: #98989f; font-size: 11px; }
.nav { display: grid; gap: 7px; }
.nav-item {
  width: 100%; min-height: 45px; display: flex; align-items: center; gap: 13px;
  padding: 0 12px; border: 0; border-radius: 13px; color: #a9a9b0; background: transparent;
  font-size: 14px; font-weight: 650; text-align: left; transition: .18s ease;
}
.nav-item > span { width: 22px; color: #888890; font-size: 19px; text-align: center; }
.nav-item:hover { color: white; background: rgba(255,255,255,.055); }
.nav-item.active { color: white; background: rgba(255,255,255,.1); box-shadow: inset 0 0 0 1px rgba(255,255,255,.045); }
.nav-item.active > span { color: #ff6866; }
.nav-count { margin-left: auto; padding: 3px 7px; border-radius: 999px; color: #c5c5ca; background: #323236; font-size: 10px; }
.sidebar-note { margin-top: auto; display: flex; gap: 11px; padding: 16px 14px; border: 1px solid rgba(255,255,255,.08); border-radius: 16px; background: rgba(255,255,255,.045); }
.note-icon { color: #ff6b68; font-size: 18px; }
.sidebar-note p { margin: 0; color: #a6a6ad; font-size: 11px; line-height: 1.5; }
.sidebar-note strong { display: block; margin-bottom: 3px; color: white; font-size: 12px; }
.curator-profile { width: 100%; display: flex; align-items: center; gap: 10px; padding: 18px 8px 0; margin-top: 17px; border: 0; border-top: 1px solid rgba(255,255,255,.08); color: white; background: transparent; text-align: left; }
.avatar, .person-avatar { display: grid; place-items: center; border-radius: 50%; font-weight: 800; }
.avatar { width: 35px; height: 35px; overflow: hidden; flex: 0 0 auto; color: #611512; background: #ffc9c8; }
.avatar img, .person-avatar.photo { width: 100%; height: 100%; object-fit: cover; }
.curator-profile > span:nth-child(2) { min-width: 0; display: grid; flex: 1; gap: 2px; }
.curator-profile strong { font-size: 12px; }
.curator-profile small { overflow: hidden; color: #85858c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.curator-profile i { color: #7f7f87; font-size: 18px; font-style: normal; }

.main { grid-column: 2; min-width: 0; padding: 0 34px 60px; }
.topbar { height: 104px; display: flex; align-items: center; gap: 22px; border-bottom: 1px solid rgba(222,222,226,.7); }
.today { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 600; }
.topbar h1 { margin: 0; font-size: 23px; font-weight: 750; letter-spacing: -.035em; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 11px; }
.search, .table-search {
  display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: rgba(255,255,255,.8);
}
.search { width: min(30vw, 300px); height: 40px; padding: 0 13px; border-radius: 13px; }
.search span, .table-search span { color: #a1a1aa; font-size: 20px; transform: rotate(-15deg); }
.search input, .table-search input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.icon-button, .icon-small, .close-editor, .week-head button {
  display: grid; place-items: center; border: 1px solid var(--line); color: var(--ink); background: white;
}
.icon-button { position: relative; width: 40px; height: 40px; border-radius: 13px; font-size: 19px; }
.icon-button i { position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border: 2px solid white; border-radius: 50%; background: var(--red); }
.mode-badge { padding: 7px 10px; border-radius: 999px; color: #53535a; background: #ececef; font-size: 10px; font-weight: 750; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 21px; }

.view { display: none; padding-top: 28px; animation: reveal .28s ease both; }
.view.active { display: block; }
@keyframes reveal { from { opacity: 0; transform: translateY(5px); } }
.overline, .kicker { display: block; margin: 0 0 7px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.panel { border: 1px solid rgba(226,226,230,.9); border-radius: 23px; background: var(--card); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.panel-head h2, .view-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.panel-head select { padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: white; font-size: 10px; }

.welcome-card {
  min-height: 220px; display: flex; align-items: center; justify-content: space-between; gap: 40px; padding: 34px 42px;
  overflow: hidden; position: relative; border-radius: 28px; color: white;
  background: linear-gradient(125deg, #222226 0%, #242428 55%, #351d20 100%);
  box-shadow: 0 20px 55px rgba(26,26,30,.15);
}
.welcome-card::after { content: ""; position: absolute; width: 350px; height: 350px; right: -90px; top: -180px; border-radius: 50%; background: radial-gradient(circle, rgba(255,74,71,.25), transparent 67%); }
.welcome-card > div:first-child { position: relative; z-index: 1; max-width: 650px; }
.welcome-card .overline { color: #ff8582; }
.welcome-card h2 { margin: 0 0 10px; font-size: clamp(28px, 3vw, 40px); letter-spacing: -.045em; }
.welcome-card p { max-width: 560px; margin: 0; color: #c4c4ca; font-size: 13px; line-height: 1.6; }
.welcome-actions { display: flex; gap: 10px; margin-top: 23px; }
.primary, .ghost {
  min-height: 42px; padding: 0 17px; border-radius: 12px; font-size: 12px; font-weight: 750; transition: .18s ease;
}
.primary { border: 1px solid var(--red); color: white; background: var(--red); box-shadow: 0 8px 18px rgba(239,49,47,.18); }
.primary:hover { border-color: var(--red-dark); background: var(--red-dark); transform: translateY(-1px); }
.ghost { border: 1px solid rgba(255,255,255,.16); color: white; background: rgba(255,255,255,.08); }
.ghost:hover { background: rgba(255,255,255,.13); }
.week-progress { position: relative; z-index: 1; flex: 0 0 auto; width: 150px; height: 150px; display: grid; place-items: center; }
.week-progress svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.week-progress circle { fill: none; stroke-width: 8; }
.week-progress .track { stroke: rgba(255,255,255,.1); }
.week-progress .value { stroke: #ff5a57; stroke-linecap: round; stroke-dasharray: 302; stroke-dashoffset: 302; }
.week-progress div { display: grid; text-align: center; }
.week-progress strong { font-size: 28px; letter-spacing: -.05em; }
.week-progress small { color: #a9a9af; font-size: 9px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 18px 0; }
.metric { position: relative; min-height: 105px; padding: 19px; overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: rgba(255,255,255,.82); }
.metric::before { content: ""; position: absolute; width: 68px; height: 68px; right: -26px; top: -25px; border-radius: 50%; background: var(--tone, #eee); opacity: .65; }
.metric-top { display: flex; align-items: center; justify-content: space-between; }
.metric strong { font-size: 27px; letter-spacing: -.05em; }
.metric-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; color: var(--accent, var(--red)); background: var(--tone, var(--red-soft)); font-weight: 800; }
.metric span { display: block; margin-top: 8px; color: var(--muted); font-size: 10px; }
.metric em { margin-left: 5px; color: var(--mint); font-size: 9px; font-style: normal; font-weight: 750; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(290px, .75fr); gap: 16px; }
.attention-panel, .schedule-panel, .progress-panel, .quick-panel { padding: 24px; }
.text-button { padding: 5px 0; border: 0; color: var(--red); background: transparent; font-size: 10px; font-weight: 750; }
.attention-list { display: grid; margin-top: 14px; }
.attention-item { display: grid; grid-template-columns: 40px minmax(0,1fr) auto; align-items: center; gap: 11px; padding: 13px 0; border-top: 1px solid var(--line); }
.attention-item:first-child { border-top: 0; }
.person-avatar { width: 38px; height: 38px; color: var(--avatar-ink, #423b31); background: var(--avatar-bg, #ece6da); font-size: 11px; }
.person-copy { min-width: 0; display: grid; gap: 3px; }
.person-copy strong { font-size: 12px; }
.person-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.action-pill { padding: 6px 9px; border: 0; border-radius: 9px; color: var(--red); background: var(--red-soft); font-size: 9px; font-weight: 750; }
.timeline { position: relative; display: grid; gap: 0; margin-top: 16px; }
.timeline::before { content: ""; position: absolute; left: 35px; top: 20px; bottom: 20px; width: 1px; background: var(--line); }
.timeline-item { position: relative; display: grid; grid-template-columns: 52px minmax(0,1fr); gap: 10px; padding: 11px 0; }
.timeline-time { z-index: 1; width: 38px; padding: 4px 0; border-radius: 8px; text-align: center; color: var(--red); background: var(--red-soft); font-size: 9px; font-weight: 800; }
.timeline-copy { display: grid; gap: 4px; }
.timeline-copy strong { font-size: 11px; }
.timeline-copy small { color: var(--muted); font-size: 9px; }
.progress-chart { display: grid; gap: 17px; margin-top: 22px; }
.chart-row { display: grid; grid-template-columns: 145px minmax(0,1fr) 23px; align-items: center; gap: 12px; }
.chart-row > span { color: #4f4f56; font-size: 10px; }
.chart-row > div { height: 7px; overflow: hidden; border-radius: 99px; background: #eeeeF1; }
.chart-row i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #ff7774); }
.chart-row i.warning { background: linear-gradient(90deg, #f3a73d, #f8c66f); }
.chart-row b { font-size: 10px; text-align: right; }
.quick-grid { display: grid; gap: 9px; margin-top: 15px; }
.quick-grid button { display: grid; grid-template-columns: 38px 1fr; column-gap: 11px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); background: white; text-align: left; }
.quick-grid button:hover { border-color: #d0d0d5; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.04); }
.quick-icon { grid-row: 1 / 3; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; font-size: 17px; }
.quick-icon.coral { color: var(--red); background: var(--red-soft); }
.quick-icon.violet { color: var(--violet); background: var(--violet-soft); }
.quick-icon.mint { color: var(--mint); background: var(--mint-soft); }
.quick-grid strong { font-size: 10px; }
.quick-grid small { color: var(--muted); font-size: 8px; }

.view-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 22px; }
.view-heading h2 { font-size: 31px; }
.view-heading p { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.heading-actions { display: flex; gap: 8px; }
.soft-button { min-height: 42px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; font-size: 11px; font-weight: 750; }
.soft-button:hover { border-color: #cdccd1; background: #fafafa; }
.roster-editor { display: grid; grid-template-columns: minmax(190px,.6fr) minmax(0,1.4fr); gap: 36px; padding: 26px; margin: -7px 0 15px; }
.roster-editor[hidden] { display: none; }
.roster-copy h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.roster-copy p { max-width: 330px; margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.roster-editor form { grid-template-columns: 1fr 1fr; margin: 0; }
.roster-editor form > label, .form-divider, .form-actions { grid-column: 1 / -1; }
.form-pair { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-divider { display: flex; align-items: center; gap: 8px; padding-top: 2px; color: var(--ink); font-size: 10px; font-weight: 800; }
.form-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.form-divider small { order: 2; color: var(--muted); font-size: 8px; font-weight: 500; }
.form-divider.optional::after { order: 3; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.toolbar.compact { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 14px; margin-bottom: 13px; border-radius: 18px; }
.student-toolbar-left { display: flex; align-items: center; gap: 8px; }
.student-toolbar-left select { width: 170px; height: 39px; padding-block: 0; }
.table-search { width: 280px; height: 39px; padding: 0 11px; border-radius: 11px; background: #fafafa; }
.filter-chips { display: flex; gap: 6px; }
.filter-chips button { padding: 8px 11px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 9px; font-weight: 700; }
.filter-chips button.active { color: var(--ink); background: var(--soft); }
.student-table { padding: 10px 18px; overflow: hidden; }
.table-head, .student-row { display: grid; grid-template-columns: minmax(185px,1.25fr) .8fr 1.2fr 1fr .9fr 25px; align-items: center; gap: 12px; }
.table-head { min-height: 40px; padding: 0 10px; color: #9999a1; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.student-row { min-height: 65px; padding: 9px 10px; border-top: 1px solid var(--line); }
.student-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.student-person span:last-child { min-width: 0; display: grid; gap: 2px; }
.student-person strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.student-person small, .student-row > span { color: var(--muted); font-size: 9px; }
.mini-progress { display: flex; align-items: center; gap: 7px; }
.mini-progress div { width: 68px; height: 5px; overflow: hidden; border-radius: 99px; background: #ededf0; }
.mini-progress i { display: block; height: 100%; border-radius: inherit; background: var(--mint); }
.mini-progress span { color: var(--muted); font-size: 8px; }
.status-chip { width: fit-content; padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 750; }
.status-chip.attention { color: #ad3b35; background: var(--red-soft); }
.status-chip.ontrack { color: #477059; background: var(--mint-soft); }
.status-chip.done { color: #6549b5; background: var(--violet-soft); }
.status-chip.invited { color: #63636b; background: #efeff1; }
.row-more { border: 0; color: #9999a1; background: transparent; }
.empty-state { padding: 40px; color: var(--muted); text-align: center; font-size: 11px; }

.flow-editor { display: grid; grid-template-columns: minmax(210px,.55fr) minmax(0,1.45fr); gap: 36px; padding: 28px; margin-bottom: 16px; }
.flow-editor[hidden] { display: none; }
.flow-editor-copy h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.flow-editor-copy p { max-width: 330px; margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.flow-editor form { margin: 0; }
.tariff-builder { display: grid; gap: 8px; }
.tariff-builder-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 4px; }
.tariff-builder-head strong { font-size: 11px; }
.tariff-builder-head small { color: var(--muted); font-size: 9px; }
.tariff-config { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #fbfbfc; transition: .18s ease; }
.tariff-config.enabled { border-color: #d8d4ef; background: #faf9ff; box-shadow: 0 7px 18px rgba(76,59,135,.05); }
.tariff-toggle { min-height: 53px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; cursor: pointer; }
.tariff-toggle input { width: 17px; height: 17px; padding: 0; border: 0; accent-color: var(--violet); box-shadow: none; }
.tariff-toggle span { display: grid; gap: 2px; }
.tariff-toggle strong { font-size: 11px; }
.tariff-toggle small { color: var(--muted); font-size: 8px; }
.tariff-settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; padding: 0 13px 13px 41px; }
.tariff-settings[hidden] { display: none; }
.tariff-settings label { font-size: 8px; }
.flow-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-bottom: 16px; }
.flow-card { min-height: 230px; padding: 22px; }
.flow-card-head { display: flex; justify-content: space-between; gap: 15px; }
.flow-card h3 { margin: 3px 0 0; font-size: 18px; letter-spacing: -.035em; }
.flow-status { width: fit-content; height: fit-content; padding: 5px 8px; border-radius: 99px; color: #725923; background: var(--amber-soft); font-size: 8px; font-weight: 800; }
.flow-status.active { color: var(--mint); background: var(--mint-soft); }
.flow-status.completed { color: var(--muted); background: var(--soft); }
.flow-dates { display: flex; align-items: center; gap: 7px; margin: 18px 0; color: #4f4f56; font-size: 10px; font-weight: 700; }
.flow-dates i { width: 18px; height: 1px; background: var(--line); }
.flow-access { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.flow-access span { display: grid; gap: 3px; padding: 10px; border-radius: 12px; background: var(--soft); }
.flow-access small { color: var(--muted); font-size: 8px; }
.flow-access strong { font-size: 10px; }
.flow-tariff-list { display: grid; gap: 8px; margin: 17px 0 6px; }
.flow-tariff-row { display: grid; grid-template-columns: minmax(105px,.65fr) minmax(140px,1fr) minmax(190px,1.4fr); align-items: center; gap: 11px; padding: 11px 12px; border-radius: 13px; background: var(--soft); }
.flow-tariff-row > span { display: grid; gap: 3px; min-width: 0; }
.flow-tariff-row small { color: var(--muted); font-size: 8px; }
.flow-tariff-row strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; }
.tariff-name strong { color: var(--violet); font-size: 11px; }
.flow-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 17px; }
.flow-card-footer span { color: var(--muted); font-size: 9px; }
.flow-card-footer button { border: 0; color: var(--red); background: transparent; font-size: 9px; font-weight: 800; }
.transfer-panel { padding: 24px; }
.transfer-list { display: grid; margin-top: 14px; }
.transfer-item { display: grid; grid-template-columns: minmax(150px,1fr) minmax(180px,1.2fr) minmax(200px,1.25fr); align-items: center; gap: 14px; min-height: 70px; padding: 12px 4px; border-top: 1px solid var(--line); }
.transfer-item:first-child { border-top: 0; }
.transfer-person, .transfer-route { display: grid; gap: 4px; }
.transfer-person strong, .transfer-route strong { font-size: 10px; }
.transfer-person small, .transfer-route small { color: var(--muted); font-size: 8px; }
.transfer-actions { display: flex; justify-content: flex-end; gap: 7px; }
.transfer-actions select { max-width: 150px; padding: 8px; font-size: 9px; }
.transfer-actions button { min-height: 34px; padding-inline: 10px; }

.content-layout, .calendar-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(310px, .55fr); gap: 16px; align-items: start; }
.library-panel, .week-card { min-height: 560px; padding: 18px; }
.library-toolbar { display: flex; justify-content: space-between; gap: 10px; padding: 0 0 14px; }
.library-toolbar select { padding: 0 11px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); background: white; font-size: 10px; }
.material-list { display: grid; gap: 8px; }
.material-item { display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: #fff; cursor: pointer; transition: .16s ease; }
.material-item:hover { border-color: #d0d0d5; transform: translateY(-1px); box-shadow: 0 8px 20px rgba(0,0,0,.035); }
.material-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; color: var(--icon-color); background: var(--icon-bg); font-size: 16px; }
.material-copy { min-width: 0; display: grid; gap: 4px; }
.material-copy strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.material-copy small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.material-meta { display: grid; justify-items: end; gap: 5px; }
.material-meta small { color: var(--muted); font-size: 8px; }
.publish-dot { display: flex; align-items: center; gap: 5px; color: var(--mint); font-size: 8px; font-weight: 700; }
.publish-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.publish-dot.draft { color: var(--amber); }
.editor-panel { position: sticky; top: 18px; padding: 20px; }
.close-editor { width: 29px; height: 29px; border-radius: 9px; color: var(--muted); }
form { display: grid; gap: 12px; margin-top: 17px; }
form label { display: grid; gap: 6px; color: #55555c; font-size: 9px; font-weight: 750; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; outline: 0; color: var(--ink); background: #fbfbfc; font-size: 11px; transition: .16s ease; }
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: #ff9b99; background: white; box-shadow: 0 0 0 3px rgba(239,49,47,.08); }
.full { width: 100%; margin-top: 3px; }

.week-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 3px 18px; }
.week-head button { width: 32px; height: 32px; border-radius: 10px; }
.week-head div { display: grid; gap: 3px; text-align: center; }
.week-head span { color: var(--muted); font-size: 9px; }
.week-head strong { font-size: 14px; }
.week-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 6px; padding: 10px; border-radius: 15px; background: var(--soft); }
.day { display: grid; place-items: center; gap: 7px; min-height: 56px; border-radius: 11px; color: var(--muted); font-size: 8px; }
.day b { font-size: 12px; color: var(--ink); }
.day.active { color: white; background: var(--red); }
.day.active b { color: white; }
.day.has-event:not(.active) b::after { content: ""; display: block; width: 4px; height: 4px; margin: 5px auto -2px; border-radius: 50%; background: var(--red); }
.calendar-agenda { display: grid; margin-top: 18px; }
.agenda-item { display: grid; grid-template-columns: 60px 4px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 14px 6px; border-top: 1px solid var(--line); cursor: pointer; }
.agenda-item:first-child { border-top: 0; }
.agenda-time { display: grid; gap: 3px; font-size: 11px; font-weight: 800; }
.agenda-time small { color: var(--muted); font-size: 8px; font-weight: 500; }
.agenda-color { width: 4px; height: 39px; border-radius: 9px; background: var(--event-color); }
.agenda-copy { min-width: 0; display: grid; gap: 4px; }
.agenda-copy strong { font-size: 11px; }
.agenda-copy small { color: var(--muted); font-size: 9px; }
.agenda-arrow { color: #b1b1b7; }

.invite-builder { display: grid; grid-template-columns: minmax(210px,.65fr) minmax(0,1.35fr); gap: 34px; padding: 26px; margin-bottom: 15px; }
.invite-builder[hidden], .invite-result[hidden] { display: none; }
.invite-builder-copy h2, .invite-result h2 { margin: 0; font-size: 20px; letter-spacing: -.035em; }
.invite-builder-copy p, .invite-result p { max-width: 390px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.invite-builder form { grid-template-columns: 1fr 1fr; margin: 0; }
.check-row { grid-column: 1 / -1; display: flex; grid-template-columns: none; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fafafa; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--red); }
.check-row span { display: grid; gap: 3px; }
.check-row strong { color: var(--ink); font-size: 10px; }
.check-row small { color: var(--muted); font-size: 8px; font-weight: 500; }
.invite-result { display: grid; grid-template-columns: 46px minmax(210px,.8fr) minmax(280px,1.2fr); align-items: center; gap: 18px; padding: 22px 24px; margin-bottom: 15px; border-color: #ccebdc; background: linear-gradient(120deg,#fff,#f6fffa); }
.invite-success { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--mint); font-size: 18px; font-weight: 900; }
.copy-link { display: flex; gap: 8px; }
.copy-link input { min-width: 0; flex: 1; }
.team-panel { padding: 24px; }
.team-total { padding: 6px 9px; border-radius: 99px; color: var(--muted); background: var(--soft); font-size: 9px; font-weight: 700; }
.team-list { display: grid; margin-top: 15px; }
.team-member { display: grid; grid-template-columns: 43px minmax(0,1fr) minmax(130px,.7fr) minmax(120px,.7fr) 30px; align-items: center; gap: 13px; min-height: 69px; padding: 10px 3px; border-top: 1px solid var(--line); }
.team-member:first-child { border-top: 0; }
.team-member-copy { display: grid; gap: 3px; }
.team-member-copy strong { font-size: 11px; }
.team-member-copy small, .team-detail small { color: var(--muted); font-size: 8px; }
.team-detail { display: grid; gap: 3px; }
.team-detail strong { font-size: 9px; font-weight: 700; }
.role-badge { width: fit-content; padding: 5px 8px; border-radius: 99px; color: #6549b5; background: var(--violet-soft); font-size: 8px; font-weight: 750; }

.profile-layout { display: grid; grid-template-columns: minmax(250px,.62fr) minmax(0,1.38fr); gap: 16px; align-items: start; }
.profile-identity { min-height: 470px; display: flex; align-items: center; flex-direction: column; padding: 34px 28px; text-align: center; }
.profile-photo { width: 148px; height: 148px; display: grid; place-items: center; margin-bottom: 20px; overflow: hidden; border: 6px solid white; border-radius: 50%; color: #611512; background: linear-gradient(145deg,#ffd9d7,#ffc2c0); box-shadow: 0 16px 38px rgba(111,34,30,.14); font-size: 34px; font-weight: 850; letter-spacing: -.05em; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-identity .soft-button { min-height: 38px; }
.profile-remove { margin-top: 7px; color: var(--muted); }
.profile-identity h2 { margin: 25px 0 8px; font-size: 24px; letter-spacing: -.04em; }
.profile-identity > p { max-width: 270px; margin: 18px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.profile-details { display: grid; gap: 16px; }
.profile-form-card { padding: 26px; }
.profile-form-card form { max-width: 660px; }
.profile-save { width: fit-content; min-width: 180px; margin-top: 4px; }
.saved-mark { padding: 6px 9px; border-radius: 99px; color: var(--mint); background: var(--mint-soft); font-size: 9px; font-weight: 800; }
.max-profile-card { display: grid; grid-template-columns: 54px minmax(0,1fr) auto; align-items: center; gap: 18px; padding: 24px 26px; }
.max-profile-icon { width: 54px; height: 54px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 17px; color: white; background: linear-gradient(145deg,#7857e6,#4e77ef); box-shadow: 0 10px 24px rgba(84,93,220,.22); font-size: 10px; font-weight: 950; letter-spacing: -.04em; }
.max-profile-copy h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.max-profile-copy p { max-width: 530px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.max-profile-action { display: grid; justify-items: end; gap: 9px; }
.connection-status { padding: 5px 8px; border-radius: 99px; color: #7b5c28; background: var(--amber-soft); font-size: 8px; font-weight: 800; }
.connection-status.connected { color: var(--mint); background: var(--mint-soft); }
.max-connect-button { min-height: 42px; padding: 0 15px; border: 0; border-radius: 12px; color: white; background: linear-gradient(135deg,#7758dc,#4c72e8); box-shadow: 0 10px 22px rgba(92,90,218,.18); font-size: 10px; font-weight: 800; }
.max-connect-button span { margin-right: 5px; font-size: 8px; font-weight: 950; }
.invite-registration { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0,#fff 0,transparent 45%),#f4f4f6; }
.invite-registration[hidden] { display: none; }
.registration-card { width: min(100%,470px); padding: 38px; border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: 0 24px 70px rgba(20,20,24,.1); }
.registration-logo { margin-bottom: 30px; }
.registration-card h1 { margin: 0; font-size: 31px; letter-spacing: -.045em; }
.registration-card > p { margin: 11px 0 24px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.registration-card form > small { color: var(--muted); font-size: 8px; line-height: 1.5; text-align: center; }
.max-identity { display: grid; grid-template-columns: 38px 1fr 22px; align-items: center; gap: 11px; padding: 12px; border: 1px solid #e5defd; border-radius: 14px; background: #faf8ff; }
.max-identity > span { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg,#7857e6,#4e77ef); font-size: 8px; font-weight: 900; letter-spacing: -.03em; }
.max-identity div { display: grid; gap: 3px; }
.max-identity strong { font-size: 10px; }
.max-identity small { color: var(--muted); font-size: 8px; line-height: 1.4; }
.max-identity b { color: var(--mint); }
.max-button { min-height: 48px; border: 0; border-radius: 13px; color: white; background: linear-gradient(135deg,#7758dc,#4c72e8); font-size: 11px; font-weight: 800; box-shadow: 0 10px 22px rgba(92,90,218,.2); }
.max-button span { margin-right: 8px; font-size: 8px; font-weight: 950; }
.invite-result #inviteDeliveryNote { display: block; margin-top: 5px; color: var(--muted); font-size: 8px; }
.registration-done { display: grid; justify-items: center; padding: 12px 0 0; text-align: center; }
.registration-done[hidden] { display: none; }
.registration-done > span { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 50%; color: white; background: var(--mint); font-size: 24px; font-weight: 900; }
.registration-done h2 { margin: 0; }
.registration-done p { margin: 8px 0 20px; color: var(--muted); font-size: 10px; }
.owner-card { text-align: left; }
.owner-card .owner-entry { margin-top: 2px; }
.owner-card > small { display: block; margin-top: 12px; color: var(--muted); font-size: 8px; text-align: center; }

.login-panel { max-width: 820px; min-height: 240px; display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin: 65px auto; padding: 34px; border: 1px solid var(--line); border-radius: 26px; background: white; box-shadow: var(--shadow); }
.login-panel[hidden] { display: none; }
.login-copy { display: flex; gap: 16px; }
.login-copy h2 { margin: 0; font-size: 22px; }
.login-copy p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.login-form { display: grid; gap: 9px; }
.form-error { min-height: 14px; margin: 0; color: var(--red); font-size: 9px; }
.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 16px; border-radius: 13px; color: white; background: #202023; box-shadow: 0 18px 50px rgba(0,0,0,.22); font-size: 11px; }

.feedback-layout { display: grid; grid-template-columns: minmax(300px,.78fr) minmax(0,1.45fr); gap: 18px; align-items: start; }
.feedback-form-card, .feedback-queue-card { padding: 24px; }
.feedback-form-card { position: sticky; top: 110px; }
.feedback-form-card form { display: grid; gap: 14px; margin-top: 18px; }
.feedback-head { gap: 16px; }
.feedback-head select { min-width: 130px; }
.feedback-list { display: grid; gap: 12px; margin-top: 18px; }
.feedback-item { padding: 18px; border: 1px solid var(--line); border-radius: 17px; background: #fff; }
.feedback-item-top, .feedback-item-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.feedback-item h3 { margin: 11px 0 7px; font-size: 15px; }
.feedback-item p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; white-space: pre-wrap; }
.feedback-expected { margin-top: 11px !important; padding: 10px 12px; border-radius: 11px; background: #f7f7f9; color: var(--ink) !important; }
.feedback-decision { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: end; margin-top: 12px; padding: 12px; border-radius: 13px; background: #f8f7fa; }
.feedback-decision label { margin: 0; }
.feedback-decision textarea { min-height: 66px; }
.feedback-decision .soft-button { min-height: 42px; white-space: nowrap; }
.feedback-decision-readonly { margin-top: 12px !important; padding: 11px 12px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: #fff6f5; color: var(--ink) !important; }
.feedback-item-footer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.feedback-author { display: grid; gap: 3px; color: var(--muted); font-size: 9px; }
.feedback-author strong { color: var(--ink); font-size: 10px; }
.feedback-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.feedback-tag, .feedback-priority { display: inline-flex; padding: 5px 8px; border-radius: 999px; background: #f1f0f4; color: #56535e; font-size: 8px; font-weight: 700; }
.feedback-priority.urgent { background: #fff0ef; color: #c72f2c; }
.feedback-priority.important { background: #fff7e2; color: #9b6710; }
.feedback-status { min-width: 120px; font-size: 9px; }

.conversation-heading { align-items: center; }
.conversation-search { width: min(360px,100%); display: flex; align-items: center; gap: 9px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: white; }
.conversation-search span { color: var(--muted); font-size: 18px; }
.conversation-search input { width: 100%; height: 44px; padding: 0; border: 0; background: transparent; }
.conversation-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.conversation-stat { min-height: 96px; display: grid; align-content: space-between; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: white; }
.conversation-stat strong { font-size: 22px; letter-spacing: -.04em; }
.conversation-stat span { color: var(--muted); font-size: 9px; line-height: 1.4; }
.conversation-policy { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 22px; margin-bottom: 16px; background: linear-gradient(135deg,#fff 30%,#fff4f3); }
.conversation-policy-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; color: #9d2522; background: #ffd9d7; font-size: 24px; }
.conversation-policy h2 { margin: 2px 0 6px; font-size: 17px; }
.conversation-policy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.conversation-map { display: grid; gap: 16px; }
.conversation-section { padding: 22px; overflow: hidden; }
.conversation-section-head { display: flex; justify-content: space-between; gap: 18px; margin-bottom: 17px; }
.conversation-section-head h2 { margin: 2px 0 6px; font-size: 19px; }
.conversation-section-head p { max-width: 720px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.conversation-section-count { flex: 0 0 auto; height: fit-content; padding: 6px 9px; border-radius: 99px; color: #6549b5; background: var(--violet-soft); font-size: 8px; font-weight: 800; }
.conversation-flow { display: flex; gap: 26px; padding: 2px 2px 12px; overflow-x: auto; scroll-snap-type: x proximity; }
.conversation-node { position: relative; min-width: 305px; max-width: 360px; display: grid; align-content: start; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fbfbfc; scroll-snap-align: start; }
.conversation-node:not(:last-child)::after { content: "→"; position: absolute; top: 50%; right: -21px; color: #aaa8b0; font-size: 17px; font-weight: 800; }
.conversation-node-trigger { color: var(--red); font-size: 8px; font-weight: 800; line-height: 1.45; text-transform: uppercase; letter-spacing: .045em; }
.conversation-node h3 { margin: 0; font-size: 14px; letter-spacing: -.02em; }
.conversation-message { margin: 0; padding: 12px; border-radius: 12px; color: #37363c; background: white; box-shadow: inset 0 0 0 1px #eeeeF1; font-size: 10px; line-height: 1.62; white-space: pre-wrap; }
.conversation-group { display: grid; gap: 6px; }
.conversation-group > strong { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .05em; }
.conversation-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.conversation-tag { padding: 5px 7px; border-radius: 8px; color: #55525e; background: #efedf2; font-size: 8px; line-height: 1.3; }
.conversation-tag.button { color: #7f211f; background: #ffeceb; }
.conversation-next { color: #55525e; font-size: 9px; line-height: 1.5; }
.conversation-no-results { padding: 48px 24px; text-align: center; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .sidebar { width: 220px; }
  .main { padding-inline: 24px; }
  .metrics { grid-template-columns: repeat(2,1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .content-layout, .calendar-layout { grid-template-columns: minmax(0,1.15fr) minmax(280px,.85fr); }
  .table-head, .student-row { grid-template-columns: minmax(170px,1.2fr) .8fr 1fr .8fr 20px; }
  .table-head span:nth-child(3), .student-row > span:nth-child(3) { display: none; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { transform: translateX(-102%); box-shadow: 20px 0 50px rgba(0,0,0,.18); transition: transform .22s ease; }
  body.menu-open .sidebar { transform: translateX(0); }
  .main { padding: 0 16px 45px; }
  .topbar { height: 84px; }
  .mobile-menu { display: block; }
  .search, .mode-badge { display: none; }
  .welcome-card { padding: 28px; }
  .content-layout, .calendar-layout { grid-template-columns: 1fr; }
  .feedback-layout { grid-template-columns: 1fr; }
  .feedback-form-card { position: static; }
  .feedback-decision { grid-template-columns: 1fr; }
  .conversation-summary { grid-template-columns: repeat(2,1fr); }
  .conversation-heading { align-items: stretch; }
  .conversation-search { width: 100%; }
  .profile-layout { grid-template-columns: 1fr; }
  .flow-editor { grid-template-columns: 1fr; }
  .flow-grid { grid-template-columns: 1fr; }
  .transfer-item { grid-template-columns: 1fr; }
  .transfer-actions { justify-content: flex-start; }
  .profile-identity { min-height: 0; }
  .editor-panel { position: static; }
  .toolbar.compact { align-items: stretch; flex-direction: column; }
  .student-toolbar-left { align-items: stretch; flex-direction: column; }
  .student-toolbar-left select { width: 100%; }
  .table-search { width: 100%; }
  .filter-chips { overflow-x: auto; }
  .student-table { overflow-x: auto; }
  .table-head, .student-row { min-width: 680px; }
}
@media (max-width: 560px) {
  .topbar h1 { font-size: 19px; }
  .welcome-card { align-items: flex-start; flex-direction: column; }
  .week-progress { width: 118px; height: 118px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-height: 96px; padding: 15px; }
  .dashboard-grid { display: block; }
  .flow-grid { grid-template-columns: 1fr; }
  .flow-tariff-row, .tariff-settings { grid-template-columns: 1fr; }
  .tariff-settings { padding-left: 13px; }
  .dashboard-grid > * { margin-bottom: 14px; }
  .view-heading { align-items: flex-start; flex-direction: column; }
  .conversation-summary { grid-template-columns: 1fr; }
  .conversation-policy { grid-template-columns: 1fr; }
  .conversation-node { min-width: 272px; }
  .heading-actions { width: 100%; }
  .heading-actions button { flex: 1; }
  .roster-editor { grid-template-columns: 1fr; gap: 20px; }
  .library-toolbar { flex-direction: column; }
  .chart-row { grid-template-columns: 115px minmax(0,1fr) 20px; }
  .login-panel { grid-template-columns: 1fr; padding: 24px; }
  .invite-builder, .invite-result { grid-template-columns: 1fr; }
  .invite-builder form { grid-template-columns: 1fr; }
  .check-row, .invite-builder .form-actions { grid-column: 1; }
  .team-member { grid-template-columns: 40px minmax(0,1fr) 25px; }
  .team-detail { display: none; }
  .max-profile-card { grid-template-columns: 48px minmax(0,1fr); }
  .max-profile-action { grid-column: 1 / -1; width: 100%; justify-items: stretch; }
  .connection-status { width: fit-content; }
  .profile-form-card .form-pair { grid-template-columns: 1fr; }
  .profile-save { width: 100%; }
  .registration-card { padding: 28px 22px; }
}
