/* ==========================================
   ADVANCED PREMIUM CRM DASHBOARD STYLES
   Features: Dual Themes (Light/Dark), Glassmorphism, 
   Micro-Animations, Custom Premium Widgets.
   ========================================== */

/* 1. Theme Configurations */
.adv-dashboard {
    --bg-surface: rgba(255, 255, 255, 0.7);
    --bg-surface-solid: #ffffff;
    --border-color: rgba(226, 232, 240, 0.8);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --shadow-premium: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 20px 40px -15px rgba(15, 23, 42, 0.15);
    --neon-blue: #3b82f6;
    --neon-emerald: #10b981;
    --neon-violet: #8b5cf6;
    --neon-rose: #f43f5e;
    --neon-amber: #f59e0b;
    --card-glow: rgba(59, 130, 246, 0.05);
    
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    padding-bottom: 4rem;
    transition: background 0.4s ease, color 0.4s ease;
}

/* Dark Theme Variables */
.adv-dashboard.dark-theme {
    --bg-surface: rgba(15, 23, 42, 0.65);
    --bg-surface-solid: #0f172a;
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --shadow-premium: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 20px 50px -10px rgba(59, 130, 246, 0.25);
    --neon-blue: #60a5fa;
    --neon-emerald: #34d399;
    --neon-violet: #a78bfa;
    --neon-rose: #fb7185;
    --neon-amber: #fbbf24;
    --card-glow: rgba(96, 165, 250, 0.15);
    
    background: #020617;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin: -0.5rem;
}

/* 2. Theme Toggle & Header Controls */
.dashboard-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1.5rem;
    animation: slideDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-switcher {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 4px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-premium);
}

.theme-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.theme-btn.active {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-violet));
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

/* 3. Interactive Filter Bar */
.filter-bar {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-premium);
    margin-bottom: 2rem;
    flex-wrap: wrap;
    animation: fadeIn 0.8s ease;
}

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

.filter-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.filter-select {
    background: var(--bg-surface-solid);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.filter-select:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* 4. Glassmorphism KPI Grid */
.premium-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.premium-kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 1.8rem;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}

.premium-kpi-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 80% 20%, var(--card-glow), transparent 60%);
    pointer-events: none;
}

.premium-kpi-card:hover {
    transform: translateY(-8px);
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-hover);
}

.kpi-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
}

.kpi-icon-wrapper {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;
    box-shadow: 0 8px 20px -5px rgba(0,0,0,0.15);
}

.kpi-trend-pill {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 6px;
}

.kpi-trend-up { background: rgba(16, 185, 129, 0.15); color: var(--neon-emerald); }
.kpi-trend-down { background: rgba(244, 63, 94, 0.15); color: var(--neon-rose); }
.kpi-trend-neutral { background: rgba(148, 163, 184, 0.15); color: var(--text-secondary); }

.kpi-value-premium {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 5px;
    letter-spacing: -1px;
}

.kpi-label-premium {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-muted);
}

.kpi-footer-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
    border-top: 1px dashed var(--border-color);
    padding-top: 10px;
}

/* 5. Custom Panel & Grid Layouts */
.premium-grid-2-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.premium-grid-1-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

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

.premium-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: border 0.3s;
}

.premium-panel:hover {
    border-color: rgba(59, 130, 246, 0.2);
}

