/* ==========================================================================
   AI CEO Assistant · Plascokar Saipa
   ========================================================================== */
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Light.woff2") format("woff2"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Black.woff2") format("woff2"); font-weight: 900; font-display: swap; }

:root {
  --bg-0: #040a18;
  --bg-1: #071329;
  --surface: linear-gradient(180deg, rgba(20, 44, 88, .58), rgba(9, 24, 52, .62));
  --surface-flat: rgba(12, 30, 62, .72);
  --surface-solid: #0c1a33;
  --surface-hi: rgba(28, 62, 120, .45);
  --border: rgba(96, 165, 250, .16);
  --border-hi: rgba(56, 210, 238, .55);
  --text: #e7f0ff;
  --text-2: #a8bcdc;
  --muted: #7088ad;
  --accent: #22d3ee;
  --accent-2: #3b82f6;
  --brand: #f7941d;
  --brand-2: #f26b21;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --info: #38bdf8;
  --good-bg: rgba(52, 211, 153, .13);
  --warn-bg: rgba(251, 191, 36, .13);
  --bad-bg: rgba(251, 113, 133, .14);
  --info-bg: rgba(56, 189, 248, .13);
  --grid-line: rgba(120, 170, 255, .07);
  --shadow: 0 10px 40px rgba(0, 0, 0, .35);
  --glow: 0 0 0 1px rgba(34, 211, 238, .35), 0 0 28px rgba(34, 211, 238, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --side-w: 248px;
  --top-h: 78px;
}
:root[data-theme="light"] {
  --bg-0: #e9f0fa;
  --bg-1: #f4f7fc;
  --surface: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(248, 251, 255, .9));
  --surface-flat: rgba(255, 255, 255, .92);
  --surface-solid: #ffffff;
  --surface-hi: rgba(226, 238, 252, .9);
  --border: rgba(30, 64, 120, .12);
  --border-hi: rgba(2, 132, 199, .5);
  --text: #0b1b36;
  --text-2: #3b5070;
  --muted: #6a7f9e;
  --accent: #0891b2;
  --accent-2: #2563eb;
  --good: #059669;
  --warn: #b45309;
  --bad: #e11d48;
  --info: #0284c7;
  --good-bg: rgba(5, 150, 105, .1);
  --warn-bg: rgba(217, 119, 6, .12);
  --bad-bg: rgba(225, 29, 72, .09);
  --info-bg: rgba(2, 132, 199, .1);
  --grid-line: rgba(30, 64, 120, .05);
  --shadow: 0 8px 30px rgba(15, 40, 90, .08);
  --glow: 0 0 0 1px rgba(8, 145, 178, .35), 0 6px 24px rgba(8, 145, 178, .12);
}

* { box-sizing: border-box; }
html { background: var(--bg-0); overflow-x: hidden; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, sans-serif;
  background: radial-gradient(1200px 700px at 85% -10%, rgba(37, 99, 235, .22), transparent 60%),
              radial-gradient(900px 600px at 0% 100%, rgba(8, 145, 178, .16), transparent 60%),
              linear-gradient(180deg, var(--bg-1), var(--bg-0));
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="light"] body {
  background: radial-gradient(1200px 700px at 85% -10%, rgba(37, 99, 235, .10), transparent 60%),
              radial-gradient(900px 600px at 0% 100%, rgba(8, 145, 178, .08), transparent 60%),
              linear-gradient(180deg, var(--bg-1), var(--bg-0));
}
button { font: inherit; color: inherit; }
input { font: inherit; }
b, strong { font-weight: 700; }
.num { font-feature-settings: "tnum"; }

