/* =========================================================
   COSMO DASHBOARD — Dark & Light, AI-Institut Design
   ========================================================= */

/* ---- DARK (default) ---- */
[data-cosmo-theme="dark"], .cosmo-shell[data-cosmo-theme="dark"]{
  --bg:#070b16;
  --bg-2:#0b1224;
  --panel:#0e1730;
  --panel-2:#111a33;
  --line:rgba(120,150,220,.14);
  --line-strong:rgba(120,160,255,.3);
  --ink:#eaf0ff;
  --ink-2:#b7c4e6;
  --ink-3:#7f8db5;
  --cyan:#22e3ff;
  --magenta:#b16bff;
  --lime:#7CFFB2;
  --grad:linear-gradient(120deg,#22e3ff,#b16bff);
  --grad-soft:linear-gradient(120deg,rgba(34,227,255,.16),rgba(177,107,255,.16));
  --shadow:0 24px 60px -30px rgba(0,0,0,.8);
  --sidebar-bg:#0a1020;
}
/* ---- LIGHT ---- */
[data-cosmo-theme="light"], .cosmo-shell[data-cosmo-theme="light"]{
  --bg:#f4f6fc;
  --bg-2:#eef1fa;
  --panel:#ffffff;
  --panel-2:#f7f9ff;
  --line:rgba(30,50,110,.12);
  --line-strong:rgba(60,90,200,.28);
  --ink:#0d1526;
  --ink-2:#41506f;
  --ink-3:#6b7799;
  --cyan:#0aa9d4;
  --magenta:#7c3aed;
  --lime:#12a45a;
  --grad:linear-gradient(120deg,#0aa9d4,#7c3aed);
  --grad-soft:linear-gradient(120deg,rgba(10,169,212,.12),rgba(124,58,237,.12));
  --shadow:0 20px 50px -28px rgba(30,50,110,.35);
  --sidebar-bg:#ffffff;
}

*{box-sizing:border-box}
.cosmo-dash-body{margin:0}
.cosmo-shell{
  min-height:100vh;background:var(--bg);color:var(--ink);
  font-family:"Inter",system-ui,sans-serif;font-size:15px;line-height:1.6;
  display:grid;grid-template-columns:264px 1fr;
  -webkit-font-smoothing:antialiased;
}
.cosmo-shell a{text-decoration:none;color:inherit}
.cosmo-shell h1,.cosmo-shell h2{font-family:"Space Grotesk",sans-serif;letter-spacing:-.02em;margin:0}
.grad{background:var(--grad);-webkit-background-clip:text;background-clip:text;color:transparent}

/* =========================================================
   SIDEBAR
   ========================================================= */
.cosmo-sidebar{
  background:var(--sidebar-bg);border-right:1px solid var(--line);
  display:flex;flex-direction:column;position:sticky;top:0;height:100vh;padding:22px 16px;
}
.cosmo-brand{display:flex;align-items:center;gap:11px;padding:6px 8px 22px}
.cosmo-brand-mark{width:30px;height:30px;border-radius:9px;background:var(--grad);box-shadow:0 0 18px -3px var(--cyan);flex:0 0 auto}
.cosmo-brand-name{font-family:"Space Grotesk",sans-serif;font-weight:700;font-size:17px}

.cosmo-nav-wrap{flex:1;overflow-y:auto;margin:0 -6px;padding:0 6px}
.cosmo-nav-wrap::-webkit-scrollbar{width:6px}
.cosmo-nav-wrap::-webkit-scrollbar-thumb{background:var(--line-strong);border-radius:6px}
.cosmo-nav{list-style:none;margin:0;padding:0}

.cosmo-nav-heading{
  font-family:"Space Grotesk",sans-serif;font-size:11px;letter-spacing:.2em;text-transform:uppercase;
  color:var(--ink-3);padding:18px 12px 8px;font-weight:600;
}
.cosmo-nav-item a{
  display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:11px;
  color:var(--ink-2);font-weight:500;transition:background .18s,color .18s;position:relative;
}
.cosmo-nav-item a:hover{background:var(--grad-soft);color:var(--ink)}
.cosmo-nav-item.is-active a{background:var(--grad-soft);color:var(--ink)}
.cosmo-nav-item.is-active a::before{
  content:"";position:absolute;left:-6px;top:8px;bottom:8px;width:3px;border-radius:3px;background:var(--grad);
}
.cosmo-ic{width:19px;height:19px;flex:0 0 auto;color:var(--cyan);opacity:.9}
.cosmo-nav-item a:hover .cosmo-ic,.cosmo-nav-item.is-active a .cosmo-ic{opacity:1}

.cosmo-sidebar-foot{padding-top:16px;border-top:1px solid var(--line);margin-top:8px}
.cosmo-theme-toggle{
  display:flex;align-items:center;gap:12px;width:100%;background:none;border:0;cursor:pointer;
  color:var(--ink-2);font-family:"Inter",sans-serif;font-size:13.5px;padding:8px;border-radius:10px;
}
.cosmo-theme-toggle:hover{background:var(--panel-2)}
.tt-track{width:44px;height:24px;border-radius:100px;background:var(--panel-2);border:1px solid var(--line-strong);position:relative;flex:0 0 auto;transition:background .2s}
.tt-thumb{position:absolute;top:2px;left:2px;width:18px;height:18px;border-radius:50%;background:var(--grad);transition:transform .25s}
[data-cosmo-theme="light"] .tt-thumb{transform:translateX(20px)}

/* =========================================================
   MAIN
   ========================================================= */
.cosmo-main{padding:22px 30px 60px;max-width:1200px}
.cosmo-topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:26px}
.cosmo-date{font-family:"Space Grotesk",sans-serif;font-size:14px;color:var(--ink-3);text-transform:capitalize}
.cosmo-topbar-right{display:flex;align-items:center;gap:14px}
.cosmo-cart-chip,.cosmo-bell{position:relative;display:grid;place-items:center;width:42px;height:42px;border-radius:12px;background:var(--panel);border:1px solid var(--line);color:var(--ink-2);transition:border-color .2s}
.cosmo-cart-chip:hover,.cosmo-bell:hover{border-color:var(--line-strong)}
.cosmo-cart-chip .cosmo-ic,.cosmo-bell .cosmo-ic{color:var(--ink-2)}
.cc-count,.cosmo-bell i{
  position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 5px;border-radius:100px;
  background:var(--grad);color:#04121b;font-size:11px;font-weight:700;display:grid;place-items:center;font-style:normal;
}
.cosmo-user-chip{display:flex;align-items:center;gap:10px;padding:6px 14px 6px 6px;border-radius:100px;background:var(--panel);border:1px solid var(--line);transition:border-color .2s}
.cosmo-user-chip:hover{border-color:var(--line-strong)}
.cosmo-user-chip img{width:30px;height:30px;border-radius:50%;object-fit:cover}
.cosmo-user-chip span{font-weight:600;font-size:14px}

/* Welcome */
.cosmo-welcome{
  background:var(--grad-soft);border:1px solid var(--line-strong);border-radius:22px;
  padding:34px 36px;display:flex;justify-content:space-between;align-items:center;gap:30px;margin-bottom:24px;
  position:relative;overflow:hidden;
}
.cw-eyebrow{font-family:"Space Grotesk",sans-serif;font-size:12px;letter-spacing:.22em;text-transform:uppercase;color:var(--cyan);font-weight:600}
.cosmo-welcome h1{font-size:clamp(1.8rem,3.6vw,2.6rem);margin:8px 0 10px}
.cosmo-welcome p{color:var(--ink-2);max-width:52ch;margin:0 0 20px}
.cw-actions{display:flex;gap:12px;flex-wrap:wrap}

.cosmo-btn{
  display:inline-flex;align-items:center;gap:8px;font-family:"Space Grotesk",sans-serif;font-weight:600;
  font-size:14.5px;padding:12px 22px;border-radius:100px;cursor:pointer;border:0;transition:transform .2s,filter .2s,border-color .2s;
}
.cosmo-btn.sm{padding:9px 16px;font-size:13.5px}
.cosmo-btn.full{width:100%;justify-content:center;margin-top:12px}
.cosmo-btn.primary{background:var(--grad);color:#04121b;box-shadow:0 10px 26px -10px rgba(34,227,255,.5)}
.cosmo-btn.primary:hover{transform:translateY(-2px);filter:brightness(1.05)}
.cosmo-btn.ghost{background:transparent;border:1px solid var(--line-strong);color:var(--ink)}
.cosmo-btn.ghost:hover{border-color:var(--cyan);color:var(--cyan)}

/* Progress ring */
.cw-ring{flex:0 0 auto}
.cosmo-progress-ring{
  --pct:0;width:132px;height:132px;border-radius:50%;display:grid;place-items:center;
  background:conic-gradient(var(--cyan) calc(var(--pct)*1%),var(--panel-2) 0);position:relative;
}
.cosmo-progress-ring::before{content:"";position:absolute;inset:10px;border-radius:50%;background:var(--panel)}
.pr-inner{position:relative;text-align:center;z-index:1}
.pr-inner b{font-family:"Space Grotesk",sans-serif;font-size:1.9rem;display:block;line-height:1}
.pr-inner small{color:var(--ink-3);font-size:12px;letter-spacing:.08em}

/* Stat cards */
.cosmo-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:24px}
.cosmo-stat{
  background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:22px;
  display:flex;flex-direction:column;gap:4px;transition:transform .25s,border-color .25s,box-shadow .25s;position:relative;
}
.cosmo-stat:hover{transform:translateY(-4px);border-color:var(--line-strong);box-shadow:var(--shadow)}
.cs-ic{width:40px;height:40px;border-radius:11px;display:grid;place-items:center;background:var(--grad-soft);border:1px solid var(--line-strong);margin-bottom:8px}
.cs-ic .cosmo-ic{color:var(--cyan)}
.cs-label{font-size:12.5px;color:var(--ink-3);letter-spacing:.04em;text-transform:uppercase;font-family:"Space Grotesk",sans-serif}
.cs-value{font-family:"Space Grotesk",sans-serif;font-size:1.25rem;font-weight:700;line-height:1.2}
.cs-sub{font-size:13px;color:var(--ink-3)}
.cs-cta{margin-top:12px;display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--cyan)}
.cs-cta svg{width:15px;height:15px;transition:transform .2s}
.cosmo-stat:hover .cs-cta svg{transform:translateX(3px)}

