:root {
  --bg: #0b1020;
  --bg-2: #0f1630;
  --panel: #151d36;
  --panel-2: #1c2645;
  --panel-3: #243055;
  --line: rgba(148, 163, 214, .14);
  --line-2: rgba(148, 163, 214, .24);
  --text: #eef1fb;
  --muted: #8f9bbd;
  --accent: #5b8cff;
  --accent-2: #3f6fe6;
  --accent-soft: rgba(91, 140, 255, .16);
  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, .15);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, .14);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, .14);
  --violet: #a78bfa;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --radius: 16px;
  --radius-sm: 11px;
  --tabbar-h: 64px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --glow-1: #1a2a5a;
  --glow-2: #1b1640;
  --glass: rgba(21, 29, 54, .92);
  --inset: rgba(11, 16, 32, .35);
  --output-bg: #070b16;
  color-scheme: dark;
}
/* temalar: Ayarlar sekmesinden seçilir (html[data-theme]); varsayılan yukarıdaki "Gece mavisi" */
html[data-theme="amoled"] {
  --bg: #000; --bg-2: #07080c; --panel: #0c0d12; --panel-2: #14161d; --panel-3: #1d2029;
  --line: rgba(255,255,255,.09); --line-2: rgba(255,255,255,.16); --muted: #8a8f9c;
  --glow-1: #000; --glow-2: #000; --glass: rgba(12,13,18,.94); --inset: rgba(255,255,255,.04); --output-bg: #000;
}
html[data-theme="zumrut"] {
  --bg: #06140f; --bg-2: #0a1d16; --panel: #0f251d; --panel-2: #143127; --panel-3: #1b3e32;
  --line: rgba(110,231,183,.13); --line-2: rgba(110,231,183,.22); --muted: #8fb5a6;
  --accent: #10b981; --accent-2: #059669; --accent-soft: rgba(16,185,129,.16);
  --glow-1: #0d3b2b; --glow-2: #0b2a33; --glass: rgba(15,37,29,.93); --inset: rgba(4,14,10,.4); --output-bg: #030b08;
}
html[data-theme="mor"] {
  --bg: #120a1f; --bg-2: #180e2a; --panel: #1f1436; --panel-2: #291b45; --panel-3: #342356;
  --line: rgba(196,167,255,.14); --line-2: rgba(196,167,255,.24); --muted: #a99bc6;
  --accent: #a78bfa; --accent-2: #7c3aed; --accent-soft: rgba(167,139,250,.18);
  --glow-1: #3b1d66; --glow-2: #4a1747; --glass: rgba(31,20,54,.93); --inset: rgba(10,5,20,.4); --output-bg: #08040f;
}
html[data-theme="gunbatimi"] {
  --bg: #1a0e0a; --bg-2: #22130d; --panel: #2b1912; --panel-2: #372119; --panel-3: #452a1f;
  --line: rgba(253,186,116,.14); --line-2: rgba(253,186,116,.24); --muted: #c3a593;
  --accent: #f97316; --accent-2: #ea580c; --accent-soft: rgba(249,115,22,.17);
  --glow-1: #5a2312; --glow-2: #4a1430; --glass: rgba(43,25,18,.93); --inset: rgba(15,7,4,.4); --output-bg: #0c0503;
}
html[data-theme="acik"] {
  --bg: #f3f5fa; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #eef1f7; --panel-3: #e2e7f1;
  --line: rgba(20,30,60,.10); --line-2: rgba(20,30,60,.18); --text: #172033; --muted: #5d6882;
  --accent: #2f6bf2; --accent-2: #1f55d6; --accent-soft: rgba(47,107,242,.12);
  --ok: #059669; --ok-soft: rgba(5,150,105,.12); --warn: #b45309; --warn-soft: rgba(180,83,9,.12);
  --danger: #dc2626; --danger-soft: rgba(220,38,38,.10);
  --shadow: 0 8px 24px rgba(20,30,60,.12);
  --glow-1: #dfe8ff; --glow-2: #efe6ff; --glass: rgba(255,255,255,.94); --inset: rgba(20,30,60,.05); --output-bg: #0f1424;
  color-scheme: light;
}
html[data-theme="acik"] .output { color: #e8ecf8; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.theme-grid button { border: 2px solid var(--line-2); border-radius: 14px; padding: 8px 6px 7px; background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 12.5px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.theme-grid button.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-grid .sw { width: 100%; height: 34px; border-radius: 9px; display: block; }
.log-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 12px; }
.log-buttons .btn { padding-left: 6px; padding-right: 6px; font-size: 13px; }
.tabbar button { position: relative; }
.tabbar button[data-badge]::after { content: attr(data-badge); position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger, #ef4444); color: #fff; font-size: 11px; line-height: 18px; font-weight: 700; }
.alert-item { display: flex; gap: 10px; padding: 11px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.alert-item .i { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.alert-item.p .i { color: var(--danger, #ef4444); } .alert-item.ok .i { color: var(--ok, #22c55e); }
.alert-item b { display: block; } .alert-item small { color: var(--muted); }
.h-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.h-tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.h-tile small { color: var(--muted); display: block; } .h-tile b { font-size: 22px; }
.h-tile.bad b { color: var(--danger, #ef4444); }
.h-chart { width: 100%; height: 190px; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.h-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin: 8px 2px 14px; flex-wrap: wrap; }
.h-legend span::before { content: ""; display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 5px; vertical-align: middle; background: currentColor; }
.disk-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 4px 0 10px; }
.disk-bar > div { height: 100%; background: var(--accent); } .disk-bar.bad > div { background: var(--danger, #ef4444); }
.rank-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 8px; }
.rank-row .n { font-weight: 800; color: var(--muted); text-align: center; } .rank-row .sc { font-weight: 800; color: var(--danger, #ef4444); }
.log-buttons .btn { width: 100%; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; color: var(--text);
  background: radial-gradient(1200px 600px at 100% -10%, var(--glow-1) 0%, transparent 55%), radial-gradient(900px 500px at -20% 0%, var(--glow-2) 0%, transparent 50%), var(--bg);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.pad { padding: 24px 16px; }
.error { color: var(--danger); min-height: 1.4em; margin: 10px 0 0; text-align: center; font-size: 14px; }
.warn-text { color: var(--warn); }
h1 { margin: 10px 0 4px; font-size: 22px; text-align: center; letter-spacing: -.2px; }
h3 { margin: 0 0 10px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
svg.i { width: 20px; height: 20px; flex: none; display: block; }

input, select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); padding: 12px 13px; font: inherit; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: block; margin: 14px 0 0; color: var(--muted); font-size: 13px; }
label > input, label > .pw-wrap, label > select { margin-top: 6px; }
label.check { display: flex; gap: 10px; align-items: center; margin: 16px 0; color: var(--text); font-size: 14px; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

.btn { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 10px 14px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn svg.i { width: 18px; height: 18px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(63, 111, 230, .35); }
.btn.warn { color: var(--warn); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.block { display: flex; width: 100%; margin-top: 12px; }
.btn.lg { padding: 14px; font-size: 16px; }
.btn[disabled] { opacity: .5; }
.link-btn { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--muted); font: inherit;
  font-size: 13px; text-decoration: underline; padding: 8px; cursor: pointer; }

.view { position: fixed; inset: 0; display: flex; flex-direction: column; }
#view-login { align-items: center; justify-content: center; padding: 16px; overflow: auto; }
.login-card { width: 100%; max-width: 390px; background: var(--glass); border: 1px solid var(--line); border-radius: 22px;
  padding: 28px 22px; box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.login-logo { width: 68px; height: 68px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--violet)); box-shadow: 0 10px 28px rgba(91, 140, 255, .35); }
.login-logo svg.i { width: 34px; height: 34px; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); padding: 9px; }

.topbar { display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--glass); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); flex: none; min-height: 62px; }
.topbar .title { flex: 1; min-width: 0; padding-left: 4px; }
.stack { display: flex; flex-direction: column; min-width: 0; }
.stack b, .stack small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack b { font-size: 16.5px; }
.stack small { font-size: 12px; display: flex; align-items: center; gap: 5px; }
.brand { flex: 1; display: flex; align-items: center; gap: 11px; min-width: 0; padding-left: 4px; }
.brand-logo { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: #fff; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--violet)); }
.icon-btn { background: none; border: 0; color: var(--text); width: 44px; height: 44px; border-radius: 12px; cursor: pointer; flex: none;
  display: grid; place-items: center; }
.icon-btn:active { background: var(--panel-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5b6584; flex: none; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
/* 2.9.23: the live panel stream is open (/api/events) */
.dot.on.live { box-shadow: 0 0 0 3px var(--ok-soft), 0 0 0 6px var(--ok-soft); }

.content { flex: 1; overflow-y: auto; padding: 14px 16px 28px; -webkit-overflow-scrolling: touch; }
#view-main .content { padding-bottom: calc(var(--tabbar-h) + 20px + env(safe-area-inset-bottom)); }
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar > input { flex: 1; min-width: 150px; }
.toolbar select { width: auto; padding: 10px 9px; }
.toolbar .grow { flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 7px; margin: 0; padding: 10px 11px; background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); color: var(--text); font-size: 14px; }
.chip input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* istatistikler, arama, segmentli seçici */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; }
.stat .n { font-size: 22px; font-weight: 750; line-height: 1.1; }
.stat .l { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.stat.ok .n { color: var(--ok); } .stat.warn .n { color: var(--warn); }
.search { position: relative; margin-bottom: 10px; }
.search > svg.i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; }
.search input { padding-left: 40px; background: var(--panel); border-color: var(--line); }
.segmented { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.segmented button { flex: 1; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; padding: 8px 4px; border-radius: 10px; }
.segmented button.active { background: var(--panel-3); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.25); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px; margin-bottom: 12px; }
.notice { background: var(--warn-soft); border: 1px solid rgba(251, 191, 36, .35); color: #fcd889; border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.notice.err { background: var(--danger-soft); border-color: rgba(248, 113, 113, .4); color: #fecaca; }

.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%; min-width: 0; }
.item:active { background: var(--panel-2); }
.item.off { opacity: .6; }
.item .txt { flex: 1; min-width: 0; }
.item .t1 { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .t2, .item .t3 { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .side { text-align: right; font-size: 12px; color: var(--muted); flex: none; }
.item .fi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--panel-2); color: var(--muted); }
.item .fi.folder { color: var(--warn); background: var(--warn-soft); }
.item .fi.drive { color: var(--cyan); background: rgba(34, 211, 238, .12); }
.item .fi.file { color: var(--accent); background: var(--accent-soft); }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--panel-2); color: var(--muted); font-weight: 650; margin-left: 4px; white-space: nowrap; display: inline-block; }
.badge.ok { color: var(--ok); background: var(--ok-soft); } .badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.acc { color: var(--accent); background: var(--accent-soft); } .badge.danger { color: var(--danger); background: var(--danger-soft); }

/* client satırı */
.client { position: relative; padding: 12px 12px 12px; display: block; }
.client .row { display: flex; align-items: center; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 750; font-size: 15px; flex: none;
  color: #fff; position: relative; text-transform: uppercase; }
.avatar .dot { position: absolute; right: -3px; bottom: -3px; border: 2px solid var(--panel); width: 13px; height: 13px; }
.star { background: none; border: 0; color: #5b6584; padding: 6px; margin: -6px -4px -6px 0; }
.star.on { color: var(--warn); }
.quick { display: flex; gap: 6px; margin-top: 10px; padding-left: 56px; }
.quick button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 8px 4px; font: inherit; font-size: 12.5px; font-weight: 600; }
.quick button svg.i { width: 16px; height: 16px; color: var(--accent); }
.quick button:active { background: var(--panel-3); }

/* client sayfası */
.hero { display: flex; align-items: center; gap: 14px; background: linear-gradient(135deg, rgba(91,140,255,.18), rgba(167,139,250,.12)); }
.hero .avatar { width: 56px; height: 56px; font-size: 19px; border-radius: 18px; }
.hero .stack b { font-size: 18px; }
.hero-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.hero-meta div { background: var(--inset); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.hero-meta small { display: block; color: var(--muted); font-size: 11px; }
.hero-meta span { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-title { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; margin: 18px 4px 8px; }
.actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
.action { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 12px; color: inherit; font: inherit;
  text-align: left; cursor: pointer; display: flex; align-items: center; gap: 11px; min-height: 64px; }
.action:active { background: var(--panel-2); transform: scale(.98); }
.action .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.action .txt { min-width: 0; display: flex; flex-direction: column; }
.action b { font-size: 14px; }
.action small { color: var(--muted); font-size: 11.5px; }
.action[disabled] { opacity: .42; }
.c-blue { color: var(--accent); background: var(--accent-soft); } .c-green { color: var(--ok); background: var(--ok-soft); }
.c-amber { color: var(--warn); background: var(--warn-soft); } .c-red { color: var(--danger); background: var(--danger-soft); }
.c-violet { color: var(--violet); background: rgba(167,139,250,.15); } .c-cyan { color: var(--cyan); background: rgba(34,211,238,.13); }
.c-pink { color: var(--pink); background: rgba(244,114,182,.14); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; font-size: 14px; }
.kv > div:nth-child(odd) { color: var(--muted); }
.kv > div { overflow-wrap: anywhere; }

/* ekran */
.scr-box { position: relative; overflow: auto; background: #000; border-radius: var(--radius); border: 1px solid var(--line); max-height: 60vh; }
.scr-box img, .scr-box canvas { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.scr-box .placeholder { padding: 46px 16px; text-align: center; color: var(--muted); }
.scr-box.fs { position: fixed; inset: 0; z-index: 40; max-height: none; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
.fs-bar { position: fixed; z-index: 41; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.fs-bar button { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--glass); color: var(--text);
  display: grid; place-items: center; box-shadow: var(--shadow); }
.tap-ping { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 2px solid var(--accent); pointer-events: none; animation: ping .5s ease-out forwards; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.7); opacity: 0; } }
.status-line { font-size: 12.5px; color: var(--muted); margin: 7px 2px; min-height: 1.3em; }
.type-row { display: flex; gap: 8px; margin: 10px 0 9px; }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.keys button { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 4px; font: inherit; font-size: 12.5px; font-weight: 650; cursor: pointer; }
.keys button:active { background: var(--accent-2); }
details.fold { margin-top: 4px; }
details.fold > summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 2px; }
details.fold > summary::-webkit-details-marker { display: none; }

.output { background: var(--output-bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px;
  font: 12px/1.45 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-word; margin: 0;
  height: 52vh; overflow-y: auto; color: #d7e0f5; }

.big3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.big3 .card { text-align: center; margin: 0; padding: 13px 6px; }
.big3 .v { font-size: 24px; font-weight: 750; }
.big3 .u { font-size: 11px; color: var(--muted); }
.app-update { border-color: rgba(91,140,255,.45); background: linear-gradient(135deg, rgba(91,140,255,.20), rgba(167,139,250,.14)); }
.app-update .row { display: flex; align-items: center; gap: 12px; }
.app-update .row > svg { width: 26px; height: 26px; flex: none; color: var(--accent); }
.app-update .txt { flex: 1; min-width: 0; }
.app-update .txt b { display: block; }
.app-update .txt small { color: var(--muted); font-size: 12.5px; }
.app-update .btn { flex: none; margin: 0; padding: 9px 14px; }
.app-update .note { margin-top: 10px; font-size: 13px; color: var(--muted); }
.app-update .note.err { color: var(--danger, #e5484d); }
.bar { height: 6px; background: var(--panel-2); border-radius: 9px; overflow: hidden; margin: 12px 0; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--violet)); transition: width .3s; }

.log { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.log div { padding: 9px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow-wrap: anywhere; }
.log div.m { border-color: rgba(91,140,255,.35); }
.log div.w { border-color: rgba(251,191,36,.4); }
.log div.e { border-color: rgba(248,113,113,.45); background: var(--danger-soft); }
.log div.o { border-left: 3px solid var(--ok); }
.log div.empty, .log div.spinner { background: none; border: 0; }
.log time { color: var(--muted); margin-right: 8px; font-size: 11.5px; font-variant-numeric: tabular-nums; }

.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--panel-3); border-top-color: var(--accent); animation: spin .8s linear infinite; margin: 26px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { text-align: center; color: var(--muted); padding: 30px 16px; }
.empty svg.i { width: 36px; height: 36px; margin: 0 auto 8px; opacity: .6; }

.tabbar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; background: var(--glass);
  backdrop-filter: blur(12px); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); }
.tabbar button { flex: 1; height: var(--tabbar-h); background: none; border: 0; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.tabbar button svg.i { width: 22px; height: 22px; }
.tabbar button.active { color: var(--accent); }

.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(3, 6, 16, .6); backdrop-filter: blur(2px); }
.sheet-panel { position: relative; width: 100%; max-width: 540px; background: var(--panel); border-radius: 22px 22px 0 0; border: 1px solid var(--line-2);
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto; animation: up .2s ease-out; }
.sheet-grip { width: 40px; height: 4px; border-radius: 4px; background: var(--panel-3); margin: 0 auto 12px; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-title { font-weight: 700; margin-bottom: 12px; overflow-wrap: anywhere; white-space: pre-line; }
#sheet-body > .btn { display: flex; width: 100%; margin-bottom: 8px; justify-content: flex-start; padding: 13px 14px; }
#sheet-body .form-err { color: var(--danger); font-size: 13px; min-height: 1.2em; margin-top: 8px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + 30px + env(safe-area-inset-bottom));
  background: var(--panel-3); border: 1px solid var(--line-2); padding: 11px 16px; border-radius: 14px; z-index: 60;
  max-width: calc(100% - 32px); font-size: 14px; box-shadow: var(--shadow); }
.toast.err { border-color: rgba(248, 113, 113, .6); color: #fecaca; }

.chip.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
button.chip { font: inherit; font-size: 13px; font-weight: 600; color: var(--text); border: 1px solid var(--line); cursor: pointer; }

/* araçlar */
.tool-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-bottom: 10px; }
.tool-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); margin: 0; }
.tool-form label.wide { grid-column: 1 / -1; }
.tool-form input, .tool-form select, .tool-form textarea { width: 100%; }
textarea.mono, .tool-out { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.tool-note { font-size: 12px; margin: -4px 2px 6px; }
.tool-out { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; max-height: 55vh; overflow: auto; margin: 8px 0; }
.tool-actions { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 4px; background: var(--bg); }
.tool-actions .btn { flex: 1 1 auto; margin: 0; }
.tool-row.sel { border-color: var(--accent); background: var(--accent-soft); }
.tool-row.tone-bad .t1 { color: var(--danger); }
.tool-row.tone-warn .t1 { color: var(--warn); }
.tool-row.tone-ok .t1 { color: var(--ok); }
.tool-row.tone-muted { opacity: .75; }
.detail-full { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12.5px; margin-top: 6px; color: var(--text); }
.check-dot { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.check-dot.on { background: var(--accent); border-color: var(--accent); }
.err-text { color: var(--danger); }
.field-hint { display: block; margin: -6px 0 8px; font-size: 11.5px; }

.group-filter { display: flex; gap: 6px; overflow-x: auto; margin: -4px 0 10px; padding-bottom: 2px; }
.group-filter .chip { flex: none; padding: 7px 10px; font-size: 12.5px; }
.tabbar button { min-width: 0; }

.card.task.off { opacity: .65; }
.card.task .toolbar .btn { flex: 1 1 auto; margin: 0; padding: 9px 8px; }

/* ---- sanal teknisyen, raporlar */
.ai-chat { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ai-line { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; white-space: pre-wrap; font-size: 14px; }
.ai-line.me { border-color: var(--accent); }
.ai-line.muted { color: var(--muted); font-size: 12.5px; background: none; }
.ai-line.warn { border-color: #f59e0b; }
.ai-line.bad { border-color: #ef4444; }
.ai-line.ok { border-color: #22c55e; }
.ai-input textarea { flex: 1; min-width: 0; resize: vertical; font: inherit; border-radius: 12px; padding: 8px 10px; background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.report-grid { display: flex; flex-direction: column; gap: 8px; }

/* ---- tarayıcıdan tam yönetim: geniş ekranda masaüstü düzeni */
@media (min-width: 1000px) {
  .tabbar { left: 0; right: auto; top: 0; bottom: 0; width: 210px; flex-direction: column; justify-content: flex-start; padding: 70px 10px 10px; border-radius: 0; gap: 4px; }
  .tabbar button { flex: 0 0 auto; height: 44px; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 0 14px; font-size: 14px; border-radius: 10px; display: flex; align-items: center; }
  .tabbar button.active { background: var(--glass-2, rgba(255,255,255,.06)); }
  #view-main .topbar, #view-main .content { margin-left: 210px; }
  .content { padding: 20px 28px 40px; }
  .content > * { max-width: 1400px; margin-left: auto; margin-right: auto; }
  #client-list, .report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 10px; }
  .stats { grid-template-columns: repeat(6, 1fr); }
  .actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
  #page-body .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 8px; }
  .sheet { align-items: center; }
  .sheet-panel { border-radius: 22px; }
  .ai-chat { max-width: 1000px; }
}
/* uzak metin düzenleyici */
textarea.editor { width: 100%; min-height: calc(100vh - 220px); font-family: ui-monospace, Consolas, monospace; font-size: 13px; line-height: 1.45; white-space: pre; overflow: auto; tab-size: 4; resize: vertical; }
/* ekran duvarı */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 10px; }
.wall .tile { position: relative; padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 10; cursor: pointer; }
.wall .tile img { width: 100%; height: 100%; object-fit: contain; display: block; }
.wall .tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; font-size: 12px; color: #fff; background: rgba(0,0,0,.6); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
