/* ============================================
   NAUTICAL ACADEMY HUB - MAIN STYLESHEET
   ============================================ */

/* CSS Variables */
:root {
    --primary-color: #0066cc;
    --primary-dark: #004d99;
    --primary-light: #e6f0ff;
    --secondary-color: #1a365d;
    --accent-color: #00b4d8;
    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --bg-primary: #ffffff;
    --bg-secondary: #f7fafc;
    --bg-dark: #1a365d;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-sm: 4px;
    --radius: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.3s ease;

    /* Department Colors */
    --deck-color: #0066cc;
    --engine-color: #dc2626;
    --eto-color: #7c3aed;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-primary:disabled,
.btn-primary.btn-disabled {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
}

.btn-primary:disabled:hover,
.btn-primary.btn-disabled:hover {
    background: #94a3b8;
    transform: none;
}

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

.btn-outline:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

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

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    border-radius: 50%;
}

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

.btn-danger:hover {
    background: #dc2626;
}

/* Form Elements */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    transition: var(--transition);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #94a3b8;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input:disabled {
    background: var(--bg-secondary);
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 0 24px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.nav-logo i {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hide navbar when user portal or admin page is active */
body.hide-navbar .navbar {
    display: none !important;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu span {
    font-weight: 500;
    color: var(--text-primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

/* Page Management */
.page {
    display: none;
    padding-top: 70px;
    min-height: 100vh;
}

.page.active {
    display: block;
}

/* Auth visibility */
.guest-only, .auth-only, .admin-only {
    display: none !important;
}

body.guest .guest-only {
    display: inline-flex !important;
}

body.guest a.guest-only {
    display: flex !important;
}

body.authenticated .auth-only {
    display: flex !important;
}

body.admin .admin-only {
    display: flex !important;
}

/* Hide nav menu on auth pages (login, register) */
body.auth-page .nav-menu {
    display: none !important;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px;
    align-items: center;
}

.hero-content h1 {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    margin-bottom: 48px;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.hero-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.ship-illustration {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

.ship-illustration i {
    font-size: 8rem;
    color: white;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Sections */
.section {
    padding: 80px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-dark {
    background: var(--bg-dark);
    max-width: 100%;
    padding: 80px 24px;
}

.section-dark .section-title {
    color: white;
}

.section-title {
    text-align: center;
    margin-bottom: 16px;
    color: var(--secondary-color);
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.feature-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.feature-card h3 {
    margin-bottom: 12px;
    color: var(--secondary-color);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Departments Grid */
.departments-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.departments-grid .department-card {
    flex: 0 1 360px;
    max-width: 380px;
}

.department-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    border-top: 4px solid;
}

.department-card.deck {
    border-color: var(--deck-color);
}

.department-card.engine {
    border-color: var(--engine-color);
}

.department-card.eto {
    border-color: var(--eto-color);
}

.dept-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.department-card.deck .dept-icon {
    background: rgba(0, 102, 204, 0.1);
    color: var(--deck-color);
}

.department-card.engine .dept-icon {
    background: rgba(220, 38, 38, 0.1);
    color: var(--engine-color);
}

.department-card.eto .dept-icon {
    background: rgba(124, 58, 237, 0.1);
    color: var(--eto-color);
}

.dept-icon i {
    font-size: 1.5rem;
}

.department-card h3 {
    margin-bottom: 12px;
}

.department-card p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
}

.dept-topics {
    list-style: none;
}

.dept-topics li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.dept-topics i {
    color: var(--success-color);
}

.dept-topics i.coming-soon-icon {
    color: #f59e0b;
}

.dept-topics .book-suffix {
    color: #64748b;
    font-size: 0.9em;
    font-style: italic;
}

/* Department Card Additional Styling */
.department-card {
    position: relative;
}

.department-card .dept-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.coming-soon-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.department-card.coming-soon {
    opacity: 0.85;
}

.department-card.coming-soon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), transparent);
    pointer-events: none;
    border-radius: var(--radius-lg);
}

.dept-info {
    display: none;
    font-size: 13px;
    color: var(--primary-color);
    font-weight: 500;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

.pricing-grid.pricing-grid-two {
    grid-template-columns: repeat(2, 1fr);
    max-width: 700px;
}

/* Why Choose Us - Features Grid Alt */
.features-grid-alt {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.feature-item-alt {
    text-align: center;
    padding: 24px 16px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.feature-item-alt:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.feature-item-alt i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.feature-item-alt h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-item-alt p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 768px) {
    .features-grid-alt {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .features-grid-alt {
        grid-template-columns: 1fr;
    }
}

.pricing-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    position: relative;
    transition: var(--transition);
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.pricing-header {
    text-align: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.pricing-header h3 {
    margin-bottom: 16px;
    color: var(--secondary-color);
}

.price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
}

.price .currency {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.price .amount {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price .period {
    font-size: 14px;
    color: var(--text-muted);
}

.pricing-features {
    list-style: none;
    margin-bottom: 24px;
}

.pricing-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.pricing-features i {
    color: var(--success-color);
}

/* CTA Section */
.cta-section {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 80px 24px;
    max-width: 100%;
}

.cta-section h2 {
    margin-bottom: 16px;
}

.cta-section p {
    opacity: 0.9;
    margin-bottom: 32px;
}

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

.cta-section .btn-primary:hover {
    background: var(--bg-secondary);
}

/* Footer */
.footer {
    background: var(--bg-dark);
    color: white;
    padding: 40px 24px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer p {
    opacity: 0.7;
    font-size: 14px;
}

/* Auth Pages */
#login-page,
#register-page,
#verify-email-page {
    background: linear-gradient(135deg, var(--bg-dark), var(--primary-dark));
}

.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: var(--bg-primary);
    padding: 48px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.auth-header h2 {
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

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

/* Auth Pages Mobile Responsive */
@media (max-width: 768px) {
    #login-page,
    #register-page,
    #verify-email-page {
        padding-top: 0;
    }

    .auth-container {
        padding: 16px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 60px;
    }

    .auth-card {
        padding: 24px;
        border-radius: var(--radius-lg);
        max-width: 100%;
    }

    .auth-header {
        margin-bottom: 20px;
    }

    .auth-header i {
        font-size: 2.5rem;
    }

    .auth-header h2 {
        font-size: 1.5rem;
    }

    .auth-method-tabs {
        margin-bottom: 16px;
    }

    .auth-method-tab {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .auth-method-tab i {
        font-size: 0.9rem;
    }

    .form-group {
        margin-bottom: 14px;
    }

    .auth-footer {
        margin-top: 16px;
        padding-top: 16px;
    }

    /* Verification card mobile */
    .verification-card {
        padding: 24px 20px;
    }

    .verification-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 16px;
    }

    .verification-icon i {
        font-size: 2rem;
    }

    .verification-card h2 {
        font-size: 1.3rem;
    }

    .verification-steps .step {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .verification-steps .step-num {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .auth-container {
        padding: 12px;
        padding-top: 50px;
    }

    .auth-card {
        padding: 20px 16px;
    }

    .auth-header i {
        font-size: 2rem;
    }

    .auth-header h2 {
        font-size: 1.3rem;
    }

    .auth-method-tab span {
        display: none;
    }

    .auth-method-tab {
        padding: 12px;
    }

    .auth-method-tab i {
        font-size: 1.1rem;
    }

    /* Method radio options mobile */
    .method-radio-option {
        padding: 12px;
    }

    .method-radio-content {
        gap: 10px;
    }

    .method-radio-content i {
        width: 32px;
        height: 32px;
        font-size: 1.1rem;
    }

    .method-radio-content .method-info strong {
        font-size: 0.9rem;
    }

    .method-radio-content .method-info span {
        font-size: 0.75rem;
    }

    /* Single method info mobile */
    .single-method-info {
        padding: 12px;
        gap: 10px;
    }

    .single-method-info i {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
    }

    .single-method-info .method-details strong {
        font-size: 0.9rem;
    }

    .single-method-info .method-details span {
        font-size: 0.8rem;
    }

    /* Verification card smaller screens */
    .verification-card {
        padding: 20px 16px;
    }

    .verification-steps {
        gap: 8px;
    }

    .verification-steps .step {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* Auth Method Tabs */
.auth-method-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 12px;
}

.auth-method-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.auth-method-tab:hover {
    color: #334155;
}

.auth-method-tab.active {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.auth-method-tab i {
    font-size: 0.85rem;
}

/* Auth Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Forgot Password Link */
.forgot-password-link {
    text-align: center;
    margin-top: 16px;
}

.forgot-password-link a {
    color: #64748b;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password-link a:hover {
    color: var(--primary-color);
}

/* OTP Styles */
.otp-sent-info {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 12px;
    margin-bottom: 24px;
}

.otp-sent-info i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.otp-sent-info p {
    color: #334155;
    margin: 0;
}

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

.otp-input {
    width: 100%;
    max-width: 200px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 8px;
    padding: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: border-color 0.2s;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.otp-resend {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: #64748b;
}

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

.otp-resend a:hover {
    text-decoration: underline;
}

.otp-change-email {
    text-align: center;
    margin-top: 16px;
}

.otp-change-email a {
    color: #64748b;
    font-size: 0.85rem;
    text-decoration: none;
}

.otp-change-email a:hover {
    color: var(--primary-color);
}

/* OTP Type Toggle (Email/Phone) */
.otp-type-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
}

.otp-type-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.otp-type-btn:hover {
    color: #334155;
}

.otp-type-btn.active {
    background: #ffffff;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.otp-type-btn i {
    font-size: 1rem;
}

/* 2FA Method Selection Styles */
.twofa-method-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.twofa-method-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.twofa-method-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.15);
}

.twofa-method-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-light);
    border-radius: 50%;
}

.twofa-method-btn .method-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.twofa-method-btn .method-info strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.twofa-method-btn .method-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Method Radio Group Styles (for 2FA and Account Verification) */
.method-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.method-radio-option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.method-radio-option:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.method-radio-option:has(input:checked) {
    border-color: var(--primary-color);
    background: var(--primary-light);
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.15);
}

.method-radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 14px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.method-radio-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.method-radio-content i {
    font-size: 1.3rem;
    color: var(--primary-color);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 102, 204, 0.1);
    border-radius: 50%;
}

.method-radio-content .method-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.method-radio-content .method-info strong {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.method-radio-content .method-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Single Method Info (when only email available) */
.single-method-info {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--primary-light);
    border-radius: 12px;
    margin-bottom: 16px;
}

.single-method-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 102, 204, 0.15);
    border-radius: 50%;
}

.single-method-info .method-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
}

.single-method-info .method-details strong {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.single-method-info .method-details span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Verification Method Selector */
.verification-method-selector {
    margin: 20px 0;
}

/* Email Verification Page Styles */
.verification-card {
    text-align: center;
    padding: 40px 30px;
}

.verification-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #e0f2fe 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.verification-icon i {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.verification-desc {
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.verification-email {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

.verification-steps {
    text-align: left;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.verification-steps .step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--text-secondary);
}

.verification-steps .step:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.verification-steps .step-num {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.verification-actions {
    margin-bottom: 20px;
}

.resend-section {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.resend-section a {
    color: var(--primary-color);
}

.verification-footer {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.verification-footer a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.verification-footer a:hover {
    color: var(--danger-color);
}

/* Phone Management Section in Profile */
.phone-section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 30px 0;
}

.phone-management-section h4 {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    margin-bottom: 16px;
    font-size: 1rem;
}

.phone-management-section h4 i {
    color: var(--primary-color);
}

.current-phone-box {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
}

.no-phone-text {
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.phone-number-text {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-primary);
}

/* Professional Phone Number Display - Enterprise Style */
.phone-display-professional {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.phone-display-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.phone-country-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #f8fafc;
    border-right: 1px solid #e5e7eb;
}

.phone-country-section .country-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.phone-country-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.phone-country-info .country-name {
    font-size: 0.65rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    line-height: 1;
}

.phone-country-info .country-code {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.phone-number-section {
    padding: 14px 18px;
    display: flex;
    align-items: center;
}

.phone-number-section .phone-digits {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.phone-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.phone-status-badge.verified {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.phone-status-badge.verified i {
    font-size: 0.7rem;
}

.phone-status-badge.unverified {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fcd34d;
}

/* Dark mode support */
[data-theme="dark"] .phone-display-card {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .phone-country-section {
    background: #0f172a;
    border-right-color: #334155;
}

[data-theme="dark"] .phone-country-info .country-name {
    color: #94a3b8;
}

[data-theme="dark"] .phone-country-info .country-code {
    color: #f1f5f9;
}

[data-theme="dark"] .phone-number-section .phone-digits {
    color: #f1f5f9;
}

[data-theme="dark"] .phone-status-badge.verified {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #065f46;
}

[data-theme="dark"] .phone-status-badge.unverified {
    background: #78350f;
    color: #fcd34d;
    border-color: #92400e;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .phone-display-professional {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .phone-display-card {
        width: 100%;
    }

    .phone-country-section {
        padding: 10px 12px;
    }

    .phone-number-section {
        padding: 10px 14px;
        flex: 1;
    }

    .phone-number-section .phone-digits {
        font-size: 1rem;
    }
}

.verified-badge {
    background: #dcfce7;
    color: #15803d;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.unverified-badge {
    background: #fef3c7;
    color: #b45309;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.phone-actions a {
    color: var(--primary-color);
    font-size: 0.9rem;
}

.phone-actions a:hover {
    text-decoration: underline;
}

.pending-request-info,
.approved-request-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
}

.pending-request-info {
    background: #fef3c7;
}

.pending-request-info i {
    color: #b45309;
    font-size: 1.2rem;
    margin-top: 2px;
}

.pending-request-info strong {
    color: #92400e;
}

.pending-request-info p {
    color: #a16207;
    font-size: 0.85rem;
    margin: 0;
}

.approved-request-info {
    background: #dcfce7;
    margin-bottom: 16px;
}

.approved-request-info i {
    color: #15803d;
    font-size: 1.2rem;
    margin-top: 2px;
}

.approved-request-info strong {
    color: #166534;
}

.approved-request-info p {
    color: #15803d;
    font-size: 0.85rem;
    margin: 0;
}

.new-phone-form,
#addPhoneForm {
    margin-top: 16px;
}

.add-phone-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* Email with verification status */
.email-with-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.email-with-status input {
    flex: 1;
}

.email-verified-badge {
    background: #dcfce7;
    color: #15803d;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

/* Phone Verify Modal */
.modal-verify-phone {
    max-width: 400px;
}

.verify-phone-desc {
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 8px;
}

.verify-phone-number {
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
}

/* Phone Input Group with Select */
.phone-input-group select {
    padding: 12px;
    border: none;
    background: #f1f5f9;
    font-weight: 600;
    color: #475569;
    min-width: 70px;
    cursor: pointer;
}

.phone-input-group select:focus {
    outline: none;
}

/* Additional Phone Items */
.additional-phone-item {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

.additional-phone-item .phone-info-row {
    margin-bottom: 8px;
}

.additional-phone-item .phone-actions {
    display: flex;
    gap: 15px;
}

.additional-phone-item .phone-actions a {
    font-size: 0.85rem;
}

/* Phone Input Styles */
.phone-country-notice {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: #0369a1;
}

.phone-country-notice i {
    font-size: 1rem;
    color: #0284c7;
}

.phone-input-group {
    display: flex;
    align-items: stretch;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.phone-input-group:focus-within {
    border-color: var(--primary-color);
}

.phone-prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    background: #f1f5f9;
    border-right: 1px solid #e2e8f0;
    font-weight: 600;
    color: #475569;
    min-width: 70px;
    font-size: 0.95rem;
}

.phone-input-group input {
    flex: 1;
    border: none;
    padding: 14px 16px;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.phone-input-group input::placeholder {
    color: #94a3b8;
}

/* Registration Phone Input - Flexible country code sizing */
.register-phone-group {
    display: flex;
    align-items: stretch;
}

.register-phone-group .register-country-select {
    flex: 0 0 auto;
    width: auto;
    min-width: 80px;
    max-width: 200px;
    padding: 12px 12px 12px 12px;
    padding-right: 28px; /* Space for dropdown arrow */
    border: none;
    background: #f1f5f9;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    font-size: 0.9rem;
    border-right: 1px solid #e2e8f0;
    /* Allow text to determine width */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.register-phone-group .register-country-select:focus {
    outline: none;
    background-color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23475569' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
}

.register-phone-group input {
    flex: 1;
    min-width: 120px;
}

/* Unified Input - Email/Phone with Dynamic Country Code */
.unified-input-wrapper {
    display: flex;
    align-items: stretch;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fff;
}

.unified-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.unified-country-select {
    padding: 14px 8px 14px 12px;
    border: none;
    background: #f8fafc;
    font-size: 0.95rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    min-width: 90px;
    max-width: 100px;
    border-right: 1px solid #e2e8f0;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23475569' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 20px;
    transition: all 0.2s ease;
}

.unified-country-select:focus {
    outline: none;
    background-color: #f1f5f9;
}

.unified-input {
    flex: 1;
    border: none !important;
    padding: 14px 16px !important;
    font-size: 1rem !important;
    outline: none;
    background: transparent !important;
    min-width: 0;
    border-radius: 0 !important;
    box-shadow: none !important;
    width: auto !important;
}

.unified-input::placeholder {
    color: #94a3b8;
}

.unified-input:focus {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

/* Override form-group input styles for unified inputs */
.form-group .unified-input-wrapper input.unified-input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.form-group .unified-input-wrapper input.unified-input:focus {
    border: none !important;
    box-shadow: none !important;
}

/* Smooth transition when country select appears/disappears */
.unified-input-wrapper.phone-mode .unified-input {
    padding-left: 12px;
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.auth-divider span {
    padding: 0 16px;
    color: #94a3b8;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Social Login Options */
.social-login-options {
    display: flex;
    gap: 12px;
}

.btn-social {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-social:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.btn-google svg {
    flex-shrink: 0;
}

/* Session Popup Styles */
.session-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.session-popup {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

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

.session-popup-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 2rem;
    color: var(--primary-color);
}

.session-popup-icon.warning {
    color: #f59e0b;
}

.session-popup-icon.warning i {
    font-size: 3rem;
}

.session-popup h3 {
    margin: 0 0 12px 0;
    color: #1e293b;
    font-size: 1.25rem;
}

.session-popup p {
    margin: 0 0 24px 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.session-popup .btn {
    min-width: 140px;
}

.session-popup-overlay.session-expired .session-popup {
    border-top: 4px solid #f59e0b;
}

/* Secure Login Badge */
.secure-login-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border: 1px solid #10b981;
    border-radius: 8px;
    color: #047857;
    font-size: 12px;
    font-weight: 600;
}

.secure-login-badge i {
    font-size: 14px;
    color: #059669;
}

/* ============================================
   USER PORTAL - Enterprise Vertical Layout
   ============================================ */

.user-portal-layout {
    min-height: 100vh;
    background: #f0f4f8;
}

/* User Sidebar - Clean White Theme */
.user-sidebar {
    background: #ffffff;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 280px;
    z-index: 1000;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
    border-right: 1px solid #e2e8f0;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 24px;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.sidebar-brand i {
    font-size: 1.6rem;
    color: #0ea5e9;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 24px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.user-info .user-name {
    font-weight: 600;
    font-size: 15px;
    color: #1e293b;
}

.user-info .user-dept {
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 10px;
    color: #64748b;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
}

.sidebar-nav .nav-item i {
    width: 22px;
    font-size: 16px;
    text-align: center;
    color: #94a3b8;
}

.sidebar-nav .nav-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.sidebar-nav .nav-item:hover i {
    color: #0ea5e9;
}

.sidebar-nav .nav-item.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

.sidebar-nav .nav-item.active i {
    color: white;
}

.nav-badge {
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px 12px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    color: #dc2626;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
}

/* Mobile Header (hidden on desktop) */
.user-mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #ffffff;
    z-index: 999;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid #e2e8f0;
}

.mobile-menu-btn {
    width: 44px;
    height: 44px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
    background: #e2e8f0;
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1e293b;
    font-weight: 600;
    font-size: 16px;
}

.mobile-brand i {
    color: #0ea5e9;
}

.mobile-user {
    color: #64748b;
    font-size: 13px;
}

/* User Main Content */
.user-main {
    margin-left: 280px;
    padding: 32px 40px;
    min-height: 100vh;
    background: #f0f4f8;
    overflow-x: hidden;
}

/* User Tabs */
.user-tab {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
}

.user-tab.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* Tab Header */
.tab-header {
    margin-bottom: 32px;
}

.tab-title h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
    line-height: 1.3;
}

.tab-title p {
    color: #64748b;
    font-size: 15px;
    margin: 0;
}

/* Content Sections */
.content-section {
    background: white;
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
}

.content-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f1f5f9;
}

.content-section .section-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    white-space: nowrap;
}

/* Dashboard Stats in User Portal */
#user-portal .dashboard-stats,
#tab-dashboard .dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 28px;
}

#user-portal .stat-card,
#tab-dashboard .stat-card {
    background: white;
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.2s ease;
}

#user-portal .stat-card:hover,
#tab-dashboard .stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

#user-portal .stat-icon,
#tab-dashboard .stat-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#user-portal .stat-icon i,
#tab-dashboard .stat-icon i {
    font-size: 1.4rem;
    color: #0284c7;
}

#user-portal .stat-info,
#tab-dashboard .stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

#user-portal .stat-value,
#tab-dashboard .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

#user-portal .stat-label,
#tab-dashboard .stat-label {
    font-size: 0.85rem;
    color: #64748b;
}

/* Profile Page - Account Overview Card */
#tab-profile .account-overview-card {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 50%, #06b6d4 100%);
    border-radius: 20px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 28px;
    margin-bottom: 24px;
    box-shadow: 0 10px 40px rgba(14, 165, 233, 0.25);
    position: relative;
    overflow: hidden;
}

#tab-profile .account-overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(30%, -30%);
}

#tab-profile .account-avatar {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

#tab-profile .account-avatar i {
    font-size: 36px;
    color: white;
}

#tab-profile .account-details {
    flex: 1;
    color: white;
    position: relative;
    z-index: 1;
}

#tab-profile .account-details h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
}

#tab-profile .account-email {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

#tab-profile .account-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

#tab-profile .account-meta span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
}

#tab-profile .account-meta i {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

#tab-profile .account-stats {
    display: flex;
    gap: 24px;
    position: relative;
    z-index: 1;
}

#tab-profile .account-stat {
    text-align: center;
    background: rgba(255, 255, 255, 0.12);
    padding: 16px 24px;
    border-radius: 14px;
    backdrop-filter: blur(10px);
}

#tab-profile .account-stat .stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

#tab-profile .account-stat .stat-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Profile Settings Card */
#tab-profile .profile-settings-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

#tab-profile .profile-settings-tabs {
    display: flex;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0;
}

