/* Site Pulse — same design language as VaultPulse: clean, calm, functional */

:root {
  --bg: #f6f6f4;
  --surface: #ffffff;
  --surface-2: #f9f9f8;
  --hover: #f2f2f0;
  --border: #e7e7e3;
  --border-strong: #d6d6d1;
  --text: #18181a;
  --text-2: #55565b;
  --muted: #8a8b90;
  --accent: #ed3057;
  --accent-hover: #d41f46;
  --accent-soft: #fdecf0;
  --ok: #1d8a4e;
  --ok-soft: #e8f5ee;
  --busy: #b25e09;
  --busy-soft: #fdf1e3;
  --danger: #c93b3b;
  --danger-soft: #fcebeb;
  --info: #1f6feb;
  --info-soft: #e8f0fd;
  --violet: #6b4fd8;
  --violet-soft: #efebfc;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 1px 1px rgba(20, 20, 30, .03);
  --shadow-lg: 0 12px 40px rgba(20, 20, 30, .16), 0 2px 8px rgba(20, 20, 30, .06);
  --radius: 10px;
  --radius-sm: 7px;
  --font: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --side-w: 232px;
  /* team colours */
  --p-pt: #ed3057; --p-emma: #c98a1b; --p-justin: #1d8a4e; --p-bret: #1f6feb; --p-rich: #7c4fd8; --p-other: #8a8b90;
  /* server colours */
  --s-tzcom: #c98a1b; --s-nofrills: #1f6feb; --s-tzinfo: #d4b106; --s-hosting: #e8590c; --s-clientnf: #0b9aa8;
  --s-clienthosted: #8a8b90; --s-tiger: #7c4fd8; --s-coolify: #6b4fd8; --s-none: #d6d6d1;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111214; --surface: #18191c; --surface-2: #1d1e22; --hover: #222327; --border: #2a2b30; --border-strong: #37383e;
    --text: #ececee; --text-2: #b4b5ba; --muted: #85868c; --accent: #ed3057; --accent-hover: #f24d70; --accent-soft: #3a1720;
    --ok: #4cc987; --ok-soft: #16291f; --busy: #f0a24a; --busy-soft: #2d2215; --danger: #f07070; --danger-soft: #331b1d;
    --info: #5c9dff; --info-soft: #172338; --violet: #a996ff; --violet-soft: #241e3a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
    --p-pt: #f25a7a; --p-emma: #e0a948; --p-justin: #4cc987; --p-bret: #5c9dff; --p-rich: #a996ff;
    --s-tzcom: #e0a948; --s-nofrills: #5c9dff; --s-tzinfo: #e8cc3a; --s-hosting: #ff8c42; --s-clientnf: #3cc3cf;
    --s-tiger: #a996ff; --s-coolify: #a996ff; --s-none: #37383e;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111214; --surface: #18191c; --surface-2: #1d1e22; --hover: #222327; --border: #2a2b30; --border-strong: #37383e;
  --text: #ececee; --text-2: #b4b5ba; --muted: #85868c; --accent: #ed3057; --accent-hover: #f24d70; --accent-soft: #3a1720;
  --ok: #4cc987; --ok-soft: #16291f; --busy: #f0a24a; --busy-soft: #2d2215; --danger: #f07070; --danger-soft: #331b1d;
  --info: #5c9dff; --info-soft: #172338; --violet: #a996ff; --violet-soft: #241e3a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 16px 48px rgba(0, 0, 0, .55);
  --p-pt: #f25a7a; --p-emma: #e0a948; --p-justin: #4cc987; --p-bret: #5c9dff; --p-rich: #a996ff;
  --s-tzcom: #e0a948; --s-nofrills: #5c9dff; --s-tzinfo: #e8cc3a; --s-hosting: #ff8c42; --s-clientnf: #3cc3cf;
  --s-tiger: #a996ff; --s-coolify: #a996ff; --s-none: #37383e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- boot / auth ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--border-strong); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 32px 28px 28px; box-shadow: var(--shadow); }
.auth-card .brand { margin-bottom: 22px; }
.auth-logo { display: block; margin: 0 0 22px; }
.auth-logo img { width: 225px; height: auto; margin: -22px auto -21px; display: block; }
.auth-card h1 { font-size: 18px; margin: 0 0 4px; }
.auth-card p.sub { color: var(--text-2); margin: 0 0 20px; }
.auth-card .btn.primary { width: 100%; justify-content: center; margin-top: 18px; height: 40px; }
.auth-err { color: var(--danger); font-size: 13px; min-height: 19px; margin-top: 10px; }
.auth-logo .logo-dark { display: block; }
.auth-logo .logo-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-logo .logo-dark { display: none; }
  :root:not([data-theme="light"]) .auth-logo .logo-light { display: block; }
}
:root[data-theme="dark"] .auth-logo .logo-dark { display: none; }
:root[data-theme="dark"] .auth-logo .logo-light { display: block; }
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 6px; }
.role-btn { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px 11px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 560; font-size: 13px; transition: border-color .12s, background .12s; }
.role-btn:hover { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 15px; letter-spacing: -.01em; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.brand small { font-weight: 450; color: var(--muted); font-size: 12px; margin-left: 2px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.topbar-inner { padding: 0 20px; height: 56px; display: flex; align-items: center; gap: 12px; }
.topbar .spacer { flex: 1; }
.preview-badge { font-size: 11.5px; font-weight: 600; color: var(--busy); background: var(--busy-soft); padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 650; color: #fff; flex: none; background: var(--p-other); }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }
.avatar.lg { width: 40px; height: 40px; font-size: 14px; }
.avatar.none { background: transparent; border: 1.5px dashed var(--border-strong); }
.av-PT { background: var(--p-pt); } .av-Emma { background: var(--p-emma); } .av-Justin { background: var(--p-justin); }
.av-Bret { background: var(--p-bret); } .av-Rich { background: var(--p-rich); }
.user-btn { display: flex; align-items: center; gap: 8px; background: none; border: 1px solid transparent; border-radius: 99px; padding: 3px 10px 3px 3px; cursor: pointer; }
.user-btn:hover { background: var(--hover); }
.updated { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - 57px); }
.side { position: sticky; top: 57px; height: calc(100vh - 57px); overflow-y: auto; border-right: 1px solid var(--border); padding: 16px 12px 24px; }
.side-group + .side-group { margin-top: 18px; }
.side-title { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); font-size: 13.5px; font-weight: 520; text-align: left; text-decoration: none; }
.nav-item:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--border), var(--shadow); }
.nav-item[aria-current="page"] .i { color: var(--accent); }
.nav-item .n { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.nav-item .ext { margin-left: auto; width: 13px; height: 13px; color: var(--muted); }
.main { padding: 26px 28px 80px; min-width: 0; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head h1 { font-size: 22px; letter-spacing: -.02em; margin: 0; }
.page-head .count { color: var(--muted); font-weight: 500; margin-left: 6px; font-size: 15px; }
.page-head .spacer { flex: 1; }
.page-sub { color: var(--text-2); margin: -12px 0 18px; font-size: 13.5px; }

/* ---------- stat cards ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .12s, background .12s; min-width: 0; }
.stat:hover { border-color: var(--border-strong); }
.stat[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.stat .lbl { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); font-weight: 540; }
.stat .lbl .i { width: 15px; height: 15px; color: var(--muted); }
.stat .val { font-size: 26px; font-weight: 680; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .foot { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.warn .val { color: var(--danger); }
.stat.amber .val { color: var(--busy); }

.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; margin-bottom: 20px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); min-width: 0; }
.panel-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.panel-title .spacer { flex: 1; }
.panel-title .linkish { text-transform: none; letter-spacing: 0; font-weight: 540; font-size: 12px; }
.bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--hover); gap: 2px; }
.bar > span { display: block; height: 100%; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-top: 12px; }
.leg { display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; background: none; border-radius: 99px; padding: 3px 9px 3px 7px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.leg:hover { background: var(--hover); color: var(--text); }
.leg[aria-pressed="true"] { border-color: var(--border-strong); background: var(--hover); color: var(--text); font-weight: 560; }
.leg .sw { width: 8px; height: 8px; border-radius: 50%; }
.leg b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.team { display: flex; flex-wrap: wrap; gap: 6px; }
.person { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 99px; padding: 3px 11px 3px 3px; cursor: pointer; font-size: 13px; }
.person:hover { border-color: var(--border-strong); background: var(--surface-2); }
.person[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.person b { font-weight: 650; font-variant-numeric: tabular-nums; }
.person .nm { color: var(--text-2); }
.linkish { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.linkish:hover { text-decoration: underline; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.search { position: relative; display: block; flex: 1 1 240px; max-width: 360px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input[type=search] { width: 100%; height: 34px; padding: 0 34px 0 34px; }
.search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); }
kbd { font: 11px var(--mono); color: var(--muted); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; background: var(--surface); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: none; padding: 5px 11px; border-radius: 5px; cursor: pointer; color: var(--text-2); font-size: 13px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--hover); color: var(--text); font-weight: 560; box-shadow: inset 0 0 0 1px var(--border); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.filters select { width: auto; height: 30px; font-size: 12.5px; padding: 0 28px 0 10px; color: var(--text-2); }
.filters select.on { color: var(--text); border-color: var(--accent); background-color: var(--accent-soft); }
.filters .clear { font-size: 12.5px; }
.result-n { font-size: 12.5px; color: var(--muted); margin-left: auto; }

/* ---------- controls ---------- */
input[type=text], input[type=password], input[type=search], select {
  width: 100%; height: 38px; padding: 0 11px; background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); outline: none; transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field label { display: block; font-size: 12.5px; font-weight: 560; color: var(--text-2); margin-bottom: 5px; }
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-weight: 540; font-size: 13.5px; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; color: var(--text); }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.spin .i { animation: spin .8s linear infinite; }

/* ---------- table ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: auto; max-height: calc(100vh - 140px); }
table.grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; font-size: 11.5px; font-weight: 620; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
.grid th.sortable { cursor: pointer; }
.grid th.sortable:hover { color: var(--text); }
.grid th .arr { display: inline-block; width: 10px; margin-left: 3px; color: var(--accent); }
.grid td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; white-space: nowrap; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid tbody tr.click { cursor: pointer; }
.grid tbody tr.click:hover td { background: var(--surface-2); }
.grid tbody tr.sel td { background: var(--accent-soft); }
.grid th:first-child, .grid td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.grid th:first-child { z-index: 3; background: var(--surface-2); }
.grid tbody tr.click:hover td:first-child { background: var(--surface-2); }
.grid tbody tr.sel td:first-child { background: var(--accent-soft); }
.grid td.wrap { white-space: normal; min-width: 220px; max-width: 360px; }
.site { display: flex; align-items: center; gap: 10px; min-width: 210px; max-width: 320px; }
.site .hd { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ok); }
.site .hd.warn { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.site .hd.amber { background: var(--busy); }
.site .hd.none { background: var(--border-strong); }
.site-txt { min-width: 0; }
.site-txt b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.site-txt span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.note { color: var(--text-2); max-width: 300px; overflow: hidden; text-overflow: ellipsis; display: block; }
.dash { color: var(--muted); }
.empty-row td { padding: 40px 12px; text-align: center; color: var(--muted); }

/* pills & tags */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 560; padding: 2px 9px 2px 8px; border-radius: 99px; white-space: nowrap; color: var(--text-2); background: var(--hover); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); }
.pill.busy { color: var(--busy); background: var(--busy-soft); }
.pill.danger { color: var(--danger); background: var(--danger-soft); }
.pill.info { color: var(--info); background: var(--info-soft); }
.pill.violet { color: var(--violet); background: var(--violet-soft); }
.pill.none { color: var(--muted); background: var(--hover); }
.pill.plain::before { display: none; }
.srv { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.srv .sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.vtag { font: 600 12px/1 var(--mono); padding: 4px 6px; border-radius: 5px; background: var(--hover); color: var(--text-2); display: inline-block; }
.vtag.old { background: var(--danger-soft); color: var(--danger); }
.who { display: inline-flex; align-items: center; gap: 7px; }
.who .nm { color: var(--text-2); }
.date { display: inline-flex; flex-direction: column; line-height: 1.25; font-variant-numeric: tabular-nums; }
.date small { font-size: 11.5px; color: var(--muted); }
.date.ok b { color: var(--ok); font-weight: 560; }
.date.amber b { color: var(--busy); font-weight: 560; }
.date.warn b { color: var(--danger); font-weight: 600; }
.date b { font-weight: 500; }
.ico-ok { color: var(--ok); }
.ico-off { color: var(--border-strong); }
.flag { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 5px; }
.flag.on { color: var(--s-hosting); background: color-mix(in srgb, var(--s-hosting) 14%, transparent); }
.flag.on.redir { color: var(--info); background: var(--info-soft); }
.flag .i { width: 13px; height: 13px; }

/* ---------- drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; z-index: 40; background: rgba(15, 15, 20, .28); animation: fade .15s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(460px, 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.drawer-head { padding: 18px 18px 14px 20px; border-bottom: 1px solid var(--border); }
.drawer-head .top { display: flex; align-items: flex-start; gap: 10px; }
.drawer-head h2 { font-size: 18px; margin: 0; letter-spacing: -.015em; flex: 1; overflow-wrap: anywhere; }
.drawer-head .host { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.drawer-head .acts { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.drawer-body { padding: 4px 20px 24px; overflow-y: auto; flex: 1; }
.sec-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; display: flex; align-items: center; gap: 8px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.kv > div { padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--border); min-height: 38px; display: flex; align-items: center; }
.kv > div:nth-child(-n+2) { border-top: 0; }
.kv .k { color: var(--muted); background: var(--surface-2); }
.notes-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; color: var(--text-2); white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); }
.notice { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; background: var(--busy-soft); color: var(--busy); }
.notice.info { background: var(--accent-soft); color: var(--accent); }
.notice .i { margin-top: 2px; }
.drawer-foot { padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }

/* ---------- AI SEO pipeline ---------- */
.prog { display: flex; flex-direction: column; }
.prog-row { display: grid; grid-template-columns: minmax(180px, 1.2fr) 110px minmax(260px, 2fr) 120px 230px; gap: 16px; align-items: center; padding: 13px 16px; }
.prog-row + .prog-row { border-top: 1px solid var(--border); }
.prog-row.head { padding-top: 9px; padding-bottom: 9px; background: var(--surface-2); font-size: 11.5px; font-weight: 620; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.prog-name b { display: block; font-weight: 600; }
.prog-name span { font-size: 12px; color: var(--muted); }
.prog-name span.wait { color: var(--busy); font-weight: 560; }
.steps { display: flex; gap: 3px; }
.steps i { flex: 1; height: 8px; border-radius: 3px; background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); position: relative; }
.steps i.done { background: var(--ok); box-shadow: none; }
.steps i.in_progress { background: var(--info); box-shadow: none; }
.steps i.waiting { background: var(--busy); box-shadow: none; }
.steps i.cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.steps-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 5px; }
.links { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.key { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0 0 12px; }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 14px; height: 8px; border-radius: 3px; display: inline-block; background: var(--hover); box-shadow: inset 0 0 0 1px var(--border); }
.key i.done { background: var(--ok); box-shadow: none; } .key i.in_progress { background: var(--info); box-shadow: none; } .key i.waiting { background: var(--busy); box-shadow: none; }
.stepbar { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.stepbar .st { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 12.5px; color: var(--text-2); }
.stepbar .st b { display: block; font-size: 18px; color: var(--text); font-weight: 660; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 56px 20px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-2); }
.skeleton { height: 46px; border-top: 1px solid var(--border); background: linear-gradient(90deg, transparent, var(--hover), transparent); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.menu { position: fixed; z-index: 60; min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 4px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 9px; background: none; border: 0; padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 13.5px; text-align: left; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--hover); text-decoration: none; }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 4px 0; }
.menu .menu-head { padding: 8px 10px 6px; font-size: 12.5px; color: var(--muted); }
.menu .menu-head b { display: block; color: var(--text); font-size: 13.5px; }
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; width: 100%; background: var(--text); color: var(--bg); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: up .18s ease-out; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes up { from { transform: translateY(8px); opacity: 0; } }
.tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.mob-nav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .prog-row { grid-template-columns: minmax(160px, 1fr) minmax(200px, 2fr) 200px; }
  .prog-row > .c-who, .prog-row > .c-date { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .mob-nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 57px; z-index: 25; background: var(--bg); }
  .mob-nav .nav-item { width: auto; white-space: nowrap; flex: none; }
  .mob-nav .nav-item .n { margin-left: 4px; }
  .main { padding: 18px 16px 80px; }
  .topbar-inner { padding: 0 16px; }
  .updated, .user-btn .nm, .topbar .brand small, .search kbd, .preview-badge .long { display: none; }
  .table-wrap { max-height: none; }
  .search { max-width: none; }
}
@media (max-width: 520px) {
  .stats { gap: 8px; }
  .stat { padding: 11px 12px; }
  .stat .val { font-size: 22px; }
  .prog-row { grid-template-columns: 1fr; gap: 8px; }
  .prog-row.head { display: none; }
  .links { justify-content: flex-start; }
  .kv { grid-template-columns: 112px minmax(0, 1fr); }
}

