/* ============================================================
   ACENTE PANELİ — KOYU TEMA (dark-theme.css)
   ------------------------------------------------------------
   Katman 1: Tema sözleşmesi (semantik tokenlar — açık + koyu)
   Katman 2: Nötr skala remap (app.css --slate-* / --gray-*)
   Katman 3: Bootstrap 5.3 ince ayar
   Katman 4: Panel iskeleti (sidebar, header, kart, tablo, form)
   Katman 5: 3. parti (Quill, FullCalendar)
   Katman 6: Inline style="" attribute yakalayıcıları
   Katman 7: Otomatik üretilmiş modül override'ları (dosya sonu)
   ------------------------------------------------------------
   TÜM koyu kurallar [data-theme="dark"] ile başlar; açık temaya
   hiçbir etkisi yoktur. Tema anahtarı: <html data-theme="dark"
   data-bs-theme="dark"> + localStorage('theme').
   ============================================================ */

/* ── Katman 1: Tema sözleşmesi ──
   Diğer modüller yeni stil yazarken bu tokenları kullanırsa
   iki temada da otomatik doğru görünür. */
:root {
    color-scheme: light;
    --bg-page: #f8fafc;      /* sayfa zemini */
    --bg-card: #ffffff;      /* kart / panel yüzeyi */
    --bg-inset: #f8fafc;     /* kart içi kuyu (tablo başlığı, well) */
    --bg-hover: #f1f5f9;     /* hover satır/yüzey */
    --bg-raise: #e2e8f0;     /* bir kademe kalkık yüzey */
    --bg-elevated: #ffffff;  /* dropdown, modal, popover */
    --border-1: #e2e8f0;     /* ana çizgi */
    --border-2: #f1f5f9;     /* ince çizgi */
    --text-1: #0f172a;       /* başlık / birincil metin */
    --text-2: #334155;       /* gövde metni */
    --text-3: #64748b;       /* ikincil / soluk metin */
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg-page: #0b1220;
    --bg-card: #111a2c;
    --bg-inset: #0d1526;
    --bg-hover: #182338;
    --bg-raise: #243350;
    --bg-elevated: #16213a;
    --border-1: #243350;
    --border-2: #1b2740;
    --text-1: #e8eef8;
    --text-2: #c3cede;
    --text-3: #94a3b8;
}

/* ── Katman 2: Nötr skala remap ──
   app.css ve sayfa stilleri var(--slate-*) / var(--gray-*) kullanır;
   skalayı ters çevirmek arayüzün büyük bölümünü otomatik koyulaştırır. */
[data-theme="dark"] {
    --slate-50: #0d1526;  --gray-50: #0d1526;
    --slate-100: #182338; --gray-100: #182338;
    --slate-200: #243350; --gray-200: #243350;
    --slate-300: #33445f; --gray-300: #33445f;
    --slate-400: #7d8da6; --gray-400: #7d8da6;
    --slate-500: #93a3bb; --gray-500: #93a3bb;
    --slate-600: #b3c0d4; --gray-600: #b3c0d4;
    --slate-700: #c9d4e4; --gray-700: #c9d4e4;
    --slate-800: #dde5f0; --gray-800: #dde5f0;
    --slate-900: #eef2f9; --gray-900: #eef2f9;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.35);
    --shadow-md: 0 4px 10px -2px rgb(0 0 0 / 0.45);
    --shadow-lg: 0 10px 20px -5px rgb(0 0 0 / 0.55);
    --shadow-xl: 0 20px 30px -8px rgb(0 0 0 / 0.6);
}

/* ── Katman 3: Bootstrap 5.3 ince ayar (data-bs-theme="dark" üstüne) ── */
[data-theme="dark"] {
    --bs-body-bg: var(--bg-page);
    --bs-body-color: var(--text-2);
    --bs-emphasis-color: var(--text-1);
    --bs-secondary-color: var(--text-3);
    --bs-tertiary-color: #7d8da6;
    --bs-secondary-bg: var(--bg-hover);
    --bs-tertiary-bg: var(--bg-inset);
    --bs-border-color: var(--border-1);
    --bs-border-color-translucent: rgba(148, 163, 184, .16);
    --bs-heading-color: var(--text-1);
    --bs-link-color: #60a5fa;
    --bs-link-hover-color: #93c5fd;
}

[data-theme="dark"] .card {
    --bs-card-bg: var(--bg-card);
    --bs-card-border-color: var(--border-1);
    --bs-card-cap-bg: var(--bg-card);
    color: var(--text-2);
}
[data-theme="dark"] .card-header { background: var(--bg-card); border-bottom-color: var(--border-1); }
[data-theme="dark"] .card-body { background: var(--bg-card); }
[data-theme="dark"] .card-footer { background: var(--bg-card); border-top-color: var(--border-1); }

