/* =========================================
   1. GLOBAL – umumiy sozlamalar
========================================= */

/* Barcha elementlarda quti o'lchovi bir xil bo'lishi uchun */
* {
  box-sizing: border-box;
}

/* Umumiy shrift oilasi */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}


/* =========================================
   2. YUQORI PANEL (LOGO + MONITORING TIZIMI)
========================================= */

/* Topbar – ekranning tepasiga yopishgan panel,
   balandligi ekranning 10 foizi (10vh) */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 10%;           /* 10% ekran balandligi */
  z-index: 1200;
}

/* Topbar'ning "katta" holati – gradient fon va joylashuv */
.topbar.big {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #007c46, #00aa67);
  color: #fff;
  padding: 10px 24px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  flex-wrap: nowrap;
}

/* Logo + sarlavha + metrikalar joylashgan blok */
.topbar.big .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Logo o'lchami va ko'rinishi */
.topbar .logo {
  width: 80px;
  height: 80px;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  object-fit: contain;
}

/* Sarlavha va statistik ko'rsatkichlar joylashgan blok */
.header-title {
  display: flex;
  align-items: center;
  gap: 10px;              /* sarlavha va metrikalar orasidagi masofa */
  flex-wrap: nowrap;
  width: 100%;
  justify-content: space-between;
}

/* “YASHIL ENERGIYA MONITORING TIZIMI” yozuvi */
.header-title h1 {
  font-size: 29px;        /* katta font */
  font-weight: 600;
  margin: 0;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, .4);
  white-space: nowrap;    /* satrga bo‘linmasin */
}

/* Sarlavha yonidagi metrikalar qatori */
.summary-panel {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
  overflow-x: auto;       /* kichik ekranlarda gorizontal scroll */
}

/* Har bir metrikaning kartochkasi */
.metric {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 8px 16px;
  text-align: left;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  min-width: 150px;
}

/* Metrika sarlavhasi (masalan, JAMI PV STANSIYALAR SONI) */
.metric-label {
  font-size: 12px;
  font-weight: 400;
  color: #cfeecf;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Metrika ichidagi emoji / ikonchalar uchun */
.metric-icon {
  font-size: 18px;
  line-height: 1;
}

/* Metrika qiymati (raqam) */
.metric-value {
  font-size: 20px;
  font-weight: 600;
  margin-top: 2px;
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, .3);
}


/* =========================================
   3. XARITA BLOKI
========================================= */

/* Topbardan keyin xarita pastroqda boshlansin,
   balandligi ekranning qolgan 90 foizi */
#map {
  /* margin-top: ;      yuqori panel balandligi */
  top: 10%;
  height: 90%;          /* qolgan balandlik */
  width: 100%;
}


/* =========================================
   4. KARTALAR (chap/o‘ng panellar uchun umumiy)
========================================= */

.card {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

/* Kartaning tepa sarlavhasi (masalan, “Hududlar”, “Foiz filtrlari”) */
.card-header {
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

/* Kartaning asosiy kontent qismi.
   max-height: 260px – o'ng panellarda scroll uchun. */
.card-body {
  padding: 8px 10px;
  max-height: 260px;
  overflow: auto;
}

/* Kartaning pastki qismi (tugmalar, izohlar) */
.card-footer {
  padding: 8px 10px;
  border-top: 1px solid #eee;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}


/* =========================================
   5. CHAP PANEL – HUDUDLAR RO‘YXATI
========================================= */

/* Chap panelning ekrandagi joylashuvi */
.left {
  position: fixed;
  top: calc(10vh + 20px);   /* headerdan biroz pastroqda */
  right: 12px;              /* (agar haqiqatan chapga qo‘ymoqchi bo‘lsangiz – left:12px;) */
  width: 280px;
  z-index: 1100;
}

/* Hududlar ro‘yxati qismi balandligini oshiramiz –
   ko‘proq viloyat ko‘rinsin */
#left-panel .card-body {
  max-height: 400px;
  overflow: auto;
}

/* Hududlar ro'yxatidagi har bir satr (viloyat + “Ko‘rish”) */
.region-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
}

/* “Ko‘rish” tugmasi */
.region-row button {
  padding: 4px 6px;
  border: 1px solid #ddd;
  background: #f6f6f6;
  border-radius: 6px;
  cursor: pointer;
}

/* Chap panel pastidagi statistik matn (umumiy yoki region bo‘yicha) */
#region-stats {
  font-size: 13px;
  line-height: 1.4;
}


/* =========================================
   6. O‘NG PANEL – FOIZ FILTRLARI
========================================= */

/* O‘ng panel joylashuvi (Foiz filtrlari) */
.right {
  position: fixed;
  bottom: 5px;
  right: 12px;
  height: 170px;
  width: 280px;
  z-index: 1100;
}

/* Foiz filtri satri */
.bin-row {
  margin-bottom: 6px;
  font-size: 13px;
}

.bin-row label {
  display: flex;
  align-items: center;
  gap: 6px;
}

.bin-row input {
  margin-right: 2px;
}

/* Har bir foiz toifasi uchun rangli kvadrat – legendani almashtiradi */
.bin-color-box {
  display: inline-block;
  width: 16px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid #ccc;
}


/* =========================================
   7. QIDIRUV PANELI – ENG YAQIN STANSIYA
========================================= */

/* Qidiruv paneli ekrandagi joylashuvi */
.right-bottom {
  position: fixed;
  bottom: 10px;
  left: 12px;
  width: 280px;
  z-index: 1100;
}

/* Qidiruv panelidagi inputlar */
#search-panel input {
  width: 100%;
  margin: 4px 0 8px;
  padding: 6px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
}

/* “Qidirish” tugmasi */
#search-panel button {
  padding: 6px 8px;
  border: 1px solid #0a7f4f;
  background: #0a7f4f;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

/* Qidiruv ostidagi izoh matni */
.muted {
  margin-top: 6px;
  color: #666;
  font-size: 12px;
}
