/* Tenant console (console.tanzeem.in).
   Same design system as the jamaat portal's dashboards (application/views/Anjuman/Home.php,
   Anjuman/Header.php): ivory page, cream top bar, white sidebar with icon tiles, gold
   gradient hero, white 16px cards, overview cards with icon squares. Light only, like
   the portal. Text-bearing gold uses #8a6408 (5.4:1 on white); #b8860b is for marks. */
:root {
  --gold: #b8860b;
  --gold-deep: #8a6408;
  --gold-darker: #6f5006;
  --gold-light: #e6c84a;
  --gold-muted: #f5e9c0;
  --gold-wash: #fdf3d9;
  --cream: #fefbf3;
  --bg: #faf7f0;
  --surface: #ffffff;
  --surface-2: #f7f4ec;
  --border: #e8e0cc;
  --border-light: #f0ece0;
  --text: #1a1610;
  --text-2: #5a5244;
  --text-3: #9c8f7a;
  --ok: #1a6645;
  --ok-soft: #eaf4ee;
  --ok-line: #86efac;
  --warn: #a5560a;
  --warn-soft: #fffbeb;
  --warn-line: #f5d58a;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-line: #fca5a5;
  --info: #1d4ed8;
  --info-soft: #eff6ff;
  --teal: #0d9488;
  --teal-soft: #ccfbf1;
  --violet: #7c3aed;
  --violet-soft: #ede9fe;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
  --shadow: 0 4px 16px rgba(0, 0, 0, .07), 0 1px 4px rgba(0, 0, 0, .04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, .10), 0 2px 8px rgba(0, 0, 0, .05);
  /* Chart series — validated with the dataviz validate_palette.js against #ffffff */
  --series-1: #b8860b;
  --series-2: #0d9488;
  --grid: #f0ead9;
  --sidebar: #1c1710; /* chart tooltip background */
  --accent: var(--gold-deep);
  --appbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--gold-deep); text-decoration: none; }
