/* =====================================================================
   GOVTECH ENTERPRISE DESIGN SYSTEM (O'ZBEKISTON RESPUBLIKASI STANDARTI)
   Design Philosophy: Human-Crafted, Prestigious, Accessible (WCAG AAA),
   High-Trust Government Portal with Tactile Controls & Typographic Harmony.
   ===================================================================== */

:root {
  /* Surface & Canvas */
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f8faf9;
  --surface-3: #edf3f1;
  --surface-hover: #f1f6f4;
  
  /* Text & Ink (WCAG AAA Contrast > 7:1) */
  --ink: #0d221f;
  --ink-2: #344c48;
  --ink-3: #627b76;
  --ink-muted: #889f9b;
  
  /* Borders & Dividers */
  --line: #d8e3e0;
  --line-2: #c4d3cf;
  --line-focus: #0c564e;
  
  /* Brand: Prestigious Emerald & State Greens */
  --brand: #0c5048;
  --brand-dark: #07342f;
  --brand-light: #167a6f;
  --brand-soft: #e2f2ef;
  --brand-ink: #ffffff;
  
  /* Executive Gold & Accents */
  --gold: #b38600;
  --gold-dark: #8c6700;
  --gold-soft: #fcf6e5;
  --gold-border: #f3e09e;
  
  /* Semantics */
  --ok: #15803d;
  --ok-dark: #166534;
  --ok-soft: #dcfce7;
  --ok-border: #bbf7d0;
  --ok-row: #f4fbf6;
  
  --warn: #b45309;
  --warn-dark: #92400e;
  --warn-soft: #fef3c7;
  --warn-border: #fde68a;
  
  --bad: #b91c1c;
  --bad-dark: #991b1b;
  --bad-soft: #fee2e2;
  --bad-border: #fecaca;
  
  /* Gender Tokens (Men: Executive Navy/Slate, Women: Elegant Berry) */
  --men-color: #1e40af;
  --men-soft: #eff6ff;
  --men-border: #bfdbfe;
  --men-badge: #dbeafe;
  
  --women-color: #9d174d;
  --women-soft: #fdf2f8;
  --women-border: #fbcfe8;
  --women-badge: #fce7f3;
  
  /* Sector Colors */
  --s1: #1d6fc6; --s2: #d95826; --s3: #128c61; --s4: #c98000; --s5: #c94073; --s6: #0a7a0a;
  
  /* Sidebar (Deep Obsidian Emerald) */
  --side: #08211e;
  --side-surface: #0e302b;
  --side-hover: #143d37;
  --side-on: #1a4d46;
  --side-ink: #e0eee9;
  --side-dim: #7da59f;
  --side-border: rgba(255, 255, 255, 0.08);
  
  /* Elevation & Shadows (Layered Natural Ambient) */
  --shadow-xs: 0 1px 2px rgba(10, 36, 33, 0.04);
  --shadow-sm: 0 1px 3px rgba(10, 36, 33, 0.07), 0 1px 2px rgba(10, 36, 33, 0.04);
  --shadow: 0 4px 14px rgba(10, 36, 33, 0.08), 0 1px 3px rgba(10, 36, 33, 0.04);
  --shadow-lg: 0 12px 30px rgba(10, 36, 33, 0.12), 0 4px 10px rgba(10, 36, 33, 0.05);
  --shadow-xl: 0 20px 45px rgba(10, 36, 33, 0.16);
  
  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;
  
  /* Typography */
  --f: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --m: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #071513;
  --surface: #0e201d;
  --surface-2: #132825;
  --surface-3: #19332f;
  --surface-hover: #162f2b;
  
  --ink: #ebf5f3;
  --ink-2: #a7c4bf;
  --ink-3: #759792;
  --ink-muted: #53736e;
  
  --line: #1c3834;
  --line-2: #284c47;
  --line-focus: #38bdf8;
  
  --brand: #24a899;
  --brand-dark: #177a6f;
  --brand-light: #48cbbd;
  --brand-soft: #12332e;
  --brand-ink: #041815;
  
  --gold: #dfb23e;
  --gold-soft: #2e240a;
  --gold-border: #4d3d12;
  
  --ok: #34d399;
  --ok-soft: #0d2a1f;
  --ok-border: #134633;
  --ok-row: #0a2118;
  
  --warn: #fbbf24;
  --warn-soft: #302409;
  --warn-border: #523c10;
  
  --bad: #f87171;
  --bad-soft: #331515;
  --bad-border: #592020;
  
  --men-color: #60a5fa;
  --men-soft: #10233d;
  --men-border: #1e3a66;
  --men-badge: #1d3557;
  
  --women-color: #f472b6;
  --women-soft: #351322;
  --women-border: #5a1e38;
  --women-badge: #4c1830;
  
  --side: #050e0d;
  --side-surface: #091a18;
  --side-hover: #0f2824;
  --side-on: #153833;
  --side-ink: #cfe2dd;
  --side-dim: #6c908a;
  
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
  color-scheme: dark;
}

