/* ===== THEME TOKENS ===== */
:root {
  /* Light: clean white + green */
  --bg:            #f8faf8;
  --bg-2:          #f0f4f0;
  --surface:       #ffffff;
  --surface-2:     #f5f9f5;
  --surface-solid: #ffffff;
  --surface-hover: #f0f7f2;
  --text:          #0a0f0c;
  --text-2:        #364d40;
  --text-3:        #7a9486;
  --accent:        #16a34a;
  --accent-light:  #22c55e;
  --accent-glow:   rgba(22, 163, 74, 0.35);
  --accent-bg:     rgba(22, 163, 74, 0.07);
  --accent-border: rgba(22, 163, 74, 0.22);
  --stroke:        rgba(0, 0, 0, 0.08);
  --stroke-2:      rgba(0, 0, 0, 0.04);
  --focus-ring:    rgba(22, 163, 74, 0.22);
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.06);
  --sidebar-bg:    #ffffff;
  --topbar-bg:     rgba(255, 255, 255, 0.9);
  --input-bg:      #ffffff;
  --input-border:  rgba(0, 0, 0, 0.12);
  --table-head:    #f0f7f2;
  --badge-bg:      rgba(22, 163, 74, 0.08);
  --badge-border:  rgba(22, 163, 74, 0.2);
  --radius-sm:     10px;
  --radius-md:     16px;
  --radius-lg:     24px;
}

html[data-theme="dark"] {
  /* Dark: deep black bg + clearly visible gray cards */
  --bg:            #0a0a0a;
  --bg-2:          #0d0d0d;
  --surface:       #1c1c1c;
  --surface-2:     #212121;
  --surface-solid: #1c1c1c;
  --surface-hover: #242424;
  --text:          #f0f0f0;
  --text-2:        #a8a8a8;
  --text-3:        #606060;
  --accent:        #22c55e;
  --accent-light:  #4ade80;
  --accent-glow:   rgba(34, 197, 94, 0.35);
  --accent-bg:     rgba(34, 197, 94, 0.1);
  --accent-border: rgba(34, 197, 94, 0.25);
  --stroke:        rgba(255, 255, 255, 0.09);
  --stroke-2:      rgba(255, 255, 255, 0.04);
  --focus-ring:    rgba(34, 197, 94, 0.28);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.6);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.55);
  --shadow-lg:     0 12px 40px rgba(0,0,0,0.65);
  --sidebar-bg:    #141414;
  --topbar-bg:     rgba(10, 10, 10, 0.97);
  --input-bg:      #212121;
  --input-border:  rgba(255, 255, 255, 0.11);
  --table-head:    #212121;
  --badge-bg:      rgba(34, 197, 94, 0.1);
  --badge-border:  rgba(34, 197, 94, 0.22);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

/* Subtle background texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 70% 50% at 0% 0%, rgba(22,163,74,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 60% 60% at 100% 100%, rgba(34,197,94,0.04) 0%, transparent 55%),
    var(--bg);
  pointer-events: none;
}

html[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, rgba(34,197,94,0.04) 0%, transparent 50%),
    radial-gradient(ellipse 50% 60% at 100% 100%, rgba(34,197,94,0.03) 0%, transparent 50%),
    var(--bg);
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.5rem;
  height: 60px;
  border-bottom: 1px solid var(--stroke);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--topbar-bg);
  transition: background 0.3s ease, border-color 0.3s ease;
}

html[data-theme="dark"] .topbar {
  border-bottom-color: rgba(255,255,255,0.08);
  background: rgba(10,10,10,0.97);
  box-shadow: 0 1px 0 rgba(255,255,255,0.05);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.brand-stack { display: grid; gap: 0.05rem; }

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #ffffff, #e8f5ee);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-bg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}

.brand-logo:hover {
  box-shadow: var(--shadow-md), 0 0 0 4px var(--accent-bg);
}

.brand-logo svg { width: 36px; height: 36px; }

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 4.5px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--stroke);
  background: var(--surface);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.hamburger:hover {
  border-color: var(--accent-border);
  background: var(--surface-hover);
}

html[data-theme="dark"] .hamburger {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .hamburger:hover {
  background: #222222;
  border-color: var(--accent-border);
}

.hamburger span {
  display: block;
  width: 15px;
  height: 1.5px;
  background: var(--text);
  border-radius: 8px;
  transition: all 0.18s ease;
}

.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  color: var(--text);
}

.brand span {
  color: var(--accent);
}

.brand-sub {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-3);
  text-transform: uppercase;
}

.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--stroke);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s ease;
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
  color: var(--accent);
}

html[data-theme="dark"] .theme-toggle {
  background: #1a1a1a;
  border-color: rgba(255,255,255,0.08);
  color: var(--accent);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: #222222;
  border-color: var(--accent-border);
  box-shadow: 0 0 12px var(--accent-glow);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.theme-toggle .icon-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle .icon-moon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* ===== APP SHELL ===== */
.app-shell {
  --sidebar-width: 256px;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  align-items: start;
}

.app-shell.collapsed {
  --sidebar-width: 0px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow: hidden auto;
  padding: 1rem 0.75rem;
  border-right: 1px solid var(--stroke);
  background: var(--sidebar-bg);
  transition: width 0.3s cubic-bezier(0.4,0,0.2,1),
              padding 0.3s cubic-bezier(0.4,0,0.2,1),
              opacity 0.25s ease,
              background 0.3s ease;
}

html[data-theme="dark"] .sidebar {
  background: var(--sidebar-bg);
  border-right-color: rgba(255,255,255,0.08);
}

.app-shell.collapsed .sidebar {
  padding-left: 0;
  padding-right: 0;
  opacity: 0;
  border-right-color: transparent;
  pointer-events: none;
}

/* Sidebar section label */
.sidebar-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 0 0.6rem;
  margin: 0.6rem 0 0.4rem;
}

.sidebar-label:first-child { margin-top: 0; }

.menu-btn {
  width: 100%;
  text-align: left;
  margin-bottom: 0.2rem;
  border: none;
  background: transparent;
  color: var(--text-2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s ease;
  padding: 0.62rem 0.9rem 0.62rem 1.1rem;
  font-weight: 600;
  font-size: 0.87rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  position: relative;
}

.menu-btn::after {
  content: "";
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.18s ease, top 0.18s ease, height 0.18s ease;
}

.menu-btn:hover {
  background: var(--accent-bg);
  color: var(--text);
}

.menu-btn:hover::after {
  opacity: 0.5;
}

.menu-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.menu-btn.active::after {
  opacity: 0;
}

/* ===== MAIN LAYOUT ===== */
.layout {
  max-width: 1120px;
  margin: 1.5rem auto 2rem;
  padding: 0 1.25rem 2rem;
  display: grid;
  gap: 1.2rem;
  width: 100%;
}

.page-section {
  display: none;
  gap: 1.2rem;
  min-width: 0;
}

.page-section.active {
  display: grid;
  animation: sectionIn 0.4s ease both;
}

@keyframes sectionIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  box-shadow: var(--shadow-md);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.25s ease, transform 0.25s ease;
  animation: cardRise 0.4s cubic-bezier(0.34,1.08,0.64,1) both;
  min-width: 0;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--accent-border);
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== HERO ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-left: 4px solid var(--accent);
  padding: 2rem 1.8rem;
}

html[data-theme="dark"] .hero {
  background: #111111;
  border-color: rgba(255,255,255,0.06);
  border-left-color: var(--accent);
}

.hero::before {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -100px;
  top: -120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22,163,74,0.15), transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  left: -60px;
  bottom: -80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.1), transparent 70%);
  pointer-events: none;
}

/* Watermark logo in hero */
.hero .hero-logo-bg {
  position: absolute;
  right: 1.5rem;
  bottom: -10px;
  width: 140px;
  height: 140px;
  opacity: 0.06;
  object-fit: contain;
  pointer-events: none;
  filter: grayscale(1);
}

