/* Status Facil Kontrol — identité Facil Kontrol (marine #033363, bleu #0557b9), clair/sombre selon le système */
:root {
  color-scheme: light;
  --navy: #033363;
  --brand: #0557b9;
  --brand-2: #2f7de0;
  --brand-soft: #e8f0fb;
  --page: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f1f3f7;
  --surface-3: #e7ebf1;
  --ink: #0d1726;
  --ink-2: #4a5566;
  --muted: #8791a0;
  --grid: #e6e9ef;
  --axis: #cdd3dc;
  --border: rgba(13, 23, 38, 0.08);
  --accent: #0557b9;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --good: #0ca30c;
  --good-soft: #e7f6e7;
  --good-ink: #067306;
  --warning: #fab219;
  --warning-soft: #fff4dc;
  --warning-ink: #8a5a00;
  --critical: #d03b3b;
  --critical-soft: #fdecec;
  --critical-ink: #b42323;
  --unknown: #cdd3dc;
  --shadow: 0 1px 2px rgba(13, 23, 38, 0.04), 0 8px 24px -12px rgba(13, 23, 38, 0.12);
  --shadow-lg: 0 20px 50px -20px rgba(3, 51, 99, 0.35);
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand: #3b8cf0;
    --brand-2: #6aa9f5;
    --brand-soft: rgba(59, 140, 240, 0.14);
    --page: #0a0f17;
    --surface: #121925;
    --surface-2: #19212f;
    --surface-3: #232d3d;
    --ink: #f3f6fa;
    --ink-2: #b4bdca;
    --muted: #7c8696;
    --grid: #202938;
    --axis: #2e3949;
    --border: rgba(255, 255, 255, 0.07);
    --accent: #5aa0f2;
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
    --series-4: #c98500;
    --series-5: #d55181;
    --good-soft: rgba(12, 163, 12, 0.14);
    --good-ink: #3fcf3f;
    --warning-soft: rgba(250, 178, 25, 0.14);
    --warning-ink: #fab219;
    --critical-soft: rgba(208, 59, 59, 0.16);
    --critical-ink: #f07575;
    --unknown: #3a4556;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--page); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
h1 { font-size: 22px; font-weight: 750; }
h2 { font-size: 17px; font-weight: 700; }
h3 { font-size: 14px; font-weight: 650; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 860px; }

/* ---------- Barre du haut (admin) ---------- */
.appbar {
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
  background: linear-gradient(100deg, var(--navy) 0%, #04448f 55%, var(--brand) 100%);
  color: #fff; box-shadow: 0 6px 24px -12px rgba(3, 51, 99, 0.6);
}
.appbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-block: 8px; }
.appbar .brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.appbar .brand b { font-size: 16px; letter-spacing: -0.01em; }
.appbar .brand span { display: block; font-size: 12px; opacity: 0.75; }
.logo-chip { width: 38px; height: 38px; border-radius: 11px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,0.18); }
.logo-chip img { width: 34px; height: 34px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: rgba(255,255,255,0.8); font-size: 13px; font-weight: 600; padding: 7px 11px; border-radius: 9px; white-space: nowrap; }
.nav a:hover { background: rgba(255,255,255,0.12); color: #fff; text-decoration: none; }
.appbar .btn { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.18); color: #fff; }
.appbar .btn:hover { background: rgba(255,255,255,0.22); }

/* ---------- Boutons & formulaires ---------- */
.btn {
  appearance: none; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; font-size: 13.5px; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; transition: background .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px var(--brand); }
.btn.primary:hover { background: var(--navy); }
.btn.danger { color: var(--critical-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { padding: 5px 10px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn { width: 30px; height: 30px; padding: 0; justify-content: center; border-radius: 8px; color: var(--muted); background: transparent; border-color: transparent; }
.icon-btn:hover { color: var(--critical-ink); background: var(--critical-soft); }
input, select {
  font: inherit; color: var(--ink); background: var(--surface-2); border: 1px solid transparent;
  border-radius: 10px; padding: 9px 12px; min-width: 0; width: 100%; transition: border-color .15s, background .15s;
}
input:hover, select:hover { border-color: var(--border); }
input:focus, select:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.btn:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
label.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
label.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
label.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.form-msg { font-size: 13px; min-height: 20px; font-weight: 500; }
.form-msg.err { color: var(--critical-ink); }
.form-msg.ok { color: var(--good-ink); }

/* ---------- Cartes & sections ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.section { margin-top: 36px; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.section-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.grid { display: grid; gap: 16px; }
.charts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); }
.apps { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }

/* ---------- Héros (état général) ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 22px 24px; margin-top: 24px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; gap: 18px; align-items: flex-start;
}
.hero::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--good); }
.hero.warn::before { background: var(--warning); }
.hero.bad::before { background: var(--critical); }
.pulse { position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--good-soft); display: grid; place-items: center; }
.pulse::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--good); }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--good); opacity: 0; animation: ping 2.4s ease-out infinite; }
.hero.warn .pulse { background: var(--warning-soft); } .hero.warn .pulse::before, .hero.warn .pulse::after { background: var(--warning); border-color: var(--warning); }
.hero.bad .pulse { background: var(--critical-soft); } .hero.bad .pulse::before { background: var(--critical); } .hero.bad .pulse::after { border-color: var(--critical); }
.hero.warn .pulse::after { background: transparent; }
@keyframes ping { 0% { transform: scale(0.55); opacity: 0.7; } 80%, 100% { transform: scale(1.25); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse::after { animation: none; } html { scroll-behavior: auto; } }
.hero strong { display: block; font-size: 19px; letter-spacing: -0.01em; }
.hero .sub { color: var(--muted); font-size: 13.5px; }
.alerts { display: grid; gap: 8px; margin-top: 12px; }
.alert-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 13px; border-radius: 12px; background: var(--surface-2); }
.alert-row.critical { background: var(--critical-soft); }
.alert-row.warning { background: var(--warning-soft); }
.alert-row .t { font-weight: 650; }
.alert-row .d { font-size: 13px; color: var(--ink-2); }

/* ---------- Jauges & tuiles ---------- */
.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
.kpis .card { padding: 16px; }
.kpi { display: flex; gap: 14px; align-items: center; }
.kpi .gauge { width: 72px; height: 72px; }
.kpi .gauge .center b { font-size: 18px; }
.gauge { position: relative; width: 84px; height: 84px; flex: none; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--surface-3); stroke-width: 9; }
.gauge .val { fill: none; stroke: var(--brand); stroke-width: 9; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.gauge.warn .val { stroke: var(--warning); }
.gauge.crit .val { stroke: var(--critical); }
.gauge .thr { stroke: var(--ink-2); stroke-width: 2.5; opacity: 0.55; }
.gauge .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.gauge .center b { font-size: 20px; font-weight: 750; letter-spacing: -0.02em; line-height: 1; }
.gauge .center b small { font-size: 11px; font-weight: 700; color: var(--ink-2); }
.kpi .label { font-size: 12.5px; font-weight: 650; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi .big { font-size: 17px; font-weight: 700; margin: 2px 0; letter-spacing: -0.01em; }
.kpi .sub { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.kpi-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.kpi-icon svg { width: 22px; height: 22px; }
.net-lines { display: grid; gap: 2px; }
.net-lines b { font-size: 18px; letter-spacing: -0.01em; }
.net-lines span { color: var(--muted); font-size: 12.5px; font-weight: 500; }

/* ---------- Répartition de la RAM ---------- */
.split { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--surface-2); gap: 2px; margin-top: 14px; }
.split > i { display: block; height: 100%; min-width: 3px; transition: flex-basis .6s ease; }
.split-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 13px; }
.split-legend span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); }
.split-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.split-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Statuts ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; padding: 4px 10px 4px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); flex: none; }
.s-up.pill { background: var(--good-soft); color: var(--good-ink); }
.s-degraded.pill { background: var(--warning-soft); color: var(--warning-ink); }
.s-down.pill { background: var(--critical-soft); color: var(--critical-ink); }
.s-up .dot, .dot.s-up { background: var(--good); }
.s-degraded .dot, .dot.s-degraded { background: var(--warning); }
.s-down .dot, .dot.s-down { background: var(--critical); }
.lvl { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font-size: 13px; font-weight: 800; color: #fff; flex: none; }
.lvl.critical { background: var(--critical); }
.lvl.warning { background: var(--warning); color: #3b2800; }
.lvl.info { background: var(--brand); }
.lvl.ok { background: var(--good); }

/* ---------- Barres de disponibilité ---------- */
.bars { display: flex; gap: 3px; align-items: stretch; height: 34px; margin-top: 14px; }
.bars > span { flex: 1; border-radius: 3px; background: var(--surface-3); min-width: 2px; transition: transform .15s; }
.bars > span.up { background: var(--good); opacity: 0.85; }
.bars > span.part { background: var(--warning); }
.bars > span.down { background: var(--critical); }
.bars > span:hover { transform: scaleY(1.12); opacity: 1; }
.bars.thin { height: 20px; gap: 1.5px; margin-top: 0; }
.bars.thin > span { border-radius: 2px; }
.bars-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.bars-legend b { color: var(--ink-2); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-weight: 650; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 12px 10px 0; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.checks-table { min-width: 680px; }
.checks-table td:nth-child(2) { min-width: 230px; }
.svc-name { font-weight: 650; }
.svc-name .app { color: var(--muted); font-weight: 500; }
.svc-url { color: var(--muted); font-size: 12px; word-break: break-all; }
.cname { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.minibar { display: inline-block; width: 56px; height: 6px; border-radius: 3px; background: var(--surface-3); vertical-align: middle; margin-left: 8px; position: relative; overflow: hidden; }
.minibar > i { position: absolute; inset: 0 auto 0 0; background: var(--series-1); border-radius: 3px; }
.minibar.warn > i { background: var(--warning); }
.minibar.crit > i { background: var(--critical); }
.ssl-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); }

/* ---------- Cartes d'applis ---------- */
.app-card { position: relative; overflow: hidden; }
.app-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--app-color, var(--brand)); }
.app-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.app-title { display: flex; align-items: center; gap: 10px; }
.app-avatar { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; background: var(--app-color, var(--brand)); flex: none; }
.app-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 16px 0 6px; }
.app-stats div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; }
.app-stats b { display: block; font-size: 18px; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.app-stats span { font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.spark-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.spark-row svg { flex: 1; height: 34px; max-width: 220px; }
details.containers { margin-top: 12px; border-top: 1px solid var(--grid); padding-top: 8px; }
details.containers summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 4px 0; list-style: none; display: flex; align-items: center; gap: 6px; }
details.containers summary::-webkit-details-marker { display: none; }
details.containers summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 16px; line-height: 1; }
details.containers[open] summary::before { transform: rotate(90deg); }
.svc-list { display: grid; gap: 2px; margin-top: 14px; }
.svc { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; padding: 9px 0; border-bottom: 1px solid var(--grid); }
.svc:last-child { border-bottom: 0; }