#tab-profile .profile-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 18px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: #64748b;
    transition: all 0.2s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

#tab-profile .profile-tab-btn:hover {
    color: #0284c7;
    background: rgba(14, 165, 233, 0.04);
}

#tab-profile .profile-tab-btn.active {
    color: #0284c7;
    background: white;
    border-bottom-color: #0ea5e9;
}

#tab-profile .profile-tab-btn i {
    font-size: 16px;
}

#tab-profile .profile-settings-content {
    display: none;
    padding: 32px;
}

#tab-profile .profile-settings-content.active {
    display: block;
}

#tab-profile .settings-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

#tab-profile .settings-desc {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 28px;
}

#tab-profile .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

#tab-profile .form-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.8rem;
    color: #94a3b8;
}

.optional-label {
    font-size: 0.85rem;
    font-weight: 400;
    color: #94a3b8;
}

#tab-profile .form-actions {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}

/* Department Settings */
#tab-profile .current-departments-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
    border: 1px solid #e2e8f0;
}

#tab-profile .current-departments-box label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#tab-profile .department-change-section {
    margin-top: 24px;
}

#tab-profile .department-change-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
}

#tab-profile .additional-dept-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#tab-profile .additional-dept-section h4 i {
    color: #3b82f6;
}

#tab-profile .section-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 28px 0;
}

