:root {
  --bg: #f6f5f1;
  --fg: #1f1f1c;
  --muted: #7a786f;
  --soft: #eceae3;
  --softer: #f0eee8;
  --accent: #1f3a2e;
  --accent-fg: #f6f5f1;
  --pos: #2f6f4f;
  --neg: #b4442f;
  --warn: #a8661b;
  --gold: #c39a4a;
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141413;
    --fg: #e9e7e0;
    --muted: #8d8b82;
    --soft: #222220;
    --softer: #1b1b19;
    --accent: #d9e4dc;
    --accent-fg: #141413;
    --pos: #7fbf99;
    --neg: #e58a74;
    --warn: #e0a85a;
    --gold: #d9b56a;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 13.5px/1.6 var(--font);
  font-feature-settings: 'tnum' 1, 'cv11' 1;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--pos); }
p { margin: 0 0 .6em; }
h1, h2, h3 { font-weight: 500; margin: 0; }
h1.serif, .serif { font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.05; letter-spacing: -.01em; }
h2 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 14px; font-weight: 500; }
h3 { font-size: 14px; margin: 0 0 10px; }
code { font-size: 12px; background: var(--soft); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
.warn { color: var(--warn); }
.error { color: var(--neg); }
.num { font-variant-numeric: tabular-nums; }
.num.neg { color: var(--neg); }
.num.pos { color: var(--pos); }

/* ---------- iskelet ---------- */
.shell { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 100vh; }
.nav { position: sticky; top: 0; height: 100vh; padding: 28px 18px; display: flex; flex-direction: column; gap: 26px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; }
.links { display: flex; flex-direction: column; gap: 2px; }
.links a { padding: 6px 10px; border-radius: 8px; color: var(--muted); }
.links a:hover { color: var(--fg); background: var(--softer); }
.links a.on { color: var(--fg); background: var(--soft); }
.out { margin-top: auto; padding-left: 10px; }
main { padding: 36px 48px 80px; max-width: 1060px; width: 100%; }
main.narrow { max-width: 380px; margin: 0 auto; padding-top: 14vh; }
section { margin: 0 0 44px; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 10px; flex-wrap: wrap; }
.kicker { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 5px 11px; border-radius: 999px; color: var(--muted); font-size: 12.5px; }
.tabs a.on { background: var(--soft); color: var(--fg); }

.flash { padding: 10px 14px; border-radius: 10px; background: var(--soft); margin-bottom: 22px; }
.flash.error { color: var(--neg); }

/* ---------- özet ---------- */
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: 30px 0 40px; }
.label { font-size: 12px; color: var(--muted); margin: 0 0 2px; }
.big { font-family: var(--serif); font-size: 34px; line-height: 1.1; margin: 0; }
.big-sm { font-family: var(--serif); font-size: 28px; line-height: 1.1; margin: 0 0 6px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.todo { display: flex; gap: 22px; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; background: var(--softer); margin-top: -10px; }
.todo a { color: var(--warn); }
.more { font-size: 12.5px; color: var(--muted); }

.bars { position: relative; display: flex; align-items: flex-end; gap: 10px; height: 96px; margin: 6px 0 22px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar span { width: 100%; max-width: 34px; background: var(--soft); border-radius: 5px 5px 2px 2px; }
.bar.over span { background: var(--warn); }
.bar small { position: absolute; bottom: -19px; font-size: 11px; color: var(--muted); }
.limit { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--muted); opacity: .5; }

.meter { height: 6px; background: var(--soft); border-radius: 99px; overflow: hidden; margin: 4px 0 12px; }
.meter span { display: block; height: 100%; background: var(--pos); }

ul.dl { list-style: none; margin: 0 0 8px; padding: 0; }
ul.dl li { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; }
ul.dl li.soon > :first-child { color: var(--warn); }
ul.dl li.late > :first-child { color: var(--neg); }
ul.dl.big li { padding: 14px 0; }
ul.dl.big li + li { box-shadow: 0 -1px 0 var(--softer); }
ul.dl.big p { margin: 2px 0 0; max-width: 560px; }

.starter ul.checks { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 32px; }
.checks li { padding: 4px 0 4px 22px; position: relative; break-inside: avoid; }
.checks li::before { content: ''; position: absolute; left: 0; top: 10px; width: 10px; height: 10px; border-radius: 3px; background: var(--soft); }
.checks li.done { color: var(--muted); text-decoration: line-through; }
.checks li.done::before { background: var(--pos); }

/* ---------- tablo ---------- */
table.t { width: 100%; border-collapse: collapse; }
.t th { font-weight: 400; font-size: 11.5px; color: var(--muted); text-align: left; padding: 0 10px 8px; }
.t th.r { text-align: right; }
.t td { padding: 9px 10px; vertical-align: top; }
.t tbody tr:nth-child(odd) td { background: var(--softer); }
.t tbody tr td:first-child { border-radius: 8px 0 0 8px; }
.t tbody tr td:last-child { border-radius: 0 8px 8px 0; }
.t.list tbody tr { cursor: pointer; }
.t.list tbody tr:hover td { background: var(--soft); }
.t tr.rev td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.sub { font-size: 12px; color: var(--muted); margin-top: 1px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.tag { font-size: 11px; padding: 0 7px; border-radius: 99px; background: var(--soft); color: var(--muted); }
.tag.warn { color: var(--warn); }
.empty { padding: 40px 0; color: var(--muted); }
.empty a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- form ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input:not([type=radio]):not([type=checkbox]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; background: var(--soft); border: 0; border-radius: 9px; padding: 9px 12px; outline: none;
  transition: background .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { background: var(--softer); box-shadow: 0 0 0 2px var(--soft); }
textarea { resize: vertical; font-family: var(--font); }
textarea[name$=p8], textarea[name$=key], textarea[name$=account] { font: 11.5px/1.4 ui-monospace, monospace; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px !important; }
label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
label > input, label > select, label > textarea { color: var(--fg); font-size: 13.5px; }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
legend { font-size: 12px; color: var(--muted); padding: 0; margin-bottom: 6px; width: 100%; }
fieldset label { flex-direction: row; align-items: center; gap: 7px; color: var(--fg); font-size: 13.5px; }
input[type=radio], input[type=checkbox] { accent-color: var(--pos); margin: 0; }

.btn { background: var(--accent); color: var(--accent-fg); border: 0; border-radius: 9px; padding: 9px 18px; cursor: pointer; font-weight: 500; display: inline-block; }
.btn:hover { opacity: .9; color: var(--accent-fg); }
.btn.quiet { background: var(--soft); color: var(--fg); }
.btn:disabled { opacity: .5; cursor: default; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); }
.link:hover { color: var(--fg); }
.link:disabled { opacity: .4; cursor: default; }
.danger:hover { color: var(--neg); }

.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.auth { text-align: left; }
.auth h1 { margin: 14px 0 6px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; }
.grid .wide { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; gap: 18px; margin-top: 22px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row input:not([type=color]) { flex: 1; min-width: 160px; width: auto !important; }
.row.add { margin-top: 14px; max-width: 640px; }
.row.inline { flex-wrap: nowrap; }
.plain { background: transparent !important; padding: 2px 0 !important; }
.swatch { width: 22px; height: 22px; border: 0; padding: 0; background: none; border-radius: 50%; overflow: hidden; cursor: pointer; flex: none; }
.swatch::-webkit-color-swatch-wrapper { padding: 0; }
.swatch::-webkit-color-swatch { border: 0; border-radius: 50%; }

.filters { display: flex; gap: 10px; margin: 22px 0 18px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto !important; min-width: 140px; }
.filters input[type=search] { flex: 1; min-width: 160px; }
.chip { padding: 6px 12px; border-radius: 99px; background: var(--soft); font-size: 12.5px; }
.chip.on { color: var(--warn); }

/* ekle formu */
.tx { margin-top: 22px; }
.seg { display: flex; gap: 6px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.seg label { flex-direction: row; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { padding: 7px 16px; border-radius: 99px; color: var(--muted); font-size: 13.5px; }
.seg input:checked + span { background: var(--accent); color: var(--accent-fg); }
.seg .other-kind { width: auto !important; display: none; margin-left: 4px; }
.tx[data-kind=other] .other-kind { display: block; }
.tx:not([data-kind=expense]) .for-expense { display: none; }
.tx:not([data-kind=income]) .for-income { display: none; }
.tx[data-kind=salary] .paid { display: flex; }
.drop { background: var(--softer); border-radius: 14px; padding: 22px; margin-bottom: 22px; text-align: center; transition: background .15s; }
.drop.over { background: var(--soft); }
.drop p { margin: 0; }
.drop .link { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.docs { margin-top: 20px; display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; }
.docs a { text-decoration: underline; text-underline-offset: 3px; }
.attach { margin-top: 14px; }

/* içe aktar, ayarlar */
.src { padding: 18px 20px; background: var(--softer); border-radius: 14px; margin-bottom: 14px; }
.src-head { display: flex; justify-content: space-between; align-items: baseline; }
.src h2 { color: var(--fg); text-transform: none; letter-spacing: 0; font-size: 15px; margin-bottom: 6px; }
.src form { margin-top: 8px; }
.keys { padding: 20px; background: var(--softer); border-radius: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 16px; }
.keys .actions { margin-top: 0; }
.keys em.ok { font-style: normal; color: var(--pos); margin-left: 6px; }
.keys small { font-size: 11.5px; line-height: 1.5; }

/* asistan */
.chat { display: flex; flex-direction: column; gap: 16px; max-width: 760px; }
.msgs { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.msg { line-height: 1.65; }
.msg.user { align-self: flex-end; background: var(--soft); padding: 9px 14px; border-radius: 14px 14px 4px 14px; max-width: 80%; }
.msg.assistant { max-width: 100%; }
.msg p:last-child { margin: 0; }
.msg ul { margin: 0 0 .6em; padding-left: 18px; }
.msg.thinking { color: var(--muted); }
.ask { display: flex; gap: 10px; align-items: flex-end; position: sticky; bottom: 16px; }
.ask textarea { min-height: 42px; max-height: 200px; }

/* ---------- mobil ---------- */
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav { position: sticky; height: auto; padding: 12px 16px; flex-direction: row; align-items: center; gap: 14px; background: var(--bg); z-index: 5; overflow-x: auto; }
  .links { flex-direction: row; }
  .links a { white-space: nowrap; padding: 5px 9px; }
  .brand span, .out { display: none; }
  main { padding: 18px 16px 60px; }
  h1.serif { font-size: 32px; }
  .figures { grid-template-columns: 1fr 1fr; gap: 20px; }
  .big { font-size: 26px; }
  .cols { grid-template-columns: 1fr; gap: 0; }
  .grid { grid-template-columns: 1fr 1fr; }
  .starter ul.checks { columns: 1; }
  .t.list th:nth-child(3), .t.list td:nth-child(3), .t.list th:nth-child(4), .t.list td:nth-child(4) { display: none; }
}

/* şirket arşivi */
h3.grp { font-size: 13px; font-weight: 500; margin: 22px 0 8px; }
.t.facts td:first-child { width: 38%; }
.reveal, .copy { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.reveal { color: var(--muted); }
.copy.done::after, .reveal.done::after { content: ' kopyalandı'; color: var(--pos); font-size: 11.5px; }
details.add-fact { margin-top: 18px; }
details.add-fact summary { list-style: none; display: inline-block; margin-bottom: 14px; }
details.add-fact summary::-webkit-details-marker { display: none; }
.upload { margin-top: 26px; padding: 20px; background: var(--softer); border-radius: 14px; }
