/* Domain Takip arayüz teması (Bootstrap 5.3 üzerine) */

:root,
[data-bs-theme="light"] {
    --app-primary: #4f46e5;
    --app-primary-rgb: 79, 70, 229;
    --app-primary-hover: #4338ca;
    --app-bg: #f4f6fb;
    --app-surface: #ffffff;
    --app-border: rgba(15, 23, 42, .08);
    --app-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .06);
    --app-muted: #64748b;
    --app-table-head: #f8fafc;

    --bs-primary: var(--app-primary);
    --bs-primary-rgb: var(--app-primary-rgb);
    --bs-link-color: var(--app-primary);
    --bs-link-color-rgb: var(--app-primary-rgb);
    --bs-link-hover-color: var(--app-primary-hover);
    --bs-body-bg: var(--app-bg);
    --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bs-border-radius: .6rem;
    --bs-border-radius-lg: .9rem;
    --bs-primary-bg-subtle: #eef2ff;
    --bs-primary-text-emphasis: #3730a3;

    /* grafik renkleri (validate_palette.js ile kontrol edildi) */
    --chart-1: #2a78d6;
    --chart-2: #eb6834;
    --chart-3: #1baf7a;
    --chart-4: #eda100;
    /* tür renkleri (8'li doğrulanmış palet) */
    --c-blue: #2a78d6; --c-orange: #eb6834; --c-teal: #1baf7a; --c-amber: #eda100;
    --c-pink: #e87ba4; --c-green: #008300; --c-violet: #4a3aa7; --c-red: #e34948;
    --chart-grid: #e2e8f0;
    --chart-text: #64748b;
}

[data-bs-theme="dark"] {
    --app-primary: #818cf8;
    --app-primary-rgb: 129, 140, 248;
    --app-primary-hover: #a5b4fc;
    --app-bg: #0f1117;
    --app-surface: #1b1e25;
    --app-border: rgba(255, 255, 255, .08);
    --app-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --app-muted: #94a3b8;
    --app-table-head: #20242d;

    --bs-primary: var(--app-primary);
    --bs-primary-rgb: var(--app-primary-rgb);
    --bs-link-color: var(--app-primary);
    --bs-link-color-rgb: var(--app-primary-rgb);
    --bs-link-hover-color: var(--app-primary-hover);
    --bs-body-bg: var(--app-bg);
    --bs-body-color: #e2e8f0;
    --bs-border-color: rgba(255, 255, 255, .1);
    --bs-primary-bg-subtle: rgba(129, 140, 248, .15);
    --bs-primary-text-emphasis: #c7d2fe;

    --chart-1: #3987e5;
    --chart-2: #d95926;
    --chart-3: #199e70;
    --chart-4: #c98500;
    --c-blue: #3987e5; --c-orange: #d95926; --c-teal: #199e70; --c-amber: #c98500;
    --c-pink: #d55181; --c-green: #008300; --c-violet: #9085e9; --c-red: #e66767;
    --chart-grid: #2a2f3a;
    --chart-text: #94a3b8;
}

body { background: var(--app-bg); font-feature-settings: "cv11"; }
.text-muted, .form-text { color: var(--app-muted) !important; }
a { text-decoration: none; }
a:hover { text-decoration: underline; }
.btn:hover, .nav-link:hover, .dropdown-item:hover, .sidebar a:hover { text-decoration: none; }

/* ---------- düğmeler ---------- */
.btn { font-weight: 500; border-radius: .55rem; }
.btn-primary {
    --bs-btn-bg: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary-hover);
    --bs-btn-hover-border-color: var(--app-primary-hover);
    --bs-btn-active-bg: var(--app-primary-hover);
    --bs-btn-active-border-color: var(--app-primary-hover);
    --bs-btn-disabled-bg: var(--app-primary);
    --bs-btn-disabled-border-color: var(--app-primary);
    box-shadow: 0 2px 8px rgba(var(--app-primary-rgb), .3);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
    --bs-btn-active-bg: var(--app-primary);
    --bs-btn-active-border-color: var(--app-primary);
}
.btn-icon { display: inline-flex; align-items: center; gap: .4rem; }
.btn-soft {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    border: 0;
}
.btn-soft:hover { background: rgba(var(--app-primary-rgb), .22); color: var(--bs-primary-text-emphasis); }