/* Columns */
.cosmo-columns{display:grid;grid-template-columns:1.6fr 1fr;gap:20px;align-items:start}
.cosmo-panel{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:24px 26px;margin-bottom:20px}
.cosmo-side .cosmo-panel:last-child{margin-bottom:0}
.cp-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}
.cp-head h2{font-size:1.15rem}
.cp-link{font-size:13px;color:var(--cyan);font-weight:600}

/* Course list */
.cosmo-course-list{list-style:none;margin:0;padding:0;display:grid;gap:18px}
.ccl-top{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:8px}
.ccl-title{font-weight:600;font-size:15px}
.ccl-title:hover{color:var(--cyan)}
.ccl-pct{font-family:"Space Grotesk",sans-serif;font-weight:700;font-size:14px;color:var(--ink-2)}
.ccl-bar{height:8px;border-radius:100px;background:var(--panel-2);overflow:hidden;border:1px solid var(--line)}
.ccl-bar span{display:block;height:100%;border-radius:100px;background:var(--grad);transition:width .6s}

.cosmo-empty{text-align:center;padding:26px 10px;color:var(--ink-3)}
.cosmo-empty p{margin:0 0 14px}

/* Next call */
.cosmo-call{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.cc-date{flex:0 0 auto;width:60px;height:60px;border-radius:14px;background:var(--grad-soft);border:1px solid var(--line-strong);display:grid;place-items:center;text-align:center;font-family:"Space Grotesk",sans-serif}
.cc-date b{font-size:1.4rem;line-height:1;display:block}
.cc-date small{font-size:11px;color:var(--ink-3);text-transform:uppercase}
.cc-body{flex:1;min-width:120px}
.cc-title{font-weight:600}
.cc-time{font-size:13px;color:var(--ink-3)}

/* Mini list */
.cosmo-mini{list-style:none;margin:0 0 8px;padding:0;display:grid;gap:12px}
.cosmo-mini li{display:flex;justify-content:space-between;align-items:center;font-size:14px;color:var(--ink-2)}
.cosmo-mini li span{display:flex;align-items:center;gap:9px}
.cosmo-mini li .cosmo-ic{width:16px;height:16px;color:var(--ink-3)}
.cosmo-mini li b{font-family:"Space Grotesk",sans-serif;color:var(--ink)}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media(max-width:1080px){
  .cosmo-stats{grid-template-columns:1fr 1fr}
  .cosmo-columns{grid-template-columns:1fr}
}
@media(max-width:860px){
  .cosmo-shell{grid-template-columns:1fr}
  .cosmo-sidebar{position:fixed;left:0;top:0;z-index:50;transform:translateX(-100%);transition:transform .3s;width:264px}
  .cosmo-shell.nav-open .cosmo-sidebar{transform:none}
  .cosmo-mobile-bar{display:flex}
  .cosmo-welcome{flex-direction:column;align-items:flex-start}
}
@media(max-width:560px){
  .cosmo-stats{grid-template-columns:1fr}
  .cosmo-main{padding:18px 18px 50px}
}

/* Mobile top bar (burger) */
.cosmo-mobile-bar{display:none;position:sticky;top:0;z-index:40;background:var(--bg);padding:12px 18px;border-bottom:1px solid var(--line);align-items:center;gap:12px}
.cosmo-burger{width:42px;height:42px;border-radius:11px;background:var(--panel);border:1px solid var(--line);color:var(--ink);display:grid;place-items:center;cursor:pointer}

@media(prefers-reduced-motion:reduce){*{transition:none!important}}
