:root {
    --primary-color: #dc2626; /* Kırmızı */
    --secondary-color: #000000; /* Siyah */
    --accent-color: #f8f9fa; /* Açık gri - göz dostu */
    --accent-gold: #dc2626; /* Kırmızı */
    --accent-gold-light: #991b1b; /* Koyu kırmızı */
    --sidebar-bg: #1a1a1a; /* Soft siyah */
    --sidebar-active: #dc2626; /* Kırmızı */
    --sidebar-hover: #2d2d2d; /* Daha soft gri */
    --navbar-bg: #ffffff; /* Beyaz */
    --navbar-text: #000000; /* Siyah */
    --card-bg: #ffffff; /* Beyaz */
    --card-shadow: 0 4px 15px rgba(220, 38, 38, 0.1);
    --transition-speed: 0.3s;
    --gradient-primary: linear-gradient(135deg, #dc2626, #991b1b);
    --gradient-secondary: linear-gradient(135deg, #000000, #1f1f1f);
    --gradient-accent: linear-gradient(135deg, #dc2626, #991b1b);
}

body {
    background: #f8fafc;
    font-family: 'Roboto', sans-serif;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

.main-wrapper {
    display: flex;
    min-height: 100vh;
    position: relative;
    transition: margin-left var(--transition-speed);
}

/* Mobil menü toggle butonu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1050;
    background: var(--gradient-primary);
    border: none;
    color: white;
    padding: 0.5rem;
    border-radius: 4px;
}

.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    color: var(--accent-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    box-shadow: 2px 0 5px rgba(0,0,0,0.2);
    transition: transform var(--transition-speed);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Sidebar içeriği için sabit yükseklik */
.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Flexbox overflow için gerekli */
}

/* Sidebar header sabit yükseklik */
.sidebar .sidebar-header {
    flex-shrink: 0; /* Header'ın küçülmesini engelle */
    min-height: 180px; /* Minimum yükseklik */
    max-height: 200px; /* Maksimum yükseklik */
}

/* Sidebar menü alanı */
.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    min-height: 0; /* Flexbox overflow için gerekli */
}

/* Sidebar arama kutusu */
.sidebar-search {
    flex-shrink: 0; /* Arama kutusunun küçülmesini engelle */
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.sidebar .sidebar-header {
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    text-align: center;
    border-bottom: 1px solid #404040;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.01) 100%);
}

.sidebar .sidebar-header img,
.sidebar .sidebar-header .sidebar-logo {
    width: 100%;
    max-width: 200px;
    height: auto;
    aspect-ratio: 1.5/1;
    border-radius: 0;
    margin-bottom: 0.8rem;
    box-shadow: none;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.3s ease;
    filter: none;
    border: none;
    background: none;
    padding: 0;
    outline: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.sidebar .sidebar-header .sidebar-logo:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.25);
    outline: none;
    border: none;
}

/* Logo'nun tüm durumlarında çerçeveyi kaldır */
.sidebar .sidebar-header .sidebar-logo:focus {
    outline: none;
    border: none;
}

.sidebar .sidebar-header .sidebar-logo:active {
    outline: none;
    border: none;
}

.sidebar .sidebar-header a:hover .sidebar-logo {
    transform: scale(1.02);
    cursor: pointer;
}

/* Logo link hover durumunda çerçeveyi kaldır */
.sidebar .sidebar-header a {
    outline: none;
    text-decoration: none;
    border: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.sidebar .sidebar-header a:hover {
    outline: none;
    text-decoration: none;
    border: none;
}

.sidebar .sidebar-header a:focus {
    outline: none;
    text-decoration: none;
    border: none;
}

.sidebar .sidebar-header a:active {
    outline: none;
    text-decoration: none;
    border: none;
}

.sidebar .sidebar-header a:visited {
    outline: none;
    text-decoration: none;
    border: none;
}

/* Logo entrance animation */
.sidebar .sidebar-header .sidebar-logo {
    animation: logoFadeIn 0.6s ease-out;
}

@keyframes logoFadeIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sidebar .sidebar-header p.slogan {
    margin-top: 1.2rem;
    margin-bottom: 2.2rem;
    font-size: 1.05rem;
    color: #fff;
    text-align: center;
    font-weight: 400;
}

.sidebar .sidebar-header .tersane-istanbul {
    margin: 0;
    padding: 0;
    line-height: 1.05;
    color: var(--accent-gold);
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 0.01em;
}

.sidebar .sidebar-header .tersane-istanbul span {
    display: block;
    margin: 0;
    padding: 0;
}

.sidebar .nav-link {
    color: var(--accent-color);
    padding: 1rem;
    display: flex;
    align-items: center;
    transition: all var(--transition-speed);
    white-space: nowrap;
    min-height: 44px;
}

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

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

.sidebar .nav-link i {
    margin-right: 0.8rem;
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 0;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    transition: margin-left var(--transition-speed);
}

.navbar {
    background: var(--navbar-bg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    margin-bottom: 1rem;
}

.navbar .nav-link {
    color: var(--navbar-text);
    padding: 0.5rem 1rem;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.card {
    background: var(--card-bg);
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    margin: 1rem;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.15);
}

.card-body {
    padding: 1.5rem;
}

.card-title {
    color: var(--secondary-color);
    font-weight: 600;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Mobil Uyumluluk */
@media (max-width: 991.98px) {
    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 100%;
        max-width: 280px;
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: 60px;
    }

    .card {
        margin: 0.5rem;
    }

    .card-body {
        padding: 1rem;
    }

    .navbar {
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 99;
        padding: 0.5rem;
    }

    .table-responsive {
        margin: 0 -0.5rem;
    }

    .dropdown-menu {
        position: absolute !important;
        left: auto !important;
        right: 0 !important;
        min-width: 180px !important;
        width: auto !important;
        bottom: auto !important;
        top: 100% !important;
        border-radius: 1rem !important;
        box-shadow: 0 4px 24px rgba(0,0,0,0.12);
        z-index: 9999;
        margin: 0;
        max-height: 80vh;
        overflow-y: auto;
    }

    .sidebar.show ~ .main-content .navbar,
    .sidebar.show ~ .navbar,
    .sidebar.show + .navbar {
        display: none !important;
    }

    body.sidebar-open .navbar {
        display: none !important;
    }
}

/* Küçük mobil cihazlar için ek optimizasyonlar */
@media (max-width: 575.98px) {
    .card-title {
        font-size: 1rem;
    }

    .sidebar .nav-link {
        padding: 0.8rem;
    }

    .navbar {
        padding: 0.3rem;
    }

    .mobile-menu-toggle {
        top: 0.5rem;
        left: 0.5rem;
    }

    .sidebar .sidebar-header img,
    .sidebar .sidebar-header .sidebar-logo {
        max-width: 180px;
        border-radius: 0;
        margin-bottom: 0.6rem;
        filter: none;
        border: none;
        background: none;
        padding: 0;
        box-shadow: none;
    }
}

/* Tablet için ek optimizasyonlar */
@media (min-width: 768px) and (max-width: 991.98px) {
    .card {
        margin: 0.75rem;
    }
}

/* Dokunmatik cihazlar için ek optimizasyonlar */
@media (hover: none) {
    .card:hover {
        transform: none;
    }
}

.vardiya-btn-dashboard {
    padding: 2rem 0 1.2rem 0;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(220, 38, 38, 0.08);
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.vardiya-btn-dashboard i {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    display: block;
}

@media (max-width: 768px) {
    .vardiya-btn-dashboard {
        padding: 1.2rem 0 1rem 0;
        font-size: 1rem;
    }
    .vardiya-btn-dashboard i {
        font-size: 1.5rem;
    }
}

/* Modern widget kart stili */
.widget-card {
    border-radius: 1.5rem;
    box-shadow: 0 4px 24px rgba(220, 38, 38, 0.10), 0 1.5px 6px rgba(0,0,0,0.04);
    background: #fff;
    border: 1.5px solid #f3f3f3;
    margin-bottom: 1.5rem;
    width: 100%;
    min-width: 320px;
    max-width: 400px;
    min-height: 170px;
    max-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.18s, transform 0.18s;
}

.widget-card:hover {
    box-shadow: 0 8px 32px rgba(220, 38, 38, 0.18), 0 2px 12px rgba(0,0,0,0.08);
    transform: translateY(-4px) scale(1.025);
}

.widget-card .card-header {
    background: transparent;
    border-bottom: none;
    border-radius: 1.5rem 1.5rem 0 0;
    font-weight: 700;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 52px;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
    letter-spacing: 0.01em;
}

.widget-card .card-header i {
    font-size: 2.3rem;
    color: var(--primary-color);
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.10);
    padding: 12px;
    margin-bottom: 0.2rem;
    border: 1.5px solid var(--primary-color);
}

.widget-card .card-body {
    padding: 0.7rem 0.7rem 0.7rem 0.7rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.widget-card .fw-bold {
    font-size: 1.13rem;
    margin-bottom: 0.7rem;
    color: #1a1a1a;
    font-weight: 600;
}

.widget-card .btn {
    font-size: 1.07rem;
    padding: 0.7rem 0;
    border-radius: 0.8rem;
    font-weight: 600;
    background: var(--primary-color);
    color: #fff;
    border: none;
    transition: background 0.18s, color 0.18s;
}

.widget-card .btn:hover, .widget-card .btn:focus {
    background: var(--accent-gold);
    color: #fff;
}

@media (max-width: 991.98px) {
    .widget-card {
        min-width: 90vw;
        max-width: 100vw;
        min-height: 120px;
        max-height: 180px;
    }
}

.widget-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.widget-card-link:hover .widget-card {
    box-shadow: 0 12px 40px rgba(220, 38, 38, 0.22), 0 2px 12px rgba(0,0,0,0.10);
    transform: translateY(-6px) scale(1.035);
}

.widget-settings-btn:hover {
    background: var(--accent-gold);
}

#widgetSettingsModal .modal-dialog {
    max-width: 400px;
}

#widgetSettingsModal .modal-body {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
}

#widgetSettingsModal label {
    font-weight: 500;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-settings-btn-guaranteed {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 99999;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    color: #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    border: none;
    transition: background 0.2s;
}

.widget-settings-btn-guaranteed:hover {
    background: var(--accent-gold);
}

@media (max-width: 480px) {
    .card, .widget-card {
        margin: 0.3rem 0 !important;
        border-radius: 8px !important;
    }
    .card-title, .widget-card .card-header {
        font-size: 0.95rem !important;
    }
    .btn, .form-control, .form-select, .sidebar .nav-link, .navbar .nav-link {
        font-size: 0.95rem !important;
        min-height: 40px !important;
        padding: 0.7rem 0.7rem !important;
    }
    .navbar {
        padding: 0.2rem !important;
    }
}

@media (hover: none) {
    .card:hover, .widget-card:hover, .btn:hover, .sidebar .nav-link:hover {
        transform: none !important;
        box-shadow: none !important;
        background: inherit !important;
        color: inherit !important;
    }
}

/* Sidebar Arama Kutusu Stilleri */
.sidebar .search-container {
    padding: 1rem;
    border-bottom: 1px solid #404040;
}

.sidebar .search-input {
    background: #2d2d2d;
    border: 1px solid #404040;
    color: #ffffff;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    width: 100%;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.sidebar .search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #333333;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.sidebar .search-input::placeholder {
    color: #888888;
}

.sidebar .search-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-left: 0.5rem;
    transition: all 0.3s ease;
}

.sidebar .search-btn:hover {
    background: var(--accent-gold-light);
    transform: translateY(-1px);
}

/* Sidebar Menü Öğeleri için Ek Stiller */
.sidebar .nav-link {
    border-bottom: 1px solid #2d2d2d;
}

.sidebar .nav-link:last-child {
    border-bottom: none;
}

.sidebar .nav-link:hover {
    background: #2d2d2d;
    border-left: 3px solid var(--primary-color);
}

.sidebar .nav-link.active {
    background: var(--primary-color);
    border-left: 3px solid #ffffff;
}

/* Şube Seçimi Stilleri */
.sube-selector-container {
    margin-bottom: 1rem;
}

.sube-selector {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid var(--primary-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all var(--transition-speed);
    backdrop-filter: blur(5px);
    min-width: 200px;
}

.sube-selector:focus {
    outline: none;
    border-color: var(--accent-gold-light);
    box-shadow: 0 0 0 0.3rem rgba(220, 38, 38, 0.15);
    background: rgba(255, 255, 255, 1);
    transform: scale(1.02);
}

.sube-selector:hover {
    border-color: var(--accent-gold-light);
    background: rgba(255, 255, 255, 1);
}

.sube-selection {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.sube-selection .form-label {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

/* Şube seçimi için responsive tasarım */
@media (max-width: 768px) {
    .sube-selector {
        min-width: 100%;
        font-size: 0.9rem;
        padding: 0.6rem 0.8rem;
    }
    
    .sube-selection {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .sube-selection .form-label {
        font-size: 1rem;
    }
}

/* Loading animasyonu için stiller */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Giriş formu için ek stiller */
.login-card-body .alert {
    margin-bottom: 1rem;
    border-radius: 10px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-card-body .alert-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border-left: 4px solid #dc3545;
}

.login-card-body .alert-success {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-left: 4px solid #28a745;
}