/* ---------- Koyu tema ---------- */
.ikon-gunes { display: none; }
[data-bs-theme="dark"] .ikon-gunes { display: inline; }
[data-bs-theme="dark"] .ikon-ay { display: none; }

[data-bs-theme="dark"] {
    --pm-bg: #0b1220;
    --pm-surface: #111a2e;
    --pm-border: #1f2c47;
    --pm-text: #e5eaf5;
    --pm-muted: #94a3b8;
    --pm-primary-soft: #1e3a8a;
    --pm-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
    --bs-body-bg: #0b1220;
    --bs-body-color: #e5eaf5;
    --bs-link-color: #60a5fa;
    --bs-link-hover-color: #93c5fd;
    --bs-border-color: #1f2c47;
}
[data-bs-theme="dark"] body { background: var(--pm-bg); color: var(--pm-text); }
[data-bs-theme="dark"] .app-nav { background: linear-gradient(90deg, #060b16, #0f1a30); }
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] table.table:not(.mesai-grid),
[data-bs-theme="dark"] .mesai-grid-wrapper { background: var(--pm-surface); border-color: var(--pm-border); color: var(--pm-text); }
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select { background-color: #0d1527; border-color: #2a3b5e; color: var(--pm-text); }
[data-bs-theme="dark"] .form-label { color: #cbd5e1; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #cbd5e1; --bs-btn-border-color: #334768; --bs-btn-hover-bg: #1a2742; --bs-btn-hover-color: #fff; background: transparent; }
[data-bs-theme="dark"] .table { --bs-table-color: var(--pm-text); --bs-table-border-color: var(--pm-border); }
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-bg-type: #0f1829; }
[data-bs-theme="dark"] .table-hover > tbody > tr:hover > * { --bs-table-bg-state: #16264a; }
[data-bs-theme="dark"] .table > thead.table-dark th { background: #0a1224; border-color: #0a1224; }
[data-bs-theme="dark"] .table-light, [data-bs-theme="dark"] .table > thead.table-light th { --bs-table-bg: #16213a; color: #cbd5e1; }
[data-bs-theme="dark"] .alert-light { background: var(--pm-surface); border-color: var(--pm-border); color: var(--pm-text); }
[data-bs-theme="dark"] .bg-light { background-color: #16213a !important; color: var(--pm-text) !important; }
[data-bs-theme="dark"] .text-dark { color: var(--pm-text) !important; }
[data-bs-theme="dark"] .text-muted, [data-bs-theme="dark"] .page-sub { color: var(--pm-muted) !important; }
[data-bs-theme="dark"] .bar-label { color: #cbd5e1; }
[data-bs-theme="dark"] .bar-track { background: #1f2c47; }
[data-bs-theme="dark"] .kart-avatar { background: linear-gradient(135deg, #1e3a8a, #3730a3); color: #bfdbfe; }
[data-bs-theme="dark"] .personel-kart:hover { border-color: #3b82f6; box-shadow: 0 8px 22px rgba(59, 130, 246, .25); }
[data-bs-theme="dark"] body.auth-page { background: radial-gradient(circle at 20% 10%, rgba(30, 58, 138, .35) 0, transparent 45%), radial-gradient(circle at 85% 90%, rgba(76, 29, 149, .35) 0, transparent 45%), var(--pm-bg); }
[data-bs-theme="dark"] .auth-card { background: rgba(17, 26, 46, .75); border-color: rgba(148, 163, 184, .15); }
[data-bs-theme="dark"] .auth-card h4 { background-image: linear-gradient(90deg, #e5eaf5, #60a5fa, #a78bfa, #e5eaf5); }
[data-bs-theme="dark"] body.auth-page .app-main::before { mix-blend-mode: screen; }

/* Aylık mesai tablosu */
.btn-yazdir { display: inline-flex; align-items: center; background: linear-gradient(135deg, #7c3aed, #6366f1); border: 0; color: #fff; box-shadow: 0 1px 2px rgba(99, 102, 241, .4); }
.btn-yazdir:hover { color: #fff; filter: brightness(1.1); transform: translateY(-1px); }

[data-bs-theme="dark"] .mesai-grid-wrapper { background: #0d1527; }
[data-bs-theme="dark"] .mesai-grid { --bs-table-bg: transparent; color: var(--pm-text); }
[data-bs-theme="dark"] .mesai-grid td { border-color: #1f2c47 !important; background-color: #0f1829; color: var(--pm-text); }
[data-bs-theme="dark"] .mesai-grid tbody tr:nth-child(even) > td.mesai-cell:not(.hafta-sonu):not(.tip-ht):not(.tip-carsaf):not(.asim) { background-color: #111c33; }
[data-bs-theme="dark"] .mesai-grid td.hafta-sonu { background-color: #1a1626 !important; }
[data-bs-theme="dark"] .mesai-grid td.mesai-cell:hover { background-color: #1d2f58 !important; }
[data-bs-theme="dark"] .mesai-grid td.mesai-cell.bugun { outline-color: #60a5fa; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell .cell-value { background-color: #16213a; border-color: #2f4268; color: #cbd5e1; box-shadow: none; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell .cell-value:not(:empty) { background-color: #12355f; border-color: #3b82f6; color: #bfdbfe; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell .cell-input { background: #0d1527; color: #fff; border-color: #60a5fa; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.asim { background-color: #2a1219 !important; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.asim .cell-value { background-color: #5b1a24; border-color: #f87171; color: #fecaca; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.tip-ht { background-color: #2a1d0f !important; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.tip-ht .cell-value { background-color: #5a3410; border-color: #fb923c; color: #fed7aa; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.tip-carsaf { background-color: #231433 !important; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.tip-carsaf .cell-value { background-color: #4a1d6b; border-color: #c084fc; color: #e9d5ff; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.saved { background-color: #123a25 !important; }
[data-bs-theme="dark"] .mesai-grid .mesai-cell.error { background-color: #4a1219 !important; }
[data-bs-theme="dark"] .mesai-grid td.sticky-col, [data-bs-theme="dark"] .mesai-grid td.sticky-col-2 { background-color: #16213a !important; color: var(--pm-text) !important; }
[data-bs-theme="dark"] .mesai-grid tbody tr:hover > td.sticky-col, [data-bs-theme="dark"] .mesai-grid tbody tr:hover > td.sticky-col-2 { background-color: #1d2f58 !important; }
[data-bs-theme="dark"] .mesai-grid thead th { background-color: #0a1224 !important; color: #e5eaf5 !important; border-color: #1f2c47 !important; }
[data-bs-theme="dark"] .mesai-grid thead th.mesai-gun { background-color: #16213a !important; color: #e5eaf5 !important; }
[data-bs-theme="dark"] .mesai-grid thead th.mesai-gun .gun-adi { color: #94a3b8; }
[data-bs-theme="dark"] .mesai-grid thead th.mesai-gun.hafta-sonu { background-color: #3b1d28 !important; }
[data-bs-theme="dark"] .mesai-grid thead th.mesai-gun.hafta-sonu .gun-adi { color: #fca5a5; }
[data-bs-theme="dark"] .mesai-grid thead th.mesai-gun.bugun { outline-color: #60a5fa; }
[data-bs-theme="dark"] .mesai-grid td.satir-devir { background-color: #131d34; color: #94a3b8; font-size: .8rem; }
[data-bs-theme="dark"] .mesai-grid td.satir-toplam { background-color: #1a2a4d; color: #fff !important; }
[data-bs-theme="dark"] .mesai-grid td.satir-carsaf { background-color: #231433; color: #d8b4fe !important; }
[data-bs-theme="dark"] .mesai-grid td.satir-ht { background-color: #2a1d0f; color: #fdba74 !important; }
[data-bs-theme="dark"] .mesai-grid td.satir-kalan { background-color: #0f2d22; color: #86efac !important; }
[data-bs-theme="dark"] .mesai-grid td.satir-kalan.negatif { background-color: #3b1219; color: #fca5a5 !important; }
[data-bs-theme="dark"] .ctx-menu { background: #111a2e; border-color: #1f2c47; }
[data-bs-theme="dark"] .ctx-menu button { color: #e5eaf5; }
[data-bs-theme="dark"] .ctx-menu button:hover { background-color: #1d2f58; }
[data-bs-theme="dark"] .ctx-menu .ctx-header { color: #94a3b8; border-color: #1f2c47; }

/* Eski kurallar (yedek) */
[data-bs-theme="dark"] .mesai-grid td { border-color: var(--pm-border) !important; background-color: var(--pm-surface); color: var(--pm-text); }
[data-bs-theme="dark"] .mesai-grid td.sticky-col, [data-bs-theme="dark"] .mesai-grid td.sticky-col-2 { background-color: #16213a !important; color: var(--pm-text); }
[data-bs-theme="dark"] .mesai-grid tbody tr:hover > td.sticky-col, [data-bs-theme="dark"] .mesai-grid tbody tr:hover > td.sticky-col-2 { background-color: #1d2f58 !important; }
[data-bs-theme="dark"] .mesai-grid thead th.mesai-gun { background-color: #16213a !important; color: #cbd5e1; border-color: var(--pm-border) !important; }
[data-bs-theme="dark"] .mesai-grid thead th.mesai-gun.hafta-sonu { background-color: #3b1d28 !important; }
[data-bs-theme="dark"] .mesai-grid td.hafta-sonu { background-color: #1a1f33; }
[data-bs-theme="dark"] .mesai-grid .cell-input { background: transparent; color: inherit; }
[data-bs-theme="dark"] .mesai-grid td.satir-toplam { background-color: #1a2440; }
[data-bs-theme="dark"] .mesai-grid td.satir-kalan { background-color: #0f2d22; color: #86efac; }
[data-bs-theme="dark"] .mesai-grid td.satir-kalan.negatif { background-color: #3b1219; color: #fca5a5; }

/* Tablo satırı ve buton okunabilirliği */
[data-bs-theme="dark"] .table {
    --bs-table-striped-color: var(--pm-text);
    --bs-table-hover-color: var(--pm-text);
    --bs-table-active-color: var(--pm-text);
}
[data-bs-theme="dark"] .table > tbody > tr > * { color: var(--pm-text); }
[data-bs-theme="dark"] .table > tbody > tr > * .text-muted { color: var(--pm-muted) !important; }
[data-bs-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-color-type: var(--pm-text); color: var(--pm-text); }
[data-bs-theme="dark"] .btn-outline-dark { --bs-btn-color: #e5eaf5; --bs-btn-border-color: #475a7d; --bs-btn-hover-bg: #e5eaf5; --bs-btn-hover-color: #0b1220; --bs-btn-hover-border-color: #e5eaf5; --bs-btn-active-bg: #e5eaf5; --bs-btn-active-color: #0b1220; }
[data-bs-theme="dark"] .btn-dark { --bs-btn-bg: #334155; --bs-btn-border-color: #334155; --bs-btn-hover-bg: #475569; --bs-btn-hover-border-color: #475569; --bs-btn-color: #fff; }
[data-bs-theme="dark"] .btn-outline-success { --bs-btn-color: #4ade80; --bs-btn-border-color: #166534; --bs-btn-hover-bg: #16a34a; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #60a5fa; --bs-btn-border-color: #1e40af; --bs-btn-hover-bg: #2563eb; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-outline-danger { --bs-btn-color: #f87171; --bs-btn-border-color: #991b1b; --bs-btn-hover-bg: #dc2626; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .badge.bg-success-subtle { background-color: #14532d !important; color: #86efac !important; }
[data-bs-theme="dark"] .badge.bg-secondary-subtle { background-color: #334155 !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .badge.bg-danger-subtle { background-color: #4a1219 !important; color: #fca5a5 !important; }
[data-bs-theme="dark"] .badge.rozet-silme { background-color: #4a1219 !important; color: #fca5a5 !important; }
[data-bs-theme="dark"] .badge.rozet-mesai { background-color: #12355f !important; color: #bfdbfe !important; }
[data-bs-theme="dark"] .badge.rozet-ht { background-color: #5a3410 !important; color: #fed7aa !important; }
[data-bs-theme="dark"] .badge.rozet-carsaf { background-color: #4a1d6b !important; color: #e9d5ff !important; }
[data-bs-theme="dark"] .badge.rozet-devir { background-color: #14532d !important; color: #86efac !important; }

@media print {
    [data-bs-theme="dark"] .table > tbody > tr > * { color: #000 !important; background: #fff !important; }
    [data-bs-theme="dark"] body, [data-bs-theme="dark"] .card, [data-bs-theme="dark"] .mesai-grid td, [data-bs-theme="dark"] .table { background: #fff !important; color: #000 !important; }
}

/* Tema gecisinde animasyonlari kapat (takilmayi onler) */
html.tema-gecis *, html.tema-gecis *::before, html.tema-gecis *::after { transition: none !important; animation-duration: 0s !important; }
