/* ==========================================================================
   SWRF Integrated Reform Monitoring & Assessment Platform
   style.css — Design system + application styling
   Bihar State Water Informatics Centre (B-SWIC)
   ========================================================================== */

/* ------------------------------------------------------------------ *
 * 1. DESIGN TOKENS
 * ------------------------------------------------------------------ */
:root {
  /* Brand */
  --primary: #123B5D;
  --primary-dark: #0B2942;
  --primary-light: #E8EFF5;
  --teal: #008C95;
  --teal-light: #E3F3F3;
  --cyan: #18AFC0;

  /* Status */
  --success: #238B5A;
  --success-light: #E7F5EE;
  --warning: #C4830A;
  --warning-light: #FDF3E1;
  --danger: #C94B4B;
  --danger-light: #FBEAEA;
  --info: #3A7BD5;
  --info-light: #EAF1FB;
  --grey: #64748B;
  --grey-light: #EEF1F5;

  /* Surfaces */
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-soft: #F8FAFC;
  --surface-hover: #F1F5F9;

  /* Text */
  --text-primary: #172B3A;
  --text-secondary: #5B6B7A;
  --text-muted: #8A98A6;
  --text-inverse: #FFFFFF;

  /* Borders / radius */
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(18, 59, 93, 0.06);
  --shadow-md: 0 4px 14px rgba(18, 59, 93, 0.08);
  --shadow-lg: 0 12px 28px rgba(18, 59, 93, 0.12);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed: 76px;
  --header-height: 68px;

  /* Motion */
  --t-fast: 150ms ease;
  --t-med: 220ms ease;

  --font-sans: "Inter", "Manrope", "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--text-primary); font-weight: 700; margin: 0; }
a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--primary); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ------------------------------------------------------------------ *
 * 2. APP SHELL
 * ------------------------------------------------------------------ */
.app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ---- Sidebar ---- */
.app-sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1030;
  transition: width var(--t-med), transform var(--t-med);
}

.app-shell.sidebar-collapsed .app-sidebar { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  min-height: var(--header-height);
}

.sidebar-brand__mark {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px;
  flex-shrink: 0;
}

.sidebar-brand__text { overflow: hidden; white-space: nowrap; }
.sidebar-brand__text .name { font-size: 14.5px; font-weight: 800; color: var(--primary-dark); line-height: 1.2; }
.sidebar-brand__text .sub { font-size: 11px; color: var(--text-muted); font-weight: 600; letter-spacing: .03em; }

