/* Tailwind CSS - Ekklesiasys Portal Styles */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* Custom Tailwind Configuration */
:root {
    --primary: #2563eb;
    --secondary: #1e40af;
    --accent: #3b82f6;
    --purple: #8b5cf6;
    --pink: #ec4899;
    --green: #10b981;
    --orange: #f59e0b;
    --red: #ef4444;
    --cyan: #06b6d4;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --white: #ffffff;
    /* Dark mode text colors */
    --text-dark-mode: rgba(255, 255, 255, 0.9);
    --text-light-mode: rgba(255, 255, 255, 0.7);
}

/* Note: CSS variables are global, but we scope the usage with selectors */

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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    min-height: 100vh;
}

body.dashboard-page {
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
}

/* Auth Pages Styles */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 10;
    pointer-events: auto;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease-out;
    position: relative;
    z-index: 20;
    pointer-events: auto;
}

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

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-logo img {
    height: 60px;
    width: auto;
}

.logo-fallback {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.auth-header p {
    color: var(--text-light);
    font-size: 0.9375rem;
}

.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert i {
    font-size: 1.125rem;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.status-active {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.status-overdue {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-locked {
    background: rgba(239, 68, 68, 0.3);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Dark mode label support - only in main content area */
body:not(.light-mode) .main-content .form-group label,
body:not(.light-mode) .dashboard-container .form-group label {
    color: rgba(255, 255, 255, 0.9);
}

/* Auth page labels are already dark, no change needed */

.form-group label i {
    color: var(--primary);
    font-size: 1rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* Auth page specific input styles - dark text on white card */
.auth-card .form-group input,
.auth-card .form-group textarea,
.auth-card .form-group select {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e7eb;
    color: var(--text-dark);
}

.auth-card .form-group input::placeholder,
.auth-card .form-group textarea::placeholder {
    color: var(--text-light);
}

.auth-card .form-group input:focus,
.auth-card .form-group textarea:focus,
.auth-card .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: rgba(255, 255, 255, 1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

/* Light mode input styles */
body.light-mode .form-group input,
body.light-mode .form-group textarea,
body.light-mode .form-group select {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e7eb;
    color: var(--text-dark);
}

body.light-mode .form-group input::placeholder,
body.light-mode .form-group textarea::placeholder {
    color: var(--text-light);
}

body.light-mode .form-group input:focus,
body.light-mode .form-group textarea:focus,
body.light-mode .form-group select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--primary);
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.95);
    transition: color 0.3s;
}

body.light-mode .checkbox-label {
    color: var(--text-dark);
}

.checkbox-label input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: var(--secondary);
    text-decoration: underline;
}

.auth-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-gradient {
    position: absolute;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
    top: -50%;
    left: -50%;
}

.auth-pattern {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* OTP Specific Styles */
.otp-hint {
    margin-top: 1rem;
    padding: 0.75rem;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 0.5rem;
    color: #1e40af;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.otp-display {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #dbeafe, #e0e7ff);
    border: 2px solid #3b82f6;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.2);
}

.otp-display-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #1e40af;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.otp-display-label i {
    font-size: 1.125rem;
}

.otp-display-code {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1e40af;
    letter-spacing: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 0.75rem;
    margin-bottom: 0.75rem;
    font-family: 'Courier New', monospace;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.otp-display-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #64748b;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}

.otp-display-note i {
    font-size: 0.875rem;
}

.otp-form .form-group {
    text-align: center;
}

.otp-input-container {
    display: flex;
    justify-content: center;
}

.otp-input {
    text-align: center;
    font-size: 2.5rem;
    letter-spacing: 0.8rem;
    font-weight: 700;
    padding: 1.5rem 2rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    max-width: 250px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e7eb;
    color: var(--text-dark);
    backdrop-filter: blur(10px);
}

.otp-input::placeholder {
    color: var(--text-light);
}

.otp-input:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.otp-help {
    color: var(--text-light);
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    display: block;
}

.otp-actions {
    margin-top: 2rem;
    text-align: center;
}

.otp-actions p {
    color: var(--text-light);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.otp-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-resend,
.btn-back {
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

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

.btn-resend:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.btn-back {
    background: #f3f4f6;
    color: var(--text-dark);
    border: 2px solid #e5e7eb;
}

.btn-back:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.otp-timer {
    margin-top: 1.5rem;
    text-align: center;
    padding: 0.75rem;
    background: #f3f4f6;
    border-radius: 0.5rem;
    color: var(--text-dark);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.otp-timer i {
    color: var(--primary);
}

/* Dashboard Styles */
.dashboard-page {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
    position: fixed;
    top: 0;
    left: 0;
}

.dashboard-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.header-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 0 0 auto;
}

.mobile-menu-toggle {
    display: none;
    background: rgba(31, 41, 55, 0.9);
    border: none;
    color: white;
    font-size: 1.25rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.mobile-menu-toggle:hover {
    background: rgba(31, 41, 55, 1);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

.dashboard-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.dashboard-logo img {
    height: 40px;
    width: auto;
}

.dashboard-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #2563eb, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    flex: 0 0 auto;
    margin-left: auto;
}

.theme-toggle {
    background: rgba(31, 41, 55, 0.9);
    border: none;
    color: white;
    font-size: 1.125rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(31, 41, 55, 1);
    transform: scale(1.05);
}

.theme-toggle:active {
    transform: scale(0.95);
}

body.light-mode .theme-toggle {
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-dark);
}

body.light-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 1);
}

.notification-wrapper {
    position: relative;
}

.notification-toggle {
    background: rgba(31, 41, 55, 0.9);
    border: none;
    color: white;
    font-size: 1.125rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.notification-toggle:hover {
    background: rgba(31, 41, 55, 1);
    transform: scale(1.05);
}

.notification-toggle:active {
    transform: scale(0.95);
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    border: 2px solid rgba(30, 41, 59, 0.95);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.notifications-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    min-width: 350px;
    max-width: 400px;
    max-height: 500px;
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.light-mode .notifications-dropdown {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.05) !important;
}

body.light-mode .notification-item:hover {
    background: rgba(0, 0, 0, 0.02) !important;
}

body.light-mode .notifications-header h3 {
    color: var(--text-dark);
}

body.light-mode .notification-item {
    border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .notification-item .notification-title {
    color: var(--text-dark);
}

body.light-mode .notification-item .notification-message {
    color: var(--text-light);
}

body.light-mode .notification-item .notification-time {
    color: rgba(0, 0, 0, 0.5);
}

.user-menu-wrapper {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    width: 100%;
    text-align: left;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.3);
}

.user-menu-arrow {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    transition: transform 0.3s;
    margin-left: auto;
}

.user-menu-wrapper.active .user-menu-arrow {
    transform: rotate(180deg);
}

.user-details {
    display: block;
}

.user-email {
    display: block;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    max-width: 320px;
    max-height: calc(100vh - 150px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.user-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 1rem;
    background: var(--bg-light);
}

.dropdown-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.dropdown-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.dropdown-email {
    font-size: 0.8125rem;
    color: var(--text-light);
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.5rem 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9375rem;
    position: relative;
}

.dropdown-item:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 1rem;
}

.dropdown-item:hover i {
    color: var(--primary);
}

.dropdown-item-danger {
    color: var(--red) !important;
    font-weight: 500;
}

.dropdown-item-danger:hover {
    background: #fee2e2 !important;
    color: #991b1b !important;
}

.dropdown-item-danger i {
    color: var(--red) !important;
}

.dropdown-item-danger:hover i {
    color: #991b1b !important;
}

.dropdown-badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.current-branch-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.75rem;
    color: var(--text-dark);
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 1rem;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.current-branch-badge i {
    font-size: 1rem;
    flex-shrink: 0;
    color: var(--primary);
}

.current-branch-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-dark);
}

/* Package Expiry Badge */
.package-expiry-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 1rem;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid;
    animation: pulse 2s infinite;
}

.package-expiry-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.4);
    color: #d97706;
}

