/* win.platenext.com — apParent parent console.
   A calm, trustworthy monitoring UI. Blue-family so it reads as a sibling of
   happy.platenext.com without being mistaken for it. Light/dark aware. */

:root {
  --bg: #eef2f9;
  --bg-grad: radial-gradient(1200px 600px at 50% -10%, #dfe8fb 0%, #eef2f9 55%);
  --card: #ffffff;
  --ink: #16202e;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e4e9f2;
  --line-strong: #d3dbe8;
  --brand: #2f6fed;
  --brand-d: #1f56c4;
  --brand-wash: #eaf1ff;
  --ok: #17935a;
  --ok-wash: #e6f6ee;
  --idle: #b7791f;
  --idle-wash: #fbf1dd;
  --off: #7c8aa0;
  --off-wash: #eef1f6;
  --danger: #d64545;
  --shadow-sm: 0 1px 2px rgba(15, 30, 60, .06), 0 2px 8px rgba(15, 30, 60, .05);
  --shadow-md: 0 4px 12px rgba(15, 30, 60, .08), 0 12px 34px rgba(15, 30, 60, .08);
  --radius: 16px;
  --radius-sm: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1220;
    --bg-grad: radial-gradient(1200px 600px at 50% -10%, #16233f 0%, #0c1220 55%);
    --card: #131c2e;
    --ink: #e8eefb;
    --muted: #93a1b8;
    --faint: #64748b;
    --line: #22304a;
    --line-strong: #2c3c5a;
    --brand: #5b8dff;
    --brand-d: #4278f0;
    --brand-wash: #182746;
    --ok: #3ecb86;
    --ok-wash: #12301f;
    --idle: #e2b155;
    --idle-wash: #33270f;
    --off: #7c8aa0;
    --off-wash: #1a2233;
    --danger: #ff6b6b;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3), 0 2px 10px rgba(0,0,0,.25);
    --shadow-md: 0 6px 18px rgba(0,0,0,.4), 0 16px 40px rgba(0,0,0,.35);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image: var(--bg-grad);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
a { color: var(--brand-d); }

/* --- Top bar ------------------------------------------------------------- */
.bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.bar__mark {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 3.4px, transparent 4px),
    radial-gradient(9px 8px at 50% 76%, #fff 0 82%, transparent 84%),
    linear-gradient(135deg, var(--brand), var(--brand-d));
}
.bar__title { font-weight: 700; letter-spacing: .2px; }
.bar__spacer { flex: 1; }
.menu { position: relative; }
.bar__who {
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 12px 6px 10px; display: inline-flex; align-items: center; gap: 8px;
  max-width: 60vw; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.bar__who::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--brand-d));
}
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 6px; z-index: 30;
}
.menu__head { padding: 8px 10px; color: var(--muted); font-size: 12.5px; border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.menu__item { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--ink); padding: 9px 10px; border-radius: 9px; }
.menu__item:hover { background: var(--brand-wash); }
.menu__item--danger { color: var(--danger); }
.menu__item--danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }

/* --- Layout -------------------------------------------------------------- */
main { max-width: 1120px; margin: 0 auto; padding: 22px 16px 72px; }
.loading { color: var(--muted); text-align: center; padding: 60px 0; }

