:root {
    --bg-primary: #f0f7ff;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e3eef9;
    --border-color: #d0e2f2;
    --border-hover: #b5cfe0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --accent-green: #22c55e;
    --accent-orange: #f59e0b;
    --accent-red: #ef4444;
    --sidebar-width: 230px;
}

* {
    box-sizing: border-box;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
}

    a:hover {
        color: #60a5fa;
    }

/* ==================== NAVBAR ==================== */
.navbar-taskflow {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    height: 56px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
}

    .navbar-brand .logo {
        width: 32px;
        height: 32px;
        border-radius: 8px;
        background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-weight: 800;
        font-size: 14px;
    }

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    height: calc(100vh - 56px);
    position: fixed;
    top: 56px;
    left: 0;
    overflow-y: auto;
    transition: transform 0.25s ease;
    z-index: 900;
}

    .sidebar.collapsed {
        transform: translateX(-100%);
    }

.sidebar-nav {
    padding: 12px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 14px;
    transition: all 0.15s;
    margin-bottom: 2px;
}

    .sidebar-link:hover {
        background: rgba(0, 0, 0, 0.04);
        color: var(--text-primary);
    }

    .sidebar-link.active {
        background: rgba(59, 130, 246, 0.10);
        color: var(--accent-blue);
        font-weight: 600;
    }

    .sidebar-link i {
        font-size: 17px;
        width: 22px;
        text-align: center;
    }

/* ==================== MAIN CONTENT ==================== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: calc(100vh - 56px);
    transition: margin-left 0.25s ease;
}

.sidebar.collapsed + .main-content {
    margin-left: 0;
}

/* ==================== BAKIM MODU BANNER ==================== */
.maintenance-banner {
    margin-left: var(--sidebar-width);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 18px;
    background: linear-gradient(90deg, #f59e0b, #ef4444);
    color: #fff;
    border-bottom: 1px solid rgba(0,0,0,0.15);
    font-size: 13px;
    z-index: 100;
}

.maintenance-banner > i {
    font-size: 22px;
    flex-shrink: 0;
}

.maintenance-banner-text {
    flex: 1;
    min-width: 0;
}

.maintenance-banner-title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.3;
}

.maintenance-banner-msg {
    font-size: 12px;
    opacity: 0.95;
    line-height: 1.3;
}

.maintenance-banner-countdown {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-weight: 700;
    font-size: 18px;
    background: rgba(0,0,0,0.25);
    padding: 4px 12px;
    border-radius: 6px;
    flex-shrink: 0;
}

.sidebar.collapsed ~ .maintenance-banner {
    margin-left: 0;
}

@media (max-width: 768px) {
    .maintenance-banner {
        margin-left: 0;
        flex-wrap: wrap;
    }
}

/* ==================== STAT CARDS ==================== */
.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.2s;
}

    .stat-card:hover {
        border-color: var(--border-hover);
    }

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.2;
}

/* ==================== FORMS ==================== */
.form-control, .form-select {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 7px;
    padding: 9px 12px;
    font-size: 14px;
}

    .form-control:focus, .form-select:focus {
        background: var(--bg-primary);
        border-color: var(--accent-blue);
        color: var(--text-primary);
        box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
    }

    .form-control::placeholder {
        color: var(--text-muted);
    }

.btn-primary {
    background: var(--accent-blue);
    border: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 14px;
    padding: 9px 18px;
}

    .btn-primary:hover {
        background: #2563eb;
    }

.btn-outline-secondary {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* ==================== NOTIFICATIONS DROPDOWN ==================== */
#notifDropdown {
    position: absolute;
    right: 0;
    top: 44px;
    width: 360px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 2000;
    overflow: hidden;
}

    #notifDropdown.show {
        display: block;
    }

.notification-item {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
    color: var(--text-secondary);
    font-size: 13px;
}

    .notification-item:hover {
        background: rgba(255, 255, 255, 0.04);
    }

    .notification-item.unread {
        background: rgba(59, 130, 246, 0.08);
    }

        .notification-item.unread .notification-text {
            color: var(--text-primary);
        }

.notification-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-blue);
    flex-shrink: 0;
    margin-top: 6px;
}

/* ==================== AVATAR ==================== */
.avatar-sm {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
}

.avatar-md {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    object-fit: cover;
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    font-size: 12px;
    border-radius: 6px;
}

/* ==================== TABLE (Admin) ==================== */
.table-dark-custom {
    background: var(--bg-secondary);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

    .table-dark-custom th {
        background: var(--bg-tertiary);
        color: var(--text-muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 600;
        border-bottom: 1px solid var(--border-color);
        padding: 12px 16px;
    }

    .table-dark-custom td {
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
        font-size: 14px;
        color: var(--text-primary);
        vertical-align: middle;
    }

/* ==================== BADGE / TAG ==================== */
.badge-priority {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.priority-Low {
    background: #052e16;
    color: #22c55e;
}

.priority-Medium {
    background: #451a03;
    color: #f59e0b;
}

.priority-High {
    background: #431407;
    color: #f97316;
}

.priority-Critical {
    background: #450a0a;
    color: #ef4444;
}

.badge-role {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ==================== TOAST ==================== */
#toastContainer {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

/* ==================== MODAL (Dark) ==================== */
.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* ==================== KAPATMA BUTONU (modal / alert / toast) ====================
   Bootstrap'in varsayilan .btn-close ikonu SABIT SIYAH bir SVG'dir ve opaklığı
   0.5'tir. Onceki `filter: invert(1)` kurali bunu her zaman beyaza ceviriyordu;
   varsayilan (acik) temada modal zemini beyaz oldugu icin buton gorunmez hale
   geliyordu - koyu temada da yari saydam kaldigi icin soluk gorunuyordu.

   Cozum: ikonu maske olarak kullanip rengini `currentColor`dan almak. Boylece
   ikon temanin metin rengini izler ve tema degistiginde (body[data-theme-mode])
   ek bir kurala gerek kalmadan dogru kontrastta kalir. */
.btn-close {
    --bs-btn-close-opacity: 1;
    --bs-btn-close-hover-opacity: 1;
    --bs-btn-close-focus-opacity: 1;
    --bs-btn-close-focus-shadow: none;
    position: relative;
    filter: none;
    background-color: transparent;
    border-radius: 8px;
    color: var(--text-muted);
    opacity: 1;
    transition: color .15s ease, background-color .15s ease, transform .12s ease;
}

/* Maske destegi olan tarayicilarda ikonu currentColor ile boyariz.
   Desteklemeyen tarayicilarda bu blok hic uygulanmaz; Bootstrap'in kendi
   arka plan SVG'si yerinde kalir (siyah X + tam opaklik) - ideal degil ama
   her zaman gorunur. Bu yuzden `background-image: none` de bu blok icinde. */
@supports ((-webkit-mask-image: none) or (mask-image: none)) {
    .btn-close {
        background-image: none;
    }

        .btn-close::before {
            content: "";
            position: absolute;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
            background-color: currentColor;
            -webkit-mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 13px 13px no-repeat;
            mask: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") center / 13px 13px no-repeat;
        }
}

    .btn-close:hover {
        color: var(--text-primary);
        background-color: var(--bg-tertiary);
    }

    .btn-close:active {
        transform: scale(0.92);
    }

    .btn-close:focus-visible {
        outline: none;
        color: var(--text-primary);
        box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
    }

/* Modal basliklarinda dokunmatige uygun kare hedef alani.
   Bootstrap negatif marj (-.5rem) ile ikonu icerik kenarina tasirir; butonun
   artik gorunur bir hover zemini oldugu icin bunu kullanmiyoruz - kutu
   basligin ic bosluguyla hizali kalsin ve yanindaki aksiyon butonlariyla
   (ornegin gorev modalindaki link kopyala) ayni cizgide dursun. */
.modal-header .btn-close {
    width: 32px;
    height: 32px;
    padding: 0;
    margin: 0 0 0 auto;
    flex-shrink: 0;
}

/* Bootstrap'in .btn-close-white varyanti invert filtresi uygular; maske
   yaklasimiyla birlestiginde rengi ters cevirecegi icin devre disi birakiyoruz.
   Notr zeminlerde (modal basligi) buton artik temayi izler. */
.btn-close-white {
    filter: none;
}

/* Renkli/koyu zeminlerde (toast, dolu renkli uyarilar) beyaz kalmali */
.toast .btn-close-white {
    color: #fff;
}

    .toast .btn-close-white:hover {
        color: #fff;
        background-color: rgba(255, 255, 255, 0.22);
    }

/* ==================== ACCESS DENIED ==================== */
.access-denied {
    text-align: center;
    padding: 80px 20px;
}

    .access-denied h1 {
        font-size: 72px;
        font-weight: 800;
        color: var(--accent-red);
        margin-bottom: 10px;
    }

/* ==================== PAGE HEADER ==================== */
.page-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
}

    .page-header h1,
    .page-header h2 {
        font-size: 20px;
        font-weight: 700;
        margin: 0;
        color: var(--text-primary);
    }

    .page-header p {
        font-size: 14px;
        color: var(--text-secondary);
        margin: 4px 0 0;
    }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.mobile-open {
            transform: translateX(0);
        }

    .main-content {
        margin-left: 0 !important;
    }

    .stat-card {
        padding: 12px 14px;
    }
}
/* ============================================================
   POPUP / TOAST BILDIRIM SISTEMI
   Bu dosyayi site.css'in SONUNA ekleyin
   ============================================================ */

/* Container - sag ust kose */
#tfPopupContainer {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: 100%;
    pointer-events: none;
}

/* Tek popup karti */
.tf-popup {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.05);
    cursor: pointer;
    pointer-events: all;
    position: relative;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

    /* Giris animasyonu */
    .tf-popup.tf-popup-enter {
        transform: translateX(0);
        opacity: 1;
    }

    /* Cikis animasyonu */
    .tf-popup.tf-popup-exit {
        transform: translateX(120%);
        opacity: 0;
        transition: transform 0.3s ease-in, opacity 0.2s ease;
    }

    .tf-popup:hover {
        border-color: var(--accent-blue);
        background: var(--bg-secondary);
    }

/* Avatar - resim */
.tf-popup-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

/* Avatar - harf dairesi */
.tf-popup-avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}

/* Icon dairesi (bildirimler icin) */
.tf-popup-icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* Icerik */
.tf-popup-body {
    flex: 1;
    min-width: 0;
}

.tf-popup-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tf-popup-message {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Kapatma butonu */
.tf-popup-close {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.tf-popup:hover .tf-popup-close {
    opacity: 1;
}

.tf-popup-close:hover {
    color: var(--text-primary);
}

/* Alt ilerleme cubugu (zaman gostergesi) */
.tf-popup-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    border-radius: 0 0 14px 14px;
    animation: tfPopupProgress 6s linear forwards;
}

@keyframes tfPopupProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Responsive */
@media (max-width: 480px) {
    #tfPopupContainer {
        top: 8px;
        right: 8px;
        left: 8px;
        max-width: none;
    }

    .tf-popup {
        padding: 12px 14px;
        border-radius: 12px;
    }
}

/* Acik temada date input renk semasi */
body[data-theme-mode="light"] input[type="date"],
body[data-theme-mode="light"] input[type="datetime-local"],
body[data-theme-mode="light"] input[type="time"] {
    color-scheme: light;
}

    body[data-theme-mode="light"] input[type="date"]::-webkit-calendar-picker-indicator,
    body[data-theme-mode="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
        filter: none;
    }

/* Acik temada sidebar hover */
body[data-theme-mode="light"] .sidebar-link:hover {
    background: rgba(0, 0, 0, 0.06);
}

body[data-theme-mode="light"] .sidebar-link.active {
    background: rgba(59, 130, 246, 0.12);
}

/* Koyu temada sidebar hover - default rgba(0,0,0,0.04) koyu zeminde gorunmedigi icin */
body[data-theme-mode="dark"] .sidebar-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Acik temada notification item hover */
body[data-theme-mode="light"] .notification-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

/* Acik temada notification-item border-bottom artik var(--border-color) kullaniyor,
   ek override gerekmiyor */

/* Acik temada tablo satir border */
body[data-theme-mode="light"] .table-dark-custom td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

/* Acik temada priority badge'ler */
body[data-theme-mode="light"] .priority-Low {
    background: #dcfce7;
    color: #166534;
}

body[data-theme-mode="light"] .priority-Medium {
    background: #fef3c7;
    color: #92400e;
}

body[data-theme-mode="light"] .priority-High {
    background: #ffedd5;
    color: #9a3412;
}

body[data-theme-mode="light"] .priority-Critical {
    background: #fee2e2;
    color: #991b1b;
}

/* Acik temada scrollbar */
body[data-theme-mode="light"] ::-webkit-scrollbar-track {
    background: #f1f5f9;
}

body[data-theme-mode="light"] ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

    body[data-theme-mode="light"] ::-webkit-scrollbar-thumb:hover {
        background: #94a3b8;
    }

/* Acik temada modal arka plan */
body[data-theme-mode="light"] .modal-content {
    background: var(--bg-secondary) !important;
    border-color: var(--border-color) !important;
}

/* Acik temada SweetAlert2 */
body[data-theme-mode="light"] .swal2-popup {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body[data-theme-mode="light"] .swal2-title {
    color: var(--text-primary) !important;
}

body[data-theme-mode="light"] .swal2-html-container {
    color: var(--text-secondary) !important;
}

/* Sidebar/dashboard ve kanban'da kullanilan kucuk renk gostergesi.
   Sidebar her sayfada gosterildigi icin global olmali (kanban.css yerine site.css). */
.column-indicator {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
    display: inline-block;
}

/* ==================== SIDEBAR SCROLLBAR ==================== */
/* Modern, ince ve tema renklerine uyumlu scrollbar.
   Firefox icin scrollbar-* property'leri, Webkit/Blink icin ::-webkit-scrollbar pseudo'lari.
   `body .sidebar` kullanimi mevcut body[data-theme-mode="light"] global override'iyla
   ayni specificity'e sahip ve daha sonra geldigi icin onun yerine bu kurallar gecerli olur. */
.sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
    overscroll-behavior: contain;
}

body .sidebar::-webkit-scrollbar {
    width: 6px;
}

body .sidebar::-webkit-scrollbar-track {
    background: transparent;
    margin: 8px 0;
}

body .sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.15s ease;
}

    body .sidebar::-webkit-scrollbar-thumb:hover {
        background: var(--border-hover);
    }

/* Sidebar uzerine geldikce thumb daha belirgin */
.sidebar:hover {
    scrollbar-color: var(--border-hover) transparent;
}