.panel-header-premium {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.panel-title-premium {
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.panel-subtitle-premium {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

/* 6. Lead Conversion Funnel Widget */
.funnel-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1.5rem;
}

.funnel-stage {
    display: flex;
    align-items: center;
    height: 38px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.funnel-stage:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.funnel-label {
    width: 120px;
    padding-left: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    z-index: 2;
}

.funnel-bar-wrapper {
    flex: 1;
    height: 100%;
    background: rgba(148, 163, 184, 0.08);
    position: relative;
    border-radius: 0 8px 8px 0;
}

.funnel-bar-fill {
    height: 100%;
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 15px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #ffffff;
    transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset -5px 0 10px rgba(0,0,0,0.1);
}

.funnel-stage:nth-child(1) .funnel-bar-fill { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.funnel-stage:nth-child(2) .funnel-bar-fill { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
.funnel-stage:nth-child(3) .funnel-bar-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.funnel-stage:nth-child(4) .funnel-bar-fill { background: linear-gradient(90deg, #f97316, #ffedd5); color: var(--text-primary); }
.funnel-stage:nth-child(5) .funnel-bar-fill { background: linear-gradient(90deg, #10b981, #34d399); }

/* 7. Revenue Goals Progress Wheel Widget */
.goals-wheel-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.8s ease-in-out;
    stroke: rgba(148, 163, 184, 0.1);
}

.progress-ring-circle-fill {
    transition: stroke-dashoffset 0.8s ease-in-out;
    stroke: url(#goals-gradient);
    stroke-linecap: round;
}

.goals-inner-text {
    position: absolute;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.goals-percent {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-violet));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.goals-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 2px;
}

.goals-stat-row {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.goals-stat-item {
    text-align: center;
}

.goals-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
}

.goals-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* 8. Predictive Analytics Smart Widget */
.predictive-box {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.08), rgba(167, 139, 250, 0.08));
    border: 1px dashed var(--neon-blue);
    border-radius: 20px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.predictive-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-violet));
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.predictive-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: var(--neon-blue);
    display: flex;
    align-items: center;
    gap: 8px;
}

.predictive-rec {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    background: var(--bg-surface-solid);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-top: 10px;
    box-shadow: var(--shadow-premium);
}

/* 9. Interactive Task Manager Widget */
.task-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 5px;
    margin-bottom: 1.2rem;
}

.task-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.task-item:hover {
    border-color: var(--neon-blue);
    transform: translateX(4px);
    box-shadow: var(--shadow-premium);
}

.task-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.task-checkbox-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.task-checkbox {
    appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
}

.task-checkbox:checked {
    background: var(--neon-emerald);
    border-color: var(--neon-emerald);
}

.task-checkbox:checked::before {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: white;
    font-size: 0.7rem;
    position: absolute;
    left: 4px;
    top: 2px;
}

.task-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: all 0.2s;
}

.task-checkbox:checked ~ .task-text {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-tag {
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-urgent { background: rgba(244, 63, 94, 0.15); color: var(--neon-rose); }
.tag-normal { background: rgba(59, 130, 246, 0.15); color: var(--neon-blue); }
.tag-follow { background: rgba(245, 158, 11, 0.15); color: var(--neon-amber); }

.task-delete {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
    opacity: 0;
}

.task-item:hover .task-delete {
    opacity: 1;
}

.task-delete:hover {
    color: var(--neon-rose);
}

.add-task-form {
    display: flex;
    gap: 8px;
}

.add-task-input {
    flex: 1;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-primary);
    outline: none;
}

.add-task-btn {
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-violet));
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s;
}

.add-task-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* 10. Live Feed Widget */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 5px;
}

.feed-item {
    display: flex;
    gap: 15px;
    position: relative;
    padding-bottom: 5px;
}

.feed-item::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 40px;
    bottom: -15px;
    width: 2px;
    background: var(--border-color);
}

.feed-item:last-child::before {
    display: none;
}

.feed-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-surface-solid);
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 2;
}

.feed-body {
    flex: 1;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: var(--shadow-premium);
}

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

.feed-actor {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.feed-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.feed-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* 11. Quick Actions Control Deck */
.deck-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.deck-item {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    padding: 16px 12px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-premium);
}

.deck-item:hover {
    transform: translateY(-5px) scale(1.03);
    border-color: var(--neon-blue);
    box-shadow: var(--shadow-hover);
}

.deck-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.deck-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

/* 12. Premium Sleek Data Tables */
.premium-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
}

.premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

