/* ===========================
   TABLE OF CONTENTS
   ===========================
   1. BASE STYLES
   2. LAYOUT
   3. HEADER
   4. CONTENT & CONTAINERS
   5. FORMS & INPUTS
   6. BUTTONS
   7. TABLES
   8. STATS & CHARTS
   9. MODALS & POPUPS
   10. TABS
   11. BADGES & STATUS
   12. TOAST NOTIFICATIONS
   13. KOC DASHBOARD SPECIFIC
   14. RESPONSIVE DESIGN
   =========================== */

/* ===========================
   1. BASE STYLES
   =========================== */

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

:root {
    /* Heights (defaults; can be overridden in responsive blocks) */
    --h-android: 120px;
    --h-ios-safari: 140px;
    --h-ios-chrome: 170px;
    /* Colors */
    --color-primary: #0066FF;
    --color-primary-dark: #003D82;
    --color-surface: #ffffff;
    --color-text: #333333;
    /* Radii */
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    /* Shadows */
    --shadow-md: 0 8px 24px rgba(0,0,0,0.12);
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
}

html {
    height: 100%;
    min-height: 100%;
    background: var(--gradient-primary);
    background-attachment: fixed;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: var(--gradient-primary);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    padding: 30px 0;
    padding-bottom: calc(30px + env(safe-area-inset-bottom));
    line-height: 1.6;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
}

/* User Dashboard - General Layout */
body:has(#userDashboard.dashboard:not([style*="display: none"])) {
    align-items: flex-start;
    padding: 20px;
}

code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    color: #374151;
    border: 1px solid #e2e8f0;
}

/* ===========================
   2. LAYOUT
   =========================== */

.app-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    height: 90vh;
    display: flex;
    flex-direction: column;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transition: max-width 0.3s ease;
    position: relative;
    z-index: 10;
}

.app-container.wide {
    max-width: 1350px;
}

.app-container.compact {
    max-width: 540px;
    min-height: auto;
    margin: 20px auto;
    height: auto;
    min-height: min-content;
}

.dashboard {
    display: none;
}

.dashboard.active {
    display: block;
}

#adminDashboard.dashboard.active {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.site-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    padding: 12px 0 6px 0;
    background: none; 
    z-index: 100;
}

.copyright {
    color: #ffffff;
    font-size: 13px;
    font-family: 'Roboto', Arial, sans-serif;
    letter-spacing: 0.7px;
    text-shadow:
        0 3px 12px rgba(0, 0, 0, 0.15),
        0 1px 1px #0a2360,
        1px 1px 0 #61a3ff,
        0 0 2px #fff;
}

/* ===========================
   SNOW EFFECT ON LOGO
   =========================== */

.logo-with-snow {
    position: relative;
    display: inline-block;
}

.logo-snow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    /* Mask to show snow only on logo colored areas */
    -webkit-mask-image: var(--logo-mask);
    mask-image: var(--logo-mask);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.snowflake {
    position: absolute;
    top: -10px;
    color: #fff;
    font-size: 1em;
    user-select: none;
    pointer-events: none;
    animation-name: snowfall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    opacity: 0;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.8), 
                 0 0 6px rgba(255, 255, 255, 0.6);
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9));
}

@keyframes snowfall {
    0% {
        opacity: 0;
        transform: translateY(0) translateX(0) rotate(0deg) scale(0.8);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(calc(100% + 20px)) translateX(var(--sway, 0px)) rotate(360deg) scale(1.2);
    }
}

/* Gentle swaying animation */
@keyframes sway {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

/* ===========================
   FULL PAGE SNOW EFFECT
   =========================== */

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

.snow-overlay .snowflake {
    position: absolute;
    color: #fff;
    font-size: 1em;
    user-select: none;
    pointer-events: none;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.9),
                 0 0 10px rgba(255, 255, 255, 0.6),
                 0 0 15px rgba(255, 255, 255, 0.4);
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 1));
}

/* Fullscreen snowfall animation */
@keyframes fullscreen-snowfall {
    0% {
        opacity: 0;
        transform: translateY(-10px) translateX(0) rotate(0deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 0.9;
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) translateX(var(--drift, 0px)) rotate(var(--rotation, 360deg));
    }
}

.snow-overlay .snowflake {
    animation-name: fullscreen-snowfall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* ===========================
   3. HEADER
   =========================== */

.header {
    background: var(--gradient-primary);
    color: #fff;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 18px;
    justify-content: center;
}

.logo {
    height: 65px;
    width: auto;
    filter: brightness(1.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.2) drop-shadow(0 4px 12px rgba(255, 255, 255, 0.3));
}

.header h1 {
    font-size: 2.2em;
    font-weight: 800;
    margin-bottom: 6px;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    opacity: 0.95;
    text-align: center;
    font-size: 1.1em;
}

/* Add separator line */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3) 20%,
            rgba(255, 255, 255, 0.3) 80%,
            transparent);
}

.user-actions {
    display: flex;
    gap: 14px;
    align-items: center;
}

.user-info {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: all 0.3s ease;
    white-space: nowrap;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.35);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 18px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-logout .logout-icon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'%3E%3C/path%3E%3Cpolyline points='16 17 21 12 16 7'%3E%3C/polyline%3E%3Cline x1='21' y1='12' x2='9' y2='12'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    flex-shrink: 0;
    vertical-align: middle;
}

.btn-logout .logout-text {
    display: inline-block;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Hide user info on dashboard */
body:has(#userDashboard:not([style*="display: none"])) .user-info {
    display: none !important;
}

/* ===========================
   CHANGE PASSWORD BUTTON
   =========================== */

.btn-change-password {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.25s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-change-password .change-password-icon {
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eab308' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='M13 12l8-8M16 4l2 2'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    flex-shrink: 0;
    transform: rotate(180deg);
    vertical-align: middle;
}

.btn-change-password .change-password-text {
    display: inline-block;
}

.btn-change-password:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-change-password:active {
    transform: translateY(0);
}

/* Change Password Modal */
#changePasswordModal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    z-index: 10000 !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

#changePasswordModal.show {
    display: block !important;
}

#changePasswordModal .modal-content {
    background: white !important;
    border-radius: 12px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    max-width: 450px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10001 !important;
    margin: 0 !important;
    opacity: 1 !important;
}

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

#changePasswordModal .modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #1f2937;
}

#changePasswordModal .close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: #9ca3af;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

#changePasswordModal .close-btn:hover {
    background: #f3f4f6;
    color: #1f2937;
}

#changePasswordModal .modal-body {
    padding: 24px;
}

#changePasswordModal .form-group {
    margin-bottom: 20px;
}

#changePasswordModal .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

#changePasswordModal .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    box-sizing: border-box;
}

#changePasswordModal .form-group input:focus {
    outline: none;
    border-color: #0066FF;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.1);
}

#changePasswordModal .form-group small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

#changePasswordModal .form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
}

#changePasswordModal .form-actions button {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

#changePasswordModal .btn-secondary {
    background: #f3f4f6;
    color: #374151;
}

#changePasswordModal .btn-secondary:hover {
    background: #e5e7eb;
}

#changePasswordModal .btn-primary {
    background: linear-gradient(135deg, #0066FF, #0052cc);
    color: white;
}

#changePasswordModal .btn-primary:hover {
    background: linear-gradient(135deg, #0052cc, #003d99);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.3);
}

#changePasswordModal .required {
    color: #ef4444;
}

/* Removed fadeIn and slideUp animations - causing modal flicker issues */

/* ===========================
   4. CONTENT & CONTAINERS
   =========================== */

.content {
    flex: 1;
    padding: 45px;
    /* padding-bottom: 100px; */
    overflow-y: auto;
    overflow-x: hidden;
    background: #fafbfc;
    height: 0;
}

#userDashboard~.content,
.dashboard#userDashboard {
    padding: 0;
    background: #fafbfc;
}

.content.compact {
    padding: 20px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding-bottom: calc(20px + env(safe-area-inset-bottom)); /* Add safe area */
}