html[data-theme="dark"] .hero .hero-logo-bg {
  opacity: 0.04;
  filter: grayscale(1) invert(1);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  border-radius: 999px;
  padding: 0.3rem 0.8rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  width: fit-content;
  position: relative;
  z-index: 1;
  margin-bottom: 0.7rem;
}

.hero-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

.stat-pulse {
  animation: statPulse 0.5s ease-out;
}

@keyframes statPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.18); color: var(--accent, #16a34a); }
  100% { transform: scale(1); }
}

.hero h1 {
  margin: 0 0 0.5rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem;
  color: var(--text);
  font-weight: 700;
  position: relative;
  z-index: 1;
  line-height: 1.25;
}

.hero p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.98rem;
  position: relative;
  z-index: 1;
  max-width: 560px;
}

/* ===== GRIDS ===== */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 0.6rem;
  align-items: end;
}

/* ===== METRIC CARDS ===== */
.card.metric {
  position: relative;
  overflow: hidden;
  padding: 1.4rem;
}

.card.metric::after {
  content: "";
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--accent-bg);
  pointer-events: none;
}

.card.metric h3 {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.metric-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.2rem;
  color: var(--accent);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(120deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== ANALYTICS (Tahlil bo'limi) ===== */
.an-stat-tile {
  position: relative;
  overflow: hidden;
  padding: 1.1rem 1.3rem;
}

.an-stat-tile::after {
  content: "";
  position: absolute;
  bottom: -22px;
  right: -22px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--accent-bg);
  pointer-events: none;
}

.an-stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 0.5rem;
}

.an-stat-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.an-stat-value-rank {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.an-rank-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--text-3);
  box-shadow: 0 0 0 4px var(--accent-bg);
}

.an-stat-sub {
  position: relative;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
}

.an-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.15rem;
}

.an-section-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.an-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-bg);
  color: var(--accent);
  flex-shrink: 0;
}

.an-section-icon svg { width: 16px; height: 16px; }

.an-chart-hint {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  color: var(--text-3);
}

.an-chart-wrap {
  position: relative;
  height: 320px;
}

.an-chart-wrap-ranked {
  height: 280px;
}

.an-legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.85rem;
}

.an-legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: var(--badge-bg);
  border: 1px solid var(--stroke);
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-2);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.an-legend-chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent-border);
}

.an-legend-chip-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.an-legend-chip-pct {
  color: var(--text-3);
  font-weight: 600;
}

.an-donut-wrap {
  position: relative;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.an-donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.an-donut-center-value {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}

.an-donut-center-label {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

.an-quality-legend {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.an-quality-legend-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.82rem;
}

.an-quality-legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex-shrink: 0;
}

.an-quality-legend-label {
  flex: 1;
  color: var(--text-2);
  font-weight: 600;
}

.an-quality-legend-pct {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 800;
  color: var(--text);
}

@media (max-width: 860px) {
  #anChartsGrid, #anCategoryGrid { grid-template-columns: 1fr; }
}

/* Sequential green ramp for the region choropleth, anchored to --accent. */
:root {
  --an-map-low:    #eef7f0;
  --an-map-high:   #0f6b30;
  --an-map-water:  #d7e8f5;
  --an-map-border: rgba(15, 70, 40, 0.35);
  --an-district-border: #abbeb4;
}
[data-theme="dark"] {
  --an-map-low:    #2a3a2e;
  --an-map-high:   #4ade80;
  --an-map-water:  #16232c;
  --an-map-border: rgba(255, 255, 255, 0.3);
  --an-district-border: #6a756d;
}

.an-map-wrap {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
}

.an-map-wrap svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.an-map-water {
  fill: var(--an-map-water);
  stroke: none;
  pointer-events: none;
}

.an-map-region {
  stroke: var(--an-map-border);
  stroke-width: 1.2;
  stroke-linejoin: round;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.35s ease, opacity 0.3s ease, filter 0.15s ease, stroke-width 0.15s ease;
}

.an-map-region:hover {
  filter: brightness(1.12);
}

.an-map-region:focus {
  outline: none;
}

.an-map-region:focus-visible {
  outline: none;
  stroke: var(--accent);
  stroke-width: 2.4;
}

.an-map-region.is-active {
  stroke: var(--text);
  stroke-width: 2.4;
}

.an-map-region.is-empty {
  fill: var(--surface-2) !important;
  cursor: default;
}

.an-map-region.is-empty:hover {
  filter: none;
}

.an-map-region.an-map-zoomed {
  transform: scale(1.22);
}

.an-map-region.an-map-faded {
  opacity: 0;
  pointer-events: none;
}

.an-map-water {
  transition: opacity 0.3s ease;
}

#anMapSvg.an-map-drilled .an-map-water {
  opacity: 0;
}

/* Once the district layer has fully faded in on top, hide the base map
   entirely (instead of just fading the non-selected paths) — otherwise its
   is-active stroke can peek through any small gaps between district shapes
   (region and district boundaries come from different source datasets and
   don't align pixel-perfectly). Reappears instantly when un-drilling so the
   shrink-back animation is visible. */
#anMapSvg {
  transition: opacity 0s linear;
}

#anMapSvg.an-map-drilled {
  transition: opacity 0s linear 0.5s;
  opacity: 0;
  pointer-events: none;
}

.an-map-wrap svg.an-district-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.an-district-svg {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease 0.15s;
}

.an-district-svg.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.an-district-path {
  fill: var(--surface-2);
  stroke: var(--an-district-border);
  stroke-width: 1.4;
  stroke-linejoin: round;
  cursor: pointer;
  vector-effect: non-scaling-stroke;
  transition: filter 0.15s ease, stroke-width 0.15s ease;
}

.an-district-path:hover {
  filter: brightness(1.12);
}

.an-district-path:focus {
  outline: none;
}

.an-district-path:focus-visible {
  outline: none;
  stroke: var(--accent);
  stroke-width: 2.6;
}

.an-district-path.is-active {
  stroke: var(--text);
  stroke-width: 2.6;
}

.an-district-path.is-empty {
  cursor: default;
}

.an-district-path.is-empty:hover {
  filter: none;
}

.an-map-back-btn {
  position: absolute;
  z-index: 6;
  top: 0.6rem;
  left: 0.6rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.an-map-back-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.an-map-back-btn:hover {
  filter: brightness(1.08);
}

.an-map-tooltip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  left: 0;
  top: 0;
  transform: translate(-50%, -100%);
  background: var(--surface-solid);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: nowrap;
  color: var(--text);
}

.an-map-tooltip b {
  font-size: 0.82rem;
}

.an-map-legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  max-width: 640px;
  margin: 0.85rem auto 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-3);
}

.an-map-legend-val {
  flex-shrink: 0;
  min-width: 1.2em;
  text-align: center;
}

.an-map-legend-bar {
  flex: 1;
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--an-map-low), var(--an-map-high));
  border: 1px solid var(--stroke);
}

/* ===== FORMS & INPUTS ===== */
input, select, textarea, button {
  font: inherit;
  padding: 0.72rem 1rem;
  border-radius: 10px;
  border: 1.5px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder, select::placeholder, textarea::placeholder {
  color: var(--text-3);
}

select option {
  background: var(--surface-solid);
  color: var(--text);
}

input:hover, select:hover, textarea:hover {
  border-color: var(--accent-border);
}

input:focus, input:focus-visible,
select:focus, select:focus-visible,
textarea:focus, textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

input[type="file"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
}

/* DB readonly */
input.db-readonly {
  background: var(--stroke-2);
  color: var(--text-3);
  cursor: not-allowed;
  border-color: var(--stroke);
  pointer-events: none;
  user-select: text;
  opacity: 0.7;
}

.field-label-db::after {
  content: " •";
  color: var(--accent);
  font-size: 0.75rem;
}

/* ===== BUTTONS ===== */
.btn {
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
  font-size: 0.9rem;
  border-radius: 12px;
  padding: 0.7rem 1.3rem;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15), 0 4px 12px var(--accent-glow);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Shine stripe */
.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.btn:hover {
  background: var(--accent-light);
  box-shadow: 0 2px 0 rgba(0,0,0,0.1), 0 6px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn:hover::before { left: 120%; }

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 rgba(0,0,0,0.15), 0 2px 6px var(--accent-glow);
}

/* Ghost / outline variant */
.btn.ghost {
  background: transparent;
  border: 1.5px solid var(--stroke);
  color: var(--text-2);
  box-shadow: none;
}

.btn.ghost::before { display: none; }

.btn.ghost:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
  color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn.ghost:active { transform: translateY(1px); }

/* Danger variant */
.btn.danger {
  background: #dc2626;
  box-shadow: 0 2px 0 rgba(0,0,0,0.15), 0 4px 12px rgba(220,38,38,0.3);
}

.btn.danger:hover {
  background: #ef4444;
  box-shadow: 0 2px 0 rgba(0,0,0,0.1), 0 6px 20px rgba(220,38,38,0.4);
}

/* Auth card button override */
.auth-card .btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  border-radius: 12px;
}

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--badge-bg);
  border: 1px solid var(--badge-border);
  font-size: 0.85rem;
  color: var(--text-2);
  font-weight: 600;
}

