/* =========================================================
   Defter teması — mürekkep yeşili, kâğıt beyazı, pirinç vurgu
   ========================================================= */
/* Para birimi sembolleri: Schibsted Grotesk'ün ₺ (TRY) çizimi £'ye çok benzediği için
   € ve £ dışındaki para birimi işaretleri sistem yazı tipiyle çizilir. */
@font-face {
    font-family: "Currency Symbols";
    src: local("Segoe UI"), local("SegoeUI"), local("Arial"), local("Helvetica Neue"), local("Roboto"), local("DejaVu Sans");
    unicode-range: U+20A0-20AB, U+20AD-20C0;
}
@font-face {
    font-family: "Currency Symbols";
    font-weight: 600 700;
    src: local("Segoe UI Semibold"), local("SegoeUI-Semibold"), local("Segoe UI Bold"), local("Arial Bold"), local("Arial-BoldMT"), local("Helvetica Neue Bold"), local("Roboto Bold"), local("DejaVu Sans Bold");
    unicode-range: U+20A0-20AB, U+20AD-20C0;
}

:root {
    --ink: #12343B;
    --ink-2: #1D4F59;
    --ink-3: #2A6672;
    --paper: #F3F6F6;
    --surface: #FFFFFF;
    --surface-2: #F8FAFA;
    --rule: #DCE4E5;
    --rule-strong: #C5D2D4;
    --text: #16252A;
    --muted: #5E7277;
    --in: #15784B;
    --out: #B3232F;
    --transfer: #3F6C78;
    --brass: #B4862A;
    --warn: #A15C07;
    --focus: rgba(180, 134, 42, .45);
    --side-text: #C9DADC;
    --side-muted: #86A3A8;
    --radius: 12px;
    --radius-sm: 8px;
    --ease: cubic-bezier(.2, .7, .2, 1);

    --bs-body-font-family: "Currency Symbols", "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-bg: var(--paper);
    --bs-body-color: var(--text);
    --bs-border-color: var(--rule);
    --bs-link-color: var(--ink-2);
    --bs-link-color-rgb: 29, 79, 89;
    --bs-link-hover-color: var(--ink);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--surface-2);
    --bs-body-font-size: .9375rem;
}

[data-bs-theme="dark"] {
    --ink: #0B2328;
    --ink-2: #4FA3B0;
    --ink-3: #6CB9C5;
    --paper: #0E1A1D;
    --surface: #142427;
    --surface-2: #182C30;
    --rule: #233A3F;
    --rule-strong: #2F4A50;
    --text: #E2ECED;
    --muted: #8DA4A9;
    --in: #4CC38A;
    --out: #F07A84;
    --transfer: #8BB4BE;
    --brass: #D9AE55;
    --warn: #E0A54A;
    --side-text: #C2D6D9;
    --side-muted: #7E9AA0;

    --bs-body-bg: var(--paper);
    --bs-body-color: var(--text);
    --bs-border-color: var(--rule);
    --bs-link-color: var(--ink-3);
    --bs-link-color-rgb: 108, 185, 197;
    --bs-link-hover-color: #9AD2DB;
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--muted);
    --bs-tertiary-bg: var(--surface-2);
}