.login-section {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 40px 50px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Remember Me Checkbox */
.remember-me-group {
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-end;
}

.remember-me-label {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 13px;
    color: #6b7280;
    font-weight: 400;
    user-select: none;
    transition: all 0.2s ease;
    margin: 0;
    opacity: 0.9;
}

.remember-me-label:hover {
    opacity: 1;
    color: #4b5563;
}

.remember-me-checkbox {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #3b82f6;
    margin: 0;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.remember-me-checkbox:hover {
    opacity: 1;
}

.remember-me-text {
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.form-section {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.form-section h3 {
    margin-bottom: 24px;
    color: #1f2937;
    font-size: 1.5em;
    font-weight: 700;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
    flex-shrink: 0;
}

.section-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25em;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 60px 24px;
    color: #6b7280;
    font-style: italic;
}

/* ===========================
   5. FORMS & INPUTS
   =========================== */

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: #fafbfc;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    background: #ffffff;
    border-color: #0066FF;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #9ca3af;
}

.form-group input::-webkit-input-placeholder,
.form-group textarea::-webkit-input-placeholder {
    color: #9ca3af;
}

.form-group input::-moz-placeholder,
.form-group textarea::-moz-placeholder {
    color: #9ca3af;
    opacity: 1;
}

.form-group input:-ms-input-placeholder,
.form-group textarea:-ms-input-placeholder {
    color: #9ca3af;
}

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

.search-input,
.filter-select {
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
}

.search-input:focus,
.filter-select:focus {
    outline: none;
    border-color: #0066FF;
    box-shadow: 0 0 0 3px rgba(0, 102, 255, 0.12);
}

/* ===========================
   6. BUTTONS
   =========================== */

.btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: inline-block;
}

.btn:hover:not(:disabled) {
    box-shadow: 0 8px 25px rgba(0, 102, 255, 0.35);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    margin: 0 4px 8px 0;
    display: inline-block;
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

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

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

.link-btn {
    background: none;
    border: none;
    color: #0066FF;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.link-btn:hover {
    color: #003D82;
}

.secondary-actions {
    margin-top: 20px;
    display: flex;
    gap: 30px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Terms & Policy Link (Login Section) */
.terms-link-wrapper {
    margin-top: 16px;
    text-align: center;
}

.terms-link {
    display: inline-block;
    color: #0066FF;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    cursor: pointer;
}

.terms-link:hover {
    color: #003D82;
    text-decoration: underline;
}

/* Terms Checkbox (Register Modal) */
.terms-checkbox-group {
    margin-top: -8px;
    margin-bottom: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.terms-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #495057;
    cursor: pointer;
    line-height: 1.5;
}

.terms-checkbox {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-link-inline {
    color: #0066FF;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.terms-link-inline:hover {
    color: #003D82;
}

/* Disable register button when checkbox not checked */
#registerBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #9ca3af;
}

.copy-btn {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

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

/* ===========================
   7. TABLES
   =========================== */

.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 16px;
    flex-wrap: wrap;
}

.controls-left {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.controls-right {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

.table-container {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    flex: 1;
    overflow: auto;
    max-height: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #f1f5f9;
}

.data-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 700;
    color: #374151;
    position: sticky;
    top: 0;
    z-index: 10;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid #e2e8f0;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.data-table th.sortable:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.sort-icon {
    margin-left: 6px;
    color: #9ca3af;
    font-size: 12px;
    transition: color 0.2s ease;
}

.data-table th.sort-asc .sort-icon,
.data-table th.sort-desc .sort-icon {
    color: #0066FF;
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #fafbfc 100%);
}

.data-table td:first-child {
    font-weight: 600;
    color: #1f2937;
}

/* KOCs table specific widths */
#kocsTab .data-table {
    table-layout: fixed;
}

#kocsTab .data-table th:nth-child(1) {
    width: 90px;
}

#kocsTab .data-table th:nth-child(2) {
    width: 100px;
}

#kocsTab .data-table th:nth-child(3) {
    width: 200px;
}

#kocsTab .data-table th:nth-child(4) {
    width: 100px;
}

#kocsTab .data-table th:nth-child(5) {
    width: 80px;
}

#kocsTab .data-table th:nth-child(6) {
    width: 60px;
}

#kocsTab .data-table th:nth-child(7) {
    width: 130px;
}

#kocsTab .data-table th:nth-child(8) {
    width: 130px;
}

#kocsTab .data-table th:nth-child(9) {
    width: 110px;
}

#kocsTab .data-table th:nth-child(10) {
    width: 180px;
}

/* ===========================
   8. STATS & CHARTS
   =========================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 12px;
    /* margin-bottom: 24px; */
}

.stats-grid.overview-stats {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    /* margin-bottom: 32px; */
}

/* ============================================
   ✨ ADMIN 4 CARDS - BEAUTIFUL CENTERED LAYOUT
   ============================================ */

.stats-grid.overview-stats .stat-card {
    background: #ffffff;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    /* padding: 32px 24px; */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
}

/* Gradient backgrounds */
.stats-grid.overview-stats .stat-card:nth-child(1) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stats-grid.overview-stats .stat-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stats-grid.overview-stats .stat-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stats-grid.overview-stats .stat-card:nth-child(4) {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Decorative circles */
.stats-grid.overview-stats .stat-card::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    top: -60px;
    right: -60px;
    transition: all 0.5s ease;
}

.stats-grid.overview-stats .stat-card::after {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    bottom: -40px;
    left: -40px;
    transition: all 0.5s ease;
}

/* Icon styling */
.stat-icon-admin {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.95;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    position: relative;
    z-index: 1;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Value styling */
.stats-grid.overview-stats .stat-card .stat-value {
    color: #ffffff;
    font-size: 3.2em;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
    margin-bottom: 8px;
    line-height: 1;
}

/* Label styling */
.stats-grid.overview-stats .stat-card .stat-label {
    color: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
    z-index: 1;
    line-height: 1.4;
    max-width: 90%;
}

/* Hover effects */
.stats-grid.overview-stats .stat-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.stats-grid.overview-stats .stat-card:hover::before {
    width: 220px;
    height: 220px;
    top: -80px;
    right: -80px;
}

.stats-grid.overview-stats .stat-card:hover::after {
    width: 150px;
    height: 150px;
    bottom: -60px;
    left: -60px;
}

.stats-grid.overview-stats .stat-card:hover .stat-icon-admin {
    transform: scale(1.15) translateY(-5px);
}

.stat-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.stat-content {
    flex: 1;
    justify-content: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 8.8em;
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-label {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.95;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.chart-card {
    background: #fff;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.chart-card h3 {
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #1f2937;
    font-weight: 700;
}

.chart-card canvas {
    width: 100% !important;
    height: auto !important;
    max-height: 240px;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-top: 24px;
}

.charts-grid .chart-card {
    height: auto;
    min-height: 280px;
}

.charts-grid .chart-card.full-width {
    grid-column: 1 / -1;
}

.single-chart {
    width: 100%;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: #6b7280;
    font-size: 14px;
}

.detail-row strong {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
}

.top-koc-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 10px;
}

.top-koc-item:last-child {
    margin-bottom: 0;
}

.top-koc-name {
    font-weight: 600;
    color: #1f2937;
}

.top-koc-count {
    background: var(--gradient-primary);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
}

/* ===========================
   9. MODALS & POPUPS
   =========================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.modal.show {
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 32px;
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
    height: auto;
    max-height: auto;
    overflow-y: hidden;
    overflow-x: hidden;
}

.modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e5e7eb;
}

.modal-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5em;
    font-weight: 700;
}

.close {
    background: none;
    border: none;
    font-size: 32px;
    font-weight: bold;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
    padding: 4px;
}

.close:hover {
    color: #374151;
    transform: scale(1.1);
}

/* Pending Requests Popup */
.pending-requests-banner {
    margin-top: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: center;
}

.btn-pending-requests {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 16px 28px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(0, 102, 255, 0.25);
    transition: all 0.3s ease;
}

.btn-pending-requests:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 102, 255, 0.35);
}

.bell-icon {
    font-size: 24px;
    animation: ring 2s ease-in-out infinite;
}

@keyframes ring {

    0%,
    100% {
        transform: rotate(0deg);
    }

    10%,
    30% {
        transform: rotate(-10deg);
    }

    20%,
    40% {
        transform: rotate(10deg);
    }
}

.requests-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.requests-popup-content {
    background-color: #fff;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.3s ease;
}

.requests-popup.show .requests-popup-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.requests-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 2px solid #e5e7eb;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 20px 20px 0 0;
    flex-shrink: 0;
}