.sidebar-badge { margin: 0 0 1rem 0; }

/* ===== AUTH GATE ===== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  overflow-y: auto;
  min-height: 100vh;
  isolation: isolate;
}

.auth-gate.hidden { display: none; }

/* Background slider */
#bgSlider {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  pointer-events: none;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.3s cubic-bezier(0.4,0,0.2,1),
              transform 8s cubic-bezier(0.25,0.46,0.45,0.94);
}

.bg-slide.active {
  opacity: 1;
  transform: scale(1);
}

.auth-bg-overlay {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(255,255,255,0.05), transparent 48%),
    radial-gradient(circle at 82% 78%, rgba(22,163,74,0.15), transparent 48%),
    linear-gradient(160deg, rgba(5,14,9,0.62), rgba(5,14,9,0.55));
}

/* Venetian blinds transition */
.bg-blinds {
  position: absolute;
  inset: 0;
  display: flex;
  z-index: 5;
  pointer-events: none;
}

.bg-slat {
  flex: 1;
  background: #060e09;
  transform: translateY(-105%);
  transition: transform 0.28s cubic-bezier(0.55,0,1,0.45);
}

.bg-slat:nth-child(even) { transform: translateY(105%); }
.bg-slat:nth-child(1) { transition-delay: 0ms; }
.bg-slat:nth-child(2) { transition-delay: 45ms; }
.bg-slat:nth-child(3) { transition-delay: 90ms; }
.bg-slat:nth-child(4) { transition-delay: 135ms; }
.bg-slat:nth-child(5) { transition-delay: 180ms; }
.bg-slat:nth-child(6) { transition-delay: 225ms; }
.bg-slat:nth-child(7) { transition-delay: 270ms; }
.bg-slat:nth-child(8) { transition-delay: 315ms; }
.bg-blinds.closing .bg-slat { transform: translateY(0); }

/* Auth panel */
.auth-panel {
  width: min(480px, 100%);
  background: rgba(6, 18, 10, 0.45);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 28px;
  padding: 1.8rem 1.6rem;
  box-shadow: 0 8px 48px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  animation: panelIn 0.5s cubic-bezier(0.34,1.1,0.64,1) both;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-head {
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.75rem;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-head p {
  margin: 0.5rem 0 0;
  color: rgba(255,255,255,0.75);
  font-size: 0.9rem;
}

.auth-logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
}

.auth-logo {
  max-width: 130px;
  max-height: 90px;
  object-fit: contain;
  filter: drop-shadow(0 4px 16px rgba(0,0,0,0.2));
}

.auth-content-grid { display: grid; }

.auth-method-switch {
  margin: 1.2rem 0 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 0.35rem;
}

.auth-method-btn {
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255,255,255,0.7);
  font-weight: 700;
  padding: 0.65rem;
  cursor: pointer;
  transition: all 0.25s ease;
  font-size: 0.82rem;
}

/* "Login va parol orqali kirish" — xodimlar uchun, tablar ostida emas, panel pastida */
.auth-alt-link {
  display: block;
  margin: 0.9rem auto 0;
  padding: 0.35rem 0.6rem;
  border: none;
  background: none;
  color: rgba(255,255,255,0.75);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255,255,255,0.35);
  cursor: pointer;
  transition: color 0.2s ease;
}
.auth-alt-link:hover { color: #fff; text-decoration-color: #4ade80; }

.auth-method-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(22,163,74,0.4);
}

.auth-card {
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 1rem;
  background: rgba(255,255,255,0.04);
  display: none;
}

.auth-card.active {
  display: block;
  animation: fadeSlide 0.35s ease both;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card h3 {
  margin: 0 0 0.5rem;
  color: #fff;
  font-size: 1rem;
}

.auth-help {
  margin: 0 0 1rem;
  color: rgba(255,255,255,0.72);
  font-size: 0.88rem;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.7rem;
}

.auth-input-wrap input {
  width: 100%;
  padding: 0.9rem 1rem 0.9rem 2.8rem !important;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  backdrop-filter: blur(8px);
  font-size: 0.92rem;
}

.auth-input-wrap input::placeholder { color: rgba(255,255,255,0.55); }

.auth-input-wrap input:focus {
  outline: none;
  border-color: rgba(34,197,94,0.6);
  background: rgba(255,255,255,0.14);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.18);
}

.auth-input-icon {
  position: absolute;
  left: 0.85rem;
  width: 1.15rem;
  height: 1.15rem;
  color: rgba(255,255,255,0.6);
  pointer-events: none;
}

.status-box {
  background: rgba(22,163,74,0.12);
  border: 1px solid rgba(22,163,74,0.28);
  color: rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  margin-top: 0.75rem;
}

.status-box.error {
  background: rgba(239,68,68,0.2);
  border-color: rgba(239,68,68,0.5);
  color: #fff;
  font-weight: 600;
}

/* .status-box's default white text is tuned for the photo-background auth gate — inside a
   regular .card (light surface in light theme) it's nearly invisible. Every other usage lives
   inside a .card, so scope the readable color there instead of changing the shared class. */
.card .status-box {
  color: var(--text);
}

.card .status-box.error {
  color: #b91c1c;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.status-box.shake { animation: shake 0.4s ease; }

/* Auth info badge */
.auth-info-badge {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  background: rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(16px);
  border-radius: 14px;
  padding: 0.7rem 1rem;
  max-width: 300px;
  z-index: 10;
  animation: fadeSlide 0.6s ease both;
}

.auth-info-badge svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke: rgba(255,255,255,0.65);
  margin-top: 2px;
}

.auth-info-lines {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auth-info-lines span {
  font-size: 0.72rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.78);
}

.auth-info-lines span:first-child {
  font-weight: 700;
  color: rgba(255,255,255,0.92);
}

/* Thumbnail filmstrip rail */
.bg-rail-wrap {
  position: fixed;
  bottom: 1.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  z-index: 10;
}

.bg-rail-label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.3rem 0.9rem;
  background: rgba(2,8,5,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}

.bg-rail {
  display: flex;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: rgba(2,8,5,0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.07);
}

.bg-thumb {
  position: relative;
  width: 66px;
  height: 44px;
  border-radius: 10px;
  border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1),
              box-shadow 0.3s ease;
}

