:root {
    /* Primary Color - Easy to change */
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-color-alpha: rgba(37, 99, 235, 0.1);
    
    /* Supporting Colors */
    --secondary-color: #64748b;
    --accent-color: #10b981;
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    
    /* Border Colors */
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    
    /* Status Colors */
    --success-color: #10b981;
    --success-light: #d1fae5;
    --warning-color: #f59e0b;
    --warning-light: #fef3c7;
    --error-color: #ef4444;
    --error-light: #fee2e2;
    
    /* Development Colors */
    --dev-color: #8b5cf6;
    --dev-light: #ede9fe;
    
    /* Role Colors */
    --role-admin: #dc2626;
    --role-admin-dark: #b91c1c;
    --role-master: #7c2d12;
    --role-master-dark: #581c87;
    --role-mobile: #059669;
    --role-mobile-dark: #047857;
    --role-user: #2563eb;
    --role-user-dark: #1d4ed8;
    
    /* Shadows */
    --shadow-small: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* Spacing */
    --header-height: 4rem;
    --sidebar-width: 16rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

html[data-theme="dark"] {
    color-scheme: dark;
}

[data-theme="dark"] {
    --primary-color: #3b82f6;
    --primary-light: #60a5fa;
    --primary-dark: #1d4ed8;
    --primary-color-alpha: rgba(59, 130, 246, 0.2);

    --secondary-color: #94a3b8;
    --accent-color: #10b981;

    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --bg-primary: #0f172a;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;

    --border-color: #334155;
    --border-light: #1f2937;

    --success-color: #34d399;
    --success-light: rgba(52, 211, 153, 0.2);
    --warning-color: #fbbf24;
    --warning-light: rgba(251, 191, 36, 0.2);
    --error-color: #f87171;
    --error-light: rgba(248, 113, 113, 0.2);

    --dev-color: #a78bfa;
    --dev-light: rgba(167, 139, 250, 0.2);

    --shadow-small: 0 1px 2px 0 rgba(15, 23, 42, 0.6);
    --shadow-medium: 0 4px 6px -1px rgba(15, 23, 42, 0.7), 0 2px 4px -1px rgba(15, 23, 42, 0.5);
    --shadow-large: 0 10px 15px -3px rgba(15, 23, 42, 0.8), 0 4px 6px -2px rgba(15, 23, 42, 0.6);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
}

h1:focus {
    outline: none;
}

/* ================================== */
/* WEBASSEMBLY LOADER STYLES - SCOPED */
/* ================================== */

/* Modern WebAssembly Loader - Completely Light Theme */
.modern-wasm-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-secondary); /* Same as main layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Very light background particles */
.modern-wasm-loader .loader-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.modern-wasm-loader .bg-particle {
    position: absolute;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.02) 0%, rgba(37, 99, 235, 0.01) 50%, transparent 100%);
    border-radius: 50%;
    animation: wasmParticleFloat 8s ease-in-out infinite;
}

.modern-wasm-loader .particle-1 {
    width: 120px;
    height: 120px;
    top: 10%;
    left: 15%;
    animation-delay: 0s;
}

.modern-wasm-loader .particle-2 {
    width: 80px;
    height: 80px;
    top: 70%;
    right: 20%;
    animation-delay: 2s;
}

.modern-wasm-loader .particle-3 {
    width: 100px;
    height: 100px;
    bottom: 20%;
    left: 10%;
    animation-delay: 4s;
}

.modern-wasm-loader .particle-4 {
    width: 60px;
    height: 60px;
    top: 30%;
    right: 15%;
    animation-delay: 6s;
}

@keyframes wasmParticleFloat {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.1;
    }
    25% { 
        transform: translateY(-20px) translateX(10px) scale(1.1);
        opacity: 0.15;
    }
    50% { 
        transform: translateY(-10px) translateX(-15px) scale(0.9);
        opacity: 0.2;
    }
    75% { 
        transform: translateY(15px) translateX(5px) scale(1.05);
        opacity: 0.12;
    }
}

