@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #f5f5f3;
  --surface:   #ffffff;
  --surface2:  #f0efed;
  --border:    rgba(0,0,0,0.08);
  --border2:   rgba(0,0,0,0.14);
  --text1:     #1a1a1a;
  --text2:     #6b6b6b;
  --text3:     #a0a0a0;
  --green:     #1D9E75;
  --green-bg:  #EAF3DE;
  --green-tx:  #3B6D11;
  --red:       #D85A30;
  --red-bg:    #FAECE7;
  --red-tx:    #993C1D;
  --blue:      #378ADD;
  --blue-bg:   #E6F1FB;
  --blue-tx:   #185FA5;
  --purple:    #7F77DD;
  --purple-bg: #EEEDFE;
  --purple-tx: #534AB7;
  --amber:     #BA7517;
  --amber-bg:  #FAEEDA;
  --amber-tx:  #854F0B;
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 14px;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'Inter', sans-serif;
  --shadow:    0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 14px;
  line-height: 1.6;
}

/* HEADER */
.header1 {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface);
  border-bottom: 0.5px solid var(--border2);
  box-shadow: var(--shadow);
}

.header-container {
  max-width: 1320px; margin: 0 auto; padding: 0 24px;
  height: 56px; display: flex; align-items: center;
  justify-content: space-between; gap: 24px;
}

.header-container h1 { font-size: 15px; font-weight: 600; flex-shrink: 0; }

.header-container h1 a {
  color: var(--text1); text-decoration: none;
  display: flex; align-items: center; gap: 8px;
}

.header-container h1 a::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); display: inline-block; flex-shrink: 0;
}

/* Header chap qism — logo + (mobil) burger */
.header-left { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }

.nav-left { display: flex; align-items: center; gap: 6px; }

.nav-left a {
  font-size: 13px; font-weight: 500; color: var(--text2);
  text-decoration: none; padding: 7px 12px; border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  display: inline-flex; align-items: center;
}

.nav-left a:hover { background: var(--surface2); color: var(--text1); }

.nav-left a.nav-active {
  color: var(--text1);
  background: var(--surface2);
  font-weight: 600;
}

/* Sign In tugma — boshqa tugmalar bilan bir xil balandlikda */
.signin-btn {
  display: inline-flex !important; align-items: center;
  font-size: 13px !important; font-weight: 600 !important;
  padding: 6px 16px !important; border-radius: var(--radius-sm) !important;
  background: var(--green) !important; color: #fff !important;
  border: 0.5px solid var(--green) !important;
  text-decoration: none; transition: opacity .15s, transform .1s;
  margin-left: 4px;
}
.signin-btn:hover { opacity: .9; background: var(--green) !important; color: #fff !important; }
.signin-btn:active { transform: scale(.97); }

.nav-right { margin-left: 8px; }

.dropdown { position: relative; }

.dropbtn {
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--text2); background: var(--surface2);
  border: 0.5px solid var(--border2); border-radius: var(--radius-sm);
  padding: 5px 10px 5px 5px; cursor: pointer; transition: background 0.15s;
  display: inline-flex; align-items: center; gap: 6px;
  line-height: 1;
}

.dropbtn:hover { background: var(--surface); color: var(--text1); }

/* Foydalanuvchi avatar (bosh harf) */
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), #00a07a);
  color: #fff; font-size: 11px; font-weight: 700;
}
.user-name { font-weight: 500; }

.dropdown-admin { color: var(--red) !important; font-weight: 600 !important; }
.dropdown-admin:hover { background: rgba(216,90,48,0.08) !important; }

.dropdown-content {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 0.5px solid var(--border2);
  border-radius: var(--radius); min-width: 160px;
  box-shadow: var(--shadow-md); overflow: hidden;
}

.dropdown:hover .dropdown-content,
.dropdown.open .dropdown-content { display: block; }