#tab-profile .dept-request-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 0.875rem;
    color: #1e40af;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

#tab-profile .dept-request-note i {
    color: #3b82f6;
    margin-top: 2px;
}

#tab-profile .pending-request {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
}

#tab-profile .pending-request-info {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #92400e;
}

#tab-profile .pending-request-info i {
    font-size: 20px;
    color: #f59e0b;
}

#tab-profile .pending-request-info strong {
    display: block;
    margin-bottom: 2px;
}

#tab-profile .pending-request-info p {
    font-size: 0.85rem;
    margin: 0;
}

/* Department Change Warning Box */
#tab-profile .dept-change-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

#tab-profile .dept-change-warning > i {
    font-size: 24px;
    color: #d97706;
    margin-top: 2px;
    flex-shrink: 0;
}

#tab-profile .dept-change-warning strong {
    display: block;
    color: #92400e;
    font-size: 1rem;
    margin-bottom: 8px;
}

#tab-profile .dept-change-warning p {
    color: #78350f;
    font-size: 0.9rem;
    margin: 0 0 12px 0;
}

#tab-profile .dept-change-warning ul {
    margin: 0;
    padding-left: 20px;
    color: #78350f;
    font-size: 0.85rem;
}

#tab-profile .dept-change-warning li {
    margin-bottom: 6px;
}