html, body { background: var(--paper); }
body { font-feature-settings: "tnum" 0; transition: background-color .25s var(--ease), color .25s var(--ease); }
.num, .ledger-value, .tbl td.amt, .amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
a { text-underline-offset: 3px; }
h1, h2, h3, h4, h5, h6 { color: var(--text); }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* ---------- Bootstrap ince ayarları ---------- */
.btn { border-radius: var(--radius-sm); font-weight: 500; transition: background-color .15s, border-color .15s, color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background-image: none; --bs-btn-bg: var(--ink); --bs-btn-border-color: var(--ink); --bs-btn-hover-bg: var(--ink-2); --bs-btn-hover-border-color: var(--ink-2); --bs-btn-active-bg: var(--ink); --bs-btn-active-border-color: var(--ink); --bs-btn-disabled-bg: var(--ink); --bs-btn-disabled-border-color: var(--ink); }
[data-bs-theme="dark"] .btn-primary { background-image: none; --bs-btn-bg: #2A6672; --bs-btn-border-color: #2A6672; --bs-btn-hover-bg: #357A87; --bs-btn-hover-border-color: #357A87; --bs-btn-active-bg: #2A6672; }
.btn-outline-secondary { --bs-btn-color: var(--text); --bs-btn-border-color: var(--rule-strong); --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-color: var(--text); --bs-btn-hover-border-color: var(--rule-strong); --bs-btn-active-bg: var(--surface-2); --bs-btn-active-color: var(--text); }
.btn-ghost { background: transparent; border: 0; color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger-soft { color: var(--out); background: transparent; border: 1px solid var(--rule); }
.btn-danger-soft:hover { background: color-mix(in srgb, var(--out) 10%, transparent); border-color: color-mix(in srgb, var(--out) 40%, transparent); color: var(--out); }
.form-control, .form-select { border-radius: var(--radius-sm); border-color: var(--rule-strong); background-color: var(--surface); color: var(--text); }
.form-control:focus, .form-select:focus { border-color: var(--brass); box-shadow: 0 0 0 3px var(--focus); }
.form-check-input:checked { background-color: var(--ink-2); border-color: var(--ink-2); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--focus); border-color: var(--brass); }
.form-label { font-weight: 500; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.form-text { color: var(--muted); }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text); --bs-table-border-color: var(--rule); --bs-table-hover-bg: color-mix(in srgb, var(--ink-2) 5%, transparent); --bs-table-hover-color: var(--text); }

