:root {
  --brand: #d71920;
  --brand-dark: #ad1016;
  --brand-soft: #fdf0f0;
  --ink: #141414;
  --ink-2: #3a3a3a;
  --muted: #6f6f6f;
  --faint: #9a9a9a;
  --line: #e4e2de;
  --line-2: #efede9;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --pos: #1f7a3f;
  --pos-soft: #ecf6ef;
  --neg: #c0261d;
  --neg-soft: #fbeeed;
  --warn: #9a6200;
  --warn-soft: #fdf4e3;
  --info: #24527a;
  --info-soft: #edf3f9;
  --c1: #141414;
  --c2: #d71920;
  --c3: #9b9690;
  --c4: #24527a;
  --radius: 4px;
  --side: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tab-nums { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.strong { font-weight: 600; }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

/* ---------- Giriş ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); }
.login-left { display: flex; flex-direction: column; justify-content: center; padding: 64px clamp(24px, 7vw, 110px); }
.login-left img { width: 280px; max-width: 100%; }
.login-left h1 { font-size: 22px; margin: 36px 0 4px; letter-spacing: -.01em; }
.login-left p { margin: 0 0 28px; color: var(--muted); }
.login-form { display: grid; gap: 14px; max-width: 360px; }
.login-right { background: var(--ink); color: #fff; padding: 64px clamp(24px, 6vw, 90px); display: flex; flex-direction: column; justify-content: space-between; }
.login-right .rows { display: grid; gap: 0; margin-top: 40px; border-top: 1px solid rgba(255,255,255,.14); }
.login-right .rows div { display: flex; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.14); font-size: 13px; color: rgba(255,255,255,.72); }
.login-right .rows strong { color: #fff; font-variant-numeric: tabular-nums; }
.login-right small { color: rgba(255,255,255,.45); font-size: 12px; }
.login-right .tag { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: rgba(255,255,255,.5); display: flex; align-items: center; gap: 10px; }
.login-right .tag::before { content: ""; width: 28px; height: 1px; background: var(--brand); }
.login-right h2 { font-size: 30px; line-height: 1.15; letter-spacing: -.02em; margin: 18px 0 0; max-width: 420px; font-weight: 700; }

/* ---------- Kabuk ---------- */
.shell { display: grid; grid-template-columns: var(--side) 1fr; min-height: 100vh; }
.side { background: var(--panel); border-right: 1px solid var(--line); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.side-logo { padding: 20px 20px 16px; border-bottom: 1px solid var(--line-2); }
.side-logo img { width: 150px; display: block; }
.side-logo span { display: block; font-size: 11px; color: var(--faint); margin-top: 6px; letter-spacing: .04em; }
.nav { padding: 12px 10px; display: grid; gap: 1px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius); color: var(--ink-2); font-weight: 500; }
.nav a svg { width: 17px; height: 17px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; color: var(--faint); }
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--ink); color: #fff; }
.nav a.active svg { color: #fff; }
.nav a .count { margin-left: auto; font-size: 11px; background: var(--brand); color: #fff; border-radius: 10px; padding: 0 6px; line-height: 17px; }
.side-foot { margin-top: auto; padding: 14px 20px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }

.main { min-width: 0; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.topbar .spacer { flex: 1; }
.topbar .date { font-size: 12.5px; color: var(--muted); }
.topbar .menu-btn { display: none; }
.content { padding: 24px 28px 60px; max-width: 1400px; }

/* ---------- Bileşenler ---------- */
.btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel); font-weight: 550; font-size: 13px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #cfccc7; background: #fbfaf8; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #2a2a2a; border-color: #2a2a2a; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-ghost { border-color: transparent; background: transparent; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line-2); }
.panel-head h2, .panel-head h3 { font-size: 14px; margin: 0; font-weight: 650; }
.panel-head .sub { font-size: 12px; color: var(--muted); }
.panel-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.panel-body { padding: 16px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g-main { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.mt { margin-top: 16px; }
.mt2 { margin-top: 24px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.kpi { padding: 16px 18px; border-left: 1px solid var(--line-2); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi .v { font-size: 22px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 4px; }

table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 9px 12px; border-bottom: 1px solid var(--line); background: #fbfaf8; white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.t tbody tr:last-child td { border-bottom: 0; }
.t tbody tr.link { cursor: pointer; }
.t tbody tr.link:hover td { background: #faf9f6; }
.t tfoot td { padding: 10px 12px; border-top: 1px solid var(--line); font-weight: 650; background: #fbfaf8; }
.t .first { padding-left: 16px; }
.t .lastc { padding-right: 16px; }
.table-wrap { overflow-x: auto; }

.badge { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 3px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--line-2); color: var(--ink-2); }
.b-pos { background: var(--pos-soft); color: var(--pos); }
.b-neg { background: var(--neg-soft); color: var(--neg); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-dark { background: var(--ink); color: #fff; }

.bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--ink); }
.bar.red > i { background: var(--brand); }
.pct { display: flex; align-items: center; gap: 10px; }
.pct .bar { flex: 1; }
.pct b { font-weight: 600; font-size: 12.5px; width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.input, .select { height: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 0 10px; min-width: 0; }
.input:focus, .select:focus, textarea:focus { outline: 2px solid rgba(215,25,32,.18); border-color: var(--brand); }
.search { position: relative; }
.search svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; stroke: var(--faint); fill: none; stroke-width: 2; }
.search .input { padding-left: 32px; width: 260px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); overflow: hidden; }
.seg button { border: 0; background: none; height: 32px; padding: 0 12px; font-size: 13px; cursor: pointer; color: var(--muted); border-left: 1px solid var(--line-2); }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--ink); color: #fff; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 550; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--brand); }

.proj-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 18px; }
.proj-code { width: 46px; height: 46px; border-radius: var(--radius); background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 18px; flex: none; }
.proj-head h2 { margin: 0; font-size: 20px; letter-spacing: -.015em; }
.proj-head .meta { color: var(--muted); font-size: 13px; margin-top: 3px; display: flex; gap: 14px; flex-wrap: wrap; }
.proj-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); display: block; }
.pcard:hover { border-color: #cbc8c2; }
.pcard .top { display: flex; gap: 12px; padding: 16px; border-bottom: 1px solid var(--line-2); align-items: center; }
.pcard .top .proj-code { width: 38px; height: 38px; font-size: 15px; }
.pcard h3 { margin: 0; font-size: 15px; }
.pcard .top .muted { font-size: 12.5px; }
.pcard .top .badge { margin-left: auto; }
.pcard dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; }
.pcard dl div { padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
.pcard dl div:nth-child(odd) { border-right: 1px solid var(--line-2); }
.pcard dt { font-size: 11.5px; color: var(--muted); }
.pcard dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pcard .foot { padding: 12px 16px; }
.pcard .foot .muted { font-size: 12px; display: flex; justify-content: space-between; margin-bottom: 6px; }

.pl { display: grid; gap: 0; }
.pl .row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.pl .row.sub { padding-left: 14px; color: var(--muted); font-size: 13px; }
.pl .row.total { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; font-size: 15px; padding-top: 11px; }

.list { display: grid; }
.list .li { display: flex; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line-2); }
.list .li:last-child { border-bottom: 0; }
.list .li .grow { flex: 1; min-width: 0; }
.list .li .t1 { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .li .t2 { font-size: 12px; color: var(--muted); }
.datebox { width: 44px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); flex: none; line-height: 1.1; padding: 5px 0; }
.datebox b { display: block; font-size: 16px; }
.datebox span { font-size: 10.5px; text-transform: uppercase; color: var(--muted); }
.datebox.soon { border-color: var(--brand); }
.datebox.soon b { color: var(--brand); }

.acc-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.acc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; cursor: pointer; }
.acc.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.acc label { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.acc .v { font-size: 20px; font-weight: 650; margin-top: 6px; font-variant-numeric: tabular-nums; }
.acc .d { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; gap: 12px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
svg.chart { width: 100%; height: auto; display: block; overflow: visible; }
svg.chart text { font-family: inherit; font-size: 11px; fill: var(--muted); }
svg.chart .grid-line { stroke: var(--line-2); }
svg.chart .axis { stroke: var(--line); }
svg.chart rect.hov:hover { opacity: .82; }
.tip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 9px; border-radius: 3px; z-index: 50; white-space: nowrap; font-variant-numeric: tabular-nums; display: none; }

.empty { padding: 36px; text-align: center; color: var(--muted); }
.note { font-size: 12.5px; color: var(--muted); background: #fbfaf8; border: 1px dashed var(--line); border-radius: var(--radius); padding: 10px 12px; }

.person-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.person-head .avatar { width: 48px; height: 48px; font-size: 16px; }
.person-head h2 { margin: 0; font-size: 20px; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(20,20,20,.42); display: none; align-items: flex-start; justify-content: center; padding: 60px 16px; z-index: 40; overflow-y: auto; }
.modal-bg.on { display: flex; }
.modal { background: var(--panel); width: 560px; max-width: 100%; border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0,0,0,.18); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-head button { margin-left: auto; }
.modal-body { padding: 18px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: flex-end; gap: 8px; }
.field { display: grid; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field .input, .field .select { width: 100%; height: 36px; }
.field textarea { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; min-height: 64px; resize: vertical; }
.field .hint { font-size: 11.5px; color: var(--faint); }

.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 13px; z-index: 60; display: none; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .g4, .acc-cards { grid-template-columns: repeat(2, 1fr); }
  .g-main { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi:nth-child(3) { border-left: 0; }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; z-index: 30; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.15); }
  .side.open { transform: none; }
  .topbar .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .topbar .date { display: none; }
  .content { padding: 16px 16px 48px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-right { display: none; }
  .search .input { width: 100%; }
  .search { flex: 1; }
  .modal-body { grid-template-columns: 1fr; }
  .kpi .v { font-size: 18px; }
}
@media (max-width: 520px) {
  .acc-cards { grid-template-columns: 1fr; }
  .topbar .btn-label { display: none; }
}
