:root {
  --page: #d9dce2;
  --app: #f4f5f8;
  --card: #ffffff;
  --line: #eceef2;
  --ink: #17181c;
  --ink-2: #4a4d57;
  --muted: #9a9ea8;
  --blue: #1e6bff;
  --blue-2: #4f8dff;
  --navy: #173a9e;
  --sky: #a9c9ff;
  --dot: #e8eaef;
  --black: #1b1c21;
  --green: #22c55e;
  --red: #ef4444;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .04);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, .18);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: var(--app);
  color: var(--ink);
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
ul { list-style: none; }

.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.tiny { font-size: 10.5px; }

/* ===== App shell ===== */
.app {
  flex: 1;
  width: 100%;
  background: var(--app);
  padding: 22px 28px 20px;
}

/* Entry animation */
.reveal { opacity: 0; transform: translateY(14px); }
.ready .reveal { animation: rise .8s var(--ease) forwards; animation-delay: calc(var(--d, 0) * 80ms); }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ===== Top bar ===== */
.topbar { display: flex; align-items: center; gap: 24px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 8px; width: 214px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 15px; }
.logo { width: 30px; height: 30px; stroke: none; transition: transform .6s var(--ease), filter .4s; filter: drop-shadow(0 6px 10px rgba(30,107,255,.35)); }
.brand:hover .logo { transform: rotate(-8deg) scale(1.08); }
.logo-ecg { stroke-dasharray: 26; stroke-dashoffset: 0; }
.brand:hover .logo-ecg { animation: logoBeat 1s ease-in-out; }
@keyframes logoBeat { 0% { stroke-dashoffset: 26; } 100% { stroke-dashoffset: 0; } }
.brand-text { display: flex; flex-direction: column; line-height: 1; font-weight: 700; font-size: 16px; letter-spacing: -.02em; }
.brand-text small { font-size: 8.5px; font-weight: 600; letter-spacing: .28em; color: var(--blue); text-transform: uppercase; margin-top: 3px; }

.tabs { position: relative; display: flex; gap: 4px; background: #e9ebef; padding: 4px; border-radius: 999px; }
.tab { position: relative; z-index: 1; padding: 8px 16px; border-radius: 999px; color: var(--ink-2); font-size: 12px; transition: color .3s; }
.tab:hover { color: var(--ink); }
.tab.active { color: #fff; }
.tab-indicator {
  position: absolute; top: 4px; left: 4px; height: calc(100% - 8px);
  background: var(--blue); border-radius: 999px;
  box-shadow: 0 6px 16px -6px rgba(30, 107, 255, .8);
  transition: transform .5s var(--ease), width .5s var(--ease);
}

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: #e9ebef; color: var(--ink-2);
  transition: background .25s, transform .25s var(--ease);
}
.icon-btn:hover { background: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
.icon-btn:active { transform: scale(.94); }
.spin-hover svg { transition: transform .8s var(--ease); }
.spin-hover:hover svg { transform: rotate(120deg); }
.icon-btn:hover .bell { animation: ring .7s ease; transform-origin: 50% 0; }
@keyframes ring { 0%,100%{transform:rotate(0)} 20%{transform:rotate(16deg)} 40%{transform:rotate(-14deg)} 60%{transform:rotate(9deg)} 80%{transform:rotate(-5deg)} }
.badge {
  position: absolute; top: -2px; right: -2px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 9.5px; font-weight: 600;
  display: grid; place-items: center; border: 2px solid var(--app);
  animation: pulse 2s infinite;
}
.badge.hide { transform: scale(0); animation: none; transition: transform .3s; }
@keyframes pulse { 0%{box-shadow:0 0 0 0 rgba(239,68,68,.5)} 70%{box-shadow:0 0 0 8px rgba(239,68,68,0)} 100%{box-shadow:0 0 0 0 rgba(239,68,68,0)} }

.profile { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; border-radius: 999px; transition: background .25s; text-align: left; }
.profile:hover { background: #e9ebef; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #ffd6a8, #ffb37a); overflow: hidden; display: grid; place-items: end center; }
.avatar svg { width: 38px; height: 40px; stroke: none; transform: translateY(4px); }
.profile-text { display: flex; flex-direction: column; line-height: 1.25; }
.profile-text strong { font-weight: 500; font-size: 12px; }
.profile-text small { color: var(--muted); font-size: 10.5px; }

/* ===== Layout ===== */
.layout { display: grid; grid-template-columns: 214px 1fr; gap: 24px; }

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; gap: 26px; }
.welcome { font-weight: 400; font-size: 25px; line-height: 1.2; letter-spacing: -.02em; margin-bottom: 6px; }
.side-label { font-size: 10px; color: #b4b7bf; letter-spacing: .06em; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.mini-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--blue); color: #fff; display: grid; place-items: center; transition: transform .3s var(--ease); }
.mini-dot svg { width: 10px; height: 10px; stroke-width: 3; }
.mini-dot:hover { transform: rotate(90deg) scale(1.15); }

.side-main {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--black); color: #fff; padding: 11px 14px; border-radius: 12px; font-size: 12px;
  transition: transform .25s var(--ease), box-shadow .25s;
}
.side-main:hover { transform: translateY(-1px); box-shadow: 0 10px 20px -10px rgba(0,0,0,.5); }
.side-main .chev { margin-left: auto; transition: transform .4s var(--ease); }
.side-main[aria-expanded="false"] .chev { transform: rotate(-90deg); }

.submenu { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .45s var(--ease), opacity .3s; padding-top: 6px; }
.submenu > * { min-height: 0; }
.submenu:not(.open) { grid-template-rows: 0fr; opacity: 0; }
.submenu-inner { overflow: hidden; }

.side-item {
  position: relative; width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 10px; color: var(--ink-2); font-size: 11.5px; text-align: left;
  transition: background .25s, color .25s, padding .25s var(--ease);
}
.side-item svg { width: 15px; height: 15px; color: var(--muted); transition: color .25s; }
.side-item:hover { background: #e9ebef; padding-left: 18px; }
.side-item.active { color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.side-item.active svg { color: var(--blue); }
.side-item.active::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 14px; margin-top: -7px; background: var(--blue); border-radius: 0 3px 3px 0; animation: grow .35s var(--ease); }
@keyframes grow { from { height: 0; margin-top: 0; } }
.side-item.new { animation: slideIn .5s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } }

.promo {
  margin-top: auto; position: relative; overflow: hidden; cursor: pointer;
  height: 150px; border-radius: 18px; padding: 14px;
  background: linear-gradient(150deg, #3d86ff 0%, #1e6bff 45%, #1453d6 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform .35s var(--ease), box-shadow .35s;
}
.promo:hover { transform: translateY(-3px); box-shadow: 0 18px 30px -14px rgba(30,107,255,.8); }
.promo-ic { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.95); color: var(--blue); display: grid; place-items: center; }
.promo-ic svg { width: 13px; height: 13px; fill: currentColor; animation: twinkle 2.4s infinite; }
@keyframes twinkle { 50% { transform: scale(.7) rotate(45deg); } }
.promo-text { position: relative; z-index: 2; }
.promo-text strong { display: block; font-weight: 500; font-size: 15px; line-height: 1.15; }
.promo-text small { font-size: 9.5px; opacity: .75; }
.promo-doc { position: absolute; right: -6px; bottom: -4px; width: 104px; height: 118px; stroke: none; animation: float 4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-5px); } }
.promo::after { content: ""; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.12); }
.promo-shine { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-120%); }
.promo:hover .promo-shine { transition: transform .9s ease; transform: translateX(120%); }