.dropdown-content a, .dropdown-content button {
  display: block; width: 100%; padding: 9px 14px;
  font-family: var(--sans); font-size: 13px; color: var(--text2);
  text-decoration: none; background: none; border: none;
  text-align: left; cursor: pointer; transition: background 0.12s;
}

.dropdown-content a:hover, .dropdown-content button:hover {
  background: var(--surface2); color: var(--text1);
}

/* MAIN */
main { flex: 1; }
.content-section { padding: 0; }

.dashboard-container {
  max-width: 1320px; margin: 0 auto; padding: 28px 24px;
}

.page-title {
  font-size: 11px; font-weight: 500; color: var(--text3);
  letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 4px;
}

.page-heading {
  font-size: 22px; font-weight: 600; color: var(--text1);
  margin-bottom: 24px; line-height: 1.25;
}

.page-heading span { color: var(--green); }

/* Sarlavha + sana filtri yonma-yon */
.th-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.th-row .page-heading { flex: 1; min-width: 0; }
@media (max-width: 768px) {
  .th-row { gap: 10px; }
  .th-row .page-heading { font-size: 18px; }
}

/* Bo'sh chart placeholder — ma'lumot yo'q */
.empty-chart {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  width: 100%; height: 100%; min-height: 240px;
  text-align: center; gap: 6px;
  color: var(--text3);
}
.empty-chart-icon {
  font-size: 36px; opacity: .35; margin-bottom: 4px;
  filter: grayscale(.4);
}
.empty-chart-title {
  font-size: 14px; font-weight: 600; color: var(--text2);
}
.empty-chart-sub {
  font-size: 12px; color: var(--text3);
}

/* STAT CARDS */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 16px;
}

.stat-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
  position: relative; overflow: hidden; transition: box-shadow 0.2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-card-bar { width: 100%; height: 2px; border-radius: 2px; margin-bottom: 14px; }

.stat-label {
  font-size: 11px; font-weight: 500; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}

.stat-value { font-size: 28px; font-weight: 600; color: var(--text1); line-height: 1; }

.stat-sub { font-size: 11px; margin-top: 6px; font-weight: 500; }

.stat-icon { position: absolute; top: 18px; right: 18px; font-size: 20px; opacity: 0.12; }

/* CHART CARDS */
.ct-card {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; transition: box-shadow 0.2s;
}

.ct-card:hover { box-shadow: var(--shadow-md); }

.ct-card-title {
  font-size: 11px; font-weight: 500; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px;
}

.chart-wrapper {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  margin-bottom: 14px; min-height: 320px;
}

.chart-title {
  font-size: 11px; font-weight: 500; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px;
}

.pie-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px; margin-bottom: 14px;
}

.pie-container .chart-wrapper { min-height: 280px; margin-bottom: 0; }

/* PROGRESS BAR */
.progress-bar {
  height: 4px; background: var(--surface2);
  border-radius: 2px; overflow: hidden; margin-top: 5px;
}

.progress-fill {
  height: 100%; background: var(--red);
  border-radius: 2px; transition: width 0.8s ease;
}

/* BADGE */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 500;
}

.badge-red    { background: var(--red-bg);    color: var(--red-tx); }
.badge-green  { background: var(--green-bg);  color: var(--green-tx); }
.badge-blue   { background: var(--blue-bg);   color: var(--blue-tx); }
.badge-purple { background: var(--purple-bg); color: var(--purple-tx); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber-tx); }
.badge-cyan   { background: var(--blue-bg);   color: var(--blue-tx); }
.badge-orange { background: var(--amber-bg);  color: var(--amber-tx); }

/* LIVE DOT */
.live-dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--red); border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* BAR ROWS */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }

.bar-label {
  font-size: 12px; color: var(--text2); width: 70px;
  text-align: right; flex-shrink: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.bar-track {
  flex: 1; height: 6px; background: var(--surface2);
  border-radius: 3px; overflow: hidden;
}

.bar-fill { height: 100%; border-radius: 3px; background: var(--red); }

.bar-val {
  font-size: 11px; color: var(--text3); width: 38px;
  text-align: right; flex-shrink: 0; font-family: var(--mono);
}

/* PIE LEGEND */
.pie-legend { display: flex; flex-direction: column; gap: 7px; justify-content: center; }

.pie-legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text2); }