/* A=зелёный, D=серый, G=красный — плавный спектр */
.bg-thumb[data-idx="0"] { color: #22c55e; border-color: rgba(34,197,94,0.5); }
.bg-thumb[data-idx="1"] { color: #4bba79; border-color: rgba(75,186,121,0.5); }
.bg-thumb[data-idx="2"] { color: #73ae94; border-color: rgba(115,174,148,0.5); }
.bg-thumb[data-idx="3"] { color: #9ca3af; border-color: rgba(156,163,175,0.5); }
.bg-thumb[data-idx="4"] { color: #b17981; border-color: rgba(177,121,129,0.5); }
.bg-thumb[data-idx="5"] { color: #c75054; border-color: rgba(199,80,84,0.5); }
.bg-thumb[data-idx="6"] { color: #dc2626; border-color: rgba(220,38,38,0.5); }

.bg-thumb:hover {
  transform: translateY(-6px) scale(1.06);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

.bg-thumb.active {
  border-color: currentColor;
  box-shadow: 0 0 0 1px currentColor, 0 0 20px currentColor, 0 6px 18px rgba(0,0,0,0.4);
  transform: translateY(-7px) scale(1.1);
}

.bg-thumb.active::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: currentColor;
  border-radius: 0 0 0 8px;
  z-index: 1;
  animation: thumb-fill 5.5s linear forwards;
}

@keyframes thumb-fill {
  from { width: 0; }
  to { width: 100%; }
}

/* Consent modal */
.consent-box {
  background: var(--surface-solid);
  border-radius: 24px;
  padding: 2.2rem 2.4rem;
  max-width: 420px;
  width: 92%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.28s cubic-bezier(0.34,1.1,0.64,1);
  border: 1px solid var(--stroke);
}

.consent-icon {
  font-size: 2.2rem;
  margin-bottom: 0.8rem;
}

.consent-box h3 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.consent-text {
  font-size: 0.87rem;
  line-height: 1.7;
  color: var(--text-2);
  margin: 0 0 1.5rem;
  text-align: left;
}

.consent-btn {
  width: 100%;
  font-size: 0.95rem;
  border-radius: 12px;
  padding: 0.85rem;
}

/* Auth error modal */
.auth-error-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.auth-error-modal.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-error-box {
  background: #1a1a2e;
  border: 1px solid rgba(239,68,68,0.45);
  border-radius: 18px;
  padding: 2rem 2.4rem;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 48px rgba(0,0,0,0.6);
  animation: popIn 0.28s ease;
}

.auth-error-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.auth-error-box p {
  color: #fff;
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.auth-error-box .btn { width: 100%; }

/* Gate lock */
body.gate-locked .app-shell,
body.gate-locked .topbar {
  pointer-events: none;
}

/* ===== STACK / TOOLBAR ===== */
.stack { display: grid; gap: 0.6rem; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ===== TABLE ===== */
.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  margin-top: 0.8rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
  background: var(--surface-solid);
  transition: background 0.35s ease;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--stroke-2);
  padding: 0.6rem 0.75rem;
  font-size: 0.88rem;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text);
}

.data-table thead th {
  background: var(--table-head);
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-2);
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: var(--accent-bg);
}

/* Wide multi-group tables (e.g. "Bino turlari bo'yicha" Reja/Amalda breakdown) — let columns
   size to their content and scroll horizontally inside .table-wrap instead of squeezing every
   column into the container width, with the first two (row #, tuman) pinned while scrolling. */
.data-table-wide {
  table-layout: auto;
  width: max-content;
  min-width: 100%;
}

.data-table-wide th,
.data-table-wide td {
  white-space: nowrap;
}

.data-table-wide .sticky-col-1,
.data-table-wide .sticky-col-2 {
  position: sticky;
  z-index: 2;
  background: var(--surface-solid);
}

.data-table-wide .sticky-col-1 { left: 0; min-width: 44px; }
.data-table-wide .sticky-col-2 { left: 44px; min-width: 120px; border-right: 2px solid var(--stroke); }

.data-table-wide thead .sticky-col-1,
.data-table-wide thead .sticky-col-2 {
  z-index: 3;
}

/* ===== LIST ===== */
.list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.list-item {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.92rem;
  color: var(--text);
}

.list-empty {
  color: var(--text-3);
  font-size: 0.88rem;
}

/* ===== SATELLITE MAP ===== */
.satellite-map {
  height: 320px;
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--stroke);
  overflow: hidden;
}

.satellite-map-wrap { position: relative; }

.map-expand-btn {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 10003;
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  border-radius: 9px;
  background: rgba(255,255,255,0.95) !important;
  border: 1px solid rgba(31,41,51,0.18) !important;
  color: #1f2933 !important;
}

.satellite-map-wrap.map-expanded {
  position: fixed;
  inset: 2.5vh 2vw;
  z-index: 10000;
  background: transparent;
  border-radius: 18px;
  padding: 0.8rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.satellite-map-wrap.map-expanded::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(4,18,23,0.65);
  border-radius: inherit;
  z-index: 10000;
}

.satellite-map-wrap.map-expanded .satellite-map {
  position: relative;
  z-index: 10002;
  height: calc(95vh - 1.6rem);
  border-radius: 12px;
}

#citizenLocationMapWrap:fullscreen,
#citizenLocationMapWrap:-webkit-full-screen {
  background: #000;
  padding: 0;
}

#citizenLocationMapWrap:fullscreen .satellite-map,
#citizenLocationMapWrap:-webkit-full-screen .satellite-map {
  height: 100%;
  width: 100%;
  border-radius: 0;
}

body.map-expanded-lock { overflow: hidden; }

/* "Bino va uy rasmlari" — xarita yonidagi 2x2 rasm slotlari (balandligi .satellite-map bilan bir xil). */
.location-photos-grid { align-items: start; }

/* Admin "Ma'lumotlarni tahrirlash" — topilgan har bir ariza uchun alohida forma. */
.edit-details-item {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 1rem;
  background: var(--surface-2);
}
.edit-details-head { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline; margin-bottom: 0.75rem; }
.edit-details-head strong { font-size: 0.95rem; }
.edit-details-head span { font-size: 0.82rem; color: var(--text-3); }
.edit-details-actions { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-top: 0.25rem; }
.edit-details-msg { font-size: 0.85rem; color: var(--text-3); }
.edit-details-msg.error { color: #dc2626; }

/* Gorizontal tugmali tanlov (masalan "Mulk shakli": Davlat / Nodavlat) — balandligi oddiy input bilan bir xil. */
.survey-radio-group.survey-radio-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.survey-radio-inline .survey-radio-label { justify-content: center; padding: 0.72rem 1rem; font-size: 0.95rem; }

/* Yoqilg'i bloki: gaz katagida "Ekvivalenti" qatori bor — qo'shni select cho'zilib ketmasin,
   maydonlar "Qavatlar soni" / "Odam soni" kabi bir xil o'lchamda tursin. */
#fuelGrid > .field { align-content: start; }

.building-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  height: 320px;
}

.building-photo-slot {
  position: relative;
  border: 1.5px dashed var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}

.building-photo-slot:hover,
.building-photo-slot:focus-visible { border-color: var(--accent); background: var(--surface-hover); outline: none; }

.building-photo-slot.has-photo { border-style: solid; }

.building-photo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.building-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.82rem;
  color: var(--text-3);
  text-align: center;
  padding: 0.5rem;
}

.building-photo-plus { font-size: 1.6rem; line-height: 1; color: var(--accent); }

.building-photo-caption {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.72rem;
}

.building-photo-remove {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.building-photo-remove:hover { background: #dc2626; }

.building-photo-slot [hidden] { display: none !important; }

@media (max-width: 900px) {
  .building-photos-grid { height: auto; grid-template-rows: none; }
  .building-photo-slot { aspect-ratio: 4 / 3; }
}

/* ===== PASSPORT PREVIEW ===== */
.passport-preview {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  margin-top: 0.8rem;
  background: var(--surface-solid);
}

/* ===== STEP TABS ===== */
.app-step-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
  counter-reset: step;
}

.app-step-tab {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: var(--surface);
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 0.75rem 0.75rem 0.75rem 2.8rem;
  min-height: 52px;
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-2);
  transition: all 0.22s ease;
}

.app-step-tab::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  color: #fff;
  background: linear-gradient(120deg, var(--text-3), var(--text-2));
  transition: background 0.22s ease;
}

.app-step-tab:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--text);
}

.app-step-tab.active {
  background: linear-gradient(120deg, var(--accent-bg), rgba(34,197,94,0.05));
  border-color: var(--accent-border);
  color: var(--accent);
}

