:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #07111c;
  color: #e5f2ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 18% 10%, rgba(24, 129, 190, 0.18), transparent 24rem),
    linear-gradient(135deg, #06111d 0%, #0a1823 42%, #09131d 100%);
}

.pazul-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(4, 17, 30, 0.82);
  backdrop-filter: blur(18px);
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.brand {
  height: 44px;
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 136px;
  max-height: 42px;
  object-fit: contain;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border-radius: 8px;
  color: #a9bfd3;
  font-size: 14px;
}

.nav-item.active {
  color: #eaf7ff;
  background: rgba(47, 140, 255, 0.14);
  box-shadow: inset 3px 0 0 #2f8cff;
}

.account-block {
  margin-top: auto;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #b7c8d8;
  font-size: 13px;
}

.account-block span,
.metric-card span,
.metric-card em,
.panel-title span,
.kv-table span {
  display: block;
  color: #8ba3b8;
  font-style: normal;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #2f8cff;
  color: #fff;
  font-weight: 700;
}

.pazul-main {
  min-width: 0;
  padding: 22px 24px 28px;
}

.topbar {
  min-height: 70px;
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.1;
}

.topbar p {
  margin: 6px 0 0;
  color: #79b8f2;
}

.topbar-controls {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.select-pill,
.live-pill {
  min-width: 150px;
  min-height: 48px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 7px 13px;
  background: rgba(8, 25, 42, 0.7);
  color: #88a1b5;
  font-size: 12px;
}

.select-pill strong {
  display: block;
  margin-top: 3px;
  color: #eaf7ff;
  font-size: 14px;
}

.live-pill {
  min-width: 82px;
  display: grid;
  place-items: center;
  color: #22c55e;
  font-weight: 800;
  border-color: rgba(34, 197, 94, 0.28);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(12, 31, 49, 0.92), rgba(8, 24, 38, 0.9));
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
}

.metric-card {
  min-height: 96px;
  padding: 14px 16px;
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
}

.metric-card.accent strong {
  color: #23c483;
}

.metric-card em {
  font-size: 12px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.4fr) minmax(300px, 0.95fr) minmax(320px, 1fr);
  gap: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-wide {
  grid-column: span 2;
}

.panel-tall {
  grid-row: span 2;
}

.panel-title {
  min-height: 42px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.panel-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.panel-title span {
  font-size: 12px;
  text-align: right;
}

.main-chart {
  height: 380px;
}

.mini-gauge {
  height: 140px;
  overflow: hidden;
}

.donut {
  height: 155px;
}

.site-map {
  height: 260px;
  overflow: hidden;
  border-radius: 8px;
}

.map-panel {
  padding-bottom: 10px;
}

.kv-table {
  display: grid;
  gap: 10px;
  font-size: 13px;
}

.kv-table div {
  display: grid;
  grid-template-columns: minmax(90px, 0.9fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: center;
  min-height: 26px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.11);
}

.kv-table strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 650;
}

.data-table {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(104px, 1fr) minmax(92px, 1fr) minmax(76px, 0.85fr) minmax(90px, 0.95fr);
  gap: 14px;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  font-size: 12px;
}

.session-table .table-head,
.session-table .table-row {
  grid-template-columns: minmax(44px, 0.4fr) minmax(112px, 1fr) minmax(72px, 0.8fr) minmax(72px, 0.7fr) minmax(62px, 0.6fr) minmax(48px, 0.5fr);
}

.table-head {
  background: rgba(148, 163, 184, 0.12);
  color: #9fb5c8;
  font-weight: 700;
}

.table-row {
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  color: #d9e8f4;
}

.table-row > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-head > * {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quality-dot {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
}

.quality-dot::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #23c483;
  box-shadow: 0 0 12px rgba(35, 196, 131, 0.72);
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  color: #88a1b5;
}

@media (max-width: 1320px) {
  .metric-strip {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .account-block {
    display: none;
  }

  .topbar,
  .topbar-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .metric-strip,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .panel-wide,
  .panel-tall {
    grid-column: auto;
    grid-row: auto;
  }
}