.requests-popup-header h2 {
    margin: 0;
    color: #1f2937;
    font-size: 1.5em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.requests-popup-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.request-card {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.2s ease;
}

.request-card:hover {
    border-color: #0066FF;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
    transform: translateY(-2px);
}

.request-card:last-child {
    margin-bottom: 0;
}

.request-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.request-info h4 {
    margin: 0 0 4px 0;
    color: #1f2937;
    font-size: 1.1em;
    font-weight: 700;
}

.request-info p {
    margin: 2px 0;
    color: #6b7280;
    font-size: 14px;
}

.request-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.request-card-body {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.request-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.request-detail label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.request-detail span {
    color: #1f2937;
    font-size: 14px;
    word-break: break-word;
}

.request-detail a {
    color: #0066FF;
    text-decoration: none;
    font-size: 14px;
}

.request-detail a:hover {
    text-decoration: underline;
}

.request-description {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.request-description label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.request-description p {
    margin: 0;
    color: #1f2937;
    font-size: 14px;
    line-height: 1.5;
}

.empty-requests {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-requests-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* ===========================
   10. TABS
   =========================== */

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #f8fafc;
    padding: 8px;
    border-radius: 16px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
    z-index: 50;
    position: sticky;
    top: -45px;
    background: #fafbfc;
    margin: -45px -45px 8px -45px;
    padding: 8px 45px;
}

.tab-btn {
    flex: 1;
    padding: 14px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    color: #64748b;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.tab-btn.active {
    background: #fff;
    color: #0066FF;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.15);
}

.tab-btn .badge-count {
    background: #ef4444;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

#overviewTab.tab-content.active {
    overflow-y: auto;
    overflow-x: hidden;
}

#kocsTab.tab-content.active {
    overflow: hidden;
}

.kocs-main-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.kocs-main-section .section-header {
    flex-shrink: 0;
}

.kocs-main-section .table-controls {
    flex-shrink: 0;
}

.kocs-main-section .table-container {
    flex: 1;
    min-height: 0;
    overflow: auto;
    max-height: 300px;
}

/* ===========================
   11. BADGES & STATUS
   =========================== */

.status-badge {
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.status-active {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-inactive {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-expired {
    background: #a2a2a2;
    color: #000000;
    border: 1px solid #e5e7eb;
}

.badge-count {
    background: #ef4444;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* ===========================
   12. TOAST NOTIFICATIONS
   =========================== */

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: #111827;
    color: #fff;
    padding: 16px 20px;
    border-radius: 12px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 11000;
    font-weight: 500;
    font-size: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 320px;
}

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

.toast.success {
    background: #065f46;
    border-left: 4px solid #10b981;
}

.toast.error {
    background: #7f1d1d;
    border-left: 4px solid #ef4444;
}

/* ===========================
   13. KOC DASHBOARD SPECIFIC
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Pacifico&display=swap');

/* KOC Dashboard Layout */
#userDashboard.dashboard {
    position: relative;
    max-width: 1700px;
    margin: 0 auto;
    padding: 24px;
}

/* User Dashboard - KOC Specific Styling */
body:has(#userDashboard.koc-dashboard:not([style*="display: none"])) .app-container {
    max-width: 1600px;
}

body:has(#userDashboard.koc-dashboard:not([style*="display: none"])) .header {
    background: linear-gradient(135deg, #0066FF 0%, #003D82 100%);
    padding: 24px 40px;
}

body:has(#userDashboard.koc-dashboard:not([style*="display: none"])) .header h1 {
    font-size: 1.8em;
}

body:has(#userDashboard.koc-dashboard:not([style*="display: none"])) .logo {
    height: 50px;
}

body:has(#userDashboard.koc-dashboard:not([style*="display: none"])) .content {
    background: #fafbfc;
    padding: 0;
}

/* Watermark Logo */
/* Base style */
.watermark-logo {
    position: fixed;
    width: 120px;
    height: auto;
    opacity: 0.9;
    z-index: 999;
    transition: all 0.4s ease;
}

#userDashboard .watermark-logo {
    bottom: 80px;
    right: max(12px, calc((100vw - 1700px) / 2 + 30px));
}

#adminDashboard .watermark-logo {
    bottom: 80px;
    right: max(12px, calc((100vw - 1250px) / 2 + 30px));
}

#kocsTab.active~.watermark-logo,
body:has(#kocsTab.active) #adminDashboard .watermark-logo {
    right: max(12px, calc((100vw - 1400px) / 2 + 30px));
}

.watermark-logo:hover {
    opacity: 1;
    transform: scale(1.08);
    filter: drop-shadow(0 4px 12px rgba(0, 102, 255, 0.3));
}

/* ============================================
   🌊 LIQUID GLASS FOOTER
   ============================================ */

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Top Section Layout */
.top-section {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

/* Welcome Banner */
.welcome-banner {
    background: linear-gradient(135deg, #0066FF 0%, #003D82 100%);
    border-radius: 20px;
    padding: 24px;
    color: white;
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.25);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.welcome-content h2 {
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-content h2 span {
    font-family: 'Pacifico', cursive;
    font-weight: 400;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 25%, #FFED4E 50%, #FFA500 75%, #FFD700 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s linear infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    position: relative;
    font-size: 1.1em;
    letter-spacing: 1px;
}

.welcome-content h2 span::before {
    content: '✨';
    position: absolute;
    left: -25px;
    top: -11px;
    animation: sparkle 2.5s ease-in-out infinite;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    filter: none !important;
    font-size: 0.7em;
}

.welcome-content h2 span::after {
    content: ' !';
}

@keyframes shimmer {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.welcome-content p {
    opacity: 0.9;
    font-size: 1.1em;
}

.quick-stat-inline {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 12px 24px;
    display: flex;
    gap: 14px;
    align-items: center;
    align-self: flex-start;
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.quick-stat-inline::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 16px;
    background: linear-gradient(45deg,
            #FFD700,
            #FFA500,
            #FFED4E,
            #FFA500,
            #FFD700);
    background-size: 300% 300%;
    z-index: -1;
    animation: gradientRotate 3s linear infinite;
}

@keyframes gradientRotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.quick-stat-icon {
    font-size: 2.5em;
}

.quick-stat-value {
    font-size: 2.2em;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    text-align: center;
    color: #2155ff;
}

.quick-stat-label {
    font-size: 0.95em;
    opacity: 0.9;
    font-weight: 500;
    text-align: center;
    color: #2155ff;
}

/* Achievement Progress Bar */
.achievement-progress {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px 24px 64px 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.achievement-title {
    font-size: 1em;
    font-weight: 700;
    opacity: 0.95;
}

.achievement-current {
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

.achievement-bar {
    position: relative;
    height: 20px;
    display: grid;
    grid-template-columns: 1fr 2.5fr 4.5fr 4fr;
    gap: 0;
    align-items: center;
}

.progress-segment {
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.progress-segment.segment-1,
.progress-segment.segment-2,
.progress-segment.segment-3,
.progress-segment.segment-infinity {
    flex: none;
}

.progress-segment.segment-infinity {
    background: rgba(255, 255, 255, 0.15);
    border-style: dashed;
    border-width: 2px;
    border-color: rgba(255, 215, 0, 0.5);
}

.segment-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #d97706);
    border-radius: 999px;
    transition: width 0.8s ease-out;
    position: relative;
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
}

.segment-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmerProgress 2s infinite;
}

@keyframes shimmerProgress {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.progress-segment.unlocked {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.3));
    border-color: rgba(251, 191, 36, 0.6);
}

.progress-segment.segment-infinity.unlocked {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(124, 58, 237, 0.25));
    border-style: dashed;
    border-color: rgba(168, 85, 247, 0.5);
}

.progress-segment.segment-infinity.unlocked .segment-fill {
    width: 40% !important;
    background: linear-gradient(90deg, #a855f7, #7c3aed);
}

.progress-segment.unlocked .segment-fill {
    width: 100% !important;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(251, 191, 36, 0.6);
    }

    50% {
        box-shadow: 0 0 25px rgba(251, 191, 36, 0.9);
    }
}

.infinity-symbol {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
    font-size: 1.5em;
    /* color: rgba(255, 215, 0, 0.8); */
    background: linear-gradient(90deg,
            #FFD700 0%,
            #FFA500 25%,
            #FFED4E 50%,
            #FFA500 75%,
            #FFD700 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 2s linear infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.6)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.achievement-milestones {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 20px;
    display: grid;
    grid-template-columns: 1fr 2.5fr 4.5fr 4fr;
    gap: 0;
    align-items: center;
    pointer-events: none;
}

.milestone-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
}

.milestone-container.container-1,
.milestone-container.container-2,
.milestone-container.container-3,
.milestone-container.container-infinity {
    flex: none;
}

.milestone-container.container-infinity {
    justify-content: center;
}

.achievement-milestone {
    position: absolute;
    right: 0;
    transform: translateX(50%) translateY(-30%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    pointer-events: auto;
}

.milestone-container.container-infinity .achievement-milestone {
    position: relative;
    right: auto;
    transform: translateY(-30%);
}

.milestone-badge {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10;
    transition: all 0.3s ease;
    border: 3px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.milestone-badge.bronze {
    border-color: #cd7f32;
}

.milestone-badge.silver {
    border-color: #c0c0c0;
}

.milestone-badge.gold {
    border-color: #ffd700;
}

.milestone-badge.legend {
    border-color: #a855f7;
}

.milestone-badge.bronze.unlocked {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    border-color: #cd7f32;
    box-shadow: 0 0 30px rgba(205, 127, 50, 0.6);
}

.milestone-badge.silver.unlocked {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    border-color: #c0c0c0;
    box-shadow: 0 0 30px rgba(192, 192, 192, 0.6);
}

.milestone-badge.gold.unlocked {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.milestone-badge.legend.unlocked {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    border-color: #a855f7;
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.6);
}

.milestone-badge.locked {
    opacity: 0.5;
    filter: grayscale(1);
}

.milestone-badge.unlocked {
    animation: badgeUnlock 0.6s ease-out;
}

.milestone-badge:hover {
    transform: scale(1.1);
}

@keyframes badgeUnlock {
    0% {
        transform: scale(0.8) rotate(0deg);
    }

    50% {
        transform: scale(1.2) rotate(180deg);
    }

    100% {
        transform: scale(1) rotate(360deg);
    }
}

.badge-icon {
    font-size: 1.8em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.milestone-label {
    position: absolute;
    top: 60px;
    white-space: nowrap;
    font-size: 0.75em;
    font-weight: 600;
    text-align: center;
    opacity: 0.9;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    line-height: 1.3;
}

.milestone-label small {
    font-size: 0.85em;
    opacity: 0.8;
    font-weight: 500;
}

/* Profile Card */
.profile-card-standalone {
    background: white;
    border-radius: 20px;
    padding: 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.profile-watermark {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: auto;
    opacity: 0.19;
    z-index: 0;
    pointer-events: none;
}

.profile-card-standalone::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 20px;
    background: linear-gradient(135deg, #1E88E5, #FFA726, #EF5350, #1E88E5);
    background-size: 200% 200%;
    z-index: -1;
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.profile-header {
    display: flex;
    gap: 12px;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.profile-avatar {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #0066FF, #003D82);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.8em;
    font-weight: 700;
    flex-shrink: 0;
}

.profile-info-header h3 {
    font-size: 1.2em;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.profile-info-header p {
    font-size: 0.9em;
    color: #6b7280;
}

.profile-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Profile Header Actions - Hidden on desktop */
.profile-header-actions {
    display: none;
}

.profile-detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
}

.detail-label {
    font-size: 0.85em;
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    font-weight: 700;
    color: #1f2937;
    font-size: 0.9em;
}

/* Stats Section - 3 Cards */
.stats-section {
    background: white;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 12px;
}

.stats-section .stat-card {
    background: #ffffff;
    min-height: 400px;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stats-section .stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* Card Colors */
.stats-section .stat-card:nth-child(1) {
    border-color: #0066FF;
}

.stats-section .stat-card:nth-child(1)::before {
    background: linear-gradient(90deg, #0066FF, #0D47A1);
}

.stats-section .stat-card:nth-child(1) .stat-icon,
.stats-section .stat-card:nth-child(1) .stat-value,
.stats-section .stat-card:nth-child(1) .stat-header-info h3 {
    color: #0066FF;
}

.stats-section .stat-card:nth-child(2) {
    border-color: #10b981;
}

.stats-section .stat-card:nth-child(2)::before {
    background: linear-gradient(90deg, #10b981, #059669);
}

.stats-section .stat-card:nth-child(2) .stat-icon,
.stats-section .stat-card:nth-child(2) .stat-header-info h3 {
    color: #10b981;
}

.stats-section .stat-card:nth-child(3) {
    border-color: #EF5350;
}

.stats-section .stat-card:nth-child(3)::before {
    background: linear-gradient(90deg, #EF5350, #C62828);
}

.stats-section .stat-card:nth-child(3) .stat-icon,
.stats-section .stat-card:nth-child(3) .stat-header-info h3 {
    color: #EF5350;
}

.stats-section .stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.stats-section .stat-card:nth-child(1):hover {
    border-color: #0066FF;
    box-shadow: 0 12px 32px rgba(0, 102, 255, 0.25);
}

.stats-section .stat-card:nth-child(2):hover {
    border-color: #10b981;
    box-shadow: 0 12px 32px rgba(16, 185, 129, 0.25);
}

.stats-section .stat-card:nth-child(3):hover {
    border-color: #EF5350;
    box-shadow: 0 12px 32px rgba(239, 83, 80, 0.25);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e5e7eb;
}

.stat-icon {
    font-size: 2.5em;
    opacity: 0.9;
    flex-shrink: 0;
}

.stat-header-info {
    flex: 1;
}

.stat-header-info h3 {
    font-size: 1em;
    font-weight: 700;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.stat-header-info p {
    font-size: 0.8em;
    color: #6b7280;
}

.stat-trend {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: #f1f5f9;
    border-radius: 12px;
    width: 100%;
}

.trend-icon {
    font-size: 1.8em;
    font-weight: 700;
}

.trend-value {
    font-size: 1.2em;
    font-weight: 700;
}

.stat-trend.up {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #166534;
}

.stat-trend.up .trend-icon {
    color: #16a34a;
}

.stat-trend.down {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: #991b1b;
}

.stat-trend.down .trend-icon {
    color: #dc2626;
}

.trend-label {
    font-size: 0.75em;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Revenue Grid */
.revenue-grid {
    flex: 1;
    justify-content: center;
    gap: 10px;
    display: flex;
    flex-direction: column;
}

.revenue-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #10b981;
    transition: all 0.2s ease;
}

.revenue-item:hover {
    transform: translateX(4px);
}

.revenue-item.total {
    border-left-color: #0066FF;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.revenue-item.pending {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
}

.revenue-item.paid {
    border-left-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}

.revenue-label {
    font-size: 0.85em;
    color: #374151;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.revenue-icon {
    font-size: 1.3em;
}

.revenue-value {
    font-size: 1.1em;
    font-weight: 800;
    color: #1f2937;
}

.revenue-item.total .revenue-value {
    color: #0066FF;
    font-size: 1.3em;
}

.revenue-item.pending .revenue-value {
    color: #d97706;
}

.revenue-item.paid .revenue-value {
    color: #059669;
}

/* Links Content */
.links-content {
    flex: 1;
    justify-content: center;
    gap: 12px;
    display: flex;
    flex-direction: column;
}

.link-box {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.2s ease;
}

.link-box:hover {
    border-color: #0066FF;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
}

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

.link-type-badge {
    padding: 4px 10px;
    background: linear-gradient(135deg, #EF5350, #C62828);
    color: white;
    border-radius: 6px;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.link-type-badge.short {
    background: linear-gradient(135deg, #EF5350, #C62828);
}

.btn-copy-mini {
    padding: 5px 10px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #374151;
}

.btn-copy-mini:hover {
    background: #e5e7eb;
    transform: translateY(-1px);
}

.link-text {
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.8em;
    color: #1f2937;
    background: #f8fafc;
    padding: 8px 10px;
    border-radius: 6px;
    word-break: break-all;
    border: 1px solid #e5e7eb;
}

.link-tips {
    display: flex;
    padding: 10px 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 10px;
    border: 2px solid #f59e0b;
    gap: 8px;
    align-items: center;
}

.tip-icon {
    font-size: 1.3em;
    flex-shrink: 0;
}

.tip-content {
    font-size: 0.8em;
    color: #78350f;
    line-height: 1.4;
}

.tip-content strong {
    font-weight: 700;
}

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

.action-btn {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: #0066FF;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 102, 255, 0.15);
}

.action-icon {
    font-size: 2.5em;
}

.action-label {
    font-weight: 600;
    color: #1f2937;
    text-align: center;
    font-size: 0.9em;
}

/* Affiliate Links (Admin) */
.user-profile {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.user-profile h3 {
    margin-bottom: 16px;
    color: #1f2937;
    font-size: 1.25em;
    font-weight: 700;
}

.profile-info p {
    margin-bottom: 8px;
    color: #4b5563;
}

.aff-links {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.aff-links h3 {
    margin-bottom: 20px;
    color: #1f2937;
    font-size: 1.25em;
    font-weight: 700;
}

.link-item {
    margin-bottom: 16px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.link-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.link-display {
    background: #fff;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 14px;
    color: #1f2937;
    margin-bottom: 10px;
    word-break: break-all;
}

/* Loading Spinner */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.loading-overlay.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.loading-overlay>div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #0066FF;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: white;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar,
.requests-popup-body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track,
.requests-popup-body::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb,
.requests-popup-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover,
.requests-popup-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Touch optimizations */
* {
    -webkit-tap-highlight-color: rgba(0, 102, 255, 0.1);
}

button,
.btn,
.tab-btn,
.action-btn,
.link-btn {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}


.header.centered .logo-section {
    display: flex;
    align-items: center;
    gap: 18px;
}

.header.centered .user-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
}

/* Safe area insets for notch devices */
@supports (padding: max(0px)) {
    body {
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }

    .header {
        padding-left: max(16px, env(safe-area-inset-left));
        padding-right: max(16px, env(safe-area-inset-right));
    }
}

/* ============================================
   🌊 ULTRA SMOOTH WAVES - VISIBLE & SMOOTH
   ============================================ */

/* Wave Layer 1 - Bottom (Largest & slowest) */
body::before {
    content: '';
    position: fixed;
    bottom: -150px;
    left: -10%;
    width: 120%;
    height: 600px;
    background:
        radial-gradient(ellipse 120% 60% at 50% 100%,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.04) 40%,
            transparent 70%);
    border-radius: 50%;
    animation: wave1Breathe 18s ease-in-out infinite;
    pointer-events: none;
    z-index: 1;
    filter: blur(1px);
    transform-origin: center bottom;
}

/* Wave Layer 2 - Middle */
body::after {
    content: '';
    position: fixed;
    bottom: -120px;
    left: -10%;
    width: 120%;
    height: 500px;
    background:
        radial-gradient(ellipse 110% 55% at 50% 100%,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.05) 40%,
            transparent 70%);
    border-radius: 50%;
    animation: wave2Breathe 14s ease-in-out infinite;
    animation-delay: -2s;
    pointer-events: none;
    z-index: 2;
    filter: blur(0.8px);
    transform-origin: center bottom;
}

/* Wave Layer 3 - Top (Fastest) */
.header::before {
    content: '';
    position: fixed;
    bottom: -100px;
    left: -10%;
    width: 120%;
    height: 400px;
    background:
        radial-gradient(ellipse 100% 50% at 50% 100%,
            rgba(255, 255, 255, 0.12) 0%,
            rgba(255, 255, 255, 0.06) 40%,
            transparent 70%);
    border-radius: 50%;
    animation: wave3Breathe 10s ease-in-out infinite;
    animation-delay: -4s;
    pointer-events: none;
    z-index: 3;
    filter: blur(0.5px);
    transform-origin: center bottom;
}

/* Enhanced twinkling stars */
.header::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle, rgba(255, 255, 255, 0.9) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.7) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.8) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(255, 255, 255, 0.6) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.85) 1px, transparent 1px),
        radial-gradient(circle, rgba(255, 255, 255, 0.75) 1px, transparent 1px);
    background-size:
        200px 200px,
        300px 300px,
        250px 250px,
        180px 180px,
        220px 220px,
        280px 280px;
    background-position:
        0 0,
        40px 60px,
        130px 270px,
        220px 120px,
        80px 340px,
        160px 180px;
    animation: starsFloat 120s linear infinite;
    pointer-events: none;
    z-index: 4;
    opacity: 0.7;
}

/* Wave animations - Smooth breathing effect */
@keyframes wave1Breathe {

    0%,
    100% {
        transform: translateX(0) translateY(0) scaleY(1);
    }

    25% {
        transform: translateX(-3%) translateY(-15px) scaleY(1.08);
    }

    50% {
        transform: translateX(-5%) translateY(-25px) scaleY(1.12);
    }

    75% {
        transform: translateX(-3%) translateY(-15px) scaleY(1.08);
    }
}

@keyframes wave2Breathe {

    0%,
    100% {
        transform: translateX(0) translateY(0) scaleY(1);
    }

    25% {
        transform: translateX(3%) translateY(-12px) scaleY(1.06);
    }

    50% {
        transform: translateX(5%) translateY(-20px) scaleY(1.1);
    }

    75% {
        transform: translateX(3%) translateY(-12px) scaleY(1.06);
    }
}

@keyframes wave3Breathe {

    0%,
    100% {
        transform: translateX(0) translateY(0) scaleY(1);
    }

    25% {
        transform: translateX(-2%) translateY(-8px) scaleY(1.04);
    }

    50% {
        transform: translateX(-4%) translateY(-15px) scaleY(1.08);
    }

    75% {
        transform: translateX(-2%) translateY(-8px) scaleY(1.04);
    }
}

@keyframes starsFloat {
    0% {
        opacity: 0.7;
        background-position:
            0 0,
            40px 60px,
            130px 270px,
            220px 120px,
            80px 340px,
            160px 180px;
    }

    50% {
        opacity: 0.9;
    }

    100% {
        opacity: 0.7;
        background-position:
            200px 200px,
            240px 260px,
            330px 470px,
            420px 320px,
            280px 540px,
            360px 380px;
    }
}

/* ============================================
   SUPPORT MODAL STYLES (DESKTOP)
   ============================================ */

.support-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.support-section {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    transition: all 0.3s ease;
}

.support-section:hover {
    border-color: #0066FF;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
}

.support-icon {
    font-size: 2.5em;
    flex-shrink: 0;
}

.support-icon-img {
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
    display: block;
}

.support-info {
    flex: 1;
}

.support-info h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1.1em;
    font-weight: 700;
}

.support-link {
    display: block;
    color: #0066FF;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 6px;
    transition: color 0.2s ease;
    cursor: pointer;
}

.support-link:hover {
    color: #003D82;
    text-decoration: underline;
}

.support-link[href^="mailto"]::after {
    content: ' 📋';
    font-size: 0.85em;
    opacity: 0.7;
}

.support-link[href^="mailto"]:hover::after {
    opacity: 1;
}

.support-note {
    font-size: 0.85em;
    color: #6b7280;
    margin: 4px 0;
}

.support-address {
    color: #374151;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 8px 0;
}

.support-footer {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: 12px;
    border: 2px solid #f59e0b;
}

.support-footer p {
    margin: 0;
    color: #78350f;
    font-size: 0.9em;
    line-height: 1.5;
}

/* ============================================
   GUIDE MODAL STYLES (DESKTOP)
   ============================================ */

.guide-content {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
    position: relative;
}


.guide-section:hover {
    border-color: #0066FF;
}

.guide-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.guide-section-header:hover {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
}

.guide-section-header:active {
    transform: scale(0.99);
}

.guide-icon {
    font-size: 1.8em;
    flex-shrink: 0;
}

.guide-section-header h3 {
    flex: 1;
    margin: 0;
    color: #1f2937;
    font-size: 1.1em;
    font-weight: 700;
}


.guide-section-body p {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 12px;
}

.guide-step {
    display: flex;
    gap: 16px;
    margin: 20px 0;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #0066FF;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #0066FF, #003D82);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 1em;
    font-weight: 700;
}

.step-content p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95em;
}

.guide-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.guide-table th,
.guide-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.guide-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #374151;
}

.guide-table tr:hover {
    background: #f8fafc;
}

.guide-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: #fef3c7;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    color: #78350f;
    font-size: 0.9em;
}

.guide-tips {
    list-style: none;
    padding: 0;
}

.guide-tips li {
    padding: 12px 16px;
    margin-bottom: 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #10b981;
    color: #374151;
    line-height: 1.5;
}

.guide-tips li strong {
    color: #1f2937;
    display: block;
    margin-bottom: 4px;
}

.faq-item {
    margin-bottom: 20px;
    padding: 16px;
    background: #f8fafc;
    border-radius: 10px;
    border-left: 4px solid #8b5cf6;
}

.faq-item h4 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-weight: 700;
    font-size: 1em;
}

.faq-item p {
    margin: 0;
    color: #6b7280;
    font-size: 0.95em;
}

.resource-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.resource-item:hover {
    border-color: #0066FF;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.1);
    transform: translateY(-2px);
}

.resource-icon {
    font-size: 2em;
    flex-shrink: 0;
}

.resource-info h4 {
    margin: 0 0 4px 0;
    color: #1f2937;
    font-size: 1em;
    font-weight: 700;
}

.resource-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.85em;
}

.guide-content::-webkit-scrollbar {
    width: 6px;
}

.guide-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.guide-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.guide-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ============================================
   VIDEO MODAL - CLEAN & BRIGHT
   ============================================ */

.video-modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.video-container {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    background: #000;
    position: relative;
}

.video-container video {
    width: 100%;
    height: auto;
    display: block;
    background: transparent;
    border: none;
    outline: none;
    filter: none !important;
    opacity: 1 !important;
    z-index: 1;
    position: relative;
}

/* Remove all pseudo-elements that might cover video */
.video-container::before,
.video-container::after,
.video-container video::before,
.video-container video::after,
#templateVideo::before,
#templateVideo::after {
    display: none !important;
    content: none !important;
    background: none !important;
    background-color: transparent !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Ensure video is not affected by hover effects */
.video-container:hover,
.video-container video:hover,
#templateVideo:hover {
    transform: none !important;
    filter: none !important;
    opacity: 1 !important;
}

/* Remove backdrop-filter and blur effects */
#videoTemplateModal {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#videoTemplateModal .modal-content {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Ensure video displays clearly */
#templateVideo {
    background: transparent !important;
    background-color: transparent !important;
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    z-index: 10 !important;
    position: relative !important;
    mix-blend-mode: normal !important;
    -webkit-mix-blend-mode: normal !important;
    object-fit: contain !important;
    width: 100% !important;
    height: auto !important;
    max-height: 400px !important;
    display: block !important;
    pointer-events: auto !important;
}

/* Remove overlay effects from parent containers */
.modal-content::before,
.modal-content::after,
.modal-body::before,
.modal-body::after {
    display: none !important;
    content: none !important;
    background: none !important;
    background-color: transparent !important;
}

/* Video info styling */
.video-info {
    padding: 0 4px;
}

.video-info h4 {
    color: #1f2937;
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-info h4::before {
    content: "🎬";
    font-size: 1.2em;
}

.video-info p {
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 0;
    font-size: 0.95em;
}

/* ============================================
   GUIDE ACCORDION ANIMATIONS
   ============================================ */

.guide-section-body {
    padding: 20px;
    background: white;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.5s ease,
        padding 0.6s ease;
}

.guide-section-body.show {
    max-height: 2000px;
    opacity: 1;
    padding: 20px;
    transition: max-height 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.6s ease,
        padding 0.8s ease;
}

.guide-section-body:not(.show) {
    padding: 0 20px;
}

.guide-section {
    margin-bottom: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.guide-section.active .guide-section-header {
    position: sticky;
    border-color: #0066FF;
    top: 0;
    z-index: 10;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.1);
    transition: all 0.3s ease;
}

.guide-section.active .guide-section-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 102, 255, 0.5) 50%,
            transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guide-section.active .guide-section-header.is-stuck::after {
    opacity: 1;
}

.guide-toggle {
    font-size: 1.2em;
    color: #6b7280;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        color 0.3s ease;
}

.guide-section.active .guide-toggle {
    transform: rotate(180deg);
    color: #0066FF;
}

/* ============================================
   BRAND LOADING SCREEN
   ============================================ */

.brand-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0066ff2a 0%, #003d822e 100%);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10002;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.brand-loading.show {
    display: flex;
    opacity: 1;
}

.brand-container {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* ===== LOGO BREATHING GLOW ===== */
.logo-glow-wrapper {
    position: relative;
    display: inline-block;
}

.brand-logo-breathing {
    width: 180px;
    height: auto;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    animation: logoBreathing 3s ease-in-out infinite;
}

@keyframes logoBreathing {

    0%,
    100% {
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.9)) drop-shadow(0 0 50px rgba(255, 215, 0, 0.6));
        transform: scale(1.05);
    }
}

/* Glow effect around logo */
.logo-glow-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 215, 0, 0.1) 30%,
            transparent 70%);
    z-index: 1;
    animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: translate(-50%, -50%) scale(0.9);
    }

    50% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.1);
    }
}

