/* Visual refresh, loaded after app.css and dashboard.css. Brings the console in line with the landing page:
   warm neutral surfaces, sentence-case sans-serif UI text, mono only for real data (IPs, hashes, numbers),
   solid buttons without gradients or glows, quiet row actions, no grid background or decorative stripes.
   Teal stays as the single accent (links, active nav, focus, success). Revert by removing this file's <link>. */

/* ---------- tokens ---------- */
:root {
    --bg: #121211;
    --bg-grid: transparent;
    --panel: #191918;
    --panel-2: #1f1f1e;
    --panel-hi: #262625;
    --border: rgba(255, 255, 255, 0.08);
    --border-hi: rgba(255, 255, 255, 0.14);
    --text: #ecebe8;
    --text-dim: #a3a19c;
    --text-faint: #75736f;
    --sidebar-bg: #151514;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
    --accent-glow: rgba(45, 212, 191, 0.22);
    --ink: #f2f1ed;
    --ink-fg: #141413;
    --ink-hover: #ffffff;
    --radius: 6px;
}
:root[data-theme="light"] {
    --bg: #fbfbfa;
    --bg-grid: transparent;
    --panel: #ffffff;
    --panel-2: #f7f6f3;
    --panel-hi: #f0efeb;
    --border: #eaeaea;
    --border-hi: #dcdcda;
    --text: #2f3437;
    --text-dim: #6b6a66;
    --text-faint: #9b9995;
    --sidebar-bg: #f7f6f3;
    --shadow: 0 8px 24px rgba(17, 17, 17, 0.07);
    --accent-glow: rgba(15, 158, 143, 0.18);
    --ink: #111111;
    --ink-fg: #ffffff;
    --ink-hover: #333333;
}

/* ---------- canvas ---------- */
body { background-image: none; background-color: var(--bg); }
.sidebar { background: var(--sidebar-bg); }
.topbar { background: color-mix(in srgb, var(--bg) 90%, transparent); }
.topbar-tag { visibility: hidden; }

/* ---------- brand ---------- */
.brand { font-family: var(--sans); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; }
.brand-mark { text-shadow: none; font-size: 13px; }
.brand-sub { display: none; }
.brand { margin-bottom: 18px; }

/* ---------- type: sentence case, sans; mono only for data ---------- */
h1 { font-family: var(--sans); font-weight: 600; font-size: 24px; letter-spacing: -0.015em; }
h2, h3 { font-family: var(--sans); letter-spacing: -0.005em; }
.panel h2, .section-title, .tab-group-title, .ue-step, .perm-group-title, .rm-ws-h, .rm-eff-h,
.ak-places th, .ak-target.head, .epd-chain-role, .dk-disk span, .ep-state, .epd-state, .rp-tag, .rm-flag, .lp-eyebrow {
    font-family: var(--sans);
    letter-spacing: 0;
    text-transform: none;
}
.panel h2, .section-title { font-size: 14px; font-weight: 600; color: var(--text); }
.tab-group-title, .ue-step, .perm-group-title { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.stat-label { font-size: 12.5px; letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.stat-sub { font-family: var(--sans); }
.nav-section { font-family: var(--sans); font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-faint); }
.fleet-table thead th { font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.donut-cap, .sev-pill-label { font-family: var(--sans); letter-spacing: 0; text-transform: none; }
.tag, .chip { font-family: var(--sans); letter-spacing: 0; font-size: 11.5px; }
.search-input, .input, .form input, .form select, .form textarea { font-family: var(--sans); }
.form label { font-family: var(--sans); font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--text-dim); }

/* ---------- buttons: solid ink primary, quiet secondary, no gradients / glows / lifts ---------- */
.btn-primary, .btn, .btn-ghost {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    border-radius: 6px;
    padding: 7px 14px;
    box-shadow: none;
    transition: background .15s, color .15s, border-color .15s, transform .1s;
}
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-primary, .btn.btn-primary, .btn.btn-primary:hover:not(:disabled),
:root[data-theme="light"] .btn-primary, :root[data-theme="light"] .btn.btn-primary {
    background: var(--ink);
    color: var(--ink-fg);
    border-color: var(--ink);
    box-shadow: none;
    filter: none;
}
.btn-primary:hover:not(:disabled), :root[data-theme="light"] .btn-primary:hover:not(:disabled) {
    background: var(--ink-hover); border-color: var(--ink-hover); transform: none; filter: none; text-decoration: none;
}
.btn-primary:active:not(:disabled), .btn:active:not(:disabled) { transform: scale(0.98); }
.btn { background: var(--panel); border-color: var(--border-hi); color: var(--text); }
.btn:hover:not(:disabled) { background: var(--panel-2); border-color: var(--border-hi); color: var(--text); }
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }
.btn-danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--border)); }
.btn-danger:hover:not(:disabled) { background: var(--red-bg); color: var(--red); border-color: var(--red); }