#tab-profile .dept-change-warning li:last-child {
    margin-bottom: 0;
}

/* Compact warning for progressive disclosure */
#tab-profile .dept-change-warning.compact {
    padding: 12px 16px;
    margin-bottom: 16px;
    align-items: center;
    gap: 12px;
}

#tab-profile .dept-change-warning.compact > i {
    font-size: 18px;
    margin-top: 0;
}

#tab-profile .dept-change-warning.compact span {
    color: #78350f;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Progressive Disclosure: Trigger link */
#tab-profile .dept-change-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
}

#tab-profile .dept-change-trigger span {
    color: #64748b;
    font-size: 0.9rem;
}

#tab-profile .dept-change-trigger a {
    color: #0066cc;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
}

#tab-profile .dept-change-trigger a:hover {
    text-decoration: underline;
}

/* Progressive Disclosure: Dropdown section */
#tab-profile .dept-change-dropdown {
    margin-bottom: 16px;
}

/* Progressive Disclosure: Confirmation section */
#tab-profile .dept-change-confirmation {
    animation: slideDown 0.2s ease-out;
}

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

/* Department change action buttons */
#tab-profile .dept-change-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

#tab-profile .dept-change-actions .btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Compact "Department Change Used" style */
#tab-profile .dept-change-used-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
}

#tab-profile .dept-change-used-compact span {
    color: #64748b;
    font-size: 0.9rem;
}

#tab-profile .dept-change-used-compact a {
    color: #0066cc;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.9rem;
}

#tab-profile .dept-change-used-compact a:hover {
    text-decoration: underline;
}

/* Department Change Locked Box */
#tab-profile .dept-change-locked {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

#tab-profile .dept-change-locked > i {
    font-size: 24px;
    color: #64748b;
    margin-top: 2px;
    flex-shrink: 0;
}

#tab-profile .dept-change-locked strong {
    display: block;
    color: #334155;
    font-size: 1rem;
    margin-bottom: 8px;
}

#tab-profile .dept-change-locked p {
    color: #475569;
    font-size: 0.9rem;
    margin: 0 0 12px 0;
}

#tab-profile .dept-change-locked ul {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    font-size: 0.85rem;
}

#tab-profile .dept-change-locked li {
    margin-bottom: 6px;
}

#tab-profile .dept-change-locked li:last-child {
    margin-bottom: 0;
}

/* Checkbox label styling */
#tab-profile .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.5;
}

#tab-profile .checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: #f59e0b;
}

/* Warning button style */
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* Security Settings */
#tab-profile .security-info-box {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 28px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

#tab-profile .security-info-box i {
    font-size: 22px;
    color: #059669;
    margin-top: 2px;
}

#tab-profile .security-info-box strong {
    display: block;
    color: #065f46;
    margin-bottom: 4px;
}

#tab-profile .security-info-box p {
    font-size: 0.875rem;
    color: #047857;
    margin: 0;
}

/* Livechat in User Portal */
#tab-livechat .livechat-container {
    height: calc(100vh - 280px);
    min-height: 450px;
}

/* Payments in User Portal */
#tab-payments .payments-table-container {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

#tab-payments .payments-table {
    margin: 0;
    border-radius: 0;
}

/* Filters Bar in User Portal */
#tab-browse .filters-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

#tab-browse .filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

#tab-browse .filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: #64748b;
}

#tab-browse .filter-group select {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 14px;
    color: #1e293b;
}

/* Quick Actions in User Portal */
#tab-dashboard .quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

#tab-dashboard .action-card {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#tab-dashboard .action-card:hover {
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border-color: #67e8f9;
    transform: translateY(-2px);
}

#tab-dashboard .action-card i {
    font-size: 24px;
    color: #0ea5e9;
}

#tab-dashboard .action-card span {
    font-size: 14px;
    font-weight: 500;
    color: #334155;
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    #user-portal .dashboard-stats,
    #tab-dashboard .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    #tab-dashboard .quick-actions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {

    .user-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .user-sidebar.active {
        transform: translateX(0);
    }

    .user-mobile-header {
        display: flex;
    }

    .user-main {
        margin-left: 0;
        padding: 80px 16px 24px;
    }

    #user-portal .dashboard-stats,
    #tab-dashboard .dashboard-stats {
        grid-template-columns: 1fr;
    }

    #tab-dashboard .quick-actions {
        grid-template-columns: 1fr;
    }

    /* Profile Page Responsive */
    #tab-profile .account-overview-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    #tab-profile .account-details {
        text-align: center;
    }

    #tab-profile .account-meta {
        justify-content: center;
    }

    #tab-profile .profile-tab-btn span {
        display: none;
    }

    #tab-profile .profile-tab-btn {
        padding: 16px;
    }

    #tab-profile .profile-tab-btn i {
        font-size: 18px;
    }

    #tab-profile .profile-settings-content {
        padding: 20px;
    }

    #tab-profile .form-row {
        grid-template-columns: 1fr;
    }

    .tab-title h1 {
        font-size: 1.4rem;
    }

    .content-section {
        padding: 20px;
        border-radius: 12px;
    }

    .content-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .content-section .section-header h2 {
        white-space: normal;
    }

    #tab-livechat .livechat-container {
        height: calc(100vh - 220px);
    }

    /* Filters bar responsive */
    .filters-bar {
        flex-direction: column;
        gap: 12px;
    }

    .filter-group {
        width: 100%;
    }
}

/* Sidebar overlay for mobile */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* Dashboard (Legacy - keeping for compatibility) */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.dashboard-header {
    margin-bottom: 32px;
}

.dashboard-header h1 {
    margin-bottom: 8px;
}