/* Brand section */
.modern-wasm-loader .loader-brand {
    text-align: center;
    margin-bottom: 3rem;
    z-index: 3;
    animation: wasmBrandSlideIn 1s ease-out;
}

.modern-wasm-loader .brand-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-small);
    animation: wasmIconPulse 3s ease-in-out infinite;
}

.modern-wasm-loader .brand-icon .material-icons {
    font-size: 2rem;
    color: white;
}

.modern-wasm-loader .brand-name {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.05em;
}

.modern-wasm-loader .brand-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.05em;
}

/* Progress container - completely clean */
.modern-wasm-loader .loader-progress-container {
    position: relative;
    margin-bottom: 2rem;
    z-index: 3;
    animation: wasmProgressSlideIn 1s ease-out 0.3s both;
}

.modern-wasm-loader .loading-progress {
    width: 10rem;
    height: 10rem;
    /* Remove all filters and shadows for clean light look */
}

.modern-wasm-loader .progress-ring {
    transition: stroke-dasharray 0.3s ease-out;
    /* Remove rotation animation for cleaner look */
}

/* Percentage display */
.modern-wasm-loader .progress-percentage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: baseline;
    font-weight: 700;
    color: var(--primary-color);
    animation: wasmPercentageScale 2s ease-in-out infinite;
}

.modern-wasm-loader .percentage-number {
    font-size: 1.75rem;
    line-height: 1;
}

.modern-wasm-loader .percentage-symbol {
    font-size: 1rem;
    margin-left: 0.125rem;
    opacity: 0.7;
}

/* Status section */
.modern-wasm-loader .loader-status {
    text-align: center;
    z-index: 3;
    animation: wasmStatusSlideIn 1s ease-out 0.6s both;
}

.modern-wasm-loader .status-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
    min-height: 1.5rem;
    animation: wasmTextFade 2s ease-in-out infinite;
}

.modern-wasm-loader .status-text:after {
    content: var(--blazor-load-percentage-text, "Loading Application...");
}

.modern-wasm-loader .status-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.modern-wasm-loader .status-dots .dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--primary-color);
    animation: wasmDotBounce 1.4s ease-in-out infinite;
}

.modern-wasm-loader .status-dots .dot:nth-child(1) { animation-delay: 0s; }
.modern-wasm-loader .status-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.modern-wasm-loader .status-dots .dot:nth-child(3) { animation-delay: 0.4s; }