[data-theme="dark"] .modal-content {
    --bs-modal-bg: var(--bg-elevated);
    --bs-modal-border-color: var(--border-1);
    --bs-modal-header-border-color: var(--border-1);
    --bs-modal-footer-border-color: var(--border-1);
    background: var(--bg-elevated);
    color: var(--text-2);
}
[data-theme="dark"] .modal-header, [data-theme="dark"] .modal-footer { border-color: var(--border-1); }

[data-theme="dark"] .dropdown-menu {
    --bs-dropdown-bg: var(--bg-elevated);
    --bs-dropdown-border-color: var(--border-1);
    --bs-dropdown-color: var(--text-2);
    --bs-dropdown-link-color: var(--text-2);
    --bs-dropdown-link-hover-color: var(--text-1);
    --bs-dropdown-link-hover-bg: var(--bg-hover);
    --bs-dropdown-link-active-bg: rgba(59, 130, 246, .2);
    --bs-dropdown-divider-bg: var(--border-1);
    --bs-dropdown-header-color: var(--text-3);
    box-shadow: var(--shadow-lg);
}

[data-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-2);
    --bs-table-border-color: var(--border-1);
    --bs-table-striped-bg: rgba(148, 163, 184, .05);
    --bs-table-striped-color: var(--text-2);
    --bs-table-hover-bg: var(--bg-hover);
    --bs-table-hover-color: var(--text-1);
    color: var(--text-2);
}
[data-theme="dark"] .table thead th {
    background: var(--bg-inset);
    color: var(--text-3);
    border-bottom-color: var(--border-1);
}
[data-theme="dark"] .table td, [data-theme="dark"] .table th { border-color: var(--border-2); }
[data-theme="dark"] .table tbody tr:hover { background: var(--bg-hover); }
[data-theme="dark"] .table-light { --bs-table-bg: var(--bg-inset); --bs-table-color: var(--text-2); }

