/* ============================================================
   MailSurety — demo dashboard
   ============================================================ */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side { border-right: 1px solid var(--line); background: var(--bg-elev); display: flex; flex-direction: column; padding: 20px 16px; position: sticky; top: 0; height: 100vh; }
.side .brand { padding: 6px 8px 22px; font-size: 19px; }
.side .brand img { width: 30px; height: 30px; }
.side nav { display: grid; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--ink-2); font-size: 14.5px; font-weight: 500; transition: background .2s, color .2s; }
.side nav a svg { width: 19px; height: 19px; opacity: .85; }
.side nav a:hover { background: rgba(255,255,255,.03); color: var(--ink); }
.side nav a.active { background: rgba(53,228,167,.1); color: var(--brand-2); }
.side nav a.active svg { opacity: 1; }
.side-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.side-user { display: flex; align-items: center; gap: 11px; padding: 8px; border-radius: 10px; }
.side-user .av { width: 36px; height: 36px; border-radius: 10px; background: var(--grad-brand); display: grid; place-items: center; color: var(--brand-ink); font-weight: 700; font-family: var(--font-display); flex: none; }
.side-user .who b { display: block; font-size: 14px; }
.side-user .who span { font-size: 12px; color: var(--muted); }

/* ---------- main ---------- */
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 30px; background: rgba(7,11,20,.75); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.topbar h1 { font-size: 21px; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); font-family: var(--mono); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.select { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 13.5px; color: var(--ink-2); cursor: pointer; transition: border-color .2s; }
.select:hover { border-color: var(--brand-2); }
.select svg { width: 15px; height: 15px; }
.select b { color: var(--ink); font-weight: 600; }

.demo-note { display: flex; align-items: center; gap: 12px; margin: 22px 30px 0; padding: 12px 18px; border: 1px dashed rgba(53,228,167,.4); border-radius: var(--r); background: rgba(53,228,167,.05); font-size: 14px; color: var(--ink-2); }
.demo-note svg { width: 18px; height: 18px; color: var(--brand-2); flex: none; }
.demo-note a { color: var(--brand-2); font-weight: 600; margin-left: auto; white-space: nowrap; }

.content { padding: 24px 30px 60px; display: grid; gap: 22px; }

