/* Tally Remote — shared look for the camera grid, dashboard, sign-in and admin pages (from the dashboard mockup) */
:root {
  --bg: #0f1117; --surface: #181c27; --surface2: #1e2333; --border: #2a2f42;
  --fg: #e8ecf4; --fg-muted: #8a93ab; --fg-dim: #5a6178;
  --accent: #e53e3e; --accent-glow: rgba(229,62,62,.15);
  --preview: #38a169; --preview-glow: rgba(56,161,105,.15);
  --blue: #4a90d9; --blue-dim: rgba(74,144,217,.12);
  --warn: #d97706; --warn-dim: rgba(217,119,6,.12);
  --success: #38a169; --success-dim: rgba(56,161,105,.12);
  --radius: 8px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f0f2f8; --surface: #ffffff; --surface2: #f7f8fc; --border: #dde1ed;
    --fg: #1a1f33; --fg-muted: #5a6478; --fg-dim: #9aa0b8;
    --accent: #c53030; --accent-glow: rgba(197,48,48,.08);
    --preview: #276749; --preview-glow: rgba(39,103,73,.08);
    --blue: #2b6cb0; --blue-dim: rgba(43,108,176,.08);
    --warn: #c05621; --warn-dim: rgba(192,86,33,.08);
    --success: #276749; --success-dim: rgba(39,103,73,.08);
    color-scheme: light;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg); min-height: 100vh;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--blue); }
[hidden] { display: none !important; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* Brand */
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-icon { width: 36px; height: 36px; border-radius: 9px; background: var(--accent); display: grid; place-items: center; flex: none; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: -.4px; line-height: 1.1; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 10.5px; color: var(--fg-muted); letter-spacing: .06em; text-transform: uppercase; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px;
  border-radius: var(--radius); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap; text-decoration: none; transition: opacity .12s, background .12s;
}
.btn:hover { opacity: .88; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-blue { background: var(--blue); color: #fff; }
.btn-ghost { background: transparent; color: var(--fg-muted); border-color: var(--border); }
.btn-ghost:hover { color: var(--fg); background: var(--surface2); opacity: 1; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-danger { color: var(--accent); }

/* Pills */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--fg-muted); white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--fg-dim); flex: none; }
.dot.live { background: var(--success); box-shadow: 0 0 0 2px var(--success-dim); }
.dot.warn { background: var(--warn); }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.card-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 13.5px; font-weight: 600; }
.card-desc { font-size: 12px; color: var(--fg-muted); margin-top: 1px; }
.card-body { padding: 16px 18px; }
.section-title { font-size: 12px; font-weight: 600; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .07em; margin: 0 0 12px; }

/* Banners */
.banner { border: 1px solid; border-radius: var(--radius); padding: 11px 16px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 500; }
.banner span { flex: 1; min-width: 180px; }
.banner.warn { background: var(--warn-dim); border-color: var(--warn); color: var(--warn); }
.banner.info { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }

/* Forms */
.field-label { font-size: 12px; font-weight: 600; color: var(--fg-muted); margin-bottom: 5px; display: block; }
.input {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; padding: 9px 12px;
  font: inherit; font-size: 14px; color: var(--fg);
}
.input:focus { outline: none; border-color: var(--blue); }
.url { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: var(--blue); background: var(--blue-dim); padding: 3px 8px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 100%; vertical-align: middle; }

/* State tags */
.tag { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.tag.program { background: var(--accent-glow); color: var(--accent); }
.tag.preview { background: var(--preview-glow); color: var(--preview); }
.tag.clear, .tag.idle { background: var(--surface2); color: var(--fg-dim); }

/* Toast */
.toast {
  position: fixed; bottom: max(24px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%) translateY(8px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 18px;
  font-size: 13px; font-weight: 600; box-shadow: 0 8px 32px rgba(0,0,0,.35); opacity: 0; pointer-events: none;
  transition: opacity .15s, transform .15s; z-index: 200; max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: var(--accent); color: var(--accent); }
