/* Inter (SIL OFL, wwwroot/fonts/LICENSE-Inter.txt) — değişken kalınlık; Türkçe karakterler latin-ext'te */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/inter-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900; src: url("../fonts/inter-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* ═════════ Tokens ═════════ */
:root {
  color-scheme: light;
  --bg: #f6f6f7;
  --surface: #ffffff;
  --surface-2: #f8f8f9;
  --surface-3: #f1f1f3;
  --hover: #f3f3f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #5f5f68;
  --text-subtle: #8e8e98;
  --accent: #0051c3;
  --accent-hover: #003f99;
  --accent-soft: #ebf2fc;
  --accent-text: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdf1ef;
  --chart-muted: #b9b9c1;
  --grid-line: #ececef;
  --overlay: rgba(9, 9, 11, .45);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  --radius: 6px;
  --radius-lg: 8px;
  --topbar-h: 48px;
  --sidebar-w: 224px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0c0e;
  --surface: #141417;
  --surface-2: #18181c;
  --surface-3: #1e1e23;
  --hover: #1d1d22;
  --border: #26262c;
  --border-strong: #34343b;
  --text: #ececef;
  --text-muted: #a1a1aa;
  --text-subtle: #71717a;
  --accent: #4d8ef7;
  --accent-hover: #6ea3ff;
  --accent-soft: rgba(77, 142, 247, .14);
  --accent-text: #08101f;
  --danger: #f97066;
  --danger-soft: rgba(249, 112, 102, .1);
  --chart-muted: #4a4a53;
  --grid-line: #222227;
  --overlay: rgba(0, 0, 0, .6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0c0c0e;
    --surface: #141417;
    --surface-2: #18181c;
    --surface-3: #1e1e23;
    --hover: #1d1d22;
    --border: #26262c;
    --border-strong: #34343b;
    --text: #ececef;
    --text-muted: #a1a1aa;
    --text-subtle: #71717a;
    --accent: #4d8ef7;
    --accent-hover: #6ea3ff;
    --accent-soft: rgba(77, 142, 247, .14);
    --accent-text: #08101f;
    --danger: #f97066;
    --danger-soft: rgba(249, 112, 102, .1);
    --chart-muted: #4a4a53;
    --grid-line: #222227;
    --overlay: rgba(0, 0, 0, .6);
  }
}

/* ═════════ Base ═════════ */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 13.5px/1.5 var(--font); font-feature-settings: "cv11", "ss01"; font-optical-sizing: auto; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 19px; line-height: 1.3; }
h2 { font-size: 14px; }
p { margin: 0; }
kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.strong { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.skip-link:focus { left: 8px; }
.print-only { display: none; }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}

/* ═════════ Shell ═════════ */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; font-size: 14px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 5px; background: var(--accent); color: var(--accent-text); }
.brand-mark .icon { width: 15px; height: 15px; }
.brand-sub { color: var(--text-muted); padding-left: 10px; margin-left: 2px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }

.main { flex: 1; min-width: 0; padding: 20px 24px 40px; }