.app-shell.sidebar-collapsed .sidebar-brand__text,
.app-shell.sidebar-collapsed .nav-link__label,
.app-shell.sidebar-collapsed .nav-section__title,
.app-shell.sidebar-collapsed .sidebar-user__meta { display: none; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.nav-section__title {
  font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 10px 6px;
}
.nav-section__title:first-child { padding-top: 4px; }

.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 2px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600; font-size: 13.5px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.nav-link i { font-size: 16.5px; width: 20px; text-align: center; flex-shrink: 0; color: var(--text-muted); }
.nav-link:hover { background: var(--surface-hover); color: var(--primary-dark); }
.nav-link:hover i { color: var(--teal); }
.nav-link.active {
  background: var(--teal-light);
  color: var(--primary-dark);
  border-left-color: var(--teal);
}
.nav-link.active i { color: var(--teal); }
.nav-link .badge-count {
  margin-left: auto; font-size: 10.5px; font-weight: 700;
  background: var(--danger); color: #fff; border-radius: 999px;
  padding: 1px 6px; min-width: 18px; text-align: center;
}

.sidebar-user {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.sidebar-user__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.sidebar-user__meta .uname { font-size: 13px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.sidebar-user__meta .urole { font-size: 11px; color: var(--text-muted); }

.sidebar-collapse-btn {
  border: none; background: transparent; color: var(--text-muted);
  width: 100%; padding: 8px; border-top: 1px solid var(--border);
  font-size: 13px; cursor: pointer;
}
.sidebar-collapse-btn:hover { color: var(--teal); background: var(--surface-hover); }

/* ---- Main column ---- */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--t-med);
}
.app-shell.sidebar-collapsed .app-main { margin-left: var(--sidebar-collapsed); }

/* ---- Header ---- */
.app-header {
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 1020;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.header-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.sidebar-toggle-btn, .mobile-nav-btn {
  border: 1px solid var(--border); background: var(--surface-soft);
  color: var(--text-secondary); width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0;
}
.sidebar-toggle-btn:hover, .mobile-nav-btn:hover { background: var(--surface-hover); color: var(--primary); }
.mobile-nav-btn { display: none; }

.breadcrumb-trail { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); font-weight: 600; overflow: hidden; white-space: nowrap; }
.breadcrumb-trail .crumb-sep { color: var(--border-strong); }
.breadcrumb-trail .crumb-current { color: var(--primary-dark); font-weight: 700; }

.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.header-refresh-meta { font-size: 11.5px; color: var(--text-muted); text-align: right; line-height: 1.2; display: none; }
.header-refresh-meta strong { color: var(--text-secondary); font-weight: 700; }

.icon-btn {
  border: 1px solid var(--border); background: var(--surface-soft);
  color: var(--text-secondary); width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  position: relative; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--primary); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger); border: 1.5px solid var(--surface);
}
.icon-btn.spinning i { animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-report {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; border: none;
  padding: 0 16px; height: 38px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background var(--t-fast);
}
.btn-report:hover { background: var(--primary-dark); color: #fff; }

.header-user { display: flex; align-items: center; gap: 10px; padding-left: 10px; border-left: 1px solid var(--border); cursor: pointer; }
.header-user__avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--teal); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12.5px; }
.header-user__meta { line-height: 1.2; display: none; }
.header-user__meta .uname { font-size: 12.5px; font-weight: 700; }
.header-user__meta .urole { font-size: 10.5px; color: var(--text-muted); }

.dropdown-menu { border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: var(--radius-md); padding: 8px; }
.dropdown-menu .dropdown-header-custom { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); padding: 8px 10px 4px; }
.dropdown-item { border-radius: var(--radius-sm); padding: 9px 10px; font-size: 13px; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 10px; }
.dropdown-item i { color: var(--text-muted); font-size: 15px; width: 18px; }
.dropdown-item:hover { background: var(--surface-hover); color: var(--primary-dark); }
.dropdown-item:hover i { color: var(--teal); }

.notif-item { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius-sm); align-items: flex-start; cursor: pointer; }
.notif-item:hover { background: var(--surface-hover); }
.notif-item__icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 14px; }
.notif-item__text { font-size: 12.5px; font-weight: 600; color: var(--text-primary); line-height: 1.35; }
.notif-item__time { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }

/* ---- Page container ---- */
.app-content { padding: 22px 26px 48px; flex: 1; min-width: 0; }
.page-view { display: none; animation: fadeIn var(--t-med); }
.page-view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px);} to { opacity: 1; transform: translateY(0);} }

.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 26px; font-weight: 800; color: var(--primary-dark); letter-spacing: -0.01em; }
.page-header p { font-size: 13.5px; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }
.page-header-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-header-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; flex-wrap: wrap; gap: 10px; }
.section-heading h2 { font-size: 17px; font-weight: 800; color: var(--primary-dark); display: flex; align-items: center; gap: 8px; }
.section-heading .section-sub { font-size: 12px; color: var(--text-muted); font-weight: 500; margin-top: 2px; }

/* ------------------------------------------------------------------ *
 * 3. BUTTONS
 * ------------------------------------------------------------------ */
