:root {
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-dark: #4338ca;
    --sidebar-bg: #ffffff;
    --sidebar-text: #64748b;
    --sidebar-active: #f1f5f9;
    --sidebar-active-text: #4f46e5;
    --bg-light: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --premium-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.02);
    --soft-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 260px;

    --bg-body: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --card-border: rgba(0, 0, 0, 0.05);
    --card-border-subtle: rgba(0, 0, 0, 0.03);
    --topbar-bg: rgba(255, 255, 255, 0.6);
    --input-bg: #ffffff;
    --input-border: #e2e8f0;
}

[data-bs-theme="dark"] {
    --bg-body: #0a0a0a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --card-bg: #141414;
    --card-border: rgba(255, 255, 255, 0.1);
    --card-border-subtle: rgba(255, 255, 255, 0.05);
    --sidebar-bg: #111111;
    --sidebar-text: #94a3b8;
    --sidebar-active: #1e1e1e;
    --bg-light: #121212;
    --topbar-bg: rgba(10, 10, 10, 0.6);
    --input-bg: #1e1e1e;
    --input-border: #334155;
    --glass-bg: rgba(18, 18, 18, 0.85);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* =====================================================
   SIDEBAR
===================================================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    position: fixed;
    left: calc(-1 * var(--sidebar-width));
    top: 0;
    z-index: 1050;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--card-border);
    /* Çok ince ve zarif bir ayırıcı */
}

.sidebar-header {
    padding: 1.5rem 1.25rem;
    color: var(--primary);
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -0.5px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--card-border-subtle);
    transition: var(--transition);
    display: flex !important;
}

.sidebar-header #sidebar_logo_container {
    cursor: default;
}

#sidebar_isletme_name {
    display: block;
    max-width: 150px;
    /* Sidebar genişliğine göre ayarla */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
    backdrop-filter: blur(4px);
}

body.sidebar-show .sidebar {
    left: 0;
}

body.sidebar-show .sidebar-overlay {
    display: block;
}


.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-bottom {
    margin-top: auto;
    padding-bottom: 0.5rem;
}

.nav-link {
    color: var(--sidebar-text);
    padding: 0.875rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: var(--transition);
    border-radius: 0.75rem;
    margin: 0.25rem 1rem;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    background: var(--sidebar-active);
    color: var(--sidebar-active-text);
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.08);
    color: var(--primary);
    font-weight: 600;
    position: relative;
}

.nav-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}

/* =====================================================
   TOPBAR / PAGE HEADER
===================================================== */
.topbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 0.8rem 1rem;
    background: var(--topbar-bg);
    border-bottom: 1px solid var(--card-border);
    margin-left: -1rem;
    margin-right: -1rem;
    margin-top: -1rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    position: sticky;
    top: 0;
    transition: var(--transition);
}

.topbar-header.scrolled {
    background: var(--card-bg);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.page-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--text-main);
    margin: 0;
}

.page-breadcrumb {
    font-size: 0.65rem;
    display: block;
    margin-top: 2px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   FLOATING USER AVATAR CARD
===================================================== */
.user-float-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--card-bg);
    border: 1px solid var(--input-border);
    border-radius: 50px;
    padding: 0.35rem 0.85rem 0.35rem 0.4rem;
    box-shadow: var(--soft-shadow);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    user-select: none;
}

.user-float-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.user-avatar-initials {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-float-info {
    line-height: 1.1;
    color: var(--text-main);
}

.user-float-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    z-index: 2000;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.user-float-dropdown.show {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.user-drop-item {
    display: flex;
    align-items: center;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
    color: var(--text-main);
    text-decoration: none;
    transition: background 0.15s;
}

.user-drop-item:hover {
    background: var(--sidebar-active);
    color: var(--primary);
}

/* =====================================================
   MAIN CONTENT
===================================================== */
.main-content {
    margin-left: 0;
    padding: 1rem;
    min-height: 100vh;
    transition: var(--transition);
}

@media (min-width: 992px) {
    .sidebar {
        left: 0;
    }

    .main-content {
        margin-left: var(--sidebar-width);
        padding: 2rem;
    }

    .sidebar-overlay {
        display: none !important;
    }
}

/* =====================================================
   KANBAN
===================================================== */
.kanban-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 2rem;
    -webkit-overflow-scrolling: touch;
    min-height: calc(100vh - 200px);
}

.kanban-column {
    min-width: 320px;
    flex: 0 0 320px;
    background: var(--sidebar-active);
    border-radius: 1.25rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-border-subtle);
    height: 100%;
}

.kanban-items {
    flex-grow: 1;
    min-height: 15rem;
    /* Boş olsa bile bırakılabilecek alan */
    transition: var(--transition);
}