/* ═════════ Page header ═════════ */
.crumbs { display: flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--text-muted); margin-bottom: 4px; }
.crumbs a { color: var(--text-muted); }
.crumbs .icon { width: 12px; height: 12px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .meta { margin-top: 2px; color: var(--text-muted); font-size: 12.5px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ═════════ Buttons ═════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 12px;
  font: inherit; font-weight: 500; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(.92); background: var(--danger); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn-lg { height: 38px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0;
  color: var(--text-muted); background: transparent; border: 1px solid transparent; border-radius: var(--radius); cursor: pointer;
}
.icon-btn:hover { color: var(--text); background: var(--hover); border-color: var(--border); text-decoration: none; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.inline { display: inline; margin: 0; }
.segmented { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.seg-btn { display: grid; place-items: center; width: 30px; height: 100%; color: var(--text-muted); }
.seg-btn:hover { background: var(--hover); color: var(--text); }
.seg-label { padding: 0 10px; font-weight: 500; min-width: 104px; text-align: center; border-left: 1px solid var(--border); border-right: 1px solid var(--border); line-height: 30px; }

/* ═════════ Cards & layout ═════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 14px; border-bottom: 1px solid var(--border); }
.card-head .meta { color: var(--text-muted); font-size: 12.5px; }
.card-body { padding: 14px; }
.layout-2-1, .layout-1-1, .layout-side { display: grid; gap: 16px; margin-top: 16px; align-items: start; }
.layout-2-1 { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.layout-1-1 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.layout-side { grid-template-columns: minmax(0, 1fr) 320px; }
.layout-2-1 > .card, .layout-1-1 > .card { height: 100%; }
.stack { display: grid; gap: 16px; align-content: start; }

/* ═════════ KPIs ═════════ */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px 14px; min-width: 0; }
.kpi-label { display: block; font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.kpi-value { display: block; margin-top: 2px; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value.accent { color: var(--accent); }
.kpi-sub { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; font-size: 12px; color: var(--text-subtle); }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 0 5px; height: 18px; border-radius: 4px; background: var(--surface-3); color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; }
.delta .icon { width: 12px; height: 12px; }
.balance-pair { display: grid; grid-template-columns: 1fr 1fr; }
.balance-pair a { padding: 12px 14px; color: inherit; }
.balance-pair a + a { border-left: 1px solid var(--border); }
.balance-pair a:hover { background: var(--hover); text-decoration: none; }
.balance-pair .kpi-value { font-size: 17px; }

/* ═════════ Toolbar ═════════ */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.toolbar-spacer { flex: 1; }
.search { position: relative; flex: 0 1 260px; min-width: 180px; }
.search .icon { position: absolute; left: 9px; top: 8px; color: var(--text-subtle); pointer-events: none; }
.search .input { padding-left: 30px; }
.date-range { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 9px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.date-range .input { border: 0; height: 28px; padding: 0 4px; width: 128px; background: transparent; }
.date-range .input:focus { box-shadow: none; }
.date-range:focus-within { border-color: var(--accent); box-shadow: var(--ring); }

/* ═════════ Tables ═════════ */
.table-wrap { overflow-x: auto; }
.table-wrap.bordered { border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
  height: 34px; padding: 0 10px; text-align: left; font-weight: 500; font-size: 12px; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--hover); }
.table tbody tr[data-edit] { cursor: default; }
.table tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 0; }
.table .row-actions { width: 1%; white-space: nowrap; text-align: right; padding-top: 3px; padding-bottom: 3px; }
.table .row-actions > * { vertical-align: middle; }
.table tbody .row-actions { opacity: .55; }
.table tbody tr:hover .row-actions, .table tbody .row-actions:focus-within { opacity: 1; }
.cell-link { color: inherit; }
.cell-link:hover { color: var(--accent); }
.grid thead tr:first-child th { position: sticky; top: 0; z-index: 2; }
.grid tbody td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; }
.sort:hover { color: var(--text); text-decoration: none; }
.sort.active { color: var(--text); }
.sort-icon { width: 12px; height: 12px; opacity: .35; }
.sort.active .sort-icon { opacity: 1; color: var(--accent); }
th.num .sort { flex-direction: row-reverse; }
.filter-row th { height: auto; padding: 4px 6px 6px; background: var(--surface-2); font-weight: 400; }
.filter-row .input, .filter-row .combo-btn { min-width: 90px; }
.empty-row:hover td { background: transparent !important; }
.empty { display: grid; justify-items: center; gap: 4px; padding: 36px 16px; text-align: center; color: var(--text-muted); }
.empty strong { color: var(--text); font-weight: 500; }

/* ═════════ Pager ═════════ */
.pager-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.pager-info { display: flex; align-items: center; gap: 16px; color: var(--text-muted); }
.pager-info strong { color: var(--text); font-weight: 500; }
.pager-size { display: inline-flex; align-items: center; gap: 8px; }
.pager-size .input { width: 72px; }
.pager { display: flex; align-items: center; gap: 2px; }
.page-btn { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: var(--radius); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.page-btn:hover { background: var(--hover); border-color: var(--border); color: var(--text); text-decoration: none; }
.page-btn.current { border-color: var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; }
.page-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.page-gap { min-width: 20px; text-align: center; color: var(--text-subtle); }

/* ═════════ Badges ═════════ */
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; font-size: 12px; font-weight: 500; color: var(--text-muted); background: var(--surface-3); border: 1px solid var(--border); border-radius: 4px; white-space: nowrap; }
.badge-accent { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.badges { display: inline-flex; gap: 4px; flex-wrap: wrap; }

/* ═════════ Forms ═════════ */
.input {
  display: block; width: 100%; height: 32px; padding: 0 10px;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.input-sm { height: 28px; font-size: 12.5px; padding: 0 8px; }
.input-lg { height: 38px; font-size: 14px; }
textarea.input { height: auto; min-height: 68px; padding: 7px 10px; resize: vertical; }
select.input {
  padding-right: 28px; appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e98' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 14px;
}
.input::placeholder { color: var(--text-subtle); }
.input:hover { border-color: var(--text-subtle); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.input.input-validation-error, .combo.input-validation-error .combo-btn { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid + .form-grid { margin-top: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.label { font-size: 12.5px; font-weight: 500; color: var(--text); display: inline-flex; align-items: center; }
.req { color: var(--text-subtle); margin-left: 3px; }
.tip { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 6px; border: 1px solid var(--border-strong); border-radius: 50%; font-size: 10px; font-weight: 600; color: var(--text-muted); cursor: help; }
.field-error { font-size: 12px; color: var(--danger); }
.field-error:empty, .field-validation-valid { display: none; }
.field-warn { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-muted); }
.field-warn .icon { width: 13px; height: 13px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; min-height: 30px; }
.checkbox { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); }
.check-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 16px; }
.check-list.scroll { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 10px; }
.check-filter { margin-bottom: 6px; max-width: 260px; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-subtle); pointer-events: none; }
.input-icon > .input { padding-left: 34px; }
.input-action { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-subtle); border-radius: var(--radius); cursor: pointer; }
.input-action:hover { color: var(--text); background: var(--hover); }

/* Form paneli: sayfada kart, modalda pencere içeriği */
.form-panel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); max-width: 760px; }
.form-panel.form-wide { max-width: 920px; }
.main > .form-panel { margin: 0 auto; }
.form-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.form-head h2 { font-size: 15px; }
.form-head .meta { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.form-close { display: none; margin: -4px -6px 0 0; }
.form-body { padding: 16px; overflow-y: auto; }
.form-body > .alert { margin: 0 0 14px; }
.form-section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.perm-tools { display: inline-flex; gap: 2px; text-transform: none; letter-spacing: 0; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.kbd-hint { margin-right: auto; font-size: 12px; }
.perm-table td { height: 36px; }
.perm-table td:first-child { font-weight: 500; }

/* ═════════ Modal ═════════ */
.modal { padding: 0; border: 0; background: transparent; width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 48px); color: var(--text); overflow: visible; }
.modal.modal-wide { width: min(920px, calc(100vw - 24px)); }
.modal.modal-sm { width: min(420px, calc(100vw - 24px)); }
.modal::backdrop { background: var(--overlay); }
.modal[open] { animation: modal-in .14s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.modal .form-panel { max-width: none; max-height: calc(100vh - 48px); border-color: var(--border-strong); }
.modal .form-close { display: inline-grid; }
.modal-loading { display: grid; place-items: center; height: 160px; background: var(--surface); border-radius: var(--radius-lg); color: var(--text-muted); }

/* ═════════ Combobox ═════════ */
.combo { position: relative; }
.combo > select { position: absolute; inset: 0; opacity: 0; pointer-events: none; width: 100%; }
.combo-btn {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 32px; padding: 0 8px 0 10px;
  font: inherit; text-align: left; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer;
}
.combo-btn:hover { border-color: var(--text-subtle); }
.combo-btn:focus-visible, .combo.open .combo-btn { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.combo-btn .combo-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.combo-btn .combo-text.placeholder { color: var(--text-subtle); }
.combo-btn .icon { width: 14px; height: 14px; color: var(--text-subtle); }
.combo-sm .combo-btn { height: 28px; font-size: 12.5px; padding-left: 8px; }
.combo-pop {
  position: fixed; z-index: 1000; min-width: 220px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}
.combo-pop .combo-search { margin: 6px; width: auto; height: 30px; }
.combo-list { max-height: 260px; overflow-y: auto; padding: 0 4px 4px; margin: 0; list-style: none; }
.combo-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 5px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt[aria-selected="true"] { font-weight: 600; color: var(--accent); }
.combo-opt.active { background: var(--hover); }
.combo-opt.clear { color: var(--text-muted); }
.combo-note { padding: 8px 10px; color: var(--text-muted); font-size: 12.5px; }
.combo-more { margin: 0 4px 4px; }

/* ═════════ Alerts & toast ═════════ */
.alert { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; margin-bottom: 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); }
.alert .icon { margin-top: 2px; }
.alert-error { border-color: color-mix(in srgb, var(--danger) 35%, transparent); border-left-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.alert ul { margin: 0; padding-left: 16px; }
.validation-summary-valid { display: none; }
.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 1100; display: grid; gap: 8px; }
.toast { padding: 10px 14px; background: var(--text); color: var(--surface); border-radius: var(--radius); font-weight: 500; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); animation: modal-in .15s ease-out; }
.main > .toast { display: none; }

/* ═════════ Menu ═════════ */
.menu { position: relative; }
.menu > summary { list-style: none; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: var(--radius); cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--hover); }
.menu > summary.btn { padding: 0 10px; }
.avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border); font-size: 10.5px; font-weight: 600; color: var(--text-muted); }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 200px; padding: 4px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); z-index: 40; box-shadow: 0 8px 24px rgba(0, 0, 0, .1); }
.menu-list.menu-left { left: 0; right: auto; min-width: 160px; }
.menu-head { padding: 8px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-item { display: flex; width: 100%; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 0; background: none; font: inherit; color: var(--text); border-radius: var(--radius); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--hover); text-decoration: none; }