.btn { font-weight: 700; font-size: 13px; border-radius: var(--radius-sm); }
.btn-swrf-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-swrf-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-swrf-teal { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-swrf-teal:hover { background: #00717A; border-color: #00717A; color: #fff; }
.btn-swrf-outline { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-secondary); }
.btn-swrf-outline:hover { background: var(--surface-hover); border-color: var(--text-muted); color: var(--primary-dark); }
.btn-sm-icon { display: inline-flex; align-items: center; gap: 6px; }

/* ------------------------------------------------------------------ *
 * 4. CARDS / SURFACES
 * ------------------------------------------------------------------ */
.card-surface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 18px;
}
.card-surface--flush { padding: 0; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; flex-wrap: wrap; }
.card-title-row h3 { font-size: 14.5px; font-weight: 800; color: var(--text-primary); }
.card-title-row .card-meta { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

/* ---- KPI cards ---- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.kpi-grid--4 { grid-template-columns: repeat(4, 1fr); }
.kpi-grid--5 { grid-template-columns: repeat(5, 1fr); }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-fast), transform var(--t-fast);
  cursor: default;
  min-width: 0;
}
.kpi-card.clickable { cursor: pointer; }
.kpi-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.kpi-card__top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.kpi-card__icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0;
}
.kpi-card__trend { font-size: 11px; font-weight: 800; display: flex; align-items: center; gap: 3px; padding: 3px 7px; border-radius: 999px; }
.kpi-card__trend.up { color: var(--success); background: var(--success-light); }
.kpi-card__trend.down { color: var(--danger); background: var(--danger-light); }
.kpi-card__trend.flat { color: var(--text-muted); background: var(--surface-soft); }

.kpi-card__value { font-size: 25px; font-weight: 800; color: var(--primary-dark); line-height: 1.1; letter-spacing: -0.01em; }
.kpi-card__value small { font-size: 14px; font-weight: 700; color: var(--text-muted); }
.kpi-card__label { font-size: 12px; color: var(--text-secondary); font-weight: 700; margin-top: 3px; }
.kpi-card__foot { margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.kpi-card__sparkline { flex: 1; height: 24px; }

.icon-tint-primary { background: var(--primary-light); color: var(--primary); }
.icon-tint-teal { background: var(--teal-light); color: var(--teal); }
.icon-tint-success { background: var(--success-light); color: var(--success); }
.icon-tint-warning { background: var(--warning-light); color: var(--warning); }
.icon-tint-danger { background: var(--danger-light); color: var(--danger); }
.icon-tint-info { background: var(--info-light); color: var(--info); }
.icon-tint-grey { background: var(--grey-light); color: var(--grey); }

/* ---- Progress bars ---- */
.progress-swrf { height: 8px; border-radius: 99px; background: var(--surface-soft); overflow: hidden; border: 1px solid var(--border); }
.progress-swrf__bar { height: 100%; border-radius: 99px; transition: width 600ms ease; }
.progress-swrf__bar.bar-primary { background: var(--primary); }
.progress-swrf__bar.bar-teal { background: var(--teal); }
.progress-swrf__bar.bar-success { background: var(--success); }
.progress-swrf__bar.bar-warning { background: var(--warning); }
.progress-swrf__bar.bar-danger { background: var(--danger); }
.progress-swrf__bar.bar-info { background: var(--info); }

.progress-swrf.lg { height: 14px; }

/* ---- Status badges ---- */
.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px;
  white-space: nowrap; letter-spacing: .01em;
}
.status-badge i { font-size: 10px; }
.status-success { background: var(--success-light); color: var(--success); }
.status-warning { background: var(--warning-light); color: var(--warning); }
.status-danger { background: var(--danger-light); color: var(--danger); }
.status-info { background: var(--info-light); color: var(--info); }
.status-grey { background: var(--grey-light); color: var(--grey); }

