:root {
  --jsr-navy: #14284b;
  --jsr-good: #16a34a;   /* Positive */
  --jsr-bad: #dc2626;    /* Negative */
  --jsr-warn: #f59e0b;   /* In Progress */
  --jsr-blue: #2563eb;   /* Awaiting MLA */
  --jsr-grey: #9ca3af;   /* No Development (grey with red border) */
  --jsr-sidebar-w: 270px;
  --jsr-bg: #f4f6fa;
}
.demo-banner { background: #f59e0b; color: #111; text-align: center; font-size: .82rem; font-weight: 600; padding: 4px 8px; position: relative; z-index: 1100; }
body { background: var(--jsr-bg); font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Nirmala UI", "Noto Sans Devanagari", sans-serif; }
.min-w-0 { min-width: 0; }

/* App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--jsr-sidebar-w); background: var(--jsr-navy) !important; color: #e8edf7; }
@media (min-width: 992px) { .sidebar { flex-shrink: 0; position: sticky !important; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar-brand { padding: 14px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-card { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-nav { padding: 10px 8px 24px; }
.sidebar-group { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; opacity: .55; padding: 10px 10px 4px; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: #e8edf7; text-decoration: none; font-size: .92rem; }
.sidebar-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-link.active { background: #2563eb; color: #fff; }
.sidebar-link i { width: 18px; text-align: center; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 8px 20px; background: #fff; border-bottom: 1px solid #e5e7eb; }
.content { padding: 20px; max-width: 1500px; width: 100%; }
.notif-badge { position: absolute; top: -2px; right: -6px; font-size: .65rem; }
@media (max-width: 991.98px) { .content { padding: 12px; } }

/* KPI tiles (spec 9.1 top row) */
.stat-tile .stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; background: rgba(37,99,235,.1); color: #2563eb; flex-shrink: 0; }
.stat-tile.tone-success .stat-icon { background: rgba(22,163,74,.12); color: var(--jsr-good); }
.stat-tile.tone-warning .stat-icon { background: rgba(245,158,11,.15); color: #b45309; }
.stat-tile.tone-danger .stat-icon { background: rgba(220,38,38,.12); color: var(--jsr-bad); }
.stat-tile.tone-info .stat-icon { background: rgba(37,99,235,.12); color: var(--jsr-blue); }
.stat-tile.tone-secondary .stat-icon { background: rgba(100,116,139,.15); color: #475569; }
.stat-tile.tone-nodev .stat-icon { background: #e5e7eb; color: #6b7280; outline: 2px solid var(--jsr-bad); }
.stat-value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.stat-label { font-size: .82rem; color: #6b7280; }
a .stat-tile:hover { box-shadow: 0 .4rem 1rem rgba(0,0,0,.08) !important; }

/* Colour code (spec 4.2 / 9.1): Green Positive, Red Negative, Amber In Progress, Blue Awaiting MLA,
   Grey with red border No Development */
.badge.outcome-success { background: var(--jsr-good); }
.badge.outcome-danger { background: var(--jsr-bad); }
.badge.outcome-warning { background: var(--jsr-warn); color: #111; }
.badge.outcome-primary { background: var(--jsr-blue); }
.badge.outcome-nodev { background: var(--jsr-grey); color: #111; border: 2px solid var(--jsr-bad); }
.badge.outcome-secondary { background: #64748b; }
.badge.outcome-light { background: #e5e7eb; color: #111; }
.ref-row { border-left: 4px solid transparent !important; }
.outcome-border-success { border-left-color: var(--jsr-good) !important; }
.outcome-border-danger { border-left-color: var(--jsr-bad) !important; }
.outcome-border-warning { border-left-color: var(--jsr-warn) !important; }
.outcome-border-primary { border-left-color: var(--jsr-blue) !important; }
.outcome-border-nodev { border-left-color: var(--jsr-grey) !important; box-shadow: inset 0 0 0 1px var(--jsr-bad); }
.outcome-border-secondary { border-left-color: #64748b !important; }
.badge.flag { font-weight: 500; }

/* Timeline (spec 3.4.2: shown to every authorised viewer as a vertical history) */
.timeline { list-style: none; padding-left: 0; margin: 0; position: relative; }
.timeline:before { content: ""; position: absolute; left: 9px; top: 4px; bottom: 4px; width: 2px; background: #dbe2ee; }
.timeline li { position: relative; padding: 0 0 14px 30px; }
.timeline li:before { content: ""; position: absolute; left: 3px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #94a3b8; }
.timeline li.sub:before { border-color: var(--jsr-blue); }
.timeline li.sys:before { border-color: #cbd5e1; }
.timeline li.child { margin-left: 18px; }

.chart-box { position: relative; height: 240px; }
.table td, .table th { vertical-align: middle; }
dl.facts dt { font-weight: normal; color: #6b7280; font-size: .82rem; margin-bottom: 0; }
dl.facts dd { margin-bottom: .55rem; }
.progress-milestones .progress { height: 10px; }
.office-picker-results { position: absolute; z-index: 1050; max-height: 300px; overflow: auto; width: 100%; }
.check-list { max-height: 220px; overflow: auto; }

/* Auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, #14284b, #1e3a8a 60%, #2563eb); }
.auth-card { width: 100%; max-width: 440px; }

@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .content { padding: 0; }
  body { background: #fff; }
}