.package-expiry-badge.expired {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
    color: #dc2626;
    animation: pulse-urgent 1.5s infinite;
}

.package-expiry-badge i {
    font-size: 1rem;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes pulse-urgent {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

/* Package Expiry Banner */
.package-expiry-banner {
    width: 100%;
    padding: 1.25rem 2rem;
    margin: 0;
    border-bottom: 3px solid;
    animation: slideDown 0.3s ease-out;
    position: relative;
    z-index: 100;
}

.package-expiry-banner.warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
    border-bottom-color: #f59e0b;
    color: #92400e;
}

.package-expiry-banner.expired {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    border-bottom-color: #ef4444;
    color: #991b1b;
    animation: slideDown 0.3s ease-out, pulse-banner 2s infinite;
}

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

@keyframes pulse-banner {
    0%, 100% {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
    }
    50% {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.2) 0%, rgba(239, 68, 68, 0.12) 100%);
    }
}

.expiry-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.expiry-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.expiry-banner-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.expiry-banner-text strong {
    font-size: 1.125rem;
    font-weight: 700;
    display: block;
}

.expiry-banner-text span {
    font-size: 0.9375rem;
    line-height: 1.5;
}

.expiry-banner-action {
    flex-shrink: 0;
}

.btn-renew {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-renew:hover {
    background: var(--secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.package-expiry-banner.expired .btn-renew {
    background: #ef4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.package-expiry-banner.expired .btn-renew:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Locked menu items */
.menu-item.locked .menu-link.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.menu-item.locked .menu-link.locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 0.5rem;
}

body:not(.light-mode) .menu-item.locked .menu-link.locked::after {
    background: rgba(255, 255, 255, 0.05);
}

.dropdown-section {
    padding: 0.5rem 0;
}

.dropdown-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dropdown-section-title i {
    font-size: 0.875rem;
}

.branch-list {
    max-height: 200px;
    overflow-y: auto;
}

.branch-item {
    padding: 0.75rem 1rem;
}

.branch-item.active-branch {
    background: rgba(37, 99, 235, 0.1);
    border-left: 3px solid var(--primary);
}

.branch-item.active-branch:hover {
    background: rgba(37, 99, 235, 0.15);
}

.branch-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
    min-width: 0;
}

.branch-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-location {
    font-size: 0.8125rem;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-check {
    color: var(--primary);
    font-size: 0.875rem;
    margin-left: auto;
    flex-shrink: 0;
}

.branch-item.active-branch .branch-name {
    color: var(--primary);
    font-weight: 600;
}

/* Modal Styles */
/* Critical: Modal must be positioned relative to viewport, not page content */
.modal {
    display: none;
    position: fixed !important;
    z-index: 2000;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    /* Ensure modal is always at viewport origin, regardless of page scroll */
    margin: 0 !important;
    padding: 0 !important;
    /* Force viewport positioning - override any inline styles */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Prevent body scrolling when modal is open */
/* JavaScript will set body.style.overflow = 'hidden', but this provides CSS backup */
body.modal-open,
body[style*="overflow: hidden"] {
    overflow: hidden !important;
    position: fixed !important;
    width: 100% !important;
    height: 100% !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
}

/* When modal is shown, it must use flexbox for proper centering */
/* This ensures modals opened with JavaScript display:block or display:flex work correctly */
.modal[style*="display: block"],
.modal[style*="display:flex"],
.modal[style*="display: flex"],
.modal.show,
.modal.active {
    display: flex !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 2000 !important;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto !important;
}

/* Ensure modal covers full viewport even when content is short */
.modal:not([style*="display: none"]) {
    display: flex !important;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    margin: auto;
    padding: 0;
    border-radius: 1rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease-out;
    border: 1px solid #e5e7eb;
    position: relative;
    /* Ensure modal content is properly positioned within flex container */
    align-self: center;
    flex-shrink: 0;
    /* Prevent content from going out of viewport */
    box-sizing: border-box;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    padding: 1.5rem;
    color: var(--text-dark);
    line-height: 1.6;
}

/* Dark Mode Modal Styles */
body:not(.light-mode) .modal-content {
    background: rgba(30, 41, 59, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body:not(.light-mode) .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.light-mode) .modal-header h2 {
    color: rgba(255, 255, 255, 0.95);
}

body:not(.light-mode) .modal-close {
    color: rgba(255, 255, 255, 0.7);
}

body:not(.light-mode) .modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

body:not(.light-mode) .modal-body {
    color: rgba(255, 255, 255, 0.9);
}

/* Light Mode Modal Styles */
body.light-mode .modal-content {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid #e5e7eb;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

body.light-mode .modal-header {
    border-bottom: 1px solid #e5e7eb;
}

body.light-mode .modal-header h2 {
    color: var(--text-dark);
}

body.light-mode .modal-close {
    color: var(--text-light);
}

body.light-mode .modal-close:hover {
    background: var(--bg-light);
    color: var(--text-dark);
}

body.light-mode .modal-body {
    color: var(--text-dark);
}

/* Modal Form Inputs - Dark Mode */
body:not(.light-mode) .modal .form-input,
body:not(.light-mode) .modal input[type="text"],
body:not(.light-mode) .modal input[type="email"],
body:not(.light-mode) .modal input[type="tel"],
body:not(.light-mode) .modal input[type="password"],
body:not(.light-mode) .modal textarea,
body:not(.light-mode) .modal select {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

body:not(.light-mode) .modal .form-input::placeholder,
body:not(.light-mode) .modal input::placeholder,
body:not(.light-mode) .modal textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body:not(.light-mode) .modal .form-input:focus,
body:not(.light-mode) .modal input:focus,
body:not(.light-mode) .modal textarea:focus,
body:not(.light-mode) .modal select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body:not(.light-mode) .modal select option {
    background: rgba(30, 41, 59, 0.98);
    color: rgba(255, 255, 255, 0.95);
}

body:not(.light-mode) .modal .form-group label {
    color: rgba(255, 255, 255, 0.9);
}

body:not(.light-mode) .modal .form-actions {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.light-mode) .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    padding: 1.5rem;
}

body:not(.light-mode) .modal-footer button,
body:not(.light-mode) .modal-footer .btn {
    color: rgba(255, 255, 255, 0.9);
}

body.light-mode .modal-footer {
    border-top: 1px solid #e5e7eb;
    background: transparent;
    padding: 1.5rem;
}

body.light-mode .modal-footer button,
body.light-mode .modal-footer .btn {
    color: var(--text-dark);
}

/* Modal Form Inputs - Light Mode */
body.light-mode .modal .form-input,
body.light-mode .modal input[type="text"],
body.light-mode .modal input[type="email"],
body.light-mode .modal input[type="tel"],
body.light-mode .modal input[type="password"],
body.light-mode .modal textarea,
body.light-mode .modal select {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e7eb;
    color: var(--text-dark);
}

body.light-mode .modal .form-input::placeholder,
body.light-mode .modal input::placeholder,
body.light-mode .modal textarea::placeholder {
    color: var(--text-light);
}

body.light-mode .modal .form-input:focus,
body.light-mode .modal input:focus,
body.light-mode .modal textarea:focus,
body.light-mode .modal select:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary);
    color: var(--text-dark);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.light-mode .modal select option {
    background: white;
    color: var(--text-dark);
}

body.light-mode .modal .form-group label {
    color: var(--text-dark);
}

body.light-mode .modal .form-actions {
    border-top: 1px solid #e5e7eb;
}

/* DataTables Dark Mode Styling */
body:not(.light-mode) .dataTables_wrapper {
    color: rgba(255, 255, 255, 0.9);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_length,
body:not(.light-mode) .dataTables_wrapper .dataTables_filter,
body:not(.light-mode) .dataTables_wrapper .dataTables_info,
body:not(.light-mode) .dataTables_wrapper .dataTables_paginate {
    color: rgba(255, 255, 255, 0.9);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_length label,
body:not(.light-mode) .dataTables_wrapper .dataTables_filter label {
    color: rgba(255, 255, 255, 0.9);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

body:not(.light-mode) .dataTables_wrapper .dataTables_filter input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_length select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

body:not(.light-mode) .dataTables_wrapper .dataTables_length select:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_length select option {
    background: rgba(30, 41, 59, 0.98);
    color: rgba(255, 255, 255, 0.95);
}

body:not(.light-mode) .dataTables_wrapper table.dataTable {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
}

body:not(.light-mode) .dataTables_wrapper table.dataTable thead th {
    background: rgba(37, 99, 235, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

body:not(.light-mode) .dataTables_wrapper table.dataTable tbody td {
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body:not(.light-mode) .dataTables_wrapper table.dataTable tbody tr {
    background: transparent;
}

body:not(.light-mode) .dataTables_wrapper table.dataTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

body:not(.light-mode) .dataTables_wrapper table.dataTable tbody tr.odd {
    background: rgba(255, 255, 255, 0.02);
}

body:not(.light-mode) .dataTables_wrapper table.dataTable tbody tr.even {
    background: transparent;
}

body:not(.light-mode) .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
}

body:not(.light-mode) .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(37, 99, 235, 0.2) !important;
    color: var(--primary) !important;
    border-color: var(--primary);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(37, 99, 235, 0.3) !important;
    color: white !important;
    border-color: var(--primary);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body:not(.light-mode) .dataTables_wrapper .dataTables_processing {
    background: rgba(30, 41, 59, 0.98);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.light-mode) .dataTables_wrapper .dataTables_empty {
    color: rgba(255, 255, 255, 0.7);
}

/* DataTables Light Mode Styling */
body.light-mode .dataTables_wrapper .dataTables_length,
body.light-mode .dataTables_wrapper .dataTables_filter,
body.light-mode .dataTables_wrapper .dataTables_info,
body.light-mode .dataTables_wrapper .dataTables_paginate {
    color: var(--text-dark);
}

body.light-mode .dataTables_wrapper .dataTables_filter input {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    color: var(--text-dark);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

body.light-mode .dataTables_wrapper .dataTables_filter input:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.light-mode .dataTables_wrapper .dataTables_length select {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    color: var(--text-dark);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

body.light-mode .dataTables_wrapper .dataTables_length select:focus {
    background: white;
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.light-mode .dataTables_wrapper .dataTables_length select option {
    background: white;
    color: var(--text-dark);
}

body.light-mode .dataTables_wrapper table.dataTable thead th {
    background: rgba(37, 99, 235, 0.1);
    color: var(--text-dark);
    border-bottom: 2px solid #e5e7eb;
}

body.light-mode .dataTables_wrapper table.dataTable tbody td {
    color: var(--text-dark);
    border-bottom: 1px solid #e5e7eb;
}

body.light-mode .dataTables_wrapper table.dataTable tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

body.light-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text-dark) !important;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    margin: 0 0.25rem;
}

body.light-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(37, 99, 235, 0.1) !important;
    color: var(--primary) !important;
    border-color: var(--primary);
}

body.light-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: rgba(37, 99, 235, 0.2) !important;
    color: var(--primary) !important;
    border-color: var(--primary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.logout-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.logout-text {
    display: inline;
}

.dashboard-container {
    width: 100%;
    height: calc(100vh - 80px);
    margin: 0;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 1.5rem;
    height: fit-content;
    max-height: calc(100vh - 100px);
    position: sticky;
    top: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transition: transform 0.3s ease-in-out;
}

.sidebar-header {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}

.sidebar-close {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-dark);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
}

.sidebar-close:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-light);
}

.menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.menu-item {
    display: block;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-radius: 0.75rem;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 0.9375rem;
}

.menu-link:hover {
    background: var(--bg-light);
    color: var(--primary);
    transform: translateX(4px);
}

.menu-link.active {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(139, 92, 246, 0.1));
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

.menu-link i {
    font-size: 1.125rem;
    width: 24px;
    text-align: center;
}

.main-content {
    background: rgba(51, 65, 85, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    max-height: calc(100vh - 120px);
    color: rgba(255, 255, 255, 0.95);
    transition: background 0.3s ease, color 0.3s ease;
}

/* Light Mode Styles */
body.light-mode .main-content {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-dark);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.content-header {
    margin-bottom: 2rem;
}

.content-title {
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

body.light-mode .content-title {
    color: var(--text-dark);
}

.content-subtitle {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    transition: color 0.3s ease;
}

body.light-mode .content-subtitle {
    color: var(--text-light);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(71, 85, 105, 0.5);
    padding: 1.5rem;
    border-radius: 1rem;
    border-left: 4px solid var(--primary);
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

body.light-mode .stat-card {
    background: rgba(249, 250, 251, 0.9);
    border-left: 4px solid var(--primary);
}

.stat-card:nth-child(2) {
    border-left-color: var(--green);
    background: rgba(16, 185, 129, 0.15);
}

body.light-mode .stat-card:nth-child(2) {
    background: rgba(240, 253, 244, 0.9);
}

.stat-card:nth-child(3) {
    border-left-color: var(--orange);
    background: rgba(245, 158, 11, 0.15);
}

body.light-mode .stat-card:nth-child(3) {
    background: rgba(255, 251, 235, 0.9);
}

.stat-card:nth-child(4) {
    border-left-color: var(--pink);
    background: rgba(236, 72, 153, 0.15);
}

body.light-mode .stat-card:nth-child(4) {
    background: rgba(253, 242, 248, 0.9);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: rgba(71, 85, 105, 0.7);
}

body.light-mode .stat-card:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.stat-label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 0.5rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

body.light-mode .stat-label {
    color: var(--text-light);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    transition: color 0.3s ease;
}

body.light-mode .stat-value {
    color: var(--text-dark);
}

.feature-section {
    margin-top: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    transition: color 0.3s ease, border-color 0.3s ease;
}

body.light-mode .section-title {
    color: var(--text-dark);
    border-bottom: 2px solid var(--bg-light);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    padding: 1.5rem;
    background: rgba(71, 85, 105, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 1rem;
    border: 2px solid transparent;
    transition: all 0.3s;
    cursor: pointer;
}

body.light-mode .feature-card {
    background: rgba(249, 250, 251, 0.9);
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: rgba(71, 85, 105, 0.7);
}

body.light-mode .feature-card:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 0.75rem;
    background: linear-gradient(135deg, #2563eb, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.feature-card:nth-child(2) .feature-icon {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

.feature-card:nth-child(3) .feature-icon {
    background: linear-gradient(135deg, #10b981, #059669);
}

.feature-card:nth-child(4) .feature-icon {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

.feature-card:nth-child(5) .feature-icon {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.feature-card:nth-child(6) .feature-icon {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.feature-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

body.light-mode .feature-name {
    color: var(--text-dark);
}

.feature-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    transition: color 0.3s ease;
}

body.light-mode .feature-desc {
    color: var(--text-light);
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open {
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        height: calc(100vh - 70px);
        padding: 1rem;
    }
    
    .sidebar {
        position: static;
        max-height: none;
    }
    
    .menu-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .main-content {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }
    
    .dashboard-header {
        padding: 0.75rem 1rem;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .header-left {
        flex: 1;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 0.5rem;
        overflow: hidden;
        align-items: center;
    }
    
    .dashboard-logo {
        flex-shrink: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
        flex-shrink: 0;
    }
    
    .header-right {
        flex: 0 0 auto;
        justify-content: flex-end;
        gap: 0.5rem;
    }
    
    .user-info {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .user-details {
        display: none;
    }
    
    .user-email {
        display: none;
    }
    
    .user-dropdown {
        right: 0;
        left: auto;
        min-width: 280px;
        max-width: calc(100vw - 2rem);
    }
    
    .current-branch-badge {
        display: flex !important;
        margin-left: 0.5rem;
        padding: 0.5rem 0.875rem;
        font-size: 0.75rem;
        max-width: 150px;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .current-branch-badge i {
        font-size: 0.875rem;
        flex-shrink: 0;
    }
    
    .current-branch-badge span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .dashboard-container {
        padding: 0.75rem;
        height: calc(100vh - 80px);
        grid-template-columns: 1fr;
        position: relative;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        max-height: 100vh;
        z-index: 999;
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar-header {
        display: flex;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .sidebar-title {
        margin-bottom: 0;
    }
    
    .menu-list {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .menu-link {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
    }
    
    .main-content {
        padding: 1rem;
        max-height: none;
        width: 100%;
    }
    
    .content-title {
        font-size: 1.5rem;
    }
    
    .content-subtitle {
        font-size: 0.875rem;
    }
    
    .dashboard-grid,
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.25rem;
    }
    
    .stat-value {
        font-size: 1.75rem;
    }
    
    .feature-card {
        padding: 1.25rem;
    }
    
    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .feature-name {
        font-size: 1rem;
    }
    
    .feature-desc {
        font-size: 0.8125rem;
    }
    
    .otp-buttons {
        flex-direction: column;
    }
    
    .btn-resend,
    .btn-back {
        width: 100%;
        justify-content: center;
    }
    
    .mobile-overlay {
        display: block;
    }
}

@media (max-width: 480px) {
    .dashboard-header {
        padding: 0.5rem 0.75rem;
    }
    
    .dashboard-logo-text {
        font-size: 1.25rem;
    }
    
    .current-branch-badge {
        display: flex !important;
        margin-left: 0.5rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.6875rem;
        max-width: 120px;
        flex-shrink: 1;
        min-width: 0;
    }
    
    .current-branch-badge i {
        font-size: 0.75rem;
        flex-shrink: 0;
    }
    
    .current-branch-badge span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .header-left {
        gap: 0.375rem;
    }
    
    .dashboard-container {
        padding: 0.5rem;
        height: calc(100vh - 70px);
    }
    
    .main-content {
        padding: 0.75rem;
    }
    
    .content-title {
        font-size: 1.25rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .feature-card {
        padding: 1rem;
    }
    
    .sidebar {
        width: 100%;
        max-width: 100%;
    }
}

/* Profile and Form Styles */
.profile-form {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-section {
    background: rgba(71, 85, 105, 0.3);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s, border-color 0.3s;
}

body.light-mode .profile-section {
    background: rgba(249, 250, 251, 0.9);
    border: 1px solid #e5e7eb;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.875rem 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.9375rem;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    width: 100%;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

body.light-mode .form-group input,
body.light-mode .form-group select,
body.light-mode .form-group textarea {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e7eb;
    color: var(--text-dark);
}

body.light-mode .form-group input::placeholder,
body.light-mode .form-group textarea::placeholder {
    color: var(--text-light);
}

body.light-mode .form-group input:focus,
body.light-mode .form-group select:focus,
body.light-mode .form-group textarea:focus {
    background: rgba(255, 255, 255, 1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color 0.3s;
}

body.light-mode .form-actions {
    border-top: 1px solid #e5e7eb;
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.9375rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    transition: all 0.3s;
}

body.light-mode .btn-secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

body.light-mode .btn-secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Checkbox Styling - Fix width issue preventing label text from displaying properly */
input[type="checkbox"],
label input[type="checkbox"],
label[style*="display: flex"] input[type="checkbox"],
.checkbox-label input[type="checkbox"],
.form-group input[type="checkbox"],
.form-group label input[type="checkbox"] {
    width: 18px !important;
    min-width: 18px !important;
    max-width: 18px !important;
    height: 18px;
    margin: 0;
    margin-right: 0.5rem;
    flex-shrink: 0 !important;
    cursor: pointer;
    accent-color: var(--primary);
    box-sizing: border-box;
}

/* Ensure label text can expand properly when checkbox is in flex container */
label[style*="display: flex"] input[type="checkbox"] + *,
.checkbox-label input[type="checkbox"] + *,
.form-group label input[type="checkbox"] + *,
label[style*="display: flex"] input[type="checkbox"] + span,
.checkbox-label input[type="checkbox"] + span,
.form-group label input[type="checkbox"] + span {
    flex: 1;
    min-width: 0;
}

/* Ensure flex containers with checkboxes display properly */
label[style*="display: flex"],
.checkbox-label,
.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Radio Button Styling - Fix spacing issue */
label[style*="display: flex"] input[type="radio"],
label input[type="radio"] {
    width: auto !important;
    min-width: 18px;
    max-width: 18px;
    height: 18px;
    margin: 0;
    margin-right: 0.5rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--primary);
}

label[style*="display: flex"] span,
label span {
    flex: 1;
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }
}

/* Dark Mode Label and Text Overrides - Only in Main Content Area */
/* Fix hardcoded dark colors in dark mode - scoped to main content */
body:not(.light-mode) .main-content label[style*="color: #6b7280"],
body:not(.light-mode) .main-content label[style*="color:#6b7280"],
body:not(.light-mode) .main-content label[style*="color: #1f2937"],
body:not(.light-mode) .main-content label[style*="color:#1f2937"],
body:not(.light-mode) .main-content label[style*="color: var(--text-dark)"] {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Fix dark text in divs and spans - scoped to main content */
body:not(.light-mode) .main-content div[style*="color: #6b7280"],
body:not(.light-mode) .main-content div[style*="color:#6b7280"],
body:not(.light-mode) .main-content div[style*="color: #1f2937"],
body:not(.light-mode) .main-content div[style*="color:#1f2937"],
body:not(.light-mode) .main-content span[style*="color: #6b7280"],
body:not(.light-mode) .main-content span[style*="color:#6b7280"],
body:not(.light-mode) .main-content span[style*="color: #1f2937"],
body:not(.light-mode) .main-content span[style*="color:#1f2937"],
body:not(.light-mode) .main-content p[style*="color: #6b7280"],
body:not(.light-mode) .main-content p[style*="color:#6b7280"],
body:not(.light-mode) .main-content p[style*="color: #1f2937"],
body:not(.light-mode) .main-content p[style*="color:#1f2937"] {
    color: rgba(255, 255, 255, 0.7) !important;
}

/* General label styling for dark mode - only in main content */
body:not(.light-mode) .main-content label {
    color: rgba(255, 255, 255, 0.9);
}

/* Fix text-dark variable usage in dark mode - scoped to main content */
body:not(.light-mode) .main-content [style*="color: var(--text-dark)"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Fix announcements page text-dark - scoped to main content */
body:not(.light-mode) .main-content h2[style*="color: var(--text-dark)"] {
    color: rgba(255, 255, 255, 0.95) !important;
}

/* Additional dark mode fixes for common patterns - scoped to main content */
body:not(.light-mode) .main-content .content-header ~ * label,
body:not(.light-mode) .main-content .profile-section label,
body:not(.light-mode) .main-content .form-section label {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Fix dark backgrounds with dark text in dark mode - scoped to main content */
body:not(.light-mode) .main-content div[style*="background: #f9fafb"],
body:not(.light-mode) .main-content div[style*="background:#f9fafb"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

body:not(.light-mode) .main-content div[style*="background: #f9fafb"][style*="color: #1f2937"],
body:not(.light-mode) .main-content div[style*="background:#f9fafb"][style*="color:#1f2937"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Fix white backgrounds in dark mode - scoped to main content */
body:not(.light-mode) .main-content div[style*="background: white"],
body:not(.light-mode) .main-content div[style*="background:white"] {
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Specific class-based fixes - scoped to main content */
body:not(.light-mode) .main-content .call-detail-label,
body:not(.light-mode) .main-content .info-label {
    color: rgba(255, 255, 255, 0.8) !important;
}

body:not(.light-mode) .main-content .call-detail-value,
body:not(.light-mode) .main-content .info-value {
    color: rgba(255, 255, 255, 0.95) !important;
}

