/* AfriCloud SQL control panel.
   Graphite control-room theme. One accent (cobalt) for focus, links and live state.
   Colour otherwise only carries meaning: green healthy, amber attention, red failure,
   and one key colour per client (the same colour everywhere that client appears).
   Radius system: controls 8px, panels 14px, chips fully round. */

@font-face {
  font-family: "Mona Sans";
  src: url("/static/fonts/MonaSans.woff2") format("woff2");
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/static/fonts/GeistMono.woff2") format("woff2");
  font-weight: 400 600;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0F1113;
  --bg-sunk: #0A0C0E;
  --raise: #15181B;
  --raise-2: #1B1F23;
  --raise-3: #22272C;
  --line: #23282D;
  --line-2: #2E343A;
  --text: #ECEEF0;
  --text-2: #A9B0B7;
  --text-3: #737D85;
  --accent: #7DA2FF;
  --accent-soft: rgba(125, 162, 255, 0.14);
  --ok: #3CCB8D;
  --ok-soft: rgba(60, 203, 141, 0.13);
  --warn: #F1B544;
  --warn-soft: rgba(241, 181, 68, 0.13);
  --bad: #FF6E63;
  --bad-soft: rgba(255, 110, 99, 0.13);
  --k0: #7DA2FF;
  --k1: #3BC9B5;
  --k2: #E9A86D;
  --k3: #F07F93;
  --k4: #A7D46A;
  --k5: #B9A6FF;
  --sans: "Mona Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "Geist Mono", "Cascadia Mono", ui-monospace, Menlo, Consolas, monospace;
  --r-control: 8px;
  --r-panel: 14px;
  --shadow-pop: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 24px 60px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font: 450 14.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 620; line-height: 1.2; }
a { color: var(--accent); text-decoration: none; }
code, .mono { font-family: var(--mono); font-size: 0.9em; font-variant-ligatures: none; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: rgba(125, 162, 255, 0.35); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.boot { padding: 48px; color: var(--text-3); }

svg.i { width: 18px; height: 18px; flex: none; fill: currentColor; vertical-align: -3px; }
svg.i.sm { width: 15px; height: 15px; vertical-align: -2px; }
svg.i.lg { width: 22px; height: 22px; }

/* ------------------------------------------------------------ mark */
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.mark-tile {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(180deg, #8DAEFF, #5F86F0); color: #0B1430;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.mark-tile svg.i { width: 18px; height: 18px; vertical-align: 0; }
.mark-name { font-weight: 680; font-stretch: 112%; font-size: 15.5px; letter-spacing: -0.01em; }
.mark-name span { color: var(--text-3); font-weight: 500; }

/* ------------------------------------------------------------ top bar */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 26px;
  height: 60px; padding: 0 28px;
  background: rgba(15, 17, 19, 0.82);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 2px; padding: 3px; background: var(--raise); border: 1px solid var(--line); border-radius: 10px; }
.tabs a {
  padding: 5px 13px; border-radius: 7px; color: var(--text-2); font-weight: 520; font-size: 13.5px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.tabs a:hover { color: var(--text); }
.tabs a.on { background: var(--raise-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.bar .grow { flex: 1; }
.live-chip {
  display: inline-flex; align-items: center; gap: 9px; max-width: 280px;
  padding: 6px 12px 6px 10px; border-radius: 999px; border: 1px solid rgba(125, 162, 255, 0.3);
  background: var(--accent-soft); color: #C9D8FF; font-size: 13px; font-weight: 540; cursor: pointer;
}
.live-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .live-dot { animation: breathe 1.6s ease-in-out infinite; }
}
@keyframes breathe { 50% { opacity: 0.25; transform: scale(0.8); } }
.who { position: relative; }
.who > button {
  display: inline-flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px;
  background: none; border: 1px solid transparent; border-radius: 999px; cursor: pointer; color: var(--text-2);
}
.who > button:hover { border-color: var(--line-2); background: var(--raise); }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--raise-3); color: var(--text); font-size: 12px; font-weight: 650; text-transform: uppercase;
  border: 1px solid var(--line-2);
}
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; padding: 6px; z-index: 30;
  background: var(--raise-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow-pop);
}
.menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; color: var(--text-2); text-align: left; cursor: pointer;
}
.menu button:hover { background: var(--raise-3); color: var(--text); }

