/* Hesap Radarı yönetim paneli. Bootstrap 5.3 üstüne marka paleti (docs/brand/README.md). */
:root, [data-bs-theme="light"] {
    --hr-primary: #0F766E;
    --hr-primary-strong: #115E59;
    --hr-primary-soft: #CCFBF1;
    --hr-on-primary-soft: #134E4A;
    --hr-accent: #F59E0B;
    --hr-bg: #F4F7FA;
    --hr-surface: #FFFFFF;
    --hr-surface-2: #F1F5F9;
    --hr-text: #0F172A;
    --hr-muted: #5B6B7F;
    --hr-border: #E2E8F0;
    --hr-sidebar: #0F172A;
    --hr-sidebar-2: #1E293B;
    --hr-shadow: 0 1px 2px rgba(15,23,42,.05), 0 6px 20px -10px rgba(15,23,42,.14);
    --bs-body-bg: var(--hr-bg);
    --bs-body-color: var(--hr-text);
    --bs-secondary-color: var(--hr-muted);
    --bs-border-color: var(--hr-border);
    --bs-primary: #0F766E;
    --bs-primary-rgb: 15, 118, 110;
    --bs-link-color: #0F766E;
    --bs-link-color-rgb: 15, 118, 110;
    --bs-link-hover-color: #115E59;
    --bs-link-hover-color-rgb: 17, 94, 89;
    --bs-body-font-family: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-border-radius: .75rem;
    --bs-border-radius-lg: 1rem;
    --bs-focus-ring-color: rgba(15, 118, 110, .25);
}
[data-bs-theme="dark"] {
    --hr-primary: #2DD4BF;
    --hr-primary-strong: #14B8A6;
    --hr-primary-soft: #134E4A;
    --hr-on-primary-soft: #99F6E4;
    --hr-accent: #FBBF24;
    --hr-bg: #0B1222;
    --hr-surface: #131C2E;
    --hr-surface-2: #1E293B;
    --hr-text: #F1F5F9;
    --hr-muted: #A3B0C2;
    --hr-border: #26334B;
    --hr-sidebar: #0A1020;
    --hr-sidebar-2: #162033;
    --hr-shadow: 0 0 0 1px var(--hr-border);
    --bs-body-bg: var(--hr-bg);
    --bs-body-color: var(--hr-text);
    --bs-secondary-color: var(--hr-muted);
    --bs-border-color: var(--hr-border);
    --bs-tertiary-bg: #1E293B;
    --bs-primary: #2DD4BF;
    --bs-primary-rgb: 45, 212, 191;
    --bs-link-color: #2DD4BF;
    --bs-link-color-rgb: 45, 212, 191;
    --bs-link-hover-color: #5EEAD4;
    --bs-link-hover-color-rgb: 94, 234, 212;
}

body.admin { background: var(--hr-bg); font-size: 15px; }
a { text-decoration: none; }
.text-muted, .text-secondary { color: var(--hr-muted) !important; }

