:root{
  --sidebar-w:208px;
  --ink:#0b2b52;
  --muted:#6e7f95;
  --blue:#2f83f5;
  --line:rgba(15,42,76,.09);
  --panel:rgba(255,255,255,.90);
  --panel-strong:rgba(255,255,255,.96);
  --shadow:0 14px 34px rgba(26,48,75,.10);
  --radius:20px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;overflow-x:hidden;background:#f4f7fb;color:var(--ink)}
body{font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.hidden{display:none!important}
.app{min-height:100dvh;background:#f4f7fb}
.app-header{display:none!important}
.main-shell{margin-left:var(--sidebar-w);min-height:100dvh;width:calc(100% - var(--sidebar-w));background:#f4f7fb}
.content{padding:0!important;min-height:100dvh;width:100%;overflow:visible!important;background:#f4f7fb!important}
.page{display:none!important;min-height:100dvh;width:100%;position:relative;background:#f4f7fb}
.page.active{display:block!important}
.page:not(#homePage){padding:28px 34px 44px;background:#f7f9fc!important}

/* SINGLE, FIXED DESKTOP SIDEBAR */
.sidebar{
  position:fixed!important;inset:0 auto 0 0!important;width:var(--sidebar-w)!important;height:100dvh!important;
  z-index:2000!important;background:rgba(250,252,255,.97)!important;border-right:1px solid rgba(25,55,90,.08)!important;
  padding:20px 16px 14px!important;display:flex!important;flex-direction:column!important;overflow:visible!important;
  box-shadow:5px 0 24px rgba(35,60,85,.08)!important;transform:none!important;
}
.side-brand{display:flex!important;align-items:center!important;gap:11px!important;padding:0 6px 18px!important;margin:0!important;height:auto!important}
.side-brand img{width:42px!important;height:42px!important;object-fit:contain!important}
.side-brand strong{display:block!important;font-size:22px!important;line-height:1!important;letter-spacing:.02em;color:#0b2a50!important}
.side-brand span{display:block!important;font-size:9px!important;font-weight:800!important;letter-spacing:.08em;color:#294664!important;margin-top:4px!important}
.season-label,.season{display:none!important}
.side-nav{display:flex!important;flex-direction:column!important;gap:4px!important;min-height:0!important;overflow:visible!important}
.side-nav>button,.nav-group>.nav-group-trigger{
  width:100%!important;min-height:43px!important;height:43px!important;border:0!important;border-radius:10px!important;
  background:transparent!important;color:#213f61!important;padding:0 12px!important;display:flex!important;align-items:center!important;
  gap:11px!important;font-size:14px!important;font-weight:500!important;text-align:left!important;cursor:pointer!important;
  transition:background .14s ease,color .14s ease,transform .14s ease!important;
}
.side-nav>button:hover,.nav-group>.nav-group-trigger:hover{background:#edf5ff!important;color:#1768ce!important}
.side-nav>button.active,.nav-group.active>.nav-group-trigger{
  color:white!important;background:linear-gradient(135deg,#297ef0,#3e99ff)!important;box-shadow:0 8px 18px rgba(47,131,245,.24)!important;
}
.nav-icon{display:grid!important;place-items:center!important;width:22px!important;min-width:22px!important;height:22px!important;font-size:17px!important}
.nav-icon svg{width:20px!important;height:20px!important;stroke:currentColor!important;fill:none!important;stroke-width:1.8!important}
.nav-text{display:block!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
.nav-caret{margin-left:auto!important;font-size:17px!important}
.nav-group{position:relative!important}
.nav-flyout{
  position:absolute!important;left:calc(100% + 12px)!important;top:-8px!important;width:330px!important;max-height:min(74dvh,620px)!important;
  overflow:auto!important;padding:10px!important;border-radius:18px!important;background:#fff!important;border:1px solid rgba(31,70,112,.10)!important;
  box-shadow:0 22px 55px rgba(27,48,75,.24)!important;z-index:4000!important;opacity:0!important;visibility:hidden!important;
  transform:translateX(-6px)!important;pointer-events:none!important;transition:opacity .12s ease,transform .12s ease,visibility .12s!important;
}
.nav-group:hover>.nav-flyout,.nav-group.open>.nav-flyout{opacity:1!important;visibility:visible!important;transform:none!important;pointer-events:auto!important}
.nav-flyout button{
  width:100%!important;min-height:52px!important;border:0!important;background:transparent!important;border-radius:12px!important;padding:9px 10px!important;
  display:grid!important;grid-template-columns:30px minmax(0,1fr)!important;gap:9px!important;align-items:center!important;text-align:left!important;color:#14385f!important;
}
.nav-flyout button:hover{background:#f0f6ff!important}
.nav-flyout button>span{font-size:19px!important;text-align:center!important}
.nav-flyout button b{display:block!important;min-width:0!important;font-size:14px!important;line-height:1.2!important;white-space:normal!important;overflow-wrap:normal!important;word-break:normal!important}
.nav-flyout button small{display:block!important;margin-top:3px!important;font-size:11px!important;line-height:1.25!important;color:#7d8da0!important;font-weight:500!important;white-space:normal!important}
.sidebar-footer{margin-top:auto!important;padding:10px 8px 0!important;border-top:1px solid #edf1f6!important;display:block!important}
.sidebar-footer #sideEmail{display:block!important;font-size:10px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;color:#8a98a9!important}
.sidebar-footer .text-btn{padding:5px 0!important;color:#b94252!important;font-size:11px!important}

/* HOME: ONLY PAGE THAT OWNS THE ISTANBUL BACKGROUND */
#homePage{padding:0!important;min-height:100dvh!important;background-image:url('nirvana-bg-fast.webp')!important;background-size:cover!important;background-position:center center!important;background-repeat:no-repeat!important;background-attachment:scroll!important}
#homePage>.home-grid{display:none!important}
#refDashboard{display:grid!important;grid-template-rows:auto auto auto auto!important;gap:16px!important;width:100%!important;max-width:1460px!important;margin:0 auto!important;padding:52px 42px 36px!important;min-height:100dvh!important}
.ref-hero{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:18px!important;color:white!important}
.ref-hero h1{margin:0!important;font-size:34px!important;line-height:1.05!important;letter-spacing:-.025em!important;text-shadow:0 2px 8px rgba(0,0,0,.18)!important}
.ref-hero p{margin:10px 0 0!important;font-size:16px!important;font-weight:700!important;text-shadow:0 2px 6px rgba(0,0,0,.22)!important}
.ref-date{display:flex!important;align-items:center!important;gap:12px!important;min-width:245px!important;padding:15px 18px!important;border-radius:16px!important;background:rgba(255,255,255,.91)!important;color:#14365a!important;box-shadow:var(--shadow)!important}
.ref-date>span{font-size:21px!important}.ref-date div{display:flex!important;flex-direction:column!important;gap:2px!important}.ref-date b{font-size:14px!important}.ref-date small{font-size:12px!important}.ref-date strong{margin-left:auto!important;font-size:26px!important}
.ref-kpis{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:16px!important}
.ref-kpis article,.ref-card{background:var(--panel)!important;border:1px solid rgba(255,255,255,.74)!important;box-shadow:var(--shadow)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
.ref-kpis article{min-height:132px!important;border-radius:18px!important;padding:20px 18px!important;display:grid!important;grid-template-columns:60px minmax(0,1fr)!important;gap:14px!important;align-items:center!important}
.ref-kpis article>span{width:56px!important;height:56px!important;border-radius:12px!important;display:grid!important;place-items:center!important;font-size:28px!important;background:#e7f0ff!important}
.ref-kpis .green>span{background:#daf8e7!important}.ref-kpis .yellow>span{background:#fff0ce!important}.ref-kpis .purple>span{background:#eee5ff!important}
.ref-kpis small{display:block!important;font-size:12px!important;color:#6d7d91!important}.ref-kpis b{display:block!important;font-size:27px!important;line-height:1.05!important;margin:3px 0 5px!important;color:#0d2d51!important}.ref-kpis em{display:block!important;font-size:12px!important;font-style:normal!important;color:#68798e!important}.ref-kpis i,.goal-lines i{display:block!important;height:8px!important;margin-top:12px!important;background:#e6e9ef!important;border-radius:999px!important;overflow:hidden!important}.ref-kpis u,.goal-lines u{display:block!important;height:100%!important;border-radius:inherit!important;background:#56a7ff!important}.ref-kpis .green u{background:#2fbd72!important}.ref-kpis .yellow u{background:#ffc31c!important}.ref-kpis .purple u{background:#9b60dc!important}
.ref-main{display:grid!important;grid-template-columns:minmax(0,1.35fr) minmax(0,1.02fr) minmax(290px,.92fr)!important;gap:16px!important;align-items:stretch!important}
.ref-bottom{display:grid!important;grid-template-columns:minmax(0,1.35fr) minmax(0,1.02fr) minmax(250px,.72fr)!important;gap:16px!important;align-items:stretch!important}
.ref-card{border-radius:20px!important;padding:18px!important;min-width:0!important}
.ref-main>.ref-card{min-height:358px!important}.ref-bottom>.ref-card{min-height:175px!important}
.ref-card header{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;margin-bottom:14px!important}.ref-card h3{margin:0!important;font-size:18px!important;color:#12365c!important}.ref-card header button{border:0!important;background:#edf5ff!important;color:#2268a8!important;border-radius:10px!important;padding:8px 11px!important;font-weight:700!important;font-size:12px!important;cursor:pointer!important}
#refToday{display:grid!important;gap:8px!important}#refToday label{display:grid!important;grid-template-columns:24px minmax(0,1fr) auto!important;align-items:center!important;gap:8px!important;min-height:47px!important;padding:8px 10px!important;border-radius:11px!important;background:rgba(255,255,255,.56)!important;border:1px solid rgba(23,54,89,.05)!important}#refToday b{font-size:13px!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}#refToday span{padding:5px 10px!important;border-radius:999px!important;background:#dff6e8!important;font-size:12px!important;color:#25885a!important}
.ref-timer{text-align:center!important}.ref-timer header{text-align:left!important}.timer-tabs{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:6px!important}.timer-tabs>*{padding:9px!important;border-radius:9px!important;background:#edf0f5!important;font-size:12px!important;font-weight:500!important}.timer-tabs b{background:#2f86f7!important;color:#fff!important}.ref-timer .clock{display:block!important;font-size:48px!important;line-height:1!important;margin:27px 0 20px!important;letter-spacing:.015em!important}.ref-timer .topic,.ref-timer .start{width:100%!important;border:0!important;border-radius:12px!important;min-height:42px!important;font-size:13px!important}.ref-timer .topic{background:white!important;color:#7b8796!important;border:1px solid #e6e9ed!important;text-align:left!important;padding:0 14px!important}.ref-timer .start{margin-top:13px!important;background:#2b7df2!important;color:white!important;font-weight:800!important}
.ref-goal .goal-ring{width:128px!important;height:128px!important;margin:18px auto!important;border:10px solid #e5e8eb!important;border-top-color:#25b46d!important;border-right-color:#25b46d!important;border-radius:50%!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important}.goal-ring strong{font-size:28px!important}.goal-ring small{font-size:11px!important}.goal-lines p{display:flex!important;align-items:center!important;gap:6px!important;margin:10px 0 0!important;font-size:12px!important}.goal-lines p span{margin-left:auto!important;color:#52677d!important}.goal-lines i{height:7px!important;margin-top:6px!important}.goal-lines u{background:#2f83f5!important}
#refResults{display:grid!important;grid-template-columns:repeat(4,1fr)!important;gap:8px!important}#refResults span{min-height:84px!important;border-radius:12px!important;background:#eff5ff!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:5px!important}#refResults span:nth-child(2){background:#edf7ff!important}#refResults span:nth-child(3){background:#eefbf5!important}#refResults span:nth-child(4){background:#fff7e7!important}#refResults small{font-size:11px!important;color:#4673a2!important}#refResults b{font-size:20px!important}.ref-coach>div{display:grid!important;grid-template-columns:56px 1fr!important;gap:11px!important;align-items:center!important;font-size:34px!important}.ref-coach p{margin:0!important;padding:11px 13px!important;background:white!important;border-radius:12px!important;font-size:13px!important;line-height:1.45!important;color:#30445b!important}.ref-quick>div{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}.ref-quick button{min-height:62px!important;border:0!important;border-radius:11px!important;background:white!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:5px!important;color:#173d67!important;font-weight:700!important}.ref-quick button span{font-size:11px!important}

/* NON-HOME PAGES: OPAQUE, SELF-CONTAINED, NEVER REVEAL HOME BACKGROUND */
#plannerPage,#subjectsPage,#dasPage,#examsPage,#statsPage,#repetitionPage,#timerPage,#countdownPage,#coachPage{background:#f7f9fc!important;background-image:none!important;isolation:isolate!important;z-index:1!important}
#coachPage{height:100dvh!important;min-height:100dvh!important;overflow:hidden!important;padding:18px!important}
#coachPage .v123-coach{height:calc(100dvh - 36px)!important;min-height:0!important;display:grid!important;grid-template-columns:280px minmax(0,1fr)!important;overflow:hidden!important;border-radius:20px!important;background:#fff!important;box-shadow:0 12px 34px rgba(30,50,70,.08)!important}
#coachPage .v123-coach-side{height:100%!important;overflow-y:auto!important;background:#f7f9fc!important}
#coachPage .v123-chat{height:100%!important;min-height:0!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;background:white!important}
#coachPage .v123-chat>header{flex:0 0 auto!important}
#v123CoachMsgs{flex:1 1 auto!important;min-height:0!important;height:auto!important;overflow-y:auto!important;overflow-x:hidden!important;padding-bottom:18px!important;background:white!important}
#v123CoachForm{flex:0 0 auto!important;position:relative!important;bottom:auto!important;display:grid!important;grid-template-columns:44px minmax(0,1fr) 48px!important;gap:8px!important;width:100%!important;background:white!important;z-index:4!important}
#v123CoachInput{width:100%!important;min-width:0!important;min-height:50px!important;max-height:145px!important;font-size:16px!important;resize:none!important;overflow-y:auto!important}
.v123-chips,.v136-attachments,.v123-typing,.v123-foot{flex:0 0 auto!important}

/* route state must always be visible */
body[data-active-page="plannerPage"] [data-go="plannerPage"],body[data-active-page="subjectsPage"] [data-go="subjectsPage"],body[data-active-page="repetitionPage"] [data-go="repetitionPage"],body[data-active-page="timerPage"] [data-go="timerPage"],body[data-active-page="statsPage"] [data-go="statsPage"]{color:#fff!important;background:linear-gradient(135deg,#297ef0,#3e99ff)!important}
body[data-active-page="coachPage"] .coach-group>.nav-group-trigger,body[data-active-page="dasPage"] .analysis-group>.nav-group-trigger,body[data-active-page="examsPage"] .analysis-group>.nav-group-trigger{color:#fff!important;background:linear-gradient(135deg,#297ef0,#3e99ff)!important}


/* explicit active route state */
body[data-active-page="homePage"] [data-go="homePage"],
body[data-active-page="plannerPage"] [data-go="plannerPage"],
body[data-active-page="subjectsPage"] [data-go="subjectsPage"],
body[data-active-page="repetitionPage"] [data-go="repetitionPage"],
body[data-active-page="timerPage"] [data-go="timerPage"],
body[data-active-page="countdownPage"] [data-go="countdownPage"],
body[data-active-page="statsPage"] [data-go="statsPage"]{color:#fff!important;background:linear-gradient(135deg,#297ef0,#3e99ff)!important;box-shadow:0 8px 18px rgba(47,131,245,.24)!important}

/* TABLET */
@media (max-width:1180px) and (min-width:769px){
  :root{--sidebar-w:186px}.sidebar{padding-left:12px!important;padding-right:12px!important}.side-brand strong{font-size:19px!important}.side-nav>button,.nav-group>.nav-group-trigger{font-size:12.5px!important;padding:0 9px!important}
  #refDashboard{padding:32px 24px 30px!important;gap:12px!important}.ref-kpis,.ref-main,.ref-bottom{gap:12px!important}.ref-kpis article{grid-template-columns:48px 1fr!important;padding:14px!important}.ref-kpis article>span{width:45px!important;height:45px!important;font-size:23px!important}.ref-kpis b{font-size:22px!important}.ref-main{grid-template-columns:1.25fr 1fr!important}.ref-goal{grid-column:1/-1!important}.ref-bottom{grid-template-columns:1fr 1fr!important}.ref-quick{grid-column:1/-1!important}
}

/* MOBILE */
@media (max-width:768px){
  :root{--sidebar-w:0px}
  .main-shell{margin-left:0!important;width:100%!important}
  .sidebar{top:auto!important;bottom:0!important;left:0!important;right:0!important;width:100%!important;height:72px!important;padding:6px 8px calc(6px + env(safe-area-inset-bottom))!important;display:block!important;border-right:0!important;border-top:1px solid #e7ecf2!important;overflow-x:auto!important;overflow-y:hidden!important}
  .side-brand,.sidebar-footer{display:none!important}.side-nav{display:flex!important;flex-direction:row!important;gap:4px!important;width:max-content!important;min-width:100%!important;height:100%!important;overflow:visible!important}.side-nav>button,.nav-group>.nav-group-trigger{flex:0 0 66px!important;width:66px!important;height:58px!important;min-height:58px!important;padding:4px!important;border-radius:13px!important;display:flex!important;flex-direction:column!important;justify-content:center!important;gap:3px!important;font-size:9px!important;text-align:center!important}.nav-icon{height:20px!important}.nav-text{max-width:62px!important}.nav-caret{display:none!important}
  .nav-flyout{position:fixed!important;left:10px!important;right:10px!important;bottom:82px!important;top:auto!important;width:auto!important;max-height:62dvh!important}
  .page:not(#homePage){padding:14px 12px 90px!important;min-height:100dvh!important}.content{padding-bottom:72px!important}
  #homePage{padding-bottom:80px!important;background-position:center center!important}.ref-dashboard,#refDashboard{padding:18px 12px 24px!important;gap:10px!important}.ref-hero h1{font-size:28px!important}.ref-hero p{font-size:14px!important}.ref-date{min-width:0!important;padding:10px 12px!important}.ref-date strong{font-size:20px!important}.ref-kpis{grid-template-columns:1fr 1fr!important;gap:9px!important}.ref-kpis article{min-height:112px!important;padding:12px!important;grid-template-columns:42px 1fr!important;gap:8px!important}.ref-kpis article>span{width:40px!important;height:40px!important;font-size:20px!important}.ref-kpis b{font-size:21px!important}.ref-main,.ref-bottom{grid-template-columns:1fr!important;gap:10px!important}.ref-main>.ref-card,.ref-bottom>.ref-card{min-height:auto!important}.ref-plan{min-height:300px!important}.ref-goal{grid-column:auto!important}.ref-quick{grid-column:auto!important}
  #coachPage{height:calc(100dvh - 72px)!important;min-height:0!important;padding:0 0 0!important;overflow:hidden!important}.v123-coach{height:100%!important;border-radius:0!important;display:block!important}.v123-coach-side{display:none!important}#coachPage .v123-chat{height:100%!important;padding:10px!important}#v123CoachForm{grid-template-columns:40px minmax(0,1fr) 44px!important;padding-bottom:calc(8px + env(safe-area-inset-bottom))!important}
}