.pie-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* MAP */
.map-container {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 14px;
}

#attackMap { height: 520px; width: 100%; }

/* DATA TABLE */
.data-table-wrapper {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-top: 14px;
}

.data-table-header {
  padding: 14px 20px; border-bottom: 0.5px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.data-table-header h3 {
  font-size: 11px; font-weight: 500; color: var(--text3);
  text-transform: uppercase; letter-spacing: 0.5px;
}

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }

.data-table thead th {
  padding: 10px 20px; text-align: left; font-size: 10px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text3); border-bottom: 0.5px solid var(--border);
  background: var(--surface2);
}

.data-table tbody tr {
  border-bottom: 0.5px solid var(--border); transition: background 0.12s;
}

.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: var(--surface2); }

.data-table tbody td { padding: 10px 20px; color: var(--text2); }
.data-table tbody td:first-child { color: var(--text1); }

/* FORMS */
.form-container {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; max-width: 520px;
  box-shadow: var(--shadow);
}

.form-group { margin-bottom: 18px; }

.form-group label {
  display: block; font-size: 12px; font-weight: 500;
  color: var(--text2); margin-bottom: 7px;
}

.form-group input[type="text"],
.form-group input[type="datetime-local"],
.form-group input[type="password"],
.form-group select {
  width: 100%; padding: 9px 12px;
  background: var(--surface); border: 0.5px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text1);
  font-family: var(--sans); font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none; color-scheme: light;
}

.form-group input:focus, .form-group select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.12);
}

.checkbox-group { display: flex; align-items: center; gap: 9px; }

.checkbox-group input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green); }

.checkbox-group label {
  font-size: 13px; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--text2); margin: 0;
}

.btn-primary {
  padding: 9px 20px; background: var(--text1); border: none;
  color: #fff; font-family: var(--sans); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: opacity 0.15s; text-decoration: none; display: inline-block;
}

.btn-primary:hover { opacity: 0.82; }

.btn-secondary {
  padding: 9px 20px; background: var(--surface2);
  border: 0.5px solid var(--border2); color: var(--text1);
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.15s; text-decoration: none; display: inline-block;
}