/* Simplified animations for clean light theme */
@keyframes wasmBrandSlideIn {
    0% { opacity: 0; transform: translateY(-30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes wasmProgressSlideIn {
    0% { opacity: 0; transform: translateY(30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wasmStatusSlideIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes wasmIconPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: var(--shadow-small);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: var(--shadow-medium);
    }
}

@keyframes wasmPercentageScale {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.02); }
}

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

@keyframes wasmDotBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* WebAssembly Loader Responsive Design */
@media (max-width: 768px) {
    .modern-wasm-loader .brand-icon {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .modern-wasm-loader .brand-icon .material-icons {
        font-size: 1.75rem;
    }
    
    .modern-wasm-loader .brand-name {
        font-size: 2rem;
    }
    
    .modern-wasm-loader .brand-subtitle {
        font-size: 0.875rem;
    }
    
    .modern-wasm-loader .loading-progress {
        width: 8rem;
        height: 8rem;
    }
    
    .modern-wasm-loader .percentage-number {
        font-size: 1.5rem;
    }
    
    .modern-wasm-loader .percentage-symbol {
        font-size: 0.875rem;
    }
    
    .modern-wasm-loader .status-text {
        font-size: 0.875rem;
    }
    
    .modern-wasm-loader .bg-particle {
        transform: scale(0.7);
    }
}

@media (max-width: 480px) {
    .modern-wasm-loader .loader-brand {
        margin-bottom: 2rem;
    }
    
    .modern-wasm-loader .brand-icon {
        width: 3rem;
        height: 3rem;
    }
    
    .modern-wasm-loader .brand-icon .material-icons {
        font-size: 1.5rem;
    }
    
    .modern-wasm-loader .brand-name {
        font-size: 1.75rem;
    }
    
    .modern-wasm-loader .loading-progress {
        width: 7rem;
        height: 7rem;
    }
    
    .modern-wasm-loader .percentage-number {
        font-size: 1.25rem;
    }
}

/* WebAssembly Loader Accessibility */
@media (prefers-reduced-motion: reduce) {
    .modern-wasm-loader *,
    .modern-wasm-loader *::before,
    .modern-wasm-loader *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .modern-wasm-loader .bg-particle {
        display: none;
    }
}

/* ================================== */
/* GENERAL APPLICATION STYLES */
/* ================================== */

/* Login Layout */
.login-layout {
    min-height: 100vh;
    background: var(--bg-secondary);
}

/* Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* App Layout */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.app-header {
    height: var(--header-height);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-small);
}

.header-left {
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo .material-icons {
    font-size: 2rem;
}

.logo-text {
    color: var(--text-primary);
}

.app-body {
    display: flex;
    flex: 1;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    height: calc(100vh - var(--header-height));
    position: sticky;
    top: var(--header-height);
}

.main-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg-secondary);
}

/* Navigation */
.nav-menu {
    padding: 1.5rem 0;
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-right: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--primary-color-alpha);
    color: var(--primary-color);
    border-right-color: var(--primary-color);
    font-weight: 500;
}

.nav-item .material-icons {
    font-size: 1.25rem;
}

.nav-text {
    font-size: 0.9rem;
}

