/* =====================================================================
   Nigraan demo - page-specific styles
   Purpose : Sign-in, dashboard catalogue, district profile, super admin
             switches, field-app phone, Ask Nigraan chat, integration map.
   Related : js/modules/*.js
   Version : 0.2
   ===================================================================== */
/* ---------- sign-in ---------- */
.login { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); min-height: 100vh; }
.lg-brand { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 0% 0%, #12524a 0%, var(--brand-deep) 55%, var(--brand-deeper) 100%); color: #e6f2ef; padding: 48px 52px 30px; display: flex; flex-direction: column; }
.lg-logo { width: 150px; height: auto; }
.lg-copy { position: relative; z-index: 1; margin-top: auto; margin-bottom: 30px; }
.lg-copy h1 { font-family: var(--f-display); font-weight: 800; font-size: clamp(54px, 6.4vw, 92px); line-height: .95; color: #fff; letter-spacing: -0.02em; }
.lg-tag { font-size: 18px; line-height: 1.45; color: #cfe5df; max-width: 30ch; margin: 16px 0 26px; }
.lg-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; border-top: 1px solid rgba(255, 255, 255, .16); }
.lg-facts div { padding: 14px 14px 0 0; }
.lg-facts dt { font-family: var(--f-display); font-weight: 750; font-size: 32px; color: #fff; line-height: 1; }
.lg-facts dd { margin: 6px 0 0; font-size: 13px; color: #b9d6cf; line-height: 1.35; }
.lg-src { display: inline-block; font-size: 10.5px; color: var(--gold); border: 1px solid rgba(189, 171, 56, .5); border-radius: 99px; padding: 0 6px; margin-top: 4px; }
.lg-dots { position: absolute; right: -30px; top: 70px; width: 64%; height: auto; opacity: .75; pointer-events: none; -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 92%); mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 92%); }
.lg-foot { position: relative; z-index: 1; font-size: 12px; color: #8fb8af; margin: 0; }
.lg-form { background: var(--surface); display: flex; align-items: center; padding: 40px 48px; }
.lg-inner { max-width: 600px; width: 100%; margin: 0 auto; }
.lg-inner h2 { font-size: 26px; font-weight: 750; margin-bottom: 6px; }
.roles { display: flex; flex-direction: column; gap: 8px; margin: 22px 0 18px; }
.role { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); cursor: pointer; transition: border-color .15s, background .15s; }
.role:hover { border-color: var(--line-2); background: var(--surface-2); }
.role.on { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 4px 0 0 var(--brand); }
.role input { position: absolute; opacity: 0; pointer-events: none; }
.role:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.role .av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-deep); color: #fff; font-weight: 700; font-size: 13px; }
.role.on .av { background: var(--brand); }
.role .rt b { display: block; font-size: 14.5px; }
.role .rt span { display: block; font-size: 12.5px; color: var(--ink-2); line-height: 1.35; margin-top: 2px; }
.role .sc { font-size: 12px; color: var(--muted); text-align: right; max-width: 130px; line-height: 1.3; }
.lg-go { width: 100%; min-height: 46px; font-size: 15px; }

/* ---------- catalogue ---------- */
.dom-block { margin-bottom: 22px; }
.dom-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); margin-bottom: 10px; }
.dom-head h2 { font-size: 17px; font-weight: 700; margin-right: 4px; }
.dom-own { font-size: 12.5px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.sys { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 10px; row-gap: 2px; padding: 11px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.sys:hover { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); color: var(--ink); }
.sys .sid { grid-row: 1 / 3; font-size: 11.5px; font-weight: 700; color: var(--brand-ink); background: var(--brand-tint); border-radius: 6px; padding: 3px 6px; align-self: start; }
.sys .snm { font-weight: 650; font-size: 14px; line-height: 1.3; }
.sys .ssub { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sys .smeth { grid-column: 2; display: flex; gap: 6px; margin-top: 5px; color: var(--pin); }
.sys .smeth svg, .lg-m svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lg-m { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 12px; }
.lg-m svg { color: var(--pin); }

/* ---------- district profile ---------- */
.dom-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.ds-row { display: grid; grid-template-columns: 104px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 7px 4px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; }
.ds-row:hover { background: var(--surface-2); color: var(--brand-ink); }
.ds-row.off { color: var(--muted); }

/* ---------- super admin ---------- */
.ctl-matrix td { padding: 2px 1px; text-align: center; }
.ctl-matrix td.rh { text-align: left; }
.tog { width: 30px; height: 18px; border-radius: 99px; border: 0; background: var(--line-2); position: relative; padding: 0; vertical-align: middle; }
.tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; transition: transform .15s var(--ease); }
.tog.on { background: var(--brand); }
.tog.on::after { transform: translateX(12px); }
.tog.draft { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--gold); }

/* ---------- field app phone ---------- */
.phone-col { display: flex; justify-content: center; }
.phone { width: 340px; max-width: 100%; border-radius: 34px; background: #0f1d1a; padding: 12px; box-shadow: var(--shadow-pop); }
.ph-top { display: flex; align-items: center; gap: 8px; background: var(--brand-deep); color: #fff; padding: 14px 14px 12px; border-radius: 24px 24px 0 0; font-size: 13.5px; }
.ph-top img { width: 22px; }
.ph-net { border: 0; border-radius: 99px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; background: #1d7a4c; color: #fff; }
.ph-net.off { background: var(--critical); }
.ph-body { background: var(--surface); padding: 14px; border-radius: 0 0 24px 24px; }
.ph-body .field { margin-bottom: 10px; }
.ph-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 4px; }
.ph-queue { color: #f3d99a; font-size: 12px; text-align: center; padding: 6px 0 2px; min-height: 22px; }
.ph-hint { color: #9fb8b2; font-size: 11.5px; text-align: center; padding: 0 10px 4px; }
.hub-tbl { table-layout: fixed; min-width: 980px; }
.hub-tbl td { font-size: 12.5px; }
.hub-tbl code { font-size: 11px; word-break: break-all; }
.hub-tbl .pin { max-width: none; }

/* ---------- Ask Nigraan ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.msg.me { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; font-size: 12.5px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; }
.sugg .btn { font-weight: 500; text-align: left; }

/* ---------- integration map ---------- */
.imap .node { cursor: pointer; }
.imap .node:hover rect, .imap .node:focus rect { stroke: var(--pin); stroke-width: 1.5; }
.imap .node:focus { outline: none; }
.imap text { font-size: 12px; }
.imap .lk { transition: stroke .15s, stroke-opacity .15s; }

@media (max-width: 1100px) {
  .login { grid-template-columns: 1fr; }
  .lg-brand { padding: 28px 22px 22px; min-height: 420px; }
  .lg-form { padding: 28px 18px; }
  .role { grid-template-columns: 40px minmax(0, 1fr); }
  .role .sc { display: none; }
  .dom-status { grid-template-columns: 1fr; }
}

/* ---------- presenter's guide ---------- */
.guide { margin: 14px 0 0; padding-left: 22px; }
.guide li { padding: 10px 0 12px; border-top: 1px solid var(--line); }
.guide li:first-child { border-top: 0; }
.guide li::marker { font-family: var(--f-display); font-weight: 700; color: var(--brand-ink); }
.g-t { font-weight: 650; font-size: 14.5px; }
.g-d { color: var(--ink-2); font-size: 13.5px; margin-top: 2px; }