.priority-pill { font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.priority-High { background: var(--danger-light); color: var(--danger); }
.priority-Medium { background: var(--warning-light); color: var(--warning); }
.priority-Low { background: var(--success-light); color: var(--success); }

/* ------------------------------------------------------------------ *
 * 5. TABLES
 * ------------------------------------------------------------------ */
.table-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.table-toolbar .search-box { position: relative; flex: 1; min-width: 220px; max-width: 320px; }
.search-box input {
  width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 13px; background: var(--surface-soft);
}
.search-box input:focus { outline: none; border-color: var(--teal); background: var(--surface); box-shadow: 0 0 0 3px rgba(0,140,149,0.1); }
.search-box i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; }

.filter-select {
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 600; padding: 8px 10px; background: var(--surface-soft); color: var(--text-secondary);
  min-width: 130px;
}
.filter-select:focus { outline: none; border-color: var(--teal); }

.table-responsive-swrf { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: auto; background: var(--surface); max-width: 100%; }
table.swrf-table { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 12.75px; }
table.swrf-table thead th {
  position: sticky; top: 0; z-index: 5;
  background: var(--surface-soft); color: var(--text-secondary);
  font-size: 10.75px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap;
  cursor: pointer; user-select: none;
}
table.swrf-table thead th:hover { color: var(--primary-dark); }
table.swrf-table thead th i { font-size: 10px; margin-left: 4px; color: var(--text-muted); }
table.swrf-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text-primary); vertical-align: middle; }
table.swrf-table tbody tr { transition: background var(--t-fast); }
table.swrf-table tbody tr:hover { background: var(--surface-hover); }
table.swrf-table tbody tr:last-child td { border-bottom: none; }
.cell-strong { font-weight: 700; color: var(--primary-dark); }
.cell-muted { color: var(--text-muted); font-size: 11.5px; }
.row-actions { display: flex; gap: 5px; }
.row-action-btn {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface-soft); color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 12.5px; transition: all var(--t-fast);
}
.row-action-btn:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---- Pagination ---- */
.pagination-bar { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; flex-wrap: wrap; gap: 10px; }
.pagination-info { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.pagination-controls { display: flex; gap: 6px; }
.page-btn {
  min-width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-secondary); font-size: 12.5px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0 8px;
}
.page-btn:hover:not(:disabled) { background: var(--surface-hover); }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------------ *
 * 6. MODALS / DRAWERS
 * ------------------------------------------------------------------ */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-header .modal-title { font-size: 16.5px; font-weight: 800; color: var(--primary-dark); }
.modal-body { padding: 22px; max-height: calc(100vh - 220px); overflow-y: auto; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

.detail-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; }
.detail-row .dl-label { color: var(--text-muted); font-weight: 600; }
.detail-row .dl-value { color: var(--text-primary); font-weight: 700; text-align: right; }

.offcanvas { max-width: 460px; }
.offcanvas-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.offcanvas-title { font-size: 16px; font-weight: 800; color: var(--primary-dark); }
.offcanvas-body { padding: 20px 22px; }

.drawer-section { margin-bottom: 22px; }
.drawer-section__title { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); margin-bottom: 10px; }

/* ------------------------------------------------------------------ *
 * 7. TABS
 * ------------------------------------------------------------------ */
.swrf-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.swrf-tab {
  padding: 10px 16px; font-size: 13px; font-weight: 700; color: var(--text-muted);
  border-bottom: 2px solid transparent; cursor: pointer; transition: color var(--t-fast);
}
.swrf-tab:hover { color: var(--primary-dark); }
.swrf-tab.active { color: var(--teal); border-bottom-color: var(--teal); }

/* ------------------------------------------------------------------ *
 * 8. TOASTS
 * ------------------------------------------------------------------ */
