/* Маячок · панель владельца. Язык One Shape v2: тёплый серый холст, чёрно-белые капсулы, один оранжевый акцент, красный — только тревога. */
@font-face { font-family: "Inter"; src: url("/app/assets/fonts/Inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  --land: #E7E4DD; --panel: #FBFAF6; --panel-2: #F1EEE7; --line: rgba(11, 11, 11, .10); --line-2: rgba(11, 11, 11, .18);
  --ink: #0B0B0B; --ink-2: #4A4741; --ink-3: #6B675E;
  --accent: #FF5A1F; --accent-soft: rgba(255, 90, 31, .15); --warn-text: #A63A08; --bad: #E5322B; --bad-soft: rgba(229, 50, 43, .12); --ok: #1F7A3A;
  --shadow: 0 24px 48px -24px rgba(20, 16, 8, .32), 0 2px 8px rgba(20, 16, 8, .08);
  --r: 24px; --r-s: 16px; --r-xs: 12px;
  --font: "Geist", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --spring: linear(0, .052, .173, .32, .468, .603, .717, .809, .879, .93, .966, .989, 1.004, 1.011, 1.015, 1.015, 1.014, 1.012, 1.01, 1.007, 1.005, 1.004, 1.003, 1.002, 1.001, 1);
  color-scheme: light;
}
[data-theme="dark"] {
  --land: #131210; --panel: #1C1B18; --panel-2: #262521; --line: rgba(244, 242, 236, .11); --line-2: rgba(244, 242, 236, .2);
  --ink: #F4F2EC; --ink-2: #B8B3A7; --ink-3: #8F8A7E;
  --accent: #FF6A2B; --accent-soft: rgba(255, 106, 43, .2); --warn-text: #FF8A52; --bad: #FF5A52; --bad-soft: rgba(255, 90, 82, .16); --ok: #5BC77A;
  --shadow: 0 24px 48px -20px rgba(0, 0, 0, .7), 0 2px 8px rgba(0, 0, 0, .4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); background: var(--land); color: var(--ink); font-size: 14px; line-height: 1.45; font-feature-settings: "tnum" 1, "ss01" 1; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--ink-3); }
.sp { flex: 1; }
[hidden] { display: none !important; }
.l-dark { display: none; }
[data-theme="dark"] .l-light { display: none; } [data-theme="dark"] .l-dark { display: inline; }