/* ================= RESET & BASE ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; user-select: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ================= 1. LOGIN SCREEN STYLES ================= */
#loginScreen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(circle at 50% 15%, #10423c 0%, #061e1b 100%);
  position: relative;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 36px 32px 32px;
  position: relative;
  z-index: 2;
}
.login-emblem-wrap {
  text-align: center;
  margin-bottom: 24px;
}
.login-emblem {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b665c 0%, #093731 100%);
  border: 2.5px solid #d4a72c;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.25);
}
.login-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.login-card p {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 4px;
}
.login-err {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid var(--bad-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
  display: none;
}

/* ================= 2. APP SCREEN LAYOUT ================= */
#appScreen {
  display: none;
  padding: 16px;
}
.shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 20px;
  max-width: min(1920px, 98vw);
  width: 100%;
  margin: 0 auto;
  align-items: start;
}

/* ================= 3. SIDEBAR (NAVIGATION) ================= */
.side {
  position: sticky;
  top: 16px;
  background: var(--side);
  color: var(--side-ink);
  border-radius: var(--radius-lg);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: calc(100vh - 32px);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--side-border);
}
.emblem-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--side-border);
}
.emblem-icon {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #207166 0%, #0c3e37 100%);
  border: 2px solid #d4a72c;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}
.emblem-wrap b {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.emblem-wrap small {
  display: block;
  font-size: 11.5px;
  color: var(--side-dim);
  margin-top: 2px;
}

#nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#nav button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  background: none;
  color: var(--side-ink);
  text-align: left;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 13px;
  transition: all 0.15s ease;
  position: relative;
}
#nav button .nav-left {
  display: flex;
  align-items: center;
  gap: 11px;
}
#nav button:hover {
  background: var(--side-surface);
  color: #ffffff;
  transform: translateX(2px);
}
#nav button.on {
  background: var(--side-on);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 3.5px 0 0 #38bdf8, 0 2px 6px rgba(0, 0, 0, 0.2);
}
#nav svg {
  width: 18px;
  height: 18px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.85;
}
#nav button.on svg {
  opacity: 1;
  stroke: #38bdf8;
}