.ghost-card {
    opacity: 0.4;
    background: var(--primary) !important;
    border: 1px dashed var(--primary) !important;
}

@media (max-width: 991.98px) {
    .kanban-container {
        flex-direction: column;
        overflow-x: hidden;
        gap: 2rem;
    }

    .kanban-column {
        min-width: 100%;
        flex: none;
        background: white;
        padding: 0;
        border: none;
        border-radius: 0;
    }

    .column-header {
        position: sticky;
        top: 0;
        background: var(--bg-light);
        padding: 1rem 0;
        z-index: 10;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        margin-bottom: 1rem !important;
    }
}

.kanban-item {
    cursor: grab;
    margin-bottom: 1rem;
    border: none;
    background-color: var(--card-bg);
    color: var(--text-main);
    box-shadow: var(--soft-shadow);
}

/* =====================================================
   FANCY STATS CARDS (Colored BG, Shadow, Animation)
===================================================== */
.stats-card-fancy {
    border: none !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px !important;
}

.stats-card-fancy:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12) !important;
}

.card-bg-danger {
    background: #dc3545 !important;
    color: white !important;
}

.card-bg-warning {
    background: #ffc107 !important;
    color: #1e293b !important;
}

.card-bg-primary {
    background: #0d6efd !important;
    color: white !important;
}

.card-bg-success {
    background: #198754 !important;
    color: white !important;
}

.card-bg-dark {
    background: #1e293b !important;
    color: white !important;
}

.card-bg-info {
    background: #0dcaf0 !important;
    color: white !important;
}

.card-bg-danger .text-muted,
.card-bg-primary .text-muted,
.card-bg-success .text-muted,
.card-bg-dark .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

.card-bg-danger h2,
.card-bg-primary h2,
.card-bg-success h2,
.card-bg-dark h2 {
    color: white !important;
}

.card-bg-warning .text-muted {
    color: rgba(30, 41, 59, 0.7) !important;
}

.card-bg-warning h2 {
    color: #1e293b !important;
}

/* =====================================================
   TABLO DROPDOWN Z-INDEX FİX
===================================================== */
.table-responsive {
    overflow: visible !important;
}

.dropdown-menu {
    z-index: 1080;
}

/* =====================================================
   ZORUNLU ALAN GÖSTERİMİ
===================================================== */
.form-label .required-star,
label .required-star {
    color: #ef4444;
    margin-left: 2px;
    font-weight: 700;
}

/* =====================================================
   TANIMLAR - RENK PALETİ BUTONU
===================================================== */
.form-control-color {
    border-radius: 8px !important;
    width: 44px !important;
    height: 38px !important;
    padding: 4px !important;
    cursor: pointer;
    border: 1px solid #e2e8f0 !important;
}

/* UTILITIES */
.btn-primary {
    background: var(--primary);
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem !important;
}

.card-header {
    background: var(--card-bg) !important;
    border-bottom: 1px solid var(--card-border) !important;
}

.bg-light {
    background-color: var(--bg-light) !important;
}

.text-dark {
    color: var(--text-main) !important;
}

h1,
.h1 {
    font-size: 2rem;
}

h2,
.h2 {
    font-size: 1.75rem;
}

/* =====================================================
   PREMIUM UI UTILITIES
   ===================================================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow: var(--premium-shadow) !important;
}

.premium-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border-subtle);
    box-shadow: var(--premium-shadow);
    transition: var(--transition);
}

.premium-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    box-shadow: 0 4px 14px 0 rgba(79, 70, 229, 0.39);
    transition: all 0.3s ease;
    border-radius: 12px;
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.23);
    color: white;
}

.badge-soft-primary {
    background-color: rgba(79, 70, 229, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.1);
}

.badge-soft-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.1);
}

.badge-soft-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: #d97706;
    border: 1px solid rgba(245, 158, 11, 0.1);
}

.badge-soft-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.1);
}

.badge-soft-info {
    background-color: rgba(6, 182, 212, 0.1);
    color: #0891b2;
    border: 1px solid rgba(6, 182, 212, 0.1);
}

.table-modern thead th {
    background: var(--bg-light);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    color: var(--text-muted);
    border-top: none;
    border-bottom: 1px solid var(--card-border-subtle);
    padding: 1rem 0.75rem;
}

.table-modern tbody td {
    padding: 1.25rem 0.75rem;
    border-bottom: 1px solid var(--card-border-subtle);
}

.search-input-wrapper {
    position: relative;
    max-width: 400px;
}

.search-input-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-input-wrapper input {
    padding-left: 2.75rem;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text-main);
    transition: var(--transition);
}

.search-input-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

/* Animations */
@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeInSlide 0.5s ease forwards;
}