/* ---------- кнопки, поля, чипы ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--ink); color: var(--panel);
  font-weight: 600; white-space: nowrap; transition: transform .35s var(--spring), opacity .2s; }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn.soft { background: var(--panel-2); color: var(--ink); }
.btn.accent { background: var(--accent); color: #0B0B0B; }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn.wide { width: 100%; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12px; }
input, select, textarea { width: 100%; min-height: 42px; padding: 10px 14px; border-radius: var(--r-xs); border: 1.5px solid var(--line-2); background: var(--panel); outline: none; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); }
input.code { letter-spacing: .3em; font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--panel-2); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.chip.accent { background: var(--accent-soft); color: var(--warn-text); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.ok { color: var(--ok); }
.chip.ink { background: var(--ink); color: var(--panel); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; }
.dot.on { background: var(--ok); } .dot.bad { background: var(--bad); }

/* ---------- вход ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
body:not(.is-auth) .auth { display: none; }
.auth-card { width: min(420px, 100%); background: var(--panel); border-radius: 32px; padding: 32px 28px; box-shadow: var(--shadow); animation: up .6s var(--spring) both; }
.auth-card.wide { width: min(560px, 100%); }
.auth-card .logo { height: 34px; margin-bottom: 22px; }
.auth-card h1 { font-size: 24px; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-card p { color: var(--ink-2); margin: 0 0 18px; }
.qr { display: grid; grid-template-columns: 168px 1fr; gap: 18px; align-items: center; background: var(--panel-2); border-radius: var(--r-s); padding: 14px; margin-bottom: 16px; }
.qr svg { width: 168px; height: 168px; border-radius: 10px; display: block; }
.secret { word-break: break-all; user-select: all; background: var(--panel); border-radius: 10px; padding: 8px 10px; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; background: var(--panel-2); border-radius: var(--r-s); padding: 14px; margin: 0 0 16px; user-select: all; }
.err { color: var(--bad); font-weight: 600; min-height: 20px; margin: 4px 0 10px; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 14px; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 0 10px; }
.brand img { height: 26px; }
.brand span { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--warn-text); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; }
#nav { display: grid; gap: 2px; overflow: auto; }
#nav a { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 600; transition: background .2s; }
#nav a:hover { background: var(--panel-2); }
#nav a.on { background: var(--ink); color: var(--panel); }
#nav a b { margin-left: auto; min-width: 22px; height: 22px; border-radius: 11px; background: var(--accent); color: #0B0B0B; font-size: 11.5px; display: grid; place-items: center; padding: 0 6px; }
.side-foot { margin-top: auto; display: grid; gap: 8px; }
.who { padding: 10px 14px; background: var(--panel); border-radius: var(--r-s); font-size: 12.5px; }
.who b { display: block; font-size: 13.5px; }
.main { min-width: 0; padding: 18px 24px 48px 8px; }
.bar { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-bottom: 14px; }
.bar h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.view { animation: up .45s var(--spring) both; }
@keyframes up { from { opacity: 0; transform: translateY(10px); } }

/* ---------- карточки, плитки, таблицы ---------- */
.card { background: var(--panel); border-radius: var(--r); padding: 18px; margin-bottom: 14px; }
.card h2 { margin: 0 0 12px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-3); display: flex; align-items: center; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.tile { background: var(--panel); border-radius: var(--r); padding: 16px 18px; text-decoration: none; display: block; transition: transform .35s var(--spring); }
a.tile:hover { transform: translateY(-2px); }
.tile .v { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.tile .k { color: var(--ink-3); font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.tile.accent { background: var(--accent); color: #0B0B0B; } .tile.accent .k { color: rgba(11, 11, 11, .7); }
.tile.bad { background: var(--bad); color: #fff; } .tile.bad .k { color: rgba(255, 255, 255, .8); }
.alerts { display: grid; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-s); background: var(--bad-soft); color: var(--bad); font-weight: 600; }
.alert.ok { background: var(--panel-2); color: var(--ink-2); }
.kv { display: grid; grid-template-columns: minmax(150px, 40%) 1fr; gap: 8px 14px; font-size: 13.5px; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; min-height: 40px; border-radius: 999px; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.tabs { display: inline-flex; background: var(--panel-2); border-radius: 999px; padding: 4px; gap: 2px; }
.tabs button { border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 999px; font-weight: 600; color: var(--ink-2); }
.tabs button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .1); }
.tbl-wrap { background: var(--panel); border-radius: var(--r); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 700; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background .15s; }
tbody tr.click:hover { background: var(--panel-2); }
td .sub { display: block; color: var(--ink-3); font-size: 12px; }
td input[type=checkbox] { width: 18px; min-height: 18px; accent-color: var(--accent); }
.empty { padding: 36px 20px; text-align: center; color: var(--ink-3); }
.bat { display: inline-flex; align-items: center; gap: 6px; }
.bat i { width: 26px; height: 11px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px var(--ink-3); position: relative; overflow: hidden; }
.bat i::after { content: ""; position: absolute; inset: 2px auto 2px 2px; width: calc((100% - 4px) * var(--p)); border-radius: 1.5px; background: var(--ink); }
.bat.low i::after { background: var(--bad); }
.diff { font-size: 12px; } .diff s { color: var(--ink-3); } .diff b { font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ncard { background: var(--panel); border-radius: var(--r); padding: 16px; display: grid; gap: 10px; }
.ncard h3 { margin: 0; font-size: 17px; display: flex; align-items: center; gap: 8px; }

/* ---------- выдвижная карточка, окно, уведомление ---------- */
.drawer, .modal { position: fixed; inset: 0; z-index: 50; background: rgba(11, 11, 11, .32); backdrop-filter: blur(2px); }
.drawer-in { position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(520px, calc(100% - 20px)); background: var(--panel); border-radius: 28px; box-shadow: var(--shadow); overflow: auto; padding: 22px; animation: slide .5s var(--spring) both; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.dh h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
h2 .mono, h3 .mono { font-size: inherit; }
.dh { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--panel-2); font-size: 18px; line-height: 1; flex: none; }
.modal { display: grid; place-items: center; padding: 16px; }
.modal-in { width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--panel); border-radius: 28px; padding: 24px; box-shadow: var(--shadow); animation: up .45s var(--spring) both; }
.keybox { background: var(--ink); color: var(--panel); border-radius: var(--r-s); padding: 14px; word-break: break-all; user-select: all; margin: 10px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 70; background: var(--ink); color: var(--panel); border-radius: 999px; padding: 11px 20px; font-weight: 600;
  pointer-events: none; transition: transform .5s var(--spring), opacity .2s; max-width: calc(100% - 32px); }
.toast.on { transform: translate(-50%, 0); opacity: 1; }
.toast.bad { background: var(--bad); color: #fff; }
.section-gap { height: 6px; }
.list-mini { display: grid; gap: 6px; font-size: 13px; }
.list-mini div { display: flex; gap: 8px; justify-content: space-between; padding: 7px 10px; background: var(--panel-2); border-radius: 10px; }

/* ---------- печать наклеек ---------- */
.print { display: none; }
@media print {
  body > *:not(.print) { display: none !important; }
  .print { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6mm; }
  .label { border: 1px dashed #999; border-radius: 3mm; padding: 3mm; text-align: center; break-inside: avoid; font: 600 11pt var(--font); color: #000; }
  .label svg { width: 30mm; height: 30mm; margin: 0 auto 1mm; }
}

/* ---------- телефон ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 16px; gap: 10px; background: var(--land); }
  #nav { order: 3; width: 100%; display: flex; overflow-x: auto; scrollbar-width: none; gap: 4px; }
  #nav a { padding: 8px 12px; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; display: flex; gap: 6px; }
  .who { display: none; }
  .main { padding: 4px 16px 40px; }
  .bar h1 { font-size: 22px; }
  .grid2 { grid-template-columns: 1fr; }
  .qr { grid-template-columns: 1fr; justify-items: center; }
  .toolbar input, .toolbar select { min-width: 0; flex: 1 1 140px; }
  .hide-m { display: none; }
}
