:root {
  --navy: #061e3d;
  --deep: #03152d;
  --blue: #176df2;
  --blue-2: #0f55d9;
  --indigo: #3f55d9;
  --teal: #079c8f;
  --green: #0ca66e;
  --orange: #ff8b20;
  --red: #ef3b3f;
  --purple: #7a3fe2;
  --ink: #071a35;
  --muted: #6b7a90;
  --line: #dce6ef;
  --soft: #f5f8fb;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: #eef3f7; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(23, 109, 242, .35); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar { color: #fff; padding: 24px 14px; display: flex; flex-direction: column; gap: 18px; background: radial-gradient(circle at 18% 0%, rgba(28, 98, 255, .35), transparent 25%), linear-gradient(180deg, #072448, #03162f 70%, #021125); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 16px; }
.brand-icon { width: 46px; height: 46px; border: 3px solid #1e7dff; border-radius: 11px; display: grid; place-items: center; color: #56a8ff; font-size: 30px; transform: rotate(-6deg); }
.brand strong { font-size: 31px; line-height: 1; }
.brand span { color: #62a5ff; }
.brand small { display: block; color: #b6c7df; font-weight: 700; }
.nav { display: grid; gap: 7px; }
.nav-item { width: 100%; height: 47px; border: 0; border-radius: 8px; padding: 0 14px; display: flex; align-items: center; gap: 12px; color: #edf5ff; background: transparent; text-align: left; font-weight: 700; }
.nav-item span { width: 24px; text-align: center; font-size: 18px; }
.nav-item:hover, .nav-item.active { background: linear-gradient(135deg, #1b62d9, #1552ba); box-shadow: 0 12px 24px rgba(19, 86, 210, .28); }
.term-card, .campus-card { border: 1px solid rgba(220, 235, 255, .18); border-radius: 8px; padding: 16px; background: rgba(255, 255, 255, .055); }
.term-card { margin-top: auto; }
.term-card small, .campus-card small { display: block; margin-top: 10px; color: #c3d3e7; }
.campus-card p { margin-bottom: 0; color: #d8e6f5; }

.workspace { min-width: 0; overflow-x: auto; }
.topbar { min-height: 78px; border-bottom: 1px solid var(--line); padding: 14px 24px; display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.96); position: sticky; top: 0; z-index: 10; }
.menu-btn, .icon-btn, .date-btn, .ghost-btn, .outline-btn, .back-btn { border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.menu-btn, .icon-btn { width: 42px; height: 42px; }
.page-copy h1 { margin: 0; font-size: 22px; }
.page-copy p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.demo-badge { border: 1px solid #b8d2ff; border-radius: 999px; padding: 7px 12px; color: #1557c8; background: #eef5ff; font-size: 12px; font-weight: 900; white-space: nowrap; }
.search { margin-left: auto; width: 390px; height: 44px; border: 1px solid var(--line); border-radius: 8px; padding: 0 13px; display: flex; align-items: center; gap: 8px; color: #8796aa; background: #fff; }
.search input { width: 100%; border: 0; outline: 0; }
.date-btn { height: 42px; padding: 0 14px; }
.alert, .mail { position: relative; }
.alert::after, .mail::after { position: absolute; top: -8px; right: -5px; width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 800; }
.alert::after { content: "5"; background: var(--red); }
.mail::after { content: "3"; background: var(--blue); }
.profile { display: flex; align-items: center; gap: 10px; }
.profile span { width: 40px; height: 40px; border-radius: 99px; display: grid; place-items: center; color: #fff; background: #0b2e62; font-weight: 800; }
.profile small { display: block; color: var(--muted); }
.primary-btn { height: 42px; border: 0; border-radius: 8px; padding: 0 18px; color: #fff; background: linear-gradient(135deg, #176df2, #1158d4); font-weight: 800; }

.demo-strip { margin: 16px 24px 0; border: 1px solid #b8d2ff; border-radius: 12px; padding: 14px 16px; display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, #eef5ff, #f8fbff); box-shadow: 0 12px 24px rgba(23, 109, 242, .08); }
.demo-strip div { margin-right: auto; }
.demo-strip strong { display: block; color: #0e4fb9; }
.demo-strip p { margin: 4px 0 0; color: var(--muted); }
.demo-strip a { border: 1px solid #9fc1ff; border-radius: 8px; padding: 10px 12px; color: #1557c8; background: #fff; text-decoration: none; font-weight: 800; white-space: nowrap; }

.view { display: none; padding: 20px 24px; }
.view.active { display: block; }
.panel, .kpi-card { border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.96); box-shadow: 0 12px 30px rgba(18, 42, 70, .06); }
.panel { padding: 16px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel h2, .panel-head h2 { margin: 0; font-size: 16px; }
.panel a { color: var(--blue); text-decoration: none; font-weight: 800; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(190px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpi-card { min-height: 120px; padding: 20px; display: flex; align-items: center; gap: 18px; transition: .18s ease; }
.kpi-card:hover, .kpi-card.selected { transform: translateY(-2px); border-color: rgba(23, 109, 242, .45); box-shadow: 0 16px 32px rgba(23,109,242,.13); }
.kpi-icon { width: 64px; height: 64px; border-radius: 99px; display: grid; place-items: center; font-size: 31px; }
.kpi-icon.blue { color: var(--blue); background: #e9f1ff; }
.kpi-icon.green { color: var(--green); background: #e5f8ef; }
.kpi-icon.orange { color: var(--orange); background: #fff0df; }
.kpi-icon.purple { color: var(--purple); background: #f0e9ff; }
.kpi-card p { margin: 0; color: var(--muted); font-weight: 700; }
.kpi-card strong { display: block; margin: 4px 0; color: var(--ink); font-size: 29px; }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1.32fr 1fr .9fr; gap: 14px; }
.schedule-panel { grid-column: span 1; }
.side-stack { display: grid; gap: 14px; grid-row: span 2; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #edf2f7; text-align: left; }
th { color: var(--muted); }
td i { display: inline-block; height: 7px; width: 60px; border-radius: 99px; background: var(--green); margin-left: 8px; vertical-align: middle; }
.lesson-grid { display: grid; grid-template-columns: 58px repeat(6, 1fr); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lesson-grid > * { min-height: 39px; border: 0; border-right: 1px solid #edf2f7; border-bottom: 1px solid #edf2f7; background: #fff; padding: 7px; font-size: 12px; text-align: left; }
.lesson-grid b { color: var(--muted); background: #f7faff; }
.lesson-grid button { color: #174c9d; background: #eff5ff; font-weight: 700; }
.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center; }
.donut { width: 158px; height: 158px; border-radius: 99px; display: grid; place-items: center; background: conic-gradient(var(--green) 0 82%, var(--orange) 82% 90%, var(--red) 90% 95%, #ccd5df 95% 100%); position: relative; }
.donut.small { width: 145px; height: 145px; margin: 10px auto; }
.donut::after { content: ""; position: absolute; inset: 38px; border-radius: inherit; background: #fff; }
.donut strong, .donut small { position: relative; z-index: 1; }
.donut strong { font-size: 28px; transform: translateY(12px); }
.donut small { transform: translateY(-17px); color: var(--muted); }
.donut-list p, .homework-panel p { color: var(--muted); }
.donut-list i, .homework-panel i { display: inline-block; width: 11px; height: 11px; border-radius: 99px; background: var(--green); margin-right: 8px; }
.donut-list .orange, .homework-panel .orange { background: var(--orange); }
.donut-list .red { background: var(--red); }
.donut-list .gray { background: #bfc8d2; }
.donut-list .blue, .homework-panel .blue { background: var(--blue); }
.donut-list b, .homework-panel b { float: right; color: var(--ink); }
.hours { display: flex; border-top: 1px solid var(--line); margin-top: 18px; padding-top: 16px; gap: 46px; }
.hours p { color: var(--muted); }
.hours strong { display: block; color: var(--ink); font-size: 21px; }
.progress { height: 8px; border-radius: 99px; background: #e6edf4; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--green); }
.collection-panel > strong { display: block; text-align: right; font-size: 17px; }
.collection-panel p { display: flex; justify-content: space-between; color: var(--muted); }
.soft-btn { width: 100%; height: 42px; border: 0; border-radius: 8px; color: #1557c8; background: #eef4ff; font-weight: 800; }
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.quick-grid button { min-height: 72px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--blue); display: grid; place-items: center; gap: 4px; }
.quick-grid span { color: var(--ink); font-size: 12px; }
.mini-row, .exam-row, .message-row, .task-row, .day-row { border-bottom: 1px solid #edf2f7; padding: 10px 0; display: flex; align-items: center; gap: 12px; }
.mini-row p, .exam-row p, .message-row p, .task-row p, .day-row p { margin: 0; flex: 1; }
.mini-row small, .exam-row small, .message-row small, .day-row small { display: block; color: var(--muted); }
.exam-row b { min-width: 48px; border-radius: 8px; padding: 8px; color: var(--blue); background: #eef4ff; text-align: center; }
.message-row span { width: 36px; height: 36px; border-radius: 99px; display: grid; place-items: center; color: #2456aa; background: #dfe9ff; font-weight: 800; }
.message-row b { width: 22px; height: 22px; border-radius: 99px; display: grid; place-items: center; color: var(--green); background: #e4f8ee; }
.task-row b, .day-row b, table b { padding: 4px 8px; border-radius: 7px; color: var(--green); background: #e3f7ed; font-size: 12px; }
.task-row:first-of-type b, .unpaid { color: var(--red); background: #ffe8e5; }

.student-layout { display: grid; grid-template-columns: 350px minmax(620px, 1fr) 360px; gap: 16px; }
.select-line, .load-more, .outline-full { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; text-align: left; padding: 0 13px; }
.filter-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 12px 0; }
.filter-tabs button { min-height: 52px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; }
.filter-tabs .active { color: var(--blue); border-color: #a9c8ff; background: #eef5ff; }
.filter-tabs b { display: block; }
.student-search { height: 42px; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; padding: 0 10px; gap: 8px; }
.student-search input { width: 100%; border: 0; outline: 0; }
.student-list { margin-top: 12px; display: grid; gap: 8px; }
.student-card { min-height: 70px; border: 1px solid transparent; border-radius: 8px; padding: 9px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; text-align: left; background: #fff; }
.student-card:hover, .student-card.active { border-color: #8db7ff; background: #f2f7ff; }
.student-card span { width: 44px; height: 44px; border-radius: 99px; display: grid; place-items: center; background: #dbe8ff; color: #17488f; font-weight: 800; }
.student-card p { margin: 0; }
.student-card small { display: block; color: var(--muted); }
.student-card em { color: var(--ink); font-style: normal; text-align: right; font-size: 12px; }
.student-card b { color: var(--red); }
.student-card .ok { color: var(--green); }
.student-main { display: grid; gap: 14px; }
.profile-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.profile-head h2 { margin: 0; flex: 1; font-size: 24px; }
.profile-head span { padding: 5px 10px; border-radius: 99px; color: var(--green); background: #e2f7ec; font-size: 13px; }
.back-btn { width: 38px; height: 38px; }
.outline-btn { height: 38px; padding: 0 14px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.photo-card, .parent-card { border: 1px solid var(--line); border-radius: 8px; padding: 18px; background: #fff; }
.student-photo { width: 72px; height: 72px; border-radius: 99px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #116bea, #0b3170); font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.photo-card p, .parent-card p, .balance-panel p { display: flex; justify-content: space-between; color: var(--muted); gap: 12px; }
.photo-card b, .parent-card b { color: var(--ink); }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); }
.summary-strip div { padding: 12px 18px; border-right: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.summary-strip div:last-child { border-right: 0; }
.summary-strip span { color: var(--blue); font-size: 26px; }
.summary-strip p { margin: 0; color: var(--muted); }
.summary-strip strong { display: block; color: var(--ink); font-size: 21px; }
.payment-table footer { display: flex; justify-content: space-between; color: var(--muted); margin-top: 12px; }
.right-panel { display: grid; gap: 14px; align-content: start; }
.whatsapp-panel h2 { font-size: 15px; }
.whatsapp-panel h2 span { float: right; color: var(--muted); background: #eef2f7; border-radius: 99px; padding: 4px 8px; font-size: 11px; }
.message-card { border: 1px solid #b9dfcd; border-radius: 8px; background: #eaf8f0; padding: 14px; line-height: 1.45; }
.message-card small { display: block; text-align: right; color: #5a8991; }
.pay-btn { width: 100%; height: 42px; margin: 12px 0 8px; border: 0; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #08a56b, #07865a); font-weight: 800; }
.drop-zone { min-height: 140px; border: 1px dashed #c6d5e4; border-radius: 8px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.side-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
.side-actions button { height: 48px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-weight: 800; }
.balance-panel h2 a { float: right; font-size: 13px; }
.balance-panel b { color: var(--red); }

.automation-layout { display: grid; grid-template-columns: minmax(780px, 1fr) 430px; gap: 16px; }
.automation-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 14px; }
.automation-head div { margin-right: auto; }
.automation-head h2 { margin: 4px 0; font-size: 26px; }
.automation-head p, .automation-head small { color: var(--muted); margin: 0; }
.flow-tabs { display: inline-flex; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; overflow: hidden; }
.flow-tabs button { height: 44px; border: 0; border-right: 1px solid var(--line); padding: 0 20px; background: #f7faff; color: #55667b; }
.flow-tabs .active { background: #fff; color: var(--ink); font-weight: 800; }
.flow-canvas { min-height: 530px; border: 1px solid var(--line); border-radius: 0 8px 8px 8px; background-image: radial-gradient(#dce7ef 1px, transparent 1px); background-size: 14px 14px; position: relative; }
.flow-canvas::before { content: ""; position: absolute; left: 112px; right: 130px; top: 110px; border-top: 2px solid #9fb1c4; }
.flow-canvas::after { content: ""; position: absolute; left: 112px; right: 300px; top: 312px; border-top: 2px solid #9fb1c4; }
.flow-node { width: 140px; min-height: 118px; border: 1px solid #97d5c0; border-radius: 8px; padding: 13px; background: #fff; position: absolute; text-align: left; transition: .18s ease; }
.flow-node small { color: var(--green); font-weight: 800; }
.flow-node strong { display: block; margin: 12px 0; }
.flow-node em { color: var(--muted); font-size: 12px; font-style: normal; }
.flow-node:nth-child(1) { left: 28px; top: 55px; }
.flow-node:nth-child(2) { left: 198px; top: 55px; border-color: #bca6e8; }
.flow-node:nth-child(3) { left: 368px; top: 55px; }
.flow-node:nth-child(4) { left: 538px; top: 55px; border-color: #ffc28d; }
.flow-node:nth-child(5) { left: 708px; top: 55px; border-color: #bca6e8; }
.flow-node.side { right: 20px; top: 35px; border-color: #9dbdff; }
.flow-node.lower { right: 20px; top: 165px; }
.flow-node.second { top: 285px; }
.flow-node:nth-child(8) { left: 28px; }
.flow-node:nth-child(9) { left: 232px; border-color: #bca6e8; }
.flow-node:nth-child(10) { left: 436px; }
.flow-node:nth-child(11) { left: 640px; border-color: #ffc28d; }
.flow-node:nth-child(12) { left: 844px; border-color: #9dbdff; }
.flow-node:hover, .flow-node.selected { transform: translateY(-2px); box-shadow: 0 14px 26px rgba(23, 109, 242, .14); }
.channel-panel h2 { margin-top: 0; }
.channel-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.channel-chips button { height: 32px; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--blue); padding: 0 12px; }
.channel-chips .active { color: #fff; background: var(--green); }
.phone { border: 8px solid #09284d; border-radius: 28px; overflow: hidden; background: #f3eee7; }
.phone-top { min-height: 58px; padding: 10px 16px; display: flex; align-items: center; gap: 12px; color: #fff; background: #047c75; }
.phone-top small { display: block; font-weight: 500; }
.phone-body { padding: 18px; }
.phone-body p { width: fit-content; max-width: 94%; padding: 11px 13px; border-radius: 8px; background: #fff; }
.phone-body time { display: block; text-align: right; color: var(--muted); }
.phone-input { margin: 0 14px 14px; border-radius: 999px; padding: 10px 12px; background: #fff; color: var(--muted); display: flex; justify-content: space-between; }
.automation-bottom { display: grid; grid-template-columns: 1fr .92fr .86fr 1fr .94fr; gap: 12px; margin-top: 16px; }
.mini-stats, .perf-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mini-stats span, .perf-stats span { padding: 10px; border-radius: 8px; background: #f6f9fc; color: var(--muted); }
.mini-stats b, .perf-stats b { display: block; color: var(--ink); font-size: 19px; }
.day-row time { padding: 7px; border-radius: 8px; background: #fff1df; color: #93500a; }
.performance-panel svg { width: 100%; height: 140px; }
.perf-stats { grid-template-columns: repeat(3, 1fr); }
.unpaid-panel strong { display: flex; justify-content: space-between; margin-top: 14px; color: var(--ink); }
.unpaid-panel span { color: var(--red); font-size: 20px; }

.selected, tbody tr.selected { outline: 2px solid rgba(23, 109, 242, .25); outline-offset: -2px; }
tbody tr, .mini-row, .exam-row, .message-row, .task-row, .day-row { cursor: pointer; }
tbody tr:hover, .mini-row:hover, .exam-row:hover, .message-row:hover, .task-row:hover, .day-row:hover { background: #f2f7ff; }

.toast { position: fixed; right: 22px; bottom: 22px; padding: 14px 18px; border-radius: 8px; color: #fff; background: #061e3d; opacity: 0; transform: translateY(20px); transition: .22s ease; pointer-events: none; box-shadow: 0 18px 36px rgba(0,0,0,.22); }
.toast.show { opacity: 1; transform: translateY(0); }

.landing-page { min-height: 100vh; background: radial-gradient(circle at 10% 10%, rgba(23, 109, 242, .18), transparent 28%), linear-gradient(135deg, #edf4ff, #f8fbff 52%, #eef3f7); }
.landing-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding: 72px 0; }
.landing-hero { border: 1px solid var(--line); border-radius: 24px; padding: 56px; background: rgba(255,255,255,.9); box-shadow: 0 24px 70px rgba(18, 42, 70, .12); }
.landing-hero h1 { max-width: 820px; margin: 22px 0 16px; color: var(--ink); font-size: clamp(36px, 6vw, 64px); line-height: 1.02; letter-spacing: -.04em; }
.landing-hero p { max-width: 760px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.landing-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.landing-actions a { border-radius: 10px; padding: 14px 18px; text-decoration: none; font-weight: 900; }
.landing-primary { color: #fff; background: linear-gradient(135deg, #176df2, #1158d4); }
.landing-secondary { border: 1px solid #b8d2ff; color: #1557c8; background: #fff; }
.landing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 18px; }
.landing-grid p { color: var(--muted); line-height: 1.55; }

@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 224px 1fr; }
  .dashboard-grid, .student-layout, .automation-layout, .automation-bottom { grid-template-columns: 1fr; }
  .search { width: 260px; }
  .demo-strip { align-items: stretch; flex-direction: column; }
  .demo-strip div { margin-right: 0; }
  .landing-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .search { width: 100%; order: 3; }
  .nav { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid, .profile-grid, .summary-strip, .mini-stats, .perf-stats { grid-template-columns: 1fr; }
  .flow-canvas { min-width: 1040px; overflow-x: auto; }
  .landing-shell { width: min(100% - 28px, 1120px); padding: 28px 0; }
  .landing-hero { padding: 28px; }
}
