/* ==========================================================================
   Sentrix - "Navy & Sand" theme (minimalist, professional).
   ALL brand colours are the variables below; change them and the whole site follows.
   ========================================================================== */
:root {
  /* brand */
  --brand: #14213d;          /* navy - primary buttons, links, active tab */
  --brand-600: #0d1730;      /* hover */
  --brand-50: #e9edf5;       /* light navy tint */
  --accent: #b4532a;         /* terracotta - highlights, detections */
  --accent-50: #f6e7dd;
  --sand: #e9c9a8;           /* logo / small highlights on navy */

  /* sidebar */
  --side: #14213d;
  --side-2: #22335a;
  --side-text: #d5d9e3;
  --side-muted: #8e97ad;

  /* neutrals */
  --bg: #f6f3ee;             /* warm sand page background */
  --surface: #ffffff;
  --surface-2: #fbf9f6;
  --line: #e7e1d6;
  --line-2: #f1ece4;
  --line-strong: #d9d1c3;    /* input borders, hover borders */
  --text: #1b2338;
  --muted: #5b6474;

  /* status */
  --ok: #1d4e89;   --ok-50: #e8f1fb;      /* online = blue */
  --bad: #b42318;  --bad-50: #fdecea;     /* offline / errors = red */
  --info: #3b5b92; --info-50: #ebf0f8;
  --focus: rgba(20, 33, 61, .18);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 33, 61, .04), 0 1px 3px rgba(20, 33, 61, .04);
  --shadow-lg: 0 10px 30px rgba(20, 33, 61, .10);
  --font: "Plus Jakarta Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --side-w: 248px;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: hidden; }
body { background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -.015em; }
h2 { font-size: 1rem; margin: 0; font-weight: 650; }
h3 { font-size: .9rem; margin: 0 0 .3rem; font-weight: 650; }
p { margin: .3rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.mono { font-family: var(--mono); font-size: .86em; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mt { margin-top: 1rem; } .mt-sm { margin-top: .5rem; } .mb { margin-bottom: 1rem; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.i.fill { fill: currentColor; stroke: none; }

/* ---------------- app shell: sidebar + content ---------------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-brand { display: flex; align-items: center; gap: .7rem; padding: 1.2rem 1.2rem 1.1rem; color: #fff; font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.side-brand:hover { text-decoration: none; }
.side-brand img { width: 34px; height: 34px; }
.side-brand small { display: block; color: var(--side-muted); font-weight: 500; font-size: .72rem; letter-spacing: .02em; }
.side-nav { padding: .4rem .75rem; display: grid; gap: .15rem; }
.side-label { color: var(--side-muted); font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 1rem .6rem .35rem; }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--radius-sm); color: var(--side-text); font-weight: 500; font-size: .92rem; }
.side-nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.side-nav a.active { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--sand); }
.side-nav a .i { opacity: .9; }
.side-foot { margin-top: auto; padding: .9rem; border-top: 1px solid rgba(255, 255, 255, .07); }
.side-user { display: flex; align-items: center; gap: .65rem; padding: .5rem; border-radius: var(--radius-sm); color: var(--side-text); }
.side-user:hover { background: var(--side-2); text-decoration: none; }
.side-user b { display: block; color: #fff; font-weight: 600; font-size: .88rem; line-height: 1.2; }
.side-user small { color: var(--side-muted); font-size: .75rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .82rem; background: var(--side-2); color: #fff; flex: none; }
.side-foot form { margin: .4rem 0 0; }
.side-foot .btn { width: 100%; justify-content: flex-start; background: transparent; border-color: transparent; color: var(--side-muted); }
.side-foot .btn:hover { color: #fff; background: var(--side-2); box-shadow: none; }

.mobilebar { display: none; }
.scrim { display: none; }
.content { padding: 1.7rem clamp(1rem, 3vw, 2.4rem) 4rem; max-width: 1280px; width: 100%; }

/* ---------------- page header ---------------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head p { margin: .25rem 0 0; color: var(--muted); }
.crumb { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-size: .85rem; font-weight: 500; margin-bottom: .6rem; }
.crumb:hover { color: var(--text); text-decoration: none; }

/* ---------------- cards ---------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 1.15rem 1.25rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .9rem 1.25rem; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.card-head p { margin: .1rem 0 0; }
.card + .card, .card + .grid-2, .grid-2 + .card { margin-top: 1rem; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.stack { display: grid; gap: 1rem; }
.divider { height: 1px; background: var(--line-2); border: 0; margin: 1rem 0; }

/* ---------------- buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem .95rem; border-radius: var(--radius-sm);
       border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer;
       transition: background .12s, border-color .12s, box-shadow .12s; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--line-strong); background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(.95); background: var(--accent); }
.btn-danger { color: var(--bad); border-color: #efc9c5; }
.btn-danger:hover { background: var(--bad-50); border-color: #e5aea8; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--line-2); }
.btn-sm { padding: .34rem .65rem; font-size: .82rem; }
.btn-lg { padding: .72rem 1.25rem; font-size: .98rem; }
.btn-block { width: 100%; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.btn-group form { margin: 0; }

/* ---------------- forms ---------------- */
.form { display: grid; gap: 1rem; }
.form label, .field { display: grid; gap: .35rem; font-weight: 600; font-size: .86rem; }
.form label.check, label.check { display: flex; align-items: center; gap: .55rem; font-weight: 500; }
.hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
input, select, textarea { width: 100%; font: inherit; font-size: .93rem; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .58rem .75rem; transition: border-color .12s, box-shadow .12s; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--focus); }
input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--surface) inset; -webkit-text-fill-color: var(--text); }
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 4rem; }
.pw-toggle { position: absolute; right: .4rem; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; padding: .3rem .5rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: .9rem; }
legend { font-weight: 650; font-size: .95rem; padding: 0; margin-bottom: .2rem; }
.form-actions { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.choice label { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .7rem .8rem; cursor: pointer; display: flex; gap: .6rem; align-items: flex-start; font-weight: 600; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.choice label span small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.checklist { max-height: 300px; overflow: auto; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.checklist label { padding: .55rem .75rem; border-bottom: 1px solid var(--line-2); font-weight: 500 !important; }
.checklist label:last-child { border-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: end; }
.filters input[type=search] { flex: 1; min-width: 200px; }
.filters > label { display: grid; gap: .25rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.filters select, .filters input[type=date], .filters input[type=time] { width: auto; }
details > summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--brand); list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line-2); }
.toggle-row:last-of-type { border-bottom: 0; }
.toggle-row b { display: block; font-weight: 600; }
.switch { position: relative; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--line-strong); border-radius: 999px; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }

/* ---------------- alerts ---------------- */
.flash { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .95rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; border: 1px solid; font-size: .92rem; }
.flash-error { background: var(--bad-50); color: #8f261c; border-color: #f0cbc6; }
.flash-success { background: var(--ok-50); color: #163e6c; border-color: #c9dbf1; }
.flash-warning { background: var(--accent-50); color: #7a3a1c; border-color: #efd2c0; }
.flash-info { background: var(--info-50); color: #234a8c; border-color: #cfdcf3; }
.alert-unauth { display: flex; gap: .7rem; padding: .9rem 1rem; border-radius: var(--radius-sm); background: var(--bad-50); border: 1px solid #e9b4ad; border-left: 4px solid var(--bad); color: #8f261c; margin: 1rem 0; animation: shake .3s ease-in-out; }
.alert-unauth strong { display: block; font-size: .98rem; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.notice { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .9rem; border-radius: var(--radius-sm); background: var(--accent-50); color: #7a3a1c; font-size: .87rem; border: 1px solid #efd2c0; }
.banner { display: flex; gap: .9rem; align-items: center; padding: .85rem 1rem; border-radius: var(--radius); background: var(--brand-50); border: 1px solid #d6dcea; margin-bottom: 1.2rem; flex-wrap: wrap; }
.banner .grow { flex: 1; min-width: 200px; }
.banner b { display: block; }

/* ---------------- badges ---------------- */
.status { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; border: 1px solid; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-online { color: var(--ok); background: var(--ok-50); border-color: #c9dbf1; }
.status-offline { color: var(--bad); background: var(--bad-50); border-color: #f0cbc6; }
.status-unknown { color: var(--muted); background: var(--surface-2); border-color: var(--line); }
.tag { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; padding: .14rem .5rem; border-radius: 5px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.tag-amber { background: var(--accent-50); color: #8a3e1f; }
.tag-green { background: var(--brand-50); color: var(--brand); }
.tag-sand { background: var(--accent-50); color: #8a3e1f; }
.tag-blue { background: var(--info-50); color: var(--info); }
.tag-red { background: var(--bad-50); color: var(--bad); }

/* ---------------- KPI tiles ---------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); display: flex; gap: .9rem; align-items: center; }
.kpi .ico { width: 40px; height: 40px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--brand-50); color: var(--brand); }
.kpi .ico.amber { background: var(--accent-50); color: var(--accent); }
.kpi .ico.red { background: var(--bad-50); color: var(--bad); }
.kpi .ico.blue { background: var(--info-50); color: var(--info); }
.kpi .label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.kpi .value { font-size: 1.55rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.kpi .value small { font-size: .9rem; color: var(--muted); font-weight: 500; }

/* ---------------- device cards ---------------- */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.device-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); transition: border-color .15s, box-shadow .15s; }
.device-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lg); text-decoration: none; }
.device-card .top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .9rem 1rem .2rem; }
.device-card .cam { width: 36px; height: 36px; border-radius: 8px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; }
.device-card .body { padding: .5rem 1rem .9rem; }
.device-card h2 { font-size: 1rem; }
.device-card .meta { display: grid; gap: .15rem; font-size: .82rem; color: var(--muted); margin-top: .35rem; }
.device-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .65rem 1rem; border-top: 1px solid var(--line-2); font-size: .8rem; color: var(--muted); }
.add-card { border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; display: grid; place-items: center; min-height: 190px; color: var(--muted); font-weight: 600; text-align: center; }
.add-card:hover { border-color: var(--brand); color: var(--brand); box-shadow: none; }
.add-card .plus { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; margin: 0 auto .5rem; }

/* ---------------- lists ---------------- */
.list-item { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.25rem; border-bottom: 1px solid var(--line-2); color: var(--text); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover { background: var(--surface-2); text-decoration: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow > span { display: block; }
.list-item .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; }
.list-item .sub { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ico-box { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; flex: none; background: var(--line-2); color: var(--muted); }
.ico-box.amber { background: var(--accent-50); color: var(--accent); }
.ico-box.red { background: var(--bad-50); color: var(--bad); }
.ico-box.green { background: var(--brand-50); color: var(--brand); }
.ico-box.blue { background: var(--info-50); color: var(--info); }
.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; font-size: .9rem; }
.empty .i { width: 28px; height: 28px; margin-bottom: .4rem; color: #b3aa9b; }

/* ---------------- device page ---------------- */
.device-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; margin-bottom: 1rem; }
.device-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; margin-top: .35rem; }
.tabs { display: flex; gap: 1.4rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: .45rem; padding: .6rem 0; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }

.viewer { position: relative; border-radius: var(--radius); overflow: hidden; background: #0d1424; aspect-ratio: 16 / 9; }
.viewer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.viewer .veil { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; background: rgba(13, 20, 36, .45); }
.viewer .veil p { margin: .7rem 0 0; font-size: .88rem; opacity: .92; }
.viewer .badge-live { position: absolute; top: 3.1rem; left: .9rem; background: var(--bad); color: #fff; font-weight: 700; font-size: .72rem; letter-spacing: .08em; padding: .22rem .55rem; border-radius: 5px; display: flex; gap: .4rem; align-items: center; }
.viewer .badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .2; } }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .75rem 1.25rem; border-top: 1px solid var(--line-2); }
.play-btn { width: 64px; height: 64px; border-radius: 50%; border: 0; background: #fff; color: var(--brand); cursor: pointer; display: grid; place-items: center; margin: 0 auto; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: transform .15s; }
.play-btn:hover { transform: scale(1.05); }
.play-btn .i { width: 24px; height: 24px; margin-left: 3px; }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; }
.shot { display: block; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s; }
.shot:hover { border-color: var(--line-strong); box-shadow: var(--shadow-lg); text-decoration: none; }
.shot img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: #0d1424; }
.shot .cap { padding: .55rem .75rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; font-weight: 600; font-size: .86rem; }
.shot .cap .tag { flex: none; }
.shot .cap.sub { padding-top: 0; font-weight: 500; color: var(--muted); font-size: .78rem; justify-content: flex-start; }
.shot.match { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-50); }
.shot .match-label { display: none; }
.shot.match .match-label { display: inline-flex; }

.rec-top { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.rec-top .when { font-size: 1.05rem; font-weight: 650; }
.pager { display: flex; justify-content: space-between; gap: .6rem; padding: .8rem 1.25rem; border-top: 1px solid var(--line-2); }

/* ---------------- 24h timeline ---------------- */
.timeline { position: relative; height: 28px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.timeline.sm { height: 14px; border-radius: 4px; }
.timeline span { position: absolute; top: 0; bottom: 0; }
.timeline .online { background: #3e6db5; }
.timeline .offline { background: var(--bad); }
.timeline .unknown { background: #ddd5c8; }
.timeline .future { background: repeating-linear-gradient(45deg, transparent 0 5px, rgba(0, 0, 0, .035) 5px 10px); }
.hours { display: flex; justify-content: space-between; color: var(--muted); font-size: .72rem; margin-top: .35rem; }
.legend { display: flex; gap: 1.1rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: .7rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.uptime-row { display: grid; grid-template-columns: minmax(180px, 260px) 1fr 70px; gap: 1.2rem; align-items: center; padding: .75rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.uptime-row:last-of-type { border-bottom: 0; }
.uptime-row.head { padding-top: .6rem; padding-bottom: .6rem; background: var(--surface-2); }

/* ---------------- tables ---------------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .7rem 1.1rem; text-align: left; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); font-weight: 650; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.row-actions form { margin: 0; }
.evt { font-family: var(--mono); font-size: .76rem; padding: .1rem .42rem; border-radius: 4px; background: var(--line-2); white-space: nowrap; }
.evt-bad { background: var(--bad-50); color: #9a2d22; }
.evt-good { background: var(--ok-50); color: #163e6c; }
.evt-sys { background: var(--info-50); color: var(--info); }

/* ---------------- notes ---------------- */
.note { padding: .75rem 1.25rem; border-bottom: 1px solid var(--line-2); }
.note:last-child { border-bottom: 0; }
.note .meta { display: flex; justify-content: space-between; align-items: center; gap: .5rem; color: var(--muted); font-size: .78rem; }
.note form { display: inline; margin: 0; }
.note p { white-space: pre-wrap; margin: .25rem 0 0; }

/* ---------------- key box / steps ---------------- */
.keybox { display: flex; gap: .6rem; align-items: center; background: var(--side); color: #eef1f7; padding: .75rem .9rem; border-radius: var(--radius-sm); font-family: var(--mono); font-size: .88rem; word-break: break-all; }
.keybox code { flex: 1; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: .7rem; align-items: start; font-size: .92rem; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }

/* ---------------- sign-in pages ---------------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.auth-brand { background: var(--side); color: var(--side-text); padding: 2.6rem clamp(1.5rem, 4vw, 3.5rem); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; right: -140px; bottom: -140px; width: 420px; height: 420px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 0 0 60px rgba(255, 255, 255, .02), 0 0 0 120px rgba(255, 255, 255, .015); }
.auth-brand .logo { display: flex; align-items: center; gap: .7rem; color: #fff; font-weight: 700; font-size: 1.2rem; }
.auth-brand .logo img { width: 40px; height: 40px; }
.auth-brand h2 { color: #fff; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.2; letter-spacing: -.02em; font-weight: 650; margin: auto 0 .8rem; max-width: 460px; }
.auth-brand .lead { max-width: 440px; color: var(--side-text); }
.auth-points { list-style: none; padding: 0; margin: 1.6rem 0 auto; display: grid; gap: .8rem; max-width: 440px; }
.auth-points li { display: flex; gap: .7rem; align-items: flex-start; font-size: .92rem; }
.auth-points .i { color: var(--sand); margin-top: 2px; }
.auth-brand .fine { color: var(--side-muted); font-size: .78rem; margin-top: 2rem; }
.auth-main { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 1.5rem; }
.auth-card .lead { color: var(--muted); margin: .35rem 0 1.4rem; }
.auth-card .form { gap: .95rem; }
.auth-foot { font-size: .8rem; color: var(--muted); margin-top: 1.2rem; }
.code-input { text-align: center; font-size: 1.55rem; letter-spacing: .45em; font-weight: 700; font-family: var(--mono); padding: .6rem .3rem .6rem .8rem; }
.install-box { margin-top: 1.2rem; }
.install-box p { font-size: .8rem; color: var(--muted); margin: .4rem 0 0; }
@media (display-mode: standalone) { .install-box, [data-install-btn] { display: none !important; } }

.err-code { font-size: 3rem; font-weight: 750; margin: 0; color: var(--brand); letter-spacing: -.04em; }
.simple-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }

/* ---------------- responsive ---------------- */
@media (max-width: 1000px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { padding: 1.4rem 1.25rem; }
  .auth-brand h2, .auth-brand .lead, .auth-points, .auth-brand .fine { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .mobilebar { display: flex; align-items: center; justify-content: space-between; gap: .8rem; position: sticky; top: 0; z-index: 30; background: var(--side); padding: .6rem 1rem; }
  .mobilebar .side-brand { padding: 0; font-size: 1rem; }
  .mobilebar .side-brand img { width: 30px; height: 30px; }
  .mobilebar button { background: transparent; border: 0; color: #fff; padding: .4rem; cursor: pointer; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 35; }
  .uptime-row { grid-template-columns: 1fr 60px; }
  .uptime-row .timeline-cell { grid-column: 1 / -1; order: 3; }
  .uptime-row.head .timeline-cell { display: none; }
}
@media (max-width: 640px) {
  .row-2, .row-3, .choice { grid-template-columns: 1fr; }
  .content { padding-top: 1.2rem; }
  h1 { font-size: 1.25rem; }
  .kpis { grid-template-columns: 1fr 1fr; gap: .7rem; }
  .kpi { padding: .8rem; gap: .6rem; }
  .kpi .ico { width: 34px; height: 34px; }
  .kpi .value { font-size: 1.3rem; }
  .tabs { gap: 1rem; }
  .card-head, .list-item, .note, .rec-top, .pager, .viewer-bar { padding-left: 1rem; padding-right: 1rem; }
  .card-body { padding: 1rem; }
}
.toggle-row > span > span, .banner .grow > span { display: block; }
.grid-2 > .card, .stack > .card { margin-top: 0; }

/* row of buttons that wraps on phones */
.btn-row{display:flex;flex-wrap:wrap;gap:.5rem}

/* ---------------- explorer: path + folders ---------------- */
.path { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; font-size: .85rem; color: var(--muted); margin-bottom: .8rem; }
.path a { color: var(--muted); font-weight: 500; }
.path a:hover { color: var(--brand); }
.path .sep { color: var(--line-strong); }
.path .here { color: var(--text); font-weight: 650; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.folder-card { display: flex; flex-direction: column; gap: .35rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; color: var(--text); box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, transform .15s; min-height: 170px; }
.folder-card:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.folder-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.folder-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-50); color: var(--accent); }
.folder-ico .i { width: 22px; height: 22px; }
.folder-card h2 { font-size: 1rem; }
.folder-card .desc { color: var(--muted); font-size: .84rem; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card .foot { margin-top: auto; padding-top: .7rem; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: .5rem; font-size: .8rem; color: var(--muted); }
.add-folder { border: 1.5px dashed var(--line-strong); background: transparent; box-shadow: none; display: grid; place-items: center; text-align: center; color: var(--muted); font-weight: 600; }
.add-folder:hover { border-color: var(--brand); color: var(--brand); box-shadow: none; }
.add-folder .plus { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; margin: 0 auto .5rem; }
.muted-folder .folder-ico { background: var(--line-2); color: var(--muted); }
.project-group + .project-group { margin-top: 1.6rem; }
.project-group > h2 { display: flex; align-items: center; gap: .5rem; font-size: .95rem; margin-bottom: .7rem; color: var(--text); }
.project-group > h2 .i { color: var(--accent); }

/* ---------------- requests ---------------- */
.req-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.req-kinds label { border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: .85rem .9rem; cursor: pointer; display: grid; gap: .25rem; font-weight: 600; }
.req-kinds label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 1px var(--brand); }
.req-kinds input { position: absolute; opacity: 0; width: 0; height: 0; }
.req-kinds .i { color: var(--accent); width: 22px; height: 22px; }
.req-kinds small { font-weight: 400; color: var(--muted); font-size: .8rem; }
.req-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; white-space: nowrap; }
.req-pending { background: var(--line-2); color: var(--muted); }
.req-processing { background: var(--info-50); color: var(--info); }
.req-done { background: var(--ok-50); color: var(--ok); }
.req-failed { background: var(--bad-50); color: var(--bad); }
.kv { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; }
.kv > div { padding: .65rem 1.25rem; border-bottom: 1px solid var(--line-2); font-size: .9rem; }
.kv > div:nth-child(odd) { color: var(--muted); }
.result-media img, .result-media video { width: 100%; display: block; background: #0d1424; }
@media (max-width: 640px) { .req-kinds { grid-template-columns: 1fr; } .kv > div { padding-left: 1rem; padding-right: 1rem; } }
.checklist-group { display: flex; align-items: center; gap: .4rem; padding: .5rem .75rem; background: var(--surface-2); border-bottom: 1px solid var(--line-2); font-size: .76rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.checklist-group .i { width: 15px; height: 15px; color: var(--accent); }
