/* ===== ROOT VARIABLES ===== */
:root {
    --primary: #25D366;
    --primary-dark: #128C7E;
    --secondary: #075E54;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --success: #28a745;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --shadow: 0 10px 20px rgba(0,0,0,0.1);
    --radius: 15px;
    --transition: all 0.3s ease;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark);
    line-height: 1.6;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--secondary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

.text-success { color: var(--primary) !important; }
.text-primary { color: var(--primary-dark) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }

/* ===== BUTTONS ===== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 25px;
    border: none;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn i {
    font-size: 1.1em;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 8px 15px;
    font-size: 0.875rem;
}

.btn-success {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
}

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

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

.btn-outline-success {
    border: 2px solid var(--primary);
    color: var(--primary);
    background: transparent;
}

.btn-outline-success:hover {
    background: var(--primary);
    color: white;
}

/* ===== FORMS ===== */
.form-control, .form-select {
    border-radius: 10px;
    border: 2px solid var(--light-gray);
    padding: 12px 15px;
    font-size: 1rem;
    transition: var(--transition);
    height: auto;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(37, 211, 102, 0.25);
    outline: none;
}

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

.form-text {
    color: var(--gray);
    font-size: 0.875rem;
    margin-top: 5px;
}

.input-group-text {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px 0 0 10px;
}

/* ===== TABLES ===== */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    margin-bottom: 0;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    font-weight: 600;
    padding: 15px;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-top: 1px solid var(--light-gray);
}

.table tbody tr:hover {
    background-color: rgba(37, 211, 102, 0.05);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 15px 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: white !important;
}

.navbar-brand i {
    margin-right: 10px;
    font-size: 1.8rem;
}

.nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 10px 15px !important;
    border-radius: 8px;
    transition: var(--transition);
}

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

/* ===== ALERTS ===== */
.alert {
    border-radius: var(--radius);
    border: none;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.alert-success {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.1) 0%, rgba(18, 140, 126, 0.1) 100%);
    border-left: 4px solid var(--primary);
    color: var(--primary-dark);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(200, 35, 51, 0.1) 100%);
    border-left: 4px solid var(--danger);
    color: var(--danger);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(224, 168, 0, 0.1) 100%);
    border-left: 4px solid var(--warning);
    color: #856404;
}

.alert-info {
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(17, 122, 139, 0.1) 100%);
    border-left: 4px solid var(--info);
    color: #0c5460;
}

/* ===== BADGES ===== */
.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

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

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

.badge-info {
    background: linear-gradient(135deg, var(--info) 0%, #117a8b 100%);
    color: white;
}

/* ===== CARD ===== */
.card {
    background: white;
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin-bottom: 20px;
    overflow: hidden;
}

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

.card-header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    color: white;
    border-bottom: none;
    padding: 15px 20px;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    font-weight: 600;
}

.card-body {
    padding: 25px;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

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

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

.pulse {
    animation: pulse 2s infinite;
}

.spin {
    animation: spin 1s linear infinite;
}

/* ===== LOADING ===== */
.spinner-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-gray);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ===== MODALS ===== */
.modal-content {
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    padding: 20px;
}

.modal-title {
    font-weight: 600;
    color: white;
}

.modal-body {
    padding: 25px;
}

/* ===== UTILITIES ===== */
.shadow-sm { box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important; }
.shadow { box-shadow: var(--shadow) !important; }
.shadow-lg { box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important; }

.rounded-lg { border-radius: var(--radius) !important; }
.rounded-xl { border-radius: 20px !important; }

.cursor-pointer { cursor: pointer; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.fw-semibold { font-weight: 600; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .card-body {
        padding: 20px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print, .btn, .navbar, .modal, footer {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        break-inside: avoid;
    }
    
    .table {
        break-inside: avoid;
    }
}

/* ===== SIDEBAR IMPROVEMENTS ===== */
.sidebar {
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    color: white;
    min-height: 100vh;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow-y: auto;
}

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

.sidebar-brand h3 {
    color: white;
    font-weight: 700;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar-brand h3 i {
    font-size: 1.8rem;
}

.sidebar-menu {
    padding: 20px 0;
}

.nav-sidebar {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    list-style: none;
}

.nav-sidebar .nav-item {
    width: 100%;
    margin-bottom: 5px;
}

.nav-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 15px 25px !important;
    font-weight: 500;
    border-radius: 0;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.nav-sidebar .nav-link:hover {
    color: white;
    background: rgba(255,255,255,0.1);
    border-left-color: #25D366;
    transform: translateX(5px);
}

.nav-sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.15);
    border-left-color: #25D366;
    box-shadow: inset 3px 0 10px rgba(37, 211, 102, 0.3);
}

.nav-sidebar .nav-link i {
    width: 24px;
    text-align: center;
    font-size: 1.2rem;
    margin-right: 12px;
    transition: all 0.3s ease;
}

.nav-sidebar .nav-link.active i {
    color: #25D366;
    transform: scale(1.1);
}

.nav-sidebar .nav-link::after {
    content: '';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background: #25D366;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-sidebar .nav-link.active::after {
    opacity: 1;
}

.nav-sidebar .nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 20px 25px;
}

.nav-sidebar .nav-link.logout-link {
    color: #ff6b6b;
    border-left-color: transparent;
}

.nav-sidebar .nav-link.logout-link:hover {
    background: rgba(255,107,107,0.1);
    color: #ff6b6b;
    border-left-color: #ff6b6b;
}

/* User info in sidebar */
.sidebar-user {
    padding: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: auto;
    background: rgba(0,0,0,0.1);
}

.user-info-sidebar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-sidebar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(37, 211, 102, 0.3);
}

.user-details-sidebar {
    flex: 1;
}

.user-name-sidebar {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.user-role-sidebar {
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
}

/* Main content adjustment */
.main-content {
    margin-left: 280px;
    padding: 20px;
    min-height: 100vh;
    background: #f8f9fa;
    transition: margin-left 0.3s ease;
}

/* Mobile sidebar toggle */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: linear-gradient(135deg, #075E54 0%, #128C7E 100%);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 10px;
    font-size: 1.3rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.active {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sidebar.active + .main-content {
        margin-left: 280px;
    }
}

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

.sidebar::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
}

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

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