/* =====================================================
   CUSTOM WAREHOUSE MANAGEMENT SYSTEM STYLES
   ===================================================== */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #16a085;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --sidebar-width: 260px;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* =====================================================
   LOGIN PAGE
   ===================================================== */
.login-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
}

.login-page .card {
    border-radius: 15px;
}

.login-page .input-group-text {
    background-color: #f8f9fa;
    border-right: none;
}

.login-page .form-control {
    border-left: none;
}

.login-page .form-control:focus {
    box-shadow: none;
    border-color: #ced4da;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

.sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: all 0.3s;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.active {
    margin-left: calc(-1 * var(--sidebar-width));
}

.sidebar-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h4 {
    color: var(--sidebar-text);
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.sidebar ul.components {
    padding: 20px 0;
}

.sidebar ul li {
    padding: 0;
}

.sidebar ul li a {
    padding: 12px 20px;
    font-size: 0.95rem;
    display: block;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar ul li a:hover,
.sidebar ul li.active > a {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--secondary-color);
}

.sidebar ul li a i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

/* =====================================================
   CONTENT AREA
   ===================================================== */
#content {
    width: 100%;
    min-height: 100vh;
    transition: all 0.3s;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

#content.active {
    margin-left: 0;
}

/* =====================================================
   NAVBAR
   ===================================================== */
.navbar {
    padding: 15px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#sidebarCollapse {
    border: none;
    background: transparent;
    font-size: 1.2rem;
}

/* =====================================================
   CARDS
   ===================================================== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background-color: #fff;
    border-bottom: 2px solid #f0f0f0;
    padding: 15px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

/* =====================================================
   DASHBOARD STATS CARDS
   ===================================================== */
.stat-card {
    border-left: 4px solid;
    height: 100%;
}

.stat-card.primary {
    border-left-color: var(--primary-color);
}

.stat-card.success {
    border-left-color: var(--success-color);
}

.stat-card.warning {
    border-left-color: var(--warning-color);
}

.stat-card.danger {
    border-left-color: var(--danger-color);
}

.stat-card.info {
    border-left-color: var(--info-color);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.stat-card .stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =====================================================
   TABLES
   ===================================================== */
.table-responsive {
    border-radius: 10px;
    overflow: hidden;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: var(--primary-color);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 15px;
}

.table tbody tr {
    transition: background-color 0.2s;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

.table tbody td {
    vertical-align: middle;
    padding: 12px 15px;
}

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
    border-radius: 6px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1a252f;
    border-color: #1a252f;
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-warning {
    background-color: var(--warning-color);
    border-color: var(--warning-color);
}

.btn-danger {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-info {
    background-color: var(--info-color);
    border-color: var(--info-color);
}

/* =====================================================
   BADGES
   ===================================================== */
.badge {
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 6px;
}

/* =====================================================
   FORMS
   ===================================================== */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
    border-radius: 8px;
    border: none;
    padding: 15px 20px;
}

/* =====================================================
   PAGINATION
   ===================================================== */
.pagination {
    margin-top: 20px;
}

.page-link {
    color: var(--primary-color);
    border-radius: 6px;
    margin: 0 3px;
    border: 1px solid #dee2e6;
}

.page-link:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* =====================================================
   FOOTER
   ===================================================== */
.footer {
    background-color: #fff;
    padding: 20px 0;
    margin-top: auto;
}

/* =====================================================
   UTILITIES
   ===================================================== */
.text-primary {
    color: var(--primary-color) !important;
}

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

.border-primary {
    border-color: var(--primary-color) !important;
}

/* =====================================================
   SIDEBAR OVERLAY (Mobile)
   ===================================================== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 768px) {
    .sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        z-index: 999;
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    #content {
        margin-left: 0;
        padding: 10px;
    }
    
    /* Mobile stat cards */
    .stat-card {
        border-radius: 8px;
    }
    
    .stat-card .card-body {
        padding: 15px 10px !important;
    }
    
    .stat-card .stat-icon {
        font-size: 1.8rem;
        opacity: 0.4;
        margin-bottom: 8px !important;
    }
    
    .stat-card .stat-value {
        font-size: 1.8rem;
        font-weight: 700;
        margin-bottom: 5px !important;
        line-height: 1;
    }
    
    .stat-card .stat-label {
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
        line-height: 1.2;
    }
    
    /* Mobile navbar */
    .navbar {
        padding: 10px 15px;
    }
    
    /* Mobile cards */
    .card-body {
        padding: 15px;
    }
    
    .card-header {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    /* Mobile tables */
    .table {
        font-size: 0.85rem;
    }
    
    .table thead th {
        padding: 10px 8px;
        font-size: 0.75rem;
    }
    
    .table tbody td {
        padding: 8px;
    }
    
    /* Mobile buttons */
    .btn {
        padding: 6px 12px;
        font-size: 0.875rem;
    }
    
    .btn-group-sm .btn {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    /* Mobile dashboard header */
    h2 {
        font-size: 1.5rem;
    }
    
    /* Hide some table columns on mobile */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 576px) {
    /* Extra small devices */
    .dashboard-stats {
        margin-bottom: 20px !important;
    }
    
    .stat-card {
        margin-bottom: 15px !important;
    }
    
    .stat-card .card-body {
        padding: 12px 8px !important;
    }
    
    .stat-card .stat-icon {
        font-size: 1.5rem;
        opacity: 0.35;
        margin-bottom: 6px !important;
    }
    
    .stat-card .stat-value {
        font-size: 1.6rem;
        font-weight: 700;
        margin-bottom: 4px !important;
        line-height: 1;
    }
    
    .stat-card .stat-label {
        font-size: 0.65rem;
        font-weight: 600;
        line-height: 1.1;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .card-header {
        font-size: 0.9rem;
    }
    
    /* Compact footer on mobile */
    .footer {
        padding: 15px 0;
        font-size: 0.85rem;
    }
    
    .footer small {
        font-size: 0.75rem;
    }
}

/* =====================================================
   CUSTOM SCROLLBAR
   ===================================================== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Sidebar scrollbar - darker for visibility */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* =====================================================
   LOADING SPINNER
   ===================================================== */
.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* =====================================================
   PRINT STYLES
   ===================================================== */
@media print {
    .sidebar,
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    #content {
        margin-left: 0;
    }
}