/* ---------- Graphiques ---------- */
.chart-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.chart-card h3 .now { font-weight: 750; font-size: 20px; letter-spacing: -0.02em; }
.chart-card h3 .now small { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 4px; }
.chart { position: relative; margin-top: 12px; height: 190px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .threshold { stroke: var(--critical); stroke-width: 1.2; stroke-dasharray: 5 5; opacity: 0.6; }
.chart .threshold-label { fill: var(--critical-ink); font-size: 10.5px; font-weight: 650; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; opacity: 0.35; }
.chart .marker { stroke: var(--surface); stroke-width: 2.5; }
.tip {
  position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.25); border-radius: 10px; padding: 8px 11px; font-size: 12.5px;
  white-space: nowrap; z-index: 5; transform: translate(-50%, calc(-100% - 12px));
}
.tip .tt { color: var(--muted); margin-bottom: 3px; font-size: 11.5px; }
.tip .row { display: flex; align-items: center; gap: 7px; }
.tip .sw { width: 10px; height: 10px; border-radius: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.empty { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; border: 1px dashed var(--grid); border-radius: 12px; }

/* ---------- Sélecteur de période ---------- */
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; box-shadow: var(--shadow); }
.seg button { appearance: none; border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 650; color: var(--ink-2); padding: 6px 13px; border-radius: 9px; cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--brand); color: #fff; }