.toast-stack { position: fixed; top: 84px; right: 22px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.swrf-toast {
  min-width: 300px; max-width: 360px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg);
  padding: 12px 14px; display: flex; align-items: flex-start; gap: 10px;
  animation: slideIn var(--t-med);
}
.swrf-toast.success { border-left-color: var(--success); }
.swrf-toast.warning { border-left-color: var(--warning); }
.swrf-toast.danger { border-left-color: var(--danger); }
.swrf-toast i.toast-ic { font-size: 17px; margin-top: 1px; }
.swrf-toast.success i.toast-ic { color: var(--success); }
.swrf-toast.warning i.toast-ic { color: var(--warning); }
.swrf-toast.danger i.toast-ic { color: var(--danger); }
.swrf-toast.info i.toast-ic, .swrf-toast:not(.success):not(.warning):not(.danger) i.toast-ic { color: var(--teal); }
.swrf-toast .toast-text { font-size: 12.75px; font-weight: 600; color: var(--text-primary); flex: 1; }
.swrf-toast .toast-close { border: none; background: none; color: var(--text-muted); cursor: pointer; font-size: 15px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px);} to { opacity: 1; transform: translateX(0);} }

/* ------------------------------------------------------------------ *
 * 9. EMPTY / LOADING / ERROR STATES
 * ------------------------------------------------------------------ */
.empty-state, .error-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 50px 20px; text-align: center; color: var(--text-muted);
}
.empty-state i, .error-state i { font-size: 34px; margin-bottom: 10px; color: var(--border-strong); }
.error-state i { color: var(--danger); opacity: .6; }
.empty-state p, .error-state p { font-size: 13px; font-weight: 600; max-width: 320px; }

.skeleton { background: linear-gradient(90deg, var(--surface-soft) 25%, var(--surface-hover) 37%, var(--surface-soft) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-card { height: 108px; }
.skeleton-line { height: 12px; margin-bottom: 8px; }

.spinner-swrf {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--border); border-top-color: var(--teal);
  animation: spin 700ms linear infinite; display: inline-block;
}

/* ------------------------------------------------------------------ *
 * 10. TIMELINE
 * ------------------------------------------------------------------ */
.timeline-swrf { position: relative; padding-left: 26px; }
.timeline-swrf::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -26px; top: 3px;
  width: 12px; height: 12px; border-radius: 50%; background: var(--surface);
  border: 2.5px solid var(--teal); z-index: 1;
}
.timeline-item.done::before { background: var(--success); border-color: var(--success); }
.timeline-item.pending::before { background: var(--surface); border-color: var(--border-strong); }
.timeline-item.risk::before { background: var(--danger); border-color: var(--danger); }
.timeline-item__title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.timeline-item__meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* ------------------------------------------------------------------ *
 * 11. EVIDENCE / DEPARTMENT CARDS
 * ------------------------------------------------------------------ */
.evidence-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; transition: box-shadow var(--t-fast), transform var(--t-fast); cursor: pointer;
}
.evidence-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.evidence-tile__icon { width: 40px; height: 40px; border-radius: 10px; background: var(--teal-light); color: var(--teal); display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 12px; }
.evidence-tile__title { font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 10px; min-height: 34px; }
.evidence-tile__stats { display: flex; gap: 10px; font-size: 11px; }
.evidence-tile__stats span { display: flex; align-items: center; gap: 4px; font-weight: 700; }

