:root {
  --bg: #0f1216;
  --surface: #171b21;
  --surface-2: #1e242c;
  --line: #2a313b;
  --text: #e7eaee;
  --muted: #98a2ae;
  --accent: #e0483f;
  --accent-text: #fff;
  --good: #3fb97d;
  --warn: #e0a63f;
  --bad: #e0483f;
  --blue: #5b8def;
  --mono: ui-monospace, "Cascadia Code", Consolas, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", sans-serif;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 4px; font-weight: 650; }
h2 { font-size: 15px; margin: 0 0 12px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* Yerlesim */
.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100%; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; font-weight: 700; font-size: 16px; }
.brand img { width: 26px; height: 26px; }
.nav-group { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 12px 10px 4px; }
.nav-item { display: block; padding: 7px 10px; border-radius: 6px; color: var(--text); }
.nav-item:hover { background: var(--surface-2); text-decoration: none; }
.nav-item.active { background: var(--accent); color: var(--accent-text); }
.side-foot { margin-top: auto; padding: 12px 8px 2px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 8px; }
.side-foot img { width: 28px; height: 28px; border-radius: 50%; }
.side-foot .who { min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { padding: 22px 26px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.menu-toggle { display: none; }

/* Kart ve izgara */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 13px 15px; }
.stat .label { color: var(--muted); font-size: 12px; }
.stat .value { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.two { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Tablo */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid #222831; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); padding: 22px; text-align: center; }

/* Form */
button, .btn {
  font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px;
  padding: 6px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover { border-color: #46505d; background: #252c35; }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.primary:hover { background: #c93d35; border-color: #c93d35; }
button.danger { color: #ff8d86; }
button.small { padding: 3px 8px; font-size: 12px; }
input, select, textarea {
  font: inherit; color: var(--text); background: #11151a; border: 1px solid var(--line); border-radius: 6px; padding: 7px 9px; width: 100%;
}
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
input[type=checkbox] { width: auto; }
textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.45; resize: vertical; tab-size: 4; }
label.field { display: block; margin-bottom: 11px; }
label.field > span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.check { display: flex; gap: 7px; align-items: center; padding: 3px 0; }
.check input { flex: none; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 160px; }
.flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 12px; }

/* Rozet */
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.tag.good { color: var(--good); border-color: #2a5a44; }
.tag.bad { color: #ff8d86; border-color: #6a2e2a; }
.tag.warn { color: var(--warn); border-color: #65502a; }
.tag.t { color: #e0a63f; }
.tag.ct { color: #6ea8fe; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); margin-right: 6px; }
.dot.on { background: var(--good); }

/* Konsol */
.console { background: #0a0c0f; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; height: 52vh; }
.console .cmd { color: var(--good); }
.console .err { color: #ff8d86; }
.editor { min-height: 58vh; white-space: pre; overflow: auto; }
.file-list { max-height: 66vh; overflow-y: auto; }
.file-list button { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 5px 8px; border-radius: 5px; white-space: normal; overflow-wrap: anywhere; font-size: 12.5px; }
.file-list button:hover { background: var(--surface-2); }
.file-list button.active { background: var(--surface-2); color: var(--blue); }
.split { display: grid; gap: 16px; grid-template-columns: 260px minmax(0, 1fr); }

/* Pencere */
.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 20; overflow-y: auto; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; width: 100%; max-width: 560px; }
.modal.wide { max-width: 780px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.modal-head h2 { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 30; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--good); border-radius: 6px; padding: 9px 13px; overflow-wrap: anywhere; }
.toast.err { border-left-color: var(--bad); }

/* Giris */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-box { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 30px; width: 100%; max-width: 380px; text-align: center; }
.login-box img { width: 54px; height: 54px; margin-bottom: 12px; }
.login-box .btn { justify-content: center; width: 100%; margin-top: 18px; padding: 10px; background: #5865f2; border-color: #5865f2; color: #fff; font-weight: 600; }
.login-box .btn:hover { background: #4752c4; text-decoration: none; }
.notice { background: #2b1b1a; border: 1px solid #6a2e2a; color: #ffb4ae; border-radius: 6px; padding: 8px 11px; margin-top: 14px; font-size: 13px; }
.note { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 8px 11px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }

@media (max-width: 820px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 15; width: 240px; transform: translateX(-100%); transition: transform .15s; left: 0; top: 0; }
  .side.open { transform: none; }
  .menu-toggle { display: inline-flex; margin-bottom: 12px; }
  .main { padding: 14px 16px 34px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .file-list { max-height: 30vh; }
}