.side-footer {
  margin-top: auto;
  border-top: 1px solid var(--side-border);
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.side-status-box {
  background: var(--side-surface);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-size: 11.5px;
  color: var(--side-dim);
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid var(--side-border);
}
.side-status-box b { color: #ffffff; font-weight: 600; }
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px #34d399;
  margin-right: 6px;
  vertical-align: middle;
}

/* ================= 4. MAIN WORKSPACE ================= */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ================= 5. TOP-BAR & ACTIONS ================= */
.top-bar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.title-block {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.title-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.gov-dot { color: var(--line-2); font-size: 8px; }
.gov-region { color: var(--ink-3); font-weight: 500; text-transform: none; }
.top-bar .title-block h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}
.top-bar .title-block p {
  color: var(--ink-2);
  font-size: 12.5px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.action-divider {
  width: 1px;
  height: 26px;
  background: var(--line);
  margin: 0 2px;
}
.action-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ================= 6. USER PROFILE BADGE ================= */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.user-badge:hover {
  background: var(--surface-3);
  border-color: var(--line-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}
.user-badge-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand) 0%, #15796f 100%);
  color: #ffffff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.user-badge-text {
  display: flex;
  flex-direction: column;
}
.user-badge-text b {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
}
.user-badge-text small {
  font-size: 11px;
  color: var(--ink-3);
}
.chevron-icon {
  stroke: var(--ink-3);
  margin-left: 2px;
}

/* ================= 7. BUTTON SYSTEM (HUMAN-CRAFTED) ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--line-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}

/* Primary Button (Prestigious Emerald Gradient & Inset Bevel) */
.btn.pri {
  background: linear-gradient(180deg, #136a5f 0%, #0c4d44 100%);
  border: 1px solid #083832;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(8, 56, 50, 0.25), inset 0 1px 0.5px rgba(255, 255, 255, 0.2);
}
.btn.pri:hover {
  background: linear-gradient(180deg, #167a6e 0%, #0e564c 100%);
  border-color: #062b26;
  box-shadow: 0 3px 8px rgba(8, 56, 50, 0.35), inset 0 1px 0.5px rgba(255, 255, 255, 0.25);
}

/* Gold / Feature Action Button */
.btn.gold {
  background: linear-gradient(180deg, #c7960e 0%, #a47805 100%);
  border: 1px solid #7c5b02;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(124, 91, 2, 0.25), inset 0 1px 0.5px rgba(255, 255, 255, 0.25);
}
.btn.gold:hover {
  background: linear-gradient(180deg, #d8a413 0%, #b38407 100%);
  box-shadow: 0 3px 8px rgba(124, 91, 2, 0.35);
}

/* Subtle / Danger Button */
.btn.bad, .btn.btn-logout {
  background: var(--bad-soft);
  border: 1px solid var(--bad-border);
  color: var(--bad);
}
.btn.bad:hover, .btn.btn-logout:hover {
  background: #fee2e2;
  color: var(--bad-dark);
  border-color: #fca5a5;
}

/* Tool Buttons (Top-Bar items) */
.btn.btn-tool {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink-2);
  padding: 7px 11px;
}
.btn.btn-tool:hover {
  color: var(--ink);
  background: var(--surface-2);
}
.btn.btn-icon-only {
  padding: 7px 9px;
  font-size: 14px;
}

.btn.sm {
  padding: 5px 10px;
  font-size: 12px;
  gap: 5px;
  border-radius: var(--radius-xs);
}
.btn svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

/* ================= 8. SEGMENTED CONTROLS (SWITCHERS) ================= */
.segmented-control {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 3px;
  border-radius: var(--radius);
  gap: 2px;
}
.segmented-control .seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  border-radius: calc(var(--radius) - 3px);
  transition: all 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.segmented-control .seg-btn:hover {
  color: var(--ink);
}
.segmented-control .seg-btn.on {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
}
.segmented-control .seg-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ================= 9. INPUTS & SELECTS ================= */
.sel, .inp {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sel:focus, .inp:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(12, 80, 72, 0.14);
}

/* ================= 10. KPI CARDS & SYSTEM ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.kpi-card.click-card {
  cursor: pointer;
}
.kpi-card.click-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--line-2);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.kpi-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-label {
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}
.kpi-val {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 6px;
}

/* KPI Variant Themes */
.kpi-card.men-unemp {
  border-color: var(--men-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--men-soft) 100%);
}
.kpi-card.men-unemp .kpi-label { color: var(--men-color); }
.kpi-card.men-unemp .kpi-val { color: var(--men-color); }

.kpi-card.men-emp {
  border-color: var(--ok-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--ok-soft) 100%);
}
.kpi-card.men-emp .kpi-label { color: var(--ok); }
.kpi-card.men-emp .kpi-val { color: var(--ok); }

.kpi-card.women-unemp {
  border-color: var(--women-border);
  background: linear-gradient(180deg, #ffffff 0%, var(--women-soft) 100%);
}
.kpi-card.women-unemp .kpi-label { color: var(--women-color); }
.kpi-card.women-unemp .kpi-val { color: var(--women-color); }

.kpi-card.women-emp {
  border-color: var(--ok-border);
  background: linear-gradient(180deg, #ffffff 0%, #ecfdf5 100%);
}
.kpi-card.women-emp .kpi-label { color: var(--ok); }
.kpi-card.women-emp .kpi-val { color: var(--ok); }

/* KPI Icon Badge (Sleek Squircle) */
.kpi-icon-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.kpi-icon-badge.men { background: var(--men-badge); color: var(--men-color); }
.kpi-icon-badge.women { background: var(--women-badge); color: var(--women-color); }
.kpi-icon-badge.ok { background: var(--ok-soft); color: var(--ok); }
.kpi-icon-badge.neutral { background: var(--surface-3); color: var(--brand); }

/* Badges / Micro Pills */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-pill);
  line-height: 1;
}
.badge.men-subtle { background: var(--men-badge); color: var(--men-color); }
.badge.women-subtle { background: var(--women-badge); color: var(--women-color); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }

/* ================= 11. PANELS & SECTIONS ================= */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  min-width: 0;
  box-shadow: var(--shadow-sm);
}
.ph {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.ph h2 {
  font-size: 17.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.ph p {
  color: var(--ink-2);
  font-size: 13px;
  margin-top: 3px;
  max-width: 80ch;
}

/* Pasport (Top Metrics strip) */
.passport {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.passport > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 14px 18px;
  border-left: 1px solid var(--line);
}
.passport > div:first-child { border-left: 0; }
.passport > div span {
  display: block;
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.25;
}
.passport > div b {
  display: block;
  font-size: 15px;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.25;
}
.lbl {
  font-size: 11px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.big {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 4px;
}

/* Pill status tags */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius-pill);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.gold { background: var(--gold-soft); color: var(--gold); }
.pill.brand { background: var(--brand-soft); color: var(--brand); }
.pill.info { background: #e0f2fe; color: #0284c7; }
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.pill.nobult::before { display: none; }

/* ================= 12. TABLES & DATA GRIDS ================= */
.tbl-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.tbl-wrap.tall { max-height: 68vh; }
.tbl-wrap.mid { max-height: 480px; }
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
}
.tbl-wrap table.compact-tbl th {
  padding: 8px 8px;
  font-size: 11px;
  white-space: nowrap;
}
.tbl-wrap table.compact-tbl td {
  padding: 7px 8px;
  font-size: 12.5px;
}
th {
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 11px 14px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--line);
}
th.num, td.num { text-align: right; }
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; transition: background 0.1s ease; }
tbody tr.click:hover td { background: var(--surface-hover); }
tr.emp td { background: var(--ok-row); }
tr.emp td:first-child { box-shadow: inset 4px 0 0 var(--ok); }
tr.overdue-row td { background: var(--bad-soft); }
tr.overdue-row td:first-child { box-shadow: inset 4px 0 0 var(--bad); }

tfoot td {
  font-weight: 700;
  background: var(--surface-2);
  border-top: 1px solid var(--line-2);
  position: sticky;
  bottom: 0;
}

.mono { font-family: var(--m); font-size: 12.5px; }
.muted { color: var(--ink-3); }

/* Progress bars */
.dual {
  position: relative;
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  min-width: 110px;
  overflow: hidden;
}
.dual i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--radius-pill);
  transition: width 0.3s ease;
}
.dual .t { background: #b8cfca; }
.dual .e { background: var(--ok); }

.stk {
  display: flex;
  gap: 2px;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  min-width: 60px;
  flex: 1;
}
.stk i { display: block; min-width: 2px; }
.stk .ok { background: var(--ok); }
.stk .warn { background: var(--warn); }
.stk .bad { background: var(--bad); }

/* Reyting kartochkalari */
.rank {
  display: flex;
  flex-direction: column;
}
.rk {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: center;
  padding: 10px 10px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  text-align: left;
  background: none;
  border-left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}
.rk:last-child { border-bottom: 0; }
.rk:hover {
  background: var(--surface-hover);
  transform: translateX(2px);
}
.rk .no {
  font-family: var(--m);
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 700;
}
.rk b { font-weight: 600; font-size: 13.5px; }
.rk .v { font-weight: 700; text-align: right; font-size: 13.5px; }
.rk .sub {
  grid-column: 2 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--ink-2);
}
.rk .sub .dual { flex: 1; height: 6px; }