/* ------------------------------------------------------------ page */
.page { max-width: 1240px; margin: 0 auto; padding: 40px 28px 96px; }
@media (prefers-reduced-motion: no-preference) {
  .page > * { animation: enter 0.45s var(--ease) both; }
  .page > *:nth-child(2) { animation-delay: 0.04s; }
  .page > *:nth-child(3) { animation-delay: 0.08s; }
  .page > *:nth-child(4) { animation-delay: 0.12s; }
}
@keyframes enter { from { opacity: 0; transform: translateY(6px); } }
.block { margin-top: 44px; }
.client-grid > div > .block:first-child { margin-top: 0; }
.cap-num, .db-size, .stat span, .night small, .progress-meta, .cap-legend b, .facts dd { font-variant-numeric: tabular-nums; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.head h2 { font-size: 16px; font-stretch: 108%; }
.head .count { color: var(--text-3); font-size: 14px; }
.head .end { margin-left: auto; display: flex; gap: 8px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: var(--r-control);
  border: 1px solid var(--line-2); background: var(--raise-2); color: var(--text);
  font-size: 13.5px; font-weight: 560; white-space: nowrap; cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), transform 0.1s var(--ease);
}
.btn:hover { background: var(--raise-3); border-color: #3A4148; }
.btn:active { transform: scale(0.98); }
.btn.primary { background: #ECEEF0; border-color: #ECEEF0; color: #101214; }
.btn.primary:hover { background: #FFFFFF; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--raise-3); color: var(--text); }
.btn.danger { background: transparent; border-color: rgba(255, 110, 99, 0.35); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.danger-fill { background: var(--bad); border-color: var(--bad); color: #1A0605; }
.btn.danger-fill:hover { background: #FF8A80; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; gap: 6px; }
.btn.icon { width: 32px; padding: 0; }
.btn.sm.icon { width: 30px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 560; cursor: pointer; }

/* ------------------------------------------------------------ state chips */
.state {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.state svg.i { width: 14px; height: 14px; vertical-align: 0; }
.state.ok { color: var(--ok); background: var(--ok-soft); }
.state.warn { color: var(--warn); background: var(--warn-soft); }
.state.bad { color: var(--bad); background: var(--bad-soft); }
.state.run { color: var(--accent); background: var(--accent-soft); }
.tag { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); font-size: 12.5px; }
.tag + .tag { margin-left: 10px; }

/* ------------------------------------------------------------ overview: status */
.status { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; align-items: center; }
.status-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; grid-row: span 2; }
.status-icon svg.i { width: 26px; height: 26px; vertical-align: 0; }
.status-icon.ok { background: var(--ok-soft); color: var(--ok); }
.status-icon.bad { background: var(--bad-soft); color: var(--bad); }
.status-icon.warn { background: var(--warn-soft); color: var(--warn); }
.status h1 { font-size: 34px; font-stretch: 120%; font-weight: 650; letter-spacing: -0.025em; }
.status p { color: var(--text-2); max-width: 70ch; }

/* ------------------------------------------------------------ overview: capacity */
.capacity { margin-top: 36px; padding: 26px 28px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-panel); }
.cap + .cap { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
.cap-top { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.cap-top h3 { font-size: 14px; color: var(--text-2); font-weight: 560; width: 78px; }
.cap-num { font-size: 26px; font-stretch: 120%; font-weight: 620; letter-spacing: -0.02em; }
.cap-of { color: var(--text-3); }
.cap-free { margin-left: auto; color: var(--text-2); font-size: 13.5px; }
.cap-bar { display: flex; height: 14px; gap: 2px; padding: 2px; background: var(--bg-sunk); border-radius: 7px; overflow: hidden; }
.cap-bar i { display: block; height: 100%; min-width: 3px; border-radius: 4px; width: 0; }
@media (prefers-reduced-motion: no-preference) { .cap-bar i { transition: width 0.9s var(--ease); } }
.cap-bar i.sys { background: repeating-linear-gradient(135deg, #3A4148 0 4px, #2E343A 4px 8px); }
.cap-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.cap-legend span { display: inline-flex; align-items: center; gap: 8px; }
.cap-legend b { color: var(--text); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw.sys { background: repeating-linear-gradient(135deg, #4A525A 0 2px, #2E343A 2px 4px); }
.sw.free { background: var(--bg-sunk); border: 1px solid var(--line-2); }
.k0 { background: var(--k0); } .k1 { background: var(--k1); } .k2 { background: var(--k2); }
.k3 { background: var(--k3); } .k4 { background: var(--k4); } .k5 { background: var(--k5); }

/* ------------------------------------------------------------ overview: backups + server */
.duo { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; margin-top: 16px; }
.panel { padding: 22px 24px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel h3 { font-size: 14px; color: var(--text-2); font-weight: 560; margin-bottom: 14px; }
.nights { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; }
.night { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.night i { display: block; width: 100%; height: 34px; border-radius: 6px; background: var(--raise-3); }
.night.ok i { background: linear-gradient(180deg, #47D99A, #2FAE77); }
.night.fail i { background: linear-gradient(180deg, #FF8278, #E2554B); }
.night small { font-size: 11.5px; color: var(--text-3); }
.night.today small { color: var(--text); font-weight: 650; }
.nights-note { margin-top: 16px; color: var(--text-2); font-size: 13.5px; }
.nights-note strong { color: var(--text); font-weight: 600; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ client units (overview list) */
.units { display: flex; flex-direction: column; gap: 8px; }
.unit {
  display: grid; grid-template-columns: 4px minmax(180px, 1.5fr) repeat(3, minmax(0, 1fr)) auto 18px; align-items: center; gap: 22px;
  padding: 16px 20px 16px 16px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-panel);
  color: var(--text); transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.unit:hover { border-color: var(--line-2); background: #181B1F; }
.unit-key { align-self: stretch; width: 4px; border-radius: 2px; }
.unit-name { min-width: 0; }
.unit-name strong { display: block; font-size: 16px; font-stretch: 112%; font-weight: 640; letter-spacing: -0.01em; }
.unit-name code { color: var(--text-3); font-size: 12.5px; }
.stat small { display: block; font-size: 12px; color: var(--text-3); }
.stat span { font-weight: 560; }
.unit > svg.i { color: var(--text-3); }
.empty {
  display: flex; align-items: center; gap: 18px; padding: 26px 24px;
  background: var(--raise); border: 1px dashed var(--line-2); border-radius: var(--r-panel); color: var(--text-2);
}
.empty .tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--raise-3); color: var(--text-2); flex: none; }
.empty strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* ------------------------------------------------------------ client page */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13.5px; margin-bottom: 18px; }
.back:hover { color: var(--text); }
.client-head { display: flex; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.client-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.client-title .unit-key { width: 6px; height: 30px; align-self: center; }
.client-title h1 { font-size: 34px; font-stretch: 120%; font-weight: 650; letter-spacing: -0.025em; }
.client-meta { display: flex; align-items: center; gap: 14px; margin-top: 8px; color: var(--text-3); font-size: 13.5px; flex-wrap: wrap; }
.client-head .end { margin-left: auto; display: flex; gap: 8px; }
.client-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; margin-top: 34px; }
.rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }

.db-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.db {
  display: flex; flex-direction: column; gap: 14px; padding: 18px 20px;
  background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.db-top { display: flex; align-items: flex-start; gap: 12px; }
.db-top .tile { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--raise-3); color: var(--text-2); flex: none; }
.db-name { min-width: 0; }
.db-name strong { display: block; font-weight: 620; overflow-wrap: anywhere; }
.db-name small { color: var(--text-3); font-size: 12.5px; }
.db-top .btn { margin-left: auto; }
.db-size { font-size: 28px; font-stretch: 120%; font-weight: 620; letter-spacing: -0.02em; line-height: 1; }
.db-size small { font-size: 14px; color: var(--text-3); font-weight: 500; font-stretch: 100%; margin-left: 4px; }
.db-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }
.db-foot b { color: var(--text-2); font-weight: 560; }

.drop {
  display: flex; align-items: center; gap: 18px; padding: 22px 24px; cursor: pointer;
  background: var(--bg-sunk); border: 1.5px dashed var(--line-2); border-radius: var(--r-panel);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(125, 162, 255, 0.05); }
.drop .tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.drop strong { display: block; font-weight: 600; }
.drop p { color: var(--text-3); font-size: 13.5px; }
.up { padding: 20px 22px; background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-panel); }
.up-file { display: flex; align-items: center; gap: 12px; }
.up-file .tile { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; background: var(--raise-3); color: var(--text-2); flex: none; }
.up-file strong { display: block; font-weight: 600; overflow-wrap: anywhere; }
.up-file small { color: var(--text-3); }
.up-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 18px; }
.progress { height: 8px; margin-top: 18px; background: var(--bg-sunk); border-radius: 4px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, #5F86F0, #8DAEFF); transition: width 0.3s var(--ease); }
.progress-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 10px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 540; color: var(--text-2); cursor: pointer; }
.seg input:checked + span { background: var(--raise-3); color: var(--text); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.rows { background: var(--raise); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden; }
.row { display: flex; align-items: center; gap: 14px; padding: 12px 18px; }
.row + .row { border-top: 1px solid var(--line); }
.row .main { min-width: 0; flex: 1; }
.row .main strong { font-weight: 560; overflow-wrap: anywhere; }
.row .main small { display: block; color: var(--text-3); font-size: 12.5px; }
.row .act { display: flex; gap: 6px; flex: none; }
.night-group + .night-group { margin-top: 18px; }
.night-head { display: flex; align-items: center; gap: 12px; padding: 0 4px 8px; font-size: 13.5px; }
.night-head strong { font-weight: 620; }
.night-head .end { margin-left: auto; display: flex; gap: 12px; }
.more { margin-top: 14px; }

.plate {
  position: relative; padding: 22px 22px 18px; border-radius: var(--r-panel); overflow: hidden;
  background: linear-gradient(160deg, #1C2230 0%, #151A24 55%, #12161E 100%);
  border: 1px solid #2B3446; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.plate::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(125, 162, 255, 0.7), transparent);
}
.plate h3 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.plate .lead { color: #93A0BA; font-size: 12.5px; margin-top: 3px; }
.plate dl { margin: 18px 0 0; }
.plate dt { font-size: 12px; color: #7F8BA3; margin-top: 14px; }
.plate dd { display: flex; align-items: center; gap: 8px; margin: 3px 0 0; }
.plate dd code { font-size: 14.5px; color: #F2F5FF; overflow-wrap: anywhere; }
.plate .pbtn {
  display: grid; place-items: center; width: 30px; height: 28px; margin-left: auto; flex: none; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 7px; color: #C9D3EA;
}
.plate .pbtn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.plate .pbtn + .pbtn { margin-left: 0; }
.plate .foot { display: flex; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.plate .foot .btn { flex: 1; background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.12); }
.plate .foot .btn:hover { background: rgba(255, 255, 255, 0.12); }
.side h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.side p { color: var(--text-2); font-size: 13.5px; }
.side .meter { margin: 14px 0 8px; }
.side .acts { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.side.danger { border-color: rgba(255, 110, 99, 0.22); }
.meter { height: 6px; background: var(--bg-sunk); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 3px; }

/* ------------------------------------------------------------ activity */
.day + .day { margin-top: 30px; }
.day h3 { font-size: 13px; color: var(--text-3); font-weight: 600; margin-bottom: 6px; }
.event { display: grid; grid-template-columns: 52px 30px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 11px 4px; }
.event + .event { border-top: 1px solid var(--line); }
.event time { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.event .what { color: var(--text-2); min-width: 0; }
.event .what b { color: var(--text); font-weight: 600; }
.event .what small { display: block; color: var(--text-3); font-size: 12.5px; margin-top: 1px; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ sign in */
.auth { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100dvh; }
.auth-art {
  position: relative; display: flex; flex-direction: column; padding: 40px 48px; overflow: hidden; isolation: isolate;
  background: #0B0F14 url("/static/img/datacentre.webp") 38% center / cover no-repeat;
}
.auth-art::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(9, 12, 17, 0.72) 0%, rgba(9, 12, 17, 0.18) 28%, rgba(9, 12, 17, 0.35) 50%, rgba(9, 12, 17, 0.9) 74%, rgba(9, 12, 17, 0.97) 100%),
    linear-gradient(90deg, rgba(20, 34, 78, 0.35), transparent 70%);
}
.auth-art .mark-name span { color: rgba(255, 255, 255, 0.6); }
.auth-art h1 { color: #FFFFFF; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5); }
.auth-art .copy { margin-top: auto; max-width: 30rem; }
.auth-art h1 { font-size: clamp(32px, 3.6vw, 48px); font-stretch: 122%; font-weight: 660; letter-spacing: -0.03em; line-height: 1.05; }
.auth-art ul { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 14px; color: rgba(236, 242, 255, 0.82); }
.auth-art li { display: flex; align-items: center; gap: 12px; }
.auth-art li .tile { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.16); color: #FFFFFF; }
.auth-art .base { margin-top: 48px; font-size: 12.5px; color: rgba(236, 242, 255, 0.55); }
.auth-side {
  display: grid; place-items: center; padding: 40px 28px;
  background: radial-gradient(70% 50% at 50% 0%, rgba(125, 162, 255, 0.08), transparent 70%), #121417;
}
.auth-box {
  width: 100%; max-width: 420px; padding: 34px 34px 30px;
  background: var(--raise-2); border: 1px solid var(--line-2); border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 80px rgba(0, 0, 0, 0.45);
}
.auth-box h2 { font-size: 26px; font-stretch: 116%; font-weight: 650; letter-spacing: -0.02em; }
.auth-box > p { color: var(--text-2); margin-top: 8px; font-size: 14px; }
.auth-box form { margin-top: 28px; }
.auth-box .btn.primary { width: 100%; height: 42px; margin-top: 8px; font-size: 14px; }
.auth-box .linkish { display: block; margin: 16px auto 0; font-size: 13.5px; }
.auth-mobile-mark { display: none; margin-bottom: 36px; }
.input.code-input { height: 52px; font-family: var(--mono); font-size: 24px; letter-spacing: 0.4em; text-align: center; }
.qr { display: flex; gap: 16px; align-items: center; padding: 14px; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 12px; }
.qr img { width: 124px; height: 124px; border-radius: 8px; background: #fff; padding: 6px; flex: none; }
.qr p { font-size: 13px; color: var(--text-2); }
.qr code { display: block; margin-top: 8px; font-size: 12.5px; color: var(--text); word-spacing: 0.2em; }

/* ------------------------------------------------------------ forms */
.stack > * + * { margin-top: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 560; color: var(--text); }
.field .hint { font-weight: 450; color: var(--text-3); font-size: 12.5px; }
.input {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-control);
  background: var(--bg-sunk); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
.input::placeholder { color: #5F6870; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(125, 162, 255, 0.18); }
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.check { display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); font-weight: 450; cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.check strong { display: block; color: var(--text); font-weight: 600; }
.choice { display: block; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer; background: var(--bg-sunk); }
.choice + .choice { margin-top: 8px; }
.choice:has(input:checked) { border-color: var(--accent); background: rgba(125, 162, 255, 0.06); }
.choice .input { margin-top: 12px; }
.form-error { color: var(--bad); font-size: 13px; min-height: 1.2em; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 10px; font-size: 13px; background: var(--warn-soft); color: #F7D79A; }
.note.bad { background: var(--bad-soft); color: #FFB3AC; }
.note.info { background: var(--accent-soft); color: #C9D8FF; }
.note svg.i { margin-top: 1px; }
.file-btn { position: relative; display: inline-flex; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ------------------------------------------------------------ dialogs */
.veil {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px;
  background: rgba(5, 7, 9, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
@media (prefers-reduced-motion: no-preference) {
  .veil { animation: fade 0.18s ease both; }
  .sheet { animation: pop 0.22s var(--ease) both; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } }
.sheet {
  width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  background: var(--raise-2); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: var(--shadow-pop);
}
.sheet.wide { max-width: 860px; }
.sheet-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px 4px; }
.sheet-head h2 { font-size: 18px; font-stretch: 112%; font-weight: 640; letter-spacing: -0.01em; }
.sheet-head .btn { margin-left: auto; }
.sheet-body { padding: 14px 22px 18px; overflow-y: auto; color: var(--text-2); }
.sheet-body p + p { margin-top: 10px; }
.sheet-body strong, .sheet-body b { color: var(--text); }
.sheet-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 18px; margin: 16px 0 0; padding: 16px; background: var(--bg-sunk); border-radius: 12px; }
.kv dt { color: var(--text-3); font-size: 13px; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 14px; color: var(--text); overflow-wrap: anywhere; }
.secret { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 14px 16px; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 12px; }
.secret code { font-size: 16px; color: var(--text); overflow-wrap: anywhere; }

.term { border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: var(--bg-sunk); }
.term-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #111417; font-size: 13px; color: var(--text-2); }
.term-bar .end { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.log { margin: 0; height: 380px; overflow: auto; padding: 14px 16px; font: 12.5px/1.65 var(--mono); color: #B8C2CA; white-space: pre-wrap; word-break: break-word; }
.log .step { color: #FFFFFF; font-weight: 600; }
.log .err { color: #FF9B93; }
.log .good { color: #6FE0AE; }
.job-hint { margin-top: 12px; font-size: 13px; color: var(--text-3); }

/* ------------------------------------------------------------ toasts */
#toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: inline-flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 32px));
  padding: 11px 16px; border-radius: 12px; background: var(--raise-3); border: 1px solid var(--line-2);
  color: var(--text); font-size: 13.5px; box-shadow: var(--shadow-pop);
}
.toast svg.i { color: var(--ok); }
.toast.bad svg.i { color: var(--bad); }
@media (prefers-reduced-motion: no-preference) { .toast { animation: pop 0.22s var(--ease) both; } }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1080px) {
  .unit { grid-template-columns: 4px minmax(160px, 1.5fr) repeat(2, minmax(0, 1fr)) auto 18px; }
  .unit .stat.backup { display: none; }
}
@media (max-width: 960px) {
  .client-grid { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; order: -1; }
  .duo { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .auth-mobile-mark { display: inline-flex; }
}
@media (max-width: 720px) {
  .bar { gap: 12px; padding: 0 14px; }
  .mark-name { display: none; }
  .who-name { display: none; }
  .page { padding: 26px 16px 72px; }
  .status h1, .client-title h1 { font-size: 26px; }
  .status { grid-template-columns: 1fr; }
  .status-icon { grid-row: auto; width: 40px; height: 40px; }
  .capacity { padding: 20px; }
  .cap-top { flex-wrap: wrap; }
  .cap-free { margin-left: 0; width: 100%; }
  .nights { gap: 3px; }
  .night small { font-size: 10.5px; }
  .unit { grid-template-columns: 4px minmax(0, 1fr) auto; gap: 14px; }
  .unit .stat, .unit > svg.i { display: none; }
  .client-head .end { margin-left: 0; width: 100%; }
  .row { flex-wrap: wrap; }
  .event { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .event .avatar { display: none; }
  .live-chip span { display: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .bar, .veil { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .bar { background: var(--bg); }
}

/* small pieces used across views */
.tile-sm { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--raise-3); color: var(--text-2); flex: none; }
.confirm { margin-top: 16px; }
.confirm-gap { margin-top: 16px; }
.up-form { margin-top: 18px; }
.status-icon.neutral { background: var(--raise-3); color: var(--text-2); }

/* ------------------------------------------------------------ loading */
.loader { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 20px; }
.loader .mark-tile { width: 44px; height: 44px; border-radius: 12px; }
.loader .mark-tile svg { width: 26px; height: 26px; fill: currentColor; }
.loader-bar { width: 132px; height: 3px; border-radius: 2px; background: var(--raise-3); overflow: hidden; }
.loader-bar i { display: block; width: 38%; height: 100%; border-radius: 2px; background: var(--accent); }
.loader p { font-size: 13px; color: var(--text-3); }
@media (prefers-reduced-motion: no-preference) {
  .loader .mark-tile { animation: glow 1.6s ease-in-out infinite; }
  .loader-bar i { animation: slide 1.15s var(--ease) infinite; }
  .sk { animation: shimmer 1.4s linear infinite; }
  .spin { animation: spin 0.7s linear infinite; }
}
@keyframes slide { from { transform: translateX(-110%); } to { transform: translateX(280%); } }
@keyframes glow { 50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 0 0 8px rgba(125, 162, 255, 0.12); } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; opacity: 0.8; flex: none; }

.sk {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--raise-2) 25%, #262B31 50%, var(--raise-2) 75%);
  background-size: 200% 100%;
}
.sk-status { display: flex; align-items: center; gap: 18px; }
.sk-icon { width: 46px; height: 46px; border-radius: 12px; flex: none; }
.sk-h1 { width: min(420px, 70vw); height: 34px; }
.sk-line { height: 12px; margin-top: 12px; }
.sk-bar { height: 14px; margin-top: 16px; border-radius: 7px; }
.sk-block { height: 34px; margin-top: 16px; }
.sk-tile { height: 168px; border-radius: var(--r-panel); }
.sk-plate { height: 300px; border-radius: var(--r-panel); }
.sk-row { height: 62px; border-radius: var(--r-panel); }
.sk-row + .sk-row { margin-top: 8px; }
.w20 { width: 20%; } .w30 { width: 30%; } .w40 { width: 40%; } .w60 { width: 60%; } .w80 { width: 80%; }
.grow-1 { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.loader-inline { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 14px; }
