:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --info-color: #0891b2;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-color: #e2e8f0;
    --sidebar-width: 220px;
    --sidebar-collapsed-width: 60px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    color: var(--dark-color);
    background-color: #f1f5f9;
    margin: 0;
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
}

    .sidebar.collapsed {
        width: var(--sidebar-collapsed-width);
    }

.sidebar-header {
    padding: 1rem 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-brand {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

    .sidebar-brand i {
        margin-right: 0.6rem;
        font-size: 1.3rem;
    }

.sidebar.collapsed .sidebar-brand span {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 0.4rem;
    transition: all 0.3s ease;
}

    .sidebar-toggle:hover {
        background: rgba(255,255,255,0.1);
    }

.sidebar-nav {
    padding: 0.8rem 0;
}

.nav-item {
    margin: 0.2rem 0.8rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    border-radius: 0.6rem;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
}

    .nav-link:hover {
        background: rgba(255,255,255,0.1);
        color: white;
        transform: translateX(3px);
    }

    .nav-link.active {
        background: rgba(255,255,255,0.15);
        color: white;
    }

    .nav-link i {
        margin-right: 0.8rem;
        font-size: 1rem;
        width: 16px;
        text-align: center;
    }

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 0.6rem 0.4rem;
}

    .sidebar.collapsed .nav-link span {
        display: none;
    }

    .sidebar.collapsed .nav-link i {
        margin-right: 0;
    }

.main-content {
    margin-left: var(--sidebar-width);
    transition: all 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.top-navbar {
    background: white;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    border-radius: 0.6rem;
    background: var(--light-color);
    color: var(--dark-color);
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.8rem;
}

.content-area {
    padding: 1.2rem;
}

.card {
    background: white;
    border-radius: 0.7rem;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.3s ease;
}

    .card:hover {
        box-shadow: 0 4px 20px rgba(0,0,0,0.08);
        transform: translateY(-1px);
    }

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--light-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.card-body {
    padding: 1rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
    border: none;
    margin-bottom: 1rem;
}

    .stat-card.success {
        background: linear-gradient(135deg, var(--success-color) 0%, #10b981 100%);
    }

    .stat-card.warning {
        background: linear-gradient(135deg, var(--warning-color) 0%, #f59e0b 100%);
    }

    .stat-card.danger {
        background: linear-gradient(135deg, var(--danger-color) 0%, #ef4444 100%);
    }

    .stat-card.info {
        background: linear-gradient(135deg, var(--info-color) 0%, #06b6d4 100%);
    }

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin: 0;
}

.stat-icon {
    font-size: 2.2rem;
    opacity: 0.3;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: 0.6rem;
    border: none;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1.4;
    vertical-align: middle;
    box-sizing: border-box;
    white-space: nowrap;
    text-align: center;
    min-height: 36px;
    position: relative;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

    .btn-primary:hover {
        background: #1d4ed8;
        transform: translateY(-1px);
        box-shadow: 0 3px 12px rgba(37, 99, 235, 0.3);
    }

.btn-success {
    background: var(--success-color);
    color: white;
}

    .btn-success:hover {
        background: #047857;
        transform: translateY(-1px);
        box-shadow: 0 3px 12px rgba(5, 150, 105, 0.3);
    }

.btn-warning {
    background: var(--warning-color);
    color: white;
}

    .btn-warning:hover {
        background: #b45309;
    }

.btn-danger {
    background: var(--danger-color);
    color: white;
}

    .btn-danger:hover {
        background: #b91c1c;
    }

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

    .btn-outline-primary:hover {
        background: var(--primary-color);
        color: white;
    }

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
    min-height: 32px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
    font-size: 0.8rem;
}

    .table th,
    .table td {
        padding: 0.6rem;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        vertical-align: middle;
    }

    .table th {
        font-weight: 600;
        background: var(--light-color);
        color: var(--dark-color);
        font-size: 0.75rem;
    }

    .table tbody tr:hover {
        background: #f8fafc;
    }

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 2px solid var(--border-color);
    border-radius: 0.6rem;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
    line-height: 1.4;
    vertical-align: middle;
    min-height: 36px;
}

    .form-control:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.form-label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.8rem;
}

.form-group {
    margin-bottom: 1rem;
}

.alert {
    padding: 0.8rem 1rem;
    border-radius: 0.6rem;
    margin-bottom: 1rem;
    border-left: 3px solid;
    position: relative;
    font-size: 0.8rem;
}

.alert-success {
    background: rgba(5, 150, 105, 0.1);
    color: var(--success-color);
    border-color: var(--success-color);
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.alert-warning {
    background: rgba(217, 119, 6, 0.1);
    color: var(--warning-color);
    border-color: var(--warning-color);
}

.alert-dismissible .btn-close {
    position: absolute;
    top: 0.5rem;
    right: 0.8rem;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.5;
}

    .alert-dismissible .btn-close:hover {
        opacity: 1;
    }

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}

    .modal.show {
        display: flex;
        align-items: center;
        justify-content: center;
    }

.modal-content {
    background: white;
    border-radius: 0.8rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    min-width: 350px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    align-items: center;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 2.5rem;
    background: white;
    border-radius: 1.2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.login-header {
    text-align: center;
    margin-bottom: 1.8rem;
}

    .login-header h2 {
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--dark-color);
        margin-bottom: 0.4rem;
    }

    .login-header p {
        color: var(--secondary-color);
        margin: 0;
        font-size: 0.9rem;
    }

/* Change Password Page Specific Styles */
.change-password-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
}

.change-password-card {
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    background: white;
    border-radius: 1.2rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.change-password-header {
    text-align: center;
    margin-bottom: 2rem;
}

    .change-password-header h2 {
        font-size: 1.6rem;
        font-weight: 700;
        color: var(--dark-color);
        margin-bottom: 0.4rem;
    }

    .change-password-header p {
        color: var(--secondary-color);
        margin: 0;
        font-size: 0.9rem;
    }

.form-check-label {
    font-size: 0.8rem;
    color: var(--dark-color);
}

.form-check-input {
    margin-right: 0.5rem;
}

.w-100 {
    width: 100%;
}

.me-2 {
    margin-right: 0.5rem;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-3 {
    margin-top: 0.8rem;
}

.text-danger {
    color: var(--danger-color);
    font-size: 0.75rem;
}

.text-muted {
    color: var(--secondary-color);
}

.text-success {
    color: var(--success-color);
}

.text-warning {
    color: var(--warning-color);
}

.text-primary {
    color: var(--primary-color);
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.table-responsive {
    overflow-x: auto;
}

/* Additional utility classes */
.flex-fill {
    flex: 1 1 auto;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.justify-content-center {
    justify-content: center;
}

.card-footer {
    padding: 0.8rem 1rem;
    background-color: var(--light-color);
    border-top: 1px solid var(--border-color);
    font-size: 0.8rem;
}

/* Compact Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col-xl-3,
.col-lg-6,
.col-md-6 {
    padding: 0.5rem;
}

.col-xl-3 {
    flex: 0 0 25%;
    max-width: 25%;
}

.col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (max-width: 1200px) {
    .col-xl-3 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Mobile Menu Styles */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--dark-color);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

    .mobile-menu-btn:hover {
        background: var(--light-color);
    }

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* User Details Styles */
.user-details {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.user-name {
    font-weight: 600;
    font-size: 0.8rem;
}

.user-role {
    font-size: 0.7rem;
    color: #64748b;
}

/* Dropdown Styles */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 0.6rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

    .dropdown-menu.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--dark-color);
    text-decoration: none;
    font-size: 0.8rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .dropdown-item:hover {
        background: var(--light-color);
        color: var(--primary-color);
    }

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

        .sidebar.show {
            transform: translateX(0);
        }

    .mobile-overlay.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .content-area {
        padding: 0.8rem;
    }

    .col-xl-3,
    .col-lg-6,
    .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .page-title {
        font-size: 1.2rem;
    }

    .user-info {
        font-size: 0.75rem;
    }

    .user-details {
        display: none;
    }

    .login-card,
    .change-password-card {
        padding: 2rem;
    }

    .top-navbar {
        padding: 0.8rem 1rem;
    }

    .dropdown-menu {
        right: 0;
        left: auto;
    }
}
