:root{
  --bg:#0b1220;
  --panel:#111827;
  --panel-2:#0f172a;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --accent:#2563eb;
  --ok:#22c55e;
  --warn:#f59e0b;
  --high:#ef4444;
  --mid:#3b82f6;
  --low:#10b981;
  --chip:#1f2937;
  --tile:#0f172a;
  --border:#1f2937;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font:14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color:var(--text);
  background:linear-gradient(180deg,var(--bg),#060a13 60%);
}

.topbar{
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 20px; border-bottom:1px solid var(--border); background:rgba(0,0,0,.25); backdrop-filter:saturate(140%) blur(6px);
  position:sticky; top:0; z-index:3;
}
.topbar h1{ margin:0; font-size:18px; font-weight:700; }
.actions{ display:flex; gap:8px; flex-wrap:wrap; justify-content: end;}
.actions .btn-secondary,
.btn-secondary{
  background:#334155; color:white; border:0; border-radius:8px; padding:10px 14px; font-weight:600; cursor:pointer;
}
.actions #btn-notify{
  background:var(--accent); color:white; border:0; border-radius:8px; padding:10px 14px; font-weight:600; cursor:pointer;
}
.actions button:hover, .btn-secondary:hover{ filter:brightness(1.05); }
.btn-secondary.small{ padding:8px 10px; font-size:12px; }

.container{ max-width:1200px; margin:20px auto; padding:0 16px; }

.tiles{
  display:grid;
  grid-template-columns:repeat(5, minmax(140px, 1fr));
  gap:12px;
}
.tile{
  background:var(--tile);
  border:1px solid var(--border);
  border-radius:12px;
  padding:14px;
  display:flex; flex-direction:column; gap:6px;
}
.tile .label{ color:var(--muted); font-size:12px; }
.tile .value{ font-size:28px; font-weight:800; letter-spacing:.5px; }
.tile.total .value{ color:var(--mid); }
.tile.critical .value{ color:var(--high); }
.tile.high .value{ color:#fb7185; }
.tile.medium .value{ color:var(--warn); }
.tile.low .value{ color:var(--low); }

.card{
  margin-top:22px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}
.card-head{
  display:flex; align-items:center; gap:10px; padding:12px 14px;
  background:var(--panel-2); border-bottom:1px solid var(--border);
}
.card-head h2{ margin:0; font-size:16px; }
.card-head .muted{ color:var(--muted); }
.spacer{ flex:1; }

.toolbar{ margin-left:auto; display:flex; align-items:center; gap:12px; }
.legend{ display:flex; align-items:center; gap:8px; color:var(--muted); }
.legend .dot{ width:10px; height:10px; border-radius:50%; display:inline-block; background:var(--mid); }
.legend .dot.total{ background:var(--mid); }

.ranges{ display:flex; gap:6px; }
.range-btn{
  background:#1f2937; color:#d1d5db; border:1px solid var(--border);
  padding:6px 10px; border-radius:999px; cursor:pointer; font-weight:600; font-size:12px;
}
.range-btn.is-active{ background:var(--accent); color:white; border-color:transparent; }

.chart-wrap{ padding:8px 10px 14px; }

.table-wrap{
  margin-top:22px;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:12px;
  overflow:hidden;
}
.table-head{
  display:flex; justify-content:space-between; align-items:center;
  padding:12px 14px; background:var(--panel-2); border-bottom:1px solid var(--border);
}
.table-head h2{ margin:0; font-size:16px; }
.filter select{
  background:var(--chip); color:var(--text); border:1px solid var(--border);
  padding:6px 8px; border-radius:8px;
}
.table-scroll{ overflow:auto; max-height:60vh; }
table.data{ width:100%; border-collapse:separate; border-spacing:0; }
table.data thead th{
  position:sticky; top:0; z-index:1;
  background:var(--panel-2);
  text-align:left; padding:10px 12px; border-bottom:1px solid var(--border);
  font-weight:600; color:var(--muted);
}
table.data tbody td{
  padding:10px 12px; border-bottom:1px solid var(--border);
}
.sev-chip{
  display:inline-block; padding:4px 8px; border-radius:999px; font-weight:700; font-size:12px;
  background:var(--chip);
}
.sev-critical{ color:var(--high); }
.sev-high{ color:#fb7185; }
.sev-medium{ color:var(--warn); }
.sev-low{ color:var(--low); }

.history{
  list-style:none; margin:0; padding:0;
  max-height:360px; overflow:auto;
}
.history li{
  display:flex; align-items:center; gap:10px;
  padding:10px 14px; border-bottom:1px solid var(--border);
}
.badge{ font-size:12px; padding:2px 8px; border-radius:999px; background:var(--chip); }
.badge.critical{ color:var(--high); }
.badge.high{ color:#fb7185; }
.badge.medium{ color:var(--warn); }
.badge.low{ color:var(--low); }
.time{ color:var(--muted); min-width:120px; font-variant-numeric:tabular-nums; }

.footer{
  padding:20px; text-align:center; color:var(--muted);
  border-top:1px solid var(--border); margin-top:26px;
}
.status-dot{
  display:inline-flex; align-items:center; gap:8px;
  font-weight:700; font-size:12px; padding:4px 10px; border-radius:999px;
  background:var(--chip); border:1px solid var(--border);
}
.status-up{ color:var(--low); }        /* зелёный */
.status-degraded{ color:var(--warn); } /* жёлтый  */
.status-down{ color:var(--high); }     /* красный  */
.status-unknown{ color:#94a3b8; }      /* серый    */

.action-btn{
  background:#1f2937; color:#e5e7eb; border:1px solid var(--border);
  padding:6px 10px; border-radius:8px; cursor:pointer; font-size:12px; font-weight:600;
}
.action-btn:hover{ filter:brightness(1.05); }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
}

.topbar .actions {
  flex: 0 0 60%;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar .logo {
  flex: 0 0 40%;
  display: flex;
  align-items: center;      /* центрируем по вертикали */
  justify-content: flex-end;
  gap: 10px;                /* отступ между картинкой и надписью */
}

.topbar .logo img {
  max-height: 40px;
  height: auto;
  width: auto;
}

.topbar .logo h3 {
  margin: 0;
  font-size: 20px;
  color: #e5e7eb;           /* можно настроить под тему */
}


/* Адаптив */
@media (max-width: 900px){
  .tiles{ grid-template-columns:repeat(3, 1fr); }
}
@media (max-width: 520px){
  .tiles{ grid-template-columns:repeat(2, 1fr); }
}