/* ===== Main ===== */
.main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.main-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-title { font-weight: 400; font-size: 21px; letter-spacing: -.02em; }
.page-title.swap { animation: titleSwap .5s var(--ease); }
@keyframes titleSwap { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
.crumbs { font-size: 10.5px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.live { margin-left: 6px; display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-weight: 600; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: livePulse 1.6s infinite; }
@keyframes livePulse { 0%{box-shadow:0 0 0 0 rgba(34,197,94,.6)} 100%{box-shadow:0 0 0 7px rgba(34,197,94,0)} }

.head-actions { display: flex; align-items: center; gap: 6px; }
.pill {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: 999px; background: #fff; font-size: 11.5px;
  box-shadow: var(--shadow); transition: transform .25s var(--ease), box-shadow .25s, background .25s;
}
.pill:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(16,24,40,.25); }
.pill:active { transform: scale(.96); }
.pill.sm { height: 28px; padding: 0 10px; font-size: 10.5px; border: 1px solid var(--line); box-shadow: none; }
.pill svg { width: 13px; height: 13px; transition: transform .3s var(--ease); }
.pill.open svg { transform: rotate(180deg); }

.circle {
  position: relative; overflow: hidden; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; box-shadow: var(--shadow);
  transition: transform .25s var(--ease), background .25s, color .25s;
}
.circle:hover { transform: translateY(-1px) rotate(-8deg); background: var(--ink); color: #fff; }
.circle:active { transform: scale(.9); }
.circle.sm { width: 28px; height: 28px; border: 1px solid var(--line); box-shadow: none; }
.circle.sm svg { width: 13px; height: 13px; }

/* ===== Cards ===== */
.card {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
  transition: transform .35s var(--ease), box-shadow .35s;
}
.stagger { opacity: 0; }
.ready .screen.active .stagger { animation: rise .75s var(--ease) both; animation-delay: calc(var(--d, 0) * 70ms); }
.card:hover { box-shadow: var(--shadow-lg); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h3 { font-weight: 500; font-size: 13.5px; }
.big { font-size: 27px; font-weight: 400; letter-spacing: -.02em; }
.big small { font-size: 11px; color: var(--muted); letter-spacing: 0; }

.row1 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row1-right { display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 { display: grid; grid-template-columns: 2.55fr 1fr; gap: 12px; }

/* Legend */
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 9.5px; color: var(--muted); }
.legend.grid2 { display: grid; grid-template-columns: auto auto; }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 50%; }
.c0 { background: var(--dot); } .c1 { background: var(--blue); } .c2 { background: var(--navy); } .c3 { background: var(--black); }
.b0 { background: var(--black); } .b1 { background: var(--navy); } .b2 { background: var(--blue); } .b3 { background: var(--sky); }

/* Admissions dot matrix */
.adm-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.dots { display: grid; grid-template-columns: 74px repeat(7, 1fr); gap: 8px 6px; align-items: center; }
.dots .rl { font-size: 10.5px; color: var(--muted); transition: color .3s; }
.dots .cl { font-size: 9.5px; color: var(--muted); text-align: center; }
.dot {
  width: 100%; max-width: 28px; aspect-ratio: 1; border-radius: 50%; justify-self: center;
  transform: scale(0); transition: background .5s var(--ease), transform .25s var(--ease), opacity .3s, box-shadow .25s;
  cursor: pointer;
}
.dot.in { animation: pop .55s var(--ease) forwards; animation-delay: var(--dl); }
@keyframes pop { 0% { transform: scale(0); } 70% { transform: scale(1.12); } 100% { transform: scale(1); } }
.dot.in:hover { transform: scale(1.18) !important; box-shadow: 0 6px 14px -4px rgba(30,107,255,.6); }
.dot.l0 { background: var(--dot); } .dot.l1 { background: var(--blue); } .dot.l2 { background: var(--navy); } .dot.l3 { background: var(--black); }
.dots.filtered .dim { opacity: .18; }
.dots .rl.hl { color: var(--blue); font-weight: 600; }

/* Dark promo */
.dark { position: relative; overflow: hidden; background: #111216; color: #fff; min-height: 130px; padding: 18px; }
.ribbon { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.ribbon-a { animation: drift 9s ease-in-out infinite; }
.ribbon-b { animation: drift 11s ease-in-out infinite reverse; }
@keyframes drift { 50% { transform: translate(-14px, 8px) scale(1.03); } }
.ecg { stroke-dasharray: 520; stroke-dashoffset: 520; opacity: .55; animation: ecg 3.2s linear infinite; filter: drop-shadow(0 0 4px #1e6bff); }
@keyframes ecg { 0% { stroke-dashoffset: 520; } 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -520; } }
.dark-content { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.dark h3 { font-weight: 400; font-size: 15px; line-height: 1.35; }
.dark-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tag { font-size: 9.5px; color: #cfd3dc; display: inline-flex; align-items: center; gap: 5px; }
.tag b { background: var(--green); color: #fff; font-size: 8.5px; padding: 3px 6px; border-radius: 999px; font-weight: 600; }
.join {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue); color: #fff; padding: 4px 4px 4px 14px; border-radius: 999px; font-size: 11px;
  box-shadow: 0 8px 18px -8px rgba(30,107,255,.9); transition: transform .25s var(--ease), padding .3s var(--ease);
}
.join span { width: 24px; height: 24px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; transition: transform .4s var(--ease); }
.join svg { width: 12px; height: 12px; }
.join:hover { padding-left: 18px; }
.join:hover span { transform: rotate(45deg); background: #fff; color: var(--blue); }

/* Today card */
.today { display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.today-head { display: flex; align-items: center; gap: 8px; }
.small-label { font-size: 9.5px; color: var(--muted); line-height: 1.2; }
.swap svg { transition: transform .45s var(--ease); }
.swap.flip svg { transform: rotate(180deg); }
.today-val { font-size: 21px; letter-spacing: -.02em; white-space: nowrap; }
.today-foot { display: flex; align-items: center; justify-content: space-between; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; }
.trend svg { width: 12px; height: 12px; color: var(--muted); }
.trend.up::before { content: "▲"; font-size: 7px; color: var(--green); }
.trend.down::before { content: "▼"; font-size: 7px; color: var(--red); }
.spark svg { width: 60px; height: 22px; stroke: var(--blue); stroke-width: 1.6; }
.spark path { stroke-dasharray: 120; stroke-dashoffset: 120; animation: draw 1.2s .4s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Report card */
.report { position: relative; overflow: hidden; background: var(--black); color: #fff; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; }
.report-top { display: flex; justify-content: space-between; }
.report .pair { display: flex; }
.report .pair .circle + .circle { margin-left: -4px; }
.circle.dk { width: 28px; height: 28px; background: #34353c; color: #fff; box-shadow: none; }
.circle.wh { width: 28px; height: 28px; background: #fff; color: var(--ink); border: 2px solid var(--black); }
.circle.dk svg, .circle.wh svg { width: 12px; height: 12px; }
.circle.wh:hover { background: var(--blue); color: #fff; }
.micro-pill { display: inline-block; font-size: 8px; background: #34353c; color: #c9ccd4; padding: 3px 8px; border-radius: 999px; margin-bottom: 6px; }
.report h4 { font-weight: 400; font-size: 15px; }
.progress { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: transparent; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--blue), var(--sky)); }
.ready .screen.active .report.hidden-card { animation: shrinkOut .45s var(--ease) forwards; }
.ready .screen.active .report.back { animation: pop .55s var(--ease); opacity: 1; }
@keyframes shrinkOut { to { opacity: 0; transform: scale(.85) rotate(-3deg); } }

/* Sources */
.sources-body { display: grid; grid-template-columns: 150px 1fr; gap: 12px; }
.src-stats { display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; padding-bottom: 4px; }
.src-stats .big { font-size: 26px; }
.dark-pill { align-self: flex-start; background: var(--black); color: #fff; font-size: 9.5px; padding: 5px 9px; border-radius: 999px; }
.src-stats .legend { margin-top: 8px; display: grid; grid-template-columns: auto auto; }

.chart { position: relative; height: 196px; }
.growth { position: absolute; top: 4px; left: 8%; z-index: 1; }
.growth strong { display: block; font-weight: 400; font-size: 22px; color: var(--blue); letter-spacing: -.02em; }
.growth small { font-size: 9.5px; color: var(--muted); }
.dash-line { position: absolute; height: 0; border-top: 1.5px dashed #b8c2d6; transform-origin: left; transform: scaleX(0); transition: transform .9s .5s var(--ease); }
.dash-line.in { transform: scaleX(1); }
.bars { position: absolute; right: 2%; bottom: 0; top: 0; left: 18%; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.bar-col { flex: 1; max-width: 72px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; cursor: pointer; transition: opacity .35s, filter .35s; }
.bar {
  width: 100%; height: 0; border-radius: 12px; position: relative; overflow: hidden;
  transition: height 1.1s var(--ease), transform .3s var(--ease);
}
.bar::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, rgba(255,255,255,.14) 0 3px, transparent 3px 9px); animation: stripes 1.8s linear infinite; background-size: 25.5px 25.5px; }
@keyframes stripes { to { background-position: 25.5px 0; } }
.bar-col:hover .bar { transform: scaleX(1.06); }
.bar-col.dim { opacity: .25; filter: grayscale(.6); }
.bar.k0 { background: var(--black); } .bar.k1 { background: var(--navy); } .bar.k2 { background: var(--blue); }
.bar.k3 { background: var(--sky); } .bar.k3::after { background: repeating-linear-gradient(135deg, rgba(255,255,255,.45) 0 3px, transparent 3px 9px); background-size: 25.5px 25.5px; }
.chip {
  display: inline-flex; align-items: center; gap: 3px; font-size: 8.5px; font-weight: 600;
  padding: 3px 6px; border-radius: 6px; margin-bottom: 6px; white-space: nowrap;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  opacity: 0; transform: translateY(6px); transition: opacity .4s, transform .4s var(--ease);
}
.chip.in { opacity: 1; transform: none; }
.chip svg { width: 9px; height: 9px; stroke-width: 2.4; }
.bar-col:nth-child(1) .chip { background: var(--black); color: #fff; border-color: var(--black); }
.bar-col:nth-child(2) .chip { background: var(--navy); color: #fff; border-color: var(--navy); }
.bar-col:nth-child(3) .chip { background: var(--black); color: #fff; border-color: var(--black); }

/* Occupancy */
.occupancy { display: flex; flex-direction: column; }
.occupancy .card-head { margin-bottom: 8px; }
.occ-legend { display: flex; justify-content: space-between; align-items: flex-start; }
.occ-legend .legend { flex-direction: column; gap: 5px; }
.ghost { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; color: var(--muted); padding: 3px 6px; border-radius: 6px; transition: background .2s, color .2s; }
.ghost:hover { background: #f1f3f6; color: var(--ink); }
.ghost svg { width: 11px; height: 11px; }
.gauge-wrap { position: relative; margin: 8px auto 0; width: 100%; max-width: 230px; }
.gauge { width: 100%; height: auto; display: block; }
.gauge line { stroke-width: 5.5; stroke-linecap: round; transition: stroke .35s ease; }
.gauge-center { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; }
.gauge-center strong { display: block; font-weight: 500; font-size: 22px; letter-spacing: -.02em; }
.gauge-center small { font-size: 9px; color: var(--muted); }
.occ-foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.switch { position: relative; width: 34px; height: 20px; flex-shrink: 0; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #dfe2e8; border-radius: 999px; transition: background .3s; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .35s var(--ease); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::before { transform: translateX(14px); }

/* ===== Ripple ===== */
.side-main, .dd-item { position: relative; overflow: hidden; }
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: currentColor; opacity: .25; transform: scale(0); animation: ripple .6s ease-out forwards; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ===== Dropdown ===== */
.dropdown {
  position: absolute; z-index: 50; min-width: 170px; padding: 6px; background: #fff; border-radius: 14px;
  box-shadow: 0 20px 40px -12px rgba(16,24,40,.25), 0 0 0 1px rgba(16,24,40,.05);
  opacity: 0; transform: translateY(-6px) scale(.97); transform-origin: top; pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease);
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dd-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 9px; font-size: 11.5px; text-align: left; transition: background .2s; }
.dd-item:hover { background: #f1f4f9; }
.dd-item .tick { margin-left: auto; color: var(--blue); width: 14px; height: 14px; opacity: 0; transform: scale(.5); transition: .25s var(--ease); }
.dd-item.sel { color: var(--blue); }
.dd-item.sel .tick { opacity: 1; transform: none; }
.dd-title { font-size: 10px; color: var(--muted); padding: 6px 10px 4px; letter-spacing: .04em; }
.notif { display: flex; gap: 10px; padding: 9px 10px; border-radius: 10px; width: 280px; transition: background .2s; }
.notif:hover { background: #f1f4f9; }
.notif i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.notif i svg { width: 14px; height: 14px; }
.notif b { display: block; font-weight: 500; font-size: 11.5px; }
.notif small { color: var(--muted); font-size: 10px; }

/* ===== Tooltip ===== */
.tooltip {
  position: fixed; z-index: 60; pointer-events: none; background: var(--black); color: #fff; font-size: 10.5px;
  padding: 6px 9px; border-radius: 8px; white-space: nowrap; opacity: 0; transform: translate(-50%, -90%);
  transition: opacity .15s, transform .2s var(--ease);
}
.tooltip.show { opacity: 1; transform: translate(-50%, -115%); }
.tooltip b { font-weight: 600; }

/* ===== Toasts ===== */
.toasts { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 10px; background: var(--black); color: #fff; padding: 11px 14px; border-radius: 12px;
  font-size: 12px; box-shadow: var(--shadow-lg); animation: toastIn .45s var(--ease);
}
.toast.out { animation: toastOut .35s var(--ease) forwards; }
.toast .ti { width: 22px; height: 22px; border-radius: 50%; background: var(--blue); display: grid; place-items: center; }
.toast .ti svg { width: 12px; height: 12px; stroke-width: 2.6; }
.toast button { color: var(--sky); font-weight: 600; margin-left: 6px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* ===== Modal ===== */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(15,17,22,.35); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.modal.open { opacity: 1; pointer-events: auto; }
.modal-card { position: relative; width: min(420px, 100%); background: #fff; border-radius: 22px; padding: 24px; transform: translateY(20px) scale(.96); transition: transform .4s var(--ease); }
.modal.open .modal-card { transform: none; }
.modal-x { position: absolute; top: 14px; right: 14px; }
.modal h3 { font-weight: 500; font-size: 18px; margin-bottom: 6px; }
.modal p { color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.modal .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.modal .stat { background: var(--app); border-radius: 12px; padding: 10px; }
.modal .stat b { display: block; font-size: 17px; font-weight: 500; }
.modal .stat small { color: var(--muted); font-size: 10px; }
.modal .cta { width: 100%; justify-content: center; padding: 10px; margin-top: 8px; }

/* ===== Responsive ===== */
@media (max-width: 1180px) {
  .tabs .tab { padding: 8px 11px; }
  .profile-text { display: none; }
}
@media (max-width: 1024px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); align-items: start; }
  .promo { margin-top: 0; }
  .row1, .row2 { grid-template-columns: 1fr; }
  .brand { width: auto; }
}
@media (max-width: 720px) {
  body { padding: 0; }
  .app { border-radius: 0; padding: 16px; }
  .topbar { flex-wrap: wrap; gap: 12px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .sources-body { grid-template-columns: 1fr; }
  .chart { height: 210px; }
  .bars { left: 0; top: 70px; }
  .growth { top: 0; }
  .dash-line { display: none; }
  .mini-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
