:root {
  --bg: #f6f7f9; --panel: #ffffff; --panel-2: #f1f3f6; --text: #1b2430; --muted: #657083; --line: #e2e6ec;
  --accent: #0F8F95; --accent-2: #56B9BD; --accent-ink: #ffffff; --danger: #c2410c; --warn: #b45309; --ok: #15803d;
  --chip: #e6f4f2; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  --radius: 10px; --font: Vazirmatn, "Vazir", "IRANSans", "Segoe UI", Tahoma, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1117; --panel: #151b23; --panel-2: #1c232d; --text: #e6edf3; --muted: #8b96a5; --line: #2a333f;
    --accent: #0F8F95; --accent-2: #56B9BD; --accent-ink: #ffffff; --chip: #12312e; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1117; --panel: #151b23; --panel-2: #1c232d; --text: #e6edf3; --muted: #8b96a5; --line: #2a333f;
  --accent: #0F8F95; --accent-2: #56B9BD; --accent-ink: #ffffff; --chip: #12312e; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; }
a { color: var(--accent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1 { font-size: 20px; margin: 0 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; }
.layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--panel); border-left: 1px solid var(--line); padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; padding: 4px 8px 16px; }
.brand .dot { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 13px; }
.side select { width: 100%; margin-bottom: 12px; }
.nav a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); margin-bottom: 2px; }
.nav a:hover { background: var(--panel-2); }
.nav a.active { background: var(--chip); color: var(--accent); font-weight: 600; }
.nav .sep { font-size: 11px; color: var(--muted); padding: 12px 10px 4px; }
.main { padding: 24px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12px; }
.btn { background: var(--accent); color: var(--accent-ink); border: 0; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }
input, select, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
textarea { width: 100%; min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-2); outline-offset: -1px; }
label.f { display: block; margin-bottom: 10px; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
label.f.check { display: flex; gap: 8px; align-items: center; cursor: pointer; align-self: end; padding-bottom: 8px; }
label.f.check input { width: auto; flex: none; }
label.f.check > span { margin: 0; font-size: 13px; color: var(--text); }
.grid { margin-bottom: 16px; }
.grid > .card, .grid > div > .card:last-child { margin-bottom: 0; }
label.f input, label.f select { width: 100%; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 8px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel-2); }
.tablewrap { overflow-x: auto; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--accent); font-size: 12px; margin: 1px; white-space: nowrap; }
.chip.warn { background: #fef3c7; color: #92400e; }
.chip.bad { background: #ffedd5; color: #9a3412; }
.chip.ok { background: #dcfce7; color: #166534; }
.chip.muted { background: var(--panel-2); color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; direction: ltr; text-align: left; white-space: pre-wrap; font-size: 12px; overflow-wrap: anywhere; }
pre.mono { background: var(--panel-2); padding: 10px; border-radius: 8px; overflow: auto; max-height: 420px; margin: 0; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 8px 12px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.bars .bar { display: grid; grid-template-columns: 110px 1fr 48px; gap: 8px; align-items: center; margin-bottom: 6px; font-size: 12px; }
.bars .track { background: var(--panel-2); border-radius: 4px; height: 10px; overflow: hidden; }
.bars .fill { background: var(--accent); height: 100%; border-radius: 4px; }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 70px; }
.spark div { flex: 1; background: var(--accent-2); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; }
.kanban .col { background: var(--panel-2); border-radius: 8px; padding: 8px; min-height: 120px; }
.kanban .item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin-bottom: 6px; font-size: 12px; }
.transcript { display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 80%; padding: 8px 12px; border-radius: 12px; line-height: 1.7; }
.msg.user { align-self: flex-start; background: var(--panel-2); border-top-right-radius: 3px; }
.msg.assistant { align-self: flex-end; background: var(--chip); border-top-left-radius: 3px; }
.msg.tool { align-self: center; font-size: 12px; color: var(--muted); background: transparent; border: 1px dashed var(--line); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.phone { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.dial { text-align: center; }
.dial .status { font-size: 13px; color: var(--muted); margin: 8px 0 14px; min-height: 20px; }
.callbtn { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 0; cursor: pointer; font-size: 26px; color: #fff; background: var(--ok); }
.callbtn.end { background: var(--danger); }
.meter { height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; margin: 10px 0; }
.meter div { height: 100%; width: 0; background: var(--accent-2); transition: width .06s; }
.ringing { animation: ring 1s infinite; }
@keyframes ring { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.emotion { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; font-size: 12px; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--panel); border-radius: 12px; padding: 20px; width: min(640px, 100%); max-height: 90vh; overflow: auto; }
#toasts { position: fixed; bottom: 16px; left: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 360px; }
.toast.err { background: var(--danger); color: #fff; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: min(380px, 100%); }
.score { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; font-weight: 700; font-size: 12px; }
.s1, .s2 { background: #ffedd5; color: #9a3412; } .s3 { background: #fef3c7; color: #92400e; } .s4, .s5 { background: #dcfce7; color: #166534; }
details summary { cursor: pointer; color: var(--muted); }
.hamb { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 0 0 auto; width: 240px; z-index: 40; transform: translateX(100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .hamb { display: inline-block; }
  .g2, .g3, .g4, .phone { grid-template-columns: 1fr; }
  .main { padding: 16px; }
  .msg { max-width: 92%; }
}

/* --------------------------------------------------------------------------
   Platform admin — light glass visual system
   -------------------------------------------------------------------------- */
:root,
:root:not([data-theme="light"]),
:root[data-theme="dark"] {
  color-scheme: light;
  --bg: #f3f7fb;
  --panel: rgba(255, 255, 255, .78);
  --panel-2: #f4f7fa;
  --text: #17212f;
  --muted: #718096;
  --line: rgba(148, 163, 184, .22);
  --accent: #0F8F95;
  --accent-2: #56B9BD;
  --accent-ink: #ffffff;
  --danger: #dc2626;
  --warn: #d97706;
  --ok: #059669;
  --chip: #E8F6F6;
  --shadow: 0 12px 36px rgba(45, 71, 103, .07), 0 2px 8px rgba(45, 71, 103, .04);
  --shadow-hover: 0 18px 45px rgba(45, 71, 103, .11), 0 3px 10px rgba(45, 71, 103, .06);
  --radius: 18px;
}

html { min-height: 100%; background: #f3f7fb; }
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 6%, rgba(147, 197, 253, .28), transparent 29rem),
    radial-gradient(circle at 88% 92%, rgba(196, 181, 253, .18), transparent 30rem),
    linear-gradient(145deg, #f8fbff 0%, #f2f6fb 48%, #f7f9fc 100%);
  background-attachment: fixed;
  line-height: 1.65;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .32;
  background-image: radial-gradient(rgba(71, 85, 105, .16) .55px, transparent .55px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

::selection { background: #bfdbfe; color: #1e3a8a; }
* { scrollbar-width: thin; scrollbar-color: #cbd5e1 transparent; }
h1, h2, h3 { letter-spacing: -.025em; color: var(--text); }
h2 { font-size: 15px; font-weight: 750; }
h3 { font-size: 13px; font-weight: 700; }

.layout {
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 0;
  position: relative;
}
.side {
  display: flex;
  flex-direction: column;
  width: 272px;
  padding: 20px 14px 14px;
  background: rgba(255, 255, 255, .7);
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .88);
  box-shadow: -10px 0 45px rgba(70, 91, 122, .055);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  overflow: hidden;
  z-index: 20;
}
.brand {
  gap: 11px;
  padding: 1px 7px 18px;
  font-size: inherit;
}
.brand .dot,
.login-brand .dot {
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(145deg, #22ADB3, #0F8F95);
  box-shadow: 0 9px 22px rgba(15, 143, 149, .24), inset 0 1px rgba(255,255,255,.28);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 800;
}
.brand > div,
.login-brand > div { display: flex; flex-direction: column; min-width: 0; }
.brand strong,
.login-brand strong { font-size: 15px; font-weight: 800; line-height: 1.45; }
.brand span:not(.dot),
.login-brand span:not(.dot) { color: var(--muted); font-size: 11px; font-weight: 500; }

.tenant-picker {
  padding: 10px;
  margin-bottom: 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(248, 250, 252, .78);
  border-radius: 14px;
}
.tenant-picker label {
  display: block;
  margin: 0 3px 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}
.tenant-picker select {
  width: 100%;
  margin: 0;
  padding: 7px 9px;
  border: 0;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
  font-size: 12px;
  font-weight: 650;
}

.nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 2px 2px 16px 4px;
}
.nav-group { margin-bottom: 8px; }
.nav .sep {
  padding: 10px 11px 5px;
  color: #9aa6b5;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .035em;
}
.nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin: 2px 0;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #526174;
  font-size: 12px;
  font-weight: 570;
  transition: background .16s ease, color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.nav a:hover {
  color: #0B7479;
  background: rgba(255, 255, 255, .72);
  transform: translateX(-2px);
}
.nav a.active {
  color: #0F8F95;
  background: rgba(255, 255, 255, .94);
  border-color: rgba(147, 197, 253, .34);
  box-shadow: 0 7px 18px rgba(51, 93, 160, .09);
  font-weight: 730;
}
.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 8px;
  color: #718096;
  background: rgba(226, 232, 240, .52);
  font-family: "Segoe UI Symbol", sans-serif;
  font-size: 13px;
  line-height: 1;
}
.nav a.active .nav-icon { color: #fff; background: linear-gradient(145deg, #56B9BD, #0F8F95); }

.side-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .17);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
}
.user-card { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
  border-radius: 10px;
  background: #DDF2F3;
  color: #0F8F95;
  font-weight: 800;
}
.user-card > div { display: flex; min-width: 0; flex-direction: column; }
.user-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.user-card span:not(.avatar) { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.logout { padding: 5px 7px; border-radius: 8px; color: #94a3b8; font-size: 10px; }
.logout:hover { color: var(--danger); background: #fef2f2; }

.main {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 28px clamp(20px, 3vw, 48px) 48px;
}
.topbar {
  position: sticky;
  top: 14px;
  z-index: 15;
  min-height: 68px;
  margin: 0 0 22px;
  padding: 11px 14px 11px 18px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 10px 30px rgba(62, 85, 117, .065);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}
.page-heading { display: flex; align-items: center; gap: 10px; }
.page-heading > div { display: flex; flex-direction: column; }
.page-heading span { color: #94a3b8; font-size: 9px; font-weight: 750; }
.page-heading h1 { margin: 0; font-size: 19px; line-height: 1.45; font-weight: 820; }

.card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
}
a.card { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.card:hover { transform: translateY(-2px); border-color: #bfdbfe; box-shadow: var(--shadow-hover); }
.grid { gap: 14px; margin-bottom: 14px; }
.card > h2:first-child,
.card > h3:first-child { margin-bottom: 14px; }

.kpi {
  position: relative;
  min-height: 112px;
  padding: 20px;
  overflow: hidden;
}
.kpi::after {
  content: "";
  position: absolute;
  left: -22px;
  bottom: -28px;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: linear-gradient(145deg, rgba(96,165,250,.16), rgba(196,181,253,.11));
}
.kpi .v { margin-bottom: 8px; color: #172554; font-size: clamp(24px, 2.1vw, 32px); font-weight: 820; line-height: 1; }
.kpi .l { color: #7b8ba0; font-size: 11px; font-weight: 580; }
.grid .kpi:nth-child(4n + 2) .v { color: #075985; }
.grid .kpi:nth-child(4n + 3) .v { color: #5b21b6; }
.grid .kpi:nth-child(4n + 4) .v { color: #047857; }

.btn {
  min-height: 36px;
  padding: 7px 14px;
  border: 1px solid rgba(37, 99, 235, .08);
  border-radius: 11px;
  background: linear-gradient(145deg, #1BA3A9, #0F8F95);
  box-shadow: 0 6px 14px rgba(15, 143, 149, .16);
  font-size: 12px;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { filter: none; transform: translateY(-1px); box-shadow: 0 9px 20px rgba(15, 143, 149, .22); }
.btn.ghost {
  color: #526174;
  border-color: rgba(148, 163, 184, .25);
  background: rgba(255, 255, 255, .7);
  box-shadow: 0 2px 6px rgba(51, 65, 85, .04);
}
.btn.ghost:hover { color: #0F8F95; border-color: #BDE2E4; background: #fff; }
.btn.sm { min-height: 29px; padding: 4px 9px; border-radius: 9px; font-size: 10px; }

input, select, textarea {
  min-height: 40px;
  padding: 8px 11px;
  border-color: rgba(148, 163, 184, .28);
  border-radius: 11px;
  background: rgba(255, 255, 255, .85);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .025);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
textarea { min-height: 104px; }
input:hover, select:hover, textarea:hover { border-color: #b6c4d6; background: #fff; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #56B9BD;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(15, 143, 149, .12);
}
label.f { margin-bottom: 12px; }
label.f > span { margin: 0 2px 5px; color: #748399; font-size: 10px; font-weight: 680; }

.tablewrap {
  margin: -3px;
  border-radius: 13px;
}
table { border-collapse: separate; border-spacing: 0; }
th, td { padding: 11px 10px; border-color: rgba(226, 232, 240, .78); }
th {
  color: #8997a9;
  background: rgba(248, 250, 252, .74);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}
th:first-child { border-radius: 0 10px 0 0; }
th:last-child { border-radius: 10px 0 0 0; }
td { color: #405066; font-size: 11px; }
tbody tr:last-child td { border-bottom: 0; }
tr.click:hover td { background: rgba(239, 246, 255, .68); }

.chip {
  padding: 3px 8px;
  border: 1px solid rgba(15, 143, 149, .16);
  background: #E8F6F6;
  color: #0F8F95;
  font-size: 10px;
  font-weight: 650;
}
.chip.ok { border-color: #bbf7d0; background: #ecfdf5; color: #047857; }
.chip.warn { border-color: #fde68a; background: #fffbeb; color: #b45309; }
.chip.bad { border-color: #fecaca; background: #fef2f2; color: #b91c1c; }
.chip.muted { border-color: #e2e8f0; background: #f8fafc; color: #64748b; }

.bars .track, .meter { background: #eaf0f6; }
.bars .fill { background: linear-gradient(90deg, #56B9BD, #0F8F95); }
.spark div { background: linear-gradient(to top, #0F8F95, #8ED3D6); opacity: .9; }
.tabs { gap: 8px; border-bottom-color: rgba(148, 163, 184, .2); }
.tabs button { border-radius: 9px 9px 0 0; font-size: 11px; }
.tabs button.on { background: rgba(239, 246, 255, .7); }
.empty { padding: 42px 24px; }
pre.mono { border: 1px solid #e2e8f0; background: #f8fafc; }

.modal-bg {
  background: rgba(30, 41, 59, .28);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.modal {
  padding: 24px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 20px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 28px 80px rgba(30, 41, 59, .2);
}
.toast { border-radius: 12px; background: #17212f; color: #fff; box-shadow: 0 12px 30px rgba(15,23,42,.16); }

.login {
  position: relative;
  min-height: 100vh;
  padding: 24px;
  isolation: isolate;
}
.login::before,
.login::after {
  content: "";
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(3px);
}
.login::before { width: 340px; height: 340px; right: 8%; top: 7%; background: rgba(147, 197, 253, .27); }
.login::after { width: 280px; height: 280px; left: 12%; bottom: 5%; background: rgba(196, 181, 253, .2); }
.login .card {
  width: min(410px, 100%);
  padding: 30px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 28px 75px rgba(51, 65, 85, .12);
}
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 28px; }
.login-intro { margin-bottom: 22px; }
.login-intro h1 { margin: 0 0 4px; font-size: 23px; font-weight: 820; }
.login-intro p { margin: 0; color: var(--muted); font-size: 11px; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 244px minmax(0, 1fr); }
  .side { width: 244px; }
  .main { padding-inline: 22px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { display: block; }
  .side {
    inset: 0 0 0 auto;
    width: min(292px, 86vw);
    padding-top: 18px;
    transform: translateX(105%);
    transition: transform .22s ease;
  }
  .side.open { transform: none; box-shadow: 0 0 0 100vmax rgba(30, 41, 59, .22), -20px 0 55px rgba(30,41,59,.12); }
  .main { padding: 14px 13px 32px; }
  .topbar { top: 8px; min-height: 60px; margin-bottom: 14px; border-radius: 15px; }
  .page-heading h1 { font-size: 16px; }
  .card { padding: 15px; border-radius: 15px; }
  .g2, .g3, .g4, .phone { grid-template-columns: 1fr; }
  .kpi { min-height: 98px; }
}
@media (max-width: 540px) {
  .topbar { align-items: flex-start; }
  .topbar > .row:last-child { width: 100%; }
  .topbar > .row:last-child > * { flex: 1; }
  .grid { gap: 10px; margin-bottom: 10px; }
  .login .card { padding: 23px 19px; }
}

/* Accordion navigation */
.nav-group {
  margin: 0 0 6px;
  border-radius: 13px;
  transition: background .2s ease;
}
.nav-group.open { background: rgba(255, 255, 255, .46); }
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 39px;
  padding: 8px 11px;
  border: 0;
  border-radius: 11px;
  color: #627286;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  font-weight: 760;
  text-align: right;
  transition: color .16s ease, background .16s ease;
}
.nav-group-toggle:hover { color: #0B7479; background: rgba(232, 246, 246, .72); }
.nav-group.open > .nav-group-toggle { color: #0F8F95; }
.nav-chevron {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  color: #8CA0A2;
  background: rgba(232, 246, 246, .7);
  font-size: 14px;
  transition: transform .22s ease, background .22s ease;
}
.nav-group.open .nav-chevron { transform: rotate(180deg); color: #fff; background: #0F8F95; }
.nav-items {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows .25s ease, opacity .18s ease;
}
.nav-items > div { min-height: 0; overflow: hidden; padding: 0 4px; }
.nav-group.open .nav-items { grid-template-rows: 1fr; opacity: 1; }
.nav-group.open .nav-items > div { padding-bottom: 7px; }
.nav-items .nav-icon { width: 22px; height: 22px; flex-basis: 22px; }
.nav-items a { min-height: 34px; margin-block: 1px; padding-block: 5px; }

/* Platform dashboard */
.platform-dashboard { --chart-teal: #0F8F95; --chart-soft: #56B9BD; }
.period-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid rgba(15, 143, 149, .13);
  border-radius: 999px;
  color: #416466;
  background: #F2FAFA;
  font-size: 10px;
  font-weight: 680;
}
.period-pill span { color: #0F8F95; font-size: 8px; }
.dashboard-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 142px;
  margin-bottom: 16px;
  padding: 25px 28px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 22px;
  color: #fff;
  background:
    radial-gradient(circle at 12% 12%, rgba(255,255,255,.18), transparent 12rem),
    linear-gradient(120deg, #0A6E73, #0F8F95 55%, #26AAB0);
  box-shadow: 0 18px 45px rgba(15, 143, 149, .18);
}
.dashboard-intro::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  left: -70px;
  bottom: -180px;
  border: 34px solid rgba(255,255,255,.09);
  border-radius: 50%;
}
.dashboard-intro > div:first-child { position: relative; z-index: 1; }
.dashboard-intro .eyebrow { color: rgba(255,255,255,.7); }
.dashboard-intro h2 { margin: 4px 0 5px; color: #fff; font-size: 22px; font-weight: 820; }
.dashboard-intro p { max-width: 650px; margin: 0; color: rgba(255,255,255,.75); font-size: 11px; }
.eyebrow {
  display: block;
  margin-bottom: 2px;
  color: #789092;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .03em;
}
.health-summary {
  display: flex;
  min-width: 160px;
  padding: 17px 20px;
  position: relative;
  z-index: 1;
  flex-direction: column;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 17px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(12px);
}
.health-summary strong { font-size: 24px; font-weight: 850; }
.health-summary span { color: rgba(255,255,255,.72); font-size: 9px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.metric-card {
  min-height: 150px;
  padding: 18px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.95);
  border-radius: 19px;
  background: rgba(255,255,255,.82);
  box-shadow: 0 12px 34px rgba(53, 78, 91, .07);
  transition: transform .18s ease, box-shadow .18s ease;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(53, 78, 91, .11); }
.metric-card::after {
  content: "";
  width: 96px;
  height: 96px;
  position: absolute;
  left: -34px;
  bottom: -42px;
  border-radius: 50%;
  background: rgba(15, 143, 149, .075);
}
.metric-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.metric-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #0F8F95;
  background: #E7F5F5;
  font-family: "Segoe UI Symbol", sans-serif;
  font-size: 17px;
  font-weight: 800;
}
.metric-detail { color: #95A3B3; font-size: 9px; font-weight: 620; }
.metric-value { color: #173B3D; font-size: 29px; font-weight: 850; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-label { margin-top: 7px; color: #6C7D8F; font-size: 10px; font-weight: 680; }
.metric-card.aqua .metric-icon { color: #087D87; background: #E2F5F7; }
.metric-card.violet .metric-icon { color: #7367B7; background: #F0EEFB; }
.metric-card.amber .metric-icon { color: #B8781D; background: #FFF5E5; }

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr);
  gap: 14px;
  margin-bottom: 14px;
}
.chart-card { min-height: 340px; margin-bottom: 0; padding: 21px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.card-heading h2 { margin: 0; font-size: 15px; }
.card-heading > a { padding-top: 7px; color: #0F8F95; font-size: 9px; font-weight: 750; }
.card-heading > a:hover { color: #09686D; }

.usage-chart { display: flex; flex-direction: column; gap: 16px; }
.usage-row { display: flex; flex-direction: column; gap: 7px; }
.usage-meta { display: grid; grid-template-columns: 25px minmax(0,1fr) auto; align-items: center; gap: 8px; }
.usage-rank {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 8px;
  color: #0F8F95;
  background: #ECF7F7;
  font-size: 9px;
  font-weight: 800;
}
.usage-name { overflow: hidden; color: #455B6B; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 680; }
.usage-meta strong { color: #173B3D; font-size: 11px; }
.usage-track { height: 8px; overflow: hidden; border-radius: 999px; background: #EDF3F3; }
.usage-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #69C4C8, #0F8F95); box-shadow: 0 2px 8px rgba(15,143,149,.16); }

.donut-layout { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(130px, .8fr); align-items: center; gap: 16px; min-height: 225px; }
.donut { width: min(190px, 100%); aspect-ratio: 1; position: relative; margin: auto; }
.donut-svg, .donut-svg svg { display: block; width: 100%; height: 100%; }
.donut-svg svg { transform: rotate(-90deg); filter: drop-shadow(0 7px 12px rgba(15,143,149,.08)); }
.donut-center { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; flex-direction: column; pointer-events: none; }
.donut-center strong { color: #173B3D; font-size: 25px; font-weight: 850; line-height: 1.2; }
.donut-center span { color: #93A1AF; font-size: 9px; }
.chart-legend { display: flex; flex-direction: column; gap: 11px; }
.chart-legend > div { display: grid; grid-template-columns: 9px minmax(0,1fr) auto; align-items: center; gap: 7px; color: #697B8D; font-size: 9px; }
.chart-legend strong { color: #334A5B; font-size: 10px; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; }

.services-panel { padding: 21px; }
.health-badge { padding: 5px 9px; border-radius: 999px; color: #9A6925; background: #FFF4E3; font-size: 9px; font-weight: 750; }
.health-badge.ok { color: #0B7479; background: #E6F6F5; }
.service-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.service-card {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #E8EEEE;
  border-radius: 14px;
  background: rgba(250,252,252,.8);
}
.service-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-weight: 850; }
.service-card.healthy .service-icon { color: #0F8F95; background: #E5F5F4; }
.service-card.unhealthy .service-icon { color: #C44E58; background: #FCECEF; }
.service-copy { display: flex; min-width: 0; flex-direction: column; }
.service-copy strong { overflow: hidden; color: #354C5C; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; }
.service-copy span { overflow: hidden; color: #98A5B2; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.service-status { color: #0F8F95; font-size: 8px; font-weight: 750; }
.service-card.unhealthy .service-status { color: #C44E58; }

.insight-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.insight-card {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 82px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: 16px;
  background: rgba(255,255,255,.69);
  box-shadow: 0 8px 22px rgba(53,78,91,.05);
}
.insight-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; color: #0F8F95; background: #E7F5F5; font-weight: 820; }
.insight-card > div { display: flex; min-width: 0; flex-direction: column; }
.insight-card strong { overflow: hidden; color: #29474A; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.insight-card span:last-child { color: #8493A3; font-size: 9px; }
.insight-card.danger .insight-icon { color: #C44E58; background: #FCECEF; }
.insight-card.backup strong { direction: ltr; text-align: right; font-size: 10px; }

@media (max-width: 1180px) {
  .metric-grid, .insight-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-grid { grid-template-columns: 1fr; }
  .chart-card { min-height: 0; }
  .service-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .dashboard-intro { min-height: 0; padding: 21px; align-items: flex-start; flex-direction: column; }
  .dashboard-intro h2 { font-size: 19px; }
  .health-summary { min-width: 0; width: 100%; padding: 12px 15px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 132px; padding: 14px; }
  .metric-value { font-size: 24px; }
  .donut-layout { grid-template-columns: 1fr; }
  .donut { width: 170px; }
  .chart-legend { display: grid; grid-template-columns: 1fr 1fr; }
  .service-grid, .insight-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .metric-grid { grid-template-columns: 1fr; }
}