/* ---------- KPI row ---------- */
.kpis { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 18px; align-items: start; }
.card {
  border: 1px solid transparent; border-radius: var(--r-lg); padding: 22px;
  /* gradient hairline edge (glows emerald at the top) + technical shadow */
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(180deg, rgba(53,228,167,.34), var(--line-2) 26%, var(--line)) border-box;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 24px 50px -34px rgba(0,0,0,.85);
}
.kpi .kpi-head { display: flex; justify-content: space-between; align-items: center; }
.kpi .kpi-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .kpi-val { font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: -.03em; margin-top: 6px; line-height: 1; }
.kpi .kpi-val.ok { color: var(--brand-2); } .kpi .kpi-val.red { color: var(--red); }
.kpi .kpi-delta { margin-top: 7px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.kpi .kpi-delta.up { color: var(--brand-2); } .kpi .kpi-delta.down { color: var(--brand-2); } .kpi .kpi-delta.bad { color: var(--red); }
.kpi .kpi-delta svg { width: 14px; height: 14px; }
.kpi .kpi-sub { margin-top: 8px; font-size: 12.5px; color: var(--muted); }

/* clickable KPI tiles + expandable info */
.card.kpi { padding: 16px 18px; }
.kpi .kpi-sub { margin-top: 6px; }
.kpi[data-kpi] { position: relative; cursor: pointer; outline: none; }
.kpi[data-kpi]:focus-visible { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(53,228,167,.18); }
.kpi .kpi-chev { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); transition: color .2s, background .2s, transform .3s var(--ease); }
.kpi .kpi-chev svg { width: 14px; height: 14px; }
.kpi[data-kpi]:hover .kpi-chev { color: var(--ink); }
.kpi.open .kpi-chev { transform: rotate(180deg); color: var(--brand-2); border-color: rgba(53,228,167,.35); }
.kpi .kpi-info { max-height: 0; opacity: 0; overflow: hidden; transition: max-height .35s var(--ease), opacity .3s, margin-top .35s var(--ease), padding-top .35s var(--ease); }
.kpi.open .kpi-info { max-height: 240px; opacity: 1; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.kpi .kpi-info p { font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.kpi .kpi-info em { color: var(--ink); font-style: normal; font-weight: 600; }
.kpi .kpi-link { display: inline-block; margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--brand-2); cursor: pointer; }
.kpi .kpi-link:hover { text-decoration: underline; }

/* ring KPI */
.ring-kpi { display: flex; flex-direction: column; }
.ring-kpi .kpi-top { display: flex; align-items: center; gap: 14px; }
.ring { position: relative; width: 72px; height: 72px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .ring-center b { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.02em; line-height: 1; }
.ring .ring-center span { font-size: 9px; color: var(--muted); }

/* ---------- chart card ---------- */
.chart-card .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.chart-card h3 { font-size: 17px; }
.chart-card .card-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 2px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
/* legend chips toggle series on/off */
.legend .lg { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: opacity .2s, border-color .2s, color .2s, background .2s; }
.legend .lg i { transition: transform .2s; }
.legend .lg:hover { border-color: var(--brand-2); color: var(--ink); }
.legend .lg:hover i { transform: scale(1.2); }
.legend .lg.off { opacity: .5; }
.legend .lg.off i { background: var(--surface-3) !important; }

/* ---------- chart controls: range button + calendar popover ---------- */
.chart-controls { position: relative; }
.range-btn { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); color: var(--ink-2); font-size: 13.5px; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.range-btn:hover, .range-btn.open { border-color: var(--brand-2); color: var(--ink); }
.range-btn svg { width: 15px; height: 15px; flex: none; }
.range-btn #rangeLabel { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.range-btn .chev { transition: transform .25s var(--ease); }
.range-btn.open .chev { transform: rotate(180deg); }

.cal-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 290px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px; box-shadow: var(--sh-3); animation: calIn .16s var(--ease); }
@keyframes calIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-weight: 600; font-size: 14px; }
.cal-nav { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; }
.cal-nav:hover:not(:disabled) { background: rgba(255,255,255,.05); color: var(--ink); }
.cal-nav:disabled { opacity: .3; cursor: default; }
.cal-nav svg { width: 16px; height: 16px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-dow span { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-d { height: 32px; display: grid; place-items: center; border-radius: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums; transition: background .15s, color .15s; }
.cal-d.empty { visibility: hidden; }
.cal-d:not(.disabled):not(.sel):hover { background: rgba(255,255,255,.06); color: var(--ink); }
.cal-d.range { background: rgba(53,228,167,.12); color: var(--brand-2); border-radius: 3px; }
.cal-d.sel { background: var(--brand); color: var(--brand-ink); font-weight: 700; }
.cal-d.disabled { opacity: .28; cursor: default; }
.cal-hint { font-size: 11.5px; color: var(--muted); margin: 11px 2px 12px; line-height: 1.4; }
.cal-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cal-presets button { padding: 8px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink-2); font-size: 12.5px; cursor: pointer; transition: border-color .2s, color .2s; }
.cal-presets button:hover { border-color: var(--brand-2); color: var(--ink); }
@media (max-width: 560px) { .cal-pop { right: auto; left: 0; } }
.chart-wrap { position: relative; margin-top: 10px; }
.chart-wrap svg { width: 100%; display: block; overflow: visible; }
.tick-txt { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.tick-txt.tab { font-variant-numeric: tabular-nums; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-line { stroke: var(--line-2); stroke-width: 1; }
.crosshair { stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 3 3; opacity: 0; }
.dot-hover { opacity: 0; }
.end-label { font-size: 12px; font-weight: 600; font-family: var(--font); }

.chart-tip { position: absolute; pointer-events: none; opacity: 0; transform: translate(-50%, -12px); transition: opacity .12s; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; box-shadow: var(--sh-2); min-width: 150px; z-index: 5; }
.chart-tip .tip-date { color: var(--muted); font-size: 11.5px; margin-bottom: 7px; font-family: var(--mono); }
.chart-tip .tip-row { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.chart-tip .tip-row i { width: 9px; height: 9px; border-radius: 2px; }
.chart-tip .tip-row b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- mail network map ---------- */
.netmap-card .card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.netmap-card h3 { font-size: 17px; }
.netmap-card .card-head p { font-size: 13px; color: var(--muted); margin-top: 3px; }
.netmap-card .flow-legend { margin: 0; gap: 10px 18px; }
.netmap-card .flow-canvas { margin-top: 22px; gap: clamp(20px, 4vw, 68px); }

/* ---------- two-col grid ---------- */
.cols { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; align-items: start; }

/* sources table */
.side-card h3, .threats h3 { font-size: 17px; margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.src-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; flex: none; font-size: 14px; font-weight: 700; font-family: var(--font-display); color: var(--ink-2); }
.src-ic.warn { background: rgba(246,178,60,.08); border-color: rgba(246,178,60,.3); color: var(--amber); }
.src-ic.crit { background: rgba(242,105,107,.08); border-color: rgba(242,105,107,.3); color: var(--red); }
.src-ic svg { width: 16px; height: 16px; }

.badge-s { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-s svg { width: 13px; height: 13px; }
.badge-s.good   { background: rgba(53,228,167,.13); color: var(--brand-2); }
.badge-s.warn   { background: rgba(246,178,60,.14); color: var(--amber); }
.badge-s.crit   { background: rgba(242,105,107,.14); color: var(--red); }

/* policy card */
.policy-state { display: flex; align-items: center; gap: 10px; margin: 6px 0 18px; }
.policy-pill { font-family: var(--mono); font-size: 13px; padding: 4px 10px; border-radius: 8px; background: rgba(246,178,60,.14); color: var(--amber); }
.steps-meter { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 6px 0 16px; }
.steps-meter .st { text-align: center; }
.steps-meter .st .bar { height: 6px; border-radius: 3px; background: var(--surface-3); }
.steps-meter .st.done .bar { background: var(--brand); }
.steps-meter .st.next .bar { background: repeating-linear-gradient(90deg, var(--amber), var(--amber) 6px, transparent 6px, transparent 12px); }
.steps-meter .st small { display: block; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.steps-meter .st.done small { color: var(--brand-2); } .steps-meter .st.next small { color: var(--amber); }
.rec-box { font-size: 13.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.side-card .btn { width: 100%; }

/* threats */
.threat-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.threat-row:first-of-type { border-top: 0; }
.threat-row .t-ic { width: 34px; height: 34px; border-radius: 9px; background: rgba(242,105,107,.12); color: var(--red); display: grid; place-items: center; flex: none; }
.threat-row .t-ic svg { width: 17px; height: 17px; }
.threat-row .t-main b { font-size: 13.5px; font-family: var(--mono); }
.threat-row .t-main span { display: block; font-size: 12px; color: var(--muted); }
.threat-row .t-meta { margin-left: auto; text-align: right; }
.threat-row .t-meta b { font-size: 13.5px; color: var(--red); }
.threat-row .t-meta span { display: block; font-size: 11.5px; color: var(--muted); }

.back-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink-2); }
.back-link svg { width: 16px; height: 16px; }
.back-link:hover { color: var(--brand-2); }

/* ---------- metric strip ---------- */
.metric-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; display: flex; flex-direction: column; gap: 8px; }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.metric-label { font-size: 12px; color: var(--muted); }
.metric-trend { font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; padding: 2px 7px; border-radius: var(--pill); white-space: nowrap; }
.metric-trend.up { background: rgba(53,228,167,.13); color: var(--brand-2); }
.metric-trend.flat { background: var(--surface-3); color: var(--muted); }
.metric-val b { font-family: var(--font-display); font-weight: 800; font-size: 27px; letter-spacing: -.02em; line-height: 1; }
.metric-bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.metric-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--grad-brand); transition: width 1.1s var(--ease); }
.metric-sub { font-size: 11.5px; color: var(--muted); line-height: 1.4; }

/* ---------- analytics row ---------- */
.analytics { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 22px; align-items: start; }
.analytics h3 { font-size: 16px; margin-bottom: 4px; }

/* auth bars */
.auth-bar { padding: 12px 0; border-top: 1px solid var(--line); }
.auth-bar:first-child { border-top: 0; }
.auth-bar-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.auth-bar-head b { font-size: 13.5px; }
.auth-bar-head .pct { font-family: var(--font-display); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.auth-bar-head .pct.ok { color: var(--brand-2); }
.auth-bar .track { height: 8px; border-radius: 4px; background: var(--surface-3); overflow: hidden; display: flex; }
.auth-bar .track i { height: 100%; width: 0; transition: width 1.1s var(--ease); }
.auth-bar .track .pass { background: #3987e5; }
.auth-bar .track .fail { background: #e66767; }
.auth-bar .cnt { margin-top: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* donut */
.donut-wrap { display: flex; align-items: center; gap: 18px; margin-top: 8px; flex-wrap: wrap; }
#donut { flex: none; transform: rotate(-90deg); }
#donut circle { transition: stroke-dasharray 1.1s var(--ease); }
.donut-legend { display: grid; gap: 12px; min-width: 0; }
.donut-legend .dl { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.donut-legend .dl i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.donut-legend .dl .dl-txt { color: var(--ink-2); }
.donut-legend .dl b { margin-left: auto; font-variant-numeric: tabular-nums; padding-left: 12px; }

/* provider list */
.prov-row { padding: 11px 0; border-top: 1px solid var(--line); }
.prov-row:first-child { border-top: 0; }
.prov-head { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.prov-head .pi { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.prov-head b { font-size: 13px; }
.prov-head .pv { margin-left: auto; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prov-row .track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.prov-row .track i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width 1.1s var(--ease); }

/* ---------- senders panel ---------- */
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.senders-panel h3, .threats h3 { font-size: 17px; margin-bottom: 4px; }
.search { display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface-2); min-width: 230px; transition: border-color .2s; }
.search:focus-within { border-color: var(--brand-2); }
.search svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search input { border: 0; background: transparent; color: var(--ink); font-size: 13.5px; width: 100%; outline: none; }
.search input::placeholder { color: var(--muted); }

.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border: 1px solid var(--line-2); border-radius: var(--pill); background: var(--surface-2); color: var(--ink-2); font-size: 13px; font-weight: 500; cursor: pointer; transition: border-color .2s, color .2s, background .2s; }
.chip span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--brand-2); color: var(--ink); }
.chip.active { background: rgba(53,228,167,.1); border-color: rgba(53,228,167,.4); color: var(--brand-2); }
.chip.active span { color: var(--brand-2); }

.table-scroll { overflow-x: auto; margin: 0 -22px -22px; padding: 0 22px 6px; }
.src-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.src-table th { text-align: right; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; white-space: nowrap; user-select: none; }
.src-table th.s-name { text-align: left; }
.src-table th.s-status { text-align: left; cursor: default; }
.src-table th[data-sort]:hover { color: var(--ink); }
.src-table th .arw { display: inline-block; margin-left: 4px; opacity: 0; transition: opacity .2s; }
.src-table th.sorted .arw { opacity: 1; }
.src-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); font-size: 13.5px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.src-table tr:last-child td { border-bottom: 0; }
.src-table tr:hover td { background: rgba(255,255,255,.02); }
.src-table td.td-name { text-align: left; }
.src-name-cell { display: flex; align-items: center; gap: 11px; min-width: 0; }
.src-name-cell .src-ic { width: 32px; height: 32px; font-size: 14px; }
.src-name-cell b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 190px; }
.src-name-cell span { font-size: 11.5px; color: var(--muted); }
.auth-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; justify-content: flex-end; }
.auth-pill.pass { color: var(--brand-2); } .auth-pill.fail { color: var(--red); }
.auth-pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pass-cell { font-weight: 600; }
.pass-cell.ok { color: var(--brand-2); } .pass-cell.mid { color: var(--amber); } .pass-cell.low { color: var(--red); }
.src-table td.td-status { text-align: left; }
.empty { padding: 34px; text-align: center; color: var(--muted); font-size: 13.5px; }

.sort-select { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.sort-select select { appearance: none; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 9px; color: var(--ink); font-size: 13px; padding: 7px 30px 7px 11px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237c8798' stroke-width='2.4'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 14px; transition: border-color .2s; }
.sort-select select:hover { border-color: var(--brand-2); }

/* ---------- views / tab switching ---------- */
.view { display: none; }
.view.active { display: grid; gap: 22px; animation: viewIn .28s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.link-more { font-size: 13px; font-weight: 600; color: var(--brand-2); cursor: pointer; white-space: nowrap; }
.link-more:hover { text-decoration: underline; }

/* summary sub-stats */
.substats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.substat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.substat b { font-family: var(--font-display); font-weight: 800; font-size: 25px; letter-spacing: -.02em; line-height: 1; display: block; }
.substat span { font-size: 12.5px; color: var(--muted); margin-top: 6px; display: block; }
.substat.good b { color: var(--brand-2); } .substat.warn b { color: var(--amber); } .substat.crit b { color: var(--red); }

/* threat table cells */
.threat-ip { font-family: var(--mono); font-size: 13px; }
.disp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: var(--pill); font-size: 12px; font-weight: 600; }
.disp-pill.rej { background: rgba(242,105,107,.14); color: var(--red); }
.disp-pill.quar { background: rgba(246,178,60,.14); color: var(--amber); }

/* report provider cell */
.rep-prov { display: flex; align-items: center; gap: 10px; }
.rep-prov .pi { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.export-btns { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.export-btns .btn svg { width: 16px; height: 16px; }

/* ---------- settings ---------- */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.set-col { display: grid; gap: 22px; }
.set-card h3 { font-size: 16px; margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type, .set-card > .set-row:first-of-type { border-top: 0; }
.set-card .card-sub + .set-row { border-top: 0; }
.set-row .lbl b { font-size: 14px; display: block; }
.set-row .lbl span { font-size: 12.5px; color: var(--muted); }

/* toggle switch */
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 20px; background: var(--surface-3); transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* DNS record rows */
.dns-rec { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.dns-rec:first-of-type { border-top: 0; }
.dns-rec .k { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.dns-rec code { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* segmented control */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { padding: 8px 15px; border-radius: 8px; font-size: 13px; color: var(--ink-2); font-weight: 500; cursor: pointer; transition: color .2s, background .2s; }
.seg button:hover { color: var(--ink); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* team + plan */
.team-m { display: flex; align-items: center; gap: 11px; min-width: 0; }
.av-sm { width: 34px; height: 34px; border-radius: 9px; background: var(--grad-brand); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; font-family: var(--font-display); font-size: 14px; flex: none; }
.role-pill { font-size: 12px; font-weight: 600; padding: 4px 11px; border-radius: var(--pill); background: rgba(53,228,167,.13); color: var(--brand-2); }
.role-pill.muted { background: var(--surface-3); color: var(--muted); }
.plan-card { background: linear-gradient(150deg, rgba(53,228,167,.08), var(--surface) 60%); border-color: rgba(53,228,167,.25); }
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.plan-name { font-family: var(--font-display); font-size: 18px; }
.plan-row span { font-size: 12.5px; color: var(--muted); display: block; margin-top: 3px; }
.plan-price { font-family: var(--font-display); font-weight: 800; font-size: 26px; white-space: nowrap; }
.plan-price small { font-size: 13px; color: var(--muted); font-weight: 500; }
.btn--sm { padding: 8px 14px; font-size: 13px; }
.btn--danger { color: var(--red); border-color: rgba(242,105,107,.35); }
.btn--danger:hover { background: rgba(242,105,107,.08); }

/* toast */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--surface-3); border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 18px; font-size: 13.5px; color: var(--ink); box-shadow: var(--sh-3); max-width: min(90vw, 440px); z-index: 60; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translateX(-50%); }

@media (max-width: 1180px) {
  .metric-strip { grid-template-columns: repeat(3, 1fr); }
  .analytics { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; overflow-x: auto; }
  .side .brand { padding: 6px 8px; }
  .side nav { grid-auto-flow: column; }
  .side-foot { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .cols { grid-template-columns: 1fr; }
  .analytics { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .metric-strip { grid-template-columns: 1fr 1fr; } .substats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .kpis { grid-template-columns: 1fr; }
  .content, .topbar { padding-inline: 16px; }
  .table-scroll { margin-inline: -16px; padding-inline: 16px; }
  .panel-head .search { min-width: 0; width: 100%; }
}

/* ---------- motion: hover feedback + on-load reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* gentle lift as the cursor moves across cards */
  .kpi, .metric, .substat { transition: transform .22s var(--ease), border-color .22s, box-shadow .22s; }
  .kpi:hover, .metric:hover, .substat:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--sh-2); }

  /* staggered entrance — opacity-only where a hover-transform also lives, so they don't fight */
  #view-overview .kpi, #view-overview .metric, #view-overview .substat { animation: msFade .55s var(--ease) both; }
  #view-overview .chart-card, #view-overview .analytics > .card, #view-overview .cols > .card { animation: msRise .55s var(--ease) both; }
  #view-overview .kpis .kpi:nth-child(1) { animation-delay: 0s; }
  #view-overview .kpis .kpi:nth-child(2) { animation-delay: .05s; }
  #view-overview .kpis .kpi:nth-child(3) { animation-delay: .10s; }
  #view-overview .kpis .kpi:nth-child(4) { animation-delay: .15s; }
  #view-overview .metric-strip .metric:nth-child(1) { animation-delay: .12s; }
  #view-overview .metric-strip .metric:nth-child(2) { animation-delay: .17s; }
  #view-overview .metric-strip .metric:nth-child(3) { animation-delay: .22s; }
  #view-overview .metric-strip .metric:nth-child(4) { animation-delay: .27s; }
  #view-overview .metric-strip .metric:nth-child(5) { animation-delay: .32s; }
  #view-overview .chart-card { animation-delay: .30s; }
  #view-overview .analytics > .card:nth-child(2) { animation-delay: .06s; }
  #view-overview .analytics > .card:nth-child(3) { animation-delay: .12s; }

  /* numbers/letters resolve into focus on refresh */
  .kpi-val, .metric-val b, #passRate, .substat b, .ring-center b { animation: msNum .7s var(--ease) both; }
}
@keyframes msFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes msRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes msNum { from { opacity: 0; filter: blur(6px); } to { opacity: 1; filter: blur(0); } }
