/* ==========================================================================
   OtoDeğer Admin Panel — Marka tema katmanı (Tabler üzerine)
   KobiCar tema sistemi baz alınarak OtoDeğer renkleriyle uyarlandı.
   ========================================================================== */

/* 1. Marka renk paleti (mobil uygulamayla aynı palet) -------------------- */
:root {
    --kc-marka: #1565d8;            /* OtoDeğer mavi: birincil buton/link/aktif */
    --kc-marka-koyu: #1050b0;       /* hover */
    --kc-marka-acik: #5b9af5;       /* form odak kenarı */
    --kc-marka-zemin: rgba(21, 101, 216, 0.10);
    --kc-notr: #7a8c94;
    --kc-menu: #0b2c5e;             /* OtoDeğer lacivert: koyu üst menü */
    --kc-menu-acik: #0b2c5e;
    --kc-ink: #1a2327;
}

/* 2. Tabler ana renk değişkenlerini marka ile ezimle -------------------- */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --tblr-primary: var(--kc-marka);
    --tblr-primary-rgb: 21, 101, 216;
    --tblr-primary-fg: #ffffff;
    --tblr-link-color: var(--kc-marka);
    --tblr-link-color-rgb: 21, 101, 216;
    --tblr-link-hover-color: var(--kc-marka-koyu);
    --tblr-focus-ring-color: rgba(21, 101, 216, 0.25);
    --tblr-blue: var(--kc-marka);
    --tblr-blue-rgb: 21, 101, 216;
    --tblr-azure: var(--kc-notr);
    --tblr-azure-rgb: 122, 140, 148;
    --tblr-indigo: var(--kc-notr);
    --tblr-indigo-rgb: 122, 140, 148;
}

/* 3. Butonlar ------------------------------------------------------------ */
.btn-primary {
    --tblr-btn-bg: var(--kc-marka);
    --tblr-btn-border-color: var(--kc-marka);
    --tblr-btn-hover-bg: var(--kc-marka-koyu);
    --tblr-btn-hover-border-color: var(--kc-marka-koyu);
    --tblr-btn-active-bg: var(--kc-marka-koyu);
    --tblr-btn-active-border-color: var(--kc-marka-koyu);
    --tblr-btn-disabled-bg: var(--kc-marka);
    --tblr-btn-disabled-border-color: var(--kc-marka);
}
.btn-outline-primary {
    --tblr-btn-color: var(--kc-marka);
    --tblr-btn-border-color: var(--kc-marka);
    --tblr-btn-hover-bg: var(--kc-marka);
    --tblr-btn-hover-border-color: var(--kc-marka);
}

/* 4. Form odağı ---------------------------------------------------------- */
.form-control:focus,
.form-select:focus {
    border-color: var(--kc-marka-acik);
    box-shadow: 0 0 0 0.25rem rgba(21, 101, 216, 0.15);
}
.form-check-input:checked {
    background-color: var(--kc-marka);
    border-color: var(--kc-marka);
}
.form-check-input:focus {
    border-color: var(--kc-marka-acik);
    box-shadow: 0 0 0 0.25rem rgba(21, 101, 216, 0.15);
}