/* ---------- form ---------- */
.form-control, .form-select { border-radius: .55rem; padding-top: .5rem; padding-bottom: .5rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: rgba(var(--app-primary-rgb), .6);
    box-shadow: 0 0 0 .2rem rgba(var(--app-primary-rgb), .18);
}
.form-check-input:checked { background-color: var(--app-primary); border-color: var(--app-primary); }
.form-label { font-weight: 500; font-size: .9rem; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #14171d; }

/* ---------- kenar menü ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #1e1b4b 0%, #111827 100%);
    color: #c7d2fe;
}
@media (min-width: 992px) {
    .sidebar .offcanvas-body { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
}
.sidebar .offcanvas-body { display: flex; flex-direction: column; padding: 1.25rem 1rem; }
.sidebar .brand {
    display: flex; align-items: center; gap: .6rem;
    color: #fff; font-weight: 700; font-size: 1rem; line-height: 1.2; letter-spacing: -.01em; padding: .25rem .25rem 1.5rem;
    white-space: nowrap;
}
.sidebar .brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.brand-mark {
    width: 38px; height: 38px; border-radius: 11px;
    display: grid; place-items: center; color: #fff; font-size: 1.15rem;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 6px 18px rgba(99, 102, 241, .45);
}
.sidebar .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #818cf8; opacity: .8; padding: 1rem .75rem .4rem; }
.sidebar .nav-link {
    display: flex; align-items: center; gap: .75rem;
    color: #c7d2fe; border-radius: .6rem; padding: .6rem .75rem; margin-bottom: .15rem; font-weight: 500;
}
.sidebar .nav-link i { font-size: 1.1rem; opacity: .85; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link.active {
    background: rgba(129, 140, 248, .22); color: #fff;
    box-shadow: inset 3px 0 0 #a5b4fc;
}
.sidebar .nav-link .count {
    margin-left: auto; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px;
    background: #ef4444; color: #fff;
}
.sidebar .user-box {
    margin-top: auto; display: flex; align-items: center; gap: .65rem;
    padding: .75rem; border-radius: .75rem; background: rgba(255, 255, 255, .06);
}
.sidebar .user-box .name { color: #fff; font-weight: 600; font-size: .9rem; line-height: 1.2; }
.sidebar .user-box .mail { font-size: .75rem; color: #a5b4fc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.sidebar .user-box .btn-logout { color: #c7d2fe; background: none; border: 0; padding: .25rem; }
.sidebar .user-box .btn-logout:hover { color: #fff; }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; gap: .75rem;
    padding: .85rem 1.5rem;
    background: color-mix(in srgb, var(--app-bg) 82%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--app-border);
}
.topbar .crumb { font-weight: 600; }
.topbar .icon-btn {
    width: 38px; height: 38px; border-radius: .6rem; border: 1px solid var(--app-border);
    background: var(--app-surface); color: var(--bs-body-color);
    display: inline-grid; place-items: center;
}
.topbar .icon-btn:hover { color: var(--app-primary); }
.content { padding: 1.75rem 1.5rem 3rem; max-width: 1400px; width: 100%; }
@media (max-width: 575.98px) { .content { padding: 1.25rem 1rem 2.5rem; } .topbar { padding: .75rem 1rem; } }

/* ---------- sayfa başlığı ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.page-header .sub { color: var(--app-muted); margin-top: .2rem; }

/* ---------- kartlar ---------- */
.card {
    --bs-card-bg: var(--app-surface);
    --bs-card-border-color: var(--app-border);
    --bs-card-border-radius: 1rem;
    --bs-card-inner-border-radius: calc(1rem - 1px);
    --bs-card-cap-bg: transparent;
    box-shadow: var(--app-shadow);
}
.card-header { padding: 1rem 1.25rem; border-bottom-color: var(--app-border); }
.card-body { padding: 1.25rem; }
.card-title-sm { font-size: 1rem; font-weight: 600; margin: 0; }
.card-header .hint, .card-title-sm .hint { color: var(--app-muted); font-weight: 400; font-size: .85rem; }

.kpi { position: relative; overflow: hidden; height: 100%; }
.kpi .card-body { display: flex; align-items: flex-start; gap: 1rem; }
.kpi .kpi-icon {
    width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 1.35rem;
}
.kpi .label { color: var(--app-muted); font-size: .85rem; font-weight: 500; }
.kpi .value { font-size: 1.85rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
.kpi .meta { font-size: .8rem; color: var(--app-muted); margin-top: .15rem; }
.kpi::after {
    content: ""; position: absolute; right: -30px; bottom: -30px; width: 110px; height: 110px; border-radius: 50%;
    background: currentColor; opacity: .04; pointer-events: none;
}
a.kpi-link { color: inherit; display: block; height: 100%; }
a.kpi-link:hover .card { transform: translateY(-2px); }
a.kpi-link .card { transition: transform .15s ease; }

.tint-indigo { background: #eef2ff; color: #4f46e5; }
.tint-blue   { background: #e0f2fe; color: #0369a1; }
.tint-amber  { background: #fef3c7; color: #b45309; }
.tint-red    { background: #fee2e2; color: #b91c1c; }
.tint-green  { background: #dcfce7; color: #15803d; }
.tint-slate  { background: #f1f5f9; color: #475569; }
.tint-pink   { background: #fce7f3; color: #be185d; }
.tint-orange { background: #ffedd5; color: #c2410c; }
.tint-teal   { background: #d1fae5; color: #047857; }
.tint-violet { background: #ede9fe; color: #5b21b6; }
[data-bs-theme="dark"] .tint-indigo { background: rgba(129, 140, 248, .16); color: #a5b4fc; }
[data-bs-theme="dark"] .tint-blue   { background: rgba(56, 189, 248, .14); color: #7dd3fc; }
[data-bs-theme="dark"] .tint-amber  { background: rgba(251, 191, 36, .14); color: #fcd34d; }
[data-bs-theme="dark"] .tint-red    { background: rgba(248, 113, 113, .14); color: #fca5a5; }
[data-bs-theme="dark"] .tint-green  { background: rgba(74, 222, 128, .14); color: #86efac; }
[data-bs-theme="dark"] .tint-slate  { background: rgba(148, 163, 184, .14); color: #cbd5e1; }
[data-bs-theme="dark"] .tint-pink   { background: rgba(244, 114, 182, .14); color: #f9a8d4; }
[data-bs-theme="dark"] .tint-orange { background: rgba(251, 146, 60, .15); color: #fdba74; }
[data-bs-theme="dark"] .tint-teal   { background: rgba(52, 211, 153, .14); color: #6ee7b7; }
[data-bs-theme="dark"] .tint-violet { background: rgba(167, 139, 250, .15); color: #c4b5fd; }

.hero {
    border-radius: 1.1rem; padding: 1.5rem 1.75rem; color: #fff; margin-bottom: 1.5rem;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .18), transparent 40%),
                linear-gradient(120deg, #4f46e5 0%, #7c3aed 55%, #db2777 100%);
    box-shadow: 0 10px 30px rgba(79, 70, 229, .25);
}
.hero h1 { font-size: 1.55rem; font-weight: 700; margin: 0 0 .25rem; letter-spacing: -.02em; }
.hero p { margin: 0; opacity: .9; }
.hero .btn-light { color: #4338ca; font-weight: 600; }
.hero .btn-glass { color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); }
.hero .btn-glass:hover { background: rgba(255, 255, 255, .26); color: #fff; }

/* ---------- tablolar ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; }
.table > :not(caption) > * > * { padding: .75rem .9rem; border-bottom-color: var(--app-border); }
.table thead th {
    background: var(--app-table-head); color: var(--app-muted);
    font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; white-space: nowrap;
}
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: rgba(var(--app-primary-rgb), .04); }
.table td, .table th { vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table-sm > :not(caption) > * > * { padding: .55rem 1rem; }
.card > .table-responsive:first-child .table thead th:first-child { border-top-left-radius: calc(1rem - 1px); }
.card > .table-responsive:first-child .table thead th:last-child { border-top-right-radius: calc(1rem - 1px); }
.num { font-variant-numeric: tabular-nums; }

.avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: inline-grid; place-items: center; font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.15rem; }
.type-icon {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: inline-grid; place-items: center; font-size: 1rem;
}
.cell-title { font-weight: 600; line-height: 1.25; }
.col-service { min-width: 230px; }
.cell-sub { font-size: .8rem; color: var(--app-muted); }

/* ---------- rozetler ---------- */
.badge-soft {
    display: inline-flex; align-items: center; gap: .3rem;
    font-weight: 600; font-size: .75rem; padding: .35rem .6rem; border-radius: 99px;
}
.badge-soft i { font-size: .8rem; }
.badge-ok      { background: #dcfce7; color: #166534; }
.badge-soon    { background: #fef3c7; color: #92400e; }
.badge-expired { background: #fee2e2; color: #991b1b; }
.badge-passive { background: #f1f5f9; color: #475569; }
[data-bs-theme="dark"] .badge-ok      { background: rgba(74, 222, 128, .15); color: #86efac; }
[data-bs-theme="dark"] .badge-soon    { background: rgba(251, 191, 36, .15); color: #fcd34d; }
[data-bs-theme="dark"] .badge-expired { background: rgba(248, 113, 113, .15); color: #fca5a5; }
[data-bs-theme="dark"] .badge-passive { background: rgba(148, 163, 184, .15); color: #cbd5e1; }

.text-profit { color: #15803d; }
.text-loss { color: #dc2626; }
[data-bs-theme="dark"] .text-profit { color: #4ade80; }
[data-bs-theme="dark"] .text-loss { color: #f87171; }

/* ---------- boş durum ---------- */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--app-muted); }
.empty i { font-size: 2.2rem; display: block; margin-bottom: .5rem; opacity: .6; }

/* ---------- uyarılar ---------- */
.alert { border: 0; border-radius: .8rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert > i { font-size: 1.1rem; line-height: 1.3; }

/* ---------- grafik ---------- */
.chart-box { position: relative; height: 300px; }
.chart-box.lg { height: 360px; }
.chart-box.sm { height: 220px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .82rem; color: var(--app-muted); }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.type-list .row-item { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--app-border); }
.type-list .row-item:last-child { border-bottom: 0; }
.bar-track { height: 6px; border-radius: 99px; background: var(--chart-grid); overflow: hidden; flex: 1; }
.bar-track > span { display: block; height: 100%; border-radius: 99px; }

/* ---------- sayfalama ---------- */
.pagination { --bs-pagination-border-radius: .55rem; --bs-pagination-active-bg: var(--app-primary); --bs-pagination-active-border-color: var(--app-primary); }

/* ---------- giriş ekranı ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
    position: relative; overflow: hidden; color: #fff; padding: 3rem;
    display: flex; flex-direction: column; justify-content: space-between;
    background: radial-gradient(circle at 20% 15%, rgba(255, 255, 255, .16), transparent 35%),
                radial-gradient(circle at 80% 85%, rgba(236, 72, 153, .45), transparent 45%),
                linear-gradient(135deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
}
.auth-art h2 { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; max-width: 440px; }
.auth-art p { opacity: .85; max-width: 420px; }
.auth-art .feature { display: flex; gap: .75rem; align-items: center; margin-bottom: .9rem; }
.auth-art .feature i { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .14); font-size: 1.05rem; }
.auth-art .float-card {
    position: absolute; right: 3rem; top: 3rem; width: 240px; padding: 1rem; border-radius: 1rem;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22); backdrop-filter: blur(8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, .2);
}
.auth-art .float-card .line { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .3); margin-top: .5rem; }
.auth-form { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--app-surface); }
.auth-form .inner { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.input-icon { position: relative; }
.input-icon > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--app-muted); pointer-events: none; }
.input-icon > .form-control { padding-left: 2.5rem; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-art { display: none; }
    .auth-form { background: var(--app-bg); }
    .auth-form .inner { background: var(--app-surface); padding: 2rem 1.5rem; border-radius: 1rem; box-shadow: var(--app-shadow); }
}
@media (max-width: 1199.98px) { .auth-art .float-card { display: none; } }
.min-w-0 { min-width: 0; }

/* ---------- sekmeler ---------- */
.nav-pills { --bs-nav-pills-link-active-bg: var(--app-primary); --bs-nav-pills-border-radius: .6rem; }
.nav-pills .nav-link { color: var(--bs-body-color); font-weight: 500; font-size: .9rem; padding: .45rem .85rem; }
.nav-pills .nav-link:not(.active):hover { background: rgba(var(--app-primary-rgb), .08); }
[data-bs-theme="dark"] .nav-pills .nav-link.active { color: #0f1117; }
.btn-link { text-decoration: none; }

/* ---------- küçük ekran ---------- */
@media (max-width: 575.98px) {
    .kpi .card-body { flex-direction: column; gap: .6rem; padding: 1rem; }
    .kpi .kpi-icon { width: 40px; height: 40px; font-size: 1.1rem; border-radius: 12px; }
    .kpi .value { font-size: 1.5rem; }
    .hero { padding: 1.25rem; }
    .hero h1 { font-size: 1.3rem; }
    .hero .btn { font-size: .875rem; padding: .4rem .7rem; }
    .page-header h1 { font-size: 1.35rem; }
}

/* ---------- tanım formları: renk ve ikon seçimi ---------- */
.swatch {
    width: 34px; height: 34px; border-radius: 10px; cursor: pointer; background: var(--sw);
    border: 3px solid var(--app-surface); box-shadow: 0 0 0 1px var(--app-border);
}
.btn-check:checked + .swatch { box-shadow: 0 0 0 2px var(--bs-body-color); }
.btn-check:focus-visible + .swatch, .btn-check:focus-visible + .icon-pick { outline: 2px solid var(--app-primary); outline-offset: 2px; }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; }
.icon-pick {
    display: flex; flex-direction: column; align-items: center; gap: .25rem; cursor: pointer;
    padding: .6rem .25rem; border-radius: .6rem; border: 1px solid var(--app-border);
    font-size: .72rem; color: var(--app-muted); text-align: center;
}
.icon-pick i { font-size: 1.25rem; color: var(--bs-body-color); }
.icon-pick:hover { background: rgba(var(--app-primary-rgb), .06); }
.btn-check:checked + .icon-pick { border-color: var(--app-primary); background: rgba(var(--app-primary-rgb), .1); color: var(--app-primary); }
.btn-check:checked + .icon-pick i { color: var(--app-primary); }

/* ---------- mobil: uygulama gibi kullanım (alt sekme çubuğu, hızlı ekle, kart listeleri) ---------- */
.tabbar, .fab-wrap, .brand-mini { -webkit-tap-highlight-color: transparent; }
.brand-mini {
    width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center; flex-shrink: 0;
    color: #fff; font-size: 1.1rem; background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
@media (max-width: 991.98px) {
    html { -webkit-tap-highlight-color: transparent; }
    body { overscroll-behavior-y: none; }
    .topbar { padding-top: calc(.6rem + env(safe-area-inset-top)); padding-bottom: .6rem; padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
    .topbar .crumb { font-size: 1.05rem; }
    .content { padding-bottom: calc(6.5rem + env(safe-area-inset-bottom)); }
    /* iOS'ta odaklanınca sayfanın büyümesini önler */
    .form-control, .form-select { font-size: 16px; }
    .form-control-sm, .form-select-sm { font-size: 16px; }
    .btn { min-height: 40px; }
    .btn-sm { min-height: 34px; }

    .tabbar {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        display: flex; justify-content: space-around;
        padding: .35rem .25rem calc(.35rem + env(safe-area-inset-bottom));
        background: color-mix(in srgb, var(--app-surface) 88%, transparent);
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--app-border);
    }
    .tabbar .tab {
        flex: 1; display: flex; flex-direction: column; align-items: center; gap: .1rem;
        padding: .3rem 0; border: 0; background: none; color: var(--app-muted);
        font-size: .68rem; font-weight: 500; text-decoration: none; min-width: 0;
    }
    .tabbar .tab.active { color: var(--app-primary); font-weight: 600; }
    .tabbar .tab-icon { position: relative; font-size: 1.3rem; line-height: 1; }
    .tabbar .tab-badge {
        position: absolute; top: -.3rem; left: 60%; min-width: 17px; height: 17px; padding: 0 4px;
        border-radius: 99px; background: #ef4444; color: #fff; font-size: .62rem; font-weight: 700;
        display: grid; place-items: center; border: 2px solid var(--app-surface);
    }
    .fab-wrap { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: calc(4.9rem + env(safe-area-inset-bottom)); z-index: 1031; }
    .fab {
        width: 54px; height: 54px; border-radius: 18px; border: 0; color: #fff; font-size: 1.5rem;
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
        box-shadow: 0 10px 24px -6px rgba(99, 102, 241, .65);
    }
    .fab:active { transform: scale(.95); }
    .fab-wrap .dropdown-menu { border-radius: .9rem; padding: .35rem; min-width: 12rem; }
    .fab-wrap .dropdown-item { border-radius: .6rem; }
    /* Kenar menü çekmece olarak açılır; altta sekme çubuğu kaldığı için boşluk bırakılır. */
    .sidebar.offcanvas-lg { --bs-offcanvas-width: min(300px, 85vw); }
    .sidebar .offcanvas-body { padding-top: calc(1.25rem + env(safe-area-inset-top)); padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
    /* Sayfa üstündeki "ekle" düğmeleri hızlı ekle düğmesine taşındı */
    .page-header .btn-add-desktop { display: none; }
}

/* Mobil kart listesi: tablolar küçük ekranda bu listeyle değişir */
.m-list { list-style: none; margin: 0; padding: 0; }
.m-item {
    display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem;
    border-bottom: 1px solid var(--app-border); color: inherit; text-decoration: none; position: relative;
}
.m-list > li:last-child > .m-item, .m-list > .m-item:last-child { border-bottom: 0; }
a.m-item:active, .m-item.tap:active { background: rgba(var(--app-primary-rgb), .06); }
.m-item .m-main { flex: 1; min-width: 0; }
.m-item .m-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item .m-sub { font-size: .8rem; color: var(--app-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-item .m-side { text-align: right; flex-shrink: 0; font-size: .85rem; }
.m-item .m-side .badge-soft { font-size: .7rem; }
.m-item .m-chevron { color: var(--app-muted); flex-shrink: 0; }
.m-actions { display: flex; gap: .5rem; padding: 0 1rem .85rem 3.85rem; border-bottom: 1px solid var(--app-border); margin-top: -.35rem; }
.m-list > li:last-child .m-actions { border-bottom: 0; }
.m-list > li:has(.m-actions) > .m-item { border-bottom: 0; }

/* Mobilde yatay kayan filtre sekmeleri */
@media (max-width: 767.98px) {
    .nav-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -1rem; margin-right: -1rem; padding: 0 1rem; }
    .nav-scroll::-webkit-scrollbar { display: none; }
    .nav-scroll .nav-link { white-space: nowrap; }
}

/* Uygulama olarak (ana ekrandan) açıldığında */
@media (display-mode: standalone) {
    body { user-select: none; -webkit-user-select: none; }
    input, textarea, [contenteditable], .num, td, .m-title, .m-sub { user-select: text; -webkit-user-select: text; }
}

/* ---------- tutarları gizle (üst bardaki göz butonu, html.amounts-hidden) ---------- */
/* Gerçek metin saydamlaşır, yerine aynı renk ve boyutta "****" çizilir. */
html.amounts-hidden .amt {
    display: inline-block; position: relative; width: 2.4em; overflow: hidden;
    white-space: nowrap; vertical-align: bottom; -webkit-text-fill-color: transparent; user-select: none;
}
html.amounts-hidden .amt::before { content: "****"; position: absolute; left: 0; top: 0; -webkit-text-fill-color: currentColor; }
#amount-toggle[aria-pressed="true"] { color: var(--app-primary); }

/* ---------- iskelet (skeleton) yükleme görünümü: sayfa geçişleri ve grafikler ---------- */
:root, [data-bs-theme="light"] { --sk-base: #e2e7f0; --sk-shine: #f3f5fa; }
[data-bs-theme="dark"] { --sk-base: #262a33; --sk-shine: #323743; }
.page-skeleton { display: none; }
html.is-loading .content > :not(.page-skeleton) { display: none !important; }
html.is-loading .page-skeleton { display: block; animation: sk-in .2s ease-out; }
.page-skeleton [hidden] { display: none !important; }
.sk {
    display: block; border-radius: .45rem;
    background: linear-gradient(90deg, var(--sk-base) 25%, var(--sk-shine) 50%, var(--sk-base) 75%);
    background-size: 200% 100%; animation: sk-shimmer 1.3s ease-in-out infinite;
}
.sk-line { height: .8rem; }
.sk-line.sm { height: .65rem; }
.sk-line.lg { height: 1.5rem; }
.sk-title { height: 1.75rem; width: min(16rem, 60%); }
.sk-hero { height: 7rem; border-radius: var(--bs-border-radius-lg); }
.sk-icon { width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0; }
.sk-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.sk-avatar.lg { width: 56px; height: 56px; }
.sk-btn { width: 8.5rem; height: 2.4rem; border-radius: var(--bs-border-radius); }
.sk-input { height: 2.4rem; border-radius: var(--bs-border-radius); }
.sk-num { width: 5.5rem; flex-shrink: 0; }
.sk-row { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.25rem; }
.sk-row + .sk-row { border-top: 1px solid var(--app-border); }
.sk-bars { display: flex; align-items: flex-end; gap: 4%; height: 220px; padding: 0 2%; }
.sk-bars .sk { flex: 1; border-radius: 4px 4px 0 0; }
/* Grafik çizilene kadar kutuda hafif parıltı */
.chart-box:has(canvas):not(.is-ready) {
    border-radius: .6rem;
    background: linear-gradient(90deg, var(--sk-base) 25%, var(--sk-shine) 50%, var(--sk-base) 75%);
    background-size: 200% 100%; animation: sk-shimmer 1.3s ease-in-out infinite; opacity: .6;
}
@keyframes sk-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@keyframes sk-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
    .sk, .chart-box:has(canvas):not(.is-ready) { animation: none; }
    html.is-loading .page-skeleton { animation: none; }
}
