:root{
    --navy:#172033;
    --navy-2:#202b40;
    --blue:#2f6df6;
    --pink:#eb4da5;
    --yellow:#f4b400;
    --green:#35b96b;
    --purple:#7c4dff;
    --orange:#f97316;
    --red:#ef4444;
    --surface:#ffffff;
    --surface-soft:#f5f7fb;
    --border:#e5eaf2;
    --text:#172033;
    --muted:#6d788b;
    --shadow:0 10px 30px rgba(23,32,51,.08);
    --sidebar-width:245px;
}

*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,Segoe UI,Arial,sans-serif;background:var(--surface-soft);color:var(--text)}
a{color:inherit}
button,input{font:inherit}

.app-shell{display:flex;min-height:100vh}
.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-width);display:flex;flex-direction:column;background:linear-gradient(180deg,#1a2440,#121827);color:#fff;z-index:50}
.sidebar-brand{display:flex;align-items:center;gap:12px;padding:18px 16px;border-bottom:1px solid rgba(255,255,255,.08)}
.logo-box{width:58px;height:58px;border-radius:14px;background:#fff;display:grid;place-items:center;overflow:hidden}
.logo-box img{width:100%;height:100%;object-fit:contain}
.sidebar-brand strong,.sidebar-brand span{display:block}
.sidebar-brand strong{font-size:14px}
.sidebar-brand span{font-size:11px;color:#aeb8ca;margin-top:3px}
.sidebar-nav{padding:18px 10px;flex:1;overflow-y:auto}
.nav-section-title{padding:0 10px 8px;color:#8792a6;font-size:10px;text-transform:uppercase;letter-spacing:.12em;font-weight:700}
.nav-section-gap{margin-top:22px}
.nav-item{display:flex;align-items:center;gap:11px;padding:10px 11px;margin:3px 0;border-radius:11px;text-decoration:none;color:#d5dce8;transition:.18s}
.nav-item:hover,.nav-item.is-active{background:rgba(255,255,255,.10);color:#fff}
.nav-item.is-active{box-shadow:inset 3px 0 0 #f4b400}
.nav-icon{width:24px;text-align:center}
.sidebar-footer{padding:14px;border-top:1px solid rgba(255,255,255,.08)}
.school-year{padding:11px;border-radius:10px;background:rgba(255,255,255,.06)}
.school-year span,.school-year strong{display:block}
.school-year span{font-size:10px;color:#9eabc0}
.school-year strong{margin-top:3px;font-size:14px}

.app-main{margin-left:var(--sidebar-width);width:calc(100% - var(--sidebar-width));min-height:100vh;display:flex;flex-direction:column}
.topbar{height:82px;display:grid;grid-template-columns:1fr minmax(320px,600px) auto;gap:20px;align-items:center;padding:0 26px;background:#fff;border-bottom:1px solid var(--border);position:sticky;top:0;z-index:40}
.topbar-left{display:flex;align-items:center;gap:12px}
.topbar-left h1{font-size:20px;margin:2px 0 0}
.eyebrow,.section-kicker{font-size:10px;text-transform:uppercase;letter-spacing:.12em;font-weight:700;color:#8290a3}
.section-kicker.light{color:rgba(255,255,255,.75)}
.global-search{height:42px;display:flex;align-items:center;gap:9px;padding:0 13px;background:#f2f5fa;border-radius:12px}
.global-search input{flex:1;border:0;outline:0;background:transparent}
.shortcut{font-size:10px;color:#8290a3;padding:3px 6px;border:1px solid #d8dee8;border-radius:6px;background:#fff}
.topbar-actions{display:flex;align-items:center;gap:12px}
.icon-button{border:0;background:transparent;border-radius:9px;padding:8px;cursor:pointer}
.notification-button{position:relative}
.notification-dot{position:absolute;right:5px;top:4px;width:7px;height:7px;border-radius:50%;background:var(--red);border:2px solid #fff}
.user-menu{display:flex;align-items:center;gap:9px}
.user-avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(135deg,#eef2ff,#fff3d8);color:var(--blue);font-weight:800}
.user-meta strong,.user-meta span{display:block}
.user-meta strong{font-size:12px}
.user-meta span{font-size:10px;color:var(--muted);margin-top:2px}
.logout-button{border:0;background:#f3f5f8;padding:7px 9px;border-radius:8px;cursor:pointer;font-size:11px}
.mobile-menu-button{display:none}

.content-area{padding:26px;flex:1}
.app-footer{display:flex;justify-content:space-between;padding:17px 26px;border-top:1px solid var(--border);font-size:11px;color:var(--muted);background:#fff}

.welcome-banner{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:26px 28px;margin-bottom:18px;border-radius:22px;color:#fff;background:linear-gradient(120deg,#2f6df6 0%,#7c4dff 50%,#eb4da5 100%);box-shadow:0 18px 35px rgba(124,77,255,.22)}
.welcome-content h2{font-size:30px;margin:6px 0}
.welcome-content p{margin:0;color:rgba(255,255,255,.88)}
.welcome-actions{display:flex;gap:10px;margin-top:20px}
.hero-button{display:inline-flex;align-items:center;justify-content:center;padding:10px 14px;border-radius:10px;text-decoration:none;font-weight:700}
.hero-button-light{background:#fff;color:#4535c4}
.hero-button-outline{border:1px solid rgba(255,255,255,.5);color:#fff}
.welcome-art{display:flex;gap:12px;font-size:38px;transform:rotate(-3deg)}
.welcome-art span{display:grid;place-items:center;width:62px;height:62px;border-radius:18px;background:rgba(255,255,255,.18);backdrop-filter:blur(4px)}

.stats-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin-bottom:18px}
.stat-card{display:flex;align-items:center;gap:13px;padding:17px;background:#fff;border:1px solid var(--border);border-radius:16px;box-shadow:var(--shadow);position:relative;overflow:hidden}
.stat-card:before{content:"";position:absolute;inset:0 auto 0 0;width:5px}
.accent-blue:before{background:var(--blue)}
.accent-pink:before{background:var(--pink)}
.accent-yellow:before{background:var(--yellow)}
.accent-green:before{background:var(--green)}
.accent-purple:before{background:var(--purple)}
.stat-icon{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:#f5f7fb;font-size:21px}
.stat-card span,.stat-card small{display:block}
.stat-card span{font-size:12px;color:var(--muted)}
.stat-card strong{display:block;font-size:24px;margin:2px 0}
.stat-card small{font-size:10px;color:#98a3b3}

.dashboard-layout{display:grid;grid-template-columns:minmax(0,2fr) minmax(300px,.8fr);gap:18px}
.dashboard-side{display:grid;gap:18px;align-content:start}
.panel{background:#fff;border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow);padding:20px}
.panel-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}
.panel-header h3{margin:4px 0 0;font-size:18px}
.text-link{font-size:11px;color:var(--blue);text-decoration:none;font-weight:700}

.week-agenda{display:grid;gap:16px}
.agenda-day{display:grid;grid-template-columns:90px 1fr;gap:14px}
.agenda-day-title{font-weight:800;color:#43506a;padding-top:10px}
.agenda-events{display:grid;gap:9px}
.agenda-event{display:grid;grid-template-columns:58px 1fr 10px;gap:12px;align-items:center;padding:12px 14px;border-radius:13px;background:#f8faff;border:1px solid #edf1f7}
.agenda-time{font-weight:800;color:var(--blue)}
.agenda-event-body strong,.agenda-event-body span{display:block}
.agenda-event-body span{margin-top:3px;font-size:11px;color:var(--muted)}
.agenda-dot{width:8px;height:8px;border-radius:50%;background:var(--pink)}

.quick-actions.fun{display:grid;gap:10px}
.quick-actions.fun a{display:flex;align-items:center;gap:11px;padding:11px;border:1px solid var(--border);border-radius:12px;text-decoration:none}
.quick-actions.fun a:hover{background:#fbfcff;border-color:#cbd7f1}
.quick-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;font-size:18px}
.quick-icon.blue{background:#eaf1ff}
.quick-icon.pink{background:#ffe8f5}
.quick-icon.yellow{background:#fff4cf}
.quick-icon.green{background:#e7f8ed}
.quick-actions strong,.quick-actions small{display:block}
.quick-actions small{font-size:10px;color:var(--muted);margin-top:3px}

.alert-list{display:grid;gap:10px}
.alert-item{display:grid;grid-template-columns:10px 1fr auto;gap:10px;align-items:center;padding:11px;border:1px solid var(--border);border-radius:12px;text-decoration:none}
.alert-status{width:8px;height:8px;border-radius:50%}
.status-red{background:var(--red)}
.status-orange{background:var(--orange)}
.status-yellow{background:var(--yellow)}
.alert-item strong,.alert-item span{display:block}
.alert-item div span{font-size:10px;color:var(--muted);margin-top:3px}
.badge{display:inline-flex;padding:5px 8px;border-radius:999px;font-size:10px;font-weight:700}
.badge-danger{background:#feecec;color:var(--red)}

.empty-state.compact{padding:35px 15px;text-align:center}
.empty-icon{font-size:34px}

.login-wrapper{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:30px;background:linear-gradient(135deg,#eef3ff,#fff4fb)}
.login-card{width:100%;max-width:420px;background:#fff;padding:28px;border:1px solid var(--border);border-radius:18px;box-shadow:var(--shadow)}
.login-card form{display:grid;gap:12px}
.login-card input{padding:12px;border:1px solid var(--border);border-radius:10px}
.login-card button{padding:12px;border:0;border-radius:10px;background:linear-gradient(120deg,var(--blue),var(--purple));color:#fff;font-weight:700;cursor:pointer}
.alert{padding:12px 16px;border-radius:10px;margin-bottom:16px}
.alert-error{background:#feecec;color:#991b1b}

@media(max-width:1250px){
    .stats-grid{grid-template-columns:repeat(3,1fr)}
    .topbar{grid-template-columns:1fr minmax(260px,420px) auto}
}
@media(max-width:980px){
    .sidebar{transform:translateX(-100%);transition:.25s}
    .sidebar.is-open{transform:translateX(0)}
    .app-main{margin-left:0;width:100%}
    .mobile-menu-button{display:inline-flex}
    .topbar{grid-template-columns:1fr auto}
    .topbar-center{display:none}
    .dashboard-layout{grid-template-columns:1fr}
}
@media(max-width:650px){
    .content-area{padding:16px}
    .topbar{padding:0 14px}
    .user-meta,.logout-button{display:none}
    .welcome-banner{align-items:flex-start;flex-direction:column}
    .welcome-art{font-size:28px}
    .welcome-art span{width:50px;height:50px}
    .stats-grid{grid-template-columns:1fr}
    .agenda-day{grid-template-columns:1fr}
    .app-footer{flex-direction:column;gap:4px}
}