.premium-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    padding: 5px 16px;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.premium-table td {
    padding: 16px;
    background: var(--bg-surface-solid);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.premium-table tr:hover td {
    background: var(--bg-surface);
    color: var(--text-primary);
}

.premium-table td:first-child {
    border-radius: 14px 0 0 14px;
    border-left: 3px solid transparent;
}

.premium-table tr:hover td:first-child {
    border-left-color: var(--neon-blue);
}

.premium-table td:last-child {
    border-radius: 0 14px 14px 0;
}

/* 13. Glassmorphic Badges */
.badge-premium {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-confirmed { background: rgba(16, 185, 129, 0.12); color: var(--neon-emerald); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-pending { background: rgba(245, 158, 11, 0.12); color: var(--neon-amber); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-cancelled { background: rgba(244, 63, 94, 0.12); color: var(--neon-rose); border: 1px solid rgba(244, 63, 94, 0.2); }

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

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

@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

.pulse-glow-effect {
    animation: pulse-glow 2s infinite;
}

/* Scrollbar Customization within dashboard elements */
.task-list::-webkit-scrollbar,
.feed-list::-webkit-scrollbar {
    width: 6px;
}

.task-list::-webkit-scrollbar-track,
.feed-list::-webkit-scrollbar-track {
    background: transparent;
}

.task-list::-webkit-scrollbar-thumb,
.feed-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.task-list::-webkit-scrollbar-thumb:hover,
.feed-list::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* 14. Responsive Layouts & Overrides */
.dashboard-main-title {
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-violet));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.dashboard-controls-right {
    display: flex;
    gap: 12px;
    align-items: center;
}

.dashboard-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: center;
    flex: 1;
    width: 100%;
}

.dashboard-charts-grid > div {
    min-width: 0;
    width: 100%;
}

@media (max-width: 1024px) {
    .premium-grid-2-1,
    .premium-grid-1-2 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard-main-title {
        font-size: 1.7rem;
    }
    
    .dashboard-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }
    
    .dashboard-controls > div:first-child {
        width: 100%;
    }
    
    .dashboard-controls-right {
        width: 100%;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }
    
    .dashboard-controls-right .btn {
        margin-bottom: 0 !important;
        width: auto !important;
        flex: 1;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1.25rem;
        border-radius: 16px;
    }

    .filter-group {
        justify-content: space-between;
        width: 100%;
    }

    .filter-select {
        flex: 1;
        max-width: 220px;
    }

    #filter-reset {
        width: 100%;
        margin-top: 0.5rem;
    }

    .premium-grid-equal {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .premium-panel {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .dashboard-main-title {
        font-size: 1.4rem;
    }
    
    .kpi-value-premium {
        font-size: 1.8rem;
    }
    
    .premium-kpi-grid {
        grid-template-columns: 1fr;
    }
    
    .add-task-form {
        flex-wrap: wrap;
    }
    
    .add-task-input {
        min-width: 100%;
    }
    
    #dashboard-task-tag {
        flex: 1;
    }
    
    .add-task-btn {
        flex: 0 0 auto;
    }
}

/* ==========================================
   PORTAL ACCESS SECURITY & LOGIN STYLES
   ========================================== */

/* Hide dashboard app container by default when not logged in */
body:not(.logged-in) .app-container {
    display: none !important;
}

body.logged-in .login-screen {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), pointer-events 0.5s;
}

.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 50%, #0f1c3f 0%, #060b19 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    font-family: 'Outfit', sans-serif;
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

/* Background Glowing Orbs */
.login-screen::before,
.login-screen::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(150px);
    opacity: 0.15;
    z-index: 0;
    pointer-events: none;
}
.login-screen::before {
    background: #10b981;
    top: -100px;
    left: -100px;
}
.login-screen::after {
    background: #3b82f6;
    bottom: -100px;
    right: -100px;
}

.login-card {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10;
    text-align: center;
    animation: loginCardEntry 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.login-logo {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 0.2rem;
}

.login-subtitle {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 2.5rem;
}

.login-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.login-form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.6);
}

.login-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.login-input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    padding-right: 3rem;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.login-input-wrapper input:focus {
    border-color: #3b82f6;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.login-eye-btn {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    padding: 6px;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.login-eye-btn:hover {
    color: #ffffff;
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 0.85rem;
}

.login-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    user-select: none;
}

.login-checkbox-label input {
    display: none;
}

.login-checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.login-checkbox-label input:checked + .login-checkbox-custom {
    background: #10b981;
    border-color: #10b981;
}

.login-checkbox-label input:checked + .login-checkbox-custom::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.65rem;
    color: white;
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #3b82f6 100%);
    border: none;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 10px 20px -5px rgba(16, 185, 129, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(16, 185, 129, 0.4);
}

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

/* Shake Animation for Wrong Passwords */
.login-card.shake {
    animation: cardShake 0.4s ease-in-out;
}

@keyframes cardShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px); }
    40%, 80% { transform: translateX(8px); }
}

