/* Khujedei admin console. Brand: Navy #142D4E, Teal #0F8B83, Amber #F4B544, background #F7F9FC, text #263445. */
:root {
  --navy: #142D4E; --teal: #0F8B83; --teal-d: #0B6F69; --amber: #F4B544; --bg: #F7F9FC; --text: #263445;
  --muted: #6B7A90; --line: #E2E8F0; --card: #FFFFFF; --red: #C0392B; --red-bg: #FDECEA; --green-bg: #E6F4F2; --amber-bg: #FEF5E1;
  --radius: 10px; --font: Inter, "Hind Siliguri", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 16px; color: var(--navy); }
h2 { font-size: 16px; margin: 0 0 12px; color: var(--navy); }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #fff; padding: 18px 12px; display: flex; flex-direction: column; gap: 2px; }
.brand { font-weight: 700; font-size: 17px; padding: 4px 10px 16px; letter-spacing: .2px; }
.brand span { color: var(--amber); }
.side a { color: #C9D4E3; padding: 8px 10px; border-radius: 8px; display: block; }
.side a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.side a.on { background: var(--teal); color: #fff; }
.side .grow { flex: 1; }
.side .who { font-size: 12px; color: #9FB0C6; padding: 8px 10px; border-top: 1px solid rgba(255,255,255,.12); margin-top: 8px; }
.side .who button { margin-top: 6px; }
main { padding: 24px 28px; max-width: 1200px; width: 100%; }
@media (max-width: 800px) { .shell { grid-template-columns: 1fr; } .side { flex-direction: row; flex-wrap: wrap; } .side .grow, .brand { display: none; } }

/* pieces */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.stat .n { font-size: 26px; font-weight: 700; color: var(--navy); }
.stat .l { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
dl.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; word-break: break-word; }

table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; background: #FBFCFE; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #F3F7FB; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.tablewrap table { border: 0; }
.tablewrap tr:last-child td { border-bottom: 0; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: #EEF2F7; color: var(--text); white-space: nowrap; }
.pill.ok { background: var(--green-bg); color: var(--teal-d); }
.pill.warn { background: var(--amber-bg); color: #8A5A00; }
.pill.bad { background: var(--red-bg); color: var(--red); }

/* forms */
input, select, textarea { font: inherit; color: var(--text); border: 1px solid #CBD5E1; border-radius: 8px; padding: 7px 10px; background: #fff; min-width: 0; }
textarea { width: 100%; min-height: 90px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(15,139,131,.35); border-color: var(--teal); }
label { display: block; font-size: 12px; color: var(--muted); margin: 8px 0 3px; }
button { font: inherit; border: 0; border-radius: 8px; padding: 7px 14px; cursor: pointer; background: var(--teal); color: #fff; font-weight: 600; }
button:hover { background: var(--teal-d); }
button.ghost { background: transparent; color: var(--teal); border: 1px solid var(--teal); }
button.ghost:hover { background: var(--green-bg); }
button.danger { background: var(--red); }
button.small { padding: 4px 10px; font-size: 12.5px; }
button:disabled { opacity: .55; cursor: default; }
form.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
form.inline label { margin-top: 0; }

/* login */
.login { max-width: 380px; margin: 9vh auto; }
.login .card { padding: 26px; }
.login h1 { text-align: center; }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 16px; }
.key { font-family: ui-monospace, Menlo, monospace; font-size: 17px; letter-spacing: 1px; background: var(--bg); border: 1px dashed var(--line); padding: 10px; border-radius: 8px; text-align: center; word-break: break-all; }

/* messages */
.msg { padding: 10px 12px; border-radius: 8px; margin: 10px 0; }
.msg.err { background: var(--red-bg); color: var(--red); }
.msg.ok { background: var(--green-bg); color: var(--teal-d); }
#toast { position: fixed; right: 18px; bottom: 18px; max-width: 420px; z-index: 30; }
#toast .msg { box-shadow: 0 6px 24px rgba(20,45,78,.18); }

/* modal */
.backdrop { position: fixed; inset: 0; background: rgba(20,45,78,.45); display: flex; align-items: center; justify-content: center; z-index: 20; }
.modal { background: #fff; border-radius: 12px; padding: 22px; width: min(420px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal input { width: 100%; }