/* ---------- Kabuk ---------- */
.app-shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
    background: var(--ink); color: var(--side-text);
    display: flex; flex-direction: column; gap: 1.25rem; padding: 1.25rem .9rem 1rem;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
}
.brand { display: flex; align-items: center; gap: .6rem; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; padding: 0 .4rem; letter-spacing: -.01em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brass); color: #1b1404; font-size: 1rem; }
.side-section { display: flex; flex-direction: column; gap: .35rem; }
.side-heading { display: flex; justify-content: space-between; align-items: center; color: var(--side-muted); font-size: .8rem; font-weight: 500; padding: 0 .45rem; }
.side-add { color: var(--side-muted); text-decoration: none; border-radius: 6px; padding: 0 .3rem; }
.side-add:hover { color: #fff; background: rgba(255,255,255,.08); }
.company-list { display: flex; flex-direction: column; gap: 2px; max-height: 42vh; overflow-y: auto; }
.company-item {
    position: relative; display: flex; align-items: center; gap: .55rem;
    padding: .5rem .55rem; border-radius: var(--radius-sm); color: var(--side-text); text-decoration: none; font-size: .9rem;
    transition: background-color .15s;
}
.company-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.company-item.is-active { background: rgba(255,255,255,.09); color: #fff; }
.company-item.is-active::before { content: ""; position: absolute; left: -.9rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--brass); }
.company-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.company-cur { font-size: .75rem; color: var(--side-muted); }
.side-link-sm { color: var(--side-muted); font-size: .82rem; text-decoration: none; padding: .25rem .55rem; border-radius: 6px; }
.side-link-sm:hover, .side-link-sm.is-active { color: #fff; }
.side-link-sm i { margin-right: .35rem; }
.side-nav { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 1rem; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: var(--radius-sm); color: var(--side-text); text-decoration: none; font-weight: 500; font-size: .92rem; transition: background-color .15s, color .15s; }
.side-link i { font-size: 1.05rem; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.is-active { background: #fff; color: var(--ink); }
[data-bs-theme="dark"] .side-link.is-active { background: #1F3D43; color: #fff; }
.side-foot { margin-top: auto; display: flex; gap: .35rem; border-top: 1px solid rgba(255,255,255,.08); padding-top: .8rem; }
.side-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: .4rem; background: transparent; border: 1px solid rgba(255,255,255,.1); color: var(--side-text); border-radius: var(--radius-sm); padding: .4rem .5rem; font-size: .82rem; text-decoration: none; min-width: 0; }
.side-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-btn:hover { background: rgba(255,255,255,.06); color: #fff; }

.ctag { display: inline-grid; place-items: center; min-width: 26px; height: 18px; padding: 0 4px; border-radius: 4px; font-size: .66rem; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.ctag-uk { background: #E8EEF9; color: #1F3F8F; }
.ctag-us { background: #FBEAEA; color: #9B1C2C; }
[data-bs-theme="dark"] .ctag-uk { background: #22345C; color: #BFD0F5; }
[data-bs-theme="dark"] .ctag-us { background: #4A2027; color: #F3C1C7; }

.main { min-width: 0; }
.content { padding: 2rem clamp(1rem, 3vw, 2.5rem) 4rem; max-width: 1480px; }
.mobile-bar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 991.98px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; inset: 0 auto 0 0; width: 272px; z-index: 1050; transform: translateX(-100%); transition: transform .25s var(--ease); }
    body.sidebar-open .sidebar { transform: none; }
    body.sidebar-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(5, 20, 24, .45); z-index: 1040; }
    .mobile-bar { display: flex; align-items: center; gap: .5rem; padding: .6rem 1rem; background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 1030; }
    .content { padding: 1.25rem 1rem 3rem; }
}

/* ---------- Sayfa başlığı ---------- */
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: clamp(1.5rem, 1.2rem + 1vw, 1.9rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 .35rem; line-height: 1.15; }
.page-context { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; font-weight: 500; }
.page-context .muted { font-weight: 400; font-size: .88rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------- Yüzeyler ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.panel + .panel { margin-top: 1rem; }
/* Izgara içinde yan yana duran kartlar: boşluğu grid gap verir, üst boşluk hizayı bozmasın */
.split > .panel, .side-grid > .panel, .company-grid > *, .next-grid > * { margin-top: 0 !important; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--rule); }
.panel-head h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.panel-body { padding: 1.1rem; }
.panel-foot { padding: .75rem 1.1rem; border-top: 1px solid var(--rule); }
.section-title { font-size: 1.05rem; font-weight: 600; margin: 2rem 0 .8rem; }
.empty-line { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.2rem; border: 1px dashed var(--rule-strong); border-radius: var(--radius); color: var(--muted); background: var(--surface); }
.empty-line i { font-size: 1.2rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }

/* ---------- Dönem çubuğu ---------- */
.period-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-bottom: 1.25rem; }
.segmented { display: inline-flex; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 3px; gap: 2px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { padding: .32rem .7rem; border-radius: 7px; font-size: .85rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: background-color .18s var(--ease), color .18s; user-select: none; }
.segmented label:hover { color: var(--text); }
.segmented input:checked + label { background: var(--ink); color: #fff; }
[data-bs-theme="dark"] .segmented input:checked + label { background: #2A6672; }
.segmented input:focus-visible + label { outline: 2px solid var(--brass); outline-offset: 1px; }
.period-pick { display: flex; align-items: center; gap: .35rem; }
.period-pick .form-control, .period-pick .form-select { width: auto; }
.period-input[hidden] { display: none !important; }
.custom-range { display: inline-flex; align-items: center; gap: .35rem; }
.w-year { width: 96px !important; }
.step { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 8px; border: 1px solid var(--rule); background: var(--surface); color: var(--text); text-decoration: none; transition: background-color .15s; }
.step:hover { background: var(--surface-2); color: var(--text); }
.period-label { font-weight: 600; font-size: .95rem; }
.period-label .muted { font-weight: 400; font-size: .85rem; }

/* ---------- Defter şeridi ---------- */
.ledger {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
    overflow: hidden;
}
.ledger-cell { padding: 1.1rem 1.25rem 1rem; border-left: 1px solid var(--rule); position: relative; }
.ledger-cell:first-child { border-left: 0; }
.ledger-label { color: var(--muted); font-size: .85rem; font-weight: 500; }
.ledger-value { font-size: clamp(1.3rem, 1rem + 1vw, 1.75rem); font-weight: 700; letter-spacing: -.02em; margin-top: .2rem; }
.ledger-net { background: linear-gradient(0deg, color-mix(in srgb, var(--brass) 7%, var(--surface)), var(--surface)); }
.ledger-net::after { content: ""; position: absolute; left: 1.25rem; right: 1.25rem; bottom: .55rem; border-bottom: 3px double var(--brass); opacity: .7; }
.ledger-link { font-size: .8rem; color: var(--muted); text-decoration: none; }
.ledger-link:hover { color: var(--ink-2); text-decoration: underline; }
.ledger-notes { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .65rem 0 1.5rem; font-size: .86rem; color: var(--muted); }
.fx-details { width: 100%; }
.fx-details summary { cursor: pointer; color: var(--ink-2); width: max-content; }
.fx-details table { margin-top: .5rem; background: var(--surface); border-radius: var(--radius-sm); }
@media (max-width: 767.98px) {
    .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ledger-cell:nth-child(3) { border-left: 0; }
    .ledger-cell:nth-child(n+3) { border-top: 1px solid var(--rule); }
}

.tone-in { color: var(--in); }
.tone-out { color: var(--out); }
.tone-transfer { color: var(--transfer); }

.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .55rem; border-radius: 999px; font-size: .8rem; font-weight: 500; text-decoration: none; border: 1px solid transparent; }
.pill-warn { background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--warn); }
.pill-danger { background: color-mix(in srgb, var(--out) 12%, transparent); color: var(--out); }
.pill-neutral { background: var(--surface-2); color: var(--muted); border-color: var(--rule); }
a.pill:hover { filter: brightness(.95); }

/* ---------- Tablolar ---------- */
.tbl { width: 100%; margin: 0; font-size: .9rem; }
.tbl thead th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); color: var(--muted); font-weight: 500; font-size: .8rem; border-bottom: 1px solid var(--rule); padding: .6rem .75rem; white-space: nowrap; }
.tbl td { padding: .62rem .75rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background-color .12s; }
.tbl tbody tr:hover { background: color-mix(in srgb, var(--ink-2) 4%, transparent); }
.tbl tbody tr.is-selected { background: color-mix(in srgb, var(--brass) 11%, transparent); }
.tbl .amt, .tbl .text-end { text-align: right; }
.tbl .sub { font-size: .78rem; color: var(--muted); }
.tbl .cp { max-width: 260px; font-weight: 500; }
.tbl .desc { max-width: 420px; color: var(--muted); }
.tbl .w-check { width: 36px; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tbl-wrap { overflow-x: auto; }
.row-link { color: var(--muted); }
.row-link:hover { color: var(--ink-2); }
.date-cell { white-space: nowrap; }
.date-cell .sub { display: block; }

.cat { display: inline-flex; align-items: center; gap: .35rem; max-width: 220px; padding: .14rem .5rem; border-radius: 6px; font-size: .78rem; font-weight: 500;
    background: color-mix(in srgb, var(--c) 13%, transparent); color: color-mix(in srgb, var(--c) 78%, var(--text)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
[data-bs-theme="dark"] .cat { color: color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 22%, transparent); }
.cat-none { --c: var(--warn); background: transparent; border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent); color: var(--warn); }
.cat-none::before { display: none; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; vertical-align: middle; }

.src { display: inline-block; font-size: .72rem; font-weight: 600; padding: .1rem .42rem; border-radius: 5px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--rule); }
.src-wise { color: #2F6B12; background: #EEF7E6; border-color: #D3E9C2; }
.src-stripe { color: #4B3FC4; background: #EFEDFD; border-color: #D9D5FA; }
[data-bs-theme="dark"] .src-wise { color: #B6E39A; background: #22351A; border-color: #2F4A23; }
[data-bs-theme="dark"] .src-stripe { color: #C4BDFB; background: #26224A; border-color: #36306A; }

/* ---------- Filtre satırı ---------- */
.filter-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .6rem; align-items: end; }
.filter-row .grow { grid-column: span 2; }
@media (max-width: 575.98px) { .filter-row .grow { grid-column: auto; } }

/* ---------- Toplu işlem çubuğu ---------- */
.bulk-bar {
    position: sticky; bottom: 1rem; z-index: 20; margin: 1rem auto 0; width: fit-content; max-width: 100%;
    display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem .6rem .55rem 1rem;
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 14px;
    box-shadow: 0 10px 30px -12px rgba(10, 35, 40, .35);
    transition: background-color .2s var(--ease), color .2s, transform .25s var(--ease);
}
.bulk-bar .form-select { width: auto; max-width: 230px; }
.bulk-bar.is-active { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-4px); }
.bulk-bar.is-active .form-select { border-color: transparent; }
.bulk-count { font-weight: 600; font-size: .9rem; margin-right: .25rem; }

/* ---------- Bildirimler ---------- */
.toast-stack { position: fixed; top: 1rem; right: 1rem; z-index: 1100; display: flex; flex-direction: column; gap: .5rem; width: min(440px, calc(100vw - 2rem)); }
.note {
    display: flex; align-items: flex-start; gap: .65rem; padding: .8rem .9rem; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--c, var(--ink-2));
    box-shadow: 0 12px 32px -14px rgba(10, 35, 40, .4); font-size: .9rem;
    animation: note-in .35s var(--ease) both;
}
.note > i { color: var(--c, var(--ink-2)); font-size: 1.1rem; margin-top: .05rem; }
.note-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.note-close { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; padding: 0 .2rem; }
.note-success { --c: var(--in); }
.note-danger { --c: var(--out); }
.note-warning { --c: var(--warn); }
.note-info { --c: var(--ink-2); }
.note.is-leaving { animation: note-out .25s var(--ease) forwards; }
@keyframes note-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes note-out { to { opacity: 0; transform: translateX(16px); } }

/* ---------- Yükleme alanı ---------- */
.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
    min-height: 170px; padding: 1.5rem; text-align: center; cursor: pointer;
    border: 1.5px dashed var(--rule-strong); border-radius: var(--radius); background: var(--surface-2);
    transition: border-color .15s, background-color .15s;
}
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone i { font-size: 1.9rem; color: var(--ink-2); transition: transform .25s var(--ease); }
.dropzone.is-over { border-color: var(--brass); background: color-mix(in srgb, var(--brass) 8%, var(--surface)); }
.dropzone.is-over i { transform: translateY(-4px); }
.dropzone .files { font-size: .85rem; color: var(--text); font-weight: 500; }
.source-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.source-pick input { position: absolute; opacity: 0; }
.source-pick label { display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.source-pick label strong { font-size: 1rem; }
.source-pick label span { font-size: .8rem; color: var(--muted); }
.source-pick input:checked + label { border-color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-2); background: color-mix(in srgb, var(--ink-2) 6%, var(--surface)); }
.source-pick input:focus-visible + label { outline: 2px solid var(--brass); outline-offset: 2px; }
.is-busy { pointer-events: none; opacity: .85; }
.spin { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -.15em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Genel bakış ---------- */
.company-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 1rem; }
.co-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .8rem; }
.co-card.is-active { border-color: color-mix(in srgb, var(--brass) 60%, var(--rule)); box-shadow: inset 3px 0 0 var(--brass); }
.co-card h3 { font-size: 1rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: .5rem; }
.co-figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.co-figures div { min-width: 0; }
.co-figures small { display: block; color: var(--muted); font-size: .76rem; }
.co-figures strong { font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.co-meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .8rem; }
.chart-box { position: relative; height: 290px; }
.split { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 1199.98px) { .split { grid-template-columns: 1fr; } }

/* ---------- Kimlik sayfaları ---------- */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
    background:
        repeating-linear-gradient(0deg, transparent 0 31px, color-mix(in srgb, var(--ink-2) 7%, transparent) 31px 32px),
        var(--paper); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; padding: 2rem; box-shadow: 0 24px 60px -30px rgba(10, 35, 40, .45); }
.auth-card .brand { color: var(--text); padding: 0; margin-bottom: 1.5rem; }

/* ---------- Form ızgarası ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 575.98px) { .form-grid { grid-template-columns: 1fr; } }
.country-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.country-pick input { position: absolute; opacity: 0; }
.country-pick label { display: flex; align-items: center; gap: .6rem; padding: .75rem .9rem; border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.country-pick label small { display: block; color: var(--muted); font-size: .78rem; }
.country-pick input:checked + label { border-color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--ink-2); }
.country-pick input:focus-visible + label { outline: 2px solid var(--brass); outline-offset: 2px; }
[data-us-only][hidden], [data-uk-only][hidden] { display: none !important; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .45rem 1.25rem; margin: 0; }
.kv dt { color: var(--muted); font-weight: 400; }
.kv dd { margin: 0; }

/* ---------- Hareket tercihi ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Companies House arama ---------- */
.ch-search { position: relative; }
.ch-box { position: relative; display: flex; align-items: center; }
.ch-box > i { position: absolute; left: .75rem; color: var(--muted); pointer-events: none; }
.ch-box .form-control { padding-left: 2.2rem; padding-right: 2.2rem; }
.ch-box .spin { position: absolute; right: .8rem; color: var(--muted); }
.ch-results { position: absolute; z-index: 30; left: 0; right: 0; margin: .3rem 0 0; padding: .3rem; list-style: none; max-height: 340px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--rule-strong); border-radius: var(--radius-sm); box-shadow: 0 16px 40px -18px rgba(10, 35, 40, .45);
    animation: drop-in .18s var(--ease) both; }
.ch-results button { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; width: 100%; text-align: left; border: 0; background: transparent; color: var(--text); padding: .55rem .65rem; border-radius: 6px; }
.ch-results button:hover, .ch-results button:focus-visible { background: color-mix(in srgb, var(--ink-2) 8%, transparent); }
.ch-results button span { font-size: .8rem; color: var(--muted); }
.ch-results button small { font-size: .76rem; color: var(--muted); }
.ch-results button.is-loading { opacity: .6; }
.ch-msg { padding: .6rem .7rem; color: var(--muted); font-size: .88rem; }
.ch-card { border: 1px solid color-mix(in srgb, var(--in) 35%, var(--rule)); background: color-mix(in srgb, var(--in) 6%, var(--surface)); border-radius: var(--radius-sm); padding: .8rem .9rem; animation: drop-in .25s var(--ease) both; }
@keyframes drop-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pill-ok { background: color-mix(in srgb, var(--in) 12%, transparent); color: var(--in); }

/* ---------- Beyan takvimi ---------- */
.next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.next-card { background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--rule-strong); border-radius: var(--radius); padding: .85rem 1rem; }
.next-card.status-overdue { border-left-color: var(--out); }
.next-card.status-soon { border-left-color: var(--warn); }
.next-card.status-upcoming { border-left-color: var(--ink-3); }
.next-kind { font-size: .85rem; color: var(--muted); font-weight: 500; }
.next-due { font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.next-left { font-size: .85rem; font-weight: 600; margin-bottom: .2rem; }
.status-overdue .next-left { color: var(--out); }
.status-soon .next-left { color: var(--warn); }
.tbl .group-row td { background: var(--surface-2); padding-top: .5rem; padding-bottom: .5rem; }
.mark-form { display: inline-flex; gap: .3rem; align-items: center; }
.mark-form .form-control { width: 140px; }
.deadline-list { list-style: none; margin: 0; padding: 0; }
.deadline-list li { display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .7rem 1.1rem; border-bottom: 1px solid var(--rule); }
.deadline-list li:last-child { border-bottom: 0; }
.deadline-list .when { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Yazdırma ---------- */
@media print {
    .sidebar, .mobile-bar, .page-actions, .toast-stack, .no-print, .period-bar { display: none !important; }
    .app-shell { display: block; }
    .content { padding: 0; max-width: none; }
    .panel { break-inside: avoid; border-color: #bbb; }
    body, html { background: #fff; }
}
.tbl.report .sum-row td { font-weight: 600; border-top: 1px solid var(--rule-strong); }
.tbl.report .total-row td { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--text); border-bottom: 3px double var(--rule-strong); }
.side-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.side-grid .panel + .panel { margin-top: 0; }
.split > section .tbl .cat, .split > aside .tbl .cat, .split > div > section .tbl td:first-child .cat { max-width: min(200px, 42vw); }

/* ---------- Kenar çubuğu rozeti ---------- */
.side-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brass); color: #1b1404; font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.side-link.is-active .side-badge { background: var(--ink); color: #fff; }

/* ---------- Müşteri sayfası ---------- */
.portal-top { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 30; }
.portal-top-inner { max-width: 960px; margin: 0 auto; padding: .7rem 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.portal-top .brand { color: var(--text); padding: 0; }
.portal-main { max-width: 960px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.month-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--rule); }
.month-status h2 { font-size: 1.35rem; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.status-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .35rem .8rem; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.status-chip.s-none { background: var(--surface-2); color: var(--muted); border: 1px dashed var(--rule-strong); }
.status-chip.s-pending { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
.status-chip.s-approved { background: color-mix(in srgb, var(--in) 13%, transparent); color: var(--in); }
.status-chip.s-rejected { background: color-mix(in srgb, var(--out) 12%, transparent); color: var(--out); }
.reject-note { margin: 1rem 1.4rem 0; padding: .8rem 1rem; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--out) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--out) 30%, var(--rule)); }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.file-list li:last-child { border-bottom: 0; }
.history-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: .4rem; vertical-align: middle; }
.history-dot.s-pending { background: var(--warn); } .history-dot.s-approved { background: var(--in); } .history-dot.s-rejected { background: var(--out); } .history-dot.s-none { background: var(--rule-strong); }
.seg-link { padding: .32rem .75rem; border-radius: 7px; font-size: .85rem; font-weight: 500; color: var(--muted); text-decoration: none; }
.seg-link:hover { color: var(--text); }
.seg-link.is-on { background: var(--ink); color: #fff; }
.seg-link.is-on .muted { color: rgba(255,255,255,.7); }
[data-bs-theme="dark"] .seg-link.is-on { background: #2A6672; }
.review-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }
.reject-form { display: flex; gap: .4rem; flex: 1 1 360px; max-width: 560px; }
.panel-head h2 .ctag { vertical-align: 2px; }

/* ---------- Kategori önerisi ---------- */
.suggest-bar { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; padding: .75rem 1rem; border: 1px solid color-mix(in srgb, var(--brass) 40%, var(--rule)); border-radius: var(--radius); background: color-mix(in srgb, var(--brass) 7%, var(--surface)); }
.suggest-bar > i { color: var(--brass); font-size: 1.15rem; }
.sugg-chip { max-width: 140px; white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; margin-top: .25rem; padding: .1rem .5rem; font-size: .78rem; font-weight: 500; border-radius: 999px; border: 1px dashed color-mix(in srgb, var(--brass) 60%, var(--rule)); background: color-mix(in srgb, var(--brass) 8%, transparent); color: var(--text); cursor: pointer; transition: background-color .15s var(--ease), border-color .15s; }
.sugg-chip:hover { background: color-mix(in srgb, var(--brass) 18%, transparent); border-style: solid; }
.sugg-chip .bi-magic { color: var(--brass); }
.sugg-chip .sugg-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sugg-chip i { flex: 0 0 auto; }

/* ---------- Fiş / fatura ekleri ---------- */
.att-list { list-style: none; margin: 0; padding: .5rem 1rem; display: grid; gap: .5rem; }
.att-list li { display: flex; align-items: center; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--rule); }
.att-list li:last-child { border-bottom: 0; }
.att-thumb { flex: 0 0 52px; height: 52px; border-radius: var(--radius-sm); border: 1px solid var(--rule); overflow: hidden; display: grid; place-items: center; background: var(--surface-2); }
.att-thumb img { width: 100%; height: 100%; object-fit: cover; }
.att-pdf i { font-size: 1.6rem; color: var(--out); }
.att-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.att-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.dropzone-sm { padding: 1rem; min-height: 0; }
.dropzone-sm i { font-size: 1.3rem; }

/* ---------- Değişiklik geçmişi ---------- */
.hist-list { list-style: none; margin: 0; padding: .25rem 1rem .75rem; }
.hist-list li { padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.hist-list li:last-child { border-bottom: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--ink-3); text-decoration: underline; font-size: inherit; cursor: pointer; }
[data-bs-theme="dark"] .link-btn { color: #8CC4CF; }

/* ---------- Müşteri durumu tablosu ---------- */
.status-grid th, .status-grid td { vertical-align: middle; }
.st { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-size: .95rem; text-decoration: none; }
.st-ok { background: color-mix(in srgb, var(--in) 14%, transparent); color: var(--in); }
.st-pending { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.st-rejected { background: color-mix(in srgb, var(--out) 13%, transparent); color: var(--out); }
.st-missing { background: color-mix(in srgb, var(--out) 8%, transparent); color: var(--out); border: 1px dashed color-mix(in srgb, var(--out) 45%, transparent); }
.st-waiting, .st-none { background: var(--surface-2); color: var(--muted); }
.st-na { width: 28px; height: 2px; background: var(--rule); border-radius: 2px; }
a.st:hover { filter: brightness(.92); }

/* ---------- Günlük ---------- */
.log-tbl td { vertical-align: top; }
.log-tbl tr.is-alert td:first-child { box-shadow: inset 3px 0 0 var(--out); }
.log-details summary { cursor: pointer; display: inline; }
.log-details pre { margin: .4rem 0 0; padding: .6rem .75rem; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--radius-sm); font-size: .75rem; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

/* ---------- KDV ---------- */
.vat-boxes .box-no { width: 2.4rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.vat-help summary { cursor: pointer; list-style: none; }
.vat-help summary::-webkit-details-marker { display: none; }
.sub-box { border: 1px solid var(--rule); border-radius: var(--radius); padding: .9rem 1rem 1rem; background: var(--surface-2); }
.sub-box legend { float: none; width: auto; font-size: .85rem; font-weight: 600; padding: 0 .4rem; margin: 0 0 .25rem -.4rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- İki aşamalı giriş ---------- */
.twofa-setup { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: start; }
.qr-box { padding: 6px; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); line-height: 0; }
.qr-box img { width: 200px; height: 200px; image-rendering: pixelated; }
.secret-key { font-size: .95rem; letter-spacing: .06em; user-select: all; }
.codes-box { padding: 1rem; border: 1px solid color-mix(in srgb, var(--brass) 45%, var(--rule)); border-radius: var(--radius); background: color-mix(in srgb, var(--brass) 7%, var(--surface)); }
.codes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .4rem; }
.codes-grid code { display: block; text-align: center; padding: .35rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; font-size: .95rem; letter-spacing: .05em; color: var(--text); }
.code-input { letter-spacing: .35em; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 640px) {
    .twofa-setup { grid-template-columns: 1fr; justify-items: start; }
}

/* İşlem listesinde uzun açıklamalar tabloyu taşırmasın */
.tbl td.desc { max-width: 18rem; min-width: 7rem; }
.tbl td.cp { max-width: 13rem; min-width: 7rem; }
.tbl td.desc .clamp-2, .tbl td.cp .clamp-2 { overflow-wrap: anywhere; }

/* ---------- Şirket seçici ---------- */
.side-count { display: inline-block; margin-left: .3rem; padding: 0 .4rem; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .72rem; }
.co-switch { position: relative; }
.co-current { width: 100%; display: flex; align-items: center; gap: .55rem; padding: .55rem .6rem; border-radius: var(--radius-sm); border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: #fff; font-weight: 500; font-size: .92rem; text-align: left; transition: background-color .15s, border-color .15s; }
.co-current:hover, .co-current[aria-expanded="true"] { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.22); }
.co-current .bi-chevron-expand { color: var(--side-muted); font-size: .9rem; }
.co-pop { margin-top: .4rem; border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius-sm); background: rgba(0,0,0,.18); overflow: hidden; animation: co-in .16s var(--ease); }
@keyframes co-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.co-search { display: flex; align-items: center; gap: .45rem; padding: .45rem .6rem; border-bottom: 1px solid rgba(255,255,255,.08); color: var(--side-muted); }
.co-search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; color: #fff; font-size: .88rem; }
.co-search input::placeholder { color: var(--side-muted); }
.co-search kbd { font-size: .65rem; padding: .05rem .3rem; background: rgba(255,255,255,.08); color: var(--side-muted); border-radius: 4px; }
.co-list { max-height: min(46vh, 380px); overflow-y: auto; padding: .3rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.co-label { padding: .45rem .45rem .2rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--side-muted); }
.co-opt { display: flex; align-items: center; gap: .5rem; padding: .4rem .45rem; border-radius: 6px; color: var(--side-text); text-decoration: none; font-size: .88rem; }
.co-opt:hover, .co-opt.is-focus { background: rgba(255,255,255,.08); color: #fff; }
.co-opt.is-active { color: #fff; box-shadow: inset 2px 0 0 var(--brass); }
.co-opt .company-name { white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
.co-current .company-name { white-space: normal; line-height: 1.25; }
.co-opt[hidden], [data-co-recent][hidden], .co-label[hidden] { display: none; }
.co-empty { padding: .8rem .5rem; text-align: center; color: var(--side-muted); font-size: .85rem; }
.co-foot { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .6rem; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; }
.co-foot a { color: var(--side-muted); text-decoration: none; }
.co-foot a:hover { color: #fff; }

/* ---------- İptal edilen transferler ---------- */
.amt-cancelled { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.tbl tr.is-cancelled td { color: var(--muted); }
.tbl tr.is-cancelled .cp { font-weight: 400; }
.cancel-box { border-color: var(--rule-strong); }
.cancel-box .panel-head h2 i { color: var(--muted); }