.btn-secondary:hover { background: #e5e4e2; }

/* LOGIN */
.login-wrapper {
  min-height: calc(100vh - 56px - 48px);
  display: flex; align-items: center; justify-content: center; padding: 40px 24px;
}

.login-box {
  width: 100%; max-width: 400px; background: var(--surface);
  border: 0.5px solid var(--border2); border-radius: var(--radius-lg);
  padding: 40px 36px; box-shadow: var(--shadow-md);
}

.login-logo { text-align: center; margin-bottom: 28px; }

.login-logo h2 { font-size: 18px; font-weight: 600; color: var(--text1); margin-bottom: 4px; }

.login-logo p { font-size: 12px; color: var(--text3); }

.login-error {
  background: var(--red-bg); border: 0.5px solid rgba(216,90,48,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--red-tx); margin-bottom: 18px;
}

/* SENSORS */
.sensor-status-container {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-top: 20px;
}

.sensor {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; transition: box-shadow 0.2s;
}

.sensor:hover { box-shadow: var(--shadow-md); }
.sensor h3 { font-size: 14px; font-weight: 500; color: var(--text1); margin-bottom: 4px; }
.online { color: var(--green-tx); font-size: 13px; font-weight: 500; }
.offline { color: var(--red-tx);  font-size: 13px; font-weight: 500; }
.last-updated { font-size: 12px; color: var(--text3); }

.btn-terminal {
  display: inline-block; margin-top: 12px; padding: 6px 14px;
  background: var(--surface2); border: 0.5px solid var(--border2);
  color: var(--text2); font-family: var(--sans); font-size: 12px; font-weight: 500;
  text-decoration: none; border-radius: var(--radius-sm); transition: background 0.15s;
}

.btn-terminal:hover { background: #e5e4e2; }

/* FEEDS */
.feeds-header { padding: 28px 24px 0; max-width: 1320px; margin: 0 auto; }

.feeds-container {
  max-width: 1320px; margin: 0 auto; padding: 16px 24px 28px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px;
}

.feed-item {
  background: var(--surface); border: 0.5px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px; transition: box-shadow 0.2s;
}

.feed-item:hover { box-shadow: var(--shadow-md); }

.feed-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

.feed-header h3 { font-size: 13px; font-weight: 500; color: var(--text1); }

.send-btn {
  padding: 5px 12px; background: var(--surface2); border: 0.5px solid var(--border2);
  color: var(--text2); font-family: var(--sans); font-size: 11px; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer; transition: background 0.12s;
}

.send-btn:hover { background: #e5e4e2; }

.feed-item ul { list-style: none; }

.feed-item li {
  font-size: 12px; color: var(--text2); padding: 5px 0;
  border-bottom: 0.5px solid var(--border); display: flex; gap: 6px;
}

.feed-item li:last-child { border-bottom: none; }
.feed-item li strong { color: var(--text3); font-weight: 500; min-width: 72px; }

/* SERVICES */
.services-container { max-width: 860px; margin: 0 auto; padding: 28px 24px; }
.services-container > p { font-size: 13px; color: var(--text2); margin-bottom: 20px; }

.services-table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 0.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
}

.services-table thead th {
  padding: 11px 18px; text-align: left; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; color: var(--text3);
  background: var(--surface2); border-bottom: 0.5px solid var(--border);
}

.services-table tbody tr { border-bottom: 0.5px solid var(--border); transition: background 0.12s; }
.services-table tbody tr:last-child { border-bottom: none; }
.services-table tbody tr:hover { background: var(--surface2); }
.services-table tbody td { padding: 11px 18px; font-size: 13px; color: var(--text2); }

/* REPORT LOADER */
.report-loader-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(4px);
  z-index: 999; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
}

.report-loader {
  width: 36px; height: 36px;
  border: 2.5px solid var(--border2); border-top-color: var(--green);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

.report-loader-text { font-size: 13px; color: var(--text2); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ERROR PAGES */
.error-page {
  min-height: calc(100vh - 56px - 48px);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 40px;
}

.error-code { font-size: 72px; font-weight: 600; color: var(--text1); line-height: 1; margin-bottom: 10px; }
.error-msg { font-size: 16px; color: var(--text2); margin-bottom: 24px; }

.counter { font-size: 28px; font-weight: 600; color: var(--text1); }

.alert-error {
  background: var(--red-bg); border: 0.5px solid rgba(216,90,48,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--red-tx); margin-bottom: 18px;
}

.alert-success {
  background: var(--green-bg); border: 0.5px solid rgba(29,158,117,0.25);
  border-radius: var(--radius-sm); padding: 10px 14px;
  font-size: 13px; color: var(--green-tx); margin-bottom: 18px;
}

/* FOOTER */
footer {
  text-align: center; padding: 14px 24px; font-size: 12px;
  color: var(--text3); border-top: 0.5px solid var(--border); background: var(--surface);
}


/* ═══════════════════════════════════════
   PIE GRID
═══════════════════════════════════════ */
.pie-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

/* ═══════════════════════════════════════
   MAP CANVAS
═══════════════════════════════════════ */
#map-svg { width: 100%; height: 480px; display: block; }

/* ═══════════════════════════════════════
   RESPONSIVE — Desktop kichik (1200px)
═══════════════════════════════════════ */
@media (max-width: 1200px) {
  .dashboard-container { padding: 24px 20px; }
  .header-container { padding: 0 20px; gap: 16px; }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Planshet (1024px)
═══════════════════════════════════════ */
@media (max-width: 1024px) {
  .pie-grid { grid-template-columns: 1fr 1fr; }
  .stats-container { grid-template-columns: repeat(2, 1fr); }

  .header-container { height: 52px; }
  .nav-left a { padding: 5px 10px; font-size: 12px; }

  #map-svg { height: 420px; }
  .map-container #attackMap { height: 420px !important; }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Kichik planshet (768px)
═══════════════════════════════════════ */
@media (max-width: 768px) {
  /* Layout */
  .dashboard-container { padding: 16px 14px; }
  .feeds-container     { padding: 12px 14px 20px; grid-template-columns: 1fr; }
  .feeds-header        { padding: 20px 14px 0; }
  .services-container  { padding: 20px 14px; }
  .table-container     { padding: 20px 14px; }

  /* Header — burger menu */
  .header-container {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .header-container h1 { font-size: 14px; }

  .nav-left {
    width: 100%;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: flex-start;
    padding-bottom: 4px;
  }
  .nav-left a {
    padding: 5px 10px;
    font-size: 12px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
  }
  .nav-right { margin-left: 0; }
  .dropbtn   { font-size: 12px; padding: 5px 10px; }

  /* Cards */
  .stats-container { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value      { font-size: 24px; }
  .stat-card       { padding: 14px 16px; }

  /* Pie charts — 1 ustun */
  .pie-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Charts */
  .chart-wrapper   { padding: 14px; min-height: 280px !important; }

  /* Map */
  #map-svg { height: 300px !important; }
  .map-container #attackMap { height: 300px !important; }
  .map-overlay-stats { top:10px; right:10px; gap:5px; }
  .map-pill          { font-size: 11px; padding: 4px 10px; }
  .map-overlay-legend { bottom:10px; left:10px; padding:8px 12px; font-size:11px; }

  /* Tables */
  .data-table thead th { padding: 8px 10px; font-size: 9px; }
  .data-table tbody td { padding: 8px 10px; font-size: 12px; }
  .data-table-header   { padding: 10px 14px; }

  /* Form */
  .form-container { padding: 20px 16px; }
  .login-box      { padding: 28px 20px; }

  /* Sensor grid */
  .sensor-status-container { grid-template-columns: 1fr; }

  /* Error page */
  .error-code { font-size: 52px; }
  .page-heading { font-size: 18px; }

  /* Dropdown fullwidth */
  .dropdown-content { min-width: 140px; right: 0; }
}

/* ═══════════════════════════════════════
   RESPONSIVE — Mobil kichik (480px)
═══════════════════════════════════════ */
@media (max-width: 480px) {
  .dashboard-container { padding: 12px 10px; }

  /* Header */
  .header-container h1 { font-size: 13px; }
  .nav-left a { font-size: 11px; padding: 4px 8px; }

  /* Stats — ustma-ust */
  .stats-container { grid-template-columns: 1fr; gap: 8px; }
  .stat-value      { font-size: 28px; }

  /* Pie */
  .pie-grid { grid-template-columns: 1fr; }

  /* Chart wrapper */
  .chart-wrapper { padding: 12px; min-height: 240px !important; }

  /* Map */
  #map-svg { height: 240px !important; }
  .map-container #attackMap { height: 240px !important; }
  .map-overlay-stats  { display: none; }
  .map-overlay-legend { display: none; }

  /* Table scroll */
  .data-table-wrapper { overflow-x: auto; }
  .data-table { min-width: 420px; }
  .data-table tbody td { font-size: 11px; padding: 7px 8px; }

  /* Login */
  .login-box { padding: 24px 16px; }
  .login-logo h2 { font-size: 16px; }

  /* Page heading */
  .page-heading { font-size: 16px; margin-bottom: 16px; }
  .page-title   { font-size: 10px; }

  /* Footer */
  footer { font-size: 11px; padding: 12px 14px; }

  /* Feeds */
  .feeds-container { grid-template-columns: 1fr; gap: 8px; }

  /* Sensor */
  .sensor-status-container { grid-template-columns: 1fr; gap: 8px; }
  .btn-terminal { font-size: 11px; padding: 5px 12px; }

  /* Error */
  .error-code { font-size: 44px; }
  .error-msg  { font-size: 14px; }
}

/* ═══════════════════════════════════════
   TOUCH — hover effektlarni o'chir
═══════════════════════════════════════ */
@media (hover: none) {
  .stat-card:hover,
  .ct-card:hover,
  .feed-item:hover,
  .sensor:hover { box-shadow: none; transform: none; }
}

/* ═══════════════════════════════════════
   BURGER MENU
═══════════════════════════════════════ */
.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: 0.5px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 7px;
  cursor: pointer;
  flex-shrink: 0;
}

.burger-btn span {
  display: block;
  width: 100%;
  height: 1.5px;
  background: var(--text2);
  border-radius: 2px;
  transition: all 0.2s;
  transform-origin: center;
}

.burger-btn.burger-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.burger-btn.burger-open span:nth-child(2) { opacity: 0; }
.burger-btn.burger-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

@media (max-width: 768px) {
  .burger-btn { display: flex; }

  /* Header ichidagi flex tartib */
  .header-container {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 10px 14px;
  }

  /* Nav yashirin holda */
  .nav-left {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 8px 0 4px;
    border-top: 0.5px solid var(--border);
    margin-top: 6px;
    gap: 2px;
  }

  /* Ochilganda */
  .nav-left.nav-open { display: flex; }

  .nav-left a {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: var(--radius-sm);
    border: 0.5px solid transparent;
  }

  .nav-left a:hover {
    background: var(--surface2);
    border-color: var(--border);
  }

  /* Dropdown mobilda full width */
  .dropdown { width: 100%; }
  .dropbtn  { width: 100%; text-align: left; padding: 10px 12px; border-radius: var(--radius-sm); }
  .dropdown-content {
    position: static;
    display: none;
    box-shadow: none;
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    margin-top: 4px;
  }
  .dropdown:focus-within .dropdown-content,
  .dropdown.open .dropdown-content { display: block; }

  /* Table horizontal scroll */
  .data-table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Til almashtirish tugmasi ── */
.lang-switcher { display:flex; align-items:center; }

.lang-btn {
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px; height:26px;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.5px;
  color:var(--text2);
  background:var(--surface2);
  border:0.5px solid var(--border2);
  border-radius:var(--radius-sm);
  text-decoration:none;
  transition:background .15s, color .15s;
}

.lang-btn:hover {
  background:var(--text1);
  color:#fff;
  border-color:var(--text1);
}

@media(max-width:768px) {
  .lang-switcher { order:-1; }
  .lang-btn { width:36px; height:32px; font-size:12px; }
}

.lang-btn-active {
  background: var(--text1) !important;
  color: #fff !important;
  border-color: var(--text1) !important;
}

/* ── Til dropdown ── */
.lang-dropdown {
  position: relative;
  display: flex;
  align-items: center;
}
.lang-drop-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  background: var(--surface2);
  border: 0.5px solid var(--border2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.lang-drop-btn:hover { background: var(--surface); color: var(--text1); }
.flag { font-size: 16px; line-height: 1; }
.lang-drop-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 140px;
  background: var(--surface);
  border: 0.5px solid var(--border2);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  z-index: 999;
  overflow: hidden;
}
.lang-dropdown.open .lang-drop-menu { display: block; }
.lang-drop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  text-decoration: none;
  transition: background .12s;
}
.lang-drop-item:hover { background: var(--surface2); color: var(--text1); }
.lang-drop-item.active {
  color: var(--text1);
  font-weight: 700;
  background: var(--surface2);
}
@media(max-width:768px) {
  .lang-drop-menu { right: auto; left: 0; }
}