/* ---------- Incidents ---------- */
.incident { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--grid); }
.incident:first-child { padding-top: 0; }
.incident:last-child { border-bottom: 0; padding-bottom: 0; }
.incident .t { font-weight: 650; }
.incident .d { font-size: 13px; color: var(--ink-2); word-break: break-word; }
.incident .w { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tag-live { display: inline-block; font-size: 10.5px; font-weight: 800; color: var(--critical-ink); background: var(--critical-soft); padding: 2px 7px; border-radius: 6px; margin-left: 8px; text-transform: uppercase; letter-spacing: 0.05em; vertical-align: 2px; }
.empty-state { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13.5px; }
.empty-state .lvl { background: var(--good-soft); color: var(--good-ink); }

/* ---------- Page publique ---------- */
.pub-hero {
  background: radial-gradient(1200px 400px at 85% -10%, rgba(47, 125, 224, 0.55), transparent 60%),
              linear-gradient(135deg, var(--navy) 0%, #043f82 60%, var(--brand) 100%);
  color: #fff; padding: calc(28px + env(safe-area-inset-top, 0px)) 0 96px;
}
.pub-hero .top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-hero .brand { display: flex; align-items: center; gap: 12px; }
.pub-hero .brand b { font-size: 17px; letter-spacing: -0.01em; }
.pub-hero .brand span { display: block; font-size: 12.5px; opacity: 0.75; }
.pub-hero .btn { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.2); color: #fff; }
.pub-hero .btn:hover { background: rgba(255,255,255,0.22); }
.pub-hero h1 { font-size: clamp(26px, 5vw, 38px); font-weight: 800; letter-spacing: -0.025em; margin-top: 44px; max-width: 18ch; line-height: 1.12; }
.pub-hero p.lead { margin: 10px 0 0; opacity: 0.8; font-size: 15px; }
.pub-main { margin-top: -64px; padding-bottom: 48px; }
.pub-main .hero { margin-top: 0; box-shadow: var(--shadow-lg); }
.pub-group h2 { font-size: 18px; }
.uptime-big { font-size: 13px; color: var(--muted); font-weight: 500; }
.uptime-big b { color: var(--ink); font-size: 15px; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 20px;
  background: radial-gradient(900px 500px at 80% 0%, rgba(47, 125, 224, 0.45), transparent 60%), linear-gradient(135deg, var(--navy), var(--brand)); }
.auth .card { width: 100%; max-width: 400px; padding: 32px; box-shadow: var(--shadow-lg); }
.auth .brand { display: flex; align-items: center; gap: 12px; }
.auth .brand img { width: 44px; height: 44px; }
.auth form { display: grid; gap: 16px; margin-top: 24px; }

footer.foot { margin-top: 48px; padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); font-size: 12.5px; color: var(--muted); text-align: center; display: flex; gap: 8px; justify-content: center; align-items: center; }
footer.foot img { width: 18px; height: 18px; opacity: 0.8; }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .card { padding: 16px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .hide-sm { display: none; }
  .appbar .brand span { display: none; }
  .appbar { position: static; }
  .nav { order: 3; width: 100%; margin: 0 -6px; }
  .hero { padding: 18px; }
  .gauge { width: 72px; height: 72px; }
  .app-stats b { font-size: 16px; }
}

/* ---------- Direct ---------- */
.live-badge { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 650; color: var(--ink-2); background: var(--surface); border: 1px solid var(--border); padding: 5px 11px; border-radius: 999px; }
.live-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--unknown); }
.live-badge.on i { background: var(--critical); animation: blink 1.6s ease-in-out infinite; }
.live-badge.on { color: var(--critical-ink); }
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .live-badge.on i { animation: none; } }

