/* MikroTik İzleme — koyu tema.
   Bölümler: 1 belirteçler · 2 temel · 3 form öğeleri · 4 yerleşim/menü · 5 başlık, rozet, uyarı
   6 kutucuk/kart · 7 tablo · 8 sekme ve küçük bileşenler · 9 grafik (uPlot) · 10 giriş · 11 dar ekran */

/* ---- 1. belirteçler --------------------------------------------------- */
:root {
  color-scheme: dark;
  /* yüzeyler: koyudan açığa dört kademe */
  --bg: #0a0e14; --panel: #121821; --panel2: #1a222e; --panel3: #232d3b; --inset: #0e131b;
  --line: #263142; --line-soft: #1b2431; --line-strong: #34425a;
  --text: #e4eaf2; --text2: #b9c3d1; --muted: #8e9bae; --faint: #5d6a7d;
  --accent: #5b9df5; --accent-strong: #7fb4ff; --accent-ink: #06121f;
  /* seriler (CVD doğrulamalı: mavi ↔ macenta; mor tek başına çizilir) */
  --in: #3987e5; --out: #d95f9f; --und: #9085e9;
  /* durum renkleri: serilerden ayrı tutulur */
  --ok: #3cc37f; --warn: #eeb23c; --crit: #f26464;
  --grid: #222c3b; --axis: #7f8ca0;
  --r-sm: 5px; --r: 8px; --r-lg: 12px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 1px 2px rgba(0,0,0,.35);
  --shadow-pop: 0 12px 32px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.4);
  --ctl-h: 32px;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Inter", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --chev: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%238e9bae' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><path d='M4 6.5l4 4 4-4'/></svg>");
}

/* ---- 2. temel --------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; color: var(--text); font: 14px/1.5 var(--sans);
  background: var(--bg) radial-gradient(1100px 520px at 85% -160px, rgba(57,135,229,.07), transparent 70%) no-repeat fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }
::selection { background: rgba(91,157,245,.35); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .93em; font-variant-ligatures: none; }
.spacer { flex: 1; }

/* ---- 3. form öğeleri -------------------------------------------------- */
button, select, input, textarea {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-sm); transition: border-color .12s, background-color .12s, box-shadow .12s;
}
button, select, input:not([type=checkbox]):not([type=radio]):not([type=file]) { height: var(--ctl-h); padding: 0 12px; }
button {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap; font-weight: 500; background: linear-gradient(var(--panel3), var(--panel2));
  box-shadow: 0 1px 1px rgba(0,0,0,.25);
}
button:hover { border-color: var(--line-strong); background: var(--panel3); }
button:active { background: var(--panel2); box-shadow: none; }
button.on {
  background: color-mix(in srgb, var(--accent) 20%, var(--panel2)); border-color: color-mix(in srgb, var(--accent) 65%, var(--line));
  color: #dbeaff; font-weight: 600; box-shadow: none; position: relative; z-index: 1;
}
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button:disabled, button.primary:disabled { opacity: .45; cursor: default; pointer-events: none; }
a > button { vertical-align: middle; }

input:not([type=checkbox]):not([type=radio]):not([type=file]), textarea { background: var(--inset); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--line-strong); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,157,245,.22);
}
input[type=text], input[type=search], textarea { width: 100%; }
input[type=datetime-local] { color-scheme: dark; font-variant-numeric: tabular-nums; }
textarea { padding: 8px 10px; min-height: 72px; line-height: 1.45; resize: vertical; display: block; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 30px; cursor: pointer; max-width: 100%;
  background: var(--panel2) var(--chev) no-repeat right 8px center / 14px;
}
select option { background: var(--panel2); color: var(--text); }
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 4px; background: var(--inset) center / 12px no-repeat; vertical-align: -3px;
}
input[type=checkbox]:checked {
  background-color: var(--accent); border-color: var(--accent);
  background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%2306121f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M2.5 6.2l2.3 2.3 4.7-5'/></svg>");
}
input[type=file] { border: 1px dashed var(--line-strong); background: var(--inset); padding: 8px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-weight: 500; color: var(--text); background: var(--panel3); border: 1px solid var(--line);
  border-radius: var(--r-sm); height: 28px; padding: 0 12px; margin-right: 12px; cursor: pointer;
}
label { cursor: pointer; }
details { margin: var(--s2) 0; }
summary { cursor: pointer; color: var(--text2); padding: 6px 0; font-weight: 500; }
summary:hover { color: var(--text); }

