/* Family Cam - shared UI */
:root {
  --green: #16A34A;
  --green-600: #15924a;
  --green-050: #E9F8EF;
  --ink: #111826;
  --ink-2: #51607A;
  --muted: #8A94A6;
  --line: #E6E9F0;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --dark: #141B2A;
  --danger: #E5484D;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: #eaedf7; -webkit-font-smoothing: antialiased; min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 50% -12%, #1d2748 0%, rgba(29,39,72,0) 58%),
    radial-gradient(900px 600px at 85% 6%, rgba(139,125,255,.14) 0%, transparent 55%),
    linear-gradient(180deg, #0e1426 0%, #0b1020 55%, #090d1a 100%); }
a { color: inherit; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 390px;
  background: linear-gradient(180deg, rgba(21,28,50,.78), rgba(15,21,38,.78));
  border: 1px solid rgba(255,255,255,.10); border-radius: 22px; box-shadow: 0 30px 70px rgba(0,0,0,.5);
  padding: 34px 30px; text-align: center; backdrop-filter: blur(16px) saturate(140%);
}
.brand { width: 60px; height: 60px; border-radius: 17px; background: linear-gradient(160deg, #1fbf67, #12894a); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 10px 24px rgba(22,163,74,.4), inset 0 1px 0 rgba(255,255,255,.22); overflow: hidden; }
.brand svg { width: 30px; height: 30px; }
.brand img { width: 100%; height: 100%; object-fit: cover; }
.auth .brandname { font-weight: 700; font-size: 16px; color: #eef1fb; margin-top: 14px; letter-spacing: -.2px; }
.auth .brandname:empty { display: none; }
.auth h1 { font-size: 23px; font-weight: 700; margin: 20px 0 5px; letter-spacing: -.3px; color: #eef1fb; }
.auth .sub { color: #98a0bd; font-size: 14px; margin: 0 0 24px; }
.badge-admin { display: inline-block; margin-top: 12px; font-size: 11.5px; font-weight: 600; color: #b7adff; background: rgba(139,125,255,.14); border: 1px solid rgba(139,125,255,.32); padding: 4px 13px; border-radius: 999px; letter-spacing: .4px; }

.field { text-align: left; margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: #aab2cf; margin-bottom: 7px; }
.input {
  width: 100%; height: 50px; padding: 0 15px; font-size: 15px; color: #eaedf7;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: #6b7493; }
.input:focus { border-color: rgba(110,168,254,.6); box-shadow: 0 0 0 4px rgba(110,168,254,.15); background: rgba(255,255,255,.08); }

.btn {
  width: 100%; height: 50px; border: none; border-radius: 13px; font-size: 15px; font-weight: 650;
  cursor: pointer; transition: transform .05s, filter .15s, background .15s, box-shadow .15s; font-family: inherit;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, #1fbf67, #16a34a); color: #fff; box-shadow: 0 10px 24px rgba(22,163,74,.35); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-dark { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); color: #eaedf7; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn-dark:hover { background: rgba(255,255,255,.11); }
.btn-dark svg { width: 18px; height: 18px; }

.divider { display: flex; align-items: center; gap: 12px; color: #6b7493; font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.10); }
.err { color: #ff8088; font-size: 13.5px; min-height: 18px; margin-top: 12px; }
.linklike { color: #98a0bd; font-size: 13.5px; text-decoration: none; }

/* ---------- app shell ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--line); height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; }
.topbar .l { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.topbar .l .dotlogo { width: 30px; height: 30px; border-radius: 9px; background: var(--green); display: inline-flex; align-items: center; justify-content: center; }
.topbar .l .dotlogo svg { width: 17px; height: 17px; }
.topbar .r { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--ink-2); }
.topbar .r a { cursor: pointer; color: var(--ink-2); text-decoration: none; }
.topbar .r a:hover { color: var(--ink); }
.pill { background: var(--green-050); color: var(--green); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }

.container { max-width: 880px; margin: 0 auto; padding: 22px 20px 48px; }
.section-title { font-size: 13px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); margin: 6px 2px 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 18px; }

.list-row { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; transition: background .12s, border-color .12s; }
.list-row:hover { background: #FAFBFD; border-color: #DADFEA; }
.list-row .meta { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 11px; background: var(--green-050); color: var(--green); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.list-row .name { font-weight: 650; }
.list-row .sub { color: var(--muted); font-size: 13px; }

.btn-sm { height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; font-family: inherit; }
.btn-sm.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn-sm.ghost { background: #F1F3F8; border-color: transparent; color: var(--ink-2); }
.btn-sm.danger { background: #fff; border-color: #F3C3C5; color: var(--danger); }

.statusdot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: #16A34A; box-shadow: 0 0 0 3px rgba(22,163,74,.15); }
.statusdot.off { background: #C4CAD6; box-shadow: none; }

.form-inline { display: flex; gap: 10px; flex-wrap: wrap; }
.form-inline .input { height: 46px; flex: 1; min-width: 160px; }

/* ---------- camera window ---------- */
.cam { background: #0C1120; border-radius: 16px; overflow: hidden; border: 1px solid #0a0f1c; }
.cam-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; color: #D7DEEC; font-size: 14px; font-weight: 600; }
.cam-head a { color: #9AA6BE; cursor: pointer; font-weight: 500; }
.cam-video { background: #000; display: flex; align-items: center; justify-content: center; min-height: 240px; }
.cam-video video { width: 100%; max-height: 70vh; transition: transform .2s; }
.toolbar { display: flex; gap: 8px; padding: 12px 14px; flex-wrap: wrap; background: #0F1626; }
.toolbar button { height: 40px; min-width: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid #263149; background: #18223A; color: #D7DEEC; font-size: 14px; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.toolbar button:hover { background: #1f2c49; }
.toolbar button.on { background: var(--green); border-color: var(--green); color: #fff; }
.cam-status { padding: 10px 14px; color: #8794AE; font-size: 13px; background: #0F1626; }

/* telemetry + summary */
.telemetry { display: flex; align-items: center; gap: 14px; color: #D7DEEC; font-size: 13px; font-weight: 500; }
.telemetry .t { display: inline-flex; align-items: center; gap: 5px; }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.bars i { width: 3px; border-radius: 1px; display: inline-block; background: #35507a; }
.bars i.on { background: #37d39b; }
.summary { display: flex; flex-wrap: wrap; gap: 10px; padding: 14px; background: #0F1626; }
.stat { background: #18223A; border: 1px solid #263149; border-radius: 12px; padding: 10px 14px; min-width: 110px; }
.stat .k { font-size: 11px; color: #8794AE; text-transform: uppercase; letter-spacing: .4px; }
.stat .v { font-size: 17px; font-weight: 700; color: #EAF0FB; margin-top: 2px; }
.store { padding: 0 14px 16px; background: #0F1626; }
.store .track { height: 10px; background: #1b2740; border-radius: 6px; overflow: hidden; }
.store .fill { height: 100%; background: linear-gradient(90deg, #16A34A, #37d39b); width: 0; }
.store .lbl { color: #8794AE; font-size: 12px; margin-top: 7px; }
.devmeta { color: var(--muted); font-size: 12px; margin-top: 2px; }

.hidden { display: none !important; }