/* Tabs */
.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  padding-bottom: 2px;
}
.tabs button {
  background: none;
  border: 0;
  border-bottom: 2.5px solid transparent;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13.5px;
  color: var(--ink-2);
  white-space: nowrap;
  margin-bottom: -3px;
  transition: all 0.15s ease;
}
.tabs button:hover {
  color: var(--ink);
}
.tabs button.on {
  color: var(--brand);
  border-bottom-color: var(--brand);
}

/* ================= 13. MODALS & DRAWERS ================= */
#drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
}
#modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
}
#drawer.open, #modal.open { display: block; }
.ov {
  position: absolute;
  inset: 0;
  background: rgba(8, 26, 23, 0.55);
  backdrop-filter: blur(6px);
}
.md {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(620px, calc(100% - 32px));
  max-height: calc(100% - 40px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--line);
}
.md .ph {
  padding-right: 44px;
  flex-wrap: nowrap;
}
.md .x {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 10;
}
.x {
  border: 0;
  background: var(--surface-2);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  color: var(--ink-2);
  transition: all 0.15s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.x:hover {
  background: var(--bad-soft);
  color: var(--bad);
}

.dr {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(660px, 100%);
  background: var(--surface);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line);
}
.dr header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}
.dr .body {
  overflow: auto;
  padding: 22px 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.fld label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.fld .inp, .fld .sel, .fld textarea {
  width: 100%;
}
.fld textarea {
  min-height: 84px;
  resize: vertical;
}

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px 18px; }
.kv div { display: flex; flex-direction: column; gap: 4px; }
.kv div span { display: block; font-size: 11.5px; color: var(--ink-3); font-weight: 500; }
.kv div b { display: block; font-weight: 600; color: var(--ink); font-size: 14px; }

