/* =============================================================================
   HKU KYS — Dark Mode tema override
   ----------------------------------------------------------------------------
   Aktif olmasi icin <html data-theme="dark"> olmasi yeterli. JS toggle
   (hku-theme-toggle.js) bu attribute'u yonetir.
   FOUC onlemek icin <head>'de inline mini script ile attribute'in erken
   yazilmasi gerekir (entegrasyon talimatina bkz.).
   ----------------------------------------------------------------------------
   Strateji:
     1) :root degisken degerleri dark variant'a override edilir (hku-modern.css
        ve hku-theme.css'in tum komponentleri otomatik adapte olur).
     2) Sadece "renk degeri hardcoded #fff/#f8f9fa/..." olan yerlere ek
        selector-bazli override yazilir.
     3) Sol menu ACIK temada beyaz (hku-auth deseni); koyu temada --hku-sidebar-*
        tokenlari koyu sete cevrilir. Sidebar kurallari token-tabanli oldugu icin
        ayrica selector override GEREKMEZ.
   ============================================================================= */

/* Smooth tema gecisi */
html {
    transition: background-color .25s ease, color .25s ease;
}
body,
.hku-card, .hku-card-header, .hku-card-footer,
.hku-topbar, .hku-footer, .hku-filter-card,
.hku-kpi, .hku-quick, .hku-welcome,
.alert, .form-control, .form-select,
table.dataTable.hku-dt tbody tr,
.dropdown-menu, .modal-content,
.page-content-wrapper .page-head, .page-footer {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

/* =============================================================================
   1) CSS DEGISKEN OVERRIDE — tek kaynak doğruluk
   ============================================================================= */
[data-theme="dark"] {
    /* Kaynak: hku-auth HkuAuthFrontEnd/src/index.css — [data-theme='dark'] blogu.
       Acik temadaki token adlariyla BIREBIR ayni set; yalniz degerler degisir. */
    --hku-navy:           #4a7ab8;   /* koyu zeminde okunur lacivert */
    --hku-primary:        var(--hku-navy);
    --hku-primary-soft:   #3d6699;
    --hku-primary-light:  #5a8acc;
    --hku-primary-dark:   #345780;
    --hku-primary-tint:   rgba(255, 255, 255, .10);
    --hku-accent:         var(--hku-navy);
    --hku-accent-hover:   #5a8acc;
    --hku-text-on-primary:#ffffff;

    /* Yuzeyler */
    --hku-bg-soft:        #0f172a;
    --hku-card:           #1e293b;
    --hku-card-border:    #334155;
    --hku-border:         #334155;
    --hku-border-hover:   #475569;
    --hku-line:           #334155;
    /* Koyu temada zemin koyu oldugu icin ayrac ACILARAK belirginlesir. */
    --hku-rule-strong:    #64748b;
    --hku-input:          #334155;
    --hku-input-bg:       #172033;
    --hku-thead-bg:       #172033;
    --hku-label:          #94a3b8;

    /* Metin */
    --hku-text:           #e2e8f0;
    --hku-text-muted:     #94a3b8;

    /* Durum renkleri — acik tonlu zeminler koyu temada okunmaz, koyulastirilir */
    --hku-success:        #4caf76;
    --hku-success-muted:  #0f2a1c;
    --hku-warn:           #f5a623;
    --hku-warn-light:     #ffc850;
    --hku-warn-muted:     #2e2211;
    --hku-danger:         #ef4444;
    --hku-danger-muted:   #331617;
    --hku-info:           #4dabc7;
    --hku-info-muted:     #12263c;

    /* Golge — opacity dusurulmus (koyu zeminde aydinlik halka olusturmasin) */
    --hku-shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --hku-shadow-md: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    --hku-shadow-lg: 0 12px 28px rgba(0,0,0,.55);

    /* Sol menu — acik tema karari YALNIZ aydinlik mod icindir; koyu temada koyu kalir. */
    --hku-sidebar-bg:        #131c2e;
    --hku-sidebar-text:      #b9c6d8;
    --hku-sidebar-title:     #6f86a3;
    --hku-sidebar-active:    #dbeafe;
    --hku-sidebar-active-bg: rgba(255, 255, 255, .10);
    --hku-sidebar-hover:     rgba(255, 255, 255, .06);
    --hku-sidebar-border:    #24314a;

    /* Dark-only degiskenler (ozel komponent override'lari icin) */
    --hku-dark-surface:   #1e293b;
    --hku-dark-surface-2: #172033;
    --hku-dark-surface-3: #334155;
    --hku-dark-page-bg:   #0f172a;
    --hku-dark-divider:   #334155;

    color-scheme: dark;
}

/* =============================================================================
   2) BODY + GENEL ZEMIN
   ============================================================================= */
[data-theme="dark"] body {
    background-color: var(--hku-dark-page-bg);
    color: var(--hku-text);
}

/* =============================================================================
   3) TOPBAR (hku-modern.css) — beyaz topbar -> koyu yuzey
   ============================================================================= */
[data-theme="dark"] .hku-topbar {
    background: var(--hku-dark-surface);
    border-bottom: 1px solid var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .hku-topbar-toggle {
    color: var(--hku-text);
}
[data-theme="dark"] .hku-topbar-toggle:hover {
    background: var(--hku-dark-surface-3);
}
[data-theme="dark"] .hku-topbar-title {
    color: var(--hku-text);
}
[data-theme="dark"] .hku-topbar-user {
    color: var(--hku-text);
}
[data-theme="dark"] .hku-topbar-user:hover {
    background: var(--hku-dark-surface-3);
    color: #fff;
}
[data-theme="dark"] .hku-topbar-user .user-role {
    color: var(--hku-text-muted);
}

/* Topbar tema toggle butonu */
.hku-topbar-toggle.hku-theme-toggle {
    background: transparent;
    border: 0;
    color: var(--hku-primary);
    font-size: 1.15rem;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}
.hku-topbar-toggle.hku-theme-toggle:hover {
    background: var(--hku-bg-soft);
}
.hku-topbar-toggle.hku-theme-toggle:focus-visible {
    outline: 2px solid var(--hku-primary);
    outline-offset: 2px;
}
[data-theme="dark"] .hku-topbar-toggle.hku-theme-toggle {
    color: var(--hku-warn-light);
}
[data-theme="dark"] .hku-topbar-toggle.hku-theme-toggle:hover {
    background: var(--hku-dark-surface-3);
}

/* =============================================================================
   4) CARD (hku-card + Bootstrap .card)
   ============================================================================= */
[data-theme="dark"] .hku-card,
[data-theme="dark"] .card {
    background: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .hku-card-header,
[data-theme="dark"] .card-header {
    background: var(--hku-card);
    border-bottom: 1px solid var(--hku-line);
    color: var(--hku-text);
}
[data-theme="dark"] .hku-card-header .hku-card-title,
[data-theme="dark"] .card-header h1,
[data-theme="dark"] .card-header h2,
[data-theme="dark"] .card-header h3,
[data-theme="dark"] .card-header h4,
[data-theme="dark"] .card-header h5,
[data-theme="dark"] .card-header h6 {
    color: var(--hku-text);
}
[data-theme="dark"] .hku-card-footer,
[data-theme="dark"] .card-footer {
    background: var(--hku-dark-surface-2);
    border-top: 1px solid var(--hku-dark-divider);
    color: var(--hku-text-muted);
}

/* Filter card */
[data-theme="dark"] .hku-filter-card {
    background: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
}

/* =============================================================================
   5) FORM INPUT'lar
   ============================================================================= */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select,
[data-theme="dark"] .hku-form .form-control,
[data-theme="dark"] .hku-form .form-select,
[data-theme="dark"] .hku-form-control,
[data-theme="dark"] textarea.form-control,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="url"] {
    background-color: var(--hku-dark-surface);
    border-color: #4a5568;
    color: var(--hku-text);
}
[data-theme="dark"] .form-control::placeholder,
[data-theme="dark"] .hku-form .form-control::placeholder {
    color: #718096;
    opacity: 1;
}
[data-theme="dark"] .form-control:hover,
[data-theme="dark"] .form-select:hover,
[data-theme="dark"] .hku-form .form-control:hover,
[data-theme="dark"] .hku-form .form-select:hover {
    border-color: #6b7a8f;
}
[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .hku-form .form-control:focus,
[data-theme="dark"] .hku-form .form-select:focus,
[data-theme="dark"] .hku-form-control:focus {
    background-color: var(--hku-dark-surface);
    border-color: var(--hku-primary);
    color: var(--hku-text);
    box-shadow: 0 0 0 3px rgba(74, 122, 184, .25);
}
[data-theme="dark"] .form-control[readonly],
[data-theme="dark"] .form-control:disabled,
[data-theme="dark"] .form-select:disabled,
[data-theme="dark"] .hku-form .form-control[readonly],
[data-theme="dark"] .hku-form .form-control:disabled {
    background-color: var(--hku-dark-surface-2);
    color: var(--hku-text-muted);
    opacity: .7;
}

/* Form label + help text */
[data-theme="dark"] .form-label,
[data-theme="dark"] .hku-form .form-label,
[data-theme="dark"] label {
    color: #cbd5e0;
}
[data-theme="dark"] .form-text,
[data-theme="dark"] .hku-form .form-text {
    color: var(--hku-text-muted);
}

/* Checkbox + radio */
[data-theme="dark"] .form-check-input {
    background-color: var(--hku-dark-surface);
    border-color: #6b7a8f;
}
[data-theme="dark"] .form-check-input:checked {
    background-color: var(--hku-primary);
    border-color: var(--hku-primary);
}
[data-theme="dark"] .form-check-label {
    color: var(--hku-text);
}

/* Input-group addon */
[data-theme="dark"] .input-group-text {
    background-color: var(--hku-dark-surface-2);
    border-color: #4a5568;
    color: var(--hku-text);
}

/* Autofill (Chrome) — sari arkaplan'i bastir */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover,
[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] textarea:-webkit-autofill,
[data-theme="dark"] select:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 30px var(--hku-dark-surface) inset !important;
    -webkit-text-fill-color: var(--hku-text) !important;
    caret-color: var(--hku-text);
}

/* =============================================================================
   6) BUTONLAR — hardcoded beyaz/koyu yer override'lari
   ============================================================================= */
[data-theme="dark"] .hku-btn-secondary {
    background: var(--hku-dark-surface);
    color: var(--hku-text);
    border-color: #4a5568;
}
[data-theme="dark"] .hku-btn-secondary:hover {
    background: var(--hku-dark-surface-3);
    border-color: var(--hku-primary);
    color: #fff;
}
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn.grey {
    background-color: transparent !important;
    border: 1px solid #6b7a8f !important;
    color: var(--hku-text) !important;
}
[data-theme="dark"] .btn-secondary:hover,
[data-theme="dark"] .btn.grey:hover {
    background-color: #4a5568 !important;
    border-color: #6b7a8f !important;
    color: #fff !important;
}
[data-theme="dark"] .btn-light,
[data-theme="dark"] .btn-outline-light {
    background-color: var(--hku-dark-surface);
    border-color: #4a5568;
    color: var(--hku-text);
}
[data-theme="dark"] .btn-link {
    color: var(--hku-primary-light);
}
[data-theme="dark"] .btn-link:hover {
    color: var(--hku-warn-light);
}

/* btn-close (modal kapatma) — dark zemin uzerinde gorunsun */
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

/* =============================================================================
   7) DATATABLES — thead lacivert gradyan KORUNUR (kontrast yeterli)
       tbody satirlari dark uyumlu yapilir.
   ============================================================================= */
[data-theme="dark"] table.dataTable,
[data-theme="dark"] table.dataTable.hku-dt {
    background-color: transparent;
    color: var(--hku-text);
}
[data-theme="dark"] table.dataTable.hku-dt tbody tr {
    background-color: var(--hku-dark-surface) !important;
}
[data-theme="dark"] table.dataTable.hku-dt tbody tr.odd {
    background-color: var(--hku-dark-surface-2) !important;
}
[data-theme="dark"] table.dataTable.hku-dt tbody tr:hover {
    background-color: var(--hku-dark-surface-3) !important;
}
[data-theme="dark"] table.dataTable.hku-dt tbody td {
    border-bottom: 1px solid var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] table.dataTable tbody tr,
[data-theme="dark"] table.dataTable tbody td {
    color: var(--hku-text);
    border-color: var(--hku-dark-divider);
}

/* DataTables kontrol elemanlari */
[data-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-theme="dark"] .dataTables_wrapper .dataTables_length select {
    background-color: var(--hku-dark-surface);
    border-color: #4a5568;
    color: var(--hku-text);
}
[data-theme="dark"] .dataTables_wrapper .dataTables_filter label,
[data-theme="dark"] .dataTables_wrapper .dataTables_length label,
[data-theme="dark"] .dataTables_wrapper .dataTables_info {
    color: var(--hku-text-muted);
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--hku-text) !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--hku-dark-surface-3) !important;
    border-color: var(--hku-dark-divider) !important;
    color: #fff !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--hku-primary) !important;
    border-color: var(--hku-primary) !important;
    color: #fff !important;
}
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
    color: #4a5568 !important;
    background: transparent !important;
    border-color: transparent !important;
}

/* DataTables toolbar (Print/Excel/PDF) */
[data-theme="dark"] .dataTables_wrapper .dt-buttons .dt-button {
    background: #4a5568 !important;
    color: var(--hku-text) !important;
    border: 0 !important;
}
[data-theme="dark"] .dataTables_wrapper .dt-buttons .dt-button:hover {
    background: #6b7a8f !important;
    color: #fff !important;
}

/* =============================================================================
   8) DASHBOARD — Welcome banner + KPI + Quick action
   ============================================================================= */
/* Welcome banner: lacivert gradyan KORUNUR — sadece daha derin ton */
[data-theme="dark"] .hku-welcome {
    background: linear-gradient(135deg, var(--hku-primary-dark) 0%, #1f2a44 100%);
    box-shadow: var(--hku-shadow-md);
}
[data-theme="dark"] .hku-welcome::before {
    background: radial-gradient(circle, rgba(255, 184, 28, .10) 0%, transparent 70%);
}

/* KPI cards */
[data-theme="dark"] .hku-kpi {
    background: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .hku-kpi:hover {
    box-shadow: var(--hku-shadow-md);
    color: var(--hku-text);
}
[data-theme="dark"] .hku-kpi-label {
    color: var(--hku-text-muted);
}
[data-theme="dark"] .hku-kpi-value {
    color: #ffffff;
}
[data-theme="dark"] .hku-kpi-trend {
    color: var(--hku-text-muted);
}
/* KPI ikon arkaplanlari — dark zemin uzerinde biraz daha opaklik */
[data-theme="dark"] .hku-kpi.kpi-primary .hku-kpi-icon { background: rgba(74,122,184,.20);  color: var(--hku-primary-light); }
[data-theme="dark"] .hku-kpi.kpi-danger  .hku-kpi-icon { background: rgba(212,69,69,.22);   color: #ef6b6b; }
[data-theme="dark"] .hku-kpi.kpi-warn    .hku-kpi-icon { background: rgba(245,166,35,.22);  color: var(--hku-warn-light); }
[data-theme="dark"] .hku-kpi.kpi-success .hku-kpi-icon { background: rgba(76,175,118,.22);  color: #6ec98f; }
[data-theme="dark"] .hku-kpi.kpi-info    .hku-kpi-icon { background: rgba(77,171,199,.22);  color: #6fc0d8; }
[data-theme="dark"] .hku-kpi.kpi-accent  .hku-kpi-icon { background: rgba(212,69,69,.20);   color: #ef6b6b; }

/* Quick action cards */
[data-theme="dark"] .hku-quick {
    background: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .hku-quick:hover {
    border-color: var(--hku-primary);
    color: var(--hku-primary-light);
}
[data-theme="dark"] .hku-quick-icon {
    background: var(--hku-dark-surface-2);
    color: var(--hku-primary-light);
}
[data-theme="dark"] .hku-quick-title {
    color: var(--hku-text);
}
[data-theme="dark"] .hku-quick-desc {
    color: var(--hku-text-muted);
}

/* Section title */
[data-theme="dark"] .hku-section-title {
    color: var(--hku-text);
    border-bottom-color: var(--hku-dark-divider);
}

/* =============================================================================
   9) PAGE HEADER (modern + legacy KYS)
   ============================================================================= */
[data-theme="dark"] .hku-page-header {
    border-bottom-color: var(--hku-rule-strong);
}
[data-theme="dark"] .hku-page-header h1,
[data-theme="dark"] .hku-page-header h2 {
    color: var(--hku-text);
}

/* Legacy KYS page-head (Metronic) */
[data-theme="dark"] .page-content-wrapper .page-head {
    background: var(--hku-dark-surface);
    border-bottom: 1px solid var(--hku-dark-divider);
}
[data-theme="dark"] .page-content-wrapper .page-head .page-title h1 {
    color: var(--hku-accent);
}
[data-theme="dark"] .page-content-wrapper .page-content {
    color: var(--hku-text);
}

/* Legacy KYS footer */
[data-theme="dark"] .page-footer {
    background: var(--hku-dark-surface) !important;
    color: var(--hku-text-muted) !important;
    border-top: 1px solid var(--hku-dark-divider);
}

/* hku-modern footer */
[data-theme="dark"] .hku-footer {
    background: var(--hku-dark-surface);
    border-top-color: var(--hku-dark-divider);
    color: var(--hku-text-muted);
}

/* =============================================================================
   10) ALERTS — dark variant
   ============================================================================= */
[data-theme="dark"] .alert.hku-alert-success,
[data-theme="dark"] .alert-success {
    background: rgba(76, 175, 118, .12);
    border-color: rgba(76, 175, 118, .35);
    border-left-color: var(--hku-success);
    color: #95d5af;
}
[data-theme="dark"] .alert.hku-alert-danger,
[data-theme="dark"] .alert-danger {
    background: rgba(220, 53, 69, .12);
    border-color: rgba(220, 53, 69, .35);
    border-left-color: #ef6b6b;
    color: #f5a6a6;
}
[data-theme="dark"] .alert.hku-alert-info,
[data-theme="dark"] .alert-info {
    background: rgba(77, 171, 199, .12);
    border-color: rgba(77, 171, 199, .35);
    border-left-color: var(--hku-info);
    color: #9ed7e6;
}
[data-theme="dark"] .alert.hku-alert-warning,
[data-theme="dark"] .alert-warning {
    background: rgba(245, 166, 35, .12);
    border-color: rgba(245, 166, 35, .35);
    border-left-color: var(--hku-warn);
    color: #f5cb8a;
}
[data-theme="dark"] .alert-secondary,
[data-theme="dark"] .alert-light {
    background: var(--hku-dark-surface-2);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
}

/* =============================================================================
   11) DETAY (dl > dt/dd)
   ============================================================================= */
[data-theme="dark"] .hku-card-body dl.row dt,
[data-theme="dark"] .hku-card-body dl dt {
    color: var(--hku-text-muted);
}
[data-theme="dark"] .hku-card-body dl.row dd,
[data-theme="dark"] .hku-card-body dl dd {
    color: var(--hku-text);
    border-bottom: 1px solid var(--hku-dark-divider);
}
[data-theme="dark"] .hku-card-body dl dd.empty,
[data-theme="dark"] .hku-card-body dl dd:empty::after {
    color: #4a5568;
}

/* =============================================================================
   12) TIMELINE
   ============================================================================= */
[data-theme="dark"] .hku-timeline::before {
    background: var(--hku-dark-divider);
}
[data-theme="dark"] .hku-timeline > li::before {
    background: var(--hku-dark-surface);
    border-color: var(--hku-primary-light);
}

/* =============================================================================
   13) DROPDOWN + MODAL + POPOVER + TOOLTIP
   ============================================================================= */
[data-theme="dark"] .dropdown-menu {
    background-color: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
    box-shadow: var(--hku-shadow-md);
}
[data-theme="dark"] .dropdown-menu .dropdown-item {
    color: var(--hku-text);
}
[data-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-theme="dark"] .dropdown-menu .dropdown-item:focus {
    background-color: var(--hku-dark-surface-3);
    color: #fff;
}
[data-theme="dark"] .dropdown-menu .dropdown-item.active,
[data-theme="dark"] .dropdown-menu .dropdown-item:active {
    background-color: var(--hku-primary);
    color: #fff;
}
[data-theme="dark"] .dropdown-divider {
    border-top-color: var(--hku-dark-divider);
}
[data-theme="dark"] .dropdown-header {
    color: var(--hku-text-muted);
}

/* Legacy Metronic dropdown-menu-default */
[data-theme="dark"] .dropdown-menu-default {
    background: var(--hku-dark-surface) !important;
}
[data-theme="dark"] .dropdown-menu-default > li > a {
    color: var(--hku-text) !important;
}
[data-theme="dark"] .dropdown-menu-default > li > a:hover {
    background: var(--hku-dark-surface-3) !important;
    color: #fff !important;
}

/* Modal */
[data-theme="dark"] .modal-content {
    background-color: var(--hku-dark-surface);
    color: var(--hku-text);
    border: 1px solid var(--hku-dark-divider);
}
[data-theme="dark"] .modal-header {
    border-bottom: 1px solid var(--hku-dark-divider);
    background: linear-gradient(180deg, var(--hku-dark-surface) 0%, var(--hku-dark-surface-2) 100%);
}
[data-theme="dark"] .modal-footer {
    border-top: 1px solid var(--hku-dark-divider);
    background: var(--hku-dark-surface-2);
}
[data-theme="dark"] .modal-backdrop {
    background-color: #000;
}
[data-theme="dark"] .modal-backdrop.show {
    opacity: .7;
}

/* Tooltip + Popover */
[data-theme="dark"] .popover {
    background-color: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .popover-header {
    background-color: var(--hku-dark-surface-2);
    border-bottom-color: var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .popover-body {
    color: var(--hku-text);
}

/* =============================================================================
   14) LIST GROUP + NAV TABS + PROGRESS + ACCORDION
   ============================================================================= */
[data-theme="dark"] .list-group-item {
    background-color: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .list-group-item:hover {
    background-color: var(--hku-dark-surface-3);
}
[data-theme="dark"] .list-group-item.active {
    background-color: var(--hku-primary);
    border-color: var(--hku-primary);
    color: #fff;
}

[data-theme="dark"] .nav-tabs {
    border-bottom-color: var(--hku-dark-divider);
}
[data-theme="dark"] .nav-tabs .nav-link {
    color: var(--hku-text-muted);
    border-color: transparent;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
    color: var(--hku-text);
    border-color: transparent;
    background-color: transparent;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background-color: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider) var(--hku-dark-divider) var(--hku-dark-surface);
    color: var(--hku-primary-light);
}

[data-theme="dark"] .progress {
    background-color: var(--hku-dark-surface-2);
}
[data-theme="dark"] .progress-bar {
    background-color: var(--hku-primary);
}

[data-theme="dark"] .accordion-item {
    background-color: var(--hku-dark-surface);
    border-color: var(--hku-dark-divider);
    color: var(--hku-text);
}
[data-theme="dark"] .accordion-button {
    background-color: var(--hku-dark-surface);
    color: var(--hku-text);
}
[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: var(--hku-dark-surface-2);
    color: var(--hku-primary-light);
    box-shadow: inset 0 -1px 0 var(--hku-dark-divider);
}
[data-theme="dark"] .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(180%);
}
[data-theme="dark"] .accordion-body {
    background-color: var(--hku-dark-surface);
    color: var(--hku-text);
}

/* =============================================================================
   15) TABLOLAR (Bootstrap .table — DataTables disindaki ham tablolar)
   ============================================================================= */
[data-theme="dark"] .table,
[data-theme="dark"] .table > :not(caption) > * > * {
    color: var(--hku-text);
    border-color: var(--hku-dark-divider);
    background-color: transparent;
}
[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: var(--hku-dark-surface-2);
    color: var(--hku-text);
}
[data-theme="dark"] .table-hover > tbody > tr:hover > * {
    background-color: var(--hku-dark-surface-3);
    color: var(--hku-text);
}
[data-theme="dark"] .table thead th {
    color: var(--hku-text);
    border-color: var(--hku-dark-divider);
}

/* =============================================================================
   16) LEGACY METRONIC (page-header, hor-menu) — dark surface adapte
   ============================================================================= */
[data-theme="dark"] .page-header.navbar,
[data-theme="dark"] .page-header,
[data-theme="dark"] .page-header .page-header-top {
    background: #14233a !important;
}
[data-theme="dark"] .page-header-menu {
    background-color: #1a2c47;
}
[data-theme="dark"] .page-header-menu .hor-menu .nav.navbar-nav > li:hover > a,
[data-theme="dark"] .page-header-menu .hor-menu .nav.navbar-nav > li.active > a,
[data-theme="dark"] .page-header-menu .hor-menu .nav.navbar-nav > li.open > a {
    background-color: #25406b;
}

/* Legacy portlet sari header KORUNUR (kasitli vurgu) */

/* =============================================================================
   17) ANCHOR + KOD + HR + BLOCKQUOTE
   ============================================================================= */
[data-theme="dark"] a {
    color: var(--hku-primary-light);
}
[data-theme="dark"] a:hover {
    color: var(--hku-warn-light);
}
[data-theme="dark"] hr {
    border-color: var(--hku-dark-divider);
    opacity: .6;
}
[data-theme="dark"] code,
[data-theme="dark"] kbd,
[data-theme="dark"] pre {
    background-color: var(--hku-dark-surface-2);
    color: #f8b8b8;
}
[data-theme="dark"] pre {
    color: var(--hku-text);
    padding: .75rem 1rem;
    border-radius: 6px;
    border: 1px solid var(--hku-dark-divider);
}
[data-theme="dark"] blockquote {
    border-left: 4px solid var(--hku-primary);
    background: var(--hku-dark-surface-2);
    color: var(--hku-text);
}

/* Bootstrap text-* yardımcılarını dark-friendly tut */
[data-theme="dark"] .text-muted {
    color: var(--hku-text-muted) !important;
}
[data-theme="dark"] .text-dark {
    color: var(--hku-text) !important;
}
[data-theme="dark"] .text-body {
    color: var(--hku-text) !important;
}
[data-theme="dark"] .bg-white {
    background-color: var(--hku-dark-surface) !important;
}
[data-theme="dark"] .bg-light {
    background-color: var(--hku-dark-surface-2) !important;
    color: var(--hku-text) !important;
}
[data-theme="dark"] .border {
    border-color: var(--hku-dark-divider) !important;
}
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-start,
[data-theme="dark"] .border-end {
    border-color: var(--hku-dark-divider) !important;
}

/* =============================================================================
   18) LOGIN SAYFASI — dark friendly
   ============================================================================= */
[data-theme="dark"] .hku-login-card {
    background-color: var(--hku-dark-surface);
    color: var(--hku-text);
    border-top: 4px solid var(--hku-accent);
}
[data-theme="dark"] .hku-brand-title {
    color: var(--hku-primary-light);
}

/* =============================================================================
   19) SCROLLBAR (WebKit + Firefox)
   ============================================================================= */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--hku-dark-page-bg);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a4556;
    border-radius: 5px;
    border: 2px solid var(--hku-dark-page-bg);
}
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4a5568;
}
[data-theme="dark"] html {
    scrollbar-color: #3a4556 var(--hku-dark-page-bg);
}

/* =============================================================================
   20) SELECTION (vurgulanmis metin) + FOCUS RING
   ============================================================================= */
[data-theme="dark"] ::selection {
    background-color: rgba(74, 122, 184, .55);
    color: #fff;
}
[data-theme="dark"] :focus-visible {
    outline-color: var(--hku-primary-light);
}

/* =============================================================================
   21) CHART.JS — canvas etrafindaki div'lere yardim
   ============================================================================= */
[data-theme="dark"] canvas {
    /* Chart.js'in plugin'i renkleri data-theme'e gore vermiyorsa
       en azindan zemin koyu olsun. Color override JS tarafinda yapilmali. */
}

/* =============================================================================
   22) BADGE — bg-* baselineları (Bootstrap'in koyu zemin uyumsuzlugunu engelle)
   ============================================================================= */
[data-theme="dark"] .badge.bg-light {
    background-color: var(--hku-dark-surface-3) !important;
    color: var(--hku-text) !important;
}
[data-theme="dark"] .badge.bg-secondary {
    background-color: #4a5568 !important;
    color: #fff !important;
}

/* =============================================================================
   23) PRINT — dark mode'da yazdirma her zaman acik tema
   ============================================================================= */
@media print {
    [data-theme="dark"] body,
    [data-theme="dark"] .hku-card,
    [data-theme="dark"] .hku-card-body,
    [data-theme="dark"] .hku-card-header {
        background: #fff !important;
        color: #000 !important;
        border-color: #ddd !important;
    }
    [data-theme="dark"] * {
        color: #000 !important;
        background-color: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
}

/* =============================================================================
   24) REDUCED MOTION — tema gecisi animasyonunu kapat
   ============================================================================= */
@media (prefers-reduced-motion: reduce) {
    html,
    body,
    .hku-card, .hku-card-header, .hku-card-footer,
    .hku-topbar, .hku-footer, .hku-filter-card,
    .hku-kpi, .hku-quick, .hku-welcome,
    .alert, .form-control, .form-select,
    table.dataTable.hku-dt tbody tr,
    .dropdown-menu, .modal-content,
    .page-content-wrapper .page-head, .page-footer,
    .hku-topbar-toggle.hku-theme-toggle {
        transition: none !important;
    }
}

/* =============================================================================
   ANA EYLEM BUTONU — koyu temada dolgu ile METIN ayri tokenlardan gelir
   ----------------------------------------------------------------------------
   --hku-primary koyu temada aciklastirildi (#4a7ab8) cunku METIN/ikon olarak
   koyu zeminde okunmasi gerekiyor. Ama ayni deger BUTON DOLGUSU olunca beyaz
   yazi ile kontrast 4.4:1'e dusuyor (olculdu) — AA sinirinda. Buton dolgusu
   bu yuzden ayri ve daha koyu bir tona baglanir: beyaz metinle ~6.4:1.
   hku-auth'ta da buton koyu temada koyu lacivert kalir.
   ============================================================================= */
[data-theme="dark"] .hku-btn-primary,
[data-theme="dark"] .btn-primary {
    background: #0f5ea8;
    border-color: #0f5ea8;
    color: #fff;
}
[data-theme="dark"] .hku-btn-primary:hover,
[data-theme="dark"] .hku-btn-primary:focus,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-primary:focus {
    background: #1272c6;
    border-color: #1272c6;
    color: #fff;
}