/* row actions inside tables: text buttons, so the data carries the row, not four boxes */
.fleet-table td .btn, .fleet-table td .btn-ghost, .fleet-table td .btn-danger {
    background: transparent; border-color: transparent; color: var(--text-dim); padding: 4px 8px;
}
.fleet-table td .btn:hover:not(:disabled) { background: var(--panel-2); color: var(--text); border-color: transparent; }
.fleet-table td .btn-danger { color: var(--red); }
.fleet-table td .btn-danger:hover:not(:disabled) { background: var(--red-bg); color: var(--red); border-color: transparent; }
.fleet-table td .btn-primary { background: var(--ink); color: var(--ink-fg); border-color: var(--ink); }

/* ---------- surfaces ---------- */
.stat::after { display: none; }
.stat { border-radius: 10px; }
.stat-ico { color: var(--text-faint); }
.panel { border-radius: 10px; }
.dot-ok, .dot-warn, .dot-critical { box-shadow: none; }
.nav-link.active { box-shadow: inset 2px 0 0 var(--accent); background: var(--panel-hi); color: var(--text); border-color: transparent; }
.nav-link.active .nav-glyph { color: var(--accent); opacity: 1; }
.search-input:focus, .input:focus { box-shadow: 0 0 0 3px var(--accent-glow); }

/* app.css styled every table's 2nd and 3rd column as grey mono, whatever it held (names, messages...). Undo that;
   real data cells opt in with .dim-mono / <code>. */
.fleet-table td:nth-child(2), .fleet-table td:nth-child(3) { font-family: inherit; color: inherit; font-size: inherit; }
.fleet-table a { font-family: var(--sans); font-weight: 600; }
.posture-chip, .posture-chip-n { font-family: var(--sans); letter-spacing: 0; }
.tag, .chip { white-space: nowrap; }
.app-footer-logo { font-family: var(--sans); font-weight: 600; letter-spacing: 0; }
/* detail-tab fact lists read like terminal output ("› OS: ..."): plain text rows instead */
.tab-body ul li { font-family: var(--sans); font-size: 13.5px; padding: 9px 14px; }
.tab-body ul li::before { content: none; }
.fleet-table td > a:first-child { white-space: nowrap; }

/* ---------- tables scroll inside their own box, not the page ----------
   Every .fleet-table is wrapped in .table-scroll: rows scroll vertically under a pinned header, and wide tables
   scroll sideways inside the box. The table itself must not be a scroll container (overflow: visible), or the
   sticky header would stick to the table instead of the box. */