/* User Profile */
.user-profile {
    position: relative;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

/* Role-based avatar colors */
.user-avatar-user {
    background: var(--role-user);
}

.user-avatar-user:hover {
    background: var(--role-user-dark);
    transform: scale(1.05);
}

.user-avatar-admin {
    background: var(--role-admin);
}

.user-avatar-admin:hover {
    background: var(--role-admin-dark);
    transform: scale(1.05);
}

.user-avatar-master {
    background: var(--role-master);
    background: linear-gradient(135deg, var(--role-master) 0%, #581c87 100%);
    box-shadow: 0 0 0 2px rgba(124, 45, 18, 0.3);
}

.user-avatar-master:hover {
    background: var(--role-master-dark);
    background: linear-gradient(135deg, var(--role-master-dark) 0%, #4c1d95 100%);
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(124, 45, 18, 0.5);
}

.user-avatar-mobile {
    background: var(--role-mobile);
}

.user-avatar-mobile:hover {
    background: var(--role-mobile-dark);
    transform: scale(1.05);
}

.user-initials {
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-large);
    min-width: 220px;
    z-index: 100;
    overflow: hidden;
    animation: slideDown 0.2s ease-out;
}

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

.dropdown-header {
    padding: 1rem;
}

.user-info {
    text-align: center;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.user-role {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

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

.dropdown-item .material-icons {
    font-size: 1.125rem;
}

/* Page Content */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    animation: slideUp 0.4s ease-out;
}

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

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

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 0.5rem 0;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.page-header h1 .material-icons {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.page-header p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.content-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-small);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s ease;
}

.content-card:hover {
    box-shadow: var(--shadow-medium);
}

/* Settings Sections */
.settings-section {
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.section-header h2 .material-icons {
    font-size: 1.75rem;
    color: var(--primary-color);
}

.settings-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.settings-label h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-label p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.settings-control {
    min-width: 220px;
}

/* Database Management Styles */
.database-status-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.database-status {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

.status-indicator {
    flex-shrink: 0;
}

.status-ready .material-icons {
    font-size: 3rem;
    color: var(--success-color);
    animation: pulse 2s infinite;
}

.status-not-ready .material-icons {
    font-size: 3rem;
    color: var(--error-color);
}

.status-loading .material-icons {
    font-size: 3rem;
    color: var(--text-secondary);
    animation: spin 1s linear infinite;
}

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

.status-details {
    flex: 1;
}

.status-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-message {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

.status-info {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
}

.status-info p {
    margin: 0.25rem 0;
}

.database-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-small);
}

.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Initialization Results */
.initialization-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideUp 0.3s ease-out;
}

.initialization-result.success {
    background: var(--success-light);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.initialization-result.error {
    background: var(--error-light);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.initialization-result .material-icons {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.result-content {
    flex: 1;
}

.result-content p {
    margin: 0 0 0.5rem 0;
    font-weight: 500;
}

.result-content details {
    margin-top: 0.5rem;
}

.result-content summary {
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.result-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.result-content li {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    padding: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.login-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 3rem 2.5rem;
    box-shadow: var(--shadow-large);
    width: 100%;
    max-width: 450px;
    animation: slideUp 0.4s ease-out;
}

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

.login-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-header p {
    color: var(--text-secondary);
    margin: 0;
}

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

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

.form-group label {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

/* Modern Login Page Styles - Unified Light Theme */
.modern-login-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: var(--bg-secondary); /* Use same background as main layout */
    padding: 2rem;
    animation: fadeIn 0.6s ease-out;
}

/* Light animated background for login */
.modern-login-container .login-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 1;
}

.modern-login-container .bg-shape {
    position: absolute;
    background: rgba(37, 99, 235, 0.05); /* Much lighter, consistent with main theme */
    border-radius: 50%;
    animation: loginFloat 6s ease-in-out infinite;
}

.modern-login-container .shape-1 {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
    animation-delay: 0s;
}

.modern-login-container .shape-2 {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 2s;
}

.modern-login-container .shape-3 {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
    animation-delay: 4s;
}

@keyframes loginFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

/* Modern Login Card - Light Theme */
.modern-login-card {
    background: var(--bg-primary); /* Use consistent white background */
    border-radius: 2rem;
    padding: 3rem;
    box-shadow: var(--shadow-large); /* Use consistent shadow */
    border: 1px solid var(--border-light); /* Add subtle border like main cards */
    width: 100%;
    max-width: 480px;
    z-index: 2;
    position: relative;
    animation: loginSlideUpScale 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginSlideUpScale {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header Section for Login */
.login-header-modern {
    text-align: center;
    margin-bottom: 2.5rem;
}

.brand-container {
    margin-bottom: 2rem;
}

.brand-icon-modern {
    width: 5rem;
    height: 5rem;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium); /* Use consistent shadow */
    animation: loginIconPulse 3s ease-in-out infinite;
}

.brand-icon-modern .material-icons {
    font-size: 2.5rem;
    color: white;
}

.brand-title {
    font-size: 2.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.05em;
}

.brand-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.welcome-section h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.welcome-section p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
}

@keyframes loginIconPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: var(--shadow-medium);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: var(--shadow-large);
    }
}

/* Modern Form */
.modern-login-form {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

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

.modern-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modern-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-primary);
    border: 2px solid var(--border-color); /* Use consistent border colors */
    border-radius: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.modern-input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 
        0 0 0 4px var(--primary-color-alpha),
        var(--shadow-small);
    transform: translateY(-2px);
}

.modern-input-wrapper.has-value {
    border-color: var(--success-color);
}

.modern-input-wrapper .input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-secondary);
    font-size: 1.25rem;
    z-index: 2;
    transition: color 0.3s ease;
}

.modern-input-wrapper:focus-within .input-icon {
    color: var(--primary-color);
}

.modern-input {
    width: 100%;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s ease;
}

.modern-input::placeholder {
    color: var(--text-muted);
    transition: opacity 0.3s ease;
}

.modern-input:focus::placeholder {
    opacity: 0.5;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-secondary);
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    z-index: 2;
}

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

/* Form Options */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0;
}

.modern-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