/* ---------- Trafic ---------- */
.traffic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.traffic-grid .span-2 { grid-column: span 2; }
@media (max-width: 980px) { .traffic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .traffic-grid { grid-template-columns: 1fr; } .traffic-grid .span-2 { grid-column: auto; } }
.toplist { display: grid; gap: 4px; margin-top: 12px; }
.toprow { position: relative; display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; overflow: hidden; }
.toprow > .fill { position: absolute; inset: 0 auto 0 0; background: var(--brand-soft); border-radius: 8px; z-index: 0; }
.toprow > span { position: relative; z-index: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toprow > b { position: relative; z-index: 1; font-variant-numeric: tabular-nums; }
.toplist .none { color: var(--muted); font-size: 13px; padding: 6px 2px; }
.flag { font-size: 16px; line-height: 1; margin-right: 6px; }
.feed { display: grid; gap: 2px; margin-top: 12px; max-height: 420px; overflow-y: auto; }
.visit { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--grid); font-size: 13px; }
.visit:last-child { border-bottom: 0; }
.visit .where { font-weight: 600; white-space: nowrap; }
.visit .what { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit .when { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.visit.fresh { animation: fresh 2.5s ease-out; }
@keyframes fresh { from { background: var(--brand-soft); } to { background: transparent; } }
.notice { display: flex; gap: 14px; align-items: flex-start; }
.notice .lvl { background: var(--brand); }
