:root {
  --ink: #0c1322;
  --ink-2: #3a4458;
  --muted: #8d97a9;
  --line: rgba(15, 40, 80, .08);
  --card: rgba(255, 255, 255, .78);
  --card-solid: #fff;
  --accent: #3a9bf0;
  --accent-2: #6cbcff;
  --accent-soft: #e4f1fe;
  --ok: #34c759;
  --warn: #f5a524;
  --bad: #ff4d5e;
  --shadow: 0 12px 34px rgba(36, 92, 168, .09), 0 2px 6px rgba(36, 92, 168, .05);
  --r-xl: 30px;
  --r-lg: 24px;
  --r-md: 16px;
  --t-blue: linear-gradient(140deg, #d9ecff 0%, #a9d3ff 55%, #e3f1ff 100%);
  --t-yellow: linear-gradient(140deg, #fffbe0 0%, #f4f68d 55%, #e3fab8 100%);
  --t-purple: linear-gradient(140deg, #f2e9ff 0%, #cfbcff 55%, #eadffc 100%);
  --t-green: linear-gradient(140deg, #ecfbe3 0%, #bdf1a3 55%, #e0fad2 100%);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e6f1fc;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 600px at 85% -10%, rgba(126, 194, 255, .55), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(186, 222, 255, .8), transparent 60%),
    radial-gradient(800px 600px at 60% 110%, rgba(160, 210, 255, .5), transparent 60%),
    linear-gradient(170deg, #dcebfb, #eef5fd 45%, #f5f9fe);
}
body::after {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background: repeating-radial-gradient(circle at 110% 0%, transparent 0 38px, rgba(255,255,255,.55) 39px, transparent 41px);
  mask-image: linear-gradient(200deg, #000, transparent 55%);
  -webkit-mask-image: linear-gradient(200deg, #000, transparent 55%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; }
.mono { font-family: var(--mono); font-size: .92em; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ------------------------------------------------ layout */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  padding: 28px 18px; display: flex; flex-direction: column; gap: 6px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; font-weight: 800; font-size: 19px; letter-spacing: -.03em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: 0 8px 18px rgba(58, 155, 240, .35);
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px;
  color: var(--ink-2); font-weight: 600; font-size: 15px; text-decoration: none; transition: background .2s, color .2s;
}
.nav-item svg { width: 20px; height: 20px; color: var(--muted); transition: color .2s; }
.nav-item:hover { background: rgba(255, 255, 255, .55); }
.nav-item.active { background: var(--card-solid); color: var(--ink); box-shadow: var(--shadow); }
.nav-item.active svg { color: var(--accent); }
.sidebar .spacer { flex: 1; }
.server-chip {
  margin: 0 4px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.6);
  border: 1px solid rgba(255,255,255,.9); font-size: 13px;
}
.server-chip b { display: block; font-size: 14px; margin-bottom: 2px; }

.main { padding: 32px 36px 60px; max-width: 1840px; width: 100%; min-width: 0; margin: 0 auto; }
.topbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.title { margin: 0; font-size: 40px; line-height: 1.02; font-weight: 800; letter-spacing: -.045em; }
.title span { display: block; color: #b2bccb; }
.topbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.bottom-nav { display: none; }

/* ------------------------------------------------ cards */
.card {
  background: var(--card);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 24px;
  min-width: 0;
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-h h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.card-h .muted { font-size: 13px; }

.grid { display: grid; gap: 20px; }
.ov-top { grid-template-columns: 1fr 1fr 1.1fr; }
.ov-mid { grid-template-columns: 2fr 1fr; margin-top: 20px; }
.ov-bot { grid-template-columns: 1fr 1fr; margin-top: 20px; }

/* hero / power */
.hero { position: relative; overflow: hidden; padding: 0; display: flex; flex-direction: column; min-height: 360px; }
.hero-sky {
  position: relative; height: 210px; overflow: hidden;
  background: linear-gradient(180deg, #8cc8fb, #b9defd 60%, #d9ecfd);
}
.hero-sky .ring {
  position: absolute; left: 50%; bottom: -100%; transform: translateX(-50%);
  border-radius: 50%; background: rgba(255, 255, 255, .16);
}
.hero-sky .ring:nth-child(1) { width: 190%; aspect-ratio: 1; bottom: -150%; }
.hero-sky .ring:nth-child(2) { width: 140%; aspect-ratio: 1; bottom: -105%; }
.hero-sky .ring:nth-child(3) { width: 95%; aspect-ratio: 1; bottom: -62%; }
.hero.down .hero-sky { background: linear-gradient(180deg, #cfd6e2, #e3e8f0 60%, #eef1f6); }
.hero-body {
  position: relative; flex: 1; background: var(--card-solid); border-radius: var(--r-xl) var(--r-xl) 0 0;
  margin-top: -36px; padding: 70px 20px 22px; text-align: center;
}
.power {
  position: absolute; left: 50%; top: -62px; transform: translateX(-50%);
  width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #fff, #f3f8fe);
  box-shadow: 0 16px 40px rgba(58, 155, 240, .25), inset 0 -4px 10px rgba(58,155,240,.06);
  color: var(--accent);
}
.power svg { width: 46px; height: 46px; }
.power::after {
  content: ""; position: absolute; inset: -10px; border-radius: 50%;
  border: 2px solid rgba(58, 155, 240, .25); animation: pulse 2.6s ease-out infinite;
}
.hero.down .power { color: var(--muted); }
.hero.down .power::after { display: none; }
@keyframes pulse { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.hero-state { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.hero-timer { color: var(--muted); font-size: 15px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.hero-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--accent-soft); color: #1f6fbf; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.pill.gray { background: #eff2f6; color: var(--ink-2); }
.pill.green { background: #e3f8e8; color: #1f8a3c; }
.pill.red { background: #ffe8ea; color: #c3283a; }
.pill.amber { background: #fff3dc; color: #a46400; }
.pill svg { width: 14px; height: 14px; flex: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* gauge */
.gauge-card { display: flex; flex-direction: column; }
.gauge-title { font-size: 26px; font-weight: 800; letter-spacing: -.04em; line-height: 1.05; }
.gauge-title span { display: block; color: #b2bccb; }
.gauge { position: relative; margin: 8px auto 0; width: 100%; max-width: 300px; }
.gauge svg { width: 100%; display: block; }
.gauge-val { position: absolute; left: 0; right: 0; top: 40%; text-align: center; }
.gauge-val .lbl { color: var(--muted); font-size: 13px; }
.gauge-val .num { font-size: 54px; font-weight: 800; letter-spacing: -.05em; line-height: 1; margin: 2px 0; font-variant-numeric: tabular-nums; }
.gauge-val .unit { color: var(--muted); font-size: 13px; }
.gauge-foot { display: flex; justify-content: center; gap: 8px; margin-top: auto; padding-top: 6px; }

/* tiles */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tile {
  border-radius: var(--r-lg); padding: 16px; min-height: 120px; display: flex; flex-direction: column;
  border: 1px solid rgba(255,255,255,.8); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); min-width: 0;
}
.tile .ic { width: 22px; height: 22px; color: rgba(12,19,34,.55); }
.tile .lbl { margin-top: auto; font-size: 12.5px; color: rgba(12,19,34,.6); font-weight: 600; }
.tile .val { font-size: 22px; font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-blue { background: var(--t-blue); }
.t-yellow { background: var(--t-yellow); }
.t-purple { background: var(--t-purple); }
.t-green { background: var(--t-green); }

/* lists */
.list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .name { font-weight: 700; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 12.5px; color: var(--muted); }
.row .right { text-align: right; font-size: 13px; font-weight: 700; white-space: nowrap; }
.bar { height: 6px; border-radius: 9px; background: #edf2f8; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; border-radius: 9px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

.avatar {
  position: relative; flex: none; width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  font-weight: 800; font-size: 14px; color: rgba(12,19,34,.72);
}
.avatar .st { position: absolute; right: -2px; bottom: -2px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #fff; background: #c5ccd8; }
.avatar .st.on { background: var(--ok); }
.avatar .st.off { background: var(--bad); }

.ev-ic { flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: #eff4fa; color: var(--ink-2); }
.ev-ic svg { width: 17px; height: 17px; }
.ev-ic.connect { background: #e3f8e8; color: #1f8a3c; }
.ev-ic.disconnect { background: #f0f2f6; color: var(--muted); }
.ev-ic.create, .ev-ic.import { background: var(--accent-soft); color: var(--accent); }
.ev-ic.delete, .ev-ic.expire, .ev-ic.disable { background: #ffe8ea; color: #c3283a; }
.ev-ic.security, .ev-ic.regenerate, .ev-ic.settings { background: #fff3dc; color: #a46400; }

/* resources */
.res { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ring-stat { text-align: center; }
.ring-stat svg { width: 100%; max-width: 110px; }
.ring-stat .lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ring-stat .sub { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.kv div { background: #f4f8fc; border-radius: 14px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.kv b { display: block; color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* charts */
.chart { position: relative; width: 100%; height: 240px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .axis { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.chart .gridline { stroke: var(--line); }
.tip {
  position: absolute; pointer-events: none; background: #0c1322; color: #fff; padding: 9px 12px; border-radius: 12px;
  font-size: 12px; white-space: nowrap; transform: translate(-50%, -110%); box-shadow: 0 8px 22px rgba(0,0,0,.18); z-index: 3;
}
.tip b { display: block; margin-bottom: 3px; font-size: 12px; opacity: .7; font-weight: 600; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

/* buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px;
  border-radius: 999px; font-weight: 700; font-size: 14.5px; background: var(--card-solid); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { color: #fff; background: linear-gradient(180deg, #55b1fa, var(--accent)); box-shadow: 0 10px 22px rgba(58,155,240,.35); }
.btn.danger { color: #fff; background: linear-gradient(180deg, #ff6b78, var(--bad)); box-shadow: 0 10px 22px rgba(255,77,94,.3); }
.btn.ghost { background: #f1f5fa; box-shadow: none; }
.btn.sm { height: 38px; padding: 0 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.refresh-btn svg { color: var(--accent); }
.refresh-btn.spinning svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: #f1f5fa; color: var(--ink-2);
  transition: background .2s, color .2s; flex: none;
}
.icon-btn:hover { background: var(--accent-soft); color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input {
  height: 48px; padding: 0 16px; border-radius: 15px; border: 1.5px solid #e4ebf3; background: #f8fbfe; outline: none;
  transition: border .2s, background .2s; width: 100%; min-width: 0;
}
textarea.input { height: 84px; padding: 12px 16px; resize: vertical; }
.input:focus { border-color: var(--accent-2); background: #fff; }
.pw { position: relative; }
.pw .input { padding-right: 50px; }
.pw-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; color: var(--muted); transition: color .2s, background .2s;
}
.pw-btn:hover { color: var(--accent); background: var(--accent-soft); }
.pw-btn svg { width: 19px; height: 19px; }
.pw .input::-ms-reveal { display: none; }
.search { position: relative; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.search .input { padding-left: 44px; height: 46px; border-radius: 999px; background: rgba(255,255,255,.8); border-color: rgba(255,255,255,.95); box-shadow: var(--shadow); width: 260px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 38px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.65); font-weight: 600; font-size: 13.5px;
  color: var(--ink-2); border: 1px solid rgba(255,255,255,.9); transition: all .2s;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n { opacity: .55; margin-left: 4px; }
.seg { display: inline-flex; background: rgba(255,255,255,.65); border-radius: 999px; padding: 4px; border: 1px solid rgba(255,255,255,.9); }
.seg button { height: 34px; padding: 0 14px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.seg button.active { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(36,92,168,.12); }

/* toggle like the reference "C◯nnection" */
.toggle { position: relative; width: 52px; height: 30px; border-radius: 999px; background: #e3e9f1; transition: background .25s; flex: none; }
.toggle::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.15); transition: transform .25s;
}
.toggle.on { background: linear-gradient(90deg, #8fcbff, var(--accent)); }
.toggle.on::after { transform: translateX(22px); }

/* clients */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.clients { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 18px; }
.client { padding: 20px; display: flex; flex-direction: column; gap: 14px; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.client:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(36,92,168,.13); }
.client.disabled { opacity: .62; }
.client-h { display: flex; align-items: center; gap: 12px; }
.client-h .grow { flex: 1; min-width: 0; }
.client-h .name { font-weight: 800; font-size: 16.5px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-h .sub { font-size: 12.5px; color: var(--muted); }
.spark { height: 46px; }
.spark svg { width: 100%; height: 100%; display: block; }
.client-stats { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: 8px; }
.client-stats div { background: #f4f8fc; border-radius: 13px; padding: 8px 10px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.client-stats b { display: block; color: var(--ink); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-actions { display: flex; gap: 8px; }
.client-actions .btn { flex: 1; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; color: #bfd3e8; }

/* modal / sheet */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 30, 55, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .2s;
}
.modal {
  width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 30px; padding: 26px;
  box-shadow: 0 30px 80px rgba(15,30,55,.3); animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
.modal.wide { max-width: 720px; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.modal-h h2 { margin: 0; font-size: 24px; letter-spacing: -.035em; line-height: 1.1; }
.modal-h h2 span { display: block; color: #b2bccb; font-size: 18px; }
.modal-f { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.modal-f .btn { flex: 1; }
.qr {
  background: #fff; border-radius: 22px; padding: 10px; border: 1.5px solid #e9eff6; margin: 0 auto 16px; max-width: 300px;
}
.qr svg { width: 100%; height: auto; display: block; }
.notice { background: #fff6e3; color: #7a4d00; padding: 14px 16px; border-radius: 16px; font-size: 13.5px; line-height: 1.45; margin-bottom: 16px; }
.share-box { display: flex; gap: 8px; align-items: center; background: #f4f8fc; border-radius: 15px; padding: 6px 6px 6px 14px; margin-bottom: 14px; }
.share-box input { flex: 1; border: 0; background: none; outline: none; font-family: var(--mono); font-size: 12px; min-width: 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.menu {
  position: fixed; z-index: 60; background: #fff; border-radius: 18px; padding: 6px; min-width: 210px;
  box-shadow: 0 18px 50px rgba(15,30,55,.22); animation: fade .15s;
}
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border-radius: 12px; font-weight: 600; font-size: 14px; text-align: left; }
.menu button:hover { background: #f2f6fb; }
.menu button svg { width: 17px; height: 17px; color: var(--muted); }
.menu button.danger { color: var(--bad); }
.menu button.danger svg { color: var(--bad); }

.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 70; background: var(--ink); color: #fff;
  padding: 13px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; box-shadow: 0 14px 30px rgba(0,0,0,.2);
  animation: pop .25s; max-width: calc(100vw - 32px);
}
.toast.err { background: var(--bad); }

/* detail drawer */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.detail-grid > div { background: #f4f8fc; border-radius: 14px; padding: 10px 12px; font-size: 12px; color: var(--muted); min-width: 0; }
.detail-grid b { display: block; color: var(--ink); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 10px 10px; }
.table td { padding: 12px 10px; border-top: 1px solid var(--line); }
.table td.num, .table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login { width: 100%; max-width: 400px; text-align: center; padding: 34px 28px; }
.login .title { font-size: 38px; margin: 18px 0 10px; }
.login p { color: var(--ink-2); margin: 0 0 24px; font-size: 14.5px; }
.login .brand-mark { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto; }
.login .brand-mark svg { width: 30px; height: 30px; }
.login .btn { width: 100%; margin-top: 4px; }
.err-text { color: var(--bad); font-size: 13.5px; min-height: 20px; margin-top: 10px; }

.settings { grid-template-columns: 1.3fr 1fr; align-items: start; }

/* ------------------------------------------------ responsive */
@media (max-width: 1200px) {
  .ov-top { grid-template-columns: 1fr 1fr; }
  .ov-top .tiles-card { grid-column: span 2; }
  .ov-top .tiles-card .tiles { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .main { padding: 22px 16px 120px; }
  .ov-mid, .ov-bot, .settings { grid-template-columns: 1fr; }
  .bottom-nav {
    display: flex; position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
    z-index: 40; gap: 4px; padding: 6px; border-radius: 999px; background: rgba(255,255,255,.9);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); box-shadow: 0 14px 40px rgba(36,92,168,.18);
    border: 1px solid #fff; max-width: calc(100vw - 24px);
  }
  .bottom-nav a {
    display: flex; align-items: center; gap: 8px; height: 48px; min-width: 48px; padding: 0 12px; border-radius: 999px;
    justify-content: center; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 14px;
  }
  .bottom-nav a svg { width: 20px; height: 20px; }
  .bottom-nav a span:not(.bn-ic) { display: none; }
  .bottom-nav a.active { background: #f0f6fd; color: var(--ink); padding: 0 16px 0 6px; }
  .bottom-nav a.active span:not(.bn-ic) { display: inline; }
  .bottom-nav a.active .bn-ic { background: #fff; color: var(--accent); box-shadow: 0 4px 12px rgba(58,155,240,.25); }
  .bn-ic { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
}
@media (max-width: 720px) {
  .title { font-size: 34px; min-width: 0; }
  .title span { font-size: 26px; }
  .topbar { flex-wrap: nowrap; align-items: flex-start; }
  .ov-top { grid-template-columns: 1fr; }
  .ov-top .tiles-card { grid-column: auto; }
  .ov-top .tiles-card .tiles { grid-template-columns: 1fr 1fr; }
  .card { padding: 20px; border-radius: 26px; }
  .hero { padding: 0; }
  .clients { grid-template-columns: 1fr; }
  .toolbar .search { flex: 1; }
  .search .input { width: 100%; }
  .toolbar > .chips { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + 32px); margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .overlay { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 30px 30px 0 0; max-height: 92vh; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: sheet .3s cubic-bezier(.2,.9,.3,1); }
  .modal.wide { max-width: none; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .chart { height: 200px; }
  .hide-sm { display: none; }
  .topbar .btn.primary span { display: none; }
  .topbar .btn.primary, .topbar .refresh-btn { width: 46px; padding: 0; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
