/* NodeCost — Nodemade marka dili: siyah / beyaz / gri, Inter Tight. */
:root {
  --bg: #FFFFFF;
  --soft: #F4F4F4;
  --card: #EFEFEF;
  --ink: #000000;
  --ink-2: #191919;
  --text: #595959;
  --muted: #8E8E93;
  --line: #E0E0E0;
  --line-strong: #CCCCCC;
  --neg: #C62828;
  --radius: 20px;
  --max: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --field: 42px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-padding-top: 88px; }
body {
  font-family: "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Üst bar ---------- */
.logo { font-size: 24px; letter-spacing: -0.045em; line-height: 1; white-space: nowrap; }
.logo b { font-weight: 700; }
.logo span { font-weight: 300; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 28px; height: 64px; }
.tabs { display: flex; gap: 2px; background: var(--soft); padding: 4px; border-radius: 999px; }
.tabs a { font-size: 14px; font-weight: 500; padding: 7px 16px; border-radius: 999px; color: var(--ink-2); transition: background .2s, color .2s; }
.tabs a:hover { background: var(--card); }
.tabs a.active { background: var(--ink); color: #fff; }
.session-note { margin-left: auto; font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.session-note::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }

/* ---------- Sayfa başlığı ---------- */
.page-head { padding: 40px 0 28px; }
.page-head h1 { font-size: clamp(32px, 4vw, 48px); letter-spacing: -0.04em; font-weight: 700; line-height: 1.05; }
.page-head p { margin-top: 10px; color: var(--text); max-width: 760px; }
.page-head.split { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

/* ---------- Yerleşim ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; padding-bottom: 64px; }
.col-main { display: grid; gap: 16px; min-width: 0; }
.col-side { position: sticky; top: 88px; display: grid; gap: 12px; } /* top, uzun panelde app.js'te ayarlanır */

.card { background: var(--soft); border-radius: var(--radius); padding: 24px 28px; }
.card.tight { padding: 20px 22px; }
.card.plain { background: transparent; padding: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.card-head p { font-size: 14px; color: var(--text); margin-top: 2px; }
.card-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-strong); display: flex; justify-content: flex-end; gap: 36px; flex-wrap: wrap; }
.card-foot div { display: grid; text-align: right; }
.card-foot span { font-size: 12px; color: var(--muted); }
.card-foot strong { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* ---------- Form ---------- */
.fields { display: grid; gap: 14px; }
.fields.three { grid-template-columns: 2fr 1fr 1fr; }
.fields.two { grid-template-columns: 1fr 1fr; }
.fields.gap-top { margin-top: 14px; }
.field { display: grid; gap: 6px; align-content: start; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field small { font-size: 12px; color: var(--muted); }

.in {
  font: inherit; font-size: 15px; color: var(--ink);
  height: var(--field); width: 100%; min-width: 0; padding: 0 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, box-shadow .15s;
}
.in::placeholder { color: #B0B0B5; }
.in:hover { border-color: var(--line-strong); }
.in:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.in.invalid { border-color: var(--neg); box-shadow: 0 0 0 3px rgba(198,40,40,.12); }
input.in[data-num] { text-align: right; font-variant-numeric: tabular-nums; }
select.in {
  appearance: none; cursor: pointer; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23595959' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* ---------- Gider satırları ---------- */
.grid-head { display: grid; gap: 10px; font-size: 12px; font-weight: 500; color: var(--muted); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.col-main .card { container-type: inline-size; }
.fixed-grid { grid-template-columns: minmax(140px, 1fr) 140px 160px 130px 32px; grid-template-areas: "name mode value total del"; }
.var-grid { grid-template-columns: minmax(140px, 1fr) 132px 140px 88px 120px 32px; grid-template-areas: "name mode value qty total del"; }
.row .name { grid-area: name; }
.row .mode { grid-area: mode; }
.row .value { grid-area: value; }
.row .qty { grid-area: qty; }
.row .total { grid-area: total; }
.row .del { grid-area: del; }
.r { text-align: right; }
.rows { display: grid; gap: 8px; }
.row { display: grid; gap: 10px; align-items: start; }
.num { position: relative; }
.num .in { padding-right: 46px; }
.num .suffix {
  position: absolute; right: 12px; top: 0; height: var(--field);
  display: flex; align-items: center;
  font-size: 12px; color: var(--muted); pointer-events: none;
}
.value .hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; padding-left: 2px; font-variant-numeric: tabular-nums; }
.num .hint { text-align: right; }
.value .hint:empty { display: none; }
.relink {
  display: block; width: 100%; margin-top: 4px; padding: 0;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--text); text-align: right;
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
}
.relink:hover { color: var(--ink); }
.total {
  height: var(--field); display: flex; align-items: center; justify-content: flex-end;
  font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.del {
  width: 32px; height: var(--field); border: 0; background: none; border-radius: 10px;
  color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer;
}
.del:hover { color: var(--ink); background: var(--card); }
.add {
  margin-top: 12px; width: 100%; height: var(--field);
  border: 1px dashed var(--line-strong); border-radius: 12px; background: transparent;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.add:hover { border-color: var(--ink); background: #fff; }
.add.sm { width: auto; height: 34px; padding: 0 14px; margin-top: 0; }
.cat-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.empty { font-size: 13px; color: var(--muted); padding: 6px 2px; }

.cat { padding: 14px 0 16px; border-bottom: 1px solid var(--line); }
.cat:first-child { padding-top: 0; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cat-name { font-weight: 600; font-size: 15px; background: transparent; border-color: transparent; padding-left: 6px; max-width: 320px; }
.cat-name:hover { background: #fff; }
.cat-total { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }

/* ---------- Sonuç paneli ---------- */
.result { background: var(--ink); color: #fff; border-radius: var(--radius); padding: 24px; }
.eyebrow { font-size: 13px; font-weight: 500; color: #A6A6A6; display: flex; align-items: center; gap: 8px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.result .big { font-size: clamp(34px, 3.2vw, 42px); font-weight: 700; letter-spacing: -0.04em; line-height: 1.1; margin-top: 8px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result .sub { color: #A6A6A6; font-size: 13px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.result .sub.tiny { color: #7F7F7F; font-size: 12px; margin-top: 2px; }
.result .sub:empty { display: none; }
.breakdown { margin-top: 18px; border-top: 1px solid #2A2A2A; padding-top: 12px; display: grid; gap: 10px; }
.breakdown div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.breakdown dt small { display: block; color: #7F7F7F; font-size: 12px; }
.breakdown dd { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.kv { display: grid; gap: 8px; }
.kv div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.kv dt { color: var(--text); }
.kv dt small { color: var(--muted); font-size: 12px; }
.kv dd { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.kv .strong { border-top: 1px solid var(--line-strong); padding-top: 9px; margin-top: 2px; }
.kv .strong dt { color: var(--ink); font-weight: 600; }
.kv .strong dd { font-size: 17px; }
.kv.small div { font-size: 13px; }
.kv.small .strong dd { font-size: 15px; }
.neg { color: var(--neg) !important; }

.mini-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.mini-head h3 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.link { font-size: 13px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

.meter { display: flex; height: 8px; margin-top: 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; transition: width .3s; }
.m-cash { background: var(--ink); }
.m-transfer { background: repeating-linear-gradient(-45deg, #8E8E93 0 3px, #B5B5B5 3px 6px); }

.transfer { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-strong); display: grid; gap: 12px; justify-items: start; }
.transfer .kv { width: 100%; }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 14px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--line-strong); transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(0,0,0,.2); }
.switch:has(input:disabled) { opacity: .45; cursor: not-allowed; }
.note { font-size: 13px; color: var(--text); }

.seg { display: inline-flex; gap: 2px; padding: 3px; background: #fff; border: 1px solid var(--line); border-radius: 999px; }
.seg button { border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.seg button:hover { background: var(--soft); }
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; }

/* ---------- Onay ---------- */
.approve { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 2px; }
.approve-msg { grid-column: 1 / -1; font-size: 13px; color: var(--text); padding: 0 4px 2px; }
.approve-msg.err { color: var(--neg); }
.approve-msg.ok b { color: var(--ink); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 18px; border-radius: 999px;
  background: var(--ink); color: #fff; border: 1px solid var(--ink);
  font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: transform .2s, background .2s, color .2s;
}
.btn:hover:not(:disabled) { background: #333; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover:not(:disabled) { background: var(--ink); color: #fff; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:focus-visible, .add:focus-visible, .del:focus-visible, .seg button:focus-visible, .tabs a:focus-visible, .stepper button:focus-visible {
  outline: 2px solid var(--ink); outline-offset: 2px;
}

/* ---------- Ayarlar ---------- */
.settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding-bottom: 64px; align-items: start; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-strong); background: #fff; font-size: 20px; cursor: pointer; transition: border-color .15s; }
.stepper button:hover { border-color: var(--ink); }
.stepper label { position: relative; }
.stepper .in { width: 120px; height: 46px; font-size: 20px; font-weight: 600; text-align: center !important; padding-right: 34px; }
.stepper label span { position: absolute; right: 14px; top: 0; height: 46px; display: flex; align-items: center; font-size: 13px; color: var(--muted); pointer-events: none; }
.money-in { display: flex; gap: 10px; align-items: center; }
.money-in .in { flex: 1; height: 46px; font-size: 18px; }
.rank-table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.rank-table th { font-size: 12px; font-weight: 500; color: var(--muted); text-align: right; padding: 0 0 6px; border-bottom: 1px solid var(--line-strong); }
.rank-table td { text-align: right; padding: 7px 0; border-bottom: 1px solid var(--line); }
.rank-table th:first-child, .rank-table td:first-child { text-align: left; }
.rank-table td:first-child { font-weight: 600; }
.rank-table tr:last-child td { border-bottom: 0; }
.calc-line { margin-top: 14px; font-size: 14px; color: var(--text); }
.calc-line b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Bildirim ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.toast.err { background: var(--neg); }

.mobile-bar { display: none; }

/* ---------- Duyarlı ---------- */
/* Gider satırları kart genişliğine göre alt alta dizilir. */
@container (max-width: 660px) {
  .grid-head.fixed-grid { display: none; }
  .row.fixed-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) 32px;
    grid-template-areas: "name name name del" "mode value total total";
    padding-bottom: 10px; border-bottom: 1px solid var(--line);
  }
}
@container (max-width: 720px) {
  .grid-head.var-grid { display: none; }
  .row.var-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 92px minmax(0, 1fr) 32px;
    grid-template-areas: "name name name name del" "mode value qty total total";
    padding-bottom: 10px; border-bottom: 1px solid var(--line);
  }
}
@container (max-width: 460px) {
  .row.fixed-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; grid-template-areas: "name name del" "mode value value" "total total total"; }
  .row.var-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; grid-template-areas: "name name del" "mode value value" "qty total total"; }
  .row .total { justify-content: space-between; }
  .row .total::before { content: attr(data-label); font-weight: 400; color: var(--muted); font-size: 13px; }
}

@media (max-width: 1100px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .col-side { position: static; }
  .mobile-bar {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 30;
    padding: 12px 20px; border-radius: 999px;
    background: var(--ink); color: #fff; font-size: 13px;
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
  }
  .mobile-bar strong { font-size: 17px; font-variant-numeric: tabular-nums; }
  .toast { bottom: 84px; }
  main { padding-bottom: 72px; }
}
@media (max-width: 760px) {
  .card { padding: 20px 18px; }
  .fields.three, .fields.two, .settings { grid-template-columns: minmax(0, 1fr); }
  .card-foot { justify-content: space-between; gap: 16px; }
  .cat-name { max-width: none; }
}
@media (max-width: 600px) {
  .session-note { display: none; }
  .bar { justify-content: space-between; gap: 12px; }
  .page-head { padding: 28px 0 20px; }
  .approve { grid-template-columns: 1fr; }
}