.dept-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px;
}
.dept-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dept-card__badge { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.dept-card__name { font-size: 12.75px; font-weight: 700; color: var(--text-primary); line-height: 1.25; }
.dept-card__sub { font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
.dept-card__row { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-secondary); margin-bottom: 4px; font-weight: 600; }

/* ------------------------------------------------------------------ *
 * 12. RADAR / DIMENSION CARDS
 * ------------------------------------------------------------------ */
.dim-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.dim-card:last-child { margin-bottom: 0; }
.dim-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal); }
.dim-card__icon { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.dim-card__body { flex: 1; min-width: 0; }
.dim-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.dim-card__name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.dim-card__score { font-size: 15px; font-weight: 800; color: var(--primary-dark); }
.dim-card__trend { font-size: 10.5px; font-weight: 700; margin-left: 6px; }

/* ------------------------------------------------------------------ *
 * 13. CHART CONTAINERS
 * ------------------------------------------------------------------ */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { max-width: 100%; }
.chart-box--sm { height: 220px; }
.chart-box--md { height: 300px; }
.chart-box--lg { height: 360px; }
.chart-legend-note { font-size: 11px; color: var(--text-muted); text-align: center; margin-top: 6px; }

.donut-center-label {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; pointer-events: none;
}
.donut-center-label .num { font-size: 26px; font-weight: 800; color: var(--primary-dark); line-height: 1; }
.donut-center-label .lbl { font-size: 10.5px; color: var(--text-muted); font-weight: 700; margin-top: 3px; }

/* ------------------------------------------------------------------ *
 * 14. STRATEGIC READINESS RINGS
 * ------------------------------------------------------------------ */
.readiness-card { text-align: center; }
.ring-wrap { position: relative; width: 118px; height: 118px; margin: 0 auto 10px; }
.ring-wrap svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring-wrap .ring-bg { fill: none; stroke: var(--surface-soft); stroke-width: 10; }
.ring-wrap .ring-fg { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 800ms ease; }
.ring-value { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 800; color: var(--primary-dark); }
.readiness-title { font-size: 12.5px; font-weight: 700; color: var(--text-primary); margin-top: 2px; }
.readiness-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; }

/* ------------------------------------------------------------------ *
 * 15. BIHAR MAP WIDGET
 * ------------------------------------------------------------------ */
.map-widget { position: relative; }
.map-svg-wrap { position: relative; width: 100%; aspect-ratio: 16 / 11; background: var(--surface-soft); border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; }
.map-svg-wrap svg { width: 100%; height: 100%; }
.map-outline { fill: var(--primary-light); stroke: var(--border-strong); stroke-width: 0.4; }
.map-river { stroke: #B9D8E8; stroke-width: 0.9; fill: none; opacity: .8; }
.district-node { cursor: pointer; stroke: #fff; stroke-width: 0.6; transition: r 150ms ease, opacity 150ms ease; }
.district-node:hover { opacity: 0.85; }
.district-label { font-size: 2.2px; font-weight: 700; fill: var(--text-secondary); pointer-events: none; }
.map-legend { display: flex; gap: 14px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.map-legend span { font-size: 11px; font-weight: 700; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; }
.map-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-tooltip {
  position: absolute; pointer-events: none; background: var(--primary-dark); color: #fff;
  padding: 8px 11px; border-radius: 8px; font-size: 11.5px; font-weight: 600; z-index: 10;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity var(--t-fast); white-space: nowrap;
}
.map-tooltip.show { opacity: 1; }
.map-tooltip strong { font-weight: 800; }

/* ------------------------------------------------------------------ *
 * 16. INSIGHT PANELS
 * ------------------------------------------------------------------ */
.insight-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.insight-item:last-child { border-bottom: none; padding-bottom: 0; }
.insight-item__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; gap: 8px; }
.insight-item__title { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.insight-item__meta { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 4px; }
.insight-item__action { font-size: 11.5px; color: var(--teal); font-weight: 700; display: flex; gap: 6px; align-items: flex-start; }

.action-req-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.action-req-item:last-child { border-bottom: none; }
.action-req-item__badge { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 11px; color: #fff; flex-shrink: 0; }
.action-req-item__body { flex: 1; min-width: 0; }
.action-req-item__name { font-size: 12.75px; font-weight: 700; }
.action-req-item__stats { font-size: 11px; color: var(--text-muted); }

/* ------------------------------------------------------------------ *
 * 17. ACCOUNTABILITY / CLICKABLE STAT CARDS
 * ------------------------------------------------------------------ */
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; cursor: pointer; transition: box-shadow var(--t-fast), transform var(--t-fast);
  display: flex; align-items: center; gap: 14px;
}
.stat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--teal); }
.stat-tile__icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.stat-tile__value { font-size: 22px; font-weight: 800; color: var(--primary-dark); line-height: 1; }
.stat-tile__label { font-size: 11.5px; color: var(--text-secondary); font-weight: 700; margin-top: 3px; }

/* ------------------------------------------------------------------ *
 * 18. CLOSURE RATE WIDGET
 * ------------------------------------------------------------------ */
.closure-widget { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.closure-widget__ring { flex-shrink: 0; }
.closure-widget__legend { flex: 1; min-width: 220px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.closure-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.closure-legend-item .dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.closure-target-bar { margin-top: 16px; position: relative; }
.closure-target-bar .marker { position: absolute; top: -4px; width: 2px; height: 22px; background: var(--primary-dark); }
.closure-target-bar .marker-label { position: absolute; top: -20px; font-size: 10px; font-weight: 800; color: var(--primary-dark); transform: translateX(-50%); }

/* ------------------------------------------------------------------ *
 * 19. REPORT / ANALYTICS CARDS
 * ------------------------------------------------------------------ */
.report-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 18px; display: flex; flex-direction: column; gap: 12px; height: 100%;
}
.report-card__icon { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 20px; }
.report-card__title { font-size: 14.5px; font-weight: 800; color: var(--text-primary); }
.report-card__desc { font-size: 12px; color: var(--text-secondary); flex: 1; }
.report-card__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ *
 * 20. ADMIN PAGE
 * ------------------------------------------------------------------ */
.admin-section-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 18px; margin-bottom: 18px; }
.admin-section-card h3 { font-size: 14.5px; font-weight: 800; margin-bottom: 4px; }
.admin-section-card .admin-desc { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; }

/* ------------------------------------------------------------------ *
 * 21. UTILS
 * ------------------------------------------------------------------ */
.text-muted-swrf { color: var(--text-muted); }
.fw-800 { font-weight: 800; }
.glass-accent {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.4);
}
.divider-v { width: 1px; align-self: stretch; background: var(--border); }
.overflow-hidden-x { overflow-x: hidden; }
.sidebar-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(11,41,66,0.45); z-index: 1025;
}
.sidebar-backdrop.show { display: block; }