.pager {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 14px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #092c27;
  color: #ffffff;
  border: 1px solid #1a5850;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 13.5px;
  z-index: 120;
  display: none;
  box-shadow: var(--shadow-lg);
}
#toast.on { display: block; }

/* Xizmat Pasporti Modali */
.passport-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative;
  overflow: hidden;
}
.id-badge-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}
.id-badge-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--gold) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ================= 14. RESPONSIVE ================= */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .passport { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .passport > div:nth-child(3) { border-left: 0; }
  .passport > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; min-height: 0; }
  #nav { flex-direction: row; overflow-x: auto; }
}
@media (max-width: 640px) {
  .kpi-grid, .passport { grid-template-columns: 1fr; }
  .top-bar { flex-direction: column; align-items: stretch; }
  .top-actions { justify-content: space-between; }
}

/* ================= 15. PRINT ================= */
@media print {
  body { background: #fff !important; color: #000 !important; padding: 0 !important; font-size: 11pt; }
  .side, .top-bar .top-actions, .bar-tools, .tabs, .pager, #toast, #drawer, #modal, button { display: none !important; }
  .shell { display: block !important; }
  .panel, .passport { border: 1px solid #999 !important; box-shadow: none !important; break-inside: avoid; }
  .tbl-wrap { max-height: none !important; overflow: visible !important; border: 1px solid #000 !important; }
  th { background: #f0f0f0 !important; color: #000 !important; }
  .print-head { display: block !important; text-align: center; margin-bottom: 20px; border-bottom: 2px solid #000; padding-bottom: 10px; }
}
/* ================= 16. CITIZEN NAME LINK & DEADLINES ================= */
.citizen-name-link {
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-decoration: none;
  text-align: left;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}
.citizen-name-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2.5px 7px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}
.deadline-badge.overdue {
  background: var(--bad-soft);
  color: var(--bad);
  border: 1px solid var(--bad-border);
}
.deadline-badge.soon {
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}
.deadline-badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.form-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 6px;
  margin: 18px 0 10px;
  border-bottom: 1.5px solid var(--line);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.form-section-header:first-of-type {
  margin-top: 0;
}

.print-head { display: none; }

/* ================= 17. ADVANCED MODULES & VISUALIZATIONS ================= */
.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 7px;
  border-radius: var(--radius-xs);
  letter-spacing: 0.02em;
}
.source-badge-bot {
  background: #f5f3ff;
  color: #7c3aed;
  border: 1px solid #c4b5fd;
  font-weight: 700;
}
.source-badge-xatlov {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
  font-weight: 600;
}

.badge-davlat {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}
.badge-xususiy {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-invest {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.badge-tuman {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}
.badge-mahalla {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.code-inn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  color: var(--brand);
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.crumb a, .crumb button {
  color: var(--brand);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.crumb a:hover, .crumb button:hover {
  text-decoration: underline;
  color: var(--brand-dark);
}
.crumb-sep {
  color: var(--ink-3);
  font-weight: 400;
}

.proj-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.proj-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.proj-chip b {
  color: var(--ink);
  font-weight: 700;
}

/* Charts: Vertical Bars */
.vbars-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 8px;
  background: var(--surface);
  border-radius: var(--radius);
}
.vbars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  height: 180px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}
.vbar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  position: relative;
}
.vbar-col .vb {
  width: 100%;
  max-width: 38px;
  background: linear-gradient(180deg, var(--brand) 0%, #15796f 100%);
  border-radius: 4px 4px 0 0;
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 4px;
  position: relative;
}
.vbar-col .vb:hover {
  background: linear-gradient(180deg, var(--brand-dark) 0%, var(--brand) 100%);
}
.vbar-val {
  position: absolute;
  top: -20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.vbar-label {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--ink-2);
  font-weight: 500;
}

/* Horizontal Demographic Comparison Bars */
.hbars-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}
.hrow {
  display: grid;
  grid-template-columns: 160px 1fr 60px;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
}
.hrow-label {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hbars-track {
  width: 100%;
  height: 20px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
}
.hbar-emp {
  height: 100%;
  background: var(--ok);
  transition: width 0.3s ease;
}
.hbar-unemp {
  height: 100%;
  background: #cbd5e1;
  transition: width 0.3s ease;
}
.hrow-pct {
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  font-size: 12px;
}

/* Multi-tab layout */
.subtabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.subtab-btn {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  transition: all 0.15s ease;
}
.subtab-btn:hover {
  color: var(--brand);
  background: var(--surface-2);
}
.subtab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 700;
}

.readonly-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.chip.done {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: var(--ok-border);
}
.chip.active {
  background: var(--info-soft);
  color: var(--info);
  border-color: var(--info-border);
}

/* =====================================================================
   1-RASM: ТАРКИБИ БЎЙИЧА ТАҲЛИЛ (OQ GOVTECH MAVZUSI - YUQORI KONTRAST)
   ===================================================================== */
.tarkib-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  color: var(--ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-top: 20px;
}
.tarkib-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 14px;
}
.tarkib-head h3 {
  margin: 0 0 4px 0;
  font-size: 18px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.tarkib-head p {
  margin: 0;
  font-size: 13px;
  color: var(--ink-3);
}
.tarkib-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}
.tarkib-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
}
.leg-box-dim {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: #cbd5e1;
}
.leg-box-lit {
  width: 14px;
  height: 10px;
  border-radius: 2px;
  background: #059669;
}

.tarkib-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 36px;
}
@media (max-width: 900px) {
  .tarkib-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
.tarkib-sec-title {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-bottom: 12px;
}
.tarkib-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tarkib-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.tarkib-lbl {
  width: 140px;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.tarkib-lbl-wide {
  width: 220px;
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.tarkib-track {
  flex: 1;
  height: 14px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.tarkib-fill {
  height: 100%;
  background: #059669;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.tarkib-stat {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
  min-width: 140px;
  flex-shrink: 0;
}
.tarkib-stat b {
  color: #059669;
  font-weight: 700;
}

/* =====================================================================
   RBAC PERMISSIONS MATRIX TABLE
   ===================================================================== */
.rbac-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.rbac-table th {
  background: var(--surface-2);
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ink-2);
  border-bottom: 2px solid var(--line);
}
.rbac-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.perm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}
.perm-badge.yes {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.perm-badge.no {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.perm-badge.scoped {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* ================= 17. PROJECT PASSPORT CARD (2-RASM OQ BO'LISHI KERAK) ================= */
.proj-passport-card, .proj-passport-dark {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 22px;
  color: var(--ink);
}
.proj-passport-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line-2);
}
.proj-passport-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 6px 0;
  letter-spacing: -0.01em;
}
.proj-passport-desc {
  font-size: 13.5px;
  color: var(--ink-3);
  margin: 0;
  line-height: 1.5;
}
.proj-passport-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 20px;
}
@media (max-width: 900px) {
  .proj-passport-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .proj-passport-grid { grid-template-columns: 1fr; }
}
.proj-passport-item {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.proj-passport-lbl {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.proj-passport-val {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.3;
}
.proj-passport-stat {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-top: 2px;
}
.proj-stat-box {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.proj-stat-box:hover {
  transform: translateY(-2px);
  border-color: #86efac;
}

/* Dashboard-Style KPI grid for Project Details (1-rasm: Huddi Dashboarddek chiroyli 4 talik grid) */
.proj-kpi-grid {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 16px !important;
  margin-top: 18px !important;
}
@media (max-width: 900px) {
  .proj-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 500px) {
  .proj-kpi-grid { grid-template-columns: 1fr !important; }
}

.proj-kpi-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.proj-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
}

.proj-kpi-card.plan {
  background: #fafafa;
  border-color: #e5e7eb;
}
.proj-kpi-card.emp {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.proj-kpi-card.pro {
  background: #fffbeb;
  border-color: #fef3c7;
}
.proj-kpi-card.vac {
  background: #f0f9ff;
  border-color: #bae6fd;
}

.proj-kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.proj-kpi-lbl {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}
.proj-kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.proj-kpi-card.plan .proj-kpi-icon { background: #f3f4f6; color: #4b5563; }
.proj-kpi-card.emp .proj-kpi-icon { background: #dcfce7; color: #15803d; }
.proj-kpi-card.pro .proj-kpi-icon { background: #fef3c7; color: #b45309; }
.proj-kpi-card.vac .proj-kpi-icon { background: #e0f2fe; color: #0369a1; }

.proj-kpi-val {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 6px;
}
.proj-kpi-card.plan .proj-kpi-val { color: var(--ink); }
.proj-kpi-card.emp .proj-kpi-val { color: #059669; }
.proj-kpi-card.pro .proj-kpi-val { color: #d97706; }
.proj-kpi-card.vac .proj-kpi-val { color: #0284c7; }

.proj-kpi-sub {
  font-size: 12px;
  color: var(--ink-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 2-rasm: Loyihaga joylashtirilgan fuqarolar jadvali - 100% to'q, aniq, yuqori kontrastli matnlar */
#projCitTbody tr td {
  color: #0f172a !important;
  font-size: 13px !important;
  vertical-align: middle !important;
}
#projCitTbody tr td b {
  color: #0f172a !important;
}
#projCitTbody .citizen-name-link b {
  color: #0f172a !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
}
#projCitTbody tr.emp td {
  background: #e8f5e9 !important;
  color: #0f172a !important;
}
#projCitTbody tr.emp td:first-child {
  box-shadow: inset 5px 0 0 #059669 !important;
}
#projCitTbody tr.emp .citizen-name-link b {
  color: #065f46 !important;
}
#projCitTbody tr:hover td {
  background: #f8fafc !important;
}
#projCitTbody tr.emp:hover td {
  background: #dcfce7 !important;
}

/* Ish bilan ta'minlangan fuqaro (Бандлиги таъминланган) — foydalanuvchi screenshotidagi kabi to'liq och yashil qator */
tr.emp td {
  background: #e8f5e9 !important; /* Och yashil GovTech foni */
  color: var(--ink);
}
tr.emp td:first-child {
  box-shadow: inset 5px 0 0 #059669 !important; /* Chap tarafdagi qalin yashil chiziq */
}
tr.emp .citizen-name-link b {
  color: #065f46 !important; /* Fuqaro ismi quyuq yashil rangda */
}
tbody tr.emp:hover td {
  background: #dcfce7 !important; /* Hover bo'lganda toza yashil */
}

.pill-emp-vivid {
  background: #059669 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  font-size: 12px !important;
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.35);
  white-space: nowrap !important;
}
.pill-emp-vivid::before {
  content: "✓" !important;
  font-weight: 900 !important;
  font-size: 11px !important;
}

/* Routing Radio Cards */
.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.radio-card:hover {
  border-color: var(--brand);
  background: var(--surface-hover);
}
.radio-card input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--brand);
}

/* Interactive RBAC Cell Button */
.perm-cell-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  user-select: none;
  outline: none;
}
.perm-cell-btn:hover {
  transform: scale(1.08);
  opacity: 0.9;
}
.perm-cell-btn:active {
  transform: scale(0.96);
}

/* Overdue Alert Banner */
.overdue-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 5px solid #ef4444;
  padding: 12px 18px;
  border-radius: 10px;
  margin-bottom: 18px;
  color: #991b1b;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}
.overdue-alert-banner b {
  color: #b91c1c;
}

/* Drill-down Clickable Rows */
tr.tarkib-row {
  display: table-row !important;
}
tr.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}
tr.clickable-row:hover {
  background-color: rgba(16, 185, 129, 0.08) !important;
}
.tarkib-row.clickable {
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}
.tarkib-row.clickable:hover {
  background: rgba(16, 185, 129, 0.12);
  transform: translateX(4px);
}
.tarkib-row.clickable:hover .tarkib-stat {
  color: #10b981;
}
.drill-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.drill-badge-active button {
  background: none;
  border: none;
  color: inherit;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  font-size: 14px;
}

/* ================= 25. SECTOR HIERARCHICAL ACCORDION PICKER ================= */
.sector-picker {
  position: relative;
  width: 100%;
}
.sector-picker .sp-trigger {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.sector-picker .sp-trigger:hover,
.sector-picker .sp-trigger:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  outline: none;
}
.sector-picker .sp-label {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--ink);
  flex: 1;
}
.sector-picker .sp-arrow {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}
.sector-picker.open .sp-arrow {
  transform: rotate(180deg);
}

.sector-picker .sp-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 0;
}

