:root {
  --ink: #0E1A26;
  --panel: #15263A;
  --panel-2: #1A2E45;
  --line: #24384F;
  --text: #E6EEF6;
  --muted: #8DA2B8;
  --gain: #2BC48A;
  --loss: #F2596B;
  --act: #3FB6D9;
  --amber: #E7B04B;
  --radius-s: 6px;
  --radius-m: 10px;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--ink); color: var(--text);
  font: 15px/1.55 var(--sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--act); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--act); outline-offset: 2px; }
.hidden { display: none !important; }
.w100 { width: 100%; }
.pad8 { padding: 8px; }
.m0 { margin: 0; }
textarea.ed-grid { min-height: 90px; }

/* ---------- yerlesim ---------- */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.side {
  border-right: 1px solid var(--line); padding: 28px 18px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
}
.mark { font: 600 21px/1 var(--cond); letter-spacing: 0.02em; }
.mark small { display: block; font: 400 12px/1.4 var(--sans); color: var(--muted); letter-spacing: 0; margin-top: 6px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 9px 12px; border-radius: var(--radius-s);
  border-left: 2px solid transparent;
}
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a.on { color: var(--text); background: var(--panel); border-left-color: var(--act); }
.side .who { margin-top: auto; color: var(--muted); font-size: 13px; }
.side .who button { margin-top: 6px; }
main { padding: 32px 40px 80px; max-width: 1240px; width: 100%; min-width: 0; }

h1 { font: 600 30px/1.15 var(--cond); margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font: 600 19px/1.3 var(--cond); margin: 36px 0 12px; }
h3 { font: 600 15px/1.4 var(--sans); margin: 0 0 8px; }
.lede { color: var(--muted); margin: 0 0 28px; max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- formlar ---------- */
.form { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px 24px; align-items: start; max-width: 980px; }
.form > label, .form > .lab { padding-top: 8px; color: var(--muted); font-size: 14px; }
.field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hint { flex-basis: 100%; color: var(--muted); font-size: 13px; }
input[type=text], input[type=password], input[type=number], input[type=date], select, textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; min-width: 0;
}
input[type=number] { width: 110px; }
textarea { width: 100%; min-height: 180px; font: 13px/1.45 ui-monospace, "SFMono-Regular", Menlo, monospace; }
input:focus, select:focus, textarea:focus { border-color: var(--act); outline: none; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; flex-wrap: wrap; }
.seg button { background: transparent; border: 0; padding: 7px 12px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--act); color: var(--ink); font-weight: 600; }
.check { display: inline-flex; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-s); cursor: pointer; }
.check input { accent-color: var(--act); }
.params { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 14px; width: 100%; }
.params label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.params input, .params select { width: 100%; }

button.btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 14px; cursor: pointer;
}
button.btn:hover { border-color: var(--muted); }
button.primary { background: var(--act); border-color: var(--act); color: var(--ink); font-weight: 600; padding: 10px 20px; }
button.primary:hover { filter: brightness(1.08); }
button.quiet { background: transparent; border: 0; color: var(--muted); padding: 4px 6px; cursor: pointer; }
button.quiet:hover { color: var(--text); }
button.danger:hover { color: var(--loss); border-color: var(--loss); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.actions { grid-column: 2; display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.err { color: var(--loss); }

/* coin secici */
.picker { width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; min-height: 8px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 13px; }
.chip button { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0 4px; font-size: 15px; line-height: 1; }
.chip button:hover { color: var(--loss); }
.suggest { position: relative; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.suggest input { width: 220px; }
.dropdown { position: absolute; top: 40px; left: 0; z-index: 5; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-s); max-height: 260px; overflow-y: auto; width: 260px; }
.dropdown button { display: flex; justify-content: space-between; width: 100%; background: none; border: 0; padding: 7px 10px;
  cursor: pointer; text-align: left; }
.dropdown button:hover, .dropdown button.hl { background: var(--panel-2); }

/* ---------- sonuc ---------- */
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.meta { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.progress { height: 6px; background: var(--panel); border-radius: 3px; overflow: hidden; width: 100%; max-width: 520px; }
.progress div { height: 100%; background: var(--act); transition: width 0.4s; }
.figures { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.fig { background: var(--panel); padding: 14px 16px; }
.fig b { display: block; font: 600 22px/1.2 var(--cond); }
.fig span { color: var(--muted); font-size: 13px; }
.pos { color: var(--gain); }
.neg { color: var(--loss); }

/* sans seridi: sayfanin imza ogesi */
.chance { margin: 6px 0 30px; padding: 22px 24px 18px; background: var(--panel); border-radius: var(--radius-m);
  border: 1px solid var(--line); }
.chance .verdict { font: 600 20px/1.3 var(--cond); margin: 0 0 4px; }
.chance .verdict.good { color: var(--gain); }
.chance .verdict.mid { color: var(--amber); }
.chance .verdict.bad { color: var(--muted); }
.chance svg { width: 100%; height: 110px; display: block; margin-top: 14px; }
.chance .axis { fill: var(--muted); font-size: 11px; }
.chance .dot { fill: var(--muted); opacity: 0.55; }
.chance .marker { stroke: var(--act); stroke-width: 2; }
.chance .mlabel { fill: var(--act); font-size: 12px; font-weight: 600; }
.chance .zero { stroke: var(--line); stroke-dasharray: 3 3; }

.chartbox { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; height: 320px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 8px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; background: var(--panel); position: sticky; top: 0; cursor: default; }
th.sort { cursor: pointer; }
th.sort:hover { color: var(--text); }
td:first-child, th:first-child { text-align: left; }
td.l, th.l { text-align: left; }
tr:last-child td { border-bottom: 0; }
tr.control td { background: rgba(141, 162, 184, 0.08); color: var(--muted); }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--panel); }
.heat td { padding: 6px 8px; font-size: 13px; }
.status { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }
.status.done { color: var(--gain); border-color: rgba(43, 196, 138, 0.4); }
.status.error { color: var(--loss); border-color: rgba(242, 89, 107, 0.4); }
.status.running, .status.queued { color: var(--act); border-color: rgba(63, 182, 217, 0.4); }
.status.pending, .status.archived, .status.cancelled { color: var(--muted); }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; }
.notes { color: var(--muted); font-size: 13px; padding-left: 18px; }

/* indikator kutuphanesi */
.lib { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.lib-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 16px 18px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.lib-row:last-child { border-bottom: 0; }
.lib-row p { margin: 2px 0 0; color: var(--muted); font-size: 14px; max-width: 70ch; }
.lib-row .acts { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }
.lib-edit { grid-column: 1 / -1; display: grid; gap: 14px; padding-top: 6px; }
.lib-row.archived { opacity: 0.6; }

/* giris */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }
.login .mark { font-size: 30px; margin-bottom: 8px; }
.login input { width: 100%; padding: 11px 12px; }

.toast { position: fixed; bottom: 22px; right: 22px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 10px 16px; max-width: 420px; z-index: 20; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; align-items: center; padding: 14px 16px; gap: 16px;
    border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .mark small, .side .who { display: none; }
  .nav { flex-direction: row; }
  .nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .nav a.on { border-bottom-color: var(--act); }
  main { padding: 22px 16px 60px; }
  .form { grid-template-columns: 1fr; gap: 6px; }
  .form > label, .form > .lab { padding-top: 12px; }
  .actions { grid-column: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
