:root{
  --primary:#7754c9;
  --primary-700:#5e3eb2;
  --primary-100:#eee9fa;
  --primary-50:#faf8ff;
  --text:#212529;
  --muted:#6c757d;
  --border:#dee2e6;
  --surface:#ffffff;
  --surface-soft:#f8f9fa;
  --success:#66af8e;
  --warning:#f2c96d;
  --shadow:0 8px 28px rgba(43,32,74,.08);
  --radius:.45rem;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:#fff;color:var(--text);font-family:Ageo,Arial,sans-serif;font-size:16px}
button,input,select{font:inherit}
button{touch-action:manipulation}
.shell{width:100%;max-width:1140px;margin:0 auto;background:#fff;min-height:100vh}
.topbar{height:50px;border-bottom:1px solid var(--border);background:#fff;position:sticky;top:0;z-index:20;display:flex;align-items:center}
.topbar-inner{display:flex;align-items:center;width:100%;padding:0 8px;gap:10px}
.crumbs{display:flex;align-items:center;gap:5px;min-width:0}
.crumb-btn{border:0;background:transparent;color:var(--text);padding:8px 6px;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:250px}
.crumb-sep{color:#adb5bd}
.top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}
.demo-badge,.status-badge{display:inline-flex;align-items:center;border-radius:999px;padding:4px 9px;font-size:12px;border:1px solid var(--border);background:var(--surface-soft);white-space:nowrap}
.status-badge.ready{background:#e8f4ef;border-color:#b7ddcd;color:#285d45}
.role-select{border:1px solid var(--primary);color:var(--primary);background:#fff;border-radius:999px;padding:6px 12px;min-width:230px}
.layout{display:grid;grid-template-columns:65px minmax(0,1fr)}
.sidebar{border-right:1px solid var(--border);min-height:calc(100vh - 50px);position:sticky;top:50px;align-self:start;padding:12px 8px;background:#fff}
.nav{display:flex;flex-direction:column;gap:8px}
.nav-btn{width:48px;height:42px;border:0;background:transparent;border-radius:var(--radius);display:flex;align-items:center;justify-content:center;cursor:pointer;color:var(--text);transition:background .15s ease,color .15s ease,transform .15s ease}
.nav-btn:hover{background:#f4f1fb;color:var(--primary)}
.nav-btn.active{background:var(--primary-100);color:var(--primary)}
.nav-icon{font-size:18px;line-height:1}
.nav-label{display:none}
main{min-width:0;padding:16px 16px 60px}
.toolbar{display:flex;justify-content:flex-end;min-height:28px;margin-bottom:4px}
.reset-btn{border:0;background:transparent;color:var(--muted);cursor:pointer;padding:5px 0}
.page-title{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin:0 0 8px}
.page-title h1{font-size:2rem;line-height:1.2;margin:.5rem 0 0;font-weight:700}
.page-title p{margin:6px 0 0;color:var(--muted)}
.page-title .actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;padding-top:8px}
.title-rule{border:0;border-top:1px solid var(--border);margin:8px 0 18px}
.btn{border-radius:999px;padding:8px 16px;border:1px solid transparent;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px;line-height:1.2;transition:transform .15s ease,box-shadow .15s ease,background .15s ease}
.btn:hover:not(:disabled){transform:translateY(-1px)}
.btn:focus-visible{outline:3px solid rgba(119,84,201,.2);outline-offset:2px}
.btn-primary{background:var(--primary);border-color:var(--primary);color:#fff}
.btn-primary:hover{background:var(--primary-700);box-shadow:0 6px 16px rgba(119,84,201,.2)}
.btn-outline{background:#fff;border-color:var(--primary);color:var(--primary)}
.btn-outline:hover{background:var(--primary-50)}
.btn-secondary{background:#fff;border-color:var(--border);color:var(--text)}
.btn-sm{font-size:14px;padding:5px 11px}
.btn:disabled{opacity:.5;cursor:not-allowed}
.card{background:#fff;border:1px solid var(--border);border-radius:var(--radius)}
.card-body{padding:16px}
.card-hover{transition:transform .15s ease,box-shadow .15s ease,border-color .15s ease}
.card-hover:hover{transform:translateY(-2px);box-shadow:var(--shadow);border-color:#d2c7ee}
.muted{color:var(--muted)}
.small{font-size:13px}
.mb{margin-bottom:16px}
.stack{display:flex;flex-direction:column;gap:16px}
.row{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:16px}
.col-4{grid-column:span 4}.col-5{grid-column:span 5}.col-6{grid-column:span 6}.col-7{grid-column:span 7}.col-8{grid-column:span 8}
.metric-label{color:var(--muted);font-size:14px}.metric{font-size:30px;font-weight:700;margin-top:4px}
.progress{height:6px;background:#e9ecef;border-radius:999px;overflow:hidden}.progress span{height:100%;display:block;background:var(--primary);border-radius:999px}
.table-wrap{overflow:auto}.table{border-collapse:collapse;width:100%}.table th,.table td{padding:12px;border-bottom:1px solid var(--border);text-align:left;vertical-align:middle}.table th{font-size:14px}.table tr:last-child td{border-bottom:0}

/* Teacher home */
.class-context{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-soft)}
.class-context strong{display:block}.class-context .muted{font-size:13px;margin-top:2px}
.month-focus{overflow:hidden;border-color:#d8cdf1;box-shadow:0 10px 32px rgba(78,54,131,.06)}
.month-focus-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:16px 18px;border-bottom:1px solid #e7e0f7;background:linear-gradient(180deg,#fbf9ff 0%,#fff 100%)}
.month-focus-head h2{font-size:22px;margin:0}.month-focus-head .eyebrow{color:var(--primary);font-size:13px;font-weight:700;margin-bottom:4px}
.focus-columns{display:grid;grid-template-columns:1fr 1fr;min-height:235px}
.focus-half{padding:22px;display:flex;flex-direction:column;gap:14px}
.focus-half+.focus-half{border-left:1px solid var(--border)}
.focus-label{display:flex;align-items:center;gap:9px;font-weight:700;font-size:17px}
.focus-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--primary-100);color:var(--primary);font-weight:700}
.focus-half.class-side .focus-icon{background:#eef7f3;color:#438069}
.strength-list{display:flex;flex-wrap:wrap;gap:10px;align-items:center}
.strength-token{display:inline-flex;align-items:center;gap:8px;border-radius:999px;border:1px solid #d8cdf1;background:#faf8ff;padding:9px 13px;font-weight:700}
.strength-token::before{content:"";width:9px;height:9px;border-radius:50%;background:var(--primary)}
.class-side .strength-token{border-color:#cfe4db;background:#f6fbf9}.class-side .strength-token::before{background:var(--success)}
.empty-focus{padding:12px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--muted);background:var(--surface-soft)}
.focus-actions{margin-top:auto;display:flex;gap:8px;flex-wrap:wrap}
.home-secondary{display:grid;grid-template-columns:1.3fr .7fr;gap:16px;margin-top:16px}
.action-card{padding:18px;display:flex;align-items:center;gap:16px;min-height:118px}
.action-illustration{width:72px;height:72px;border-radius:50%;flex:0 0 auto;display:grid;place-items:center;background:radial-gradient(circle at center,#fff 0 31%,#e8e0f7 32% 46%,#7754c9 47% 49%,#f6f2fc 50% 65%,#7754c9 66% 68%,#fff 69%);color:var(--primary);font-weight:700;font-size:12px;text-align:center;line-height:1.05}
.action-card h3{margin:0 0 5px;font-size:18px}.action-card p{margin:0 0 12px;color:var(--muted);font-size:14px}
.progress-card h3{margin:0 0 6px;font-size:18px}.progress-number{font-size:30px;font-weight:700;margin-bottom:2px}

/* Strength library in Teach */
.group-section{margin-bottom:24px}.group-header{display:flex;align-items:center;gap:9px;margin:0 0 10px}.group-dot{width:13px;height:13px;border-radius:50%;background:var(--primary)}
.library-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.strength-card .card-body{min-height:145px;display:flex;flex-direction:column;gap:8px}.strength-card h3{font-size:16px;margin:0}.strength-card p{font-size:13px;color:var(--muted);margin:0 0 10px}.strength-card .btn{margin-top:auto}
.strength-orb{width:38px;height:38px;border-radius:50%;display:grid;place-items:center;background:var(--primary-100);color:var(--primary);font-weight:700}

/* Year clock */
.yearclock-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:20px;align-items:start}
.yearclock-stage{border:1px solid #d9cff1;border-radius:14px;background:linear-gradient(180deg,#fff 0%,#fcfaff 100%);padding:18px;min-width:0;box-shadow:0 12px 34px rgba(86,61,141,.07)}
.yearclock-heading{text-align:center;margin-bottom:8px}.yearclock-heading h2{margin:0;font-size:24px}.yearclock-heading p{margin:4px 0 0;color:var(--muted)}
.wheel-wrap{width:min(100%,720px);margin:0 auto;position:relative}
.wheel-svg{width:100%;height:auto;display:block;filter:drop-shadow(0 10px 16px rgba(73,50,125,.06))}
.wheel-sector{fill:#fbf9ff;stroke:var(--primary);stroke-width:1.5;cursor:pointer;transition:fill .15s ease,filter .15s ease}
.wheel-sector:hover{fill:#f2ecff;filter:brightness(.99)}
.wheel-sector.current{fill:#e7dcff;stroke-width:2.4}
.wheel-sector.selected{fill:#f0e9ff;stroke-width:2.3}
.wheel-month{font-size:13px;font-weight:700;fill:#4b3a72;pointer-events:none}
.wheel-strength{font-size:10.5px;font-weight:700;fill:#27222f;pointer-events:none}
.wheel-strength.empty{font-weight:400;fill:#8b8396}
.wheel-center-outer{fill:#fff;stroke:var(--primary);stroke-width:2}
.wheel-center{fill:var(--primary)}
.wheel-center-title{fill:#fff;font-size:18px;font-weight:700;text-anchor:middle}
.wheel-center-sub{fill:#eee7ff;font-size:11px;text-anchor:middle}
.wheel-current-dot{fill:var(--primary);stroke:#fff;stroke-width:2}
.yearclock-side{display:flex;flex-direction:column;gap:14px;position:sticky;top:66px}
.side-card h3{font-size:18px;margin:0 0 7px}.side-card p{margin:0;color:var(--muted);font-size:14px}
.selected-month{margin-top:12px;padding:12px;background:var(--primary-50);border-radius:var(--radius);border:1px solid #e3daf7}
.selected-month .strength-list{margin-top:8px}
.side-actions{display:flex;flex-direction:column;gap:8px;margin-top:14px}.side-actions .btn{width:100%}
.yearclock-note{font-size:13px;color:var(--muted);margin-top:10px}

/* Principal */
.principal-intro{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:14px;padding:12px 14px;border-radius:var(--radius);background:#fbf9ff;border:1px solid #e3daf7}
.principal-intro strong{display:block;margin-bottom:3px}

/* Modals */
.modal-backdrop{position:fixed;inset:0;background:rgba(24,19,34,.45);z-index:50;display:none;align-items:center;justify-content:center;padding:20px}.modal-backdrop.show{display:flex}
.modal{width:min(720px,100%);max-height:90vh;overflow:auto;background:#fff;border-radius:10px;box-shadow:0 20px 60px rgba(31,20,49,.24)}
.modal-head,.modal-foot{padding:16px;display:flex;align-items:center;gap:8px}.modal-head{border-bottom:1px solid var(--border);justify-content:space-between}.modal-head h2{font-size:22px;margin:0}.modal-body{padding:16px}.modal-foot{border-top:1px solid var(--border);justify-content:flex-end;flex-wrap:wrap}.close-btn{border:0;background:transparent;font-size:24px;cursor:pointer;color:var(--muted)}
.field{margin-bottom:14px}.field label{display:block;margin-bottom:6px;font-weight:700;font-size:14px}.field input,.field select{width:100%;padding:9px 10px;border:1px solid #ced4da;border-radius:var(--radius);background:#fff}
.strength-picker{display:flex;flex-wrap:wrap;gap:8px}.strength-picker button{border:1px solid var(--primary);background:#fff;color:var(--primary);border-radius:999px;padding:7px 10px;cursor:pointer}.strength-picker button.selected{background:var(--primary);color:#fff}.strength-picker button.locked{border-color:#d9d9df;color:#9b9ba4;background:#f7f7f8}.strength-picker button:disabled{opacity:.45;cursor:not-allowed}
.check{display:flex;align-items:flex-start;gap:8px;margin-top:14px}.check input{margin-top:3px}
.class-choice{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid var(--border);border-radius:var(--radius);padding:12px;margin-bottom:10px;cursor:pointer}.class-choice:hover{border-color:#cdbfea;background:#fbf9ff}.class-choice.active{border-color:var(--primary);background:var(--primary-50)}
.notice{padding:12px;border-radius:var(--radius);border:1px solid #f0dda0;background:#fff8df;color:#554519;font-size:14px}

@media(min-width:1400px){.shell{max-width:1320px}.layout{grid-template-columns:220px minmax(0,1fr)}.nav-btn{width:100%;justify-content:flex-start;gap:10px;padding:0 12px}.nav-label{display:inline}.nav-icon{width:22px;text-align:center}}
@media(max-width:1050px){.yearclock-layout{grid-template-columns:1fr}.yearclock-side{position:static;display:grid;grid-template-columns:1fr 1fr}.home-secondary{grid-template-columns:1fr}.library-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px){.focus-columns{grid-template-columns:1fr}.focus-half+.focus-half{border-left:0;border-top:1px solid var(--border)}.library-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.row{grid-template-columns:repeat(6,minmax(0,1fr))}.col-4,.col-5,.col-6,.col-7,.col-8{grid-column:span 6}.yearclock-side{grid-template-columns:1fr}.page-title{display:block}.page-title .actions{justify-content:flex-start}.role-select{min-width:180px}}
@media(max-width:575px){.shell{max-width:none}.layout{display:block}.sidebar{display:none}.topbar-inner{padding:0 10px}.crumbs{display:none}.role-select{min-width:0;max-width:220px}.demo-badge{display:none}main{padding:14px 12px 50px}.month-focus-head{align-items:flex-start;flex-direction:column}.focus-half{padding:18px}.home-secondary{grid-template-columns:1fr}.library-grid{grid-template-columns:1fr}.action-card{align-items:flex-start}.wheel-wrap{margin-top:6px}.yearclock-stage{padding:10px}.wheel-month{font-size:11px}.wheel-strength{font-size:8.5px}}
