@import url("fonts.css");
/* Balrakshya — child online-safety service. Government of Nepal palette (opmcm.gov.np). */
:root {
  --gov: #0447af; --band: #2460b9; --deep: #293e92; --ink0: #172554; --crimson: #cc1424;
  --tint: #f4f8ff; --tint2: #d6e7ff; --tint3: #eaf2ff;
  --ink: #1b2540; --ink2: #4b5675; --ink3: #74809e;
  --line: #d9e1ef; --line2: #e8eef8; --surface: #fff; --surface2: #f8fbff; --hover: #f3f8ff;
  --ok: #12703f; --ok-bg: #e5f4ec; --warn: #8a5300; --warn-bg: #fff2d9; --bad: #b3141f; --bad-bg: #fde8ea;
  --f: "Mukta","Noto Sans Devanagari",system-ui,"Segoe UI",sans-serif; --fm: "IBM Plex Mono",monospace;
  --r: 8px; --r-lg: 16px; --shadow: 0 1px 2px rgba(23,37,84,.06), 0 6px 18px rgba(23,37,84,.07);
}
@media (prefers-color-scheme: dark) { :root {
  --ink0:#dce6ff; --tint:#0b1324; --tint2:#1c3363; --tint3:#172a52; --ink:#e4eaf7; --ink2:#aebad4; --ink3:#8390ad;
  --line:#24345a; --line2:#1c2a4a; --surface:#121d36; --surface2:#0f1930; --hover:#17264a;
  --ok:#6fd39b; --ok-bg:#11331f; --warn:#f3c56b; --warn-bg:#352708; --bad:#ff8f98; --bad-bg:#3a1218;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35); color-scheme: dark; }
  .leaflet-tile { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9); }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--f); color: var(--ink); background: var(--tint); line-height: 1.55; -webkit-text-size-adjust: 100%; }
