/* StockERP Main Styles */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* Sidebar */
.sidebar {
    min-height: calc(100vh - 56px);
    box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
}

.sidebar .nav-link {
    color: #333;
    border-radius: 0.375rem;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
    background-color: rgba(0, 0, 0, .075);
}

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

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Tables */
.table th {
    border-top: none;
    font-weight: 600;
    color: var(--dark-color);
}

/* Buttons */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Forms */
.form-control {
    border-radius: 0.375rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Badge */
.badge {
    font-size: 0.75em;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        min-height: auto;
    }
    
    .container-fluid .row .col-md-3 {
        margin-bottom: 1rem;
    }
}

/* Custom utilities */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

/* Login page */
.bg-gradient-primary {
    background: linear-gradient(45deg, var(--primary-color), #0056b3);
}

/* Dashboard specific */
.stats-card {
    transition: transform 0.2s;
}

.stats-card:hover {
    transform: translateY(-2px);
}

/* Data tables */
.dataTables_wrapper {
    font-size: 14px;
}

.dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

.dataTables_length select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

/* ===========================================
   SIDEBAR NAVIGATION FIXES
   =========================================== */

/* Sidebar responsive ve height fixes */
.sidebar {
    min-height: calc(100vh - 56px); /* Navbar height'ını çıkar */
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Navigation item spacing */
.sidebar .nav-pills .nav-item {
    margin-bottom: 2px;
}

.sidebar .nav-pills .nav-link {
    border-radius: 6px;
    padding: 8px 12px;
    color: #495057;
    transition: all 0.2s ease;
}

.sidebar .nav-pills .nav-link:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.sidebar .nav-pills .nav-link.active {
    background-color: #007bff;
    color: white;
}

.sidebar .nav-pills .nav-link i {
    width: 18px;
    text-align: center;
}

/* Container fixes */
.container-fluid {
    padding: 0;
}

.sidebar + .col-md-9,
.sidebar + .col-lg-10 {
    padding: 0;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        min-height: auto;
        max-height: none;
        border-bottom: 1px solid #dee2e6;
    }
    
    .sidebar .nav-pills {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sidebar .nav-pills .nav-item {
        margin: 2px;
    }
    
    .sidebar .nav-pills .nav-link {
        font-size: 0.875rem;
        padding: 6px 10px;
    }
    
    .sidebar h6 {
        text-align: center;
        margin-bottom: 10px;
    }
}

/* Scrollbar styling for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ===========================================
   ENHANCED SIDEBAR NAVIGATION
   =========================================== */

/* Sidebar container */
.sidebar {
    min-height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: #f8f9fa !important;
    border-right: 1px solid #dee2e6;
}

/* Menu title */
.sidebar h6 {
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Navigation pills */
.sidebar .nav-pills {
    --bs-nav-pills-border-radius: 0.375rem;
    --bs-nav-pills-link-active-color: #fff;
    --bs-nav-pills-link-active-bg: #0d6efd;
}

.sidebar .nav-pills .nav-item {
    margin-bottom: 3px;
}

.sidebar .nav-pills .nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.75rem;
    color: #495057;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all 0.15s ease-in-out;
    border-radius: 0.375rem;
    border: 1px solid transparent;
}

.sidebar .nav-pills .nav-link:hover {
    background-color: #e9ecef;
    color: #0d6efd;
    transform: translateX(2px);
}

.sidebar .nav-pills .nav-link.active {
    background-color: #0d6efd;
    color: white;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
    font-weight: 600;
}

.sidebar .nav-pills .nav-link i {
    width: 18px;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 0.875rem;
}

/* Container and layout fixes */
.container-fluid {
    padding: 0;
}

.sidebar + .col-md-9,
.sidebar + .col-lg-10 {
    padding: 0;
}

/* Main content area */
.sidebar ~ .col-md-9 .container-fluid,
.sidebar ~ .col-lg-10 .container-fluid {
    padding: 1.5rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .sidebar {
        position: relative;
        min-height: auto;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        padding: 1rem;
    }
    
    .sidebar h6 {
        text-align: center;
        margin-bottom: 0.75rem;
        font-size: 0.7rem;
    }
    
    .sidebar .nav-pills {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
    }
    
    .sidebar .nav-pills .nav-item {
        margin: 0;
        flex: 0 0 auto;
    }
    
    .sidebar .nav-pills .nav-link {
        font-size: 0.75rem;
        padding: 0.4rem 0.6rem;
        white-space: nowrap;
    }
    
    .sidebar .nav-pills .nav-link i {
        margin-right: 0.25rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    .sidebar .nav-pills .nav-link {
        font-size: 0.7rem;
        padding: 0.35rem 0.5rem;
    }
    
    .sidebar .nav-pills .nav-link i {
        font-size: 0.7rem;
    }
}

/* Scrollbar styling */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for active state */
.sidebar .nav-pills .nav-link.active {
    position: relative;
}

.sidebar .nav-pills .nav-link.active::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #0d6efd;
    border-radius: 0 2px 2px 0;
}

/* Hover effect improvements */
.sidebar .nav-pills .nav-link:not(.active):hover {
    background: linear-gradient(90deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    border-color: rgba(13, 110, 253, 0.2);
}

/* Focus styles for accessibility */
.sidebar .nav-pills .nav-link:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Enhanced Work Order Card Styles */
.work-order-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 4px;
    cursor: move;
    position: relative;
    transition: all 0.3s ease;
    font-size: 11px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.work-order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.work-order-card.dragging {
    opacity: 0.8;
    transform: rotate(2deg);
    z-index: 1000;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Delete Button */
.work-order-delete {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e74c3c;
    border: none;
    color: white;
    font-size: 10px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    z-index: 10;
}

.work-order-delete:hover {
    opacity: 1;
    background: #c0392b;
    transform: scale(1.1);
}

/* Customer Name */
.work-order-customer-name {
    color: #2c3e50;
    font-weight: bold;
    font-size: 10px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 3px;
}

.work-order-customer-name i {
    color: #3498db;
    font-size: 9px;
}

/* Product Name */
.work-order-product-name {
    color: #34495e;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.2;
}

/* Quantities Info */
.work-order-quantities-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quantity-label {
    font-size: 9px;
    color: #7f8c8d;
    font-weight: 500;
}

.quantity-value {
    font-size: 10px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 6px;
    color: white;
}

.quantity-value.total {
    background: #3498db;
}

.quantity-value.planned {
    background: #e67e22;
}

/* Priority Dot */
.work-order-priority {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.priority-low { background: #27ae60; }
.priority-normal { background: #f39c12; }
.priority-high { background: #e74c3c; }
.priority-urgent { 
    background: #8e44ad; 
    animation: pulse-urgent 2s infinite;
}

@keyframes pulse-urgent {
    0% { box-shadow: 0 0 0 0 rgba(142, 68, 173, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(142, 68, 173, 0); }
    100% { box-shadow: 0 0 0 0 rgba(142, 68, 173, 0); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .work-order-card {
        font-size: 9px;
        min-height: 70px;
        padding: 6px;
    }
    
    .work-order-customer-name {
        font-size: 8px;
    }
    
    .work-order-product-name {
        font-size: 9px;
    }
    
    .quantity-label {
        font-size: 8px;
    }
    
    .quantity-value {
        font-size: 8px;
    }
    
    .work-order-delete {
        width: 16px;
        height: 16px;
        font-size: 8px;
    }
}