.table-scroll {
    position: relative;
    max-height: min(68vh, 720px);
    overflow: auto;
    overscroll-behavior: contain;
    margin-top: 6px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--panel);
    scrollbar-width: thin;
    scrollbar-color: var(--border-hi) transparent;
}
.table-scroll > .fleet-table { margin: 0; border: 0; border-radius: 0; overflow: visible; background: transparent; }
.table-scroll > .fleet-table > thead th { position: sticky; top: 0; z-index: 2; background: var(--panel-2); box-shadow: inset 0 -1px 0 var(--border); }
.tab-body .table-scroll > .fleet-table { width: 100%; max-width: none; }
.table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* long non-table lists get the same treatment */
.dk-rows { max-height: min(60vh, 640px); overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* ---------- Server detail: Traffic tab ---------- */
.tr-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tr-head p { margin: 0; max-width: 70ch; }
.tr-site { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); padding: 16px 18px; margin-bottom: 14px; }
.tr-site.bad { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.tr-site-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; margin-bottom: 10px; }
.tr-site-head h3 { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.tr-kpis { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--text-dim); }
.tr-kpis b { font-family: var(--mono); font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.tr-kpis .crit b { color: var(--red); }
.tr-kpis .warnc b { color: var(--amber); }
.tr-split { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--panel-2); margin: 12px 0 6px; gap: 2px; }
.tr-split span { display: block; min-width: 2px; }
.tr-split .s2, .tr-legend .s2::before { background: var(--green); }
.tr-split .s3, .tr-legend .s3::before { background: var(--accent); }
.tr-split .s4, .tr-legend .s4::before { background: var(--amber); }
.tr-split .s5, .tr-legend .s5::before { background: var(--red); }
.tr-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tr-legend span::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.tr-tops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 14px; }
@media (max-width: 760px) { .tr-tops { grid-template-columns: 1fr; } }
.tr-tops h4 { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.tab-body .tr-tops ol { list-style: none; margin: 0; padding: 0; }
.tab-body .tr-tops li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; margin: 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none; font-size: 12.5px; }
.tab-body .tr-tops li:last-child { border-bottom: 0; }
.tr-tops code { background: none; border: 0; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.tr-tops li span { font-family: var(--mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tr-hint { max-width: 90ch; font-size: 12.5px; }
.tr-hint code { overflow-wrap: anywhere; }
.tr-logs { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }
.tr-logs summary { cursor: pointer; }
.tab-body .tr-logs ul { margin: 6px 0 0; }
.tab-body .tr-logs li { padding: 4px 0; border: 0; background: none; }

/* The top bar's backdrop blur makes it its own stacking context, which trapped the profile menu's z-index under
   later page content (dashboard cards). Lift the whole bar above the content. */
.topbar { position: relative; z-index: 40; }

/* ---- Site traffic dashboard (/servers/{id}/traffic?site=) ---- */
.st-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-bottom: 18px; }
.st-head h1 { margin: 4px 0 4px; font-size: 26px; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.st-head p { margin: 0; }
.st-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.st-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.st-kpis > div { background: var(--panel); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.st-kpis b { font-family: var(--mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-kpis b small { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.st-kpis span { font-size: 12px; color: var(--text-dim); }
.st-kpis .crit b { color: var(--red); }
.st-kpis .warnc b { color: var(--amber); }
.st-panel-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 10px; }
.st-panel-head h2, .st-grid h2 { margin: 0; font-size: 14px; font-weight: 600; }
.st-grid h2 { margin-bottom: 12px; }
.st-chart-panel { margin-bottom: 16px; }
.st-bars { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 180px; padding-top: 16px; border-bottom: 1px solid var(--border); }
.st-ymax { position: absolute; top: 0; left: 0; font-size: 11px; font-family: var(--mono); color: var(--text-faint, var(--text-dim)); }
.st-bar { flex: 1 1 0; min-width: 2px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; border-radius: 2px 2px 0 0; }
.st-bar:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.st-bar span { display: block; width: 100%; }
.st-bar .s2 { background: var(--green); } .st-bar .s3 { background: var(--accent); }
.st-bar .s4 { background: var(--amber); } .st-bar .s5 { background: var(--red); }
.st-axis { display: flex; justify-content: space-between; font-size: 11px; font-family: var(--mono); color: var(--text-dim); margin-top: 6px; }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.st-grid > .panel { margin: 0; min-width: 0; }
@media (max-width: 900px) { .st-grid { grid-template-columns: minmax(0, 1fr); } }
.st-ranked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.st-ranked li { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(60px, 1fr) auto 48px; align-items: center; gap: 10px; font-size: 13px; }
.st-ranked code, .st-key { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.st-ranked code { background: none; border: 0; padding: 0; }
.st-meter { height: 6px; border-radius: 3px; background: var(--panel-2); overflow: hidden; }
.st-meter span { display: block; height: 100%; border-radius: 3px; }
.st-meter .s2 { background: var(--green); } .st-meter .s3 { background: var(--accent); }
.st-meter .s4 { background: var(--amber); } .st-meter .s5 { background: var(--red); }
.st-num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
.st-pct { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--text-dim); font-size: 12px; }
.st-note { font-size: 12.5px; max-width: 90ch; margin: 10px 0 0; }
.st-skeleton { display: grid; gap: 14px; }
.st-skeleton span { display: block; height: 80px; border-radius: 10px; background: var(--panel-2); }
.st-skeleton span:first-child { height: 48px; width: 40%; }
.tr-site-head h3 a { color: inherit; text-decoration: none; }
.tr-site-head h3 a:hover { text-decoration: underline; }
.tr-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 500; }
.epd-visitors ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.epd-visitors h2 { margin: 0 0 4px; }
.epd-visitors p { margin: 0; }
/* ---- Website requests (/admin/leads) ---- */
.ld-filter { margin-bottom: 14px; }
.ld-filter .muted { margin-left: 4px; font-size: 11px; }
.fleet-table tr.ld-new td:first-child { box-shadow: inset 2px 0 0 var(--amber); }
.ld-detail td { background: var(--panel-2); }
.ld-msg { white-space: pre-wrap; margin: 4px 0 12px; max-width: 90ch; }
.ld-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ld-del { margin-left: auto; }

/* ---- Scan queue notifications (top bar bell) ---- */
.sn { position: relative; }
.sn-bell { position: relative; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--text-dim); }
.sn-bell:hover, .sn.open .sn-bell { color: var(--text); background: var(--panel-2); }
.sn-count, .sn-run { position: absolute; top: 2px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    font: 600 10px/16px var(--mono); text-align: center; color: #fff; background: var(--red); }
.sn-run { background: var(--accent); animation: sn-pulse 1.6s ease-in-out infinite; }
@keyframes sn-pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .sn-run { animation: none; } }
.sn-panel { position: absolute; right: 0; top: calc(100% + 8px); width: min(380px, 92vw); max-height: 70vh; overflow: auto; z-index: 60;
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 32px rgba(20, 18, 14, .12); }
.sn-head { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; }
.sn-head .muted { font-size: 12px; }
.sn-empty { padding: 14px; margin: 0; font-size: 13px; }
.sn-list { list-style: none; margin: 0; padding: 4px 0; }
.sn-item a { display: flex; gap: 10px; padding: 9px 14px; color: inherit; text-decoration: none; }
.sn-item a:hover { background: var(--panel-2); }
.sn-dot { flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--text-dim); }
.sn-succeeded .sn-dot { background: var(--green); }
.sn-partial .sn-dot { background: var(--amber); }
.sn-failed .sn-dot { background: var(--red); }
.sn-running .sn-dot, .sn-queued .sn-dot { background: var(--accent); }
.sn-running .sn-dot { animation: sn-pulse 1.2s ease-in-out infinite; }
.sn-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sn-title { font-size: 13px; font-weight: 500; }
.sn-item.unseen .sn-title { font-weight: 650; }
.sn-meta { font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* A blurred top bar becomes the containing block for fixed children, which pinned the scan toasts under it.
   Solid bar instead, so toasts sit bottom-right like everywhere else. */
.topbar { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
/* ---- Ingress sites (cluster page) ---- */
.ing-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; margin: 6px 0 12px; }
.ing-head p { margin: 0; max-width: 80ch; }
.ing-msg { margin: 0 0 10px; }
/* Top bar: bell, theme switch and account menu sit apart; the bell's badge stays inside its own button. */
.topbar-right { gap: 10px; }
.topbar-right .theme-toggle { margin: 0; }
.sn-bell { width: 36px; height: 34px; border: 1px solid var(--border); background: var(--panel); }
.sn-count, .sn-run { top: -6px; right: -6px; box-shadow: 0 0 0 2px var(--bg); }
.sn-head { flex-direction: row !important; align-items: center; justify-content: space-between; gap: 10px; }
.sn-head > div { display: flex; flex-direction: column; gap: 2px; }
/* ---- Kubernetes: update image dialog ---- */
.k8s-image input { font-family: var(--mono); }
.k8s-imgdiff { display: grid; gap: 6px; margin: 10px 0; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }
.k8s-imgdiff > div { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; align-items: baseline; }
.k8s-imgdiff code { background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.k8s-imgdiff code.bad { color: var(--red); }
/* ---- Kubernetes: ConfigMaps & Secrets ---- */
.kc-note { margin: 4px 0 12px; font-size: 12.5px; }
.kc-modal { width: min(760px, 94vw); max-height: 86vh; overflow: auto; }
.kc-pw { display: flex; gap: 8px; margin: 10px 0; }
.kc-values { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.kc-kv { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--panel-2); }
.kc-key { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.kc-val, .kc-diff pre { margin: 0; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: 12.5px/1.5 var(--mono); }
.kc-edit { width: 100%; font: 12.5px/1.5 var(--mono); }
.kc-diff { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 10px; margin: 8px 0; }
.kc-actions { display: flex; gap: 8px; margin-top: 8px; }
.kc-restart { margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--border)); }
.kc-restart p { margin: 0 0 8px; }
.k8s-quota { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; }
/* ---- Row action menus ("Actions ▾") ---- */
.row-menu-toggle { white-space: nowrap; }
.row-menu[open] > .row-menu-toggle { background: var(--panel-2); }
.row-menu-items { z-index: 70; max-height: 70vh; overflow: auto; }
.row-menu-items > [hidden] { display: none !important; }
.row-menu-items > .btn, .row-menu-items > .btn-sm, .row-menu-items > .btn-primary, .row-menu-items > .btn-danger, .row-menu-items > .btn-ghost {
    display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 6px; background: none; box-shadow: none;
    text-align: left; color: var(--text); font: inherit; font-size: 13px; font-weight: 400; height: auto; min-height: 0; transform: none;
}
.row-menu-items > .btn:hover:not(:disabled), .row-menu-items > a:hover { background: var(--panel-2); color: var(--accent); }
.row-menu-items > .btn-danger { color: var(--red); }
.row-menu-items > .btn-danger:hover:not(:disabled) { background: var(--red-bg); color: var(--red); }
.row-menu-items > .btn:disabled { opacity: .45; cursor: not-allowed; }
.row-menu-items > hr { border: 0; border-top: 1px solid var(--border); margin: 4px 2px; }
.fleet-table td.row-actions .row-menu { display: inline-block; }
.k8s-image { display: block; width: 100%; }
.k8s-image input { width: 100%; min-width: 0; }
/* Wide dialog for forms (Update image) */
.modal.modal-wide { width: min(760px, 94vw); max-width: 760px; }
.modal-wide .modal-body { padding: 20px 24px 22px; min-height: 340px; }
.modal-wide .modal-body p { margin: 0 0 10px; }
.modal-wide .k8s-scale { display: block; margin: 0 0 14px; font-weight: 500; }
.modal-wide .k8s-scale select, .modal-wide .k8s-scale input { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font-size: 14px; }
.modal-wide .k8s-imgdiff { padding: 14px 16px; margin: 14px 0; gap: 10px; }
.modal-wide .k8s-imgdiff > div { grid-template-columns: 64px minmax(0, 1fr); }
.modal-wide .k8s-imgdiff code { font-size: 13px; }
.k8s-imghist { font-size: 12.5px; }
.k8s-imghistory { margin: 14px 0 10px; border-top: 1px solid var(--border); padding-top: 12px; }
.k8s-imghistory h4 { margin: 0 0 8px; font-size: 13px; }
.k8s-imghistory ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.k8s-imghistory li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; }
.k8s-imghistory li code { background: none; border: 0; padding: 0; overflow-wrap: anywhere; }
.k8s-imghistory li.failed { opacity: .7; }
.k8s-imghistory li .btn { margin-left: auto; }
.k8s-histnote { margin: 4px 0 12px; font-size: 12.5px; }
/* ---- Live rollout progress ---- */
.ro { border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border)); border-radius: 10px; background: var(--panel); padding: 14px 16px; margin: 0 0 14px; }
.ro.done { border-color: color-mix(in srgb, var(--green) 45%, var(--border)); }
.ro.stuck { border-color: color-mix(in srgb, var(--red) 45%, var(--border)); }
.ro-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ro-head h3 { margin: 2px 0 0; font-size: 15px; }
.ro-head h3 code { background: none; border: 0; padding: 0; }
.ro-kicker { font: 600 11px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.ro.done .ro-kicker { color: var(--green); }
.ro.stuck .ro-kicker { color: var(--red); }
.ro-head-right { display: flex; align-items: center; gap: 10px; }
.ro-live { font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.ro-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: sn-pulse 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .ro-dot { animation: none; } }
.ro-counts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 12px 0 10px; }
.ro-counts > div { display: flex; flex-direction: column; gap: 2px; }
.ro-counts b { font: 600 18px/1.1 var(--mono); font-variant-numeric: tabular-nums; }
.ro-counts .ro-big b { font-size: 26px; }
.ro-counts span { font-size: 12px; color: var(--text-dim); }
.ro-bar { display: flex; height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.ro-bar span { display: block; height: 100%; transition: width .6s ease; }
.ro-upd { background: var(--green); }
.ro-pend { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.ro-msg { margin: 8px 0 0; font-size: 13px; }
.ro-pods { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow: auto; }
.ro-pods li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; }
.ro-pods li.old { opacity: .7; }
.ro-pods code { background: none; border: 0; padding: 0; }
.ro-pods .ro-problem { flex-basis: 100%; padding-left: 4px; color: var(--red); font-size: 12px; overflow-wrap: anywhere; }
.ro-banner { margin: 10px 0 0; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--red) 8%, transparent); font-size: 13px; overflow-wrap: anywhere; }
.ro-banner code { background: none; border: 0; padding: 0; }
.ro-log { margin: 10px 0 0; font-size: 12.5px; }
.ro-log summary { cursor: pointer; color: var(--text-dim); }
.ro-log pre { margin: 6px 0 0; padding: 8px 10px; max-height: 260px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
    font: 12px/1.45 var(--mono); background: var(--panel-2); border: 1px solid var(--border); border-radius: 6px; }