a { color: var(--gov); } a:hover { color: var(--deep); }
h1,h2,h3 { color: var(--ink0); line-height: 1.2; margin: 0 0 .4em; }
.mono { font-family: var(--fm); }
.muted { color: var(--ink3); } .small { font-size: .88rem; } .xs { font-size: .76rem; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* top bar */
.topbar { background: var(--deep); color: #fff; border-bottom: 3px solid var(--crimson); position: sticky; top: 0; z-index: 50; }
.topbar .in { max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.brand img { width: 36px; height: 36px; }
.brand small { display: block; font-weight: 500; font-size: .66rem; color: #c9d6f5; letter-spacing: .02em; }
.topbar .sp { flex: 1; }
.topbar a.tb { color: #dce6ff; text-decoration: none; padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: .92rem; position: relative; }
.topbar a.tb:hover { background: rgba(255,255,255,.12); color:#fff; }
.bell-n { position: absolute; top: -2px; right: -2px; background: var(--crimson); color: #fff; border-radius: 999px; font-size: .62rem; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 3px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 22px 16px 60px; }

/* buttons */
.btn { display: inline-flex; gap: 7px; align-items: center; justify-content: center; background: var(--gov); color: #fff; border: 0; border-radius: var(--r); padding: 11px 18px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--deep); color: #fff; }
.btn.light { background: var(--surface); color: var(--gov); border: 1px solid var(--line); }
.btn.light:hover { background: var(--hover); }
.btn.crimson { background: var(--crimson); } .btn.crimson:hover { background: #a00f1c; }
.btn.ok { background: var(--ok); } .btn.sm { padding: 7px 12px; font-size: .88rem; border-radius: 7px; }
.btn.wide { width: 100%; } .btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* cards & forms */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
label { font-weight: 600; font-size: .9rem; display: block; margin-bottom: 5px; }
input, select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface2); color: var(--ink); }
input[type=color] { padding: 2px; height: 42px; } input[type=checkbox] { width: auto; }
.field { margin-bottom: 14px; }
.chk { display: flex; gap: 10px; align-items: flex-start; }
.chk input { margin-top: 4px; }
.alert { padding: 12px 16px; border-radius: var(--r); margin-bottom: 14px; }
.alert.success { background: var(--ok-bg); color: var(--ok); } .alert.error { background: var(--bad-bg); color: var(--bad); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.t-ok { background: var(--ok-bg); color: var(--ok); } .t-bad { background: var(--bad-bg); color: var(--bad); }
.t-warn { background: var(--warn-bg); color: var(--warn); } .t-off { background: var(--tint3); color: var(--ink3); }

/* auth */
.auth { max-width: 400px; margin: 48px auto; }
.auth .card { padding: 28px; }
.auth h1 { text-align: center; } .auth .lead { text-align: center; color: var(--ink3); margin-bottom: 20px; }

/* dashboard: child cards */
.kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.kid { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.kid:hover { transform: translateY(-2px); border-color: var(--gov); color: var(--ink); }
.kid-top { display: flex; gap: 12px; align-items: center; padding: 16px; }
.avatar { width: 48px; height: 48px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; flex: none; }
.kid-top b { font-size: 1.1rem; color: var(--ink0); } .kid-top .muted { font-size: .84rem; }
.kid-stat { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line2); font-size: .9rem; }
.kid-stat b { color: var(--ink0); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.d-on { background: var(--ok); } .d-off { background: var(--ink3); } .d-bad { background: var(--crimson); }

/* child detail */
.layout { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(0,1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
#map, #pickmap { height: 420px; border-radius: var(--r-lg); border: 1px solid var(--line); z-index: 1; }
.statline { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.pill { display: inline-flex; gap: 6px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: .86rem; font-weight: 600; }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0 18px; }
.subnav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--ink2); font-weight: 600; font-size: .9rem; background: var(--surface); border: 1px solid var(--line); }
.subnav a.on, .subnav a:hover { background: var(--gov); color: #fff; border-color: var(--gov); }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.quick form { margin: 0; } .quick .btn { width: 100%; }

/* bars */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; justify-content: flex-end; height: 100%; }
.bar .b { width: 100%; max-width: 40px; background: var(--gov); border-radius: 6px 6px 0 0; min-height: 3px; }
.bar.today .b { background: var(--crimson); }
.bar span { font-size: .72rem; color: var(--ink3); }
.applist { list-style: none; margin: 0; padding: 0; }
.applist li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.applist .meter { flex: 1; height: 8px; background: var(--tint3); border-radius: 999px; overflow: hidden; }
.applist .meter i { display: block; height: 100%; background: var(--gov); }

/* lists */
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.rows li:last-child { border: 0; }
.ic { width: 38px; height: 38px; border-radius: 10px; background: var(--tint3); color: var(--gov); display: grid; place-items: center; flex: none; font-size: 1.1rem; }
.ic.u { background: var(--bad-bg); color: var(--bad); }
.grow { flex: 1; min-width: 0; } .grow b { color: var(--ink0); }
.grow .muted { font-size: .8rem; }

/* pairing */
.pairbox { text-align: center; max-width: 420px; margin: 0 auto; }
.code { font-family: var(--fm); font-size: 2.4rem; font-weight: 700; letter-spacing: .3em; color: var(--gov); background: var(--tint3); border-radius: var(--r); padding: 14px; margin: 8px 0 4px; }
.pairbox img { width: 220px; height: 220px; background: #fff; padding: 10px; border-radius: var(--r); border: 1px solid var(--line); }
.steps { text-align: left; counter-reset: s; list-style: none; padding: 0; margin: 20px 0; }
.steps li { counter-increment: s; position: relative; padding: 8px 0 8px 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; background: var(--gov); color: #fff; border-radius: 50%; display: grid; place-items: center; font-weight: 700; }

/* safety banner */
.safety { background: var(--tint3); border: 1px solid var(--tint2); border-radius: var(--r); padding: 12px 16px; font-size: .86rem; color: var(--ink2); margin-top: 16px; }
.safety b { color: var(--ink0); }
.foot { text-align: center; color: var(--ink3); font-size: .8rem; padding: 24px 16px; }
.avatar.sm-av { width: 38px; height: 38px; font-size: 1.1rem; }

/* utility classes (CSP forbids inline style attributes) */
.m0 { margin: 0; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; } .mt18 { margin-top: 18px; } .mt20 { margin-top: 20px; }
.tc { text-align: center; } .pad36 { padding: 36px; } .empty-card { text-align: center; padding: 40px; margin-top: 20px; }
.c-bad { color: var(--bad); } .c-ink { color: var(--ink0); }
.mw560 { max-width: 560px; }
.row-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.row-between2 { display: flex; justify-content: space-between; align-items: center; }
.row-baseline { display: flex; justify-content: space-between; align-items: baseline; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.h1row { display: flex; align-items: center; gap: 10px; margin: 0; }
.bg-warn { background: var(--warn-bg); color: var(--warn); }
.bg-bad { background: var(--bad-bg); color: var(--bad); }
.linkbtn { background: none; border: 0; cursor: pointer; font: inherit; }
.auth-foot { text-align: center; margin-top: 16px; }
