:root {
  --bg-top: #031a34;
  --bg-mid: #0b4076;
  --bg-bottom: #2195c8;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-deep: rgba(8, 32, 63, 0.8);
  --ink: #08233f;
  --ink-soft: #355777;
  --line: rgba(255, 255, 255, 0.24);
  --ok: #18a558;
  --warn: #ffb238;
  --danger: #e34848;
  --danger-deep: #b61111;
  --accent: #1e74ff;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  min-height: 100%;
  color: #fff;
  background: linear-gradient(180deg, var(--bg-top), var(--bg-mid) 45%, var(--bg-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.15), transparent 30%),
    radial-gradient(circle at 90% 30%, rgba(255, 255, 255, 0.08), transparent 35%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1150px;
  margin: 0 auto;
  padding: 18px 14px 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand h1 {
  margin: 0;
  font-size: clamp(1.1rem, 1.6vw, 1.45rem);
}

.brand p {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.9;
}

.status-strip {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  background: rgba(3, 27, 55, 0.5);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.dot.ok {
  background: var(--ok);
}

.dot.warn {
  background: var(--warn);
}

.dot.danger {
  background: var(--danger);
}

.tabs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  padding: 9px 8px;
  cursor: pointer;
}

.tab.active {
  background: #fff;
  color: var(--ink);
}

.section {
  display: none;
  margin-top: 14px;
}

.section.active {
  display: block;
}

.panel {
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow);
}

.panel + .panel {
  margin-top: 12px;
}

h2,
h3 {
  margin: 0 0 10px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.input,
.select,
.textarea,
.button {
  width: 100%;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #c7d7e8;
  font: inherit;
}

.textarea {
  min-height: 130px;
  resize: vertical;
}

.button {
  border: 0;
  background: linear-gradient(135deg, #2a83ff, #0f3ea4);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.button.alt {
  background: #f1f6fc;
  color: var(--ink);
  border: 1px solid #c7d7e8;
}

.row {
  display: flex;
  gap: 10px;
}

.row > * {
  flex: 1;
}

.risk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.risk.safe {
  background: #dcf5e7;
  color: #19653e;
}

.risk.caution {
  background: #fff4dc;
  color: #9c5f00;
}

.risk.likely,
.risk.confirmed {
  background: #fde0e0;
  color: #9e1212;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kpi {
  background: rgba(7, 28, 53, 0.88);
  border-radius: 14px;
  padding: 12px;
}

.kpi span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.85;
}

.kpi strong {
  font-size: 1.4rem;
}

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

.item {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #c9d8e8;
  background: #fff;
}

.item .meta {
  font-size: 0.78rem;
  color: var(--ink-soft);
  display: flex;
  justify-content: space-between;
}

.item h4 {
  margin: 8px 0 6px;
}

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  background: #dbeaff;
  color: #2458b3;
}

canvas {
  width: 100%;
  height: 220px;
  background: #f8fcff;
  border-radius: 12px;
  border: 1px solid #d3e2ef;
}

.banner {
  border-radius: 12px;
  border: 1px solid #dfc79a;
  background: #fff2db;
  color: #825100;
  padding: 8px 10px;
  font-size: 0.84rem;
  margin-bottom: 10px;
}

.hide {
  display: none;
}

@media (max-width: 900px) {
  .tabs {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid,
  .kpis {
    grid-template-columns: 1fr;
  }
  .row {
    flex-direction: column;
  }
}