/* Wave dots animation */
.wave-dots {
    display: flex;
    gap: 16px;
    align-items: center;
    height: 40px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    position: relative;
    animation: waveMotion 3s ease-in-out infinite;
}

/* Brand colors */
.dot-blue {
    background: linear-gradient(135deg, #0066FF, #003D82);
    box-shadow: 0 0 15px rgba(0, 102, 255, 0.6);
    animation-delay: 0s;
}

.dot-orange {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
    box-shadow: 0 0 15px rgba(255, 165, 0, 0.6);
    animation-delay: 0.25s;
}

.dot-red {
    background: linear-gradient(135deg, #FF6B6B, #EE5A6F);
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.6);
    animation-delay: 0.5s;
}

.dot-yellow {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
    animation-delay: 0.75s;
}

@keyframes waveMotion {

    0%,
    100% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 10px currentColor;
    }

    25% {
        transform: translateY(-15px) scale(1.2);
        box-shadow: 0 0 20px currentColor;
    }

    50% {
        transform: translateY(0) scale(1);
        box-shadow: 0 0 10px currentColor;
    }

    75% {
        transform: translateY(15px) scale(0.9);
        box-shadow: 0 0 5px currentColor;
    }
}

/* Loading text */
.loading-text {
    color: white;
    font-size: 15px;
    font-weight: 500;
    margin-top: 10px;
    opacity: 0.9;
    letter-spacing: 0.5px;
    animation: textPulse 3s ease-in-out infinite;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* ===========================
   14. RESPONSIVE DESIGN
   =========================== */

@media (max-width: 1200px) {
    .top-section {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 1024px) {
    .app-container {
        max-width: 95%;
        margin: 15px auto;
    }

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

    .chart-card canvas {
        max-height: 250px;
    }

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

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

    .stats-section .stat-card:last-child {
        grid-column: 1 / -1;
    }
}

/* ============================================
   MOBILE RESPONSIVE STYLES 
   ============================================ */

@media (max-width: 768px) {
    /* ===== BASE LAYOUT ===== */
    html {
        background: var(--gradient-primary);
        background-attachment: fixed;
    }

    body {
        padding: 8px;
        padding-bottom: calc(8px + env(safe-area-inset-bottom));
        overflow-y: auto;
        background: linear-gradient(135deg, #0066FF 0%, #003D82 100%);
        background-attachment: fixed;
        padding-top: max(8px, env(safe-area-inset-top, 8px));
    }

    .logo {
        height: 40px;
    }

    .app-container {
        border-radius: var(--radius-lg) !important;
        overflow: hidden;
        margin: 10px auto;
        -webkit-border-radius: 20px;
    }

    .is-android .app-container {
        height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--h-android)) !important;
        max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--h-android)) !important;
    }
    
    @supports (padding: max(0px)) {
        .app-container {
            height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--h-ios-safari)) !important;
            max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - var(--h-ios-safari)) !important;
        }
    }
    
    @media screen and (max-width: 430px) and (orientation: portrait) {
        .is-ios-chrome .app-container {
            height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--h-ios-chrome)) !important;
            max-height: calc(100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - var(--h-ios-chrome)) !important;
        }
    }
    
    .app-container > .header {
        border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important;
    }
    
    .app-container > .content,
    .app-container > .dashboard {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg) !important;
    }
    
    .app-container.compact {
        max-width: 90%;
        margin: 10px auto;
    }

    .content.koc-content,
    .dashboard-content-wrapper {
        min-height: auto;
        padding-bottom: env(safe-area-inset-bottom, 20px);
    }
    
    html.is-login .app-container {
        height: auto !important;
        max-height: none !important;
        margin: 16px auto;
    }

    /* ===== HEADER STYLES ===== */
    .header {
        padding: 14px 16px !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .header h1 {
        font-size: 1.3em !important;
        margin-bottom: 2px;
    }

    .header p {
        font-size: 0.85em;
    }

    .logo-section {
        gap: 12px;
    }

    /* Header variant - Centered style */
    .header.centered {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
    }

    .header.centered .user-actions {
        position: static;
        transform: none;
        width: 100%;
        justify-content: center;
    }

    /* Header tabs for compact variant */
    .header-tab {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    .login-section {
        padding: 25px 30px;
        border-radius: 12px;
    }

    .login-section h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }

    /* Remember Me - Mobile */
    .remember-me-group {
        margin-bottom: 14px;
    }

    .remember-me-label {
        font-size: 12px;
        gap: 6px;
    }

    .remember-me-checkbox {
        width: 15px;
        height: 15px;
    }

    /* Loading screen styles */

    .brand-container {
        gap: 10px;
    }

    .brand-logo-breathing {
        width: 180px;
    }

    .logo-glow-wrapper::before {
        width: 180px;
        height: 180px;
    }

    .wave-dots {
        gap: 12px;
    }

    .dot {
        width: 12px;
        height: 12px;
    }

    .loading-text {
        font-size: 13px;
    }

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

    .form-group input {
        padding: 10px 14px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .btn {
        padding: 12px 20px;
        font-size: 15px;
    }

    .secondary-actions {
        margin-top: 16px;
        gap: 20px;
    }

    .link-btn {
        font-size: 13px;
    }

    /* Terms Link - Mobile */
    .terms-link-wrapper {
        margin-top: 12px;
    }

    .terms-link {
        font-size: 12px;
    }

    /* Terms Checkbox - Mobile */
    .terms-checkbox-group {
        margin-top: 12px;
        margin-bottom: 6px;
        padding: 10px;
    }

    .terms-checkbox-label {
        font-size: 12px;
        gap: 6px;
    }

    .terms-checkbox {
        width: 18px;
        height: 18px;
        margin-top: 1px;
    }

    /* ===== REGISTER & FORGOT PASSWORD MODALS (MOBILE) ===== */

    /* Register Modal */
    #registerModal .modal-content {
        max-width: 90% !important;
        max-height: 80vh !important;
        padding: 16px 18px !important;
    }

    #registerModal .modal-header h2 {
        font-size: 1.1em;
    }

    #registerModal .form-group {
        margin-bottom: 12px;
    }

    #registerModal .form-group label {
        font-size: 0.85em;
        margin-bottom: 6px;
    }

    #registerModal .form-group input,
    #registerModal .form-group select,
    #registerModal .form-group textarea {
        padding: 9px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 8px;
    }

    #registerModal textarea {
        min-height: 60px;
    }

    #registerModal .btn {
        padding: 11px 18px;
        font-size: 0.9em;
    }

    /* Forgot Password Modal */
    #forgotModal .modal-content {
        max-width: 85% !important;
        max-height: 70vh !important;
        padding: 18px 18px !important;
    }

    #forgotModal .modal-header h2 {
        font-size: 1.1em;
    }

    #forgotModal .form-group {
        margin-bottom: 12px;
    }

    #forgotModal .form-group label {
        font-size: 0.85em;
        margin-bottom: 6px;
    }

    #forgotModal .form-group input {
        padding: 9px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 8px;
    }

    #forgotModal p {
        font-size: 0.8em;
        margin-bottom: 14px;
        line-height: 1.4;
    }

    #forgotModal .btn {
        padding: 11px 18px;
        font-size: 0.9em;
    }

    /* Edit KOC Modal */
    #editKOCModal .modal-content,
    #createKOCModal .modal-content {
        max-width: 92% !important;
        max-height: 85vh !important;
        padding: 14px 12px !important;
    }

    #editKOCModal .modal-header h2,
    #createKOCModal .modal-header h2 {
        font-size: 1.05em;
    }

    #editKOCModal .form-grid,
    #createKOCModal .form-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    #editKOCModal .form-group,
    #createKOCModal .form-group {
        margin-bottom: 12px;
    }

    #editKOCModal .form-group label,
    #createKOCModal .form-group label {
        font-size: 0.85em;
        margin-bottom: 6px;
    }

    #editKOCModal .form-group input,
    #editKOCModal .form-group select,
    #editKOCModal .form-group textarea,
    #createKOCModal .form-group input,
    #createKOCModal .form-group select,
    #createKOCModal .form-group textarea {
        padding: 9px 12px;
        font-size: 0.85em;
        border-radius: 8px;
    }

    #editKOCModal textarea,
    #createKOCModal textarea {
        min-height: 60px;
    }

    #editKOCModal .btn,
    #createKOCModal .btn {
        padding: 9px 14px;
        font-size: 0.85em;
    }

    #editKOCModal .btn-small,
    #createKOCModal .btn-small {
        padding: 7px 12px;
        font-size: 0.8em;
    }

    /* Custom Password Modal */
    #customPasswordModal .modal-content {
        max-width: 85% !important;
        max-height: 75vh !important;
        padding: 14px 12px !important;
    }

    #customPasswordModal .modal-header h2 {
        font-size: 1.05em;
    }

    #customPasswordModal .form-group {
        margin-bottom: 12px;
    }

    #customPasswordModal .form-group label {
        font-size: 0.85em;
        margin-bottom: 6px;
    }

    #customPasswordModal .form-group input {
        padding: 9px 12px;
        font-size: 0.85em;
        border-radius: 8px;
    }

    #customPasswordModal p {
        font-size: 0.75em;
        margin-top: 4px;
        line-height: 1.3;
    }

    #customPasswordModal .btn {
        padding: 9px 14px;
        font-size: 0.85em;
    }

    /* Modal actions buttons */
    .modal-content>form>div[style*="flex"] {
        gap: 8px !important;
        margin-top: 14px !important;
    }

    /* ===== USER INFO & ACTIONS ===== */
    .user-info {
        font-size: 12px;
        padding: 6px 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

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

    /* ===== USER DASHBOARD HEADER LAYOUT ===== */
    /* When user dashboard is visible - special header layout */
    body:has(#userDashboard:not([style*="display: none"])) .header {
        position: relative !important;
        padding: 12px !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0 !important;
    }

    /* Logo centered */
    body:has(#userDashboard:not([style*="display: none"])) .logo-section {
        margin: 0 auto !important;
        order: 1;
    }

    /* Hide user info on dashboard */
    body:has(#userDashboard:not([style*="display: none"])) .user-info {
        display: none !important;
    }

    /* User actions positioned at top right */
    body:has(#userDashboard:not([style*="display: none"])) .user-actions {
        position: absolute !important;
        top: 14px !important;
        bottom: auto !important;
        right: 10px !important;
        left: auto !important;
        transform: none !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        margin: 0 !important;
        order: 2 !important;
        width: auto !important;
        align-items: flex-end !important;
    }

    /* Logout button - circular with icon */
    body:has(#userDashboard:not([style*="display: none"])) .btn-logout {
        /* background: rgba(235, 61, 61, 0.609) !important; */
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.5) !important;
        color: #fff !important;
        width: 18px !important;
        height: 18px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        font-size: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s ease;
        position: relative;
        overflow: visible;
    }

    /* Logout icon - SVG arrow out of box */
    body:has(#userDashboard:not([style*="display: none"])) .btn-logout::before {
        content: '';
        width: 9px;
        height: 9px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'%3E%3C/path%3E%3Cpolyline points='16 17 21 12 16 7'%3E%3C/polyline%3E%3Cline x1='21' y1='12' x2='9' y2='12'%3E%3C/line%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        display: block;
    }

    /* Hover effect - turns red */
    body:has(#userDashboard:not([style*="display: none"])) .btn-logout:hover {
        background: rgba(239, 68, 68, 0.9) !important;
        border-color: rgba(255, 255, 255, 0.5);
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    }

    /* Active/Click effect */
    body:has(#userDashboard:not([style*="display: none"])) .btn-logout:active {
        transform: scale(0.95);
    }

    /* Tooltip on hover */
    body:has(#userDashboard:not([style*="display: none"])) .btn-logout::after {
        content: 'Đăng xuất';
        position: absolute;
        bottom: -35px;
        right: 0;
        background: rgba(0, 0, 0, 0.85);
        color: #fff;
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 12px;
        font-weight: 600;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1000;
    }

    body:has(#userDashboard:not([style*="display: none"])) .btn-logout:hover::after {
        opacity: 1;
    }

    /* ===== CHANGE PASSWORD BUTTON (MOBILE) ===== */
    body:has(#userDashboard:not([style*="display: none"])) .btn-change-password {
        background: transparent !important;
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.5) !important;
        color: #fff !important;
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0 !important;
        box-shadow: none;
        position: relative;
        transition: all 0.3s ease;
        overflow: visible;
    }

    /* Lock icon */
    body:has(#userDashboard:not([style*="display: none"])) .btn-change-password::before {
        content: '🔒';
        font-size: 9px;
        display: block;
        line-height: 1;
    }

    /* Tooltip on hover */
    body:has(#userDashboard:not([style*="display: none"])) .btn-change-password::after {
        content: 'Đổi mật khẩu';
        position: absolute;
        bottom: -35px;
        right: 0;
        background: rgba(0, 0, 0, 0.85);
        color: white;
        padding: 6px 10px;
        border-radius: 6px;
        font-size: 11px;
        white-space: nowrap;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        z-index: 1000;
        font-weight: 500;
    }

    body:has(#userDashboard:not([style*="display: none"])) .btn-change-password:hover::after,
    body:has(#userDashboard:not([style*="display: none"])) .btn-change-password:active::after {
        opacity: 1;
    }

    body:has(#userDashboard:not([style*="display: none"])) .btn-change-password:hover {
        background: rgba(255, 255, 255, 0.1) !important;
        border-color: rgba(255, 255, 255, 0.8);
        transform: scale(1.05);
    }

    body:has(#userDashboard:not([style*="display: none"])) .btn-change-password:active {
        transform: scale(0.95);
    }

    /* ===== CHANGE PASSWORD MODAL (MOBILE) ===== */
    #changePasswordModal .modal-content {
        max-width: 85% !important;
        width: 85% !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        top: 45% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    #changePasswordModal .modal-header {
        padding: 14px 16px !important;
    }

    #changePasswordModal .modal-header h2 {
        font-size: 17px;
    }

    #changePasswordModal .modal-body {
        padding: 16px !important;
    }

    #changePasswordModal .form-group {
        margin-bottom: 12px;
    }

    #changePasswordModal .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    #changePasswordModal .form-group input {
        padding: 10px 12px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    #changePasswordModal .form-group small {
        margin-top: 4px;
        font-size: 11px;
    }

    #changePasswordModal .form-actions {
        flex-direction: column;
        gap: 10px;
        margin-top: 16px !important;
    }

    #changePasswordModal .form-actions button {
        width: 100%;
        padding: 12px;
    }

    /* ===== CONTENT AREA ===== */
    .content {
        padding: 16px;
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        max-height: none;
    }

    /* ===== TAB BUTTONS ===== */
    .tab-buttons {
        padding: 6px 16px;
        margin: -16px -16px 12px -16px;
        gap: 4px;
        border-radius: 0;
        background: #fff;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .tab-btn {
        padding: 8px 10px;
        font-size: 12px;
        border-radius: 8px;
    }

    /* ===== CHART CARDS ===== */
    .chart-card {
        padding: 12px;
        border-radius: 12px;
    }

    .chart-card h3 {
        font-size: 0.95em;
        margin-bottom: 10px;
    }

    .chart-card canvas {
        max-height: 180px;
    }

    /* ===== TABLE STYLES ===== */
    .table-controls {
        margin-bottom: 12px;
        gap: 8px;
    }

    .search-input,
    .filter-select {
        padding: 8px 10px;
        font-size: 13px;
    }

    .controls-right {
        font-size: 12px;
        width: 100%;
        text-align: center;
    }

    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 12px;
    }

    .data-table {
        min-width: 700px;
        font-size: 12px;
    }

    .data-table th,
    .data-table td {
        padding: 10px 6px;
        font-size: 12px;
    }

    .data-table th {
        font-size: 10px;
        letter-spacing: 0.05em;
    }

    .data-table td .btn-small {
        padding: 5px 8px;
        font-size: 11px;
        margin: 2px;
        display: inline-block;
        width: auto;
    }

    /* ===== FORM & MODAL ===== */
    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-header {
        padding-bottom: 6px;
        margin-bottom: 12px
    }

    .modal-header h2 {
        font-size: 1.1em;
    }

    /* ===== REQUESTS POPUP ===== */
    .requests-popup-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 16px 16px 0 0;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
    }

    .requests-popup-header {
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 10;
        border-radius: 16px 16px 0 0;
    }

    .requests-popup-header h2 {
        font-size: 1.1em;
    }

    .requests-popup-body {
        padding: 12px 16px 20px 16px;
    }

    .request-card {
        padding: 12px;
        border-radius: 10px;
        margin-bottom: 12px;
    }

    .request-card-header {
        flex-direction: column;
        gap: 10px;
    }

    .request-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .request-card-body {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .btn-pending-requests {
        padding: 10px 18px;
        font-size: 14px;
        border-radius: 12px;
    }

    .bell-icon {
        font-size: 18px;
    }

    /* ============================================
     KOC DASHBOARD MOBILE STYLES
     ============================================ */

    #userDashboard.dashboard {
        padding: 12px;
        height: auto;
        min-height: auto;
        overflow: visible;
    }

    /* ===== TOP SECTION ===== */
    .top-section {
        gap: 12px;
        margin-bottom: 12px;
    }

    /* ===== WELCOME BANNER ===== */
    .welcome-banner {
        padding: 12px;
        border-radius: 12px;
        gap: 0;
    }

    .welcome-top {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    /* Quick stat inline badge */
    .quick-stat-inline {
        width: auto;
        padding: 3px 6px;
        flex-shrink: 0;
        gap: 4px;
        border-radius: 9px !important;
    }

    .quick-stat-inline::before {
        content: '';
        position: absolute;
        top: -2px;
        left: -2px;
        right: -2px;
        bottom: -2px;
        border-radius: 9px;
        background: linear-gradient(45deg,
                #FFD700,
                #FFA500,
                #FFED4E,
                #FFA500,
                #FFD700);
        background-size: 300% 300%;
        z-index: -1;
        animation: gradientRotate 3s linear infinite;
    }

    .quick-stat-icon {
        font-size: 1em;
    }

    .quick-stat-value {
        font-size: 1.2em;
    }

    .quick-stat-label {
        font-size: 0.6em;
    }

    /* Welcome content */
    .welcome-content h2 {
        font-size: 1.1em;
        line-height: 1.3;
        margin-bottom: 4px;
    }

    .welcome-content h2 span {
        font-size: 0.95em;
        letter-spacing: 0.3px;
    }

    .welcome-content h2 span::before {
        display: none;
    }

    .welcome-content p {
        font-size: 0.8em;
        line-height: 1.4;
    }

    /* ===== ACHIEVEMENT PROGRESS ===== */
    .achievement-header {
        margin-bottom: 18px;
    }

    .achievement-title {
        font-size: 0.7em;
    }

    .achievement-current {
        font-size: 0.5em;
        padding: 2px 6px;
        font-weight: 500;
    }

    .achievement-progress {
        padding: 10px 10px 28px 10px;
        border-radius: 8px;
    }

    /* Progress bar with Grid layout */
    .achievement-bar {
        position: relative;
        height: 10px;
        display: grid;
        grid-template-columns: 1fr 2.5fr 4fr 3.5fr !important;
        gap: 0;
    }

    .progress-segment {
        height: 100%;
        border-width: 1px;
    }

    .progress-segment.segment-infinity {
        background: rgba(255, 255, 255, 0.15);
        border-style: dashed;
        border-width: 1px;
        border-color: rgba(255, 215, 0, 0.5);
    }

    /* Milestones overlay with Grid */
    .achievement-milestones {
        position: absolute;
        top: 50%;
        left: 0;
        transform: translateY(-100%);
        width: 100%;
        height: 10px;
        display: grid;
        grid-template-columns: 1fr 2.5fr 4fr 3.5fr !important;
        gap: 0;
        pointer-events: none;
    }

    /* Milestone containers */
    .milestone-container {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .milestone-container.container-infinity {
        justify-content: center;
    }

    /* Milestone badges positioning */
    .achievement-milestone {
        position: absolute;
        right: 0;
        transform: translateX(50%);
        pointer-events: auto;
    }

    .milestone-container.container-1 .achievement-milestone {
        right: -0.5px;
        transform: translateX(50%);
    }

    .milestone-container.container-2 .achievement-milestone {
        right: -0.5px;
        transform: translateX(50%);
    }

    .milestone-container.container-infinity .achievement-milestone {
        position: relative;
        right: auto;
        transform: none;
    }

    /* Badge styles */
    .milestone-badge {
        width: 20px;
        height: 20px;
        border-width: 0.1px;
    }

    .badge-icon {
        font-size: 0.75em;
    }

    /* Milestone labels */
    .milestone-label {
        font-size: 0.45em;
        top: 23px;
        line-height: 1.2;
    }

    .infinity-symbol {
        font-size: 0.8em;
    }

    /* ===== PROFILE CARD ===== */
    .profile-card-standalone {
        padding: 14px 12px;
        border-radius: 12px;
        gap: 12px;
    }

    .profile-watermark {
        width: 180px;
        opacity: 0.1;
    }

    .profile-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.3em;
    }

    .profile-header {
        gap: 10px;
        padding-bottom: 10px;
    }

    .profile-info-header h3 {
        font-size: 1em;
    }

    .profile-info-header p {
        font-size: 0.8em;
    }

    .profile-details {
        gap: 8px;
    }

    .profile-detail-item {
        padding: 8px 10px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        border-radius: 6px;
    }

    .detail-label {
        font-size: 0.75em;
    }

    .detail-value {
        font-size: 0.85em;
    }

    /* ===== PROFILE HEADER ACTIONS (MOBILE) ===== */
    .profile-header-actions {
        display: flex !important;
        flex-direction: column;
        gap: 6px;
        margin-left: auto;
    }

    .profile-header-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: 1.5px solid #e5e7eb;
        background: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
        position: relative;
    }

    .profile-header-btn:active {
        transform: scale(0.95);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }

    /* Change Password - Key icon (SVG) */
    .btn-change-password-mobile::before {
        content: '';
        width: 16px;
        height: 16px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eab308' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='M13 12l8-8M16 4l2 2'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        display: block;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%) rotate(180deg);
    }

    .btn-change-password-mobile:active {
        background: #f9fafb;
    }

    .btn-change-password-mobile:active::before {
        opacity: 0.7;
    }

    /* Logout - Exit door icon (SVG) */
    .btn-logout-mobile::before {
        content: '';
        width: 16px;
        height: 16px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'%3E%3C/path%3E%3Cpolyline points='16 17 21 12 16 7'%3E%3C/polyline%3E%3Cline x1='21' y1='12' x2='9' y2='12'%3E%3C/line%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        display: block;
    }

    .btn-logout-mobile:active {
        background: #f9fafb;
    }

    .btn-logout-mobile:active::before {
        opacity: 0.7;
    }

    /* Hide header buttons on mobile for KOC dashboard */
    body:has(#userDashboard:not([style*="display: none"])) .user-actions {
        display: none !important;
    }

    /* ===== STATS SECTION ===== */
    .stats-section {
        padding: 12px;
        gap: 12px;
        margin-bottom: 12px;
        border-radius: 12px;
        grid-template-columns: 1fr;
    }

    .stats-grid.overview-stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 14px 12px;
        border-radius: 12px;
        min-height: auto;
    }

    .stat-value {
        font-size: 4.8em;
    }

    .stat-label {
        font-size: 11px;
    }

    .stats-section .stat-card {
        padding: 14px 12px;
        gap: 10px;
        border-radius: 10px;
        min-height: min-content;
    }

    .stats-section .stat-card:hover {
        transform: translateY(-2px);
    }

    .stat-card-header {
        padding-bottom: 8px;
        gap: 8px;
    }

    .stat-icon {
        font-size: 1.6em;
    }

    .stat-header-info h3 {
        font-size: 0.85em;
    }

    .stat-header-info p {
        font-size: 0.7em;
    }

    .stat-label {
        font-size: 0.75em;
        margin-bottom: 2px;
    }

    .stat-trend {
        padding: 8px 12px;
        gap: 3px;
        border-radius: 8px;
    }

    .trend-icon {
        font-size: 1.2em;
    }

    .trend-value {
        font-size: 0.95em;
    }

    .trend-label {
        font-size: 0.65em;
    }

    /* ===== REVENUE BREAKDOWN ===== */
    .revenue-grid {
        gap: 6px;
    }

    .revenue-item {
        padding: 8px 10px;
        border-left-width: 3px;
        flex-direction: row;
        align-items: center;
        gap: 0;
        border-radius: 8px;
    }

    .revenue-item:hover {
        transform: translateX(2px);
    }

    .revenue-label {
        font-size: 0.75em;
        gap: 5px;
    }

    .revenue-icon {
        font-size: 1.1em;
    }

    .revenue-value {
        font-size: 0.9em;
        margin-left: auto;
    }

    .revenue-item.total .revenue-value {
        font-size: 1.05em;
    }

    /* ===== REFERRAL LINKS ===== */
    .links-content {
        gap: 8px;
    }

    .link-box {
        padding: 8px;
        border-radius: 8px;
    }

    .link-header {
        margin-bottom: 6px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .link-type-badge {
        font-size: 0.6em;
        padding: 3px 7px;
    }

    .btn-copy-mini {
        font-size: 0.65em;
        padding: 4px 7px;
    }

    .link-text {
        font-size: 0.7em;
        padding: 6px 8px;
    }

    .link-text .link-protocol {
        display: none;
    }

    .link-tips {
        padding: 6px 8px;
        gap: 5px;
        border-radius: 8px;
    }

    .tip-icon {
        font-size: 1em;
    }

    .tip-content {
        font-size: 0.7em;
        line-height: 1.3;
    }

    /* ===== QUICK ACTIONS ===== */
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .action-btn {
        padding: 12px;
        border-radius: 12px;
        gap: 8px;
        flex-direction: row;
        justify-content: flex-start;
    }

    .action-btn:hover {
        transform: translateY(-1px);
    }

    .action-icon {
        font-size: 1.6em;
    }

    .action-label {
        font-size: 0.8em;
        text-align: left;
    }

    /* ===== WATERMARK & FOOTER ===== */
    #userDashboard .watermark-logo {
        width: 100px;
        bottom: 50px;
        right: 12px;
        opacity: 0.7;
    }

    /* ===== FIX MODAL POSITIONING & ANIMATION (MOBILE) ===== */

    .modal {
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .modal-content {
        width: 90% !important;
        max-width: 90% !important;
        max-height: 75vh !important;
        overflow-y: auto;
        border-radius: 16px;
        padding: 14px 12px !important;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) !important;
        bottom: auto;
        margin: 0;
        animation: modalSlideInMobile 0.3s ease-out;
        transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    }

    @keyframes modalSlideInMobile {
        from {
            opacity: 0;
            transform: translate(-50%, -50%) scale(0.9);
        }

        to {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }
    }

    #supportModal .modal-content {
        max-width: 80% !important;
        max-height: 60vh !important;
        padding: 14px 18px !important;
    }

    #guideModal .modal-content {
        max-width: 90% !important;
        max-height: 75vh !important;
    }

    .requests-popup-content {
        position: fixed;
        top: auto;
        left: 0;
        bottom: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        max-height: 90vh;
        border-radius: 16px 16px 0 0;
        animation: slideUpFromBottom 0.3s ease-out;
    }

    @keyframes slideUpFromBottom {
        from {
            transform: translateY(100%);
        }

        to {
            transform: translateY(0);
        }
    }

    /* ===== SUPPORT MODAL (MOBILE) ===== */
    .support-content {
        gap: 10px;
    }

    .support-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 6px;
        gap: 0px;
    }

    .support-icon {
        font-size: 1.9em;
    }

    .support-icon-img {
        width: 1em;
        height: 1em;
        margin: 8px;
    }

    .support-info {
        width: 100%;
    }

    .support-info h3 {
        font-size: 0.95em;
        margin-bottom: 6px;
        display: none;
    }

    .support-link {
        font-size: 0.85em;
        margin-bottom: 4px;
        word-break: break-all;
    }

    .support-link[href^="mailto"]::after {
        content: ' 📋';
        font-size: 0.75em;
    }

    .support-link[href^="tel"] {
        font-size: 1.1em;
        font-weight: 700;
    }

    .support-note {
        font-size: 0.75em;
        margin-top: 4px;
    }

    .support-address {
        font-size: 0.8em;
        line-height: 1.5;
        margin: 6px 0;
    }

    .support-footer {
        padding: 8px 10px;
        margin-top: 10px;
    }

    .support-footer p {
        font-size: 0.75em;
        line-height: 1.4;
    }

    /* ===== GUIDE MODAL (MOBILE) ===== */
    .guide-content {
        max-height: 60vh;
        padding-right: 4px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }

    .guide-section {
        margin-bottom: 10px;
        border-radius: 10px;
    }

    .guide-section-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .guide-icon {
        font-size: 1.3em;
    }

    .guide-section-header h3 {
        font-size: 0.95em;
    }

    .guide-toggle {
        font-size: 1em;
    }

    .guide-section-body {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        padding: 0 20px;
        /* Close animation timing */
        transition: max-height 0.9s cubic-bezier(0.4, 0, 0.2, 1),
            opacity 0.7s ease-out,
            padding 0.8s ease-out;
    }

    .guide-section-body.show {
        max-height: 3000px;
        padding: 10px;
        opacity: 1;
        /* Open animation timing */
        transition: max-height 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
            opacity 0.5s ease-in,
            padding 0.6s ease-in;
    }

    .guide-section.active .guide-section-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: linear-gradient(135deg, #eff6ff, #dbeafe);
        box-shadow: 0 2px 6px rgba(0, 102, 255, 0.15);
        padding: 12px 14px;
    }

    .guide-section-body p {
        font-size: 0.85em;
        margin-bottom: 10px;
        line-height: 1.5;
    }

    .guide-step {
        flex-direction: column;
        gap: 10px;
        margin: 12px 0;
        padding: 10px;
        border-left-width: 3px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.95em;
        align-self: flex-start;
    }

    .step-content h4 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }

    .step-content p {
        font-size: 0.85em;
    }

    .guide-table {
        font-size: 0.9em;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 12px 0;
    }

    .guide-table th,
    .guide-table td {
        padding: 8px 6px;
        white-space: nowrap;
    }

    .guide-note {
        padding: 8px 10px;
        font-size: 0.8em;
        margin-top: 12px;
        line-height: 1.4;
    }

    .guide-tips {
        padding-left: 0;
    }

    .guide-tips li {
        padding: 8px 10px;
        margin-bottom: 8px;
        font-size: 0.85em;
        border-left-width: 3px;
        line-height: 1.5;
    }

    .guide-tips li strong {
        font-size: 0.9em;
        display: block;
        margin-bottom: 4px;
    }

    .faq-item {
        padding: 10px;
        margin-bottom: 12px;
        border-left-width: 3px;
    }

    .faq-item h4 {
        font-size: 0.9em;
        margin-bottom: 6px;
    }

    .faq-item p {
        font-size: 0.85em;
        line-height: 1.5;
    }

    .resource-list {
        gap: 10px;
        margin-top: 12px;
    }

    .resource-item {
        padding: 10px;
        gap: 10px;
    }

    .resource-item:hover {
        transform: translateY(-1px);
    }

    .resource-icon {
        font-size: 1.5em;
    }

    .resource-info h4 {
        font-size: 0.9em;
        margin-bottom: 4px;
    }

    .resource-info p {
        font-size: 0.8em;
        line-height: 1.4;
    }
    
    .video-modal-content {
        max-width: 95%;
        max-height: 90vh;
        padding: 20px;
    }

    .video-container {
        max-width: 100%;
        height: auto;
        margin-bottom: 16px;
    }

    .video-container video {
        max-height: 50vh;
        width: 100%;
        height: auto;
    }

    .video-info {
        padding: 0 4px;
    }

    .video-info h4 {
        font-size: 1em;
    }

    .video-info p {
        font-size: 0.85em;
        line-height: 1.5;
    }
}

/* Extra small screens - Keep modal style (not full screen) */
@media screen and (max-width: 430px) and (orientation: portrait) {
    #changePasswordModal .modal-content {
        max-width: 85% !important;
        width: 85% !important;
        max-height: 80vh !important;
        top: 45% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        border-radius: 12px !important;
        overflow-y: auto !important;
    }

    #changePasswordModal .modal-header {
        padding: 18px;
    }

    #changePasswordModal .modal-header h2 {
        font-size: 16px;
    }

    #changePasswordModal .modal-body {
        padding: 18px;
    }
    
    #changePasswordModal .form-group {
        margin-bottom: 14px;
    }
    
    #changePasswordModal .form-group input {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 11px;
    }
}