/* Qora yozuvdagi asosiy guruhlar (Accordion Headers) */
.sector-picker .sp-group {
  border-bottom: 1px solid #f1f5f9;
}
.sector-picker .sp-group:last-child {
  border-bottom: none;
}
.sector-picker .sp-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.sector-picker .sp-group-header:hover {
  background: #f1f5f9;
}
.sector-picker .sp-group-title {
  font-weight: 800; /* QORA QALIN YOZUV */
  font-size: 13.5px;
  color: #0f172a; /* QORA */
  display: flex;
  align-items: center;
  gap: 8px;
}
.sector-picker .sp-group-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sector-picker .sp-group-count {
  font-size: 11px;
  color: #64748b;
  background: #e2e8f0;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.sector-picker .sp-group-chevron {
  font-size: 11px;
  color: #0f172a;
  font-weight: bold;
  transition: transform 0.2s ease;
}
.sector-picker .sp-group.open .sp-group-chevron {
  transform: rotate(90deg);
}
.sector-picker .sp-group.open .sp-group-header {
  background: #e2e8f0;
  border-left: 3px solid #0f172a;
}

/* Ichidagi bo'limlari (Sub-items) */
.sector-picker .sp-group-body {
  background: #ffffff;
  padding: 4px 0;
}
.sector-picker .sp-item {
  display: flex;
  align-items: center;
  padding: 9px 14px 9px 26px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  border-left: 3px solid transparent;
  user-select: none;
}
.sector-picker .sp-item:hover {
  background: #f0fdf4;
  color: #065f46;
  border-left-color: #10b981;
  padding-left: 30px;
}
.sector-picker .sp-item.active {
  background: #ecfdf5;
  color: #065f46;
  font-weight: 700;
  border-left-color: #059669;
}
.sector-picker .sp-item-icon {
  margin-right: 8px;
  font-size: 14px;
}
.sector-picker .sp-item-name {
  flex: 1;
}
.sector-picker .sp-check {
  color: #059669;
  font-weight: 800;
  font-size: 14px;
  margin-left: 8px;
}