[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: var(--bg-inset);
    border-color: var(--border-1);
    color: var(--text-1);
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: var(--bg-card);
    border-color: #3b82f6;
    color: var(--text-1);
    box-shadow: 0 0 0 .25rem rgba(59, 130, 246, .2);
}
[data-theme="dark"] .form-control::placeholder { color: #7d8da6; }
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] .form-select:disabled {
    background-color: var(--bg-hover);
    color: var(--text-3);
    opacity: 1;
}
[data-theme="dark"] .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2394a3b8' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
[data-theme="dark"] .input-group-text {
    background: var(--bg-hover);
    border-color: var(--border-1);
    color: var(--text-3);
}
[data-theme="dark"] .form-check-input { background-color: var(--bg-inset); border-color: #33445f; }
[data-theme="dark"] .form-check-input:checked { background-color: #2563eb; border-color: #2563eb; }
[data-theme="dark"] .form-text { color: var(--text-3); }
[data-theme="dark"] .form-label, [data-theme="dark"] label { color: var(--text-2); }

[data-theme="dark"] .list-group {
    --bs-list-group-bg: var(--bg-card);
    --bs-list-group-color: var(--text-2);
    --bs-list-group-border-color: var(--border-1);
    --bs-list-group-action-hover-bg: var(--bg-hover);
    --bs-list-group-action-hover-color: var(--text-1);
}

[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-white {
    background: var(--bg-hover);
    border-color: var(--border-1);
    color: var(--text-2);
}
[data-theme="dark"] .btn-light:hover,
[data-theme="dark"] .btn-light:focus,
[data-theme="dark"] .btn-white:hover {
    background: var(--bg-raise);
    border-color: #33445f;
    color: var(--text-1);
}
[data-theme="dark"] .btn-outline-secondary { color: var(--text-3); border-color: #33445f; }
[data-theme="dark"] .btn-outline-secondary:hover { background: var(--bg-hover); color: var(--text-1); border-color: #46597a; }
[data-theme="dark"] .btn-outline-dark { color: var(--text-2); border-color: #46597a; }
[data-theme="dark"] .btn-outline-dark:hover { background: var(--bg-raise); color: var(--text-1); border-color: #5b7194; }

[data-theme="dark"] .pagination {
    --bs-pagination-bg: var(--bg-card);
    --bs-pagination-color: var(--text-2);
    --bs-pagination-border-color: var(--border-1);
    --bs-pagination-hover-bg: var(--bg-hover);
    --bs-pagination-hover-color: var(--text-1);
    --bs-pagination-hover-border-color: var(--border-1);
    --bs-pagination-focus-bg: var(--bg-hover);
    --bs-pagination-focus-color: var(--text-1);
    --bs-pagination-disabled-bg: var(--bg-inset);
    --bs-pagination-disabled-color: #5b7194;
    --bs-pagination-disabled-border-color: var(--border-2);
}

[data-theme="dark"] .alert-success { color: #6ee7b7; border-color: rgba(16, 185, 129, .3); }
[data-theme="dark"] .alert-danger { color: #fca5a5; border-color: rgba(239, 68, 68, .3); }
[data-theme="dark"] .alert-warning { color: #fcd34d; border-color: rgba(245, 158, 11, .3); }
[data-theme="dark"] .alert-info { background: rgba(6, 182, 212, .1); color: #67e8f9; border-color: rgba(6, 182, 212, .3); }

[data-theme="dark"] .tooltip { --bs-tooltip-bg: #33445f; --bs-tooltip-color: #eef2f9; }
[data-theme="dark"] .popover {
    --bs-popover-bg: var(--bg-elevated);
    --bs-popover-border-color: var(--border-1);
    --bs-popover-body-color: var(--text-2);
    --bs-popover-header-bg: var(--bg-hover);
    --bs-popover-header-color: var(--text-1);
}
[data-theme="dark"] .offcanvas { background: var(--bg-elevated); color: var(--text-2); }
[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before { color: var(--text-3); }
[data-theme="dark"] .progress { background: var(--bg-hover); }

/* Bootstrap yardımcı sınıfları */
[data-theme="dark"] .bg-white { background-color: var(--bg-card) !important; }
[data-theme="dark"] .bg-light { background-color: var(--bg-hover) !important; }
[data-theme="dark"] .text-dark { color: var(--text-1) !important; }
[data-theme="dark"] .text-black { color: var(--text-1) !important; }
[data-theme="dark"] .text-body { color: var(--text-2) !important; }
[data-theme="dark"] .text-secondary { color: var(--text-3) !important; }
[data-theme="dark"] .text-muted { color: var(--text-3) !important; }
[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end { border-color: var(--border-1) !important; }
[data-theme="dark"] .shadow-sm { box-shadow: var(--shadow-sm) !important; }
[data-theme="dark"] .shadow { box-shadow: var(--shadow-md) !important; }
[data-theme="dark"] .shadow-lg { box-shadow: var(--shadow-lg) !important; }

/* ── Katman 4: Panel iskeleti ── */
[data-theme="dark"] body.agency-layout {
    background-color: var(--bg-page);
    color: var(--text-2);
}

[data-theme="dark"] .agency-sidebar {
    background: var(--bg-card);
    border-right-color: var(--border-2);
    box-shadow: 4px 0 12px rgba(0, 0, 0, .25);
}
[data-theme="dark"] .sidebar-header { border-bottom-color: var(--border-2); }
[data-theme="dark"] .sidebar-footer { border-top-color: var(--border-2); }
[data-theme="dark"] .sidebar-collapse-btn:hover { background: var(--bg-hover); }
[data-theme="dark"] .logo-title { color: var(--text-1); }
[data-theme="dark"] .user-avatar { border-color: var(--border-1); }
[data-theme="dark"] .status-badge { border-color: var(--bg-card); }
[data-theme="dark"] .nav-notification-dot { border-color: var(--bg-card); }
[data-theme="dark"] .nav-link.active { background: rgba(96, 165, 250, .12); }
[data-theme="dark"] .nav-link:hover { background: var(--bg-hover); color: #93c5fd; }
[data-theme="dark"] .dropdown-link:hover, [data-theme="dark"] .dropdown-link.active { color: #93c5fd; background: var(--bg-hover); }

[data-theme="dark"] .main-header {
    background: rgba(17, 26, 44, .92);
    border-bottom-color: var(--border-1);
}
[data-theme="dark"] .page-title h4 { color: var(--text-1); }
[data-theme="dark"] .mobile-sidebar-toggle { background: var(--bg-hover); color: var(--text-2); }
[data-theme="dark"] .mobile-sidebar-toggle:hover { background: var(--bg-raise); }

[data-theme="dark"] .stats-card { background: var(--bg-card); border-color: var(--border-1); }
[data-theme="dark"] .stats-card:hover { box-shadow: var(--shadow-lg); }
[data-theme="dark"] .notification-item { border-bottom-color: var(--border-2); }

/* Quill sarmalayıcı (layout içi .rte-*) */
[data-theme="dark"] .rte-wrap { background: var(--bg-inset); border-color: var(--border-1); }
[data-theme="dark"] .rte-wrap .ql-toolbar.ql-snow { background: var(--bg-hover); border-bottom-color: var(--border-1); }
[data-theme="dark"] .rte-content { color: var(--text-2); }

/* Kademeli ödeme sıra uyarı notu (app.css) */
[data-theme="dark"] .pp-order-note {
    background: rgba(245, 158, 11, .1);
    border-color: rgba(245, 158, 11, .3);
    border-left-color: #f59e0b;
    color: #fcd34d;
}

/* Metin seçimi + odak görünürlüğü */
[data-theme="dark"] ::selection { background: rgba(59, 130, 246, .45); color: #eef2f9; }
[data-theme="dark"] :focus-visible { outline-color: #60a5fa; }

/* ── Katman 5: 3. parti bileşenler ── */
/* Quill Snow */
[data-theme="dark"] .ql-toolbar.ql-snow, [data-theme="dark"] .ql-container.ql-snow { border-color: var(--border-1); }
[data-theme="dark"] .ql-snow .ql-stroke { stroke: #b3c0d4; }
[data-theme="dark"] .ql-snow .ql-fill { fill: #b3c0d4; }
[data-theme="dark"] .ql-snow .ql-picker { color: var(--text-2); }
[data-theme="dark"] .ql-snow .ql-picker-options { background: var(--bg-elevated); border-color: var(--border-1) !important; }
[data-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-stroke,
[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: #60a5fa; }
[data-theme="dark"] .ql-snow.ql-toolbar button:hover .ql-fill,
[data-theme="dark"] .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: #60a5fa; }
[data-theme="dark"] .ql-editor { color: var(--text-1); }
[data-theme="dark"] .ql-editor.ql-blank::before { color: #7d8da6; }

/* FullCalendar */
[data-theme="dark"] .fc {
    --fc-border-color: var(--border-1);
    --fc-page-bg-color: transparent;
    --fc-neutral-bg-color: var(--bg-hover);
    --fc-list-event-hover-bg-color: var(--bg-hover);
    --fc-today-bg-color: rgba(245, 158, 11, .09);
    --fc-highlight-color: rgba(59, 130, 246, .18);
    --fc-non-business-color: rgba(13, 21, 38, .5);
}
[data-theme="dark"] .fc .fc-toolbar-title { color: var(--text-1); }
[data-theme="dark"] .fc .fc-col-header-cell-cushion,
[data-theme="dark"] .fc .fc-daygrid-day-number { color: var(--text-2); }
[data-theme="dark"] .fc .fc-list-day-cushion { background: var(--bg-inset); }
[data-theme="dark"] .fc-theme-standard .fc-list { border-color: var(--border-1); }

/* Toastr */
[data-theme="dark"] #toast-container > div { box-shadow: var(--shadow-lg); }

/* ── Katman 6: Inline style="" yakalayıcıları ──
   Blade dosyalarında elementin üzerine yazılmış açık tema renkleri.
   Önce genel kural, ardından yanlış eşleşen amber/kırmızı tonlar
   doğru koyu tonlarına geri düzeltilir (kaynak sıralı kaskad). */
[data-theme="dark"] [style*="background:#fff"],
[data-theme="dark"] [style*="background: #fff"],
[data-theme="dark"] [style*="background:#ffffff"],
[data-theme="dark"] [style*="background: #ffffff"],
[data-theme="dark"] [style*="background-color:#fff"],
[data-theme="dark"] [style*="background-color: #fff"],
[data-theme="dark"] [style*="background:white"],
[data-theme="dark"] [style*="background: white"] { background-color: var(--bg-card) !important; }

[data-theme="dark"] [style*="background:#f8fafc"],
[data-theme="dark"] [style*="background: #f8fafc"],
[data-theme="dark"] [style*="background-color:#f8fafc"],
[data-theme="dark"] [style*="background:#fafbff"],
[data-theme="dark"] [style*="background:#fcfdfe"],
[data-theme="dark"] [style*="background:#fbfcfe"] { background-color: var(--bg-inset) !important; }

[data-theme="dark"] [style*="background:#f1f5f9"],
[data-theme="dark"] [style*="background: #f1f5f9"],
[data-theme="dark"] [style*="background-color:#f1f5f9"] { background-color: var(--bg-hover) !important; }

/* #fff ile başlayan açık tonların geri düzeltmeleri */
[data-theme="dark"] [style*="background:#fffbeb"],
[data-theme="dark"] [style*="background: #fffbeb"] { background-color: rgba(245, 158, 11, .1) !important; }
[data-theme="dark"] [style*="background:#fff7ed"] { background-color: rgba(249, 115, 22, .1) !important; }
[data-theme="dark"] [style*="background:#fff1f2"] { background-color: rgba(244, 63, 94, .1) !important; }
[data-theme="dark"] [style*="background:#fff5f5"] { background-color: rgba(239, 68, 68, .08) !important; }
[data-theme="dark"] [style*="background:#fffdf5"] { background-color: rgba(245, 158, 11, .05) !important; }

/* Sık kullanılan açık ton chip/rozet zeminleri */
[data-theme="dark"] [style*="background:#eef2ff"], [data-theme="dark"] [style*="background: #eef2ff"] { background-color: rgba(99, 102, 241, .13) !important; }
[data-theme="dark"] [style*="background:#eff6ff"], [data-theme="dark"] [style*="background: #eff6ff"] { background-color: rgba(59, 130, 246, .12) !important; }
[data-theme="dark"] [style*="background:#f0f9ff"] { background-color: rgba(14, 165, 233, .1) !important; }
[data-theme="dark"] [style*="background:#ecfdf5"], [data-theme="dark"] [style*="background: #ecfdf5"] { background-color: rgba(16, 185, 129, .1) !important; }
[data-theme="dark"] [style*="background:#f0fdf4"] { background-color: rgba(34, 197, 94, .1) !important; }
[data-theme="dark"] [style*="background:#d1fae5"] { background-color: rgba(16, 185, 129, .18) !important; }
[data-theme="dark"] [style*="background:#dcfce7"] { background-color: rgba(34, 197, 94, .17) !important; }
[data-theme="dark"] [style*="background:#fee2e2"] { background-color: rgba(239, 68, 68, .17) !important; }
[data-theme="dark"] [style*="background:#fef2f2"] { background-color: rgba(239, 68, 68, .1) !important; }
[data-theme="dark"] [style*="background:#fef3c7"] { background-color: rgba(245, 158, 11, .18) !important; }
[data-theme="dark"] [style*="background:#ede9fe"] { background-color: rgba(139, 92, 246, .18) !important; }
[data-theme="dark"] [style*="background:#f5f3ff"] { background-color: rgba(139, 92, 246, .11) !important; }
[data-theme="dark"] [style*="background:#fce7f3"] { background-color: rgba(236, 72, 153, .17) !important; }
[data-theme="dark"] [style*="background:#e0f2fe"] { background-color: rgba(14, 165, 233, .17) !important; }
[data-theme="dark"] [style*="background:#dbeafe"] { background-color: rgba(59, 130, 246, .2) !important; }
[data-theme="dark"] [style*="background:#e0e7ff"] { background-color: rgba(99, 102, 241, .21) !important; }

/* Inline metin renkleri */
[data-theme="dark"] [style*="color:#0f172a"], [data-theme="dark"] [style*="color: #0f172a"],
[data-theme="dark"] [style*="color:#1e293b"], [data-theme="dark"] [style*="color: #1e293b"] { color: var(--text-1) !important; }
[data-theme="dark"] [style*="color:#334155"], [data-theme="dark"] [style*="color: #334155"],
[data-theme="dark"] [style*="color:#475569"], [data-theme="dark"] [style*="color: #475569"] { color: var(--text-2) !important; }
[data-theme="dark"] [style*="color:#64748b"], [data-theme="dark"] [style*="color: #64748b"] { color: var(--text-3) !important; }

/* Inline çizgiler */
[data-theme="dark"] [style*="border:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border: 1px solid #e2e8f0"],
[data-theme="dark"] [style*="border:1.5px solid #e2e8f0"] { border-color: var(--border-1) !important; }
[data-theme="dark"] [style*="border-bottom:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-bottom: 1px solid #e2e8f0"] { border-bottom-color: var(--border-1) !important; }
[data-theme="dark"] [style*="border-top:1px solid #e2e8f0"],
[data-theme="dark"] [style*="border-top: 1px solid #e2e8f0"] { border-top-color: var(--border-1) !important; }
[data-theme="dark"] [style*="border:1px solid #f1f5f9"],
[data-theme="dark"] [style*="border: 1px solid #f1f5f9"] { border-color: var(--border-2) !important; }
[data-theme="dark"] [style*="border:1px dashed #cbd5e1"],
[data-theme="dark"] [style*="border: 1px dashed #cbd5e1"],
[data-theme="dark"] [style*="border:2px dashed #cbd5e1"] { border-color: #33445f !important; }

/* Tema geçiş butonu (header) */
.theme-toggle-btn .fa-sun { display: none; }
[data-theme="dark"] .theme-toggle-btn .fa-sun { display: inline-block; }
[data-theme="dark"] .theme-toggle-btn .fa-moon { display: none; }
