/* Colours follow the screens of doc 21: navy menu, orange for the main action, teal quick buttons,
   tiles with a coloured top edge, status pills (doc 9.1). */
:root {
  --bsk-navy: #1e3557;
  --bsk-navy-2: #172b48;
  --bsk-orange: #e07b24;
  --bsk-teal: #1f8a8a;
  --bsk-blue: #3a6fb7;
  --bsk-green: #2e8b57;
  --bsk-red: #cf4b3a;
  --bsk-grey: #8a94a6;
  --bsk-bg: #eef1f5;
  --bsk-sidebar-w: 240px;
}
.demo-banner { background: #f59e0b; color: #111; text-align: center; font-size: .8rem; font-weight: 600; padding: 3px 8px; position: relative; z-index: 1100; }
body { background: var(--bsk-bg); color: #1f2a37; font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Bengali", "Nirmala UI", "Vrinda", "Noto Sans Devanagari", sans-serif; }
.min-w-0 { min-width: 0; }
a { color: #24548f; }

/* App shell: fixed LHS menu, working area on the RHS (doc 6.1) */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--bsk-sidebar-w); background: var(--bsk-navy) !important; color: #e8edf7; display: flex; flex-direction: column; }
@media (min-width: 992px) { .sidebar { flex-shrink: 0; position: sticky !important; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar-brand { padding: 16px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.sidebar-nav { padding: 8px 0 16px; flex: 1; }
.sidebar-link { display: flex; align-items: center; gap: 10px; padding: 10px 16px; color: #dfe6f1; text-decoration: none; font-size: .95rem; border-left: 4px solid transparent; }
.sidebar-link .dot { width: 8px; height: 8px; border-radius: 2px; background: #6f84a3; flex-shrink: 0; }
.sidebar-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-link.active { background: #fff; color: var(--bsk-navy); font-weight: 600; border-left-color: var(--bsk-orange); }
.sidebar-link.active .dot { background: var(--bsk-orange); }
.sidebar-sublink { display: flex; gap: 8px; align-items: center; padding: 6px 16px 6px 36px; font-size: .86rem; color: #c3cfe0; text-decoration: none; }
.sidebar-sublink:hover { color: #fff; background: rgba(255,255,255,.05); }
.sidebar-sublink.current { color: #fff; font-weight: 600; }
.sidebar-sublink i { width: 16px; opacity: .8; }
.sidebar-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); color: #c3cfe0; }
.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: 10px 20px; background: #fff; border-bottom: 1px solid #e3e7ee; }
.topbar-title { font-size: 1rem; color: var(--bsk-navy); }
.role-chip { background: #dff1ef; color: #17706f; font-weight: 600; font-size: .8rem; border-radius: 12px; padding: 3px 10px; white-space: nowrap; }
.lang-switch { display: flex; align-items: center; border: 1px solid #d5dbe5; border-radius: 6px; padding: 1px 6px; font-size: .8rem; }
.lang-switch button { border: 0; background: none; color: #5b6575; padding: 1px 3px; }
.lang-switch button.on { color: var(--bsk-navy); font-weight: 700; }
.lang-switch span { color: #c0c6d0; }
.content { padding: 18px 20px 24px; max-width: 1500px; width: 100%; }
.notif-badge { position: absolute; top: -2px; right: -6px; font-size: .62rem; }
@media (max-width: 991.98px) { .content { padding: 12px 12px 80px; } .topbar { padding: 8px 12px; } }

/* Bottom bar on a phone (Figure 4) */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; display: flex; background: #fff; border-top: 1px solid #e3e7ee; padding-bottom: env(safe-area-inset-bottom); }
.bottom-nav a { flex: 1; text-align: center; padding: 6px 0; font-size: .72rem; color: #6b7380; text-decoration: none; display: flex; flex-direction: column; align-items: center; }
.bottom-nav a i { font-size: 1.15rem; }
.bottom-nav a.on { color: var(--bsk-teal); font-weight: 700; }

/* Band 1: quick buttons (doc 6.3) */
.quick-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.quick-buttons .btn { font-weight: 600; border-radius: 6px; padding: 8px 14px; }
.btn-orange { background: var(--bsk-orange); border-color: var(--bsk-orange); color: #fff; }
.btn-orange:hover, .btn-orange:focus { background: #c86a19; border-color: #c86a19; color: #fff; }
.btn-teal { background: var(--bsk-teal); border-color: var(--bsk-teal); color: #fff; }
.btn-teal:hover, .btn-teal:focus { background: #176f6f; border-color: #176f6f; color: #fff; }
.btn-outline-navy { border: 1px solid var(--bsk-navy); color: var(--bsk-navy); background: #fff; }
.btn-outline-navy:hover { background: var(--bsk-navy); color: #fff; }
@media (max-width: 575.98px) { .quick-buttons { flex-wrap: nowrap; overflow-x: auto; } .quick-buttons .btn { white-space: nowrap; font-size: .85rem; } }

/* Band 2: summary tiles */
.tile { background: #fff; border-radius: 8px; padding: 10px 12px; border-top: 4px solid var(--bsk-teal); box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.tile-label { font-size: .8rem; color: #5b6575; line-height: 1.2; }
.tile-value { font-size: 1.55rem; font-weight: 700; color: #1f2a37; line-height: 1.25; }
.tile-hint { font-size: .75rem; color: #6b7380; }
.tile.tone-navy { border-top-color: var(--bsk-navy); }
.tile.tone-orange { border-top-color: var(--bsk-orange); }
.tile.tone-green { border-top-color: var(--bsk-green); }
.tile.tone-red { border-top-color: var(--bsk-red); }
.tile.tone-blue { border-top-color: var(--bsk-blue); }
.tile.tone-grey { border-top-color: var(--bsk-grey); }
a .tile:hover { box-shadow: 0 .3rem .8rem rgba(0,0,0,.08); }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tiles.t4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1199.98px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .tiles, .tiles.t4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile-value { font-size: 1.3rem; } }

/* Band 3: cards with charts */
.panel { background: #fff; border-radius: 8px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(16,24,40,.05); height: 100%; }
.panel-title { font-size: .92rem; font-weight: 700; color: var(--bsk-navy); margin-bottom: 8px; }
.chart-box { position: relative; height: 240px; }
.hbar-row { display: grid; grid-template-columns: minmax(90px, 42%) 1fr 44px; align-items: center; gap: 10px; font-size: .84rem; margin-bottom: 5px; }
.hbar-track { background: #edf0f5; border-radius: 3px; height: 12px; overflow: hidden; }
.hbar-fill { height: 100%; background: var(--bsk-blue); border-radius: 3px; }
.hb-orange .hbar-fill { background: var(--bsk-orange); }
.hb-teal .hbar-fill { background: var(--bsk-teal); }
.hb-green .hbar-fill { background: var(--bsk-green); }
.hbar-value { text-align: right; font-weight: 700; }
.alert-list { list-style: none; padding: 0; margin: 0; }
.alert-list li { padding: 6px 0 6px 16px; border-bottom: 1px solid #edf0f5; position: relative; font-size: .86rem; }
.alert-list li:before { content: ""; position: absolute; left: 0; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--bsk-blue); }
.alert-list li.good:before { background: var(--bsk-green); }
.alert-list li.warn:before { background: var(--bsk-orange); }
.alert-list li.bad:before { background: var(--bsk-red); }
.check-table td { font-size: .86rem; padding: 6px 4px; border-bottom: 1px solid #edf0f5; }
.check-table td.v { text-align: right; font-weight: 700; }
.v-good { color: var(--bsk-green); } .v-warn { color: var(--bsk-orange); } .v-bad { color: var(--bsk-red); } .v-muted { color: var(--bsk-grey); }

/* Kendra selector (doc 11.1 / Figure 4) */
.kendra-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.kendra-pills a { border: 1px solid #cfd6e1; border-radius: 14px; padding: 3px 12px; font-size: .82rem; font-weight: 600; color: var(--bsk-navy); text-decoration: none; background: #fff; }
.kendra-pills a.on { background: var(--bsk-navy); color: #fff; border-color: var(--bsk-navy); }

/* Status pills (doc 9.1) */
.badge.st-received { background: var(--bsk-blue); }
.badge.st-inprocess { background: var(--bsk-orange); }
.badge.st-referred { background: var(--bsk-grey); }
.badge.st-done { background: var(--bsk-green); }
.badge.st-notdone { background: var(--bsk-red); }

/* Data entry steps (Figure 3) */
.step { background: #fff; border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 2px rgba(16,24,40,.05); }
.step-title { font-weight: 700; color: var(--bsk-navy); font-size: .92rem; margin-bottom: 6px; }
.step-title .meta { font-weight: 400; color: #6b7380; margin-left: 8px; font-size: .84rem; }
.repeat-note { color: var(--bsk-green); font-weight: 600; font-size: .86rem; }
.today-list td, .today-list th { font-size: .82rem; }
.timeline { list-style: none; padding-left: 0; margin: 0; position: relative; }
.timeline:before { content: ""; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: #dbe2ee; }
.timeline li { position: relative; padding: 0 0 12px 26px; font-size: .88rem; }
.timeline li:before { content: ""; position: absolute; left: 1px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #94a3b8; }
.progress-steps { display: flex; justify-content: space-between; font-size: .78rem; color: #7a8494; }
.progress-steps .on { color: var(--bsk-green); font-weight: 700; }
dl.facts dt { font-weight: normal; color: #6b7380; font-size: .8rem; margin-bottom: 0; }
dl.facts dd { margin-bottom: .5rem; }
.table td, .table th { vertical-align: middle; }
.table thead th { font-size: .8rem; color: #5b6575; font-weight: 600; }
.offline-bar { background: #fff7e6; border: 1px solid #f5c76b; border-radius: 6px; padding: 6px 10px; margin-bottom: 10px; font-size: .86rem; }
.map-box { height: 420px; border-radius: 8px; }
.heat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 6px; }
.heat-grid a { display: block; border-radius: 4px; padding: 8px 4px; text-align: center; font-size: .75rem; color: #fff; text-decoration: none; }
.token-screen { background: #0f1e33; color: #fff; min-height: 100vh; }
.token-now { font-size: 9rem; font-weight: 800; line-height: 1; color: #ffd27a; }

/* Auth */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(135deg, #172b48, #1e3557 55%, #1f8a8a); }
.auth-card { width: 100%; max-width: 460px; }

/* Public pages */
.public-head { background: var(--bsk-navy); color: #fff; padding: 12px 0; }

@media print {
  .sidebar, .topbar, .no-print, .bottom-nav, .demo-banner { display: none !important; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; }
  .panel, .tile, .step { box-shadow: none; border: 1px solid #ddd; }
}