/* 5. Tipografi: Inter govde, Plus Jakarta Sans başlıklar ---------------- */
body {
    font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3, .h1, .h2, .h3,
.page-title, .card-title, .navbar-brand {
    font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}

/* 6. Layout scroll telafisi iptali --------------------------------------- */
@media (min-width: 992px) {
    :root, :host {
        margin-left: 0;
        margin-right: 0;
    }
}

/* 7. Koyu üst menü ------------------------------------------------------- */
.navbar.navbar-overlap[data-bs-theme="dark"],
.navbar-vertical[data-bs-theme="dark"] {
    --tblr-navbar-bg: var(--kc-menu);
    background-color: var(--kc-menu);
}
[data-bs-theme="dark"] .dropdown-menu:not([data-bs-theme]) {
    --tblr-dropdown-bg: var(--kc-menu-acik);
    --tblr-bg-surface: var(--kc-menu-acik);
    background-color: var(--kc-menu-acik);
    border-color: rgba(255, 255, 255, 0.08);
}
[data-bs-theme="dark"] .dropdown-menu:not([data-bs-theme]) .dropdown-item { color: #d6dee2; }
[data-bs-theme="dark"] .dropdown-menu:not([data-bs-theme]) .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-menu:not([data-bs-theme]) .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}
.dropdown-menu[data-bs-theme="light"] .dropdown-item.active,
.dropdown-menu[data-bs-theme="light"] .dropdown-item:active {
    background-color: var(--kc-marka-zemin);
    color: var(--kc-marka-koyu);
}
.dropdown-menu[data-bs-theme="light"] .dropdown-item.active i { color: var(--kc-marka); }

/* 8. Menü ortalama ------------------------------------------------------- */
@media (min-width: 768px) {
    .navbar-overlap .navbar-collapse > .d-flex {
        justify-content: center;
    }
}

/* 9. Subheader ----------------------------------------------------------- */
.subheader {
    color: var(--kc-ink);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6875rem;
    opacity: 0.85;
}
.page-pretitle { letter-spacing: 0.06em; }

/* 10. Marka yardımcı sınıfları ------------------------------------------ */
.bg-marka { background-color: var(--kc-marka) !important; color: #ffffff !important; }
.bg-marka-lt { background-color: var(--kc-marka-zemin) !important; color: var(--kc-marka-koyu) !important; }
[data-bs-theme="dark"] .bg-marka-lt { background-color: rgba(21, 101, 216, 0.28) !important; color: var(--kc-marka-acik) !important; }
.text-marka { color: var(--kc-marka) !important; }

.text-azure, .text-indigo { color: var(--kc-notr) !important; }
.bg-azure, .bg-indigo { background-color: var(--kc-notr) !important; }
.bg-azure-lt, .bg-indigo-lt {
    background-color: rgba(122,143,155, 0.12) !important;
    color: #53656e !important;
}

/* 11. Üst menü çizgi/gölge kaldırıldı ----------------------------------- */
.navbar.navbar-overlap[data-bs-theme="dark"] {
    border-bottom: 0 !important;
    box-shadow: none !important;
}

/* 12. Modal açılış animasyonu -------------------------------------------- */
@media (min-width: 576px) {
    .modal.show .modal-content {
        animation: odModalGiris .2s cubic-bezier(.2, .7, .3, 1);
    }
    @keyframes odModalGiris {
        from { opacity: 0; transform: translateY(10px) scale(.985); }
        to   { opacity: 1; transform: none; }
    }
    .modal-backdrop.show { animation: odFade .2s ease; }
    @keyframes odFade { from { opacity: 0; } to { opacity: .4; } }
}

/* 13. Mobil bottom-sheet modallar --------------------------------------- */
@media (max-width: 575.98px) {
    html, body { overflow-x: hidden; }
    .modal.show .modal-dialog,
    .modal.show .modal-dialog.modal-dialog-centered {
        position: fixed;
        left: 0; right: 0; bottom: 0; top: auto;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        align-items: flex-end !important;
        display: block;
        pointer-events: none;
    }
    .modal.show .modal-content {
        pointer-events: auto;
        border-radius: 1rem 1rem 0 0;
        border-bottom: 0;
        max-height: 92vh;
        display: flex;
        flex-direction: column;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        will-change: transform;
        transition: transform .28s cubic-bezier(.22,.61,.36,1);
    }
    .modal.fade:not(.show) .modal-dialog .modal-content { transform: translateY(100%); }
    .modal.fade.show .modal-dialog .modal-content { transform: translateY(0); }
    .modal.show .modal-header, .modal.show .modal-footer { flex: 0 0 auto; }
    .modal.show .modal-body {
        flex: 1 1 auto; overflow-y: auto;
        -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    }
    .nav-tabs, .card-header-tabs {
        flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    }
    .nav-tabs .nav-link { white-space: nowrap; }
    .table-responsive [style*="max-height"] { max-height: none !important; }
    form .col-auto > .btn[type="submit"] { width: 100%; }
}

/* 14. Gece modu ---------------------------------------------------------- */
html[data-bs-theme="dark"] {
    --tblr-body-bg: #0c0c0d;
    --tblr-body-color: #e6e8e9;
    --tblr-bg-surface: #17191a;
    --tblr-bg-surface-secondary: #1f2022;
    --tblr-bg-surface-tertiary: #26292b;
    --tblr-border-color: #2e2f33;
    --tblr-border-color-translucent: rgba(255, 255, 255, 0.07);
    --tblr-active-bg: #26292b;
    --tblr-secondary: #9a9ca1;
    --tblr-secondary-color: #9a9ca1;
    --tblr-secondary-bg: #17191a;
    --kc-marka: #e6e8e9;
    --kc-marka-koyu: #ffffff;
    --kc-marka-acik: #6b6d72;
    --kc-marka-zemin: rgba(255, 255, 255, 0.08);
    --tblr-primary: #e6e8e9;
    --tblr-primary-rgb: 230, 231, 233;
    --tblr-primary-fg: #16191a;
    --tblr-link-color: #cfd0d3;
    --tblr-link-hover-color: #ffffff;
    --tblr-focus-ring-color: rgba(255, 255, 255, 0.18);
    --tblr-blue: #9a9ca1;
    --tblr-azure: #9a9ca1;
    --tblr-indigo: #9a9ca1;
}
html[data-bs-theme="dark"] body { background: var(--tblr-body-bg); }
html[data-bs-theme="dark"] .card,
html[data-bs-theme="dark"] .modal-content {
    background-color: var(--tblr-bg-surface);
    border-color: var(--tblr-border-color);
}
html[data-bs-theme="dark"] .card-header,
html[data-bs-theme="dark"] .card-footer,
html[data-bs-theme="dark"] .modal-header,
html[data-bs-theme="dark"] .modal-footer {
    background-color: transparent;
    border-color: var(--tblr-border-color);
}
html[data-bs-theme="dark"] .table thead th,
html[data-bs-theme="dark"] thead {
    background-color: #121214;
    color: #9a9ca1;
}
html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: #101012;
    border-color: var(--tblr-border-color);
    color: var(--tblr-body-color);
}
html[data-bs-theme="dark"] .navbar.navbar-overlap[data-bs-theme="dark"] {
    --tblr-navbar-bg: #141617;
    background-color: #141617 !important;
}
html[data-bs-theme="dark"] .btn-primary {
    --tblr-btn-bg: #e6e8e9; --tblr-btn-border-color: #e6e8e9; --tblr-btn-color: #16191a;
    --tblr-btn-hover-bg: #ffffff; --tblr-btn-hover-color: #000000;
}
html[data-bs-theme="dark"] .subheader { color: #9ba6ab; }
html[data-bs-theme="dark"] .datagrid-title { color: #8b959a; }
html[data-bs-theme="dark"] .table {
    --tblr-table-hover-bg: rgba(255, 255, 255, 0.035);
    color: var(--tblr-body-color);
}
html[data-bs-theme="dark"] .text-secondary,
html[data-bs-theme="dark"] .text-muted { color: #9a9ca1 !important; }

/* Durum rozet renkleri gecede korunur (kırmızı=tehlike, sarı=uyarı) */
html[data-bs-theme="dark"] .bg-red-lt,
html[data-bs-theme="dark"] .bg-danger-lt {
    background-color: rgba(214, 92, 92, 0.16) !important; color: #e79a9a !important;
}
html[data-bs-theme="dark"] .bg-orange-lt,
html[data-bs-theme="dark"] .bg-warning-lt {
    background-color: rgba(210, 168, 92, 0.15) !important; color: #dcbb84 !important;
}
html[data-bs-theme="dark"] .bg-success-lt,
html[data-bs-theme="dark"] .bg-green-lt {
    background-color: rgba(42, 168, 99, 0.15) !important; color: #7ed4a8 !important;
}

/* Beyaz (light) tema adaları gecede okunabilir kalır */
html[data-bs-theme="dark"] [data-bs-theme="light"] {
    --tblr-body-color: #232e33;
    color: #232e33;
}
html[data-bs-theme="dark"] .dropdown-menu[data-bs-theme="light"] {
    background-color: #ffffff;
    border-color: rgba(0, 0, 0, 0.08);
}