/* ---- 4. yerleşim ve menü ---------------------------------------------- */
.layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100%; }
nav {
  background: linear-gradient(180deg, #111822, #0e141c); border-right: 1px solid var(--line-soft);
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--s4) var(--s3) var(--s3);
}
nav h1 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 var(--s4); padding: 2px 6px var(--s4);
  font-size: 14px; font-weight: 650; letter-spacing: .01em; line-height: 1.25; border-bottom: 1px solid var(--line-soft);
}
nav h1 .mark { width: 30px; height: 30px; flex: none; }
nav h1 > span { min-width: 0; }
nav h1 small {
  display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; letter-spacing: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#menu { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
nav a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--text2); font-weight: 500; position: relative; white-space: nowrap; flex: none;
}
nav a::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor; opacity: .7;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat;
  --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M4 11V7.5a4 4 0 0 1 8 0V11l1.2 1.6H2.8zM6.7 14.2h2.6'/></svg>");
}
nav a[href="#/trafik"]::before { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M1.5 8.5h2.6l2-5.5 3.2 10 2-4.5h3.2'/></svg>"); }
nav a[href="#/p95"]::before { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M3.5 12.5V9M8 12.5V6M12.5 12.5V3M1.5 14.2h13'/></svg>"); }
nav a[href="#/envanter"]::before { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linejoin='round'><path d='M2.5 2.5h4.2v4.2H2.5zM9.3 2.5h4.2v4.2H9.3zM2.5 9.3h4.2v4.2H2.5zM9.3 9.3h4.2v4.2H9.3z'/></svg>"); }
nav a[href="#/musteriler"]::before { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><circle cx='8' cy='5.2' r='2.7'/><path d='M2.5 13.8c.6-2.4 2.8-3.6 5.5-3.6s4.9 1.2 5.5 3.6'/></svg>"); }
nav a[href="#/guvenlik"]::before { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M8 1.8l5 1.9v3.8c0 3.2-2.1 5.6-5 6.7-2.9-1.1-5-3.5-5-6.7V3.700z'/><path d='M5.800 8l1.600 1.600 2.900-3.100'/></svg>"); }
nav a[href="#/yetenekler"]::before { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'><path d='M2.500 4h.8M6 4h7.500M2.500 8h.8M6 8h7.500M2.500 12h.8M6 12h7.500'/></svg>"); }
nav a[href="#/sim"]::before { --i: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round'><path d='M2 4.500h6M11.500 4.500H14M2 11.500h2.500M8 11.500h6M9.700 2.800v3.400M6.200 9.800v3.400'/></svg>"); }
nav a:hover { background: var(--panel2); color: var(--text); text-decoration: none; }
nav a.active { background: color-mix(in srgb, var(--accent) 14%, transparent); color: #fff; }
nav a.active::before { opacity: 1; background: var(--accent-strong); }
nav a.active::after {
  content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
nav a .badge { margin-left: auto; float: none !important; min-width: 22px; text-align: center; padding: 0 6px; }
nav .foot {
  margin-top: var(--s3); padding: var(--s3) 6px 0; border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: var(--s2);
}
nav .foot .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav .foot .who:not(:empty)::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 7px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent);
}
nav .foot button { height: 28px; padding: 0 10px; font-size: 12px; }

main { padding: 0 var(--s6) 56px; min-width: 0; max-width: 1760px; }
#banners { padding-top: var(--s4); }
#banners:empty { padding-top: 0; }

/* ---- 5. sayfa başlığı, rozet, uyarı ------------------------------------ */
.top {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 10px 12px; align-items: center; flex-wrap: wrap;
  margin: 0 calc(-1 * var(--s6)) var(--s4); padding: 14px var(--s6); min-height: 60px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(10px) saturate(1.3); backdrop-filter: blur(10px) saturate(1.3);
  border-bottom: 1px solid var(--line-soft); color: var(--text2);
}
.top h2 { margin: 0 6px 0 0; font-size: 19px; font-weight: 650; letter-spacing: -.01em; color: var(--text); line-height: 1.3; }
.top .muted { font-size: 12.5px; font-variant-numeric: tabular-nums; }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; line-height: 18px;
  border: 1px solid var(--line); background: var(--panel2); color: var(--muted); white-space: nowrap;
  font-variant-numeric: tabular-nums; vertical-align: baseline;
}
.badge.ok   { color: #6fdca4; border-color: color-mix(in srgb, var(--ok) 34%, transparent);   background: color-mix(in srgb, var(--ok) 12%, transparent); }
.badge.warn { color: #f6c768; border-color: color-mix(in srgb, var(--warn) 36%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge.crit { color: #ff8f8f; border-color: color-mix(in srgb, var(--crit) 40%, transparent); background: color-mix(in srgb, var(--crit) 14%, transparent); }
.badge.info { color: #8fc0ff; border-color: color-mix(in srgb, var(--accent) 38%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.badge.mono { font-size: 11px; }

.banner {
  position: relative; padding: 10px 14px 10px 40px; border-radius: var(--r); margin-bottom: var(--s3); line-height: 1.5;
  background: color-mix(in srgb, var(--warn) 9%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 30%, var(--line));
  color: #f3d590;
}
.banner::before {
  content: ""; position: absolute; left: 13px; top: 12px; width: 16px; height: 16px; background: var(--warn);
  -webkit-mask: var(--bi) center / contain no-repeat; mask: var(--bi) center / contain no-repeat;
  --bi: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'><path d='M8 2.200l6.300 11.300H1.700zM8 6.600v3.200M8 11.700v.1'/></svg>");
}
.banner.crit { background: color-mix(in srgb, var(--crit) 10%, var(--panel)); border-color: color-mix(in srgb, var(--crit) 36%, var(--line)); color: #ffb3ad; }
.banner.crit::before { background: var(--crit); }
.banner a { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }

.bar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin-bottom: var(--s4); color: var(--text2); }
.bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.bar > label { display: inline-flex; align-items: center; gap: 6px; margin-left: 6px; }
/* yan yana düğmeler tek parça (segment) gibi görünür */
.bar > button + button { margin-left: calc(-1 * var(--s2) - 1px); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar > button:has(+ button) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar > button { font-variant-numeric: tabular-nums; min-width: 44px; }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: var(--s2) 0; }

/* ---- 6. kutucuklar ve kartlar ------------------------------------------ */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.tile, .card {
  background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r); box-shadow: var(--shadow);
}
.tile { padding: 12px 14px 12px 16px; position: relative; overflow: hidden; min-width: 0; }
.tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.tile .k {
  color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile .v {
  font-size: 24px; font-weight: 650; line-height: 1.25; margin: 4px 0 2px; letter-spacing: -.015em;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1, "zero" 0;
}
.tile .s { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1.4; }
.tile.ok::before { background: var(--ok); } .tile.warn::before { background: var(--warn); } .tile.crit::before { background: var(--crit); }
.tile.warn { background: linear-gradient(90deg, color-mix(in srgb, var(--warn) 7%, var(--panel)), var(--panel) 60%); }
.tile.crit { background: linear-gradient(90deg, color-mix(in srgb, var(--crit) 9%, var(--panel)), var(--panel) 60%); }
.tile.warn .v { color: #f6c768; } .tile.crit .v { color: #ff8f8f; }
.tiles > .empty { grid-column: 1 / -1; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; vertical-align: 0; }
.card .tiles .tile { background: var(--panel2); box-shadow: none; }

.card { padding: 14px var(--s4); margin-bottom: var(--s4); overflow-x: auto; }
.card:empty { display: none; }
.card h3 {
  margin: 0 0 var(--s3); font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .005em;
  display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap;
}
.card h3 .badge { font-weight: 400; }
.chart { width: 100%; position: relative; }
.empty { color: var(--muted); padding: 36px var(--s4); text-align: center; font-size: 13px; }

.meter { height: 8px; background: var(--inset); border-radius: 999px; overflow: hidden; margin: 10px 0 6px; box-shadow: inset 0 0 0 1px var(--line-soft); }
.meter > div { height: 100%; background: var(--ok); border-radius: 999px; min-width: 4px; transition: width .3s; }
.meter.warn > div { background: var(--warn); } .meter.crit > div { background: var(--crit); }

.blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.blocks .tile .k { text-transform: none; letter-spacing: 0; font-family: var(--mono); font-size: 12px; font-weight: 500; }
.grid { display: grid; grid-template-columns: repeat(32, 1fr); gap: 2px; margin-top: 10px; padding: 6px; background: var(--inset); border-radius: var(--r-sm); }
.grid i { display: block; aspect-ratio: 1; border-radius: 1.5px; background: #222b39; }
.grid i.used { background: var(--ok); } .grid i.silent { background: var(--crit); }
.grid i:hover { outline: 1.5px solid #fff; outline-offset: 0; position: relative; z-index: 1; }

/* ---- 7. tablolar ------------------------------------------------------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
th {
  color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
  position: sticky; top: 0; z-index: 1; background: var(--panel2); border-bottom-color: var(--line); padding-top: 8px; padding-bottom: 8px;
}
td.num, th.num { text-align: right; white-space: nowrap; }
td { vertical-align: top; }
tbody tr:nth-child(even) td { background: rgba(255,255,255,.014); }
tbody tr:hover td { background: var(--panel2); }
tbody tr:last-child td { border-bottom: 0; }
tr.group td, tbody tr.group:hover td {
  background: var(--inset); color: var(--muted); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  padding-top: 7px; padding-bottom: 7px; border-bottom-color: var(--line);
}
/* tablo kaydırma kutusu: başlık satırı dikeyde sabit kalır */
.scroll { overflow: auto; max-height: min(72vh, 900px); }
.card > .scroll, .card > table { margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); }
.card > table { width: calc(100% + 2 * var(--s4)); }
.card > .scroll:last-child, .card > table:last-child { margin-bottom: -14px; }
.card > .scroll:first-child, .card > table:first-child { margin-top: -14px; }
.card > .scroll th:first-child, .card > .scroll td:first-child, .card > table th:first-child, .card > table td:first-child { padding-left: var(--s4); }
.card > .scroll th:last-child, .card > .scroll td:last-child, .card > table th:last-child, .card > table td:last-child { padding-right: var(--s4); }
details > .scroll { border: 1px solid var(--line-soft); border-radius: var(--r-sm); max-height: 320px; }

/* ---- 8. sekmeler ve küçük bileşenler ----------------------------------- */
.tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: var(--s4); }
.tabs button {
  border: 0; border-bottom: 2px solid transparent; border-radius: var(--r-sm) var(--r-sm) 0 0; background: none; box-shadow: none;
  color: var(--muted); height: 38px; padding: 0 14px; margin-bottom: -1px; font-weight: 500;
}
.tabs button:hover { color: var(--text); background: var(--panel2); }
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); background: none; font-weight: 600; }
.tabs .cnt {
  background: var(--panel3); border-radius: 999px; padding: 0 7px; font-size: 11px; line-height: 18px; color: var(--text2);
  font-weight: 500; font-variant-numeric: tabular-nums;
}
.tabs button.on .cnt { background: color-mix(in srgb, var(--accent) 24%, var(--panel2)); color: #dbeaff; }

.switch { display: flex; align-items: center; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.switch:first-child { padding-top: 2px; } .switch:last-child { border-bottom: 0; padding-bottom: 2px; }
.switch .t { flex: 1; min-width: 0; }
.switch button { min-width: 64px; }

.st { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; background: #46526a; }
.st.used { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.st.silent { background: var(--crit); box-shadow: 0 0 0 3px color-mix(in srgb, var(--crit) 18%, transparent); }
span:has(> .st) { white-space: nowrap; }
.note { cursor: pointer; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-radius: 4px; }
.note:hover { color: var(--text); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: 0; }
.kv dt { color: var(--muted); font-size: 12.5px; } .kv dd { margin: 0; word-break: break-word; font-variant-numeric: tabular-nums; }
pre.diff {
  margin: 6px 0 0; padding: 6px 9px; font: 12px/1.5 var(--mono); color: var(--text2); white-space: pre-wrap; word-break: break-word;
  background: var(--inset); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
}
td > pre.diff:first-child { margin-top: 0; }

.ev {
  display: grid; grid-template-columns: 150px 72px minmax(0, 1fr) auto; gap: var(--s3); align-items: start;
  padding: 11px var(--s4) 11px calc(var(--s4) + 3px); margin: 0 calc(-1 * var(--s4)); border-bottom: 1px solid var(--line-soft); position: relative;
}
.ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent; }
.ev:has(> div > .badge.crit)::before { background: var(--crit); }
.ev:has(> div > .badge.warn)::before { background: var(--warn); }
.ev:has(> div > .badge.info)::before { background: color-mix(in srgb, var(--accent) 60%, transparent); }
.ev:hover { background: rgba(255,255,255,.02); }
.ev:first-child { margin-top: -14px; } .ev:last-child { border-bottom: 0; margin-bottom: -14px; }
.ev .t { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.ev.closed { opacity: .62; } .ev.closed::before { opacity: .5; }
.ev button { height: 28px; font-size: 12.5px; }

dialog {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px;
  width: min(720px, 94vw); max-height: 88vh; overflow: auto; box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(4,7,12,.66); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog h3 { margin: 0 0 14px; font-size: 16px; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
dialog h3 ~ h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; margin-top: 18px !important; }
dialog h3 > span:not(.mono) { font-size: 13px; font-weight: 400; color: var(--text2); }
dialog .scroll { max-height: 220px; border: 1px solid var(--line-soft); border-radius: var(--r-sm); }
dialog > .row:last-child { margin: 18px 0 0; }

/* ---- 9. grafik (uPlot) -------------------------------------------------- */
.chart .uplot { display: flex; flex-direction: column-reverse; width: 100%; font-family: inherit; color: var(--text); line-height: 1.5; }
.u-legend { color: var(--text2); font-family: inherit; font-size: 12px; text-align: right; margin: -30px 0 6px auto; padding: 0; width: auto; }
.u-legend.u-inline tr { margin: 0 0 0 6px; }
.u-legend .u-series {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel2); user-select: none;
}
.u-legend .u-series:hover { border-color: var(--line-strong); }
.u-legend .u-series > * { padding: 0; }
.u-legend .u-series th {
  font-weight: 500; font-size: 12px; display: inline-flex; align-items: center; cursor: pointer; position: static; background: none;
  border: 0; color: inherit; text-transform: none; letter-spacing: 0;
}
.u-legend .u-marker { width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; border: 0 !important; }
.u-legend .u-value { font-variant-numeric: tabular-nums; }
.u-legend .u-series.u-off { opacity: .5; } .u-legend .u-series.u-off > * { opacity: 1; }
.u-legend .u-series.u-off th { text-decoration: line-through; }
.u-select { background: rgba(91,157,245,.14); border-left: 1px solid var(--accent); border-right: 1px solid var(--accent); }
.u-over { cursor: crosshair; }
.u-cursor-x { border-right: 1px solid rgba(228,234,242,.34); }
.u-cursor-y { border-bottom: 1px dashed rgba(228,234,242,.2); }
.u-cursor-pt { box-shadow: 0 0 0 1px rgba(0,0,0,.35); }

.chart-tip {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; min-width: 150px; max-width: 280px;
  padding: 8px 10px; border-radius: var(--r); background: color-mix(in srgb, var(--panel3) 94%, transparent);
  border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-size: 12px; line-height: 1.4; white-space: nowrap;
  will-change: transform;
}
.chart-tip .tt { color: var(--muted); font-size: 11px; margin-bottom: 5px; font-variant-numeric: tabular-nums; }
.chart-tip .tr { display: flex; align-items: center; gap: 7px; padding: 1.5px 0; color: var(--text2); }
.chart-tip .tr i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.chart-tip .tr b { margin-left: auto; padding-left: 14px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- 10. giriş sayfası --------------------------------------------------- */
body.auth { display: grid; place-items: center; padding: var(--s4);
  background: var(--bg) radial-gradient(900px 520px at 50% -80px, rgba(57,135,229,.13), transparent 70%) no-repeat fixed; }
.login {
  width: 100%; max-width: 360px; margin: 12vh auto; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 30px 28px 24px; box-shadow: var(--shadow-pop);
}
body.auth .login { margin: 0 auto 8vh; }
.login .mark { width: 40px; height: 40px; display: block; margin-bottom: 14px; }
.login h1 { font-size: 19px; font-weight: 650; letter-spacing: -.01em; margin: 0 0 20px; }
.login label { display: block; color: var(--muted); font-size: 12px; font-weight: 500; margin: 14px 0 6px; }
.login input:not([type=checkbox]) { width: 100%; height: 38px; padding: 0 12px; }
.login button {
  width: 100%; height: 38px; margin-top: 22px; background: var(--accent); color: var(--accent-ink); font-weight: 600;
  border-color: var(--accent); box-shadow: none;
}
.login button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.login .err { color: #ff8f8f; min-height: 20px; margin-top: 12px; font-size: 13px; }

/* ---- 11. dar ekran -------------------------------------------------------- */
@media (max-width: 800px) {
  :root { --s6: 14px; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  nav {
    position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    padding: 8px 12px 0; border-right: 0; border-bottom: 1px solid var(--line-soft);
  }
  nav h1 { margin: 0; padding: 0; border: 0; flex: 1; }
  nav h1 .mark { width: 26px; height: 26px; }
  nav h1 small, nav .foot .who { display: none; }
  nav .foot { margin: 0; padding: 0; border: 0; }
  #menu { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 2px; scrollbar-width: none; }
  #menu::-webkit-scrollbar { display: none; }
  nav a { height: 38px; padding: 0 10px; border-radius: 0; gap: 7px; }
  nav a.active { background: none; }
  nav a.active::after { left: 8px; right: 8px; top: auto; bottom: 0; width: auto; height: 2px; border-radius: 2px 2px 0 0; }
  nav a .badge { margin-left: 2px; }
  main { padding-bottom: 40px; }
  .top { padding-top: 10px; padding-bottom: 10px; min-height: 0; }
  .top h2 { font-size: 17px; }
  .tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s2); }
  .tile .v { font-size: 20px; }
  .ev { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .ev > button, .ev > .badge { justify-self: start; margin-top: 4px; }
  .u-legend { margin-top: 0; text-align: left; margin-left: 0; }
  .u-legend.u-inline tr { margin: 0 6px 0 0; }
  th, td { padding: 8px 10px; }
}