.app-step-tab.active::before {
  background: linear-gradient(120deg, var(--accent), var(--accent-light));
  box-shadow: 0 2px 8px rgba(22,163,74,0.3);
}

/* ===== STEP PROGRESS BAR ===== */
.step-progress {
  display: flex;
  gap: 0;
  margin: 0 0 1.4rem;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--stroke);
}

.step-progress-item {
  flex: 1;
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--surface);
  color: var(--text-3);
  border-right: 1px solid var(--stroke);
  transition: background 0.25s, color 0.25s;
}

.step-progress-item:last-child { border-right: none; }

.step-progress-item.active {
  background: var(--accent);
  color: #fff;
}

.step-progress-item.done {
  background: var(--accent-bg);
  color: var(--accent);
}

/* ===== FIELD ===== */
.field {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}

.field > input,
.field > select,
.field > textarea {
  width: 100%;
  min-width: 0;
}

.field-label {
  font-size: 0.82rem;
  color: var(--text-2);
  font-weight: 700;
}

/* ===== CITIZEN APP SECTION ===== */
#citizenApplicationSection {
  border: 1px solid var(--accent-border);
  position: relative;
}

.form-journey-tip {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  border: 1px dashed var(--accent-border);
  background: var(--accent-bg);
  color: var(--text-2);
  font-size: 0.88rem;
}

#citizenAppStep1Form,
#citizenAppStep2Form {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 1.1rem;
  position: relative;
}

#citizenAppStep1Form .field,
#citizenAppStep2Form .field,
#citizenAppStep3Form .field {
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--stroke-2);
  background: var(--surface-hover);
  transition: border-color 0.2s, background 0.2s;
}

#citizenAppStep1Form .field:focus-within,
#citizenAppStep2Form .field:focus-within,
#citizenAppStep3Form .field:focus-within {
  border-color: var(--accent-border);
  background: var(--surface-solid);
}

#citizenAppStep2Form .toolbar { justify-content: flex-end; }

/* ===== SURVEY (Step 3) ===== */
.survey-element {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 1.1rem;
  background: var(--surface);
  display: grid;
  gap: 0.7rem;
  transition: border-color 0.2s, background 0.35s;
}

.survey-element:focus-within {
  border-color: var(--accent-border);
}

.survey-element-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.survey-element-num {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-light));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(22,163,74,0.3);
}

.survey-element-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  flex: 1;
}

.survey-element-weight {
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  flex-shrink: 0;
}

.survey-weight-badge {
  font-size: 0.74rem;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0.18rem 0.5rem;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.survey-tip {
  font-size: 0.8rem;
  color: var(--text-3);
  font-style: italic;
  margin: 0;
}

.survey-radio-group { display: grid; gap: 0.3rem; }

.survey-radio-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.75rem;
  border-radius: 9px;
  border: 1px solid var(--stroke);
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-2);
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.35;
}

.survey-radio-label:hover {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}

.survey-radio-label:has(input:checked) {
  background: linear-gradient(120deg, var(--accent-bg), rgba(34,197,94,0.04));
  border-color: var(--accent-border);
  font-weight: 600;
  color: var(--text);
}

.survey-radio-label input[type="radio"] {
  flex-shrink: 0;
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
  padding: 0;
  margin: 0;
  border: none;
}

.coef-badge {
  margin-left: auto;
  font-size: 0.73rem;
  background: var(--accent-bg);
  color: var(--accent);
  padding: 0.1rem 0.42rem;
  border-radius: 6px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== AUDIT STAGE ===== */
.audit-stage-head h3 { margin: 0; }
.audit-stage-grid { display: grid; gap: 0.4rem; }

.audit-stage-row {
  display: grid;
  grid-template-columns: minmax(200px, 1.15fr) minmax(260px, 2fr) 120px;
  gap: 0.55rem;
  align-items: center;
  padding: 0.38rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--surface);
}

.audit-stage-row label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-2);
}

.audit-source-badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  padding: 0 0.6rem;
}

.audit-source-badge.auto {
  color: #9b2626;
  border-color: rgba(155,38,38,0.25);
  background: rgba(255,239,214,0.8);
}

.audit-source-badge.select {
  color: #1e5f2d;
  border-color: rgba(30,95,45,0.22);
  background: rgba(229,246,231,0.8);
}

.audit-source-badge.manual {
  color: #1055a5;
  border-color: rgba(16,85,165,0.22);
  background: rgba(229,239,255,0.8);
}

html[data-theme="dark"] .audit-source-badge.auto {
  background: rgba(155,38,38,0.25);
  color: #fca5a5;
}

html[data-theme="dark"] .audit-source-badge.select {
  background: rgba(22,163,74,0.2);
  color: #86efac;
}

html[data-theme="dark"] .audit-source-badge.manual {
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
}

/* ===== TECH INDEX ===== */
.tech-index-result {
  border: 2px solid;
  border-radius: 14px;
  padding: 1.4rem;
}