/* ---------- ambient background ---------- */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}
.bg-aurora { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.bg-aurora i { position: absolute; width: 46vw; height: 46vw; border-radius: 50%; filter: blur(90px); opacity: .22; animation: drift 26s ease-in-out infinite alternate; }
.bg-aurora i:nth-child(1) { background: #1d4ed8; top: -18vw; right: -8vw; }
.bg-aurora i:nth-child(2) { background: #0e7490; bottom: -22vw; left: 10vw; animation-delay: -8s; }
.bg-aurora i:nth-child(3) { background: #f26b21; width: 22vw; height: 22vw; top: 40vh; right: 38vw; opacity: .07; animation-delay: -15s; }
:root[data-theme="light"] .bg-aurora i { opacity: .08; }
@keyframes drift { to { transform: translate3d(-6vw, 5vh, 0) scale(1.12); } }

/* ---------- layout ---------- */
.app {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  grid-template-rows: var(--top-h) 1fr;
  grid-template-areas: "top top" "side main";
  min-height: 100vh;
}
.topbar { grid-area: top; }
.sidebar { grid-area: side; }
.main { grid-area: main; padding: 18px 22px 40px 26px; min-width: 0; }

/* ---------- icons ---------- */
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px;
  padding: 0 22px;
  background: linear-gradient(180deg, rgba(6, 16, 36, .92), rgba(6, 16, 36, .75));
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
:root[data-theme="light"] .topbar { background: rgba(255, 255, 255, .86); }
.brand { display: flex; align-items: center; gap: 12px; width: calc(var(--side-w) - 22px); flex: none; }
.brand-mark { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 0 10px rgba(34, 211, 238, .55)); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-en { font-family: "Segoe UI", Arial, sans-serif; font-weight: 700; letter-spacing: .5px; font-size: 17px; direction: ltr; text-align: right; white-space: nowrap; }
.brand-en b { color: var(--accent); font-weight: 800; }
.brand-fa { color: var(--text-2); font-size: 13px; margin-top: -3px; }

.top-center { flex: 1; display: flex; align-items: center; gap: 22px; min-width: 0; }
.greet { min-width: 0; padding-inline-start: 18px; border-inline-start: 1px solid var(--border); }
.greet-title { font-weight: 800; font-size: 16px; white-space: nowrap; }
.greet-sub { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 rgba(52, 211, 153, .7); animation: ping 2s infinite; flex: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 9px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }

.cmd {
  flex: 1; max-width: 520px; min-width: 200px;
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  background: var(--surface-flat); border: 1px solid var(--border); color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.cmd:hover { border-color: var(--border-hi); box-shadow: var(--glow); }
.cmd .ico { color: var(--brand); }
.cmd-text { flex: 1; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
kbd { font-family: "Segoe UI", Arial, sans-serif; font-size: 11px; padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border); color: var(--text-2); direction: ltr; white-space: nowrap; }

.top-left { display: flex; align-items: center; gap: 10px; flex: none; }
.date-box { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-flat); }
.date-box .ico { color: var(--accent); width: 22px; height: 22px; }
.date-main { font-weight: 700; font-size: 13px; white-space: nowrap; }
.date-sub { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-flat); border: 1px solid var(--border); color: var(--text-2); transition: .2s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--border-hi); box-shadow: var(--glow); }
.bell-count { position: absolute; top: -6px; left: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 12px rgba(251, 113, 133, .6); }
.bell-wrap { position: relative; }
.dropdown {
  position: absolute; top: 50px; left: 0; width: 380px; z-index: 40; padding: 10px;
  background: var(--surface-solid); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
}
.dropdown h4 { margin: 4px 6px 8px; font-size: 13px; color: var(--text-2); font-weight: 600; }
.client-logo { height: 46px; padding-inline-start: 12px; border-inline-start: 1px solid var(--border); display: flex; align-items: center; }
.client-logo img { height: 52px; display: block; }

/* ---------- sidebar ---------- */
.sidebar {
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
  padding: 18px 14px 18px 12px; display: flex; flex-direction: column; gap: 14px;
  border-inline-end: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(7, 18, 40, .7), rgba(5, 12, 28, .5));
  scrollbar-width: thin;
}
:root[data-theme="light"] .sidebar { background: rgba(255, 255, 255, .7); }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 12px; color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 14px;
  transition: background .2s, color .2s;
}
.nav a .ico { width: 20px; height: 20px; color: var(--muted); transition: color .2s; }
.nav a:hover { background: var(--surface-hi); color: var(--text); }
.nav a:hover .ico { color: var(--accent); }
.nav a.active {
  color: #fff; font-weight: 700;
  background: linear-gradient(90deg, rgba(34, 211, 238, .85), rgba(37, 99, 235, .95));
  box-shadow: 0 6px 22px rgba(37, 99, 235, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.nav a.active .ico { color: #fff; }
.nav .tag { margin-inline-start: auto; font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 8px; background: linear-gradient(90deg, var(--brand), var(--brand-2)); color: #fff; }
.nav .cnt { margin-inline-start: auto; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: grid; place-items: center; background: var(--bad-bg); color: var(--bad); }
.nav a.active .cnt { background: rgba(255, 255, 255, .25); color: #fff; }
.nav-sep { height: 1px; background: var(--border); margin: 6px 8px; }

.side-ai {
  margin-top: auto; position: relative; padding: 14px; border-radius: 16px; cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, rgba(37, 99, 235, .28), rgba(8, 145, 178, .14));
  border: 1px solid var(--border);
}
.side-ai::before { content: ""; position: absolute; inset: -1px; border-radius: 16px; padding: 1px; background: conic-gradient(from var(--ang, 0deg), transparent 0 70%, var(--accent), var(--brand), transparent); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: spin 5s linear infinite; }
.side-ai-head { display: flex; gap: 10px; font-weight: 700; font-size: 13px; line-height: 1.7; }
.side-ai-head .ico { color: var(--accent); width: 26px; height: 26px; }
.side-ai-foot { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.ai-chip { font-family: Arial, sans-serif; font-weight: 800; font-size: 12px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at 30% 30%, #38bdf8, #1d4ed8); box-shadow: 0 0 18px rgba(56, 189, 248, .55); }
.wave { display: flex; align-items: center; gap: 3px; height: 28px; }
.wave i { width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); animation: wave 1.2s ease-in-out infinite; }
.wave i:nth-child(1) { height: 30%; animation-delay: -.2s; } .wave i:nth-child(2) { height: 70%; animation-delay: -.5s; }
.wave i:nth-child(3) { height: 100%; animation-delay: -.1s; } .wave i:nth-child(4) { height: 55%; animation-delay: -.7s; }
.wave i:nth-child(5) { height: 85%; animation-delay: -.3s; } .wave i:nth-child(6) { height: 40%; animation-delay: -.9s; }
.wave i:nth-child(7) { height: 65%; animation-delay: -.4s; }
@keyframes wave { 50% { transform: scaleY(.35); } }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
.side-sources { display: flex; align-items: center; gap: 8px; justify-content: center; padding: 9px; border-radius: 12px; border: 1px dashed var(--border); background: transparent; color: var(--text-2); font-size: 12px; cursor: pointer; }
.side-sources:hover { color: var(--accent); border-color: var(--border-hi); }
.side-sources .ico { width: 16px; height: 16px; }

/* ---------- page ---------- */
.page { animation: pageIn .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-title { margin: 0; font-size: 24px; font-weight: 900; letter-spacing: -.2px; display: flex; align-items: center; gap: 12px; }
.page-title .sep { width: 2px; height: 22px; background: var(--border-hi); border-radius: 2px; }
.page-title .hl { background: linear-gradient(90deg, var(--accent), #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-sub { color: var(--text-2); margin-top: 2px; font-size: 13px; }
.page-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-flat); color: var(--text-2); font-size: 12px; white-space: nowrap; }
.pill .ico { width: 15px; height: 15px; color: var(--accent); }
.pill.demo { border-style: dashed; }

.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; } .s5 { grid-column: span 5; }
.s6 { grid-column: span 6; } .s7 { grid-column: span 7; } .s8 { grid-column: span 8; } .s9 { grid-column: span 9; } .s12 { grid-column: span 12; }

/* ---------- card ---------- */
.card {
  position: relative; border-radius: var(--radius); padding: 16px 18px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(10px);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-title { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-title::before { content: ""; width: 4px; height: 16px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent-2)); box-shadow: 0 0 10px var(--accent); }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.card-actions { display: flex; gap: 6px; align-items: center; }
.chart { width: 100%; height: 260px; }
.chart.h200 { height: 200px; } .chart.h220 { height: 220px; } .chart.h300 { height: 300px; } .chart.h340 { height: 340px; } .chart.h380 { height: 380px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin: -2px 0 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { height: 3px; border-radius: 2px; width: 16px; }
.legend i.dash { height: 0; width: 16px; border-top: 2px dashed currentColor; border-radius: 0; background: none !important; }
.mini-btn { padding: 4px 10px; font-size: 12px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.mini-btn:hover { color: var(--accent); border-color: var(--border-hi); }
.mini-btn.ai { color: var(--brand); border-color: rgba(247, 148, 29, .4); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-flat); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 3px 10px; border-radius: 7px; font-size: 12px; cursor: pointer; }
.seg button.on { background: var(--surface-hi); color: var(--text); font-weight: 700; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi {
  position: relative; overflow: hidden; cursor: pointer;
  border-radius: 16px; padding: 14px 14px 10px; min-width: 0;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: transform .25s, border-color .25s, box-shadow .25s;
  animation: rise .5s cubic-bezier(.2, .7, .2, 1) both;
}
.kpi:hover { transform: translateY(-3px); border-color: var(--border-hi); box-shadow: var(--glow); }
.kpi.alert { border-color: rgba(251, 113, 133, .45); }
.kpi.alert::after { content: ""; position: absolute; inset: 0; border-radius: 16px; pointer-events: none; box-shadow: inset 0 0 26px rgba(251, 113, 133, .12); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label { color: var(--text-2); font-size: 13px; font-weight: 600; line-height: 1.4; }
.kpi-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; background: linear-gradient(135deg, #22d3ee, #2563eb); box-shadow: 0 6px 16px rgba(37, 99, 235, .35); }
.kpi-ico .ico { width: 20px; height: 20px; }
.kpi-ico.orange { background: linear-gradient(135deg, #fbbf24, #f26b21); box-shadow: 0 6px 16px rgba(242, 107, 33, .35); }
.kpi-ico.violet { background: linear-gradient(135deg, #a78bfa, #6d28d9); box-shadow: 0 6px 16px rgba(109, 40, 217, .35); }
.kpi-ico.green { background: linear-gradient(135deg, #34d399, #0d9488); box-shadow: 0 6px 16px rgba(13, 148, 136, .35); }
.kpi-ico.red { background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 6px 16px rgba(225, 29, 72, .35); }
.kpi-val { margin-top: 8px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.kpi-val b { font-size: 27px; font-weight: 900; letter-spacing: -.5px; line-height: 1.1; }
.kpi-val small { color: var(--text-2); font-size: 12px; }
.kpi-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; font-size: 12.5px; padding: 1px 7px; border-radius: 8px; white-space: nowrap; }
.delta .ico { width: 13px; height: 13px; }
.delta.up { color: var(--good); background: var(--good-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--text-2); background: var(--surface-hi); }
.kpi-spark { height: 34px; margin: 6px -4px -2px; }
.kpi-bar { height: 5px; border-radius: 4px; background: var(--surface-hi); margin-top: 8px; overflow: hidden; }
.kpi-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width 1s; }
.kpi-bar.bad i { background: linear-gradient(90deg, #e11d48, var(--bad)); }
.kpi-bar.warn i { background: linear-gradient(90deg, #d97706, var(--warn)); }
.kpi-bar.good i { background: linear-gradient(90deg, #0d9488, var(--good)); }

/* ---------- badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 8px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.badge .ico { width: 13px; height: 13px; }
.b-bad { color: var(--bad); background: var(--bad-bg); }
.b-warn { color: var(--warn); background: var(--warn-bg); }
.b-good { color: var(--good); background: var(--good-bg); }
.b-info { color: var(--info); background: var(--info-bg); }
.b-mute { color: var(--text-2); background: var(--surface-hi); }
.t-good { color: var(--good); } .t-bad { color: var(--bad); } .t-warn { color: var(--warn); } .t-info { color: var(--info); } .t-mute { color: var(--muted); } .t-accent { color: var(--accent); } .t-brand { color: var(--brand); }

/* ---------- AI brief ---------- */
.ai-card { position: relative; overflow: hidden; }
.ai-card::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--radius); padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), rgba(34, 211, 238, .9), rgba(37, 99, 235, .2) 25%, rgba(247, 148, 29, .85) 50%, rgba(37, 99, 235, .2) 75%, rgba(34, 211, 238, .9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 8s linear infinite;
}
.ai-card::after { content: ""; position: absolute; width: 340px; height: 340px; top: -170px; left: -120px; border-radius: 50%; background: radial-gradient(rgba(34, 211, 238, .16), transparent 65%); pointer-events: none; }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ai-title { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 16px; }
.ai-title .ico { color: var(--brand); width: 24px; height: 24px; filter: drop-shadow(0 0 8px rgba(247, 148, 29, .6)); }
.ai-meta { color: var(--muted); font-size: 12px; }
.brief-hello { font-size: 15px; color: var(--text); margin-bottom: 8px; min-height: 24px; }
.brief-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
.brief-list li {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface-hi); border: 1px solid transparent; transition: .2s; opacity: 0; transform: translateX(-8px);
}
.brief-list li.show { opacity: 1; transform: none; transition: opacity .4s, transform .4s, border-color .2s, background .2s; }
.brief-list li:hover { border-color: var(--border-hi); }
.brief-list .ico { width: 18px; height: 18px; margin-top: 3px; }
.brief-list .txt { flex: 1; font-size: 13.5px; line-height: 1.85; }
.brief-list .go { color: var(--muted); font-size: 12px; white-space: nowrap; margin-top: 3px; }
.brief-foot { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 11px; cursor: pointer; font-weight: 700; font-size: 13px;
  border: 1px solid var(--border); background: var(--surface-flat); color: var(--text); transition: .2s; white-space: nowrap;
}
.btn .ico { width: 17px; height: 17px; }
.btn:hover { border-color: var(--border-hi); box-shadow: var(--glow); }
.btn.primary { border: 0; color: #fff; background: linear-gradient(90deg, #06b6d4, #2563eb); box-shadow: 0 6px 20px rgba(37, 99, 235, .35); }
.btn.brand { border: 0; color: #fff; background: linear-gradient(90deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 20px rgba(242, 107, 33, .3); }
.btn.ghost { background: transparent; }
.btn.good { border: 0; color: #fff; background: linear-gradient(90deg, #10b981, #0d9488); }
.btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.caret { display: inline-block; width: 8px; height: 17px; background: var(--accent); vertical-align: -3px; margin-inline-start: 2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- health ---------- */
.health { display: grid; grid-template-columns: 170px 1fr; gap: 10px; align-items: center; }
.health-dims { display: grid; gap: 6px; }
.dim { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.dim .bar { height: 6px; border-radius: 4px; background: var(--surface-hi); overflow: hidden; }
.dim .bar i { display: block; height: 100%; border-radius: 4px; }
.dim b { text-align: left; color: var(--text); font-size: 12px; }

/* ---------- lists ---------- */
.alerts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.alert-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface-hi); border: 1px solid transparent; transition: .2s;
}
.alert-item:hover { border-color: var(--border-hi); transform: translateX(-2px); }
.alert-item .a-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.alert-item .a-ico .ico { width: 17px; height: 17px; }
.alert-item .a-txt { flex: 1; min-width: 0; }
.alert-item .a-txt b { display: block; font-size: 13px; }
.alert-item .a-txt small { color: var(--muted); font-size: 11.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* quick analyses */
.quick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.quick button {
  display: flex; align-items: center; gap: 10px; text-align: right; padding: 10px 12px; border-radius: 12px; cursor: pointer;
  background: var(--surface-hi); border: 1px solid var(--border); transition: .2s;
}
.quick button:hover { border-color: var(--border-hi); box-shadow: var(--glow); transform: translateY(-2px); }
.quick .q-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--accent); background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .25); flex: none; }
.quick b { display: block; font-size: 13px; }
.quick small { display: block; color: var(--muted); font-size: 11px; }

/* plant pulse */
.pulse { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pl {
  position: relative; padding: 10px 12px; border-radius: 12px; background: var(--surface-hi); border: 1px solid var(--border); overflow: hidden;
}
.pl-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; font-weight: 700; }
.pl-st { width: 9px; height: 9px; border-radius: 50%; }
.pl-st.run { background: var(--good); box-shadow: 0 0 10px var(--good); animation: ping 2s infinite; }
.pl-st.warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.pl-st.stop { background: var(--bad); box-shadow: 0 0 10px var(--bad); animation: blink 1s steps(2) infinite; }
.pl-val { font-size: 22px; font-weight: 900; margin-top: 4px; }
.pl-val small { font-size: 11px; color: var(--muted); font-weight: 500; }
.pl-sub { font-size: 11px; color: var(--muted); }
.pl-meter { height: 4px; border-radius: 3px; background: rgba(120, 160, 220, .15); margin-top: 6px; overflow: hidden; }
.pl-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.pl::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -40%; background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .07), transparent); animation: scan 4s linear infinite; }
@keyframes scan { to { left: 110%; } }

/* ---------- AI insight ---------- */
.insight {
  position: relative; border-radius: var(--radius); padding: 16px 18px;
  background: linear-gradient(160deg, rgba(247, 148, 29, .1), rgba(37, 99, 235, .12) 60%, rgba(8, 145, 178, .1));
  border: 1px solid rgba(247, 148, 29, .3);
}
:root[data-theme="light"] .insight { background: linear-gradient(160deg, rgba(247, 148, 29, .08), rgba(37, 99, 235, .06) 60%, #fff); }
.insight-head { display: flex; align-items: center; gap: 8px; font-weight: 900; margin-bottom: 8px; }
.insight-head .ico { color: var(--brand); width: 22px; height: 22px; }
.insight-head .conf { margin-inline-start: auto; font-size: 11px; font-weight: 600; color: var(--muted); }
.insight p { margin: 0 0 8px; font-size: 13.5px; line-height: 1.9; color: var(--text); }
.insight ul { margin: 0; padding: 0 18px 0 0; }
.insight li { font-size: 13px; line-height: 1.85; margin-bottom: 4px; color: var(--text); }
.insight li::marker { color: var(--brand); }
.insight .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* chain (root cause) */
.chain { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.chain .step { position: relative; padding: 12px; border-radius: 12px; background: var(--surface-hi); border: 1px solid var(--border); }
.chain .step:not(:last-child)::after { content: "←"; position: absolute; left: -14px; top: 50%; transform: translateY(-50%); color: var(--accent); font-weight: 900; }
.chain .step small { display: block; color: var(--accent); font-weight: 800; font-size: 11px; margin-bottom: 4px; }
.chain .step div { font-size: 12.5px; line-height: 1.8; }

/* ---------- tables ---------- */
.tbl-wrap { overflow: auto; max-height: 380px; border-radius: 12px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: right; font-weight: 700; color: var(--text-2); background: var(--surface-solid); padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tr:hover td { background: var(--surface-hi); }
.tbl td.n { font-feature-settings: "tnum"; }
.tbl .bar-cell { display: flex; align-items: center; gap: 8px; }
.tbl .bar-cell i { display: block; height: 6px; border-radius: 4px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }

/* ---------- decisions ---------- */
.dec-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.dec-stat { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.dec-stat small { color: var(--text-2); font-size: 12.5px; }
.dec-stat b { display: block; font-size: 26px; font-weight: 900; margin-top: 2px; }
.dec-stat b em { font-style: normal; font-size: 13px; color: var(--text-2); font-weight: 500; }
.dec-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.dec-list { display: grid; gap: 14px; }
.dec {
  position: relative; border-radius: var(--radius); padding: 16px 18px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); transition: .35s;
}
.dec::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 4px; background: var(--c, var(--accent)); box-shadow: 0 0 14px var(--c, var(--accent)); }
.dec-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.dec h3 { margin: 0 0 6px; font-size: 17px; font-weight: 900; }
.dec .why { color: var(--text-2); font-size: 13px; line-height: 1.9; margin-bottom: 10px; }
.dec .why b { color: var(--text); }
.dec-body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.opts { display: grid; gap: 7px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-hi); cursor: pointer; transition: .2s; }
.opt:hover { border-color: var(--border-hi); }
.opt.rec { border-color: rgba(52, 211, 153, .55); background: linear-gradient(90deg, rgba(52, 211, 153, .12), transparent); }
.opt.sel { box-shadow: var(--glow); border-color: var(--border-hi); }
.opt .radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); flex: none; position: relative; }
.opt.sel .radio { border-color: var(--accent); }
.opt.sel .radio::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--accent); }
.opt .o-txt { flex: 1; font-size: 13px; }
.opt .o-txt small { display: block; color: var(--muted); font-size: 11.5px; }
.opt .o-imp { font-weight: 800; font-size: 13px; white-space: nowrap; }
.dec-side { display: grid; gap: 10px; align-content: start; }
.impact { padding: 12px; border-radius: 12px; background: var(--surface-hi); text-align: center; }
.impact small { color: var(--text-2); font-size: 12px; }
.impact b { display: block; font-size: 26px; font-weight: 900; color: var(--good); line-height: 1.3; }
.impact em { font-style: normal; font-size: 12px; color: var(--muted); }
.conf-bar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.conf-bar .bar { height: 6px; border-radius: 4px; background: var(--surface-hi); overflow: hidden; }
.conf-bar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.dec-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 10px; }
.dec-meta span { display: inline-flex; align-items: center; gap: 5px; }
.dec-meta .ico { width: 14px; height: 14px; }
.dec-acts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dec.done { border-color: rgba(52, 211, 153, .5); }
.dec.done .dec-body, .dec.done .dec-acts, .dec.done .why { display: none; }
.dec .done-msg { display: none; align-items: center; gap: 10px; color: var(--good); font-weight: 700; font-size: 13.5px; }
.dec.done .done-msg { display: flex; }
.done-msg .check { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--good-bg); }
.log { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.log-item { display: flex; gap: 10px; font-size: 12.5px; padding: 8px 10px; border-radius: 10px; background: var(--surface-hi); animation: rise .4s both; }
.log-item .ico { color: var(--good); width: 16px; height: 16px; margin-top: 3px; }
.log-item small { display: block; color: var(--muted); }

/* ---------- plant map ---------- */
.plant { position: relative; width: 100%; }
.plant svg { width: 100%; height: auto; display: block; }
.plant .m { cursor: pointer; }
.plant .m rect.box { transition: .2s; }
.plant .m:hover rect.box { filter: brightness(1.25); }
.plant .flow { stroke-dasharray: 6 8; animation: flow 1.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.plant .halo { animation: halo 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes halo { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(2.6); } }
.mdetail .row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.mdetail .row span { color: var(--text-2); }
.apq { display: grid; gap: 8px; margin: 10px 0; }
.apq div { display: grid; grid-template-columns: 80px 1fr 44px; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.apq .bar { height: 7px; border-radius: 4px; background: var(--surface-hi); overflow: hidden; }
.apq .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.risk-meter { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-hi); margin-top: 10px; }
.risk-meter b { font-size: 26px; font-weight: 900; }

/* ---------- risk matrix ---------- */
.matrix { display: grid; grid-template-columns: 34px repeat(5, minmax(0, 1fr)); grid-template-rows: repeat(5, 74px) 30px; gap: 5px; }
.matrix .cell { border-radius: 10px; position: relative; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 4px; padding: 4px; }
.matrix .ylab, .matrix .xlab { display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.matrix .ylab { writing-mode: vertical-rl; transform: rotate(180deg); }
.rk { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #fff; cursor: pointer; border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 0 14px rgba(0, 0, 0, .3); transition: transform .2s; }
.rk:hover { transform: scale(1.18); }
.risk-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.risk-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 12px; background: var(--surface-hi); cursor: pointer; border: 1px solid transparent; }
.risk-row:hover, .risk-row.hl { border-color: var(--border-hi); }
.risk-row .rk { width: 26px; height: 26px; font-size: 11px; border-width: 1px; }
.risk-row b { font-size: 13px; }
.risk-row small { display: block; color: var(--muted); font-size: 11.5px; }
.opp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.opp-item { padding: 12px 14px; border-radius: 14px; background: var(--surface-hi); border: 1px solid var(--border); }
.opp-item .o-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.opp-item b { font-size: 13.5px; }
.opp-item .val { color: var(--good); font-weight: 900; white-space: nowrap; }
.opp-item p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); line-height: 1.8; }

/* ---------- simulator ---------- */
.sim { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.sliders { display: grid; gap: 14px; }
.sl { display: grid; gap: 6px; }
.sl-top { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.sl-top output { font-weight: 900; color: var(--accent); font-size: 14px; min-width: 64px; text-align: left; }
.sl small { color: var(--muted); font-size: 11.5px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) var(--p, 50%), var(--surface-hi) var(--p, 50%)); outline: none; direction: ltr; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 0 12px var(--accent); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); cursor: pointer; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.presets button { padding: 5px 10px; font-size: 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-hi); color: var(--text-2); cursor: pointer; }
.presets button:hover, .presets button.on { color: var(--text); border-color: var(--border-hi); }
.sim-out { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.so { padding: 12px 14px; border-radius: 14px; background: var(--surface-hi); border: 1px solid var(--border); }
.so small { color: var(--text-2); font-size: 12px; }
.so b { display: block; font-size: 22px; font-weight: 900; margin: 2px 0; }
.so em { font-style: normal; font-size: 12px; font-weight: 700; }

/* ---------- chat ---------- */
.chat {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(500px, 96vw); z-index: 60;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(8, 20, 44, .97), rgba(5, 12, 28, .98)); border-inline-start: 1px solid var(--border-hi);
  box-shadow: 30px 0 80px rgba(0, 0, 0, .5);
  transform: translateX(-104%); visibility: hidden; transition: transform .45s cubic-bezier(.2, .8, .2, 1), visibility 0s .45s;
}
:root[data-theme="light"] .chat { background: rgba(255, 255, 255, .98); }
.chat.open { transform: none; visibility: visible; transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(2, 6, 18, .5); backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .3s; }
.scrim.show { opacity: 1; pointer-events: auto; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.chat-title { display: flex; align-items: center; gap: 12px; }
.chat-title b { display: block; font-size: 16px; }
.chat-title small { color: var(--muted); font-size: 12px; }
.orb { width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #a5f3fc, #06b6d4 35%, #1d4ed8 70%, #f97316); box-shadow: 0 0 22px rgba(34, 211, 238, .6); animation: orb 6s linear infinite; }
@keyframes orb { 50% { filter: hue-rotate(40deg) brightness(1.15); transform: scale(1.06); } }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; }
.msg { max-width: 92%; padding: 10px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.95; animation: rise .35s both; }
.msg.me { align-self: flex-start; background: linear-gradient(90deg, #0891b2, #2563eb); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-end; background: var(--surface-hi); border: 1px solid var(--border); border-bottom-left-radius: 4px; width: 92%; }
.msg.bot .chart { height: 170px; margin-top: 6px; }
.msg.bot ul { margin: 4px 0; padding-right: 18px; }
.msg.bot .acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.think { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.think div { display: flex; align-items: center; gap: 6px; animation: rise .3s both; }
.think .ico { width: 14px; height: 14px; color: var(--good); }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--accent); animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.chat-suggest { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 18px 10px; }
.chat-suggest button { padding: 5px 11px; border-radius: 999px; font-size: 12px; border: 1px solid var(--border); background: var(--surface-hi); color: var(--text-2); cursor: pointer; }
.chat-suggest button:hover { color: var(--text); border-color: var(--border-hi); }
.chat-input { display: flex; gap: 8px; padding: 12px 18px 18px; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-hi); color: var(--text); padding: 0 14px; outline: none; }
.chat-input input:focus { border-color: var(--border-hi); box-shadow: var(--glow); }
.send { width: 44px; height: 44px; border-radius: 12px; border: 0; cursor: pointer; color: #fff; background: linear-gradient(135deg, #06b6d4, #2563eb); display: grid; place-items: center; }
.send .ico { transform: scaleX(-1); }

/* ---------- modal / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: rgba(2, 6, 18, .6); backdrop-filter: blur(4px); padding: 20px; animation: fadeIn .25s both; }
.modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.modal-card { width: min(760px, 100%); max-height: 88vh; overflow: auto; border-radius: 20px; padding: 20px 22px; background: var(--surface-solid); border: 1px solid var(--border-hi); box-shadow: var(--shadow); animation: rise .35s both; }
.modal-card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.modal-x { float: left; }
.src-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.src { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-hi); border: 1px solid var(--border); }
.src .ico { color: var(--accent); }
.src b { display: block; font-size: 13px; }
.src small { color: var(--muted); font-size: 11.5px; }
.toasts { position: fixed; bottom: 22px; left: 22px; z-index: 90; display: grid; gap: 10px; }
.toast { display: flex; gap: 10px; align-items: center; min-width: 300px; max-width: 420px; padding: 12px 14px; border-radius: 14px; background: var(--surface-solid); border: 1px solid rgba(52, 211, 153, .5); box-shadow: var(--shadow); animation: toastIn .4s cubic-bezier(.2, .8, .2, 1) both; font-size: 13px; }
.toast .ico { color: var(--good); width: 22px; height: 22px; }
.toast.out { animation: toastOut .35s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- tooltip (echarts) ---------- */
.tt { font-family: "Vazirmatn", Tahoma, sans-serif; direction: rtl; text-align: right; font-size: 12.5px; line-height: 1.8; min-width: 150px; }
.tt .tt-h { font-weight: 800; margin-bottom: 2px; }
.tt .tt-r { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tt .tt-r span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.tt .tt-r i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.tt .tt-r b { font-weight: 800; }

/* ---------- presentation ---------- */
.present-bar {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 70; width: min(980px, 94vw);
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 12px 16px 16px;
  border-radius: 18px; background: rgba(5, 14, 32, .92); border: 1px solid var(--border-hi); box-shadow: 0 20px 60px rgba(0, 0, 0, .5), var(--glow); backdrop-filter: blur(12px);
  animation: rise .4s both;
}
:root[data-theme="light"] .present-bar { background: rgba(255, 255, 255, .96); }
.present-bar[hidden] { display: none; }
.present-step { font-weight: 900; color: var(--brand); white-space: nowrap; }
.present-caption { font-size: 14.5px; line-height: 1.8; }
.present-ctrl { display: flex; gap: 6px; }
.present-ctrl button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-hi); color: var(--text); cursor: pointer; display: grid; place-items: center; }
.present-ctrl .ico { width: 16px; height: 16px; }
.present-progress { position: absolute; bottom: 6px; left: 16px; right: 16px; height: 3px; border-radius: 3px; background: var(--surface-hi); overflow: hidden; }
.present-progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); }
body.presenting .main { padding-bottom: 130px; }

/* ---------- misc ---------- */
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.big-num { font-size: 34px; font-weight: 900; letter-spacing: -.5px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.signals { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.signal { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 12px; background: var(--surface-hi); font-size: 12.5px; line-height: 1.8; }
.signal .ico { width: 17px; height: 17px; margin-top: 4px; flex: none; }
.counter-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--good); }
.counter-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: ping 2s infinite; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(120, 160, 220, .25); border-radius: 8px; }

/* ---------- responsive ---------- */
@media (max-width: 1500px) {
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .quick, .pulse { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .greet { display: none; }
}
@media (max-width: 1280px) {
  :root { --side-w: 78px; }
  .nav a { justify-content: center; padding: 10px; }
  .nav a .lbl, .nav .tag, .nav .cnt, .side-ai, .side-sources, .brand-text { display: none; }
  .brand { width: auto; }
  .s3, .s4, .s5 { grid-column: span 6; }
  .s7, .s8, .s9 { grid-column: span 12; }
  .dec-layout, .sim { grid-template-columns: 1fr; }
  .client-logo { display: none; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; grid-template-areas: "top" "main"; }
  .sidebar { display: none; }
  .main { padding: 14px 16px 40px; }
  .grid > * { grid-column: span 12 !important; }
  .kpis, .kpis.k4, .kpis.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick, .pulse, .dec-stats, .sim-out, .chain { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dec-body, .health { grid-template-columns: 1fr; }
  .date-box, .cmd-text { display: none; }
  .cmd { min-width: 0; flex: 0 0 42px; padding: 0; justify-content: center; }
  .cmd kbd { display: none; }
}
@media print {
  .sidebar, .topbar, .chat, .scrim, .bg-aurora, .bg-grid, .present-bar { display: none !important; }
  .app { display: block; }
}