/* ═════════ Charts ═════════ */
.chart-body { padding: 10px 12px 6px; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--grid-line); stroke-width: 1; }
.chart .grid-line.baseline { stroke: var(--border-strong); }
.chart .axis-label { fill: var(--text-subtle); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .axis-label.strong { fill: var(--text); font-weight: 600; }
.chart .bar-income { fill: var(--accent); }
.chart .bar-expense { fill: var(--chart-muted); }
.chart .hit { fill: transparent; }
.chart .bar-group:hover .hit, .chart .bar-group:focus .hit { fill: var(--hover); }
.chart .bar-group.selected .hit { fill: var(--accent-soft); }
.chart .bar-group:focus { outline: none; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.legend .l-income { background: var(--accent); }
.legend .l-expense { background: var(--chart-muted); }
.chart-tip { position: fixed; z-index: 1200; pointer-events: none; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); font-size: 12.5px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); white-space: nowrap; font-variant-numeric: tabular-nums; }
.chart-tip div:first-child { font-weight: 600; margin-bottom: 2px; }
.meter-row { display: grid; grid-template-columns: 116px 1fr auto 48px; gap: 10px; align-items: center; padding: 7px 4px; color: inherit; border-radius: var(--radius); }
.meter-row:hover { background: var(--hover); text-decoration: none; }
.meter-label { font-weight: 500; }
.meter { display: block; position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; min-width: 40px; }
.meter-sm { height: 5px; }
.meter-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--accent); }
.margin-cell { display: grid; grid-template-columns: minmax(48px, 1fr) 48px; gap: 8px; align-items: center; min-width: 110px; }
.rank-list { list-style: none; margin: 0; padding: 4px 0; }
.rank-list li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px 14px; }
.rank-list li + li { border-top: 1px solid var(--border); }
.rank-list .meter { grid-column: 1 / -1; }
.rank-name { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-sub { grid-column: 1 / -1; font-size: 12px; }
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }

/* ═════════ Tabs, KV ═════════ */
.tabs { display: flex; gap: 4px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.tab { display: inline-flex; align-items: center; height: 40px; padding: 0 8px; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 7px 12px; margin: 0; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv-inline { grid-template-columns: auto 1fr auto 1fr auto 1fr; margin-bottom: 14px; }
.diff td { vertical-align: top; overflow-wrap: anywhere; }
.diff .old { color: var(--text-muted); text-decoration: line-through; }

/* ═════════ Auth ═════════ */
.auth-page {
  min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto;
  background-color: var(--bg);
  background-image: radial-gradient(var(--border) 1px, transparent 1px);
  background-size: 20px 20px;
}
.auth-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; }
.auth-main { display: grid; place-items: center; padding: 16px; }
.auth-box { width: 100%; max-width: 380px; }
.auth-heading { margin-bottom: 16px; }
.auth-heading h1 { font-size: 22px; }
.auth-heading p { margin-top: 2px; }
.auth-card { display: grid; gap: 14px; padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.auth-card .alert { margin: 0; }
.auth-help { margin-top: 14px; font-size: 12.5px; text-align: center; }
.auth-foot { padding: 16px 20px; font-size: 12px; text-align: center; }

/* ═════════ Responsive ═════════ */
.only-mobile { display: none; }
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-2-1, .layout-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .only-mobile { display: inline-grid; }
  .brand-sub { display: none; }
  .main { padding: 16px 16px 32px; }
  .layout-1-1 { grid-template-columns: minmax(0, 1fr); }
  .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .kpis, .kpis-3 { grid-template-columns: minmax(0, 1fr); }
  .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
  .search { flex: 1 1 100%; }
  .kv, .kv-inline { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 8px; }
  .kbd-hint { display: none; }
  .meter-row { grid-template-columns: 1fr auto; }
  .meter-row .meter, .meter-row .meter-pct { display: none; }
}

/* ═════════ Print (grid dışı sayfalar) ═════════ */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; font-size: 11px; }
  .topbar, .sidebar, .actions, .toolbar, .row-actions, .pager-bar, .filter-row, .skip-link, .toast-region, dialog { display: none !important; }
  .print-only { display: flex; }
  .print-head { justify-content: space-between; gap: 12px; padding-bottom: 6px; margin-bottom: 10px; border-bottom: 2px solid #000; }
  .main { padding: 0; }
  .card, .kpi { border-color: #bbb; break-inside: avoid; }
  .layout-2-1, .layout-1-1, .layout-side { grid-template-columns: 1fr; }
  .table th { background: #fff; color: #000; border-bottom: 1.5px solid #000; }
  .table tbody tr:hover td { background: transparent; }
}

.modal .form-body { flex: 1; min-height: 0; }


/* ═════════ Takvim ═════════ */
.dp-wrap { position: relative; }
.dp-wrap .input { padding-right: 34px; font-variant-numeric: tabular-nums; }
.dp-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 28px; height: 26px; border: 0; border-radius: var(--radius); background: none; color: var(--text-subtle); cursor: pointer; }
.dp-btn:hover { background: var(--hover); color: var(--text); }
.daterange-btn { gap: 8px; font-variant-numeric: tabular-nums; }
.cal-pop { position: fixed; z-index: 1000; display: flex; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 10px 28px rgba(0, 0, 0, .14); padding: 10px; flex-direction: column; width: 280px; }
.cal-range { flex-direction: row; width: auto; padding: 0; }
.cal-presets { display: flex; flex-direction: column; gap: 1px; padding: 8px; border-right: 1px solid var(--border); min-width: 132px; }
.cal-preset { text-align: left; height: 30px; padding: 0 10px; border: 0; border-radius: var(--radius); background: none; color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.cal-preset:hover { background: var(--hover); }
.cal-preset.selected { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.cal-main { padding: 10px; width: 280px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.cal-title { border: 0; background: none; font: inherit; font-weight: 600; color: var(--text); padding: 4px 8px; border-radius: var(--radius); cursor: pointer; }
.cal-title:hover, .cal-nav:hover { background: var(--hover); }
.cal-nav { width: 30px; height: 30px; border: 0; border-radius: var(--radius); background: none; font-size: 18px; line-height: 1; color: var(--text-muted); cursor: pointer; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-subtle); padding: 4px 0; }
.cal-day { height: 34px; border: 0; border-radius: var(--radius); background: none; font: inherit; font-variant-numeric: tabular-nums; color: var(--text); cursor: pointer; }
.cal-day:hover { background: var(--hover); }
.cal-day.other { color: var(--text-subtle); }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--border-strong); font-weight: 600; }
.cal-day.in-range { background: var(--accent-soft); border-radius: 0; }
.cal-day.selected { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cal-month { height: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: none; font: inherit; color: var(--text); cursor: pointer; }
.cal-month:hover { background: var(--hover); }
.cal-month.selected { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.cal-range-info { margin-right: auto; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.combo-opt.create { color: var(--accent); font-weight: 500; }
@media (max-width: 640px) { .cal-range { flex-direction: column; } .cal-presets { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--border); } }

/* ═════════ Kategorik seri renkleri (dataviz doğrulanmış palet) ═════════ */
:root { --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600; --s5: #ee7fac; --s6: #008a17; --s7: #6a4ce2; --s8: #ec4647; }
:root[data-theme="dark"] { --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef; --s8: #eb6263; } }
.s1 { --c: var(--s1); } .s2 { --c: var(--s2); } .s3 { --c: var(--s3); } .s4 { --c: var(--s4); }
.s5 { --c: var(--s5); } .s6 { --c: var(--s6); } .s7 { --c: var(--s7); } .s8 { --c: var(--s8); }
.chart .bar { fill: var(--c); stroke: var(--surface); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.chart .dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.chart .hit.on { fill: var(--hover); }
.legend i[class^="s"], .tip-row i { background: var(--c); }
.legend { flex-wrap: wrap; justify-content: flex-end; max-width: 70%; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.tip-row span { flex: 1; color: var(--text-muted); }
.tip-row b { font-weight: 600; }
.tip-total { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); font-weight: 600; }

/* ═════════ Rapor gezgini (üst çubuk) ═════════ */
.report-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.report-ds { width: auto; min-width: 220px; font-weight: 600; }
.report-bar { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 16px; }
.rb-field { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.rb-field .input { width: auto; }
.rb-menu > summary { max-width: 260px; }
.rb-menu > summary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; }
.rb-list { min-width: 220px; }
.rb-list .menu-item { font-weight: 400; }
.rb-list-title { padding: 6px 10px 4px; font-size: 11.5px; color: var(--text-subtle); }
.rb-filter { width: 190px; }
.seg-sm { height: 30px; }
.seg-opt { position: relative; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt > span { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 9px; color: var(--text-muted); font-size: 12.5px; font-weight: 500; }
.seg-opt + .seg-opt > span { border-left: 1px solid var(--border); }
.seg-opt:hover > span { color: var(--text); background: var(--hover); }
.seg-opt input:checked + span { color: var(--accent); background: var(--accent-soft); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg-opt .icon { width: 14px; height: 14px; }
.explore-totals { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.explore-chart-card { margin-bottom: 16px; }
.explore-chart { width: 100%; min-height: 320px; }
.explore-chart .chart { width: 100%; height: auto; }
.explore-table { max-height: 520px; overflow: auto; }
.explore-table thead th { position: sticky; top: 0; z-index: 1; }
.timerange { display: inline-block; }
.timerange-btn span { flex: 1; text-align: left; }
@media (max-width: 900px) { .seg-text { display: none; } .rb-filter { width: 100%; } .report-bar { position: static; } }

/* ═════════ Zaman aralığı seçici ═════════ */
.tr-pop { width: 520px; max-width: calc(100vw - 16px); padding: 0; }
.tr-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--border); }
.tr-tab { height: 34px; padding: 0 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font: inherit; font-weight: 500; color: var(--text-muted); cursor: pointer; }
.tr-tab:hover { color: var(--text); }
.tr-tab.active { color: var(--text); border-bottom-color: var(--accent); }
.tr-body { padding: 12px; }
.tr-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tr-group { display: flex; flex-direction: column; gap: 2px; }
.tr-group-title { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-subtle); padding: 0 8px 4px; }
.tr-option { text-align: left; height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius); background: none; font: inherit; color: var(--text); cursor: pointer; }
.tr-option:hover { background: var(--hover); }
.tr-option.selected { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tr-last { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.tr-last .input { width: 80px; }
.tr-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.tr-cal { max-width: 300px; margin: 0 auto; }
.tr-hint { margin-top: 8px; font-size: 12px; }
.tr-preview { margin-right: auto; font-size: 12.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tr-preview strong { color: var(--text); font-weight: 600; }
.tr-pop .cal-foot { margin: 0; padding: 10px 12px; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 640px) { .tr-groups { grid-template-columns: 1fr 1fr; } }

/* ═════════ Menü başlığı (daraltma düğmesi sağ üstte) ═════════ */


/* ═════════ Excel içe aktarma ═════════ */
.dropzone { display: grid; justify-items: center; gap: 6px; padding: 26px 16px; margin: 10px 0 12px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-muted); cursor: pointer; text-align: center; position: relative; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .icon { width: 22px; height: 22px; }
.import-template a { display: inline-flex; align-items: center; gap: 6px; }
.import-errors { max-height: 260px; overflow: auto; margin-bottom: 12px; }

/* ═════════ Tablo düzenleme (Excel benzeri) ═════════ */
.sheet-card { overflow: hidden; }
.sheet-hints { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 12px; }
.sheet-hints kbd { margin-right: 2px; }
.sheet-status { font-size: 12.5px; margin-right: 4px; }
.sheet-wrap { overflow: auto; max-height: calc(100vh - 240px); }
.sheet { border-collapse: separate; border-spacing: 0; font-size: 13px; min-width: 100%; }
.sheet th { position: sticky; top: 0; z-index: 2; height: 32px; padding: 0 8px; background: var(--surface-2); border-bottom: 1px solid var(--border-strong); border-right: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text-muted); text-align: left; white-space: nowrap; }
.sheet th.num { text-align: right; }
.sheet td { padding: 0; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--surface); }
.sheet .sheet-rownum { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; padding: 0 8px; text-align: right; color: var(--text-subtle); background: var(--surface-2); font-variant-numeric: tabular-nums; font-size: 12px; }
.sheet th.sheet-rownum { z-index: 3; }
.sheet .sheet-state { width: 28px; min-width: 28px; text-align: center; font-weight: 700; color: var(--danger); cursor: help; }
.sheet .cell { display: block; width: 100%; min-width: 130px; height: 30px; padding: 0 8px; border: 0; outline: none; background: transparent; font: inherit; color: var(--text); }
.sheet td.num .cell { text-align: right; font-variant-numeric: tabular-nums; min-width: 100px; }
.sheet .cell:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); position: relative; z-index: 1; }
.sheet .cell.changed { background: var(--accent-soft); }
.sheet .cell.error { box-shadow: inset 0 0 0 2px var(--danger); background: var(--danger-soft); }
.sheet tr.dirty .sheet-rownum { color: var(--accent); font-weight: 700; }
.sheet tr.has-error .sheet-rownum { color: var(--danger); }

/* ═════════ Rapor kataloğu ═════════ */
.report-catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 16px; align-items: start; }
.report-list { list-style: none; margin: 0; padding: 4px; }
.report-list a { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 9px 10px; border-radius: var(--radius); color: var(--text); }
.report-list a:hover { background: var(--hover); text-decoration: none; }
.report-list .rl-title { font-weight: 500; }
.report-list .rl-desc { grid-column: 1; font-size: 12.5px; color: var(--text-muted); }
.report-list .icon { grid-row: 1 / span 2; grid-column: 2; }
.report-title .meta { font-size: 12.5px; margin-top: 2px; }


/* Tablo düzenleme: açılır liste hücreleri ve satır silme */
.sheet td.has-list { position: relative; }
.sheet td.has-list .cell { padding-right: 26px; cursor: pointer; }
.sheet .cell-chevron { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; color: var(--text-subtle); cursor: pointer; }
.sheet td.has-list:hover .cell-chevron { color: var(--text); background: var(--hover); }
.sheet-list { position: fixed; z-index: 1000; max-height: 260px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: 0 8px 24px rgba(0, 0, 0, .12); font-size: 13px; }
.sheet-list-opt { padding: 6px 8px; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.sheet-list-opt.active, .sheet-list-opt:hover { background: var(--hover); }
.sheet-list-opt.selected { color: var(--accent); font-weight: 600; }
.sheet-list-empty { padding: 6px 8px; color: var(--text-muted); }
.sheet .sheet-rownum { width: 56px; min-width: 56px; }
.sheet .row-del { display: none; margin-left: 4px; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 4px; background: none; color: var(--text-subtle); cursor: pointer; vertical-align: middle; }
.sheet .row-del .icon { width: 13px; height: 13px; }
.sheet tr:hover .row-del, .sheet tr:focus-within .row-del, .sheet tr.deleted .row-del { display: inline-grid; place-items: center; }
.sheet tr:hover .rn, .sheet tr:focus-within .rn { display: none; }
.sheet tr.deleted .rn { display: none; }
.sheet .row-del:hover { color: var(--danger); background: var(--danger-soft); }
.sheet tr.deleted td { background: var(--danger-soft); }
.sheet tr.deleted .cell { text-decoration: line-through; color: var(--text-muted); }
.sheet tr.deleted .row-del { color: var(--danger); }


/* ═════════ Menü (rehber): tam / mini / mobil çekmece ═════════ */
:root { --guide-w: 220px; --guide-mini: 64px; }
.topbar { padding: 0 16px 0 12px; gap: 6px; }
.guide-btn { width: 40px; height: 40px; border-radius: 50%; color: var(--text); }
.guide-btn .icon { width: 20px; height: 20px; }
.topbar-brand { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.topbar-brand:hover { text-decoration: none; }

.app { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.app > .main { flex: 1; min-width: 0; }
.sidebar {
  position: sticky; top: var(--topbar-h); flex: none; width: var(--guide-w); height: calc(100vh - var(--topbar-h));
  overflow-y: auto; overflow-x: hidden; padding: 10px 8px 20px; background: var(--surface); border-right: 0;
  scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
.sidebar:hover { scrollbar-color: var(--border-strong) transparent; }
.guide-head { display: none; }
.nav-backdrop { display: none; }

/* Arama */
.g-search { position: relative; display: flex; align-items: center; margin-bottom: 8px; }
.g-search > .icon { position: absolute; left: 10px; width: 14px; height: 14px; color: var(--text-subtle); pointer-events: none; }
.g-search input { width: 100%; height: 30px; padding: 0 52px 0 30px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font: inherit; font-size: 13px; }
.g-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.g-search input::-webkit-search-cancel-button { display: none; }
.g-search kbd { position: absolute; right: 10px; font-size: 10.5px; color: var(--text-subtle); pointer-events: none; }
.g-search input:focus ~ kbd, .g-search input:not(:placeholder-shown) ~ kbd { display: none; }
.g-search-mini { display: none !important; }

/* Satırlar */
.g-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 30px; padding: 0 8px; border: 0; border-radius: var(--radius); background: none; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.g-item:hover { background: var(--hover); text-decoration: none; }
.g-item:focus-visible, .g-mini:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); }
.g-item .icon { flex: none; width: 16px; height: 16px; color: var(--text-muted); }
.g-item.active { background: var(--surface-3); font-weight: 500; }
.g-item.active .icon { color: var(--accent); }
.g-label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-label mark { background: none; color: var(--accent); font-weight: 700; }
.g-short { display: none; }

/* Bölümler */
.g-top { padding-bottom: 6px; }
.g-section { padding: 6px 0; border-top: 1px solid var(--border); }
.g-title { margin: 0; padding: 6px 8px 4px; font-size: 12px; font-weight: 600; color: var(--text-subtle); }
.g-mini { display: none; }
.g-empty { margin: 0; padding: 12px; color: var(--text-muted); font-size: 13px; }

/* ── Mini rehber (geniş ekranda ☰ ile) ── */
.guide-mini .sidebar { width: var(--guide-mini); padding: 6px 4px 16px; overflow-y: auto; }
.guide-mini .g-search, .guide-mini .g-section > .g-panel, .guide-mini .g-empty { display: none; }
.guide-mini .g-search-mini { display: flex !important; }
.guide-mini .g-top { padding: 0; }
.guide-mini .g-section { padding: 0; border: 0; position: relative; }
.guide-mini .g-top .g-item, .guide-mini .g-search-mini, .g-mini {
  flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 56px; height: 54px; padding: 8px 0 6px; margin: 0 0 2px;
  border: 0; border-radius: var(--radius); background: none; color: var(--text-muted); font: inherit; cursor: pointer;
}
.guide-mini .g-mini { display: flex; }
.guide-mini .g-top .g-item .g-label { display: none; }
.guide-mini .g-short, .g-mini .g-short { display: block; max-width: 60px; font-size: 10px; line-height: 1.2; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 400; }
.guide-mini .g-top .g-item.active, .g-mini.active { background: none; font-weight: 400; }
.g-mini .icon, .guide-mini .g-top .g-item .icon, .guide-mini .g-search-mini .icon { width: 18px; height: 18px; color: var(--text-muted); }
.g-mini.active .icon { color: var(--accent); }
.g-mini:hover, .g-mini[aria-expanded="true"], .guide-mini .g-top .g-item:hover, .guide-mini .g-search-mini:hover { background: var(--hover); }
/* Açılır panel (YouTube "Siz" menüsü gibi) */
.guide-mini .g-section.fly > .g-panel {
  display: block; position: fixed; left: calc(var(--guide-mini) + 4px); z-index: 50; width: 220px; max-height: calc(100vh - 24px); overflow-y: auto;
  padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg, 8px); background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
}
.guide-mini .g-section.fly > .g-panel::before { content: ""; position: absolute; left: -12px; top: 0; bottom: 0; width: 12px; }
.guide-mini .g-panel .g-title { padding: 4px 8px 6px; font-size: 12px; }
.guide-mini .g-panel .g-item { gap: 10px; }

/* ── Mobil: çekmece ── */
@media (max-width: 960px) {
  .sidebar { position: fixed; top: 0; left: 0; z-index: 60; width: var(--guide-w); height: 100vh; padding-top: 0; transform: translateX(-100%); transition: transform .2s ease; border-right: 1px solid var(--border); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 59; background: var(--overlay); }
  .guide-head { display: flex; align-items: center; gap: 8px; height: var(--topbar-h); margin: 0 -8px 8px; padding: 0 8px; }
  .guide-mini .sidebar { width: var(--guide-w); }
}
@media print { .sidebar, .nav-backdrop { display: none !important; } }
.g-item:hover .icon { color: var(--text); }
.g-mini.active, .guide-mini .g-top .g-item.active { color: var(--text); }
.guide-mini .g-top .g-item.active .icon { color: var(--accent); }

/* Dar form (parola değiştir) */
.form-panel.form-narrow { max-width: 420px; }
.form-stack { display: grid; gap: 12px; }

/* İki seçenekli düğme grubu (Durum: Aktif / Pasif) */
.seg { display: inline-flex; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); align-self: flex-start; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { display: inline-flex; align-items: center; padding: 0 14px; border-radius: 4px; font-size: 13px; color: var(--text-muted); cursor: pointer; user-select: none; }
.seg label:hover { color: var(--text); }
.seg input:checked + label { background: var(--surface); color: var(--text); font-weight: 500; box-shadow: 0 0 0 1px var(--border); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Yazılı küçük satır düğmesi (Ekstre, Seferler…) */
.btn-xs { height: 26px; padding: 0 8px; gap: 5px; font-size: 12.5px; margin-right: 2px; }
.btn-xs .icon { width: 14px; height: 14px; }

/* Tablo düzenle: tarih hücresi */
.sheet .has-date .dp-wrap { display: flex; align-items: center; width: 100%; height: 100%; }
.sheet .has-date .dp-wrap .cell { flex: 1; min-width: 0; }
.sheet .has-date .dp-btn { position: static; transform: none; flex: none; width: 22px; height: 22px; margin-right: 2px; opacity: .55; }
.sheet .has-date:hover .dp-btn, .sheet .has-date:focus-within .dp-btn { opacity: 1; }

/* Dar ekran: işlem kolonu sağa yapışık, tablo yatay kayar */
@media (max-width: 1200px) {
  .table.grid .row-actions { position: sticky; right: 0; z-index: 1; opacity: 1; background: var(--surface); box-shadow: inset 1px 0 0 var(--border); }
  .table.grid thead .row-actions { z-index: 3; background: var(--surface-2); }
  .table.grid tbody tr:hover .row-actions { background: var(--hover); }
}
@media (max-width: 640px) {
  .table.grid .row-actions { padding-left: 4px; padding-right: 4px; }
  .table.grid .row-actions .icon-btn { width: 28px; height: 28px; }
  .table.grid .row-actions .btn-xs { padding: 0 6px; }
  .table.grid .row-actions .btn-xs .icon { display: none; }
}

.print-frame { position: fixed; right: 0; bottom: 0; width: 0; height: 0; border: 0; visibility: hidden; }

/* Rapor: çoklu seçim filtresi */
.multi { position: relative; min-width: 0; }
.multi-pop { width: 260px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .10); }
.multi-pop > .input { width: 100%; }
.multi-list { max-height: 240px; overflow-y: auto; margin: 6px -4px; }
.multi-opt { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: var(--radius); font-size: 13px; cursor: pointer; }
.multi-opt:hover { background: var(--hover); }
.multi-empty { padding: 8px; color: var(--text-muted); font-size: 13px; }
.multi-foot { display: flex; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--border); }
/* Rapor özet kartları */
.explore-totals.kpis-1 { grid-template-columns: minmax(0, 1fr); }
.explore-totals.kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.explore-totals.kpis-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sheet td.has-date { min-width: 132px; }

/* ═════════ Özet kartları (KPI) ═════════ */
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; }
.kpi-label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); line-height: 1.3; }
.kpi-value { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.2; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-sub { margin: 0; font-size: 12px; line-height: 1.4; color: var(--text-muted); }
.kpi-sub .badge { height: 18px; font-size: 11.5px; }

/* ═════════ Geri bağlantısı ═════════ */
.back-link { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 6px -4px; padding: 2px 6px 2px 2px; border-radius: var(--radius); font-size: 13px; font-weight: 500; color: var(--text-muted); }
.back-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.back-link .icon { width: 16px; height: 16px; }

/* ═════════ Dar ekranda tablo araç çubuğu: yalnızca simge ═════════ */
@media (max-width: 640px) {
  .toolbar { gap: 6px; padding: 8px; }
  .toolbar .search { flex: 1 1 100%; }
  .toolbar .toolbar-spacer { display: none; }
  .toolbar .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .toolbar .btn-sm { padding: 0 9px; }
  .page-head .actions .btn { height: 32px; }
}

/* ═════════ Yardım ═════════ */
.help-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; max-width: 1100px; }
.help-toc { position: sticky; top: calc(var(--topbar-h) + 16px); display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.help-toc a { padding: 5px 10px; border-radius: var(--radius); color: var(--text-muted); }
.help-toc a:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.help-doc { padding: 24px 28px; line-height: 1.65; font-size: 14px; }
.help-doc h1 { font-size: 22px; margin-bottom: 8px; }
.help-doc h2 { font-size: 17px; margin: 32px 0 10px; padding-top: 20px; border-top: 1px solid var(--border); scroll-margin-top: calc(var(--topbar-h) + 12px); }
.help-doc h3 { font-size: 14px; margin: 20px 0 6px; }
.help-doc p { margin: 8px 0; }
.help-doc ul { margin: 8px 0; padding-left: 20px; }
.help-doc li { margin: 4px 0; }
.help-doc img { display: block; max-width: 100%; height: auto; margin: 12px 0 4px; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.help-doc video { display: block; width: 100%; margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: #000; }
.help-doc code { font-family: var(--mono); font-size: 12.5px; padding: 1px 5px; border-radius: 4px; background: var(--surface-3); }
@media (max-width: 960px) { .help-layout { grid-template-columns: minmax(0, 1fr); } .help-toc { display: none; } .help-doc { padding: 16px; } }
.help-btn { color: var(--text-muted); }
.row-link { color: var(--text); }
.row-link:hover { color: var(--accent); }
.g-bottom { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
.guide-mini .g-bottom { border: 0; }
/* Sıkı tablo (gösterge paneli kartları) */
.table-compact th, .table-compact td { padding-left: 8px; padding-right: 8px; }
.table-compact td { font-size: 13px; }
.table-compact .meter { min-width: 32px; }

/* ═════════ Para alanı: tutar + para birimi + kur ═════════ */
.money { display: flex; }
.money > .input:first-child { flex: 1; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; text-align: right; font-variant-numeric: tabular-nums; }
.money .money-cur { flex: none; width: 76px; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; background-color: var(--surface-2); font-weight: 500; }
.money > .input:focus, .money .money-cur:focus { position: relative; z-index: 1; }
.money-rate { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }
.money-rate[hidden] { display: none; }
.money-rate-label { flex: none; }
.money-rate .input { width: 110px; height: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.money-eq { flex: 1; min-width: 0; text-align: right; color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.money-eq.is-loading { color: var(--text-subtle); font-weight: 400; }
input[data-decimal] { font-variant-numeric: tabular-nums; }

/* Menü: kaydırma çubuğu yer değiştirmesin (hiza sabit); mini menüde gizli ama kaydırılabilir */
.sidebar { scrollbar-width: auto; scrollbar-color: auto; scrollbar-gutter: stable; }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.guide-mini .sidebar { scrollbar-gutter: auto; }
.guide-mini .sidebar::-webkit-scrollbar { width: 0; }

/* ═════════ Çoklu seçim (tek tip) ═════════ */
.multi-btn { width: 100%; min-width: 110px; max-width: 260px; gap: 6px; }
.rb-filter .multi-btn, .report-bar .multi-btn { width: auto; }
.multi-prefix { flex: none; color: var(--text-muted); }
.multi-btn.is-set { border-color: var(--accent); }
.multi-btn.is-set .combo-text { color: var(--accent); font-weight: 500; }
.multi-pop { position: fixed; z-index: 80; }

/* ═════════ Tıklanabilir bağlantılar: mavi ve altı çizili ═════════ */
.table td a:not(.btn):not(.icon-btn), .row-link, .kv dd a, .help-doc a, .card-body p a, .link {
  color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.table td a:not(.btn):not(.icon-btn):hover, .row-link:hover, .kv dd a:hover, .help-doc a:hover, .link:hover { text-decoration-color: currentColor; }

/* ☰: açık menüde simge sütunuyla hizalı (simge merkezi 8 + 8 + 8 = 24px), mini menüde 32px */
@media (min-width: 961px) {
  :root:not(.guide-mini) .topbar { padding-left: 4px; }
}

/* Yardım: daha sıkı */
.help-layout { max-width: none; grid-template-columns: 200px minmax(0, 960px); gap: 20px; }
.help-doc { padding: 20px 24px; }
.help-doc h2 { margin: 20px 0 8px; padding-top: 16px; }
.help-doc img { max-height: 520px; width: auto; object-fit: contain; object-position: left top; }
.kpis + .card, .card + .report-section { margin-top: 16px; }
.meter-inline { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; }
.meter-inline .meter { flex: 1; min-width: 60px; }