/* --- Centered card (sign in / connect) ----------------------------------- */
.center { min-height: calc(100vh - 120px); display: grid; place-items: center; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 26px;
}
.panel { width: 100%; max-width: 440px; }
.brandmark {
  width: 52px; height: 52px; border-radius: 15px; margin: 0 auto 14px;
  background:
    radial-gradient(circle at 50% 38%, #fff 0 6.6px, transparent 7.4px),
    radial-gradient(18px 16px at 50% 78%, #fff 0 82%, transparent 84%),
    linear-gradient(135deg, var(--brand), var(--brand-d));
  box-shadow: var(--shadow-sm);
}
.panel h1 { font-size: 22px; margin: 0 0 4px; text-align: center; }
.panel .sub { color: var(--muted); text-align: center; margin: 0 0 20px; font-size: 14px; }

label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 650; margin: 14px 0 5px; }
input, select {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font-size: 15px; background: var(--card); color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; border: 1px solid var(--brand-d); font-weight: 650;
}
.btn:hover { background: var(--brand-d); }
.btn:disabled { opacity: .55; cursor: default; }
.btn--google { background: #fff; color: #1f2733; border-color: var(--line-strong); }
.btn--google:hover { background: #f6f8fc; }
.btn--ghost { background: transparent; color: var(--brand-d); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--brand-wash); }
.btn--sm { width: auto; padding: 8px 13px; font-size: 13.5px; }
.gicon { width: 18px; height: 18px; flex: none; }

.hint { font-size: 12.5px; color: var(--faint); margin-top: 14px; line-height: 1.5; text-align: center; }
.hint svg { vertical-align: -2px; }

.msg { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; margin: 14px 0 0; display: none; }
.msg.show { display: block; }
.msg.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.msg.ok  { background: var(--ok-wash); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.msg.info{ background: var(--brand-wash); color: var(--brand-d); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }

/* A quiet, underlined text action — used for "Forgot apParent password?", which
   is a link's worth of weight, not a button's. */
.linkbtn { display: inline-block; background: none; border: 0; padding: 0; margin: 12px 0 0; font-size: 13px; color: var(--brand); cursor: pointer; text-decoration: underline; }
.linkbtn:hover { color: var(--brand-d); }
.linkbtn:disabled { color: var(--faint); cursor: default; text-decoration: none; }

.row { display: flex; gap: 10px; align-items: center; }
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
.btn--ghost .spin, .btn--google .spin { border-color: rgba(120,120,120,.35); border-top-color: var(--brand); }
@keyframes sp { to { transform: rotate(360deg); } }

/* --- Dashboard header ---------------------------------------------------- */
.dash-head { display: flex; align-items: flex-end; gap: 12px; margin: 6px 2px 18px; flex-wrap: wrap; }
.dash-head h1 { font-size: 24px; margin: 0; letter-spacing: -.2px; }
.dash-head .who2 { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.dash-head .grow { flex: 1; }
.count-pill { font-size: 12.5px; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; }

/* --- Child grid ---------------------------------------------------------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.child { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; }
.child__top { display: flex; align-items: center; gap: 11px; padding: 14px 16px 12px; }
.avatar { width: 42px; height: 42px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; background: linear-gradient(135deg, var(--brand), var(--brand-d)); }
.avatar[data-h="1"] { background: linear-gradient(135deg, #12b981, #0e8f66); }
.avatar[data-h="2"] { background: linear-gradient(135deg, #a855f7, #7e3ff2); }
.avatar[data-h="3"] { background: linear-gradient(135deg, #f97316, #ea6a0e); }
.avatar[data-h="4"] { background: linear-gradient(135deg, #ec4899, #db2777); }
.child__name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.child__meta { color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; letter-spacing: .3px; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.on  { color: var(--ok);  background: var(--ok-wash); }
.pill.idle{ color: var(--idle);background: var(--idle-wash); }
.pill.off { color: var(--off); background: var(--off-wash); }

.shot { position: relative; margin: 0 16px; border-radius: 12px; overflow: hidden; background: #0b1120; aspect-ratio: 16 / 10; border: 1px solid var(--line); }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.shot__empty { position: absolute; inset: 0; display: grid; place-items: center; color: #7b8aa3; font-size: 13px; text-align: center; padding: 16px; }
.shot__stamp { position: absolute; left: 8px; bottom: 8px; font-size: 11px; color: #dbe6ff; background: rgba(10,16,30,.6); padding: 3px 8px; border-radius: 999px; backdrop-filter: blur(4px); }

.child__body { padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.checkin { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.checkin b { color: var(--ink); font-weight: 600; }
.lock { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; padding: 9px 11px; border-radius: 10px; background: var(--idle-wash); color: var(--idle); border: 1px solid color-mix(in srgb, var(--idle) 25%, transparent); }

.tabs { display: flex; gap: 4px; background: var(--off-wash); border-radius: 10px; padding: 3px; }
.tabs button { flex: 1; border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 6px 4px; border-radius: 8px; }
.tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.tablist { font-size: 13px; max-height: 168px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.tablist div { padding: 7px 11px; border-bottom: 1px solid var(--line); word-break: break-word; }
.tablist div:last-child { border-bottom: 0; }
.tablist .empty { color: var(--faint); text-align: center; padding: 18px 10px; }
.tablist .cnt { color: var(--faint); font-variant-numeric: tabular-nums; float: right; }

/* --- Empty / error states ------------------------------------------------ */
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .big { font-size: 17px; color: var(--ink); font-weight: 650; margin-bottom: 6px; }

/* --- Lightbox ------------------------------------------------------------ */
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(6,10,20,.86); display: grid; place-items: center; padding: 24px; }
.lightbox img { max-width: 96vw; max-height: 86vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.lightbox__cap { position: fixed; bottom: 18px; color: #cdd8ee; font-size: 13px; }
.lightbox__close { position: fixed; top: 16px; right: 20px; font-size: 30px; line-height: 1; color: #fff; background: none; border: 0; }

.live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .dash-head h1 { font-size: 21px; }
}