.toolbar select { width: auto; max-width: 260px; height: 34px; }
.grid td .who { vertical-align: middle; }
.seg .n { color: var(--muted); font-weight: 450; margin-left: 4px; }

/* ---------- card view ---------- */
.seg-icons button { display: grid; place-items: center; padding: 5px 8px; }
.seg-icons .i { width: 16px; height: 16px; }
.table-wrap.as-cards { background: none; border: 0; box-shadow: none; overflow: visible; max-height: none; border-radius: 0; }
.card-sort { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.card-sort select { width: auto; height: 28px; font-size: 12.5px; padding: 0 26px 0 9px; }
.card-sort .btn.icon { width: 28px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); outline: none; }
.card.click { cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.card.click:hover, .card.click:focus-visible { border-color: var(--border-strong); box-shadow: var(--shadow), inset 0 0 0 1px var(--border-strong); }
.card.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card-head .site { max-width: none; min-width: 0; }
.card-head .site-txt b { font-size: 14.5px; }
.card-chips { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 12.5px; }
.card-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12.5px; align-items: center; }
.card-kv dt { color: var(--muted); }
.card-kv dd { margin: 0; text-align: right; }
.card-kv .date { flex-direction: row; align-items: baseline; gap: 6px; }
.card-kv .date small { order: -1; }
.card-note .note { max-width: none; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12.5px; }
.card-foot { display: flex; gap: 6px; margin-top: auto; padding-top: 2px; }
@media (max-width: 520px) { .cards { grid-template-columns: 1fr; gap: 10px; } }
