/* «Возрождение» · Видеонаблюдение — стили по дизайн-хэндоффу */
:root {
  --bg: #eef1f5;
  --panel: #fff;
  --line: #e7ebf1;
  --line-soft: #eef1f5;
  --text: #2f3a42;
  --muted: #8a96a6;
  --muted-2: #5b6770;
  --muted-3: #9aa6b4;
  --accent: #ba0c2f;
  --accent-strong: #8e0a24;
  --radius: 15px;
  --serif: 'Book Antiqua', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Century Gothic', 'Jost', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body { font-family: var(--sans); color: var(--text); font-size: 14px; line-height: 1.45; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #cdd5df; border-radius: 9px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #b8c2ce; background-clip: content-box; }
input, button, select, textarea { font-family: inherit; }
input::placeholder, textarea::placeholder { color: #9aa7b6; }
a { color: inherit; }

.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }
.mi { font-family: 'Material Symbols Rounded'; font-weight: normal; font-style: normal; line-height: 1; display: inline-block; vertical-align: middle; -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga'; }
.mi.fill { font-variation-settings: 'FILL' 1; }

/* ---- animations ---- */
@keyframes vozSpin { to { transform: rotate(360deg); } }
@keyframes vozPulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes vozUp { 0% { opacity: 0; transform: translateY(9px); } 100% { opacity: 1; transform: none; } }
@keyframes vozFade { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes vozPop { 0% { opacity: 0; transform: scale(.96); } 100% { opacity: 1; transform: none; } }
@keyframes vozToast { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: none; } }
@keyframes vozGrid { 0% { background-position: 0 0; } 100% { background-position: 46px 46px; } }

/* ---- inputs ---- */
.inp {
  height: 48px; width: 100%; padding: 0 14px; border-radius: 11px;
  border: 1.5px solid #dfe3e7; background: #fff; font-size: 14px; color: var(--text);
  outline: none; transition: border .15s, box-shadow .15s;
}
.inp:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 16%, transparent) !important; }
.inp.mono { font-family: var(--mono); font-size: 12.5px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--muted-2); }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 11px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform .12s, box-shadow .12s, background .12s; white-space: nowrap; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 30%, transparent); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn-ghost { background: #fff; color: var(--text); border: 1px solid #e3e8ef; }
.btn-ghost:hover { background: #f4f6f9; }
.btn-soft { background: #f2f5f9; color: var(--muted-2); }
.btn-soft:hover { background: #e8edf3; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 8px; }
.btn-danger { background: #fff; color: var(--accent); border: 1px solid #e3b0b7; }
.btn-danger:hover { background: #fbeff1; }

/* ---- cards ---- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.card-title { font-size: 13px; font-weight: 700; }

/* ---- toggle ---- */
.toggle { position: relative; display: inline-block; width: 42px; height: 24px; border-radius: 99px; border: none; cursor: pointer; padding: 0; background: #d4dbe4; transition: background .18s; flex: none; vertical-align: middle; }
.toggle.on { background: var(--accent); }
.toggle .knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.35); transition: left .18s; }
.toggle.on .knob { left: 20px; }

/* ---- AUTH ---- */
.auth { position: fixed; inset: 0; display: flex; background: var(--accent-strong); }
.auth-brand { flex: 1.05; position: relative; overflow: hidden; background: radial-gradient(120% 100% at 18% 0%, #c8112f 0%, #9c0c27 56%, #7d0a20 100%); display: flex; flex-direction: column; justify-content: space-between; padding: 48px; min-width: 0; }
.auth-grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 46px 46px; animation: vozGrid 14s linear infinite; opacity: .5; }
.auth-form-side { flex: 1; display: flex; align-items: center; justify-content: center; background: #fff; padding: 32px; min-width: 420px; }
.auth-card { width: 100%; max-width: 360px; }

/* ---- app shell ---- */
.shell { display: flex; height: 100vh; animation: vozFade .35s both; }
.side { width: 248px; flex: none; background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; }
.side-nav { display: flex; align-items: center; gap: 11px; width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: none; background: transparent; color: #46505f; font-size: 14px; font-weight: 500; cursor: pointer; text-align: left; }
.side-nav:hover { background: #f4f6f9; }
.side-nav.active { background: color-mix(in srgb, var(--accent) 11%, #fff); color: var(--accent); font-weight: 600; }
.side-cat { font-size: 11px; font-weight: 600; letter-spacing: .08em; color: var(--muted-3); padding: 6px 10px; text-transform: uppercase; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; flex: none; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.85); backdrop-filter: blur(8px); display: flex; align-items: center; gap: 16px; padding: 0 26px; }
.content { flex: 1; overflow-y: auto; overflow-x: hidden; }

/* ---- stat cards ---- */
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; animation: vozUp .45s both; }
.stat-h { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.stat-v { margin-top: 12px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-family: var(--mono); }

/* ---- camera tile (CamFeed) ---- */
.tile { position: relative; width: 100%; height: 100%; overflow: hidden; background: #0c1118; }
.tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #0c1118; display: block; }
.tile-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 90px rgba(0,0,0,.55); pointer-events: none; }
.tile-top { position: absolute; top: 9px; left: 11px; right: 11px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-family: var(--mono); font-size: 10.5px; color: rgba(255,255,255,.92); text-shadow: 0 1px 3px rgba(0,0,0,.7); pointer-events: none; }
.tile-badges { position: absolute; top: 31px; left: 11px; display: flex; gap: 6px; }
.badge-live { display: inline-flex; align-items: center; gap: 5px; height: 19px; padding: 0 7px; border-radius: 5px; background: rgba(186,12,47,.95); color: #fff; font-family: var(--mono); font-size: 9.5px; font-weight: 600; letter-spacing: .08em; }
.badge-live .dot { width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: vozPulse 1.4s infinite; }
.tile-bottom { position: absolute; bottom: 9px; left: 11px; right: 11px; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; pointer-events: none; }
.tile-label { font-weight: 600; font-size: 12.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-addr { font-size: 10.5px; color: rgba(255,255,255,.72); text-shadow: 0 1px 3px rgba(0,0,0,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-viewers { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.42); color: #fff; font-family: var(--mono); font-size: 10.5px; white-space: nowrap; }
.tile-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 12px; background: rgba(8,10,14,.6); color: rgba(255,255,255,.82); }
.tile-overlay .tag { font-size: 11px; letter-spacing: .16em; border: 1px solid rgba(255,255,255,.28); padding: 8px 14px; border-radius: 8px; }
.spinner { width: 26px; height: 26px; border: 3px solid rgba(255,255,255,.18); border-top-color: #fff; border-radius: 50%; animation: vozSpin .9s linear infinite; }

.cam-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer; animation: vozUp .5s both; transition: transform .14s, box-shadow .14s, border-color .14s; }
.cam-card:hover { transform: translateY(-3px); box-shadow: 0 16px 34px rgba(16,24,40,.1); border-color: #d7deea; }

/* ---- tabs ---- */
.tab { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 15px; border: none; background: none; border-bottom: 2px solid transparent; color: var(--muted-2); font-size: 13.5px; font-weight: 600; cursor: pointer; margin-bottom: -1px; }
.tab.active { border-bottom-color: var(--accent); color: var(--accent); }

/* ---- modal ---- */
.modal-bg { position: fixed; inset: 0; z-index: 60; background: rgba(11,15,23,.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: vozFade .2s both; }
.modal { width: 100%; max-width: 560px; background: #fff; border-radius: 18px; box-shadow: 0 40px 90px rgba(11,15,23,.4); overflow: hidden; animation: vozPop .3s both; }

/* ---- toasts ---- */
#toasts { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 9px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 17px; border-radius: 11px; background: #0e1320; color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: 0 14px 34px rgba(11,15,23,.4); animation: vozToast .26s both; }

.codebox { position: relative; background: #0e1320; border-radius: 11px; padding: 46px 15px 15px; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: #c7d2e8; white-space: pre-wrap; word-break: break-all; }
.input-row { display: flex; align-items: center; padding: 0 14px; border-radius: 10px; border: 1px solid #e3e8ef; background: #f7f9fc; font-family: var(--mono); font-size: 13px; color: var(--text); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.err-text { color: var(--accent); font-size: 13px; min-height: 18px; }

/* ---- адаптив под мобильные ---- */
.hamburger { display: none; }
.side-backdrop { display: none; }
@media (max-width: 880px) {
  .hamburger { display: inline-flex !important; }
  .side {
    position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: 264px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 20px 60px rgba(11,15,23,.35);
  }
  body.nav-open .side { transform: none; }
  body.nav-open .side-backdrop { display: block; position: fixed; inset: 0; background: rgba(11,15,23,.45); z-index: 55; }
  .m-stack { grid-template-columns: 1fr !important; }
  .topbar { padding: 0 14px; gap: 10px; }
  .content { -webkit-overflow-scrolling: touch; }
  /* AUTH: прячем брендовую панель, форма на весь экран */
  .auth-brand { display: none; }
  .auth-form-side { min-width: 0; flex: 1; padding: 24px 20px; }
  .auth-card { max-width: 420px; }
}
@media (max-width: 560px) {
  [data-clock] { display: none; }
  .topbar .serif { font-size: 16px; }
  /* уменьшаем горизонтальные отступы контента на узких экранах */
  .content > div { padding-left: 14px !important; padding-right: 14px !important; }
}
