/* Палитра «Oko Doma» / dashboard.html */
:root {
  --bg: #060B14;
  --card: #0E172D;
  --card-2: #0A1220;
  --accent: #3A75FF;
  --accent-press: #2E5FD6;
  --text: #F1F5FE;
  --muted: #8CA0C9;
  --online: #22C55E;
  --offline: #6B7A99;
  --danger: #EF4444;
  --border: #1C2A4A;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
#app { min-height: 100%; }

/* --- центрированные экраны (вход/otp/регистрация/объект) --- */
.screen { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.h1 { font-size: 22px; margin: 0 0 14px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.5; }
.err { color: var(--danger); font-size: 14px; min-height: 18px; margin: 4px 0; }

.field {
  width: 100%; height: 48px; margin-top: 10px; padding: 0 14px;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 16px; outline: none;
}
.field:focus { border-color: var(--accent); }
.field.code { letter-spacing: 8px; text-align: center; font-size: 22px; }

.btn {
  width: 100%; height: 48px; margin-top: 12px; border: 0; border-radius: var(--radius);
  font-size: 16px; font-weight: 700; cursor: pointer; color: var(--text); background: transparent;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-press); }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--border); }
.btn.sm { width: auto; height: 36px; padding: 0 14px; margin: 0 0 0 8px; font-size: 14px; }
.row-links { margin-top: 14px; text-align: center; }
.link { color: var(--accent); text-decoration: none; font-weight: 600; }

/* --- полностраничные экраны (камеры/камера) --- */
.page { max-width: 860px; margin: 0 auto; padding: 12px 16px 32px; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 0 14px; }
.topbar .title { font-size: 18px; font-weight: 700; }
.topbar .spacer { flex: 1; }

.cam-group-title { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; color: var(--muted); font-weight: 600; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.on { background: var(--online); }
.dot.off { background: var(--offline); }

.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cam-tile { text-align: left; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0; overflow: hidden; cursor: pointer; color: var(--text); }
.cam-thumb { aspect-ratio: 16/9; background: linear-gradient(135deg, #0A1220, #12203f); display: flex; align-items: center; justify-content: center; }
.cam-ch { font-size: 28px; font-weight: 800; color: #2b3d63; }
.cam-name { padding: 8px 10px; font-size: 14px; font-weight: 600; }
.empty { text-align: center; padding: 40px 0; }

/* --- видео камеры --- */
.video-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
.corner-time { position: absolute; right: 10px; top: 8px; font-variant-numeric: tabular-nums; font-size: 13px; color: #fff; background: rgba(0,0,0,.45); padding: 2px 8px; border-radius: 8px; }
.badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; color: #fff; background: rgba(6,11,20,.55); font-size: 14px; }
.badge.playing { display: none; }
.badge.no_video .badge-text { color: var(--danger); }
.spinner { width: 26px; height: 26px; border: 3px solid rgba(255,255,255,.25); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.metrics { margin-top: 8px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