a:hover { color: var(--gold-darker); }
h1, h2, h3 { margin: 0; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
code { background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 5px; padding: 1px 5px; }

/* ---------- top bar (portal .main-navbar) ---------- */
.appbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--appbar-h); z-index: 50;
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
  background: var(--cream); border-bottom: 1px solid #ece3cc; box-shadow: 0 2px 12px rgba(173, 126, 5, .06);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: linear-gradient(135deg, #e6c84a, #b8860b 55%, #8a6408); color: #fff;
  display: grid; place-items: center; font: 700 16px/1 Literata, Georgia, serif; box-shadow: 0 2px 6px rgba(138, 100, 8, .25);
}
.brand-name { font: 600 17px/1.1 Literata, Georgia, serif; color: var(--text); }
.brand-sub { font-size: 11px; color: #7a6f57; font-weight: 600; letter-spacing: .3px; }
.profile-pill {
  display: flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px;
  background: #fff; border: 1px solid #ece3cc; border-radius: 40px; min-width: 0;
}
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: linear-gradient(135deg, #ad7e05, #e6c84a); color: #fff; font-weight: 700; font-size: 12px;
}
.profile-pill .pp-name { font-weight: 700; font-size: 12.5px; color: var(--gold-deep); text-transform: uppercase; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.profile-pill .pp-meta { font-size: 11px; color: #7a6f57; font-weight: 500; text-transform: capitalize; }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.hdr-link {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px;
  font: 600 13.5px "Plus Jakarta Sans", sans-serif; color: #2b2312; background: none; border: 0; cursor: pointer; white-space: nowrap;
}
.hdr-link:hover { background: var(--gold-wash); color: var(--gold-deep); }
.hdr-link.logout:hover { background: var(--danger-soft); color: var(--danger); }
.hdr-link i { font-size: 14px; width: 16px; text-align: center; }
.env-pill { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--gold-muted); color: var(--gold-deep); letter-spacing: .3px; text-transform: uppercase; }
.env-pill.local { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.menu-toggle { display: none; }

/* ---------- layout + sidebar (portal .anj-sidebar / .menu-*) ---------- */
.shell { display: flex; min-height: 100vh; padding-top: var(--appbar-h); }
.sidebar {
  width: 262px; flex-shrink: 0; position: sticky; top: var(--appbar-h); height: calc(100vh - var(--appbar-h));
  overflow-y: auto; background: var(--surface); border-right: 1px solid var(--border); padding: 16px 12px 32px;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.sb-title { font-weight: 800; font-size: 13.5px; color: var(--text-2); margin: 0 4px 6px; display: flex; align-items: center; gap: 8px; }
.sb-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--gold-muted); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.menu-section { font-size: 9.5px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-3); padding: 14px 6px 5px; }
.menu-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px;
  color: var(--text-2); font-size: 13.5px; font-weight: 500; transition: background .14s, color .14s;
}
.menu-item + .menu-item { margin-top: 2px; }
.menu-item:hover { background: var(--gold-muted); color: var(--gold-deep); }
.menu-icon {
  width: 28px; height: 28px; border-radius: 7px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-3); font-size: 12.5px; transition: background .14s, color .14s;
}
.menu-item:hover .menu-icon { background: #fff; color: var(--gold); }
.menu-item.active { background: var(--gold-muted); color: var(--gold-deep); font-weight: 700; }
.menu-item.active .menu-icon { background: var(--gold); color: #fff; }
.menu-item .count { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--danger-soft); color: var(--danger); border-radius: 99px; padding: 1px 7px; }

.main { flex: 1; min-width: 0; }
.content { padding: 22px 22px 60px; max-width: 1400px; }

/* ---------- hero (portal .anj-header) ---------- */
.hero {
  background: linear-gradient(135deg, #78520a 0%, #b8860b 50%, #c9a227 100%);
  border-radius: 22px; padding: 22px 26px; margin-bottom: 20px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #fff;
}
.hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='30'/%3E%3C/g%3E%3C/svg%3E") repeat;
}
.hero::after { content: ''; position: absolute; right: -50px; top: -50px; width: 220px; height: 220px; background: radial-gradient(circle, rgba(255, 255, 255, .12) 0%, transparent 70%); pointer-events: none; }
.hero-text { position: relative; z-index: 1; min-width: 0; }
.hero-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .7); margin-bottom: 4px; }
.hero h1 { font: 600 26px/1.15 Literata, Georgia, serif; color: #fff; overflow-wrap: anywhere; }
.hero-sub { color: rgba(255, 255, 255, .8); font: 500 15px/1.4 Literata, Georgia, serif; margin-top: 5px; }
.hero-badge {
  position: relative; z-index: 1; flex-shrink: 0; text-align: center; padding: 10px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .25); backdrop-filter: blur(6px);
}
.hero-badge b { display: block; font-size: 25px; font-weight: 800; line-height: 1; color: #fff; }
.hero-badge span { display: block; margin-top: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: rgba(255, 255, 255, .75); }

/* ---------- cards (portal .chart-container + .section-header-standard) ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.card:hover { box-shadow: var(--shadow); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px; border-bottom: 1.5px solid var(--border-light);
}
.card-head h2 { font-size: 14px; font-weight: 800; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.card-head h2 i { color: var(--gold); font-size: 13px; }
.card-body { padding: 18px 20px; }
.muted { color: var(--text-3); }
.small { font-size: 12.5px; }
.stack > * + * { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.grid-2 + .grid-2, .kpis + .grid-2, .grid-2 + .card { margin-top: 16px; }

/* ---------- KPI tiles (portal .overview-card) ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; position: relative; overflow: hidden;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px; color: inherit;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
a.kpi:hover { border-color: var(--gold); box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
a.kpi::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--gold); transform: scaleX(0); transition: transform .2s; transform-origin: left; }
a.kpi:hover::after { transform: scaleX(1); }
.kpi-ico { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; background: var(--gold-muted); color: var(--gold); }
.kpi-body { min-width: 0; display: flex; flex-direction: column; }
.kpi-label { font-size: 12px; color: var(--text-3); font-weight: 600; line-height: 1.3; }
.kpi-value { font-size: 21px; font-weight: 800; color: var(--text); line-height: 1.15; margin-top: 3px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.kpi-note { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.kpi.ok { border-color: var(--ok-line); } .kpi.ok .kpi-ico { background: var(--ok-soft); color: var(--ok); }
.kpi.warn { border-color: var(--warn-line); } .kpi.warn .kpi-ico { background: var(--warn-soft); color: var(--warn); }
.kpi.danger { border-color: var(--danger-line); } .kpi.danger .kpi-ico { background: var(--danger-soft); color: var(--danger); }
.kpi.danger .kpi-value { color: var(--danger); }
.kpi.teal .kpi-ico { background: var(--teal-soft); color: var(--teal); }
.kpi.info .kpi-ico { background: var(--info-soft); color: var(--info); }
.kpi.violet .kpi-ico { background: var(--violet-soft); color: var(--violet); }

/* ---------- pills, alerts, tables ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cc; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.pill.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.pill.neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }
.pill.accent { background: var(--gold-muted); color: var(--gold-deep); border-color: #ecd9a0; }

.alert { padding: 11px 14px; border-radius: 12px; margin-bottom: 16px; border: 1px solid transparent; word-break: break-word; font-weight: 500; }
.alert.success { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cc; }
.alert.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.alert.info { background: var(--gold-wash); color: var(--gold-darker); border-color: #ecd9a0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border-light); vertical-align: middle; }
th { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); white-space: nowrap; }
tbody tr:hover td { background: #fffdf7; }
tr:last-child td { border-bottom: 0; }
td .sub, .sub { color: var(--text-3); font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
th.num { text-align: right; }
.stale { color: var(--warn); font-weight: 600; }

/* ---------- forms + buttons ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface-2); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184, 134, 11, .15); background: #fff; }
.field + .field { margin-top: 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1; min-width: 160px; margin-top: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 10px;
  border: 1px solid var(--gold-deep); background: var(--gold-deep); color: #fff; font: 700 13.5px "Plus Jakarta Sans", sans-serif;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--gold-darker); border-color: var(--gold-darker); color: #fff; }
.btn.block { width: 100%; }
.btn.ghost { background: var(--surface); color: var(--text-2); border-color: var(--border); }
.btn.ghost:hover { background: var(--gold-muted); border-color: var(--gold); color: var(--gold-deep); }
.btn.danger-ghost { background: var(--surface); color: var(--danger); border-color: var(--border); }
.btn.danger-ghost:hover { background: var(--danger-soft); border-color: var(--danger-line); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn:disabled { opacity: .6; cursor: default; }
.inline-form { display: inline; margin: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.actions select { width: auto; padding: 4px 8px; font-size: 12.5px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; min-width: 150px; padding: 7px 10px; }
fieldset[disabled] input, fieldset[disabled] select, fieldset[disabled] textarea { opacity: .75; }

/* ---------- page bits ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tabs { display: flex; gap: 4px; margin-bottom: 18px; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 5px; }
.tabs a { padding: 8px 14px; color: var(--text-2); border-radius: 8px; white-space: nowrap; font-weight: 600; font-size: 13px; }
.tabs a:hover { background: var(--gold-wash); color: var(--gold-deep); }
.tabs a.active { background: var(--gold-muted); color: var(--gold-deep); font-weight: 700; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { display: flex; gap: 10px; align-items: baseline; padding: 10px 20px; border-bottom: 1px solid var(--border-light); flex-wrap: wrap; }
.alert-list li:last-child { border-bottom: 0; }
.alert-list .who { font-weight: 700; white-space: nowrap; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border-light); }
.checks li:last-child { border-bottom: 0; }
.checks .v { color: var(--text-2); text-align: right; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.dl dt { color: var(--text-3); font-weight: 600; }
.dl dd { margin: 0; }
.chart-box { position: relative; height: 280px; }
.chart-empty { display: grid; place-items: center; height: 100%; color: var(--text-3); font-size: 13px; text-align: center; padding: 0 16px; }

/* ---------- import coverage matrix ---------- */
.matrix th.mod { text-transform: none; letter-spacing: 0; font-size: 11px; font-weight: 700; color: var(--text-2); text-align: center; min-width: 62px; max-width: 78px; padding: 8px 4px; white-space: normal; line-height: 1.2; vertical-align: bottom; }
.matrix td.cell { text-align: center; padding: 8px 3px; }
.matrix td.used { text-align: center; white-space: nowrap; padding: 8px 10px; }
.mx { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 52px; padding: 4px 5px; border-radius: 8px; font-size: 11.5px; font-weight: 700; line-height: 1.2; border: 1px solid transparent; }
.mx small { font-weight: 500; font-size: 10.5px; opacity: .85; white-space: nowrap; }
.mx.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe3cc; }
.mx.stale { background: var(--gold-wash); color: var(--gold-deep); border-color: #ecd9a0; }
.mx.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.mx.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.mx.never { color: var(--text-3); font-weight: 500; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--text-2); }
.legend .mx { min-width: 0; padding: 2px 8px; }
.sticky-col { position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 160px; box-shadow: 1px 0 0 var(--border-light); }
tbody tr:hover td.sticky-col { background: #fffdf7; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1000px 420px at 50% -10%, var(--gold-muted), transparent 70%), var(--bg); }
.auth-card { width: 100%; max-width: 410px; padding: 28px; border-top: 4px solid var(--gold); }
.auth-card .brand { margin-bottom: 20px; }
.auth-card h1 { font: 600 21px/1.2 Literata, Georgia, serif; margin-bottom: 4px; }
.auth-card p.lead { color: var(--text-2); margin: 0 0 20px; }
.code-input { font-size: 22px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: 10px; border: 1px solid var(--border); margin: 0 auto 12px; width: max-content; }
.secret { text-align: center; word-break: break-all; padding: 8px; border-radius: 8px; background: var(--surface-2); margin-bottom: 18px; }
.steps { margin: 0 0 16px; padding-left: 18px; color: var(--text-2); }
.steps li + li { margin-top: 4px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .profile-pill { display: none; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-flex; }
  .hdr-link span { display: none; }
  .brand-sub { display: none; }
  .sidebar { position: fixed; left: 0; top: var(--appbar-h); z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .content { padding: 16px 16px 40px; }
  .hero { padding: 16px 18px; border-radius: 16px; flex-wrap: wrap; }
  .hero h1 { font-size: 21px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- maintenance form + running state ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px; flex-wrap: wrap; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.seg input:checked + span { background: #fff; color: var(--gold-deep); box-shadow: var(--shadow-sm); }
.seg input:focus-visible + span { outline: 2px solid var(--gold); }
.pick { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.pick-item { display: flex; gap: 9px; align-items: center; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 10px; margin: 0; cursor: pointer; font-weight: 500; color: var(--text); }
.pick-item:has(input:checked) { border-color: var(--gold); background: var(--gold-wash); }
.pick-item .sub { display: block; }
.site-links { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.site-links a { font-size: 12px; font-weight: 600; }
.live-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger-line); }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(185, 28, 28, .5); animation: livepulse 1.6s infinite; flex-shrink: 0; }
@keyframes livepulse { 0% { box-shadow: 0 0 0 0 rgba(185, 28, 28, .5); } 70% { box-shadow: 0 0 0 9px rgba(185, 28, 28, 0); } 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0); } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.row + .field, .row + .row { margin-top: 14px; }

/* ---- invoice line editor ---- */
table.lines td { padding: 6px 8px; vertical-align: middle; }
table.lines input { width: 100%; padding: 8px 10px; }
table.lines input.num { text-align: right; }
table.lines .line-amt { white-space: nowrap; font-weight: 600; }
table.lines tfoot td { border-top: 1.5px solid var(--border); padding-top: 12px; }

/* (i) help icons and the setup checklist */
a.info-i, span.info-i { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-left: 4px; line-height: 1; text-decoration: none; cursor: help; color: var(--muted, #6b7a80); border-radius: 50%; }
a.info-i svg, span.info-i svg { display: block; }
a.info-i:hover, a.info-i:focus-visible { color: var(--accent, #2a6f5e); outline: none; }
a.info-i:focus-visible { box-shadow: 0 0 0 2px var(--accent, #2a6f5e); }
.check-row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--border); }
.check-row .dot { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; text-align: center; line-height: 22px; font-size: 12px; font-weight: 700; color: #fff; }
.check-row .dot.ok { background: #2e7d32; }
.check-row .dot.todo { background: #c77700; }
.check-row .dot.info { background: #6b7a80; }

/* page-header action and the New jamaat screen */
.hero-side { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.hero-btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 12px; background: #fff; color: #6b4a08; font-weight: 800; font-size: 14px; text-decoration: none; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); transition: transform .15s, box-shadow .15s; }
.hero-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .24); }
.nj-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.nj-form > * + * { margin-top: 16px; }
.nj-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.nj-row .field + .field { margin-top: 0; }
.nj-hint { font-size: 12.5px; color: var(--muted, #7a6a4a); margin: 6px 0 0; }
.nj-addr { display: flex; align-items: stretch; }
.nj-addr input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.nj-addr .suffix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border); border-left: 0; border-radius: 0 10px 10px 0; background: var(--surface-2, #f1ede2); color: var(--muted, #7a6a4a); font-weight: 600; white-space: nowrap; }
.nj-side { position: sticky; top: 100px; }
.nj-steps { list-style: none; margin: 0; padding: 0; counter-reset: nj; }
.nj-steps li { counter-increment: nj; position: relative; padding: 0 0 14px 38px; font-size: 14px; line-height: 1.45; }
.nj-steps li::before { content: counter(nj); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: #f3e6bf; color: #6b4a08; font-weight: 800; font-size: 13px; display: grid; place-items: center; }
.nj-steps li:not(:last-child)::after { content: ''; position: absolute; left: 12px; top: 28px; bottom: 2px; width: 2px; background: #eadfbd; }
.nj-preview { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #fbf6e6; border: 1px solid #eadfbd; font-size: 13.5px; line-height: 1.6; color: #3b2f10; }
.nj-preview b { color: #6b4a08; }
.nj-tick { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fffdf7; }
.nj-tick input { margin-top: 3px; }
.nj-warn { margin-top: 8px; padding: 9px 12px; border-radius: 8px; background: #fff3dc; color: #5a3b00; font-size: 13px; }
@media (max-width: 980px) { .nj-layout { grid-template-columns: minmax(0, 1fr); } .nj-side { position: static; } .nj-row { grid-template-columns: 1fr; } }
