﻿:root {
  --bg: #eef7fd;
  --ink: #0f2740;
  --panel: #ffffff;
  --line: #c7dff0;
  --brand: #00a9e0;
  --brand-2: #005e95;
  --accent: #ffd34d;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 14%, #f7fcff 0%, #eef7fd 42%, transparent 60%),
    radial-gradient(circle at 92% 86%, #e2f3ff 0%, #eef7fd 38%, transparent 62%),
    var(--bg);
}

.container {
  width: min(1100px, 92vw);
  margin: 32px auto 56px;
  position: relative;
  z-index: 2;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  color: #005e95;
}
.service-menu {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.service-menu a {
  text-decoration: none;
  border: 1px solid #bcdff2;
  background: #f7fcff;
  color: #0c577f;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}
.service-menu a:hover {
  background: #edf8ff;
}

.hero p { margin-top: 8px; max-width: 760px; }
.eyebrow {
  font-family: 'IBM Plex Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #007fba;
  margin-bottom: 6px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.hero-badge {
  border: 1px solid #b7ddf3;
  background: linear-gradient(120deg, #f8fdff, #ecf8ff);
  color: #0b4f79;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.85rem;
  font-weight: 600;
}
.hero-badge b { margin-right: 6px; color: #0ea4dc; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  margin-top: 18px;
  box-shadow: 0 10px 28px rgba(0, 94, 149, 0.08);
}
.debug-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.debug-head h2 { margin: 0; }
.debug-close {
  margin: 0;
  background: #dfeef8;
  color: #075b87;
  border: 1px solid #bdddf0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  padding: 0;
  font-weight: 700;
}

h2 { margin: 2px 0 16px; }
h3 { margin: 0 0 10px; font-size: 1rem; }

.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.compact { gap: 8px; }

.field { display: grid; gap: 6px; font-size: 0.95rem; }
input, select, button {
  font: inherit;
  border-radius: 10px;
  border: 1px solid #b7d7ea;
  background: white;
  padding: 10px 12px;
}
input:focus, select:focus {
  outline: 2px solid rgba(0, 169, 224, 0.25);
  border-color: #00a9e0;
}
button {
  margin-top: 10px;
  background: linear-gradient(120deg, #00a9e0, #007fba);
  color: #fff;
  border: none;
  font-weight: 700;
  cursor: pointer;
}
button:hover { filter: brightness(0.96); }
.actions-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.btn-secondary {
  background: #e7f5ff;
  color: #075b87;
  border: 1px solid #b8dbef;
}
.btn-secondary[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
}
.checkbox input { width: 18px; height: 18px; }

.status {
  margin-top: 10px;
  font-family: 'IBM Plex Mono', monospace;
  color: #0d6f9f;
}

.kpis {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}
.archive-list {
  display: grid;
  gap: 8px;
}
.archive-empty {
  margin-top: 8px;
  color: #5e6f7f;
  font-size: 0.9rem;
}
.archive-item {
  border: 1px solid #d4e8f6;
  border-radius: 12px;
  background: #fbfeff;
  padding: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.archive-title {
  font-weight: 700;
  color: #0b5178;
}
.archive-meta {
  font-size: 0.82rem;
  color: #597184;
}
.archive-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.archive-actions button {
  margin: 0;
  padding: 7px 10px;
}
.archive-actions a {
  text-decoration: none;
  border: 1px solid #b8dbef;
  background: #e7f5ff;
  color: #075b87;
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 0.85rem;
  font-weight: 700;
}
.archive-view {
  margin-top: 12px;
  border-top: 1px dashed #cfe3f2;
  padding-top: 12px;
}
.archive-view h3 {
  margin: 0 0 8px;
}
.archive-block {
  margin-top: 10px;
  border: 1px solid #d9eaf6;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.kpi {
  background: linear-gradient(120deg, #ffffff, #f4fbff);
  border: 1px solid #c7e4f5;
  border-radius: 14px;
  padding: 14px;
}
.kpi .label {
  font-size: 0.86rem;
  color: #50535e;
}
.kpi .value {
  margin-top: 4px;
  font-size: 1.2rem;
  font-weight: 700;
  color: #005e95;
  line-height: 1.25;
  word-break: break-word;
}
.kpi-meta {
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4f6477;
}

.chart-wrap {
  background: #fff;
  border: 1px solid #c7e4f5;
  border-radius: 12px;
  padding: 10px;
  height: 340px;
  min-height: 340px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}
.chart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #0f476d;
  margin-bottom: 6px;
  font-size: 0.92rem;
}
.chart-wrap canvas {
  width: 100% !important;
  max-width: 100% !important;
  height: 290px !important;
  display: block;
}

.diagnosis {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
}
.diagnosis-panel {
  background: linear-gradient(180deg, #f8fcff 0%, #ffffff 48%);
  border-color: #cfe6f5;
}
.diagnosis-panel h2 {
  margin-bottom: 10px;
  color: #0b537b;
}
.diag-help {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d9eaf6;
  background: #f7fcff;
  color: #315f7d;
  font-size: 0.9rem;
  line-height: 1.45;
}
.diag-help strong {
  color: #0d5b85;
}
.diag-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
  background: #f2f9ff;
  border: 1px solid #d7eaf7;
  border-radius: 12px;
  padding: 8px 10px;
}
.diag-active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.diag-chip {
  border: 1px solid #cce4f2;
  border-radius: 999px;
  background: #f6fbff;
  color: #19577b;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 600;
}
.diag-grid {
  margin-top: 10px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}
.diag-group {
  border: 1px solid #d6e8f4;
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(8, 83, 124, 0.05);
  position: relative;
}
.diag-group::before {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, #0ea4dc, #71c8ee);
}
.diag-group h3 {
  margin: 0 0 10px;
  color: #0f5279;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.diag-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.diag-kv-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.diag-kv {
  border: 1px solid #dbeaf4;
  border-radius: 10px;
  background: #fbfeff;
  padding: 8px 10px;
}
.diag-kv span {
  display: block;
  font-size: 0.78rem;
  color: #5c6c7d;
}
.diag-kv strong {
  display: block;
  margin-top: 2px;
  font-size: 0.9rem;
  color: #134f75;
  word-break: break-word;
}
.diag-section-title {
  margin: 10px 0 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f5279;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.diag-note {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fff9e8;
  border: 1px solid #f1deaa;
  color: #79500f;
}
.diagnosis-panel .field > span {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4b6a82;
}
.diagnosis-panel .field {
  min-width: 0;
}
.diagnosis-panel .field select,
.diagnosis-panel .field input {
  width: 100%;
  min-width: 0;
  border-color: #cde3f2;
  background: #fbfeff;
  min-height: 40px;
}
.diagnosis-panel .checkbox {
  margin-top: 10px;
}
.diagnosis-panel button {
  min-height: 40px;
}
.table-wrap {
  margin-top: 12px;
  overflow: auto;
  border: 1px solid #d7e9f6;
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 1px 0 #f5fbff;
}
.diag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.diag-table th,
.diag-table td {
  border-bottom: 1px solid #e6eef4;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
}
.diag-table th {
  position: sticky;
  top: 0;
  background: #eaf7ff;
  z-index: 1;
}
.diag-table tr.row-code_match td { background: #e9f8ff; }
.diag-table tr.row-time_match td { background: #fff9e6; }
.diag-table tr.row-no_spot td { background: #fff1ef; }

.table-pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
  background: #f8fcff;
  border: 1px solid #d7eaf7;
  border-radius: 10px;
  padding: 8px 10px;
}
.table-pager button {
  margin: 0;
  padding: 8px 12px;
  min-height: 38px;
}
.pager-size {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pager-size select { min-width: 90px; }
#diagPageInfo {
  min-width: 150px;
}

.insights { line-height: 1.45; }
.insight-shell { display: grid; gap: 12px; }
.insight-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.insight-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  padding: 12px;
}
.insight-card.primary {
  background: linear-gradient(120deg, #eef9ff, #fff);
  border-color: #bfe4f8;
}
.insight-card.good {
  background: linear-gradient(120deg, #ecf8ff, #fff);
  border-color: #c5e8fb;
}
.insight-card.warn {
  background: linear-gradient(120deg, #fff9e8, #fff);
  border-color: #f4e0ab;
}
.insight-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.insight-icon {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  background: #f3ede1;
  color: #674c27;
}
.insight-value {
  margin-top: 6px;
  font-size: 1.25rem;
  font-weight: 700;
}
.insight-sub {
  margin-top: 4px;
  color: #555d6a;
  font-size: 0.9rem;
}
.insight-rec-list {
  margin: 6px 0 0 18px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.insight-rec-list li {
  line-height: 1.45;
}
.insight-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.insight-pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.insight-pill {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.82rem;
}
.insight-pill strong { margin-left: 4px; }
.insight-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.insight-tab {
  border: 1px solid #d7d0c3;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 600;
}
.insight-tab.active {
  background: #007fba;
  color: #fff;
  border-color: #007fba;
}
.insight-dynamic {
  border: 1px dashed #c9c2b7;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.insight-flag {
  display: inline-block;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 700;
}
.insight-flag.ok { background: #e8f6f2; color: #14564f; }
.insight-flag.warn { background: #fff1dc; color: #8d5620; }

.hint {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e3f3fb;
  color: #0f6695;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: help;
}

.bg-shape {
  position: fixed;
  z-index: 1;
  opacity: 0.35;
  pointer-events: none;
}
.bg-shape-1 {
  width: 360px;
  height: 360px;
  top: -120px;
  right: -60px;
  border-radius: 38% 62% 55% 45%;
  background: linear-gradient(120deg, #6fd3ff, #c6f0ff);
}
.bg-shape-2 {
  width: 300px;
  height: 300px;
  bottom: -90px;
  left: -80px;
  border-radius: 59% 41% 66% 34%;
  background: linear-gradient(120deg, #ffe27f, #fff3c6);
}

@media (max-width: 860px) {
  .grid.two, .grid.three, .kpis { grid-template-columns: 1fr; }
  .checkbox { margin-top: 0; }
  .insight-kpi-grid, .insight-row { grid-template-columns: 1fr; }
  .diag-grid { grid-template-columns: 1fr; }
  .diag-kv-grid, .diag-kv-grid.compact { grid-template-columns: 1fr; }
  .chart-wrap {
    height: 300px;
    min-height: 300px;
  }
  .chart-wrap canvas {
    height: 248px !important;
  }
}
