:root {
  --bg: #0B0C0F;
  --side: #0E1013;
  --card: #14161B;
  --card-2: #1A1D24;
  --line: #22252D;
  --line-soft: #1E2128;
  --input-line: #2A2E37;
  --text: #F2F3F5;
  --muted: #A3A9B4;
  --dim: #7D8492;
  --accent: #8B7CFF;
  --accent-soft: #B3A9FF;
  --teal: #5EE6D0;
  --ok: #3DD68C;
  --warn: #F5B547;
  --err: #FF7A7A;
  --info: #5EB1FF;
  --term: #08090B;
  --f-head: 'Space Grotesk', system-ui, sans-serif;
  --f-body: Inter, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--f-body); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-soft); }
a:hover { color: #D4CEFF; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code { font-family: var(--f-mono); font-size: 0.92em; background: var(--card-2); padding: 1px 6px; border-radius: 4px; }

.mono { font-family: var(--f-mono); }
.small { font-size: 12px; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 22px; }
.stack-4 { display: flex; flex-direction: column; gap: 4px; }
p { margin: 0; }

/* ---- marka ---- */
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; color: var(--accent); }
.brand span { font-family: var(--f-head); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.brand-lg { gap: 12px; }
.brand-lg span { font-size: 26px; }

/* ---- giris ---- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 48px 16px; }
.login-card { width: 100%; max-width: 420px; padding: 32px; border-radius: 20px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 22px; }
.steps { display: flex; gap: 8px; }
.steps span { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--input-line); }
.steps span.on { background: var(--accent); }
.h-login { margin: 0; font-family: var(--f-head); font-size: 24px; font-weight: 600; }
.login-note { max-width: 420px; text-align: center; font-size: 12px; color: var(--dim); line-height: 1.7; }
.code-input { text-align: center; font-family: var(--f-mono) !important; font-size: 28px !important; letter-spacing: 0.4em; min-height: 60px !important; }
.form-err { color: var(--err); font-size: 13px; min-height: 0; }
.form-err:empty { display: none; }

/* ---- form ---- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child { font-size: 13px; font-weight: 500; color: var(--muted); }
.input, .field input, .field select, .field textarea {
  min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--input-line);
  background: var(--side); color: var(--text); width: 100%;
}
.login .field input { min-height: 48px; padding: 0 14px; border-radius: 12px; }
.field textarea { padding: 10px 12px; min-height: 84px; resize: vertical; font-family: var(--f-mono); font-size: 13px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.suffix-input { display: flex; align-items: center; min-height: 44px; border-radius: 10px; border: 1px solid var(--input-line); background: var(--side); overflow: hidden; }
.suffix-input:focus-within { border-color: var(--accent); }
.suffix-input input { flex: 1 1 auto; min-width: 0; border: 0 !important; background: transparent !important; font-family: var(--f-mono); font-size: 13px; outline: none; }
.suffix-input span { padding: 0 12px; color: var(--dim); font-family: var(--f-mono); font-size: 13px; white-space: nowrap; }
.hint { font-size: 12px; color: var(--dim); }

/* ---- dugmeler ---- */
.btn { min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--input-line); background: var(--card); color: var(--text); font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--card-2); color: var(--text); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--bg); font-weight: 600; }
.btn-primary:hover { background: #9C8FFF; color: var(--bg); }
.btn-lg { min-height: 48px; border-radius: 12px; }
.btn-danger { color: var(--err); }
.btn-link { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--accent-soft); font-weight: 500; cursor: pointer; align-self: flex-start; }
.icon-btn { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--input-line); background: var(--side); color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; text-decoration: none; }
.icon-btn:hover { color: var(--text); border-color: #3A3F4A; }
.icon-btn:disabled { opacity: 0.5; cursor: progress; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 10px; background: var(--side); border: 1px solid var(--line); }
.seg button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 7px; font-size: 12px; font-weight: 500; cursor: pointer; background: transparent; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--line); color: var(--text); }
.seg.seg-lg button { min-height: 36px; padding: 0 14px; font-size: 13px; }
.chip { min-height: 32px; padding: 0 10px; border-radius: 8px; font-size: 12px; font-weight: 500; cursor: pointer; background: transparent; color: var(--muted); border: 1px solid var(--input-line); }
.chip[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }

/* ---- kabuk ---- */
.shell { min-height: 100vh; display: flex; flex-wrap: wrap; }
.side { flex: 1 1 232px; max-width: 100%; display: flex; flex-direction: column; gap: 28px; padding: 24px 16px; border-right: 1px solid var(--line-soft); background: var(--side); }
.nav-links { display: flex; flex-direction: column; gap: 4px; }
.nav-links a, .nav-btn { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 500; background: transparent; border: 0; cursor: pointer; text-align: left; }
.nav-links a:hover, .nav-btn:hover { color: var(--text); background: #14161B; }
.nav-links a[aria-current="page"] { background: var(--card-2); color: var(--text); }
.nav-links a[aria-current="page"] svg { stroke: var(--accent); }
.nav-count { margin-left: auto; font-size: 12px; color: var(--dim); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.server-card { padding: 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.server-name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.main { flex: 999 1 560px; min-width: 0; padding: 32px clamp(16px, 3vw, 40px) 48px; display: flex; flex-direction: column; gap: 24px; outline: none; }

@media (min-width: 900px) {
  .side { position: sticky; top: 0; height: 100vh; flex: 0 0 248px; overflow-y: auto; }
  .shell { flex-wrap: nowrap; }
}
@media (max-width: 899px) {
  .side { border-right: 0; border-bottom: 1px solid var(--line-soft); gap: 16px; padding: 16px; }
  .nav-links { flex-direction: row; flex-wrap: wrap; }
  .nav-links a { flex: 1 1 140px; }
  .side-foot { flex-direction: row; flex-wrap: wrap; align-items: stretch; }
  .server-card { flex: 1 1 200px; }
}

/* ---- sayfa basligi ---- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { margin: 0; font-family: var(--f-head); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; }
.page-head p { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---- kartlar ---- */
.card { padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card-title { font-family: var(--f-head); font-size: 17px; font-weight: 600; margin: 0; }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.grid-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row > .grow-2 { flex: 2 1 520px; }
.row > .grow-1 { flex: 1 1 300px; }
.stat-top { display: flex; justify-content: space-between; color: var(--muted); font-weight: 500; }
.stat-top span:last-child { color: var(--dim); }
.stat-big { font-family: var(--f-head); font-size: 34px; font-weight: 600; line-height: 1; white-space: nowrap; }
.stat-big small { font-size: 18px; color: var(--muted); font-weight: 600; }
.stat-mid { font-family: var(--f-head); font-size: 24px; font-weight: 600; line-height: 1.1; }
.stat-mid small { font-size: 14px; color: var(--muted); }
.stat-line { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; }
.bar-thin { height: 4px; border-radius: 2px; }

/* ---- grafik ---- */
.legend { display: flex; gap: 20px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.chart { position: relative; height: 220px; }
.chart svg { display: block; width: 100%; height: 220px; }
.chart-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); font-family: var(--f-mono); }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; }

/* ---- listeler ---- */
.kv-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-soft); }
.kv-row:last-child { border-bottom: 0; padding-bottom: 0; }
.kv-row > div { display: flex; flex-direction: column; min-width: 0; }
.kv-row > div > span:first-child { font-weight: 500; }
.kv-row > div > span:last-child { font-size: 12px; color: var(--dim); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill-nodot::before { display: none; }
.pill-ok { background: rgba(61,214,140,0.12); color: var(--ok); }
.pill-warn { background: rgba(245,181,71,0.14); color: var(--warn); }
.pill-err { background: rgba(255,122,122,0.14); color: var(--err); }
.pill-muted { background: rgba(163,169,180,0.12); color: var(--muted); }
.pill-info { background: rgba(94,177,255,0.12); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot-ok { background: var(--ok); }
.ev { display: flex; gap: 12px; }
.ev .dot { margin-top: 7px; }
.ev > div { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.ev time { font-size: 12px; color: var(--dim); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--dim); font-size: 12px; font-weight: 500; padding: 10px 12px 10px 0; white-space: nowrap; }
td { padding: 13px 12px 13px 0; border-top: 1px solid var(--line-soft); vertical-align: middle; }
td.muted { color: var(--muted); }
td .mono { font-size: 13px; }
.empty { padding: 28px 0; text-align: center; color: var(--dim); }

/* ---- uygulamalar ---- */
.apps-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.apps-list { flex: 2 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.apps-new { flex: 1 1 340px; min-width: 0; }
.app-card { padding: 18px 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.app-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.app-badge { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-family: var(--f-head); font-weight: 700; font-size: 18px; background: #1E2128; }
.app-title { display: flex; flex-direction: column; min-width: 0; flex: 1 1 200px; }
.app-title h2 { margin: 0; font-family: var(--f-head); font-size: 17px; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.app-title .mono { font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }
.app-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.app-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.app-meta div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.app-meta span:first-child { font-size: 12px; color: var(--dim); }
.app-meta span:last-child { font-family: var(--f-mono); font-size: 13px; overflow-wrap: anywhere; }
.tpl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tpl { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 60px; padding: 10px 12px; border-radius: 10px; text-align: left; cursor: pointer; color: var(--text); background: var(--side); border: 1px solid var(--input-line); }
.tpl[aria-pressed="true"] { border-color: var(--accent); }
.tpl span:first-child { font-weight: 600; }
.tpl span:last-child { font-size: 12px; color: var(--dim); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
details summary { cursor: pointer; color: var(--muted); font-weight: 500; min-height: 32px; display: flex; align-items: center; }
details[open] summary { margin-bottom: 10px; }

/* ---- domainler ---- */
.dns-card { padding: 20px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; align-items: center; gap: 16px; min-width: 0; }
.dns-icon { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.dns-card > div:last-child { display: flex; flex-direction: column; min-width: 0; }
.dns-card > div:last-child span:first-child { font-weight: 600; }
.form-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.form-row > .f2 { flex: 2 1 260px; }
.form-row > .f1 { flex: 1 1 200px; }

/* ---- terminal / loglar ---- */
.tl-layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.term-box { flex: 1 1 520px; min-width: 0; border-radius: 16px; background: var(--term); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.box-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); background: var(--side); min-height: 52px; }
.term-wrap { flex: 1 1 auto; height: 560px; padding: 10px 6px 6px 12px; }
.term-wrap .xterm { height: 100%; }
.term-wrap .xterm-viewport { background: var(--term) !important; }
.logs-box { flex: 1 1 480px; min-width: 0; border-radius: 16px; background: var(--card); border: 1px solid var(--line); display: flex; flex-direction: column; overflow: hidden; }
.logs-box .box-head { background: transparent; }
.logs-box select { min-height: 36px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--input-line); background: var(--side); color: var(--text); font-size: 13px; max-width: 220px; }
.log-list { flex: 1 1 auto; height: 560px; padding: 8px 0; overflow: auto; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.6; }
.log-line { display: flex; gap: 12px; padding: 2px 16px; }
.log-line time { flex: none; color: var(--dim); }
.log-line .lv { flex: none; width: 52px; text-align: center; border-radius: 4px; font-size: 11px; font-weight: 500; align-self: flex-start; margin-top: 2px; }
.lv-info { color: var(--info); background: rgba(94,177,255,0.12); }
.lv-warn { color: var(--warn); background: rgba(245,181,71,0.14); }
.lv-err { color: var(--err); background: rgba(255,122,122,0.14); }
.log-line span:last-child { color: #D6D9DE; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.live { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); }
.live.paused { color: var(--dim); }
.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---- bildirim ---- */
.toast { position: fixed; right: 16px; bottom: 16px; max-width: min(420px, calc(100vw - 32px)); padding: 12px 16px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,0.4); z-index: 50; overflow-wrap: anywhere; }
.toast.err { border-color: rgba(255,122,122,0.5); color: #FFC2C2; }
.toast.ok { border-color: rgba(61,214,140,0.45); }

.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } }
