/* Vektra Seal — "Gece lobisi" teması
   Fikir: otelin pirinç oda anahtarı ile kriptografik imza anahtarı aynı dilde.
   Pirinç (brass) = imza / ana anahtar gerektiren her şey. Turkuaz (lagün) = çevrimiçi, başarılı. */

@font-face { font-family: 'Bricolage'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/bricolage-grotesque-latin-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Bricolage'; font-style: normal; font-display: swap; font-weight: 200 800;
  src: url(fonts/bricolage-grotesque-latin-ext-opsz-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Instrument'; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%;
  src: url(fonts/instrument-sans-latin-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Instrument'; font-style: normal; font-display: swap; font-weight: 400 700; font-stretch: 75% 100%;
  src: url(fonts/instrument-sans-latin-ext-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'JBMono'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(fonts/jetbrains-mono-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'JBMono'; font-style: normal; font-display: swap; font-weight: 400;
  src: url(fonts/jetbrains-mono-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }

:root {
  /* gece lobisi */
  --night: #0a1620; --deep: #0e202d; --panel: #122a3a; --panel-2: #163246; --line: #21425a; --line-soft: #1a364a;
  --ink: #e7eef3; --mute: #8aa3b6; --faint: #5f7a8e;
  /* pirinç anahtar + lagün */
  --brass: #d6aa5c; --brass-hi: #f0cf8d; --brass-ink: #1d1406;
  --teal: #3dd5bf; --teal-ink: #04201b;
  --coral: #f2715c; --amber: #efb34a; --sky: #7fb2ff;
  --ok: var(--teal); --warn: var(--amber); --bad: var(--coral); --root: var(--brass);
  --r-shell: 20px; --r-card: 14px; --r-field: 10px; --r-chip: 6px;
  --display: 'Bricolage', 'Instrument', system-ui, sans-serif;
  --body: 'Instrument', system-ui, 'Segoe UI', sans-serif;
  --mono: 'JBMono', ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 15px/1.55 var(--body); color: var(--ink); background: var(--night);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background-image:
    radial-gradient(1200px 600px at 12% -10%, rgba(61, 213, 191, .10), transparent 60%),
    radial-gradient(900px 500px at 105% 10%, rgba(214, 170, 92, .09), transparent 60%),
    radial-gradient(rgba(138, 163, 182, .09) 1px, transparent 1.2px);
  background-size: auto, auto, 22px 22px;
  background-attachment: fixed;
}
::selection { background: rgba(214, 170, 92, .35); color: #fff; }
a { color: var(--teal); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 3.2vw, 34px); line-height: 1.1; margin: 0 0 6px; font-variation-settings: 'opsz' 96; }
h2 { font-size: 18px; margin: 0 0 14px; }
h3 { font-size: 15px; margin: 18px 0 8px; color: var(--ink); }
p { margin: 8px 0; max-width: 78ch; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
code { background: rgba(127, 178, 255, .08); border: 1px solid var(--line-soft); padding: 1px 6px; border-radius: 5px; }
.muted { color: var(--mute); } .small { font-size: 13px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------------------------------------------------------------- marka + mühür */
.brand { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.brand span { color: var(--brass); font-weight: 500; }
.brand .mark { width: 28px; height: 28px; flex: none; }
.mark .ring { fill: none; stroke: var(--brass); stroke-width: 2.2; }
.mark .v { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

/* giriş mührü: tek orkestre an — imza çizilir, halka döner, sonra durur */
.seal { width: 132px; height: 132px; display: block; margin: -4px auto 10px; overflow: visible; }
.seal .halo { fill: url(#sealGlow); }
.seal .outer { fill: none; stroke: var(--brass); stroke-width: 1.6; stroke-dasharray: 2 5; transform-origin: 66px 66px; animation: spin 40s linear infinite; }
.seal .inner { fill: rgba(214, 170, 92, .06); stroke: var(--brass); stroke-width: 1.2; }
.seal .sig { fill: none; stroke: var(--brass-hi); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1.6s .35s var(--ease) forwards; }
.seal .tick { fill: var(--brass); opacity: 0; animation: pop .5s 1.8s var(--ease) forwards; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- giriş ekranları */
.center-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 400px; padding: 30px 28px 26px; border-radius: var(--r-shell);
  background: linear-gradient(180deg, rgba(22, 50, 70, .92), rgba(14, 32, 45, .94));
  border: 1px solid var(--line); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(10px); animation: rise .6s var(--ease) both;
}
.auth-card .brand { justify-content: center; font-size: 24px; }
.auth-card > .muted:first-of-type { text-align: center; margin-top: 2px; }
.auth-card h2 { text-align: center; font-size: 22px; margin-top: 4px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- iskelet */
.layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.topbar { display: none; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px 18px;
  display: flex; flex-direction: column; gap: 16px;
  background: linear-gradient(180deg, rgba(14, 32, 45, .96), rgba(10, 22, 32, .98));
  border-right: 1px solid var(--line-soft);
}
.side .brand { padding: 0 8px; }
.side select { background: var(--panel); border-color: var(--line); font-weight: 600; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a {
  position: relative; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  color: var(--mute); font-weight: 550; transition: color .2s, background .2s;
}
.side nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .035); text-decoration: none; }
.nav-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; font-size: 12.5px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; background: var(--amber); color: #241703; }
.nav-count.bad { background: var(--coral); color: #2a0904; animation: breathe-bad 2.4s ease-in-out infinite; }
@keyframes breathe-bad { 50% { box-shadow: 0 0 14px rgba(242, 113, 92, .6); } }
.side nav a.on { color: var(--ink); background: linear-gradient(90deg, rgba(61, 213, 191, .14), rgba(61, 213, 191, .02)); }
.side nav a.on::before {
  content: ''; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--teal); box-shadow: 0 0 14px var(--teal);
}
.side .label { font-size: 12.5px; color: var(--faint); padding: 0 12px; margin-top: 10px; font-weight: 600; }
.side .user {
  margin-top: auto; padding: 14px; border-radius: var(--r-card); background: rgba(18, 42, 58, .7); border: 1px solid var(--line-soft);
  font-size: 13px; display: flex; flex-direction: column; gap: 6px;
}
.side .user .name { color: var(--ink); font-weight: 650; font-size: 14.5px; }
.side .user .small { color: var(--mute); word-break: break-all; }
.side .user button { width: 100%; }
main { padding: 34px clamp(18px, 3.4vw, 44px) 80px; min-width: 0; }
main.enter > * { animation: enter .42s var(--ease) both; }
main.enter > *:nth-child(2) { animation-delay: .04s; } main.enter > *:nth-child(3) { animation-delay: .08s; }
main.enter > *:nth-child(n+4) { animation-delay: .12s; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .muted { font-size: 15px; }

/* ---------------------------------------------------------------- yüzeyler */
.card {
  background: linear-gradient(180deg, rgba(22, 50, 70, .55), rgba(18, 42, 58, .55));
  border: 1px solid var(--line-soft); border-radius: var(--r-card); padding: 20px 22px; margin-bottom: 18px;
}
.card > h2:first-child { display: flex; align-items: center; gap: 10px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0; margin-bottom: 20px;
  border: 1px solid var(--line-soft); border-radius: var(--r-card); overflow: hidden; background: rgba(14, 32, 45, .6); }
.stat { padding: 16px 20px; border-right: 1px solid var(--line-soft); position: relative; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-family: var(--display); font-size: 34px; font-weight: 600; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { color: var(--mute); font-size: 13px; }
.stat:nth-child(2) b { color: var(--teal); }

.banner {
  border-radius: var(--r-card); padding: 13px 16px; margin-bottom: 18px; border: 1px solid; display: flex; gap: 12px;
  align-items: center; justify-content: space-between; flex-wrap: wrap; animation: enter .4s var(--ease) both;
}
.banner.warn { background: rgba(239, 179, 74, .08); border-color: rgba(239, 179, 74, .35); }
.banner.info { background: rgba(127, 178, 255, .07); border-color: rgba(127, 178, 255, .3); }
.banner.bad  { background: rgba(242, 113, 92, .08); border-color: rgba(242, 113, 92, .4); }
.banner.root { background: linear-gradient(90deg, rgba(214, 170, 92, .13), rgba(214, 170, 92, .04)); border-color: rgba(214, 170, 92, .45); }
.banner.small { font-size: 13.5px; padding: 9px 13px; }

/* ---------------------------------------------------------------- form */
label { display: block; font-weight: 600; font-size: 13px; margin: 14px 0 6px; color: #c9d7e2; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-field); font: inherit; font-size: 15px;
  background: rgba(10, 22, 32, .7); color: var(--ink); transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
select { appearance: none; padding-right: 34px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--mute) 50%), linear-gradient(135deg, var(--mute) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--deep); color: var(--ink); }
textarea { font-family: var(--mono); font-size: 13px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(61, 213, 191, .14); background: rgba(10, 22, 32, .9); }
input[type=checkbox], input[type=radio] { accent-color: var(--teal); width: 16px; height: 16px; flex: none; }
input[type=file] { padding: 8px; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 10px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink); cursor: pointer; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 450; margin: 8px 0; color: var(--ink); font-size: 14.5px; cursor: pointer; }
.check input { margin-top: 3px; }
.help, .check span .help { display: block; color: var(--mute); font-size: 13px; font-weight: 400; margin-top: 2px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline select, .inline input { width: auto; }
.err { color: var(--coral); font-size: 14px; margin-top: 12px; min-height: 18px; }
.err:not(:empty) { animation: shake .35s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }

/* ---------------------------------------------------------------- düğmeler */
button, a.button-link {
  --b-bg: var(--teal); --b-ink: var(--teal-ink); --b-glow: rgba(61, 213, 191, .35);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-size: 14.5px; font-weight: 650;
  cursor: pointer; background: var(--b-bg); color: var(--b-ink); white-space: nowrap;
  transition: transform .15s var(--ease), box-shadow .25s, filter .2s, background .2s;
}
button:hover:not(:disabled), a.button-link:hover { box-shadow: 0 8px 24px -8px var(--b-glow); filter: brightness(1.06); text-decoration: none; }
button:active:not(:disabled) { transform: translateY(1px) scale(.985); }
button.sec { --b-bg: rgba(255, 255, 255, .04); --b-ink: var(--ink); --b-glow: rgba(0, 0, 0, .4); border-color: var(--line); }
button.sec:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
button.danger { --b-bg: var(--coral); --b-ink: #2a0904; --b-glow: rgba(242, 113, 92, .4); }
/* imza gerektiren her şey pirinç */
button.root, a.button-link { --b-bg: linear-gradient(180deg, var(--brass-hi), var(--brass)); --b-ink: var(--brass-ink); --b-glow: rgba(214, 170, 92, .5);
  border-color: rgba(240, 207, 141, .5); }
button.link { --b-bg: none; --b-glow: transparent; color: var(--teal); padding: 0; border: 0; font-weight: 600; font-size: inherit; display: inline; }
button.link:hover:not(:disabled) { text-decoration: underline; text-underline-offset: 3px; box-shadow: none; filter: none; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.full { width: 100%; margin-top: 18px; padding: 12px 16px; font-size: 15.5px; }
button.full + button.full { margin-top: 8px; }

/* ---------------------------------------------------------------- tablo */
.table-wrap { overflow-x: auto; margin: 0 -22px; padding: 0 22px; -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-size: 13px; color: var(--faint); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .15s; }
tr.click { cursor: pointer; }
tr.click:hover td { background: rgba(61, 213, 191, .05); }
tr.click:hover td:first-child { box-shadow: inset 2px 0 0 var(--teal); }

.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); margin-right: 8px; vertical-align: 1px; position: relative; }
.dot.on { background: var(--teal); box-shadow: 0 0 10px rgba(61, 213, 191, .8); }
.dot.on::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--teal); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { from { transform: scale(.6); opacity: .9; } to { transform: scale(1.8); opacity: 0; } }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--r-chip); font-size: 12.5px; font-weight: 650;
  background: rgba(138, 163, 182, .12); color: var(--mute); white-space: nowrap; border: 1px solid transparent; }
.badge.ok { background: rgba(61, 213, 191, .12); color: var(--teal); border-color: rgba(61, 213, 191, .25); }
.badge.warn { background: rgba(239, 179, 74, .12); color: var(--amber); border-color: rgba(239, 179, 74, .28); }
.badge.bad { background: rgba(242, 113, 92, .12); color: var(--coral); border-color: rgba(242, 113, 92, .3); }
.badge.info { background: rgba(127, 178, 255, .12); color: var(--sky); border-color: rgba(127, 178, 255, .28); }
.badge.root { background: rgba(214, 170, 92, .14); color: var(--brass-hi); border-color: rgba(214, 170, 92, .35); }

pre.out { background: #071019; color: #cfe3ef; border: 1px solid var(--line-soft); padding: 14px; border-radius: 10px; overflow: auto; max-height: 380px;
  white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; font: 12.5px/1.55 var(--mono); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 14px; } .kv div:nth-child(odd) { color: var(--mute); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.empty { text-align: center; color: var(--mute); padding: 34px 20px; }
.qr { display: block; margin: 14px auto; border-radius: 12px; image-rendering: pixelated; background: #fff; padding: 8px; box-shadow: 0 0 0 1px var(--line), 0 18px 40px -18px rgba(0, 0, 0, .8); }
.secret { text-align: center; font-family: var(--mono); letter-spacing: 2px; background: rgba(10, 22, 32, .8); border: 1px dashed var(--line); padding: 10px; border-radius: 10px; word-break: break-all; }
.rule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 4px 30px; margin-bottom: 8px; }
.rule-grid h3 { margin-top: 12px; color: var(--brass-hi); font-size: 15px; }
.hidden { display: none !important; }
.m0 { margin: 0 !important; }
input.w-num { width: 110px; }

/* imza durumu: anahtar açıkken pirinç mühür nefes alır */
.side .user .badge.ok { background: rgba(214, 170, 92, .16); color: var(--brass-hi); border-color: rgba(214, 170, 92, .45); animation: breathe 3s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 16px rgba(214, 170, 92, .45); } }

/* ---------------------------------------------------------------- modal + bildirim */
.modal-back { position: fixed; inset: 0; background: rgba(4, 10, 16, .62); backdrop-filter: blur(6px); display: grid; place-items: center;
  padding: 20px; z-index: 50; animation: fade .2s ease both; }
.modal { background: linear-gradient(180deg, var(--panel-2), var(--deep)); border: 1px solid var(--line); border-radius: var(--r-shell); width: 100%; max-width: 580px;
  max-height: 90vh; max-height: 90dvh; overflow: auto; padding: 24px 26px; box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .8);
  animation: modal .32s var(--ease) both; }
.modal h2 { font-size: 22px; }
.modal.wide { max-width: 900px; }
.modal .toolbar { margin-top: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; position: sticky; bottom: -24px; padding: 14px 0 0;
  background: linear-gradient(180deg, transparent, var(--deep) 40%); }
@keyframes fade { from { opacity: 0; } }
@keyframes modal { from { opacity: 0; transform: translateY(16px) scale(.97); } }
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 520px); pointer-events: none; }
#toast div { background: rgba(22, 50, 70, .96); color: var(--ink); padding: 12px 16px 12px 18px; border-radius: 12px; border: 1px solid var(--line);
  border-left: 3px solid var(--teal); box-shadow: 0 20px 50px -18px rgba(0, 0, 0, .8); backdrop-filter: blur(8px); animation: toast .35s var(--ease) both; pointer-events: auto; }
#toast div.bad { border-left-color: var(--coral); }
@keyframes toast { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ---------------------------------------------------------------- mobil */
.nav-back { display: none; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 30;
    padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
    background: rgba(10, 22, 32, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-soft);
  }
  .topbar .brand { font-size: 18px; }
  .menu-btn { --b-bg: rgba(255, 255, 255, .05); --b-ink: var(--ink); border-color: var(--line); padding: 8px 10px; }
  .menu-btn svg { width: 20px; height: 20px; }
  .menu-btn line { stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .3s var(--ease), opacity .2s; transform-origin: 12px 12px; }
  .nav-open .menu-btn .l1 { transform: translateY(6px) rotate(45deg); }
  .nav-open .menu-btn .l2 { opacity: 0; }
  .nav-open .menu-btn .l3 { transform: translateY(-6px) rotate(-45deg); }
  .side { position: fixed; inset: 0 auto 0 0; width: min(84vw, 320px); height: 100dvh; z-index: 40; transform: translateX(-104%);
    transition: transform .38s var(--ease); box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .7); padding-top: max(22px, env(safe-area-inset-top)); }
  .nav-open .side { transform: none; }
  .nav-back { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(4, 10, 16, .55); backdrop-filter: blur(3px);
    opacity: 0; pointer-events: none; transition: opacity .3s; }
  .nav-open .nav-back { opacity: 1; pointer-events: auto; }
  .side nav a { padding: 12px 14px; font-size: 16px; }
  main { padding: 22px 16px 90px; }
  .page-head { align-items: flex-start; }
  .toolbar .grow { flex-basis: 100%; }
  .page-head > button, .page-head > span > button { width: 100%; }
  .card { padding: 16px; border-radius: 12px; }
  .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .stats { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 26px; } .stat span { font-size: 12px; line-height: 1.3; display: block; margin-top: 2px; }
  .kv { grid-template-columns: 1fr; } .kv div:nth-child(odd) { margin-top: 8px; font-size: 13px; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 22px 22px 0 0; max-height: 92dvh; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); animation: sheet .38s var(--ease) both; }
  .modal-actions { flex-direction: column-reverse; } .modal-actions button { width: 100%; padding: 12px; }
  input, select, textarea { font-size: 16px !important; } /* iOS yakınlaştırmasın */
  button { min-height: 40px; }
  #toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .banner { flex-direction: column; align-items: stretch; }
  .banner .inline { flex-direction: column; align-items: stretch; } .banner .inline > * { width: 100%; }
}
@media (max-width: 640px) {
  /* Telefonda uyarı tabloları kart gibi: önem + buton üstte, metin tam genişlikte, tarih altta */
  table.stack thead { display: none; }
  table.stack tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 0; }
  table.stack td:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  table.stack td:nth-child(3) { grid-column: 1 / -1; grid-row: 3; color: var(--mute); }
  table.stack td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  table.stack .table-wrap, .table-wrap:has(table.stack) { mask-image: none; }
}
@keyframes sheet { from { transform: translateY(100%); } }

/* ---------------------------------------------------------------- performans */
.meters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 0; border: 1px solid var(--line-soft); border-radius: var(--r-card); margin-bottom: 12px; }
.meter { padding: 12px 16px; border-right: 1px solid var(--line-soft); }
.meter b { display: block; font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; transition: color .3s var(--ease); }
.meter b.ok { color: var(--teal); } .meter b.warn { color: var(--amber); } .meter b.bad { color: var(--coral); }
.meter span { color: var(--mute); font-size: 12.5px; }
.meter-act { padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-width: 160px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-field); overflow: hidden; margin: 4px 0 8px; }
.seg button { background: transparent; color: var(--mute); border: 0; border-radius: 0; padding: 5px 12px; font-size: 13px; box-shadow: none; }
.seg button.on { background: var(--panel-2); color: var(--ink); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--line-soft); stroke-width: 1; }
.chart .ax { fill: var(--faint); font: 11px var(--body); }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .ln.cpu { stroke: var(--teal); }
.chart .ln.ram { stroke: var(--sky); stroke-dasharray: 5 4; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 12px; }
.legend .lg::before { content: ""; display: inline-block; width: 16px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.legend .lg.cpu::before { border-color: var(--teal); }
.legend .lg.ram::before { border-color: var(--sky); border-top-style: dashed; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
table.mini { width: 100%; font-size: 13.5px; }
table.mini td, table.mini th { padding: 5px 8px 5px 0; }
table.mini td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pd-head { margin: 10px 0 4px; }
.pd { margin: 4px 0; }
.warn-text { color: var(--amber); }
details summary { cursor: pointer; color: var(--mute); margin: 8px 0 4px; }
@media (max-width: 640px) {
  .meters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .meter { padding: 10px 12px; }
  .meter b { font-size: 22px; }
  .meter:nth-child(3) { border-right: 0; }
  .meter-act { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); flex-direction: row; align-items: center; justify-content: space-between; }
  .chart .ax { font-size: 17px; }
  .cols2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .seal .sig { stroke-dashoffset: 0; } .seal .tick { opacity: 1; }
}
button.link.danger { color: var(--coral); }
td.nowrap { white-space: nowrap; }

/* ---- Demo panel etiketi ---- */
.demo-pill { position: fixed; right: 18px; bottom: 18px; z-index: 45; display: flex; align-items: center; gap: 12px;
  padding: 9px 10px 9px 16px; border-radius: 999px; background: rgba(14, 32, 46, .94); border: 1px solid rgba(214, 170, 92, .45);
  color: var(--ink); font-size: 13px; text-decoration: none; box-shadow: 0 8px 28px rgba(0, 0, 0, .35); backdrop-filter: blur(6px); }
.demo-pill b { white-space: nowrap; flex-shrink: 0; background: var(--brass); color: var(--brass-ink); padding: 6px 12px; border-radius: 999px; font-weight: 600; }
.demo-pill:hover b, .demo-pill:focus-visible b { background: var(--brass-hi); }
@media (max-width: 860px) {
  .demo-pill { right: 12px; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); justify-content: space-between; font-size: 12px; }
  .demo-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