.tech-index-result.result-vgood   { border-color: #155f38; background: var(--accent-bg); }
.tech-index-result.result-good    { border-color: #2f7d4f; background: rgba(34,197,94,0.06); }
.tech-index-result.result-ok      { border-color: #6aaa5a; background: rgba(101,163,13,0.06); }
.tech-index-result.result-mod     { border-color: #d48a00; background: rgba(212,138,0,0.06); }
.tech-index-result.result-urgent  { border-color: #c0392b; background: rgba(192,57,43,0.06); }

.tech-verdict-banner {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1.2rem;
}

.tech-verdict-banner strong { font-size: 1.1rem; font-weight: 700; }
.tech-verdict-banner span { font-size: 0.84rem; opacity: 0.72; }

.result-vgood  .tech-verdict-banner strong { color: #155f38; }
.result-good   .tech-verdict-banner strong { color: #2f7d4f; }
.result-ok     .tech-verdict-banner strong { color: #4d8a3a; }
.result-mod    .tech-verdict-banner strong { color: #c07a00; }
.result-urgent .tech-verdict-banner strong { color: #c0392b; }

.tech-index-class-shift {
  background: var(--surface);
  border-radius: 12px;
  margin-bottom: 1rem;
  padding: 1rem;
}

.class-shift-base {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-2);
  width: 2rem;
  text-align: center;
}

.class-shift-arrow { font-size: 0.84rem; color: var(--text-3); flex: 1; }

.class-shift-result {
  font-size: 1.7rem;
  font-weight: 800;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.class-shift-A { background: #16a34a; }
.class-shift-B { background: #65a30d; }
.class-shift-C { background: #ca8a04; }
.class-shift-D { background: #d97706; }
.class-shift-E { background: #ea580c; }
.class-shift-F { background: #dc2626; }
.class-shift-G { background: #7f1d1d; }

/* ===== RESULT GRID ===== */
.result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.8rem;
}

.result-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.75rem;
  transition: background 0.35s;
}

.result-card .k {
  color: var(--text-3);
  font-size: 0.8rem;
}

.result-card .v {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  margin-top: 0.2rem;
  color: var(--text);
}

.result-card .v.category {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

/* ===== LOGIC LIST ===== */
.logic-list { display: grid; gap: 0.5rem; }

.logic-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
}

.logic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(120deg, var(--accent), var(--accent-light));
  flex: 0 0 auto;
}

/* ===== FLOW GRID ===== */
.flow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.flow-step {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  background: var(--surface);
  transition: background 0.35s;
}

.flow-step strong {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  margin-bottom: 0.35rem;
  background: linear-gradient(120deg, var(--accent), var(--accent-light));
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
}

.flow-step p { margin: 0; color: var(--text-2); }

/* ===== CHIPS ===== */
.chip-row {
  margin-top: 0.8rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  font-size: 0.83rem;
  color: var(--text-2);
}

/* ===== HIGHLIGHT CARD ===== */
.highlight-card {
  border: 1px solid rgba(217,111,50,0.3);
  background: linear-gradient(160deg, var(--surface), rgba(217,111,50,0.06));
}

/* ===== UNIFIED FLOW CARD ===== */
.unified-flow-card {
  border: 2px dashed var(--stroke);
  border-radius: 14px;
  padding: 1.2rem;
  margin: 1rem 0;
  background: var(--accent-bg);
}

.unified-flow-card h4 {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.93rem;
}

/* ===== RATING CARD ===== */
/* ===== RATING CARD — modern redesign ===== */
.rating-result-block {
  margin: 1.4rem 0 0.5rem;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  animation: ratingFadeIn 0.45s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes ratingFadeIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* TOP HERO */
.rating-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.4rem;
  padding: 2rem 2rem 1.6rem;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.rating-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 10% 50%, rgba(255,255,255,.15) 0%, transparent 60%);
  pointer-events: none;
}
.rating-hero::after {
  content: attr(data-letter);
  position: absolute;
  right: -0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9rem;
  font-weight: 900;
  line-height: 1;
  opacity: .07;
  letter-spacing: -0.05em;
  pointer-events: none;
  font-family: "Space Grotesk", sans-serif;
}

/* Big letter badge */
.rating-hero-letter {
  width: 84px;
  height: 84px;
  border-radius: 20px;
  background: rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
  border: 2px solid rgba(255,255,255,.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.4rem;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  box-shadow: 0 4px 20px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.4);
  flex-shrink: 0;
}

.rating-hero-info { flex: 1; }
.rating-hero-label {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  letter-spacing: -0.01em;
}
.rating-hero-energy {
  font-size: 0.88rem;
  opacity: 0.82;
  font-weight: 500;
}

/* Right badge */
.rating-hero-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 14px;
  padding: 0.55rem 0.9rem;
  min-width: 74px;
  text-align: center;
  backdrop-filter: blur(4px);
}
.rating-hero-badge-val {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}
.rating-hero-badge-lbl {
  font-size: 0.6rem;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-top: 0.25rem;
}

/* EU-STYLE SCALE BAR */
.rating-scale-bar {
  display: flex;
  height: 48px;
  background: var(--surface-solid, #f8fafc);
  padding: 6px 8px;
  gap: 3px;
  align-items: center;
}
.rsb-item {
  flex: 1;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.82rem;
  color: rgba(255,255,255,.55);
  position: relative;
  border-radius: 5px;
  cursor: default;
  transition: transform .2s, filter .2s;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
}
.rsb-item:first-child {
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
  border-radius: 6px 5px 5px 6px;
}
.rsb-item:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8px 50%);
  border-radius: 5px 6px 6px 5px;
}
.rsb-active {
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  filter: brightness(1.1) drop-shadow(0 2px 8px rgba(0,0,0,.35));
  transform: scaleY(1.18);
  z-index: 2;
}
.rsb-A  { background: #16a34a; }
.rsb-B  { background: #16a34a; }
.rsb-C  { background: #a3e635; }
.rsb-D  { background: #facc15; }
.rsb-E  { background: #f97316; }
.rsb-F  { background: #dc2626; }
.rsb-G  { background: #dc2626; }

/* STATS ROW */
.rating-stats-row {
  display: flex;
  flex-wrap: wrap;
  background: var(--surface-solid, #fff);
  border-top: 1px solid var(--stroke, #e5e7eb);
}
.rs-item {
  flex: 1;
  min-width: 110px;
  padding: 0.9rem 1.2rem;
  border-right: 1px solid var(--stroke, #e5e7eb);
}
.rs-item:last-child { border-right: none; }
.rs-label {
  font-size: 0.64rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 0.25rem;
}
.rs-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}
.rating-actions {
  padding: 0.85rem 1.2rem;
  background: var(--surface);
  border-top: 1px solid var(--stroke);
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

/* GRADIENT BACKGROUNDS */
.rating-bg-A { background: linear-gradient(130deg, #047857 0%, #059669 60%, #10b981 100%); }
.rating-bg-B { background: linear-gradient(130deg, #15803d 0%, #16a34a 60%, #22c55e 100%); }
.rating-bg-C { background: linear-gradient(130deg, #4d7c0f 0%, #65a30d 60%, #84cc16 100%); }
.rating-bg-D { background: linear-gradient(130deg, #92400e 0%, #b45309 60%, #d97706 100%); }
.rating-bg-E { background: linear-gradient(130deg, #9a3412 0%, #c2410c 60%, #ea580c 100%); }
.rating-bg-F { background: linear-gradient(130deg, #991b1b 0%, #b91c1c 60%, #dc2626 100%); }
.rating-bg-G { background: linear-gradient(130deg, #5b21b6 0%, #6d28d9 60%, #7c3aed 100%); }
.rating-bg-unknown { background: linear-gradient(130deg, #374151 0%, #4b5563 100%); }

/* RESULT MINI CARDS */
.result-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 0.75rem;
  transition: background 0.35s;
}
.result-card .k {
  color: var(--text-3);
  font-size: 0.8rem;
}
.result-card .v {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  margin-top: 0.2rem;
  color: var(--text);
}
.result-card .v.category {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
}

/* ===== CATEGORY SHOWCASE ===== */
.category-showcase {
  position: static;
  width: min(500px, 100%);
  max-width: none;
  margin: 0 auto;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 18px;
  padding: 0.9rem;
  backdrop-filter: blur(16px);
  z-index: 10;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.showcase-header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.showcase-header h3 {
  margin: 0;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
}

.showcase-header p {
  margin: 0.25rem 0 0;
  color: rgba(255,255,255,0.75);
  font-size: 0.78rem;
}

.category-buttons {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
  flex-wrap: wrap;
}

.category-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.88);
  cursor: pointer;
  transition: all 0.28s ease;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0;
}

.category-btn:hover {
  transform: translateY(-3px) scale(1.05);
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.45);
}

.category-btn.active {
  color: #fff;
  transform: scale(1.1);
}
.category-btn[data-category="A"].active {
  background: linear-gradient(120deg, #047857, #059669);
  border-color: #059669;
  box-shadow: 0 0 14px rgba(4,120,87,0.55);
}
.category-btn[data-category="B"].active {
  background: linear-gradient(120deg, #16a34a, #22c55e);
  border-color: #22c55e;
  box-shadow: 0 0 14px rgba(22,163,74,0.55);
}
.category-btn[data-category="C"].active {
  background: linear-gradient(120deg, #65a30d, #84cc16);
  border-color: #84cc16;
  box-shadow: 0 0 14px rgba(101,163,13,0.55);
}
.category-btn[data-category="D"].active {
  background: linear-gradient(120deg, #b45309, #d97706);
  border-color: #d97706;
  box-shadow: 0 0 14px rgba(180,83,9,0.55);
}
.category-btn[data-category="E"].active {
  background: linear-gradient(120deg, #c2410c, #ea580c);
  border-color: #ea580c;
  box-shadow: 0 0 14px rgba(194,65,12,0.55);
}
.category-btn[data-category="F"].active {
  background: linear-gradient(120deg, #b91c1c, #dc2626);
  border-color: #dc2626;
  box-shadow: 0 0 14px rgba(185,28,28,0.55);
}
.category-btn[data-category="G"].active {
  background: linear-gradient(120deg, #6d28d9, #7c3aed);
  border-color: #7c3aed;
  box-shadow: 0 0 14px rgba(109,40,217,0.55);
}

.cat-label { font-size: 0.54rem; margin-top: 0.18rem; opacity: 0.75; }

.category-showcase.hidden,
.category-result-card.hidden {
  display: none;
}

.category-result-card {
  margin-top: 1rem;
  border-radius: 18px;
  overflow: hidden;
  animation: fadeIn 0.5s ease;
  width: 100%;
}

.category-display {
  background: var(--surface-solid);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem;
  border-bottom: 1px solid var(--stroke);
}

.category-letter {
  width: 68px;
  height: 68px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 2.1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, var(--accent), var(--accent-light));
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(22,163,74,0.35);
}

.category-info h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--text);
}

.category-info p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-3);
}

.category-image-container {
  width: 100%;
  height: 240px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.4s ease;
}

/* ===== DARK OVERRIDES ===== */
html[data-theme="dark"] .card {
  background: var(--surface);
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

html[data-theme="dark"] .card:hover {
  border-color: rgba(34,197,94,0.3);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(34,197,94,0.12);
}

html[data-theme="dark"] .data-table {
  background: var(--surface);
}

html[data-theme="dark"] .data-table thead th {
  background: var(--table-head);
  color: #808080;
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .data-table td {
  border-bottom-color: rgba(255,255,255,0.05);
  color: var(--text);
}

html[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(34,197,94,0.07);
}

html[data-theme="dark"] .table-wrap {
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: var(--input-bg);
  border-color: rgba(255,255,255,0.1);
  color: var(--text);
}

html[data-theme="dark"] input:hover,
html[data-theme="dark"] select:hover {
  border-color: rgba(34,197,94,0.35);
}

html[data-theme="dark"] .survey-element {
  background: var(--surface-2);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .survey-radio-label {
  background: var(--surface);
  border-color: rgba(255,255,255,0.07);
  color: var(--text-2);
}

html[data-theme="dark"] .survey-radio-label:hover {
  background: rgba(34,197,94,0.09);
  border-color: rgba(34,197,94,0.25);
}

html[data-theme="dark"] .survey-radio-label:has(input:checked) {
  background: rgba(34,197,94,0.13);
  border-color: rgba(34,197,94,0.38);
  color: var(--text);
}

html[data-theme="dark"] #citizenAppStep1Form,
html[data-theme="dark"] #citizenAppStep2Form {
  background: var(--surface-2);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .app-step-tab {
  background: var(--surface);
  border-color: rgba(255,255,255,0.08);
  color: var(--text-2);
}

html[data-theme="dark"] .app-step-tab:hover {
  background: rgba(34,197,94,0.09);
  border-color: rgba(34,197,94,0.22);
}

html[data-theme="dark"] .app-step-tab.active {
  background: rgba(34,197,94,0.14);
  border-color: rgba(34,197,94,0.35);
  color: var(--accent);
}

html[data-theme="dark"] .step-progress {
  border-color: rgba(255,255,255,0.08);
}

html[data-theme="dark"] .step-progress-item {
  background: var(--surface);
  color: var(--text-3);
}

html[data-theme="dark"] .rating-stats-row {
  background: var(--surface);
}

html[data-theme="dark"] .rating-actions {
  background: var(--surface-2);
  border-top-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .rs-item {
  border-right-color: rgba(255,255,255,0.06);
}
html[data-theme="dark"] .rating-stats-row {
  border-top-color: rgba(255,255,255,0.07);
}
html[data-theme="dark"] .rating-scale-bar {
  background: var(--surface-2, #1e2128);
}
html[data-theme="dark"] .rating-hero-letter {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.25);
}

html[data-theme="dark"] .result-card {
  background: var(--surface-2);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .flow-step {
  background: var(--surface-2);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .audit-stage-row {
  background: var(--surface-2);
  border-color: rgba(255,255,255,0.07);
}

html[data-theme="dark"] .hero {
  background: var(--surface);
  border-color: rgba(255,255,255,0.08);
  border-left-color: var(--accent);
}

html[data-theme="dark"] .list-item {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.18);
}

html[data-theme="dark"] .badge {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.2);
  color: var(--accent);
}

html[data-theme="dark"] .hamburger {
  background: var(--surface);
  border-color: rgba(255,255,255,0.09);
}

html[data-theme="dark"] .hamburger:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
}

html[data-theme="dark"] .theme-toggle {
  background: var(--surface);
  border-color: rgba(255,255,255,0.09);
}

html[data-theme="dark"] .theme-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
}

html[data-theme="dark"] .btn.ghost {
  background: var(--surface);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-2);
}

html[data-theme="dark"] .btn.ghost:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
  color: var(--accent);
}

/* ===== HIDDEN ===== */
.hidden { display: none !important; }

/* Topbar action buttons sizing */
#loginBtn, #logoutBtn {
  height: 36px;
  padding: 0 1.1rem;
  font-size: 0.85rem;
  border-radius: 10px;
}

/* ===== LANG SELECT ===== */
#langSelect {
  padding: 0.45rem 0.7rem;
  font-size: 0.83rem;
  border-radius: 9px;
  min-width: 96px;
  height: 36px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 920px) {
  .audit-stage-row { grid-template-columns: 1fr; }
  .audit-source-badge { justify-self: start; }
}

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    transform: translateX(-105%);
    width: 256px;
    z-index: 1200;
    background: var(--sidebar-bg);
    box-shadow: var(--shadow-lg);
    transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
  }

  .sidebar.open { transform: translateX(0); }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-grid { grid-template-columns: 1fr; }

  .auth-panel {
    padding: 1rem;
    border-radius: 18px;
  }

  .auth-head h2 { font-size: 1.3rem; }

  .data-table th,
  .data-table td {
    font-size: 0.82rem;
    padding: 0.45rem 0.5rem;
  }

  .passport-preview { min-height: 420px; }

  .app-step-tabs { grid-template-columns: 1fr; }

  .brand-logo { width: 38px; height: 38px; }

  .auth-info-badge {
    bottom: 5.5rem;
    left: 1rem;
    right: 1rem;
    max-width: 100%;
  }
}

@media (max-height: 780px) {
  .auth-gate {
    justify-content: flex-start;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .auth-panel {
    padding: 1.1rem 1rem;
    border-radius: 18px;
  }
}

/* ===== XARITA (Kadastr map) ===== */
.layout:has(> #pageXarita.active) {
  max-width: none;
  padding: 0 1.25rem 1.25rem;
}

.xarita-fullscreen {
  height: calc(100vh - 120px);
  min-height: 480px;
}

.xarita-fullscreen .xarita-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.xarita-title {
  margin: 0;
  font-size: 1.05rem;
  white-space: nowrap;
}

.xarita-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.xarita-search-input { flex: 1; min-width: 240px; }
.xarita-hint { font-size: 12px; color: var(--text-3); }

.xarita-map-wrap {
  position: relative;
  height: 65vh;
  min-height: 420px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.xarita-fullscreen .xarita-map-wrap {
  flex: 1;
  height: auto;
  min-height: 300px;
}
#xaritaMap { height: 100%; width: 100%; }

.xarita-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: var(--shadow-md);
  max-height: 220px;
  overflow-y: auto;
  color: var(--text);
}
.xarita-legend div { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.xarita-legend div:first-child { margin-top: 0; }
.xarita-legend .legend-swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

.xarita-zoom-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(30,41,59,.9);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  display: none;
}
.xarita-zoom-hint.visible { display: block; }

.xarita-selected {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 1000;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-md);
  width: 260px;
  display: none;
  color: var(--text);
}
.xarita-selected.visible { display: block; }
.xarita-selected-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.xarita-selected h4 { font-size: 13px; margin: 0; }
.xarita-selected-close {
  background: none;
  border: none;
  padding: 0;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 18px;
  color: var(--text-3);
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.xarita-selected-close:hover { background: var(--accent-bg); color: var(--text); }
.xarita-selected .row { font-size: 12px; margin-bottom: 4px; color: var(--text); }
.xarita-selected .row span { color: var(--text-3); }
.xarita-selected .cad-num { font-family: monospace; font-size: 15px; font-weight: 700; color: var(--accent); word-break: break-all; }

.leaflet-popup-content .cad-num { font-family: monospace; font-weight: 700; }

@media (max-width: 640px) {
  .xarita-selected { width: calc(100% - 24px); }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--accent-border);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== USER MANAGEMENT PANEL ===== */
.users-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.users-panel-head h2 { margin: 0; }

.users-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.users-toolbar input { flex: 2; min-width: 220px; }
.users-toolbar select { flex: 1; min-width: 160px; }

.users-table th:last-child,
.users-table td:last-child { width: 96px; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.password-cell {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.password-text {
  font-family: "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.03em;
  font-size: 0.85rem;
  color: var(--text);
}

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid;
  white-space: nowrap;
}

.role-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.row-actions {
  display: flex;
  gap: 0.4rem;
}

.icon-btn {
  background: transparent;
  border: 1.5px solid var(--stroke);
  color: var(--text-2);
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: none;
  flex-shrink: 0;
}

.icon-btn:hover {
  background: var(--surface-hover);
  border-color: var(--accent-border);
  color: var(--accent);
  transform: none;
}

.icon-btn.danger:hover {
  border-color: #dc2626;
  color: #dc2626;
  background: rgba(220,38,38,0.08);
}

.password-input-wrap {
  position: relative;
  display: flex;
}

.password-input-wrap input { flex: 1; padding-right: 2.7rem; }

.password-input-wrap .icon-btn {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
}

/* ===== GENERIC MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 9000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  max-width: 460px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--stroke);
}

.modal-box-head h3 { margin: 0; font-size: 1.05rem; }

.modal-box form { padding: 1.1rem 1.25rem; }

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  color: var(--text-2);
  padding: 0.2rem 0.5rem;
  border-radius: 8px;
  box-shadow: none;
}

.modal-close-btn:hover { background: var(--surface-hover); color: var(--text); transform: none; }

@media (max-width: 640px) {
  .users-toolbar input, .users-toolbar select { flex: 1 1 100%; }
}

/* ===== APPLIANCE PICKER (Elektrik qurilmalar / Oshxona qurilmalari) ===== */

/* Compact widget left on the page: "+ qo'shish" button + selected items + total */
.appliance-summary {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.75rem;
}

.appliance-summary-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.65rem 0;
}

.appliance-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  font-size: 0.86rem;
}

.appliance-summary-row-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appliance-summary-row-name b { color: var(--accent); }
.appliance-summary-row-kwh { color: var(--text-3); font-size: 0.78rem; white-space: nowrap; margin-left: auto; padding-right: 0.5rem; }

.appliance-summary-row button {
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.appliance-summary-row button:hover { color: #dc2626; }

.appliance-summary-empty {
  color: var(--text-3);
  font-size: 0.82rem;
  margin: 0.5rem 0;
}

.appliance-summary-total {
  font-size: 0.82rem;
  color: var(--text-2);
  padding-top: 0.5rem;
  border-top: 1px solid var(--stroke-2);
}

.appliance-summary-total b { color: var(--accent); font-size: 0.95rem; }

/* Modal: search + card grid */
.appliance-modal-search {
  width: 100%;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.7rem;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.appliance-modal-search:focus { outline: none; border-color: var(--accent-border); }

.appliance-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.appliance-card {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  padding: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s, background 0.15s;
}

.appliance-card.is-selected { border-color: var(--accent-border); background: var(--accent-bg); }

.appliance-card-name {
  font-size: 0.86rem;
  color: var(--text);
  line-height: 1.25;
}

.appliance-card-kwh {
  font-size: 0.74rem;
  color: var(--text-3);
}

.appliance-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-shrink: 0;
}

.appliance-stepper button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--input-border);
  background: var(--surface-solid);
  color: var(--text);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.appliance-stepper button:hover { border-color: var(--accent-border); color: var(--accent); }
.appliance-stepper button:disabled { opacity: 0.35; cursor: default; }

.appliance-stepper-qty {
  width: 4rem;
  min-width: 1.6rem;
  padding: 0.2rem 0.3rem;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  -moz-appearance: textfield;
  appearance: textfield;
}
.appliance-stepper-qty:focus { outline: none; border-color: var(--accent-border); }
.appliance-stepper-qty::-webkit-outer-spin-button,
.appliance-stepper-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.appliance-picker-empty {
  padding: 1rem 0.75rem;
  text-align: center;
  color: var(--text-3);
  font-size: 0.85rem;
}


/* So'rovnoma: to'ldirilmagan maydonni belgilash (validateSurveyStep, app.js) */
.survey-missing-field {
  outline: 2px solid #e5484d;
  outline-offset: 4px;
  border-radius: 8px;
  animation: survey-missing-pulse 1.2s ease-out 2;
}
.survey-missing-field input,
.survey-missing-field select,
.survey-missing-field textarea { border-color: #e5484d !important; }
.survey-missing-hint {
  margin-top: 0.35rem;
  color: #e5484d;
  font-size: 0.82rem;
  font-weight: 600;
}
@keyframes survey-missing-pulse {
  0% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.45); }
  100% { box-shadow: 0 0 0 10px rgba(229, 72, 77, 0); }
}

/* Quyosh paneli / gelio kollektor jadvali ostidagi jami (updateCapacityTotal, app.js) */
.capacity-total {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--accent-soft, rgba(22, 163, 74, 0.08));
  font-size: 0.9rem;
}
.capacity-total b { color: var(--accent); font-size: 1rem; }
.capacity-total-note { color: var(--text-3); font-size: 0.8rem; }

/* ===== Kuzatuvchi paneli ichidagi iframe (index.html?embed=...) — faqat sahifaning o'zi, ramkasiz ===== */
body.embed-mode .topbar,
body.embed-mode .sidebar,
body.embed-mode .bg-shape {
  display: none;
}

body.embed-mode .app-shell {
  grid-template-columns: 1fr;
}

body.embed-mode .layout {
  max-width: none;
  margin: 0;
  padding: 0.75rem 0.75rem 1.5rem;
}

/* ===== Foydalanuvchi boshqaruvi: "Foydalanuvchilar" / "Mahallalar" vkladkalari (mahalla-accounts.js) ===== */
.admin-users-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 1rem;
  border: 1px solid var(--stroke, #e2e8f0);
  border-radius: 12px;
  background: var(--surface-2, rgba(0, 0, 0, 0.03));
}
.admin-users-tab {
  border: 0;
  background: transparent;
  color: var(--text-2, #475569);
  padding: 0.55rem 1.2rem;
  border-radius: 9px;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.admin-users-tab:hover { color: var(--accent, #16a34a); }
.admin-users-tab.is-active {
  background: var(--surface, #fff);
  color: var(--accent, #16a34a);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.mahalla-accounts-table td:nth-child(2),
.mahalla-accounts-table td:nth-child(6),
.mahalla-accounts-table td:nth-child(7) { white-space: nowrap; }


/* ===== MAHALLA: nogironligi bor fuqarolar xonalari (index.html #disabledRoomsSection, app.js disabledRooms) ===== */
.dr-counter { display: flex; align-items: center; gap: 0.4rem; }
.dr-counter input { width: 5rem; text-align: center; }

.dr-room {
  border: 1px solid var(--stroke);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 0.9rem 1rem 0.4rem;
  margin-top: 0.9rem;
}
.dr-room-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.dr-room-head b { font-size: 0.95rem; color: var(--text); }
.dr-room-num {
  width: 26px; height: 26px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 0.8rem; flex-shrink: 0;
}
.dr-room-sub { font-size: 0.78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin: 0.6rem 0 0.4rem; }
.dr-area {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1rem;
  padding: 0.5rem 0.7rem; margin-bottom: 0.6rem;
  border-radius: var(--radius-sm); background: var(--surface-hover);
  font-size: 0.85rem; color: var(--text-3);
}
.dr-area b { color: var(--text); }

/* Natija: har bir xona reytingi (saqlangandan keyin) */
.dr-results { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.dr-result {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.75rem 1rem; border: 1px solid var(--stroke); border-radius: 12px; background: var(--surface);
}
.dr-result-badge {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; font-weight: 900; color: #fff;
}
.dr-result-body { flex: 1; min-width: 12rem; }
.dr-result-body small { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.dr-result-body b { font-size: 0.92rem; color: var(--text); }
.dr-result-body span { display: block; font-size: 0.8rem; color: var(--text-3); margin-top: 0.15rem; }
.dr-result-parts { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.dr-result-parts span {
  font-size: 0.75rem; padding: 0.2rem 0.5rem; border-radius: 6px;
  background: var(--surface-hover); color: var(--text-3); white-space: nowrap;
}
.dr-result-parts b { color: var(--text); }