/* Düğmeler */
.btn-primary { --bs-btn-bg: var(--hr-primary); --bs-btn-border-color: var(--hr-primary); --bs-btn-hover-bg: var(--hr-primary-strong); --bs-btn-hover-border-color: var(--hr-primary-strong); --bs-btn-active-bg: var(--hr-primary-strong); --bs-btn-disabled-bg: var(--hr-primary); --bs-btn-disabled-border-color: var(--hr-primary); }
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0F172A; --bs-btn-hover-color: #0F172A; --bs-btn-active-color: #0F172A; }
.btn-soft { background: var(--hr-primary-soft); color: var(--hr-on-primary-soft); border: 0; font-weight: 600; }
.btn-soft:hover { background: var(--hr-primary); color: #fff; }
[data-bs-theme="dark"] .btn-soft:hover { color: #0F172A; }
.btn-outline-secondary { --bs-btn-color: var(--hr-text); --bs-btn-border-color: var(--hr-border); --bs-btn-hover-bg: var(--hr-surface-2); --bs-btn-hover-color: var(--hr-text); --bs-btn-hover-border-color: var(--hr-border); }
.btn-light { --bs-btn-bg: var(--hr-surface-2); --bs-btn-border-color: var(--hr-border); --bs-btn-color: var(--hr-text); --bs-btn-hover-bg: var(--hr-border); --bs-btn-hover-color: var(--hr-text); }
.btn { font-weight: 600; }
.btn-icon { width: 42px; height: 42px; display: inline-grid; place-items: center; font-size: 22px; padding: 0; border: 0; color: inherit; }
.form-control, .form-select { background-color: var(--hr-surface); border-color: var(--hr-border); }
.form-control:focus, .form-select:focus { border-color: var(--hr-primary); box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .18); }
.form-check-input:checked { background-color: var(--hr-primary); border-color: var(--hr-primary); }

/* Kabuk */
.shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 264px; flex: 0 0 264px; background: linear-gradient(180deg, var(--hr-sidebar) 0%, var(--hr-sidebar-2) 100%);
    color: #CBD5E1; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
    --bs-offcanvas-bg: var(--hr-sidebar); --bs-offcanvas-width: 280px;
}
@media (max-width: 991.98px) { .sidebar { height: 100%; position: fixed; } }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 20px 18px; }
.side-brand { display: flex; align-items: center; gap: 12px; color: #fff; font-weight: 700; font-size: 16px; line-height: 1.15; }
.side-brand img { width: 40px; height: 40px; }
.side-brand small { display: block; color: #5EEAD4; font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.side-nav { padding: 6px 12px; overflow-y: auto; flex: 1; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: #CBD5E1; font-weight: 600; font-size: 14.5px; margin-bottom: 2px; transition: background .15s, color .15s; }
.side-nav a i { font-size: 18px; width: 20px; text-align: center; opacity: .9; }
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: rgba(45, 212, 191, .14); color: #5EEAD4; box-shadow: inset 3px 0 0 #2DD4BF; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #64748B; padding: 18px 12px 6px; }
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.06); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2DD4BF, #0F766E); color: #0F172A; font-weight: 800; flex: 0 0 auto; }
.me-text { min-width: 0; line-height: 1.2; }
.me-text b { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { display: block; color: #94A3B8; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.btn-side { background: rgba(255,255,255,.06); color: #CBD5E1; border: 0; width: 34px; height: 34px; display: inline-grid; place-items: center; padding: 0; }
.btn-side:hover { background: rgba(255,255,255,.14); color: #fff; }

.topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: 6px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--hr-sidebar); color: #fff; }
.topbar-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; flex: 1; min-width: 0; }
.topbar-brand img { width: 30px; height: 30px; }
.topbar-brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .btn-icon { color: #fff; }

.content { flex: 1; min-width: 0; padding: 28px 32px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-head .sub { color: var(--hr-muted); margin: 4px 0 0; }
.crumb { font-size: 13px; color: var(--hr-muted); margin-bottom: 4px; }
.crumb a { color: var(--hr-muted); }
.crumb a:hover { color: var(--hr-primary); }
@media (max-width: 991.98px) { .content { padding: 18px 14px 60px; } .page-head h1 { font-size: 22px; } }

/* Kartlar */
.card { --bs-card-bg: var(--hr-surface); --bs-card-border-color: var(--hr-border); --bs-card-border-radius: 1rem; --bs-card-cap-bg: transparent; box-shadow: var(--hr-shadow); }
[data-bs-theme="dark"] .card { box-shadow: none; }
.card-header { font-weight: 700; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card-header .small, .card-header a { font-weight: 600; }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--hr-surface); border: 1px solid var(--hr-border); border-radius: 16px; padding: 16px 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--hr-shadow); color: inherit; transition: transform .15s, border-color .15s; }
a.kpi:hover { transform: translateY(-2px); border-color: var(--hr-primary); color: inherit; }
.kpi .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; font-size: 20px; flex: 0 0 auto; }
.kpi b { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.kpi span { color: var(--hr-muted); font-size: 13px; font-weight: 600; }
.kpi.alert-kpi { border-color: #F59E0B; }
.t-teal { background: #CCFBF1; color: #0F766E; } .t-blue { background: #DBEAFE; color: #1D4ED8; } .t-violet { background: #EDE9FE; color: #6D28D9; }
.t-amber { background: #FEF3C7; color: #B45309; } .t-rose { background: #FFE4E6; color: #BE123C; } .t-green { background: #DCFCE7; color: #15803D; }
.t-slate { background: #E2E8F0; color: #334155; } .t-cyan { background: #CFFAFE; color: #0E7490; }
[data-bs-theme="dark"] .t-teal { background: rgba(45,212,191,.14); color: #5EEAD4; } [data-bs-theme="dark"] .t-blue { background: rgba(96,165,250,.14); color: #93C5FD; }
[data-bs-theme="dark"] .t-violet { background: rgba(167,139,250,.14); color: #C4B5FD; } [data-bs-theme="dark"] .t-amber { background: rgba(251,191,36,.14); color: #FCD34D; }
[data-bs-theme="dark"] .t-rose { background: rgba(251,113,133,.14); color: #FDA4AF; } [data-bs-theme="dark"] .t-green { background: rgba(74,222,128,.14); color: #86EFAC; }
[data-bs-theme="dark"] .t-slate { background: rgba(148,163,184,.14); color: #CBD5E1; } [data-bs-theme="dark"] .t-cyan { background: rgba(34,211,238,.14); color: #67E8F9; }

/* Rozetler */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.st-ok { background: #DCFCE7; color: #15803D; } .st-warn { background: #FFEDD5; color: #C2410C; } .st-danger { background: #FEE2E2; color: #B91C1C; }
.st-draft { background: #E2E8F0; color: #334155; } .st-info { background: #DBEAFE; color: #1D4ED8; } .st-brand { background: var(--hr-primary-soft); color: var(--hr-on-primary-soft); }
[data-bs-theme="dark"] .st-ok { background: #14532D; color: #86EFAC; } [data-bs-theme="dark"] .st-warn { background: #7C2D12; color: #FED7AA; }
[data-bs-theme="dark"] .st-danger { background: #7F1D1D; color: #FECACA; } [data-bs-theme="dark"] .st-draft { background: #334155; color: #E2E8F0; }
[data-bs-theme="dark"] .st-info { background: #1E3A8A; color: #BFDBFE; }

/* Filtre çubuğu ve sekmeler */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 420px; }
.toolbar .search i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--hr-muted); }
.toolbar .search input { padding-left: 38px; }
.seg { display: inline-flex; background: var(--hr-surface-2); border: 1px solid var(--hr-border); border-radius: 12px; padding: 3px; gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg a { padding: 6px 12px; border-radius: 9px; color: var(--hr-muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.seg a.on { background: var(--hr-surface); color: var(--hr-text); box-shadow: 0 1px 3px rgba(15,23,42,.12); }
[data-bs-theme="dark"] .seg a.on { background: var(--hr-primary-soft); color: var(--hr-on-primary-soft); }

/* Tablo → mobilde kart */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--hr-surface-2); margin: 0; }
.table > :not(caption) > * > * { padding: 12px 14px; border-bottom-color: var(--hr-border); vertical-align: middle; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--hr-muted); font-weight: 700; background: var(--hr-surface-2); white-space: nowrap; }
.table tbody tr:last-child td { border-bottom: 0; }
.cell-title { font-weight: 700; color: var(--hr-text); }
.cell-sub { font-size: 12.5px; color: var(--hr-muted); }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--hr-surface-2); border: 1px solid var(--hr-border); flex: 0 0 auto; }
.thumb-ph { display: grid; place-items: center; color: var(--hr-muted); font-size: 20px; }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.actions form { margin: 0; }
.btn-xs { padding: 4px 10px; font-size: 12.5px; border-radius: 9px; }
@media (max-width: 767.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { padding: 12px 14px; border-bottom: 1px solid var(--hr-border); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack td { border: 0 !important; padding: 3px 0 !important; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    .table-stack td[data-label]::before { content: attr(data-label); color: var(--hr-muted); font-size: 12.5px; font-weight: 600; text-align: left; flex: 0 0 auto; }
    .table-stack td.main { display: block; text-align: left; padding-bottom: 6px !important; }
    .table-stack td.main::before { display: none; }
    .table-stack td.acts { padding-top: 10px !important; }
    .table-stack td.acts .actions { justify-content: flex-start; width: 100%; }
    .table-stack td.hide-sm { display: none; }
}

/* Sayfalama */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--hr-border); font-size: 13.5px; color: var(--hr-muted); flex-wrap: wrap; }
.pager .btn { padding: 5px 12px; }

/* Boş durum */
.empty { text-align: center; padding: 48px 20px; color: var(--hr-muted); }
.empty i { font-size: 40px; display: block; margin-bottom: 10px; color: var(--hr-primary); opacity: .7; }
.empty b { display: block; color: var(--hr-text); font-size: 16px; margin-bottom: 4px; }

/* Adisyon detayı */
.receipt-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.receipt-imgs a { display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--hr-border); aspect-ratio: 3 / 4; background: var(--hr-surface-2); }
.receipt-imgs img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.receipt-imgs a:hover img { transform: scale(1.04); }
.lines td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.line-muted td { color: var(--hr-muted); font-style: italic; }
.susp { color: #C2410C; }
dl.meta { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 14px; }
dl.meta dt { color: var(--hr-muted); font-weight: 600; }
dl.meta dd { margin: 0; text-align: right; }

/* Hata günlüğü */
details.err { border-bottom: 1px solid var(--hr-border); }
details.err:last-child { border-bottom: 0; }
details.err summary { list-style: none; cursor: pointer; padding: 12px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
details.err summary::-webkit-details-marker { display: none; }
details.err summary:hover { background: var(--hr-surface-2); }
details.err .body { padding: 0 16px 16px; }
details.err pre { background: var(--hr-surface-2); border: 1px solid var(--hr-border); border-radius: 10px; padding: 12px; font-size: 12px; max-height: 360px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 8px 0 0; }
.code-pill { font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 8px; min-width: 44px; text-align: center; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; word-break: break-all; }

/* Otomatik tamamlama */
.ac { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--hr-surface); border: 1px solid var(--hr-border); border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(15,23,42,.35); max-height: 280px; overflow-y: auto; display: none; }
.ac-list.show { display: block; }
.ac-list button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 9px 12px; background: none; border: 0; color: var(--hr-text); font-size: 14px; }
.ac-list button:hover, .ac-list button.hl { background: var(--hr-surface-2); }
.ac-list small { color: var(--hr-muted); }

/* Giriş sayfası */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(800px 500px at 90% 0%, rgba(45, 212, 191, .18), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(15, 118, 110, .35), transparent 60%), #0B1222; }
.auth-card { width: 100%; max-width: 420px; background: var(--hr-surface); border-radius: 22px; padding: 34px 30px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.6); }
.auth-card .logo { width: 64px; height: 64px; margin: 0 auto 14px; display: block; }
.auth-card h1 { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 4px; }
.auth-card .sub { text-align: center; color: var(--hr-muted); margin-bottom: 24px; }
.btn-google { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--hr-surface); border: 1px solid var(--hr-border); color: var(--hr-text); padding: 11px; border-radius: 12px; font-weight: 700; }
.btn-google:hover { background: var(--hr-surface-2); color: var(--hr-text); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--hr-muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--hr-border); }

.chart-box { position: relative; height: 280px; }
@media (max-width: 575.98px) { .chart-box { height: 220px; } .kpis { grid-template-columns: repeat(2, 1fr); gap: 10px; } .kpi { padding: 12px; gap: 10px; } .kpi .ic { width: 36px; height: 36px; font-size: 17px; } .kpi b { font-size: 19px; } }

.toast-wrap { position: fixed; right: 16px; bottom: 16px; z-index: 1080; display: grid; gap: 8px; }
.alert { border-radius: 12px; }
