/* AA Digital Network panel. Colours come from the logo: navy #2D2B5D, red #E31E28. */
:root {
  --navy: #2D2B5D;
  --navy-600: #3B3975;
  --red: #E31E28;
  --red-700: #B3161F;
  --ink: #1B2233;
  --ink-2: #3F4859;
  --muted: #5E6778;
  --faint: #7A8394;
  --border: #E6E8EF;
  --border-2: #DADDE5;
  --line: #EEF0F4;
  --ground: #F5F6FA;
  --panel: #FFFFFF;
  --soft: #F8F9FC;
  --tint: #EEEEF6;

  --good: #067A5F;   --good-bg: #E6F6F1;
  --weak: #A15C07;   --weak-bg: #FEF3E2;
  --bad: #C0362C;    --bad-bg: #FDECEA;
  --strong: #6B2FA3; --strong-bg: #F3ECFA;
  --info-bg: #EEEEF6;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 27, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 27, 42, .18);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--ink); background: var(--ground); }
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ur { font-family: var(--urdu); direction: rtl; unicode-bidi: isolate; line-height: 2; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ------------------------------------------------------------ app shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 18px 14px; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 18px; }
.brand img { width: 30px; height: 55px; object-fit: contain; }
.brand .b1 { color: var(--navy); font-weight: 700; font-size: 15px; letter-spacing: .01em; display: block; }
.brand .b2 { font-size: 11px; color: var(--muted); letter-spacing: .18em; font-weight: 600; display: block; }
.brand .b3 { font-size: 11px; color: var(--red); font-weight: 600; margin-top: 2px; display: block; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px;
  color: var(--ink-2); font-size: 14px; font-weight: 500;
}
.nav a svg { width: 18px; height: 18px; stroke: var(--faint); flex-shrink: 0; }
.nav a:hover { background: var(--soft); color: var(--navy); }
.nav a.active { background: var(--tint); color: var(--navy); font-weight: 700; }
.nav a.active svg { stroke: var(--red); }
.nav a .soon { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--faint); background: var(--line); padding: 1px 6px; border-radius: 8px; }
.sidebar .grow { flex: 1; }
.me { border-top: 1px solid var(--line); padding: 14px 8px 0; display: flex; align-items: center; gap: 10px; }
.me .who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.me .who b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { font-size: 12px; color: var(--muted); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  object-fit: cover; flex-shrink: 0;
}
.avatar.lg { width: 88px; height: 88px; font-size: 28px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 64px; flex-shrink: 0; background: var(--panel); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px; padding: 0 32px; position: sticky; top: 0; z-index: 5;
}
.topbar .grow { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 16px; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.content { padding: 28px 32px 40px; display: flex; flex-direction: column; gap: 20px; max-width: 1480px; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { font-size: 14px; color: var(--muted); margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--red); }

/* ------------------------------------------------------------ cards & grids */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
.card.flush .card-head { padding: 18px 22px 0; }
.card-head .sub { font-size: 13px; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.span2 { grid-column: span 2; }
.kpi { display: flex; flex-direction: column; gap: 6px; }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.accent { border-top: 3px solid var(--red); }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: 14px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 16px; background: var(--soft); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #FBFBFD; }
.table .right { text-align: right; }
.table .title { font-weight: 600; color: var(--ink); }
.table .title:hover { color: var(--red); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------ badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px; white-space: nowrap; background: var(--line); color: var(--ink-2); }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.weak { background: var(--weak-bg); color: var(--weak); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.strong { background: var(--strong-bg); color: var(--strong); }
.badge.navy { background: var(--tint); color: var(--navy); }
.badge.red { background: #FDECEC; color: var(--red-700); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; background: var(--navy); color: #fff; text-decoration: none;
}
.btn:hover { background: var(--navy-600); color: #fff; }
.btn.secondary { background: var(--panel); color: var(--ink); border-color: var(--border-2); }
.btn.secondary:hover { border-color: var(--navy); color: var(--navy); }
.btn.danger { background: var(--panel); color: var(--bad); border-color: #F2C4BF; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.red { background: var(--red); }
.btn.red:hover { background: var(--red-700); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.link { background: none; border: none; color: var(--navy); padding: 0; height: auto; }
.btn.link:hover { color: var(--red); }
.btn svg { width: 16px; height: 16px; }
form.inline { display: inline; }

/* ------------------------------------------------------------ forms */
.form { display: flex; flex-direction: column; gap: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field .label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .error { font-size: 12px; color: var(--bad); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; height: 40px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 0 12px;
  font: inherit; font-size: 14px; color: var(--ink); background: var(--panel);
}
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(45, 43, 93, .12); }
.input.is-invalid { border-color: var(--bad); }
.input.ur { font-family: var(--urdu); text-align: right; line-height: 1.6; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.check {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--panel); cursor: pointer; font-size: 14px;
}
.check:hover { border-color: var(--navy); }
.check input { margin-top: 3px; accent-color: var(--navy); }
.check small { display: block; color: var(--muted); font-size: 12px; }
.segmented { display: inline-flex; gap: 4px; background: var(--line); padding: 4px; border-radius: var(--radius-sm); }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 7px 14px; border-radius: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.segmented input:checked + span { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 2px solid var(--red); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }
fieldset.section { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px 20px; margin: 0; background: var(--panel); }
fieldset.section legend { font-size: 14px; font-weight: 700; padding: 0 6px; color: var(--navy); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters .field { width: 190px; }
.filters .field.wide { width: 280px; }

/* ------------------------------------------------------------ alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert.ok { background: var(--good-bg); color: #054F3E; border-color: #BFE6D9; }
.alert.error { background: var(--bad-bg); color: #8A241D; border-color: #F2C4BF; }
.alert.info { background: var(--info-bg); color: var(--navy); border-color: #DCDCEE; }
.alert.warn { background: var(--weak-bg); color: #7A4505; border-color: #F6D9A8; }
.secret {
  font-family: var(--mono); font-size: 16px; font-weight: 600; background: var(--panel); border: 1px dashed var(--navy);
  padding: 4px 10px; border-radius: 6px; user-select: all; color: var(--ink);
}

/* ------------------------------------------------------------ activity feed */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: none; }
.feed .ico { width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 11px; font-weight: 700; }
.feed .body { flex: 1; min-width: 0; font-size: 13px; }
.feed .body b { font-weight: 600; }
.feed .time { font-size: 12px; color: var(--muted); white-space: nowrap; }
details.diff summary { cursor: pointer; color: var(--navy); font-size: 12px; font-weight: 600; }
details.diff table { margin-top: 8px; border-collapse: collapse; font-size: 12px; width: 100%; }
details.diff td, details.diff th { padding: 4px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
details.diff .old { background: #FFF5F4; color: #8A241D; }
details.diff .new { background: #F1FAF6; color: #054F3E; }

/* ------------------------------------------------------------ auth screens */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art {
  background: radial-gradient(1200px 600px at 20% 10%, #3B3975 0%, var(--navy) 55%, #1F1D45 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-art::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; border: 40px solid rgba(227, 30, 40, .55); }
.auth-art .logo { display: flex; align-items: center; gap: 14px; }
.auth-art .logo img { width: 40px; height: 73px; object-fit: contain; background: #fff; border-radius: 8px; padding: 4px; }
.auth-art h2 { font-size: 30px; font-weight: 700; line-height: 1.2; max-width: 440px; }
.auth-art p { color: #C9C8E3; max-width: 420px; margin-top: 12px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--ground); }
.auth-box { width: 100%; max-width: 400px; background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 32px; box-shadow: var(--shadow); }
.auth-box h1 { font-size: 22px; }
.auth-box .sub { color: var(--muted); margin: 6px 0 22px; }
.auth-box .btn { width: 100%; height: 44px; }
.remember { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); }
.remember input { accent-color: var(--navy); }

/* ------------------------------------------------------------ pagination */
.pager { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); flex-wrap: wrap; gap: 8px; }
.pager ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.pager a, .pager span.pg { display: inline-flex; min-width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0 8px; border-radius: 6px; border: 1px solid var(--border); color: var(--ink-2); background: var(--panel); }
.pager a:hover { border-color: var(--navy); color: var(--navy); }
.pager .current span.pg { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager .disabled span.pg { opacity: .45; }


/* ------------------------------------------------------------ menu toggle & user menu */
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); cursor: pointer; flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--navy); color: var(--navy); }
.nav-collapsed .sidebar { display: none; }
.nav-backdrop { display: none; }

.usermenu { position: relative; }
.usermenu summary {
  list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer;
  padding: 5px 10px 5px 5px; border-radius: 26px; border: 1px solid var(--border); background: var(--panel);
}
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover, .usermenu[open] summary { border-color: var(--navy); }
.usermenu .who { display: flex; flex-direction: column; line-height: 1.2; }
.usermenu .who b { font-size: 14px; font-weight: 600; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usermenu .who span { font-size: 12px; color: var(--muted); }
.usermenu .chev { color: var(--muted); transition: transform .15s; }
.usermenu[open] .chev { transform: rotate(180deg); }
.usermenu .menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
}
.usermenu .menu-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: flex; flex-direction: column; }
.usermenu .menu a, .usermenu .menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border-radius: var(--radius-sm);
  font: inherit; font-size: 15px; color: var(--ink); background: none; border: none; cursor: pointer; text-align: left;
}
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--soft); color: var(--navy); }
.usermenu .menu svg { width: 18px; height: 18px; color: var(--faint); }
.usermenu .menu .signout { color: var(--bad); border-top: 1px solid var(--line); border-radius: 0 0 var(--radius-sm) var(--radius-sm); margin-top: 6px; }
.usermenu .menu .signout svg { color: var(--bad); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side, .grid.k3 { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 20; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  .nav-collapsed .sidebar { display: flex; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(15, 27, 42, .35); z-index: 15; }
  .usermenu .who, .topbar .date { display: none; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 32px; }
  .form-grid, .grid.k2 { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { display: none; }
  .filters .field, .filters .field.wide { width: 100%; }
}
@media (max-width: 520px) {
  .grid.k4 { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------ phase 2 */
a.card.kpi { color: inherit; transition: border-color .15s, box-shadow .15s; }
a.card.kpi:hover { border-color: var(--navy); box-shadow: var(--shadow); color: inherit; }
.stats-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.stats-strip a { display: inline-flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 16px; border: 1px solid var(--border); background: var(--panel); font-size: 13px; color: var(--ink-2); }
.stats-strip a b { font-variant-numeric: tabular-nums; }
.stats-strip a.on, .stats-strip a:hover { border-color: var(--navy); color: var(--navy); }
.reveal { cursor: pointer; }
.action-list { display: flex; flex-direction: column; gap: 14px; }
.action-list form { display: flex; flex-direction: column; gap: 8px; }
.action-list .row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.action-list .row .field { flex: 1; min-width: 160px; }
.danger-zone { border-color: #F2C4BF; }
.rad-table td { font-family: var(--mono); font-size: 12px; padding: 6px 10px; }

/* ------------------------------------------------------------ required marks, photo previews, upload progress */
label.req::after { content: " *"; color: var(--bad); font-weight: 700; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.thumb { width: 120px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--soft); display: flex; flex-direction: column; font-size: 11px; color: var(--muted); text-align: center; }
.thumb img { width: 100%; height: 80px; object-fit: cover; display: block; }
.thumb span { padding: 4px; }
.upload-overlay { position: fixed; inset: 0; background: rgba(15, 27, 42, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.upload-box { background: var(--panel); border-radius: var(--radius); padding: 24px; width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-lg); }
.upload-box .bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.upload-box .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy), var(--red)); transition: width .2s; }

/* ------------------------------------------------------------ renewals */
.renew-card { border-top: 3px solid var(--red); }
.period-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.period { position: relative; cursor: pointer; }
.period input { position: absolute; opacity: 0; }
.period span { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--panel); }
.period b { font-size: 14px; }
.period em { font-style: normal; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.period small { font-size: 11px; color: var(--muted); }
.period input:checked + span { border: 2px solid var(--navy); background: var(--tint); padding: 9px 11px; }
.period input:focus-visible + span { outline: 2px solid var(--red); }
.money-in { color: var(--good); font-weight: 600; }
.money-out { color: var(--bad); font-weight: 600; }
.sticky-bar { position: sticky; bottom: 0; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; box-shadow: var(--shadow-lg); z-index: 4; }
.sticky-bar .grow { flex: 1; }
.big-num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.nav a .count { margin-left: auto; font-size: 11px; font-weight: 700; background: #FDECEC; color: var(--red-700); padding: 1px 7px; border-radius: 10px; }

/* ------------------------------------------------------------ slim menu scrollbar, photo remove button */
.sidebar { scrollbar-width: thin; scrollbar-color: #C9CBE0 transparent; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #D5D7E6; border-radius: 6px; }
.sidebar:hover::-webkit-scrollbar-thumb { background: var(--navy); }
.table-wrap { scrollbar-width: thin; scrollbar-color: #C9CBE0 transparent; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: #D5D7E6; border-radius: 6px; }
.thumb { position: relative; }
.thumb-del {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(192, 54, 44, .92); color: #fff; font-size: 18px; line-height: 26px; padding: 0; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.thumb-del:hover { background: var(--bad); }

/* ------------------------------------------------------------ online dot */
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #C5C9D4; margin-right: 6px; vertical-align: middle; }
.status-dot.on { background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }

/* ------------------------------------------------------------ document review */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.doc-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; background: var(--panel); }
.doc-preview { display: flex; align-items: center; justify-content: center; height: 180px; background: var(--soft); border-bottom: 1px solid var(--line); color: var(--muted); }
.doc-preview img { width: 100%; height: 100%; object-fit: contain; }
.doc-meta { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.doc-actions { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }

/* Dealer notices (arrears, expiring users, low balance) */
.notice-bar { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid transparent; color: inherit; text-decoration: none; }
.notice-bar + .notice-bar { margin-top: 0; }
.notice-bar svg { flex-shrink: 0; }
.notice-bar .grow { flex: 1; min-width: 0; }
.notice-bar .notice-ur { font-size: 16px; line-height: 1.9; }
.notice-bar.arrears { background: var(--bad-bg); color: #8A241D; border-color: #E8A39B; }
.notice-bar.expiring { background: var(--weak-bg); color: #7A4505; border-color: #F6D9A8; }
.notice-bar.expiring:hover { border-color: #E9B565; }
.notice-bar.low { background: var(--info-bg); color: var(--navy); border-color: #DCDCEE; }
.notice-bar.blink { animation: aa-blink 1.6s ease-in-out infinite; }
@keyframes aa-blink { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 50, 40, .0); background: var(--bad-bg); } 50% { box-shadow: 0 0 0 4px rgba(200, 50, 40, .25); background: #FBD5D0; } }
@media (prefers-reduced-motion: reduce) { .notice-bar.blink { animation: none; border-width: 2px; } }
@media (max-width: 600px) { .notice-bar { flex-wrap: wrap; } .notice-bar .btn { margin-left: 32px; } }
.geo-form { margin-top: 6px; }

/* PON fullness bar, optical signal */
.pon-bar { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; margin-bottom: 4px; }
.pon-bar span { display: block; height: 100%; background: var(--good); border-radius: 5px; }
.pon-bar.near span { background: var(--weak); }
.pon-bar.full span { background: var(--bad); }
.input.sm-input { height: 34px; width: 100%; min-width: 80px; }
.rx { font-variant-numeric: tabular-nums; font-weight: 600; }
.rx.good { color: var(--good); } .rx.weak { color: var(--weak); } .rx.critical { color: var(--bad); }
.rx-chart { width: 100%; height: auto; max-height: 180px; display: block; }
.rx-chart .grid-line { stroke: var(--line); stroke-width: 1; }
.rx-chart .th-weak { stroke: var(--weak); stroke-dasharray: 4 4; stroke-width: 1; }
.rx-chart .th-critical { stroke: var(--bad); stroke-dasharray: 4 4; stroke-width: 1; }
.rx-chart .line { fill: none; stroke: var(--navy); stroke-width: 2; stroke-linejoin: round; }
.rx-chart .off { fill: var(--bad); }
.rx-chart text { font-size: 10px; fill: var(--muted, #667); }
.link-form { display: flex; gap: 6px; align-items: center; }
.link-form .input { height: 32px; width: 130px; }
.notice-bar.pons { background: var(--weak-bg); color: #7A4505; border-color: #F6D9A8; }
.notice-bar.pons .badge { margin: 2px 4px 2px 0; }
.row-flash td { animation: aa-row-flash 2.5s ease-out 1; }
@keyframes aa-row-flash { from { background: #FFF3C4; } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .row-flash td { animation: none; background: #FFF8DD; } }
.wifi-row { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; align-items: flex-end; }
.wifi-row:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

/* Public "package expired" page */
.expired-page { background: var(--bg, #F4F5FA); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.expired-card { background: var(--panel, #fff); max-width: 520px; width: 100%; border-radius: 16px; padding: 28px 24px; box-shadow: 0 10px 40px rgba(20, 20, 60, .08); }
.expired-card h1 { font-size: 22px; margin: 6px 0 12px; }
.expired-card h2 { font-size: 16px; margin: 20px 0 10px; }
.expired-card .big { font-size: 22px; line-height: 2; color: var(--red-700, #B42318); margin: 8px 0; }
.expired-brand { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.expired-brand img { width: 44px; height: 44px; }
.expired-brand b { display: block; letter-spacing: .02em; }
.expired-brand span { font-size: 11px; letter-spacing: .22em; color: var(--muted); font-weight: 600; }
.contact-list { display: grid; gap: 10px; }
.contact { display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.contact:hover { border-color: var(--navy); }
.contact span:first-child { font-size: 12px; color: var(--muted); }
.pay-info { margin-top: 14px; padding: 12px 14px; background: var(--info-bg); border-radius: 12px; font-size: 14px; }

/* Complaints */
.row-overdue td { background: #FFF5F4; }
.diag { margin-top: 8px; padding: 10px 12px; background: var(--info-bg); border-radius: 8px; font-family: inherit; font-size: 13px; white-space: pre-wrap; }
.complaint-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.notice-bar.announce { background: var(--info-bg); color: var(--navy); border-color: #DCDCEE; }
.notice-bar.announce.warning { background: var(--weak-bg); color: #7A4505; border-color: #F6D9A8; }
.notice-bar.announce.urgent { background: var(--bad-bg); color: #8A241D; border-color: #E8A39B; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }

/* Reports trend */
.trend { display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; height: 200px; align-items: end; padding-top: 10px; }
.trend-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; color: inherit; }
.trend-bar { width: 70%; background: var(--tint, #E8E8F4); border-radius: 4px 4px 0 0; min-height: 2px; }
.trend-col.on .trend-bar, .trend-col:hover .trend-bar { background: var(--navy); }
.trend-val { font-size: 11px; color: var(--muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.trend-label { font-size: 11px; margin-top: 6px; color: var(--muted); white-space: nowrap; }
.grid.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }
@media (max-width: 600px) { .trend { gap: 3px; } .trend-val { display: none; } .grid.two { grid-template-columns: 1fr; } }

/* Map */
.map-box { height: 70vh; min-height: 420px; border-radius: var(--radius); }
.map-legend [class^="dot-"] { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; }
.dot-online { background: #12B76A; } .dot-offline { background: #98A2B3; } .dot-expired { background: #F04438; }
.dot-new { background: #7A5AF8; } .dot-disabled { background: #344054; } .dot-device { background: #2E90FA; border-radius: 2px !important; }

/* Live speed */
.live-speed { display: flex; gap: 28px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 10px; }
.live-num { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.live-num.down { color: var(--navy); } .live-num.up { color: #12B76A; }
.live-speed [data-live-toggle] { margin-left: auto; }
.live-chart { width: 100%; height: auto; display: block; background: var(--bg, #F7F8FC); border-radius: 8px; }

/* ------------------------------------------------------------ sign-in page (phones get a branded header) */
.auth-form { flex-direction: column; gap: 18px; }
.auth-hero { display: none; }
.auth-foot { color: var(--faint); text-align: center; }
.auth-foot a { color: var(--ink-2); }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon > .input { padding-left: 40px; height: 46px; }
.input-icon > .input:focus + .pw-toggle, .input-icon:focus-within > svg { color: var(--navy); }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: var(--navy); font: inherit; font-size: 13px; font-weight: 600; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.pw-toggle:hover { background: var(--tint); }
.input-icon:has(.pw-toggle) > .input { padding-right: 64px; }
.login-btn { position: relative; overflow: hidden; }
.login-btn.is-busy::after { content: ""; position: absolute; left: -40%; top: 0; bottom: 0; width: 40%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .35), transparent); animation: aa-shine 1s linear infinite; }
@keyframes aa-shine { to { left: 110%; } }

@media (max-width: 860px) {
  .auth-form { justify-content: flex-start; padding: 0 0 28px; background: var(--ground); min-height: 100vh; }
  .auth-hero {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 44px 16px 74px; color: #fff; position: relative; overflow: hidden;
    background: radial-gradient(700px 360px at 20% 0%, #3B3975 0%, var(--navy) 55%, #1F1D45 100%);
    border-radius: 0 0 28px 28px;
  }
  .auth-hero img { width: 52px; height: 72px; object-fit: contain; background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); position: relative; z-index: 1; }
  .auth-hero-name { text-align: center; position: relative; z-index: 1; }
  .auth-hero-name b { display: block; font-size: 20px; letter-spacing: .04em; }
  .auth-hero-name span { font-size: 11px; letter-spacing: .32em; color: #C9C8E3; font-weight: 600; }
  .auth-hero-ur { font-family: var(--urdu); font-size: 15px; color: #E4E3F4; position: relative; z-index: 1; line-height: 2; }
  .auth-hero-ring { position: absolute; right: -90px; top: -90px; width: 240px; height: 240px; border-radius: 50%; border: 28px solid rgba(227, 30, 40, .5); }
  .auth-hero::before { content: ""; position: absolute; left: -60px; bottom: -80px; width: 180px; height: 180px; border-radius: 50%; border: 18px solid rgba(255, 255, 255, .06); }
  .auth-box { width: calc(100% - 32px); max-width: 440px; margin-top: -48px; position: relative; z-index: 2; padding: 26px 20px; border-radius: 18px; box-shadow: 0 16px 40px rgba(15, 27, 42, .12); }
  .auth-box h1 { font-size: 21px; }
  .input-icon > .input, .auth-box .btn { height: 50px; font-size: 16px; }   /* 16px stops iPhone zooming in */
  .auth-box .remember { padding: 6px 0; }
}
@media (prefers-reduced-motion: reduce) { .login-btn.is-busy::after { animation: none; } }

/* ------------------------------------------------------------ page-load animation + top progress bar */
.preloader {
  position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: var(--ground); opacity: 0; pointer-events: none;
  animation: aa-pre 3.5s ease forwards;   /* invisible for the first 0.3 s, gone by itself after 3.5 s even if JS fails */
}
@keyframes aa-pre { 0%, 8% { opacity: 0; } 12%, 88% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
html.page-ready .preloader { animation: none; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.preloader-mark { position: relative; width: 84px; height: 84px; display: grid; place-items: center; }
.preloader-mark img { width: 38px; height: 54px; object-fit: contain; animation: aa-breathe 1.4s ease-in-out infinite; }
.preloader-ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--tint); border-top-color: var(--red); border-right-color: var(--navy); animation: aa-spin .9s linear infinite; }
.preloader-name { font-size: 12px; letter-spacing: .28em; color: var(--muted); }
.preloader-name b { color: var(--navy); letter-spacing: .12em; }
@keyframes aa-spin { to { transform: rotate(360deg); } }
@keyframes aa-breathe { 50% { transform: scale(.9); opacity: .8; } }

.nav-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 101; background: linear-gradient(90deg, var(--navy), var(--red)); box-shadow: 0 0 8px rgba(227, 30, 40, .5); opacity: 0; }
html.navigating .nav-progress { opacity: 1; animation: aa-progress 8s cubic-bezier(.1, .8, .2, 1) forwards; }
@keyframes aa-progress { 0% { width: 0; } 20% { width: 45%; } 60% { width: 80%; } 100% { width: 94%; } }

/* Content slides in gently on each page */
.content > * { animation: aa-rise .35s ease both; }
.content > *:nth-child(2) { animation-delay: .04s; } .content > *:nth-child(3) { animation-delay: .08s; } .content > *:nth-child(4) { animation-delay: .12s; }
@keyframes aa-rise { from { opacity: 0; transform: translateY(6px); } }

@media (prefers-reduced-motion: reduce) {
  .preloader, .preloader-ring, .preloader-mark img, .content > * { animation: none !important; }
  .preloader { display: none; }
  html.navigating .nav-progress { animation: none; width: 60%; }
}
html.page-ready.navigating-slow .preloader { visibility: visible; opacity: 1; background: rgba(245, 246, 250, .82); backdrop-filter: blur(2px); transition: opacity .2s; }

/* Balance in the user menu */
.usermenu .menu a.menu-wallet { display: grid; gap: 2px; margin: 0 4px 6px; padding: 10px 12px; border-radius: 10px; background: var(--tint); }
.usermenu .menu a.menu-wallet b { font-size: 18px; color: var(--navy); font-variant-numeric: tabular-nums; }
.usermenu .menu a.menu-wallet b.money-out { color: var(--bad); }
.menu-wallet-cta { font-size: 13px; font-weight: 600; color: var(--red-700); margin-top: 4px; }
@media (max-width: 860px) { .usermenu .menu { min-width: 260px; } }

/* Dashboard KPIs: online / offline at a glance */
.grid.k5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1200px) { .grid.k5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid.k5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid.k5 > :first-child { grid-column: 1 / -1; } }
.kpi-online { border-top: 3px solid var(--good); }
.kpi-online .value { color: var(--good); }
.kpi-offline { border-top: 3px solid #98A2B3; }
.live-dot, .off-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.live-dot { background: #12B76A; box-shadow: 0 0 0 0 rgba(18, 183, 106, .6); animation: aa-pulse 1.8s infinite; }
.off-dot { background: #98A2B3; }
@keyframes aa-pulse { 70% { box-shadow: 0 0 0 7px rgba(18, 183, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); } }
.kpi-bar { display: block; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 6px 0 2px; }
.kpi-bar span { display: block; height: 100%; background: linear-gradient(90deg, #12B76A, #32D583); border-radius: 3px; }
.kpi-wallet .sub b { color: var(--red-700); }
.quick-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.quick-links a { display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.quick-links a:hover { border-color: var(--navy); background: var(--soft); }
.quick-links svg { width: 22px; height: 22px; color: var(--navy); }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

/* ------------------------------------------------------------ receipts and bills (screen, A4 and 80 mm printers) */
.receipt-page { background: var(--ground); padding: 16px; min-height: 100vh; }
.receipt-toolbar { display: flex; gap: 8px; align-items: center; max-width: 420px; margin: 0 auto 12px; flex-wrap: wrap; }
.receipt-toolbar .grow { flex: 1; }
.wa-btn { background: #25D366; } .wa-btn:hover { background: #1DA851; }
.receipt-flash { max-width: 420px; margin: 0 auto 12px; padding: 10px 12px; border-radius: 8px; background: var(--good-bg); color: var(--good); font-weight: 600; }
.receipt { max-width: 420px; margin: 0 auto; background: #fff; border-radius: 14px; padding: 22px 20px; box-shadow: var(--shadow-lg); color: #111; }
.receipt-head { display: flex; gap: 12px; align-items: center; padding-bottom: 12px; border-bottom: 2px dashed #ccc; }
.receipt-head img { width: 34px; height: 48px; object-fit: contain; }
.receipt-head b { display: block; letter-spacing: .06em; }
.receipt-head span { font-size: 13px; color: #555; }
.receipt-meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 12px 0; font-size: 13px; }
.receipt-meta dt { color: #666; } .receipt-meta dd { text-align: right; }
.receipt-block { border-top: 1px solid #eee; padding: 10px 0; }
.receipt-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #777; margin-bottom: 6px; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14px; }
.receipt-row span:first-child { color: #555; }
.receipt-row > :last-child { text-align: right; }
.receipt-row.total { border-top: 1px solid #ddd; margin-top: 4px; padding-top: 6px; font-size: 15px; }
.receipt-row.paid { font-size: 17px; color: var(--good); }
.receipt-row.small { font-size: 12px; }
.receipt-foot { border-top: 2px dashed #ccc; margin-top: 8px; padding-top: 10px; font-size: 12px; color: #444; text-align: center; display: grid; gap: 3px; }
.receipt-thanks { margin-top: 6px; font-weight: 600; }
@media print {
  .no-print { display: none !important; }
  .receipt-page { background: #fff; padding: 0; }
  .receipt { box-shadow: none; border-radius: 0; max-width: 80mm; padding: 2mm; }
  @page { margin: 4mm; }
}

/* Customer account card */
.acct-top { display: flex; gap: 16px; align-items: stretch; flex-wrap: wrap; margin-bottom: 14px; }
.acct-due, .acct-fee { display: grid; gap: 2px; padding: 12px 16px; border-radius: 12px; min-width: 200px; }
.acct-due b, .acct-fee b { font-size: 22px; font-variant-numeric: tabular-nums; }
.acct-due.owes { background: var(--bad-bg); color: #8A241D; }
.acct-due.clear { background: var(--good-bg); color: var(--good); }
.acct-fee { background: var(--soft); border: 1px solid var(--border); }
.acct-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.acct-forms { display: grid; gap: 8px; }
.acct-pay { padding: 0; align-items: flex-end; }
.acct-more summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: 14px; padding: 6px 0; }
.acct-more .filters { padding: 8px 0 0; align-items: flex-end; }

/* ------------------------------------------------------------ dark mode
   html.dark is set before the page paints (layouts/head), from the user's choice: Light / Dark / Auto (phone setting). */
html.dark {
  color-scheme: dark;
  --navy: #9A97F2; --navy-600: #B0AEF6; --red: #F0474F; --red-700: #FF8A90;
  --ink: #E7EAF2; --ink-2: #C5CBD8; --muted: #9AA3B5; --faint: #7F889B;
  --border: #283047; --border-2: #333C56; --line: #222A3E;
  --ground: #0D1220; --panel: #151B2C; --soft: #1A2135; --tint: #232B44;
  --good: #3DD6A5; --good-bg: #0F2E26;
  --weak: #F2B356; --weak-bg: #33250E;
  --bad: #FF7B70; --bad-bg: #3A1816;
  --strong: #C89BF5; --strong-bg: #2B1E3D;
  --info-bg: #222A42;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
  --btn: #4D4AB3; --btn-hover: #5E5BC7;
}
html.dark .avatar, html.dark .pager .current span.pg { background: var(--btn); border-color: var(--btn); }
html.dark .btn { background: var(--btn); }
html.dark .btn:hover { background: var(--btn-hover); }
html.dark .btn.secondary, html.dark .btn.danger { background: var(--soft); }
html.dark .btn.red { background: #C9252E; }
html.dark .btn.wa-btn { background: #1E9E50; }
html.dark .brand img, html.dark .preloader-mark img { background: #fff; border-radius: 8px; padding: 3px; }
html.dark .auth-art, html.dark .auth-hero { background: radial-gradient(900px 500px at 20% 0%, #2E2C66 0%, #1C1A44 60%, #0D0C24 100%); }
html.dark .table tbody tr:hover { background: #1B2236; }
html.dark .badge.red, html.dark .nav a .count { background: #3A1816; color: #FF8A90; }
html.dark .input:focus { box-shadow: 0 0 0 3px rgba(154, 151, 242, .22); }
html.dark .alert.ok { color: #9BE8CF; border-color: #1D5B4A; }
html.dark .alert.error { color: #FFB4AD; border-color: #6B2A25; }
html.dark .alert.info, html.dark .notice-bar.low, html.dark .notice-bar.announce { color: var(--ink); border-color: #343D60; }
html.dark .alert.warn, html.dark .notice-bar.expiring, html.dark .notice-bar.pons, html.dark .notice-bar.announce.warning { color: #F6CF8E; border-color: #6A4A15; }
html.dark .notice-bar.arrears, html.dark .notice-bar.announce.urgent, html.dark .acct-due.owes { color: #FFB4AD; border-color: #6B2A25; }
html.dark details.diff .old { background: #2C1514; color: #FFB4AD; }
html.dark details.diff .new { background: #10281F; color: #9BE8CF; }
html.dark .btn.danger, html.dark .danger-zone { border-color: #6B2A25; }
html.dark .row-overdue td { background: #2A1514; }
html.dark .status-dot, html.dark .off-dot { background: #5D6578; }
html.dark .kpi-offline { border-top-color: #5D6578; }
html.dark .sidebar, html.dark .table-wrap { scrollbar-color: #3A4363 transparent; }
html.dark .sidebar::-webkit-scrollbar-thumb, html.dark .table-wrap::-webkit-scrollbar-thumb { background: #3A4363; }
html.dark .trend-bar { background: #2C3553; }
html.dark .live-chart { background: #10172A; }
html.dark .upload-overlay, html.dark body.nav-open .nav-backdrop { background: rgba(0, 0, 0, .6); }
html.dark.page-ready.navigating-slow .preloader { background: rgba(13, 18, 32, .85); }
html.dark .preloader-name { color: var(--ink); }
html.dark img.map-tile, html.dark .leaflet-tile { filter: brightness(.75) contrast(1.1) saturate(.8); }
html.dark .leaflet-container { background: #0D1220; }
html.dark .rx-chart line, html.dark .rx-chart path.grid { stroke: #2A3248; }
@keyframes aa-row-flash-dark { from { background: #3A3210; } to { background: transparent; } }
html.dark .row-flash td { animation-name: aa-row-flash-dark; }
html.dark select.input option { background: var(--panel); color: var(--ink); }
/* receipts and printed statements always stay white (they are printed / shared as they are) */
html.dark .receipt, html.dark .receipt-page { color-scheme: light; }
@media print { html.dark { color-scheme: light; } html.dark body { background: #fff; color: #000; } }
html.theme-switching *, html.theme-switching *::before, html.theme-switching *::after { transition: background-color .25s, color .25s, border-color .25s !important; }

/* ------------------------------------------------------------ Urdu (html.lang-ur)
   English layout stays (left to right); words are shown in Urdu with an Urdu font. */
html.lang-ur body { font-family: 'Plus Jakarta Sans', 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', system-ui, -apple-system, 'Segoe UI', sans-serif; line-height: 1.75; }
html.lang-ur .nav a, html.lang-ur .btn, html.lang-ur .badge, html.lang-ur .usermenu .menu a, html.lang-ur .usermenu .menu button { line-height: 1.9; }
html.lang-ur .btn { padding-top: 4px; padding-bottom: 6px; }
html.lang-ur .nav-label { letter-spacing: 0; text-transform: none; font-size: 13px; }
html.lang-ur h1, html.lang-ur h2, html.lang-ur h3 { line-height: 1.9; }
html.lang-ur .table th { letter-spacing: 0; text-transform: none; }
html.lang-ur .mono, html.lang-ur code, html.lang-ur input.mono { font-family: var(--mono); }
html.i18n-pending .content, html.i18n-pending .sidebar, html.i18n-pending .topbar, html.i18n-pending .auth-box { visibility: hidden; }

/* ------------------------------------------------------------ appearance + language in the user menu / sign-in page */
.menu-prefs { display: grid; gap: 10px; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-prefs .pref-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.pref-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 3px; background: var(--soft); border: 1px solid var(--border); border-radius: 10px; }
.pref-seg button {
  display: inline-flex !important; align-items: center; justify-content: center; gap: 6px !important; padding: 7px 6px !important;
  font-size: 13px !important; border-radius: 7px !important; color: var(--ink-2) !important; background: none; border: 0; cursor: pointer; font: inherit;
}
.pref-seg button svg { width: 15px !important; height: 15px !important; color: inherit !important; }
.pref-seg button[aria-pressed="true"] { background: var(--panel) !important; color: var(--navy) !important; font-weight: 700; box-shadow: var(--shadow); }
.pref-seg .ur-word { font-family: var(--urdu); line-height: 1.6; font-size: 14px; }
.auth-prefs { position: absolute; top: 14px; right: 14px; z-index: 5; display: flex; gap: 8px; }
.auth-prefs button {
  height: 34px; min-width: 34px; padding: 0 10px; border-radius: 17px; border: 1px solid var(--border); background: var(--panel);
  color: var(--ink-2); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.auth-prefs button:hover { border-color: var(--navy); color: var(--navy); }
.auth-prefs .ur-word { font-family: var(--urdu); line-height: 1.4; }
@media (max-width: 860px) { .auth-prefs button { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; } }
.install-app[hidden] { display: none !important; }

/* ------------------------------------------------------------ complaint wizard */
.wizard { max-width: 820px; }
.wiz-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; padding: 0; counter-reset: wiz; }
.wiz-steps li { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); color: var(--muted); font-weight: 600; font-size: 13px; }
.wiz-steps li::before { counter-increment: wiz; content: counter(wiz); width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--soft); border: 1px solid var(--border-2); font-size: 12px; }
.wiz-steps li.on { border-color: var(--navy); color: var(--navy); }
.wiz-steps li.on::before { background: var(--navy); border-color: var(--navy); color: var(--panel); }
.wiz-steps li.done::before { content: "✓"; background: var(--good-bg); border-color: var(--good); color: var(--good); }
.wiz-steps li .ur { font-size: 12px; font-weight: 400; line-height: 1.6; }
@media (max-width: 600px) { .wiz-steps li { flex-direction: column; text-align: center; gap: 4px; padding: 8px 6px; } .wiz-steps li .ur { display: none; } }
.wiz-pane[hidden] { display: none; }
.wiz-search { position: relative; }
.wiz-search .input { font-size: 17px; padding: 14px 14px 14px 46px; height: auto; }
.wiz-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--faint); pointer-events: none; }
.wiz-kind { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 4px; }
.wiz-kind button { border: 1px solid var(--border-2); background: var(--panel); color: var(--ink-2); border-radius: 18px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.wiz-kind button[aria-pressed="true"] { background: var(--tint); border-color: var(--navy); color: var(--navy); font-weight: 700; }
.wiz-results { display: grid; gap: 8px; margin-top: 12px; }
.wiz-hit { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.wiz-hit:hover, .wiz-hit:focus-visible, .wiz-hit.sel { border-color: var(--navy); background: var(--soft); }
.wiz-hit .who { display: grid; gap: 1px; min-width: 0; }
.wiz-hit .who b { font-size: 15px; }
.wiz-hit .who .ur { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.wiz-hit .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wiz-hit .side { display: grid; gap: 4px; justify-items: end; font-size: 12px; }
.wiz-hit .open-c { color: var(--bad); font-weight: 600; }
.wiz-empty { padding: 18px; text-align: center; color: var(--muted); border: 1px dashed var(--border-2); border-radius: 12px; }
.wiz-picked { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--tint); margin-bottom: 14px; flex-wrap: wrap; }
.wiz-picked .who { display: grid; gap: 2px; flex: 1; min-width: 180px; }
.wiz-picked .who b { font-size: 16px; }
.wiz-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 640px) { .wiz-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wiz-tile { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 16px 10px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--panel); color: var(--ink); font: inherit; cursor: pointer; }
.wiz-tile svg { width: 28px; height: 28px; color: var(--navy); }
.wiz-tile b { font-size: 14px; }
.wiz-tile .ur { font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.wiz-tile:hover { border-color: var(--navy); }
.wiz-tile[aria-pressed="true"] { border-color: var(--red); background: var(--bad-bg); box-shadow: 0 0 0 3px rgba(227, 30, 40, .12); }
.wiz-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.wiz-diag { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.top-pref { color: var(--ink-2); }
.top-pref .ur-word { font-family: var(--urdu); font-size: 14px; line-height: 1; padding-bottom: 4px; }
.top-pref .when-dark { display: none; } html.dark .top-pref .when-light { display: none; } html.dark .top-pref .when-dark { display: inline-flex; }
.top-pref span { display: inline-flex; }
html.lang-ur .only-en, html:not(.lang-ur) .only-ur { display: none !important; }
@media (max-width: 860px) { .topbar { gap: 8px; } .top-pref { width: 36px; height: 36px; } }
.auth-prefs .when-dark { display: none; } html.dark .auth-prefs .when-light { display: none; } html.dark .auth-prefs .when-dark { display: inline-flex; }
.auth-prefs span { display: inline-flex; }
.auth-form { position: relative; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }

/* ------------------------------------------------------------ alerts bell */
.alertmenu { position: relative; }
.alertmenu summary { list-style: none; position: relative; }
.alertmenu summary::-webkit-details-marker { display: none; }
.alertmenu[open] summary { border-color: var(--navy); color: var(--navy); }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 19px; text-align: center; box-shadow: 0 0 0 2px var(--panel); }
.bell-count[hidden] { display: none; }
.alertmenu .alert-list { position: absolute; right: 0; top: calc(100% + 8px); width: 360px; max-width: calc(100vw - 24px); background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 31; }
.alert-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.linkish { background: none; border: 0; padding: 0; color: var(--navy); font: inherit; cursor: pointer; font-weight: 600; }
.linkish:hover { color: var(--red); }
[data-alert-items] { max-height: 60vh; overflow-y: auto; }
.alert-item { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius-sm); color: var(--ink); }
.alert-item:hover { background: var(--soft); color: var(--ink); }
.alert-item .dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--faint); }
.alert-item .dot.bad { background: var(--bad); } .alert-item .dot.weak { background: var(--weak); } .alert-item .dot.good { background: var(--good); } .alert-item .dot.navy { background: var(--navy); }
.alert-item .txt { display: grid; gap: 1px; min-width: 0; font-size: 13px; }
.alert-item .txt b { font-weight: 600; }
.alert-item .txt span { color: var(--muted); }
.alert-item .txt em { font-style: normal; color: var(--faint); font-size: 11px; }
.alert-item.unread { background: var(--tint); }
.alert-item.unread .txt b { font-weight: 700; }
.alert-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 6px; border-top: 1px solid var(--line); margin-top: 4px; font-size: 13px; font-weight: 600; }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: grid; gap: 8px; width: 340px; max-width: calc(100vw - 32px); }
.toast { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border); border-left: 4px solid var(--navy); box-shadow: var(--shadow-lg); color: var(--ink); animation: aa-rise .25s ease both; font-size: 13px; }
.toast.bad { border-left-color: var(--bad); } .toast.weak { border-left-color: var(--weak); } .toast.good { border-left-color: var(--good); }
.toast b { display: block; }
.toast span { color: var(--muted); }
@media (max-width: 860px) { .alertmenu .alert-list { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; } }
.alerts-page .alert-item { border: 1px solid var(--border); margin-bottom: 8px; background: var(--panel); }
.alerts-page .alert-item.unread { background: var(--tint); }

/* ------------------------------------------------------------ traffic graph */
.traffic-card .card-head { flex-wrap: wrap; gap: 10px; }
.traffic-legend { display: flex; align-items: center; gap: 8px; color: var(--muted); margin: 4px 0 8px; flex-wrap: wrap; }
.traffic-legend span { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-left: 6px; }
.lg-in { background: var(--navy); } .lg-out { background: #12B76A; } .lg-cap { background: var(--bad); }
.traffic-wrap { position: relative; }
.traffic-canvas { width: 100%; height: 280px; display: block; }
@media (max-width: 600px) { .traffic-canvas { height: 220px; } }
.traffic-tip { position: absolute; top: 10px; background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 10px; font-size: 12px; pointer-events: none; min-width: 130px; }
.traffic-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.traffic-stats div { background: var(--soft); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.traffic-stats span { font-size: 12px; color: var(--muted); }
.traffic-stats b { font-size: 16px; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ network tree */
.net-tree, .net-tree ul { list-style: none; margin: 0; padding: 0; }
.net-tree ul { margin-left: 22px; padding-left: 16px; border-left: 2px solid var(--border); }
.net-tree li { position: relative; padding: 6px 0; }
.net-tree ul > li::before { content: ""; position: absolute; left: -16px; top: 26px; width: 14px; border-top: 2px solid var(--border); }
.net-node { display: inline-flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--panel); color: var(--ink); min-width: 280px; max-width: 100%; flex-wrap: wrap; }
.net-node:hover { border-color: var(--navy); color: var(--ink); }
.net-node.down { border-color: var(--bad); background: var(--bad-bg); }
.net-node.unreachable { border-color: var(--weak); background: var(--weak-bg); }
.net-node .ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--tint); color: var(--navy); flex-shrink: 0; }
.net-node .who { display: grid; gap: 1px; min-width: 0; }
.net-node .who b { font-size: 14px; }
.net-node .who span { font-size: 12px; color: var(--muted); }
.net-node .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.net-pons { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0 46px; }
.net-pon { font-size: 12px; padding: 4px 8px; border-radius: 8px; background: var(--soft); border: 1px solid var(--border); color: var(--ink-2); }
.net-pon.out { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.net-pon.power { background: var(--weak-bg); border-color: var(--weak); color: var(--weak); }

/* ------------------------------------------------------------ system health */
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.health-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.health-list li:last-child { border-bottom: 0; }
.h-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.h-ok .h-dot { background: var(--good); } .h-warn .h-dot { background: var(--weak); } .h-bad .h-dot { background: var(--bad); }
.h-txt { display: grid; gap: 1px; flex: 1; min-width: 0; }
.h-txt span { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ two-step sign-in */
.tf-setup { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.tf-qr { background: #fff; padding: 10px; border-radius: 12px; border: 1px solid var(--border); width: 202px; min-height: 202px; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #333; }
.tf-key { font-size: 15px; letter-spacing: .06em; word-break: break-all; }
.tf-code-input { font-size: 22px; letter-spacing: .3em; text-align: center; }
.recovery-codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; margin-top: 10px; }
.recovery-codes span { background: var(--panel); border: 1px dashed var(--border-2); border-radius: 8px; padding: 6px 8px; text-align: center; font-size: 14px; }

/* ------------------------------------------------------------ online payments to check */
.proof-list { display: grid; gap: 12px; }
.proof { display: grid; grid-template-columns: 1fr 160px 260px; gap: 18px; align-items: start; }
.proof-amount { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--navy); }
.proof-photo { display: block; width: 160px; height: 200px; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: var(--soft); }
.proof-photo img { width: 100%; height: 100%; object-fit: cover; }
.proof-photo.none { display: flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .proof { grid-template-columns: 1fr; } .proof-photo { width: 100%; height: 220px; } }
.stats-strip a.on { border-color: var(--navy); color: var(--navy); font-weight: 700; background: var(--tint); }
/* Extra charges on the bill: quick buttons */
.acct-charge { border-top: 1px solid var(--line); padding-top: 10px; }
.charge-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--border-2); background: var(--panel); color: var(--ink-2); border-radius: 16px; padding: 5px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip[aria-pressed="true"] { background: var(--tint); border-color: var(--navy); color: var(--navy); font-weight: 700; }

/* ------------------------------------------------------------ message customers */
.msg-compose { display: grid; gap: 14px; max-width: 980px; }
.msg-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.msg-tpl { display: grid; justify-items: center; gap: 6px; padding: 14px 8px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--panel); color: var(--ink); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; text-align: center; }
.msg-tpl svg { color: var(--navy); }
.msg-tpl:hover { border-color: var(--navy); }
.msg-tpl[aria-pressed="true"] { border-color: var(--red); background: var(--bad-bg); }
.msg-count { font-weight: 700; color: var(--good); background: var(--good-bg); padding: 3px 10px; border-radius: 12px; font-size: 13px; }
.msg-count.zero { color: var(--bad); background: var(--bad-bg); }
.msg-areas { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.msg-area { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: var(--panel); }
.msg-area summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; list-style: none; }
.msg-area summary::-webkit-details-marker { display: none; }
.msg-subs { display: grid; gap: 4px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.msg-pick summary { cursor: pointer; color: var(--navy); font-weight: 600; }
.msg-langs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.msg-langs .ur { font-size: 16px; line-height: 2; }
@media (max-width: 760px) { .msg-langs { grid-template-columns: 1fr; } }
.msg-preview { margin-top: 14px; display: flex; justify-content: center; }
.msg-phone { width: 340px; max-width: 100%; padding: 16px 12px; border-radius: 26px; background: linear-gradient(160deg, #2D2B5D, #1C1A44); }
.msg-notif { display: flex; gap: 10px; background: rgba(255, 255, 255, .96); color: #1B2233; border-radius: 14px; padding: 10px 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.msg-notif img { width: 28px; height: 28px; border-radius: 7px; object-fit: contain; background: #fff; }
.msg-notif div { display: grid; gap: 2px; min-width: 0; font-size: 12.5px; }
.msg-notif b { font-size: 13px; }
.msg-notif .ur { font-size: 14px; line-height: 1.9; }
.msg-notif span:last-child { color: #5E6778; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--bad-bg); }
