/* LeadgerCOM ERP - Main Stylesheet */

/* ===== BASE STYLES ===== */
:root {
    --primary-color: #1a2942;
    --secondary-color: #667eea;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 70px;
    --header-height: 60px;
    --footer-height: 50px;
}

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

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

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.sidebar.collapsed .sidebar-header h5 {
    font-size: 0;
}

.sidebar.collapsed .sidebar-header::before {
    content: 'LC';
    font-size: 18px;
    font-weight: bold;
}

.sidebar-nav {
    padding: 0;
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border-left-color: var(--success-color);
}

.sidebar.collapsed .sidebar-nav .nav-link {
    justify-content: center;
    padding: 15px;
}

.sidebar.collapsed .sidebar-nav .nav-link span {
    display: none;
}

.sidebar-nav .nav-link i {
    font-size: 18px;
    margin-right: 12px;
    min-width: 20px;
    text-align: center;
}

.sidebar.collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

/* ===== NAVBAR ===== */
.navbar {
    height: var(--header-height);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}

.navbar-brand {
    font-weight: 600;
    font-size: 18px;
}

.navbar-brand-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.navbar-nav .nav-link {
    padding: 8px 12px;
    color: rgba(255, 255, 255, 0.9) !important;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.badge {
    font-size: 11px;
    padding: 3px 6px;
}

/* ===== BREADCRUMB ===== */
.breadcrumb-nav {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 20px;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 14px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 12px 12px 0 0 !important;
    font-weight: 600;
    padding: 15px 20px;
}

.card-body {
    padding: 20px;
}

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

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
}

.btn-info {
    background: linear-gradient(135deg, var(--info-color) 0%, #138496 100%);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
}

/* ===== FORMS ===== */
.form-control {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
    font-size: 15px;
}

.input-group-text {
    border-radius: 8px 0 0 8px;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
}

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

.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 15px;
}

.table tbody td {
    padding: 12px 15px;
    vertical-align: middle;
    border-bottom: 1px solid #e9ecef;
}

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

/* ===== DATA TABLES ===== */
.dataTables_wrapper {
    padding: 0;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 20px;
    border: 2px solid #e9ecef;
    padding: 8px 15px;
    margin-left: 10px;
}

.dataTables_wrapper .dataTables_length select {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 5px 10px;
}

.dataTables_wrapper .dt-buttons {
    margin-bottom: 15px;
}

.dataTables_wrapper .dt-buttons .btn {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* ===== MODALS ===== */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2c3e50 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    border: none;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 12px 12px;
}

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

.alert-success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.alert-danger {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
}

.alert-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
}

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

/* ===== FOOTER ===== */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 15px 0;
    margin-top: auto;
}

/* ===== UTILITIES ===== */
.text-gradient {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
}

.bg-gradient-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
}

.shadow-sm {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.shadow-md {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.shadow-lg {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* ===== STATUS BADGES ===== */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-inactive {
    background: #f8d7da;
    color: #721c24;
}

.status-pending {
    background: #fff3cd;
    color: #856404;
}

.status-approved {
    background: #d4edda;
    color: #155724;
}

.status-rejected {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

/* ===== NOTIFICATION DROPDOWN ===== */
.notification-dropdown {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.3s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item h6 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
}

.notification-item p {
    margin: 0 0 4px 0;
    font-size: 13px;
    color: #6c757d;
}

.notification-item small {
    font-size: 11px;
    color: #adb5bd;
}

/* ===== PROFILE PICTURE ===== */
.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.profile-pic-sm {
    width: 32px;
    height: 32px;
}

.profile-pic-lg {
    width: 80px;
    height: 80px;
}

/* ===== EMPLOYEE CARD ===== */
.employee-card {
    text-align: center;
    padding: 20px;
    border-radius: 12px;
    background: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.employee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.employee-card .profile-pic {
    margin-bottom: 15px;
}

.employee-card h5 {
    margin: 10px 0 5px 0;
    font-size: 16px;
    font-weight: 600;
}

.employee-card p {
    margin: 0;
    font-size: 14px;
    color: #6c757d;
}

/* ===== CALENDAR ===== */
.calendar-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e9ecef;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.calendar-day {
    background: white;
    padding: 10px;
    min-height: 80px;
    text-align: center;
    font-size: 14px;
}

.calendar-day-header {
    background: var(--primary-color);
    color: white;
    font-weight: 600;
    padding: 10px;
}

.calendar-day.today {
    background: #fff3cd;
}

.calendar-day.weekend {
    background: #f8f9fa;
    color: #6c757d;
}

.calendar-day.has-event {
    background: #d1ecf1;
}

/* ===== CHARTS ===== */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.chart-container h5 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
}

/* ===== PROGRESS BARS ===== */
.progress {
    height: 8px;
    border-radius: 4px;
    background: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
}

/* ===== STATS CARDS ===== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.stat-card.primary { border-left-color: var(--secondary-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.dark { border-left-color: var(--dark-color); }

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 15px;
    color: white;
}

.stat-icon.primary { background: linear-gradient(135deg, var(--secondary-color), #764ba2); }
.stat-icon.success { background: linear-gradient(135deg, var(--success-color), #20c997); }
.stat-icon.warning { background: linear-gradient(135deg, var(--warning-color), #e0a800); }
.stat-icon.danger { background: linear-gradient(135deg, var(--danger-color), #c82333); }
.stat-icon.info { background: linear-gradient(135deg, var(--info-color), #138496); }
.stat-icon.dark { background: linear-gradient(135deg, var(--dark-color), #23272b); }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .navbar-brand span {
        display: none;
    }
    
    .stat-card {
        margin-bottom: 15px;
    }
    
    .table-responsive {
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .card-body {
        padding: 15px;
    }
    
    .btn {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .form-control {
        font-size: 14px;
        padding: 8px 12px;
    }
    
    .sidebar-nav .nav-link {
        padding: 12px 15px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .sidebar,
    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }
    
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .table {
        font-size: 12px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

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

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

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

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

/* ===== SELECT2 CUSTOMIZATION ===== */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    min-height: 38px;
}

.select2-container--bootstrap-5 .select2-selection--single {
    padding: 8px 15px;
}

/* ===== FLATPICKR CUSTOMIZATION ===== */
.flatpickr-input {
    border-radius: 8px;
    border: 2px solid #e9ecef;
    padding: 10px 15px;
    font-size: 15px;
}

/* ===== SWEETALERT2 CUSTOMIZATION ===== */
.swal2-popup {
    border-radius: 12px;
}

.swal2-confirm {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
}

/* ===== VALIDATION ===== */
.is-invalid {
    border-color: var(--danger-color) !important;
}

.is-valid {
    border-color: var(--success-color) !important;
}

.invalid-feedback {
    font-size: 14px;
    color: var(--danger-color);
    margin-top: 5px;
}

.valid-feedback {
    font-size: 14px;
    color: var(--success-color);
    margin-top: 5px;
}

/* ===== FILE UPLOAD ===== */
.file-upload-area {
    border: 2px dashed #e9ecef;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--secondary-color);
    background: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: var(--success-color);
    background: #d4edda;
}

.file-preview {
    margin-top: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 10px;
}

.file-item .file-info {
    flex-grow: 1;
    margin-left: 10px;
}

.file-item .file-remove {
    color: var(--danger-color);
    cursor: pointer;
}

/* ===== QUICK ACTIONS ===== */
.quick-action-btn {
    display: flex;
    align-items: center;
    padding: 15px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    transform: translateX(5px);
    color: white;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.quick-action-btn i {
    margin-right: 10px;
    font-size: 18px;
}