.modern-checkbox-input {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.modern-checkbox-custom {
    width: 1.25rem;
    height: 1.25rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 0.375rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modern-checkbox-input:checked + .modern-checkbox-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.modern-checkbox-custom .checkmark {
    font-size: 1rem;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.modern-checkbox-input:checked + .modern-checkbox-custom .checkmark {
    opacity: 1;
    transform: scale(1);
}

.forgot-link {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.forgot-link:hover {
    background: var(--primary-color-alpha);
    color: var(--primary-dark);
}

/* Modern Error Message */
.modern-error-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--error-light);
    border: 1px solid var(--error-color);
    border-radius: 1rem;
    color: var(--error-color);
    font-size: 0.875rem;
    font-weight: 500;
    animation: loginErrorSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modern-error-message .material-icons {
    font-size: 1.125rem;
}

@keyframes loginErrorSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modern Login Button */
.modern-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-small);
}

.modern-login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.modern-login-button:hover::before {
    left: 100%;
}

.modern-login-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.modern-login-button:active:not(:disabled) {
    transform: translateY(0);
}

.modern-login-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-loading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.loading-spinner-small {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Development Credentials */
.dev-credentials {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color); /* Use consistent border color */
}

.dev-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--dev-color);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.credentials-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.credential-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary); /* Use consistent background */
    border: 1px solid var(--border-light); /* Use consistent border */
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.credential-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.1), transparent);
    transition: left 0.5s;
}

.credential-card:hover::before {
    left: 100%;
}

.credential-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

.credential-card.mobile {
    opacity: 0.6;
}

.credential-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

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

.credential-icon.admin {
    background: linear-gradient(135deg, #7c2d12 0%, #ea580c 100%);
}

.credential-icon.user {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

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

.credential-icon .material-icons {
    font-size: 1.25rem;
    color: white;
}

.credential-info {
    flex: 1;
    min-width: 0;
}

.credential-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.credential-info p {
    margin: 0 0 0.5rem 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'Monaco', 'Consolas', monospace;
}

.credential-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.credential-badge.master {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
}

.credential-badge.admin {
    background: rgba(234, 88, 12, 0.1);
    color: #ea580c;
}

.credential-badge.user {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
}

.credential-badge.mobile {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.credential-note {
    font-size: 0.625rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    font-style: italic;
}

/* Footer */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    z-index: 2;
}

.login-footer p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary); /* Use consistent text color */
}

/* Responsive Design for Login */
@media (max-width: 640px) {
    .modern-login-container {
        padding: 1rem;
    }
    
    .modern-login-card {
        padding: 2rem 1.5rem;
        border-radius: 1.5rem;
    }
    
    .brand-icon-modern {
        width: 4rem;
        height: 4rem;
        margin-bottom: 1rem;
    }
    
    .brand-icon-modern .material-icons {
        font-size: 2rem;
    }
    
    .brand-title {
        font-size: 2.25rem;
    }
    
    .welcome-section h2 {
        font-size: 1.75rem;
    }
    
    .welcome-section p {
        font-size: 1rem;
    }
    
    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .credentials-grid {
        gap: 0.75rem;
    }
    
    .credential-card {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .credential-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .credential-icon .material-icons {
        font-size: 1rem;
    }
}

/* Error UI */
#blazor-error-ui {
    color-scheme: light only;
    background: var(--error-light);
    bottom: 0;
    box-shadow: var(--shadow-medium);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    border-top: 1px solid var(--error-color);
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
    color: var(--error-color);
}

.blazor-error-boundary {
    background: var(--error-color);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
    border-radius: var(--radius-md);
    margin: 1rem 0;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

code {
    color: var(--primary-color);
    background: var(--bg-tertiary);
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
}

/* Material Icons */
.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* Form Elements */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid var(--success-color);
}

.invalid {
    outline: 1px solid var(--error-color);
}

.validation-message {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Links */
a, .btn-link {
    color: var(--primary-color);
    transition: color 0.2s ease;
}

a:hover, .btn-link:hover {
    color: var(--primary-dark);
}

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

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