/* =====================================================================
   GOVTECH MODERN ACTIONS TOOLBAR & APPROVAL MODAL (v31)
   ===================================================================== */
.gov-actions-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gov-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Primary Citizen Add Button - Sleek Emerald Gradient */
.btn-gov-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 13.5px;
  padding: 8px 18px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid #065f46;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.18s ease-in-out;
}
.btn-gov-primary svg {
  stroke: #ffffff;
}
.btn-gov-primary:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.38);
  transform: translateY(-1px);
}
.btn-gov-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 3px rgba(5, 150, 105, 0.25);
}

/* Segmented Excel Tools Group */
.btn-group-excel {
  display: inline-flex;
  background: #ffffff;
  border: 1px solid var(--line, #cbd5e1);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-excel-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: none;
  border-right: 1px solid var(--line, #cbd5e1);
  color: #334155;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  height: 38px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-excel-tool:last-child {
  border-right: none;
}
.btn-excel-tool:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.btn-excel-tool svg {
  stroke: #059669;
}

/* Filter Controls */
.btn-gov-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid var(--line, #cbd5e1);
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 14px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}
.btn-gov-filter:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a;
}
.btn-gov-filter.active-overdue {
  background: #fef2f2;
  border-color: #f87171;
  color: #991b1b;
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}
.btn-reset-filter:hover {
  background: #f1f5f9;
  color: #0284c7;
  border-color: #7dd3fc;
}
.btn-reset-filter svg {
  stroke: currentColor;
}