/* ------------------------------------------------------------------ *
 * 22. RESPONSIVE
 * ------------------------------------------------------------------ */
@media (min-width: 1600px) {
  .app-content { padding: 26px 40px 56px; }
}

@media (max-width: 1399px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .kpi-grid--5 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1279px) {
  .header-refresh-meta { display: none !important; }
}

@media (max-width: 1199px) {
  .kpi-grid, .kpi-grid--4, .kpi-grid--5 { grid-template-columns: repeat(2, 1fr); }
  .closure-widget__legend { grid-template-columns: 1fr; }
}

@media (min-width: 992px) {
  .header-refresh-meta { display: block; }
  .header-user__meta { display: block; }
}

@media (max-width: 991px) {
  .app-sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .app-shell.mobile-nav-open .app-sidebar { transform: translateX(0); }
  .app-shell.sidebar-collapsed .app-sidebar { width: var(--sidebar-width); min-width: var(--sidebar-width); }
  .app-main { margin-left: 0 !important; }
  .sidebar-toggle-btn { display: none; }
  .mobile-nav-btn { display: flex; }
  .app-content { padding: 16px 14px 40px; }
  .page-header h1 { font-size: 21px; }
}

@media (max-width: 767px) {
  .kpi-grid, .kpi-grid--4, .kpi-grid--5 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-card__value { font-size: 20px; }
  .closure-widget { flex-direction: column; align-items: stretch; }
  .table-toolbar .search-box { max-width: none; }
  .breadcrumb-trail span:not(.crumb-current) { display: none; }
  .toast-stack { left: 12px; right: 12px; top: 76px; }
  .swrf-toast { min-width: 0; max-width: none; }
}

@media (max-width: 575px) {
  .kpi-grid, .kpi-grid--4, .kpi-grid--5 { grid-template-columns: 1fr; }
  .app-header { padding: 0 14px; gap: 10px; }
  .btn-report span.txt { display: none; }
}