.dashboard-header p {
    color: var(--text-secondary);
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card .stat-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.dashboard-section {
    margin-bottom: 40px;
}

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

.section-header h2 {
    font-size: 1.25rem;
}

.section-header .badge {
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Books Grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.book-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.book-cover {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.book-cover.deck {
    background: linear-gradient(135deg, var(--deck-color), #0099ff);
}

.book-cover.engine {
    background: linear-gradient(135deg, var(--engine-color), #ff6b6b);
}

.book-cover.eto {
    background: linear-gradient(135deg, var(--eto-color), #a78bfa);
}

.book-cover i {
    font-size: 3rem;
    color: white;
    opacity: 0.5;
}

.book-dept-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.book-info {
    padding: 20px;
}

.book-info h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.book-info p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.book-price {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.book-chapters {
    font-size: 13px;
    color: var(--text-muted);
}

.book-meta {
    flex-wrap: wrap;
    gap: 8px;
}

.book-actions {
    margin-top: 12px;
}

/* Acquisition Tags */
.acquisition-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.acquisition-tag.purchased {
    background: #dbeafe;
    color: #1d4ed8;
}

.acquisition-tag.free-grant {
    background: #d1fae5;
    color: #059669;
}

.acquisition-tag.bundle {
    background: #fef3c7;
    color: #d97706;
}

.acquisition-tag.all-access {
    background: #ede9fe;
    color: #7c3aed;
}

/* Bundles Grid */
.bundles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 16px;
}

.bundle-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid;
    transition: var(--transition);
    position: relative;
    overflow: visible;
}

.bundle-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.bundle-card.deck { border-color: var(--deck-color); }
.bundle-card.engine { border-color: var(--engine-color); }
.bundle-card.eto { border-color: var(--eto-color); }

.bundle-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.bundle-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bundle-card.deck .bundle-icon {
    background: rgba(0, 102, 204, 0.1);
    color: var(--deck-color);
}

.bundle-card.engine .bundle-icon {
    background: rgba(220, 38, 38, 0.1);
    color: var(--engine-color);
}

.bundle-card.eto .bundle-icon {
    background: rgba(124, 58, 237, 0.1);
    color: var(--eto-color);
}

/* All Access Bundle Card */
.bundle-card.all-access {
    border-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    position: relative;
}

.bundle-card.all-access.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

.bundle-card.all-access .bundle-header {
    margin-bottom: 0;
}

.bundle-card.all-access .bundle-details {
    margin-bottom: 0;
}

.bundle-card.all-access .bundle-details p {
    margin-bottom: 12px;
}

.bundle-card.all-access .btn {
    white-space: nowrap;
}

.bundle-badge {
    position: absolute;
    top: -10px;
    right: 20px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

/* Savings Badge */
.bundle-savings-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
    z-index: 5;
}

.bundle-savings-badge i {
    font-size: 10px;
}

.bundle-savings-badge.all-access {
    background: linear-gradient(135deg, #10b981, #059669);
    top: 40px;
}

.all-access-icon {
    background: linear-gradient(135deg, #fbbf24, #f59e0b) !important;
    color: white !important;
    font-size: 1.2rem;
}

.btn-gold {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    border: none;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #d97706, #b45309) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}

.bundle-header h3 {
    font-size: 1.1rem;
}

.bundle-details {
    margin-bottom: 20px;
}

.bundle-details p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.bundle-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.bundle-original {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 14px;
    margin-left: 8px;
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.action-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.action-card:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.action-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.action-card span {
    display: block;
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 24px;
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state h3 {
    margin-bottom: 12px;
    color: var(--text-secondary);
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

/* Filters Bar */
.filters-bar {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    padding: 16px 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--bg-primary);
}

/* Profile Page */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
}

.profile-card {
    background: var(--bg-primary);
    padding: 32px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.profile-card h3 {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

/* Department Badges */
.department-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.dept-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.dept-badge.deck {
    background: linear-gradient(135deg, #e6f0ff, #cce0ff);
    color: #0066cc;
    border: 1px solid #99c2ff;
}

.dept-badge.engine {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.dept-badge.eto {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.dept-badge i {
    font-size: 12px;
}

/* User departments display in browse */
.user-departments-display {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-departments-display .dept-badge {
    padding: 6px 12px;
    font-size: 12px;
}

/* Current departments in profile */
.current-departments {
    margin-bottom: 1.5rem;
}

.current-departments label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 14px;
}

/* Additional department request section */
.additional-dept-section {
    margin-top: 1.5rem;
}

.additional-dept-section h4 {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.additional-dept-section h4 i {
    color: var(--primary-color);
}

.section-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

.dept-request-note {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 13px;
    color: #0369a1;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.dept-request-note i {
    margin-right: 6px;
}

.dept-request-note strong {
    display: block;
    margin-top: 8px;
}

.pending-request {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 1rem;
}

.pending-request-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pending-request-info > i {
    font-size: 24px;
    color: #d97706;
    margin-top: 2px;
}

.pending-request-info strong {
    display: block;
    color: #92400e;
    margin-bottom: 4px;
}

.pending-request-info p {
    color: #a16207;
    font-size: 13px;
    margin: 0;
}

/* Payments Table */
.payments-table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.payments-table {
    width: 100%;
    border-collapse: collapse;
}

.payments-table th,
.payments-table td {
    padding: 16px 24px;
    text-align: left;
}

.payments-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.payments-table td {
    border-bottom: 1px solid var(--border-color);
}

.payments-table tr:last-child td {
    border-bottom: none;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

/* Type badges for payment history */
.type-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.type-badge.purchase {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.type-badge.free {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.type-badge.bundle {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

/* Reader Page */
.reader-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    background: var(--bg-primary);
}

.reader-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--bg-dark);
    color: white;
}

.reader-header h2 {
    font-size: 1.25rem;
}

.reader-nav {
    display: flex;
    align-items: center;
    gap: 16px;
}

.reader-nav .btn-icon {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
}

.reader-nav .btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.reader-sidebar {
    padding: 24px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.reader-sidebar h3 {
    margin-bottom: 16px;
    font-size: 1rem;
}

.chapter-list {
    list-style: none;
}

.chapter-list li {
    margin-bottom: 4px;
}

.chapter-list a {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.chapter-list a:hover,
.chapter-list a.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.reader-content {
    padding: 48px;
    overflow-y: auto;
}

.chapter-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.8;
}

.chapter-content h1,
.chapter-content h2,
.chapter-content h3 {
    margin: 32px 0 16px;
}

.chapter-content p {
    margin-bottom: 16px;
}

.chapter-content ul,
.chapter-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.chapter-content li {
    margin-bottom: 8px;
}

/* ============================================
   ENHANCED BOOK READER - Page Navigation
   ============================================ */

/* Reader Container - New Layout */
.reader-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8fafc;
}

.reader-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Reader Header */
.reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e293b, #334155);
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.reader-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 16px;
}

.reader-header .btn-back {
    background: rgba(255,255,255,0.1);
    border-color: transparent;
    color: white;
}

.reader-header .btn-back:hover {
    background: rgba(255,255,255,0.2);
}

.reader-header #toggleSidebar {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    display: none;
}

/* Sidebar */
.reader-sidebar {
    width: 280px;
    background: white;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h3 i {
    color: #6366f1;
}

.sidebar-header .btn-icon {
    display: none;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Jump to Page */
.jump-to-page {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.jump-to-page label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 8px;
}

.jump-input-group {
    display: flex;
    gap: 8px;
}

.jump-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
}

.jump-input-group input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.jump-input-group .btn {
    padding: 8px 16px;
}

/* Page List */
.page-list-container {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.page-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.page-list li {
    margin-bottom: 2px;
}

.page-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.page-list a:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.page-list a.active {
    background: #eef2ff;
    color: #6366f1;
    font-weight: 500;
}

.page-list .page-num {
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
}

.page-list a.active .page-num {
    background: #6366f1;
    color: white;
}

.page-list .page-preview {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Reader Main Content */
.reader-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
}

.reader-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.page-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 48px;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    min-height: 500px;
    font-size: 16px;
    line-height: 1.9;
    color: #1e293b;
}

.page-content h1,
.page-content h2,
.page-content h3 {
    margin: 28px 0 16px;
    color: #0f172a;
}

.page-content h1 { font-size: 1.75rem; }
.page-content h2 { font-size: 1.5rem; }
.page-content h3 { font-size: 1.25rem; }

.page-content p {
    margin-bottom: 16px;
}

.page-content ul,
.page-content ol {
    margin-bottom: 16px;
    padding-left: 28px;
}

.page-content li {
    margin-bottom: 8px;
}

.page-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* Reader Footer - Page Navigation */
.reader-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: white;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    bottom: 0;
}

/* Legacy Chapter Navigation */
.legacy-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px 32px;
    background: white;
    border-top: 1px solid #e2e8f0;
    position: sticky;
    bottom: 0;
}

.legacy-nav .btn-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.legacy-nav .btn-icon:hover:not(:disabled) {
    background: #6366f1;
    border-color: #6366f1;
    color: white;
}

.legacy-nav .btn-icon:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#chapterIndicator {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    min-width: 150px;
    text-align: center;
}

.btn-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-nav:hover:not(:disabled) {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-nav i {
    font-size: 12px;
}

.page-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #64748b;
}

.page-indicator strong {
    color: #1e293b;
    font-weight: 600;
}

.page-separator {
    color: #94a3b8;
}

/* Hide Mobile Elements on Desktop */
.hide-mobile {
    display: inline;
}

/* Responsive Reader */
@media (max-width: 992px) {
    .reader-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .reader-sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.15);
    }

    .reader-header #toggleSidebar {
        display: flex;
    }

    .sidebar-header .btn-icon {
        display: flex;
    }

    .reader-content {
        padding: 20px;
    }

    .page-content {
        padding: 24px;
    }

    .reader-footer {
        padding: 12px 20px;
    }
}

@media (max-width: 576px) {
    .reader-header h2 {
        font-size: 0.95rem;
    }

    .hide-mobile {
        display: none;
    }

    .btn-nav span {
        display: none;
    }

    .btn-nav {
        padding: 10px 14px;
    }

    .page-content {
        padding: 20px;
        font-size: 15px;
    }
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-large {
    max-width: 720px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

/* Payment Modal */
.payment-summary {
    text-align: center;
    padding: 24px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: 24px;
}

.payment-summary h3 {
    margin-bottom: 8px;
}

.payment-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.payment-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
}

.payment-note i {
    margin-right: 6px;
    color: var(--success-color);
}

/* Admin Dashboard */
.admin-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--bg-dark);
    padding: 24px;
    color: white;
}

.admin-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
}

.admin-nav-item:hover,
.admin-nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.admin-nav-item i {
    width: 20px;
    text-align: center;
}

.admin-main {
    padding: 32px;
    overflow-y: auto;
}

.admin-tab {
    display: none;
}

.admin-tab.active {
    display: block;
}

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

.admin-header h1 {
    font-size: 1.75rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.admin-stat-card {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-stat-icon {
    width: 56px;
    height: 56px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-stat-icon i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.admin-stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
}

.admin-stat-label {
    font-size: 14px;
    color: var(--text-muted);
}

.admin-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.admin-section h2 {
    margin-bottom: 20px;
    font-size: 1.25rem;
}

/* Admin Tables */
.admin-table-container {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 16px 20px;
    text-align: left;
}

.admin-table th {
    background: var(--bg-secondary);
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.admin-table td {
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table .actions {
    display: flex;
    gap: 8px;
}

.admin-table .actions button {
    padding: 6px 12px;
    font-size: 12px;
}

/* Chapters Section in Book Modal */
.chapters-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

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

.chapter-item {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.chapter-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.chapter-item-header span {
    font-weight: 600;
    font-size: 14px;
}

.chapter-item-header button {
    color: var(--danger-color);
    background: none;
    border: none;
    cursor: pointer;
}

.chapter-item .form-group {
    margin-bottom: 12px;
}

.chapter-item textarea {
    min-height: 100px;
}

/* Activity List */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.user {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.activity-icon.purchase {
    background: rgba(0, 102, 204, 0.1);
    color: var(--primary-color);
}

.activity-info {
    flex: 1;
}

.activity-info p {
    margin-bottom: 4px;
}

.activity-info small {
    color: var(--text-muted);
    font-size: 12px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-dark);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 3000;
}

.toast.active {
    transform: translateY(0);
    opacity: 1;
}

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

.toast.error {
    background: var(--danger-color);
}

/* Init Screen - Shown during auth check */
.init-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #1a365d 0%, #0066cc 50%, #00b4d8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.init-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.init-content {
    text-align: center;
    color: white;
}

.init-logo {
    font-size: 64px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.init-content h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.init-content p {
    font-size: 14px;
    opacity: 0.9;
    margin-top: 20px;
}

.init-loader {
    display: flex;
    justify-content: center;
}

.loader-wave {
    display: flex;
    gap: 6px;
}

.loader-wave span {
    width: 8px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
    animation: wave 1.2s ease-in-out infinite;
}

.loader-wave span:nth-child(1) { animation-delay: 0s; }
.loader-wave span:nth-child(2) { animation-delay: 0.1s; }
.loader-wave span:nth-child(3) { animation-delay: 0.2s; }
.loader-wave span:nth-child(4) { animation-delay: 0.3s; }
.loader-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% {
        transform: scaleY(0.5);
        opacity: 0.5;
    }
    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 4000;
}

.loading-overlay.active {
    display: flex;
}

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

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

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-image {
        order: -1;
    }

    .hero-stats {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .departments-grid .department-card {
        flex: 0 1 100%;
        max-width: 100%;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .pricing-card.featured {
        transform: none;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .bundles-grid {
        grid-template-columns: 1fr;
    }

    .bundle-card.all-access.featured {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .bundle-card.all-access .bundle-header {
        flex-direction: column;
        margin-bottom: 16px;
    }

    .bundle-card.all-access .bundle-details {
        margin-bottom: 16px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 24px;
        gap: 16px;
        box-shadow: var(--shadow);
        display: none;
    }

    .nav-menu.active {
        display: flex;
    }

    /* Hide desktop nav-buttons, show in mobile menu instead */
    .nav-buttons {
        position: absolute;
        top: 70px;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 16px 24px 24px;
        gap: 12px;
        box-shadow: var(--shadow-lg);
        display: none;
        z-index: 999;
        border-top: 1px solid var(--border-color);
    }

    .nav-buttons.active {
        display: flex;
    }

    .nav-buttons .btn {
        width: 100%;
        justify-content: center;
        padding: 14px 24px;
        font-size: 1rem;
    }

    .nav-buttons .btn-outline {
        order: 1;
    }

    .nav-buttons .btn-primary.guest-only {
        order: 2;
    }

    /* User menu in mobile */
    .nav-buttons .user-menu {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .nav-buttons .user-menu .btn {
        width: 100%;
    }

    .nav-toggle {
        display: block;
    }

    .hero-content h1 {
        font-size: 2rem;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-stats {
        grid-template-columns: 1fr;
    }

    .quick-actions {
        grid-template-columns: 1fr;
    }

    .profile-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        flex-direction: column;
        gap: 12px;
    }

    .reader-container {
        grid-template-columns: 1fr;
    }

    .reader-sidebar {
        display: none;
    }

    .admin-container {
        grid-template-columns: 1fr;
    }

    .admin-sidebar {
        display: none;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .payments-table {
        font-size: 13px;
    }

    .payments-table th,
    .payments-table td {
        padding: 12px;
    }
}

/* Purchased Badge */
.purchased-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--success-color);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Owned Bundle Indicator */
.bundle-owned {
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }

/* ============================================
   SESSION CONFLICT MODAL STYLES
   ============================================ */

.admin-session-modal,
.user-session-modal {
    max-width: 450px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-session-modal .modal-header,
.user-session-modal .modal-header {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 20px 24px;
    border-bottom: none;
}

.admin-session-modal .modal-header h3,
.user-session-modal .modal-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin: 0;
}

.admin-session-modal .modal-header i,
.user-session-modal .modal-header i {
    font-size: 1.2rem;
}

.admin-session-modal .modal-body,
.user-session-modal .modal-body {
    padding: 24px;
    line-height: 1.6;
}

.admin-session-modal .modal-body p,
.user-session-modal .modal-body p {
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.admin-session-modal .modal-body ul,
.user-session-modal .modal-body ul {
    margin: 0;
    padding-left: 20px;
    color: var(--text-secondary);
}

.admin-session-modal .modal-body li,
.user-session-modal .modal-body li {
    margin-bottom: 6px;
}

.admin-session-modal .modal-footer,
.user-session-modal .modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.admin-session-modal .modal-footer .btn,
.user-session-modal .modal-footer .btn {
    padding: 10px 18px;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .admin-session-modal .modal-footer,
    .user-session-modal .modal-footer {
        flex-direction: column;
    }

    .admin-session-modal .modal-footer .btn,
    .user-session-modal .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   UPI PAYMENT STYLES
   ============================================ */

.modal-payment {
    max-width: 500px;
}

/* Payment Tabs */
.payment-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius);
}

.payment-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
}

.payment-tab:hover {
    color: var(--text-primary);
}

.payment-tab.active {
    background: var(--bg-primary);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Payment Sections */
.payment-section {
    display: none;
}

.payment-section.active {
    display: block;
}

/* Razorpay Section */
.razorpay-info {
    text-align: center;
    padding: 32px 24px;
}

.razorpay-logo {
    margin-bottom: 16px;
}

.razorpay-logo img {
    height: 36px;
}

.razorpay-description {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.razorpay-features {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.razorpay-features span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
}

.razorpay-features i {
    color: var(--success-color);
}

#razorpayPayBtn {
    font-size: 16px;
    padding: 14px 28px;
    margin-bottom: 16px;
}

.payment-methods-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* UPI QR Container */
.upi-qr-container {
    text-align: center;
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.qr-code-display {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin-bottom: 16px;
}

.qr-code-display canvas {
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.qr-loading {
    text-align: center;
    color: var(--text-muted);
}

.qr-loading i {
    font-size: 2rem;
    margin-bottom: 12px;
}

.qr-instruction {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.upi-apps {
    display: flex;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

.upi-apps img {
    opacity: 0.8;
}

/* UPI Manual Section */
.upi-manual {
    margin-bottom: 20px;
}

.or-divider {
    text-align: center;
    position: relative;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 13px;
}

.or-divider::before,
.or-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 20px);
    height: 1px;
    background: var(--border-color);
}

.or-divider::before {
    left: 0;
}

.or-divider::after {
    right: 0;
}

.or-divider span {
    background: var(--bg-primary);
    padding: 0 10px;
}

.upi-id-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.upi-id-display span {
    color: var(--text-secondary);
    font-size: 14px;
}

.upi-id-display code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--primary-light);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.btn-copy {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.btn-copy:hover {
    background: var(--primary-light);
}

/* Transaction ID Warning */
.txn-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 12px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius);
    color: #991b1b;
    font-size: 13px;
    line-height: 1.5;
}

.txn-warning i {
    color: #ef4444;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.txn-warning span {
    flex: 1;
}

/* Pending Payment Status */
.pending-notice {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 16px;
    border-radius: var(--radius);
    margin-top: 16px;
    text-align: center;
}

.pending-notice i {
    margin-right: 8px;
}

/* Payment Success Animation */
.payment-success {
    text-align: center;
    padding: 40px;
}

.payment-success i {
    font-size: 4rem;
    color: var(--success-color);
    margin-bottom: 20px;
}

.payment-success h3 {
    margin-bottom: 12px;
    color: var(--text-primary);
}

.payment-success p {
    color: var(--text-secondary);
}

/* ============================================
   IMAGE-BASED PAGE READER (Enterprise PDF)
   ============================================ */

.image-page-reader {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: #f5f5f5;
    min-height: 60vh;
    border-radius: var(--radius);
}

.image-page-reader .page-image-full {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    background: white;
}

/* Dark mode support for image reader */
@media (prefers-color-scheme: dark) {
    .image-page-reader {
        background: #1a1a2e;
    }
}

/* Page images container */
.page-images {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
}

.page-images img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================
   VISUAL FIDELITY OCR STYLES
   Styles for OCR-converted content that matches
   the original scanned document appearance
   ============================================ */

/* OCR Page Container */
.ocr-page {
    border-radius: var(--radius);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 0 auto;
    max-width: 100%;
}

/* OCR Tables */
.ocr-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
    font-size: 14px;
}

.ocr-table th,
.ocr-table td {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    text-align: left;
    vertical-align: top;
}

.ocr-table th {
    background-color: rgba(0, 0, 0, 0.04);
    font-weight: 600;
}

.ocr-table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.ocr-table tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* OCR Lists */
.ocr-page ul,
.ocr-page ol {
    margin: 12px 0;
    padding-left: 32px;
}

.ocr-page li {
    margin: 6px 0;
    line-height: 1.7;
}

.ocr-page ul li {
    list-style-type: disc;
}

.ocr-page ol li {
    list-style-type: decimal;
}

/* OCR Headings */
.ocr-page h2 {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #1a1a1a;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 10px;
}

.ocr-page h3 {
    font-size: 1.2em;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: #2a2a2a;
}

.ocr-page h4 {
    font-size: 1.1em;
    font-weight: 600;
    margin: 16px 0 8px 0;
    color: #3a3a3a;
}

/* OCR Paragraphs */
.ocr-page p {
    margin: 12px 0;
    line-height: 1.8;
    text-align: justify;
    hyphens: auto;
}

/* OCR Error Message */
.ocr-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    color: #991b1b;
}

/* Print-friendly styles for OCR content */
@media print {
    .ocr-page {
        box-shadow: none;
        padding: 0;
    }

    .ocr-table {
        page-break-inside: avoid;
    }

    .ocr-page h2,
    .ocr-page h3 {
        page-break-after: avoid;
    }
}

/* ============================================
   RAW PDF READER STYLES
   ============================================ */

.raw-pdf-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.raw-pdf-viewer {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
    min-height: 500px;
}

.raw-pdf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.raw-pdf-toolbar .pdf-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.raw-pdf-toolbar .pdf-title i {
    color: #ef4444;
    font-size: 18px;
}

.raw-pdf-toolbar .pdf-actions {
    display: flex;
    gap: 8px;
}

.raw-pdf-toolbar .btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.raw-pdf-iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #525659;
}

/* Mobile adjustments for RAW PDF viewer */
@media (max-width: 768px) {
    .raw-pdf-toolbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .raw-pdf-toolbar .pdf-title {
        font-size: 14px;
    }

    .raw-pdf-toolbar .pdf-actions {
        width: 100%;
        justify-content: center;
    }

    .raw-pdf-toolbar .pdf-actions .btn-sm {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .raw-pdf-viewer {
        height: calc(100vh - 160px);
    }
}

/* ============================================
   CUSTOM PDF VIEWER - Single Page with Navigation
   ============================================ */

.custom-pdf-viewer {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 70px);
    background: #1a1a2e;
    position: relative;
}

.pdf-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-bottom: 1px solid #475569;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-toolbar .pdf-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: #fff;
    font-size: 15px;
}

.pdf-toolbar .pdf-title i {
    color: #ef4444;
    font-size: 18px;
}

.pdf-toolbar .pdf-page-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 14px;
}

.pdf-toolbar .pdf-page-info input {
    width: 50px;
    padding: 4px 8px;
    border: 1px solid #475569;
    border-radius: 4px;
    background: #1e293b;
    color: #fff;
    text-align: center;
    font-size: 14px;
}

.pdf-toolbar .pdf-page-info input:focus {
    outline: none;
    border-color: #6366f1;
}

.btn-page-nav {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-page-nav:hover {
    background: rgba(255,255,255,0.2);
}

.pdf-toolbar .pdf-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdf-toolbar .pdf-actions .btn {
    padding: 6px 12px;
    font-size: 13px;
}

.pdf-toolbar #pdfZoomLevel {
    color: #e2e8f0;
    font-size: 13px;
    min-width: 50px;
    text-align: center;
}

.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    background: #2d2d44;
    position: relative;
}

.pdf-canvas-container canvas {
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    background: white;
}

.pdf-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #e2e8f0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Navigation Buttons - Bottom Left and Right */
.pdf-nav-btn {
    position: fixed;
    bottom: 30px;
    padding: 15px 25px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    transition: all 0.3s ease;
    z-index: 100;
}

.pdf-nav-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.pdf-nav-btn:disabled {
    background: #475569;
    cursor: not-allowed;
    box-shadow: none;
}

.pdf-nav-prev {
    left: 30px;
}

.pdf-nav-next {
    right: 30px;
}

.pdf-nav-btn i {
    font-size: 18px;
}

/* Mobile responsive for custom PDF viewer */
@media (max-width: 768px) {
    .pdf-toolbar {
        padding: 10px;
        flex-direction: column;
        align-items: stretch;
    }

    .pdf-toolbar .pdf-title {
        font-size: 13px;
        justify-content: center;
    }

    .pdf-toolbar .pdf-page-info {
        justify-content: center;
    }

    .pdf-toolbar .pdf-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .pdf-nav-btn {
        bottom: 20px;
        padding: 12px 18px;
        font-size: 14px;
    }

    .pdf-nav-btn span {
        display: none;
    }

    .pdf-nav-prev {
        left: 15px;
    }

    .pdf-nav-next {
        right: 15px;
    }

    .pdf-canvas-container {
        padding: 10px;
    }
}

/* PDF Sidebar Styles */
.pdf-body-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.pdf-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
}

.pdf-sidebar.collapsed {
    width: 0;
    border-right: none;
}

.pdf-sidebar.collapsed .pdf-sidebar-header,
.pdf-sidebar.collapsed .pdf-sidebar-content {
    opacity: 0;
    visibility: hidden;
}

.pdf-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid #334155;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: opacity 0.2s ease;
}

.pdf-sidebar-header h4 {
    margin: 0;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
    word-break: break-word;
}

.btn-sidebar-collapse {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-sidebar-collapse:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #e2e8f0;
}

.btn-sidebar-toggle {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-right: 10px;
}

.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pdf-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    transition: opacity 0.2s ease;
}

.pdf-sidebar-info {
    color: #94a3b8;
    font-size: 13px;
    margin: 0;
    text-align: center;
    padding: 20px 10px;
}

.pdf-sidebar-hint {
    color: #64748b;
    font-size: 12px;
    margin: 8px 0 0 0;
    text-align: center;
}

.pdf-sidebar-book-info {
    text-align: center;
    padding: 20px 10px;
}

/* Table of Contents */
.pdf-toc {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pdf-toc li {
    margin: 0;
}

.pdf-toc a {
    display: block;
    padding: 10px 12px;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1.4;
}

.pdf-toc a:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

/* Mobile responsive for PDF sidebar */
@media (max-width: 768px) {
    .pdf-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 1000;
        width: 260px;
        transform: translateX(-100%);
    }

    .pdf-sidebar:not(.collapsed) {
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    }

    .pdf-sidebar.collapsed {
        transform: translateX(-100%);
    }

    .btn-sidebar-toggle {
        display: flex;
    }
}

@media (min-width: 769px) {
    .btn-sidebar-toggle {
        display: flex;
    }
}

/* ============================================
   LIVE CHAT PAGE - USER SIDE
   ============================================ */

/* Nav Chat Badge */
.nav-chat-badge {
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: 6px;
}

/* Live Chat Page Container */
.livechat-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    min-height: 400px;
    overflow: hidden;
}

.livechat-disabled {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 60px 40px;
}

.livechat-disabled .disabled-content {
    text-align: center;
    color: #666;
}

.livechat-disabled .disabled-content i {
    font-size: 64px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.livechat-disabled .disabled-content h3 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 24px;
}

.livechat-disabled .disabled-content p {
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto;
}

.livechat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8fafc;
}

.chat-welcome-screen {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.chat-welcome-screen i {
    font-size: 56px;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.chat-welcome-screen h3 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 22px;
}

.chat-welcome-screen p {
    margin: 0;
    font-size: 15px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-welcome {
    text-align: center;
    padding: 30px 20px;
    color: #666;
}

.chat-welcome i {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.chat-welcome h4 {
    margin: 0 0 8px 0;
    color: #333;
}

.chat-welcome p {
    margin: 0;
    font-size: 14px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-message.user {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-message.admin {
    background: #f0f2f5;
    color: #333;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-message-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
}

.chat-message.user .chat-message-time {
    text-align: right;
}

.chat-input-container {
    display: flex;
    padding: 15px;
    border-top: 1px solid #e9ecef;
    gap: 10px;
}

.chat-input-container input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input-container input:focus {
    border-color: var(--primary-color);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--primary-dark);
}

/* Live Chat Input Area */
.livechat-input-area {
    display: flex;
    padding: 16px 20px;
    border-top: 1px solid #e2e8f0;
    gap: 12px;
    background: white;
}

.livechat-input-area input {
    flex: 1;
    padding: 12px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.livechat-input-area input:focus {
    border-color: var(--primary-color);
}

.livechat-input-area button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Live Chat Messages */
.livechat-message {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
}

.livechat-message.user {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.livechat-message.admin {
    background: white;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.livechat-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 6px;
}

.livechat-message.user .livechat-message-time {
    text-align: right;
}

/* Mobile responsive for live chat page */
@media (max-width: 768px) {
    .livechat-container {
        height: calc(100vh - 200px);
        border-radius: 12px;
    }

    .livechat-message {
        max-width: 85%;
    }

    .livechat-input-area {
        padding: 12px 15px;
    }
}

/* ============================================
   RAW DOCUMENT DOWNLOAD UI (Word files)
   ============================================ */

.raw-document-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

.document-download-container {
    text-align: center;
    padding: 60px 40px;
    max-width: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.document-icon-large {
    width: 120px;
    height: 120px;
    margin: 0 auto 30px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.3);
}

.document-icon-large i {
    font-size: 50px;
    color: white;
}

.document-download-container h2 {
    font-size: 24px;
    color: #1e293b;
    margin-bottom: 10px;
    font-weight: 700;
}

.document-download-container .document-info {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 5px;
    font-weight: 500;
}

.document-download-container .document-size {
    font-size: 14px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.document-download-container .document-description {
    font-size: 15px;
    color: #475569;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-download-doc {
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-download-doc:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
}

.btn-download-doc i {
    font-size: 18px;
}

.document-download-container .document-tip {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 25px;
}

.document-download-container .document-tip i {
    margin-right: 6px;
}

/* Mobile responsive for document download */
@media (max-width: 768px) {
    .document-download-container {
        padding: 40px 25px;
        margin: 20px;
    }

    .document-icon-large {
        width: 100px;
        height: 100px;
    }

    .document-icon-large i {
        font-size: 40px;
    }

    .document-download-container h2 {
        font-size: 20px;
    }
}

/* ============================================
   DOCUMENT READER WITH PAGINATION
   ============================================ */

.html-document-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #1e293b;
    overflow: hidden;
}

.doc-reader-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.doc-reader-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
}

.doc-reader-title {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 16px;
    font-weight: 500;
}

.doc-reader-title i {
    color: #60a5fa;
    font-size: 20px;
}

.doc-reader-title span {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-reader-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-doc-nav {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-doc-nav:hover:not(:disabled) {
    background: rgba(255,255,255,0.2);
}

.btn-doc-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.doc-page-info {
    color: white;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-page-info input {
    width: 50px;
    padding: 6px 8px;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 14px;
    text-align: center;
}

.doc-page-info input:focus {
    outline: none;
    border-color: #60a5fa;
}

.doc-reader-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    padding: 30px 20px;
    background: #334155;
}

.doc-page {
    background: white;
    max-width: 800px;
    width: 100%;
    padding: 50px 60px;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    min-height: 600px;
    line-height: 1.8;
    font-size: 16px;
    color: #1e293b;
}

.doc-page h1 {
    font-size: 28px;
    color: #0f172a;
    margin: 0 0 20px 0;
    font-weight: 700;
    line-height: 1.3;
}

.doc-page h2 {
    font-size: 22px;
    color: #1e293b;
    margin: 30px 0 15px 0;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.doc-page h3 {
    font-size: 18px;
    color: #334155;
    margin: 25px 0 12px 0;
    font-weight: 600;
}

.doc-page h4, .doc-page h5, .doc-page h6 {
    color: #475569;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.doc-page p {
    margin: 0 0 16px 0;
    text-align: justify;
}

.doc-page ul, .doc-page ol {
    margin: 0 0 16px 25px;
    padding: 0;
}

.doc-page li {
    margin-bottom: 8px;
}

.doc-page img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.doc-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.doc-page th, .doc-page td {
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    text-align: left;
}

.doc-page th {
    background: #f1f5f9;
    font-weight: 600;
}

.doc-page blockquote {
    border-left: 4px solid #2563eb;
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8fafc;
    font-style: italic;
    color: #475569;
}

.doc-page a {
    color: #2563eb;
    text-decoration: underline;
}

.doc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px;
    color: white;
}

.doc-loading i {
    font-size: 48px;
    color: #60a5fa;
    margin-bottom: 20px;
}

.doc-loading p {
    font-size: 16px;
    color: #94a3b8;
}

/* Mobile responsive for document reader */
@media (max-width: 768px) {
    .doc-reader-toolbar {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
    }

    .doc-reader-title span {
        max-width: 200px;
        font-size: 14px;
    }

    .doc-reader-content {
        padding: 15px 10px;
    }

    .doc-page {
        padding: 30px 25px;
        font-size: 15px;
        min-height: auto;
    }

    .doc-page h1 {
        font-size: 22px;
    }

    .doc-page h2 {
        font-size: 18px;
    }

    .doc-page h3 {
        font-size: 16px;
    }
}

/* Legacy styles kept for backwards compatibility */
.html-document-wrapper {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.html-document-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.html-document-header h2 {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    min-width: 200px;
}

.html-document-header .document-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    opacity: 0.9;
    font-size: 14px;
}

.html-document-header .document-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.html-document-header .btn-download-original {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.html-document-header .btn-download-original:hover {
    background: rgba(255,255,255,0.3);
}

.html-document-body {
    flex: 1;
    padding: 40px 50px;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 16px;
    color: #333;
}

.html-document-body h1 {
    font-size: 28px;
    color: #1e293b;
    margin: 0 0 20px 0;
    font-weight: 700;
}

.html-document-body h2 {
    font-size: 24px;
    color: #334155;
    margin: 30px 0 15px 0;
    font-weight: 600;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 8px;
}

.html-document-body h3 {
    font-size: 20px;
    color: #475569;
    margin: 25px 0 12px 0;
    font-weight: 600;
}

.html-document-body h4, .html-document-body h5, .html-document-body h6 {
    color: #64748b;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.html-document-body p {
    margin: 0 0 16px 0;
    text-align: justify;
}

.html-document-body ul, .html-document-body ol {
    margin: 0 0 16px 25px;
    padding: 0;
}

.html-document-body li {
    margin-bottom: 8px;
}

.html-document-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.html-document-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.html-document-body th, .html-document-body td {
    border: 1px solid #e2e8f0;
    padding: 10px 15px;
    text-align: left;
}

.html-document-body th {
    background: #f1f5f9;
    font-weight: 600;
}

.html-document-body blockquote {
    border-left: 4px solid #2563eb;
    margin: 20px 0;
    padding: 15px 20px;
    background: #f8fafc;
    font-style: italic;
    color: #475569;
}

.html-document-body a {
    color: #2563eb;
    text-decoration: underline;
}

.html-document-body a:hover {
    color: #1d4ed8;
}

/* Mobile responsive for HTML document reader */
@media (max-width: 768px) {
    .html-document-wrapper {
        border-radius: 0;
        margin: 0;
    }

    .html-document-header {
        padding: 15px 20px;
    }

    .html-document-header h2 {
        font-size: 16px;
    }

    .html-document-body {
        padding: 20px;
        font-size: 15px;
    }

    .html-document-body h1 {
        font-size: 22px;
    }

    .html-document-body h2 {
        font-size: 18px;
    }

    .html-document-body h3 {
        font-size: 16px;
    }
}

/* Admin Away Notice in User Chat */
.admin-away-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    margin-bottom: 16px;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
}

.admin-away-notice i {
    font-size: 18px;
    color: #d97706;
    flex-shrink: 0;
    margin-top: 2px;
}

.admin-away-notice span {
    flex: 1;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .admin-away-notice {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
        border-color: #d97706;
        color: #fef3c7;
    }

    .admin-away-notice i {
        color: #fbbf24;
    }
}