.k8s-bulk-detail { overflow-wrap: anywhere; }
/* Kubernetes dialogs (rollout, image history) */
.k8s-dialog { max-height: 88vh; overflow: auto; }
.k8s-dialog .ro { border: 0; margin: 0; padding: 18px 22px; background: none; }
.k8s-dialog .modal-head h2 code { background: none; border: 0; padding: 0; font-size: .9em; }
.k8s-dialog .modal-body { min-height: 0; }
.k8s-now { display: inline-block; margin: 2px 6px 0 0; }
.ro-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ro-actions .muted { font-size: 12.5px; }
/* Top bar: bell and theme switch are the same 34×34 square button; the count sits on the bell's corner, inside the bar. */
.topbar-right .sn-bell, .topbar-right .theme-toggle {
    width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center;
    border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text-dim); line-height: 1; font-size: 15px;
}
.topbar-right .sn-bell:hover, .topbar-right .theme-toggle:hover, .sn.open .sn-bell { color: var(--text); border-color: var(--border-hi); background: var(--panel-2); }
.topbar-right .sn-bell svg { width: 16px; height: 16px; }
.sn-count, .sn-run { top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px; font: 600 10px/16px var(--sans); border-radius: 8px; box-shadow: 0 0 0 2px var(--bg); }
.chip.chip-roll { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
/* ---- Deploy a build / build suggestions ---- */
.k8s-deploy-btn { margin-left: auto; }
.k8s-builds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 12px; font-size: 12.5px; }
.chip.k8s-build { cursor: pointer; font-family: var(--mono); background: var(--panel-2); border: 1px solid var(--border); color: var(--text); }
.chip.k8s-build:hover, .chip.k8s-build.on { border-color: var(--accent); color: var(--accent); }
.k8s-bulk-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 6px 0; }
.k8s-bulk { list-style: none; margin: 0 0 12px; padding: 0; max-height: 46vh; overflow: auto; border: 1px solid var(--border); border-radius: 8px; }
.k8s-bulk li { padding: 8px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.k8s-bulk li:last-child { border-bottom: 0; }
.k8s-bulk label { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.k8s-bulk-diff { font-size: 12px; padding-left: 24px; overflow-wrap: anywhere; }
.k8s-bulk-diff code { background: none; border: 0; padding: 0; }
.k8s-dialog .ro + .ro { border-top: 1px solid var(--border); }
.k8s-bulk-opts { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 24px; margin: 4px 0 8px; }
.k8s-bulk-opts label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.k8s-bulk-opts label.k8s-check { flex-direction: row; align-items: center; font-weight: 400; }
.k8s-bulk-opts select { width: 160px; }
.k8s-bulk-note { font-size: 12.5px; margin: 0 0 8px; }
.k8s-bulk-run { margin-top: 10px; }
.k8s-bulk-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; }
.k8s-bulk-line .btn { margin-left: auto; }
.seg.k8s-inner-tabs { margin: 4px 0 12px; }
.kc-tabs { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.kc-create { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0 0 14px; background: var(--panel-2); display: flex; flex-direction: column; gap: 10px; }
.kc-create-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kc-create label, .kc-addkey label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; }
.kc-key-actions { display: inline-flex; align-items: center; gap: 6px; }
.kc-addkey { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* ---------- Forms: styled selects, inline hints (label layout lives with the base .form rules in app.css) ---------- */
.form label > .muted { font-weight: 400; font-size: 12px; }
/* Long option text (e.g. a key fingerprint and its servers) is cut with an ellipsis instead of widening the form. */
.form select:not(.input-sm) {
    max-width: 100%; min-width: 0;
    font-size: 13px; color: var(--text);
    background-color: var(--bg);
    border: 1px solid var(--border-hi); border-radius: var(--radius);
    padding: 10px 34px 10px 12px;
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238a8f98' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    text-overflow: ellipsis; cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form select:not(.input-sm):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.form select:not(.input-sm):disabled { opacity: .6; cursor: not-allowed; }
.form .form-hint { margin: -8px 0 0; font-size: 12.5px; line-height: 1.5; }
.modal-foot { align-items: center; }
@media (max-width: 640px) {
    .form .form-row { flex-wrap: wrap; }
    .form .form-row > label { flex: 1 1 100%; }
}
/* Add / Edit server: wide enough for host + port + user on one row and a readable key box. */
.modal.modal-server { max-width: 760px; }
.modal-server .form-row > label { flex: 1 1 0; }
.modal-server .form-row > label.grow { flex: 1.6 1 0; }
.modal-server .form-row > label.port { flex: 0 0 110px; }
.modal-server textarea { font-family: var(--mono); font-size: 12px; min-height: 130px; }

/* Partners (admin) */
.pt-form { margin-bottom: 16px; }
.pt-form label { display: flex; flex-direction: column; gap: 4px; }
.pt-form .field-error, .ld-detail .field-error { font-size: 12px; color: var(--red); }
.pt-totals { margin-bottom: 14px; }
.pt-link { min-width: 260px; font-family: var(--mono, monospace); font-size: 12px; }
.pt-actions { white-space: nowrap; }
.pt-help { margin-top: 10px; font-size: 12.5px; }
.ld-deal { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border-hi); }
