/* 
 ==========================================================================
   MAGIC TASK MANAGER - PREMIUM STYLESHEET
   Aesthetics: Deep Cosmic Dark, Glassmorphism, Neon Accents, Fluid Motion
 ==========================================================================
*/

/* --- THEME SYSTEM AND CSS VARIABLES --- */
:root {
    /* Magic Dark System Palette */
    --bg-base: #080512;
    --bg-surface: rgba(18, 13, 38, 0.65);
    --bg-card: rgba(28, 21, 56, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(139, 92, 246, 0.25);
    
    /* Neon accents */
    --accent-purple: #8B5CF6;
    --accent-purple-glow: rgba(139, 92, 246, 0.5);
    --accent-indigo: #6366F1;
    --accent-emerald: #10B981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.3);
    --accent-rose: #F43F5E;
    --accent-amber: #F59E0B;
    
    /* Typography */
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    /* Telegram Theme Overrides (if available) */
    --tg-bg: var(--bg-base);
    --tg-text: var(--text-primary);
    --tg-hint: var(--text-secondary);
    --tg-link: var(--accent-purple);
    --tg-button: var(--accent-purple);
    --tg-button-text: #FFFFFF;
    
    /* Layout & Shadows */
    --nav-height: 72px;
    --header-height: 64px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
}

/* Telegram Native Theme Auto-Mapping */
body.telegram-theme {
    --bg-base: var(--tg-theme-bg-color, #080512);
    --text-primary: var(--tg-theme-text-color, #F3F4F6);
    --text-secondary: var(--tg-theme-hint-color, #9CA3AF);
    --accent-purple: var(--tg-theme-button-color, #8B5CF6);
    --bg-surface: rgba(from var(--tg-theme-secondary-bg-color, #120D26) r g b / 0.6);
}

/* --- RESET & BASE STYLES --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    overflow-x: hidden;
    position: relative;
    font-size: 15px;
    line-height: 1.5;
}

html {
    height: -webkit-fill-available;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.2);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 92, 246, 0.4);
}

/* --- PRELOADER ANIMATION --- */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #080512;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

body:not(.loading) .preloader {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.05);
}

.loader-content {
    text-align: center;
}

.magic-sparkle {
    font-size: 48px;
    animation: bounceSparkle 1.8s infinite ease-in-out;
    margin-bottom: 12px;
}

.loader-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #FFF 30%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.loader-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

.progress-bar {
    width: 140px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    margin: 0 auto;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-indigo), var(--accent-purple));
    border-radius: 10px;
    animation: fillProgress 1.5s infinite ease-in-out;
}

@keyframes bounceSparkle {
    0%, 100% { transform: translateY(0) scale(1) rotate(0deg); text-shadow: 0 0 10px rgba(139, 92, 246, 0.2); }
    50% { transform: translateY(-12px) scale(1.1) rotate(15deg); text-shadow: 0 0 25px var(--accent-purple-glow); }
}

@keyframes fillProgress {
    0% { width: 0%; }
    50% { width: 80%; }
    100% { width: 100%; }
}

/* --- DECORATIVE GLOW BACKGROUNDS --- */
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.28;
}
.bg-glow-1 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 80%);
    top: -50px;
    right: -100px;
    animation: drift 15s infinite alternate ease-in-out;
}
.bg-glow-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-indigo) 0%, transparent 80%);
    bottom: 50px;
    left: -150px;
    animation: drift 20s infinite alternate-reverse ease-in-out;
}
.bg-glow-3 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--accent-emerald) 0%, transparent 80%);
    top: 40%;
    right: -100px;
    opacity: 0.12;
}

@keyframes drift {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 30px) scale(1.15); }
}

/* --- APP CONTAINERS --- */
.app-container {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: var(--nav-height);
}

/* --- HEADER STYLES --- */
.app-header {
    height: var(--header-height);
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(8, 5, 18, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: white;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-greeting {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:active {
    transform: scale(0.92);
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--accent-purple);
}

.action-btn svg {
    width: 16px;
    height: 16px;
}

/* --- APP MAIN & VIEWS --- */
.app-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.app-view {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

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

.view-title {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Glassmorphism Panel Wrapper */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-premium);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

.panel-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    margin-bottom: 16px;
}

/* --- VIEW 1: TASKS DASHBOARD --- */
.task-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-top: 14px;
}

.task-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.task-tab-btn.active {
    background: var(--bg-card);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Stats Ribbon */
.stats-ribbon {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 6px;
    text-align: center;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-val {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.stat-lbl {
    font-size: 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.active-tasks .stat-val { color: var(--accent-purple); }
.overdue-tasks .stat-val { color: var(--accent-rose); }
.done-tasks .stat-val { color: var(--accent-emerald); }

/* Search filtering box */
.search-filter-box {
    margin-bottom: 16px;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 12px 12px 42px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.05);
    box-shadow: var(--shadow-glow);
}

/* Tasks List Empty States */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-surface);
    border: 1px dashed var(--border-glass);
    border-radius: var(--radius-lg);
}

.empty-emoji {
    font-size: 44px;
    display: block;
    margin-bottom: 10px;
    animation: floatEmoji 3s infinite ease-in-out;
}

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

.empty-state h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 16px;
    margin-bottom: 4px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 12px;
}

/* Task Cards */
.task-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-premium);
    position: relative;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: cardEntrance 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.task-card.high-prio { border-left: 3.5px solid var(--accent-rose); }
.task-card.med-prio { border-left: 3.5px solid var(--accent-amber); }
.task-card.low-prio { border-left: 3.5px solid var(--accent-emerald); }

.task-card.completed {
    opacity: 0.65;
    border-left-color: var(--text-muted);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.task-assignee {
    font-size: 13px;
    font-weight: 600;
    color: white;
}

.task-assignee span {
    color: var(--accent-purple);
}

.task-meta-badge {
    font-size: 9px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.5px;
}

.high-prio .task-meta-badge { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.med-prio .task-meta-badge { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.low-prio .task-meta-badge { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }
.task-card.completed .task-meta-badge { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }

.task-desc-content {
    font-size: 13px;
    color: var(--text-primary);
    word-break: break-word;
    margin-bottom: 12px;
    white-space: pre-line;
}

.task-card.completed .task-desc-content {
    text-decoration: line-through;
    color: var(--text-secondary);
}

.task-footer-info {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 10px;
    margin-bottom: 12px;
}

.task-deadline {
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-deadline.overdue {
    color: var(--accent-rose);
    font-weight: 600;
}

.task-regularity {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Task card control buttons */
.task-controls {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.task-ctrl-btn {
    padding: 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid var(--border-glass);
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.btn-ctrl-progress {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    border-color: rgba(139, 92, 246, 0.2);
}
.btn-ctrl-progress:active { background: rgba(139, 92, 246, 0.2); }

.btn-ctrl-complete {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border-color: rgba(16, 185, 129, 0.2);
}
.btn-ctrl-complete:active { background: rgba(16, 185, 129, 0.2); }

.btn-ctrl-stop {
    background: rgba(244, 63, 94, 0.05);
    color: var(--accent-rose);
    border-color: rgba(244, 63, 94, 0.1);
}
.btn-ctrl-stop:active { background: rgba(244, 63, 94, 0.15); }

.btn-ctrl-delete {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    grid-column: span 2;
}
.btn-ctrl-delete:active { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border-color: rgba(244, 63, 94, 0.2); }

/* --- FORM GENERAL DESIGN --- */
.magic-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: white;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-input:focus {
    border-color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.03);
    box-shadow: var(--shadow-glow);
}

.form-textarea {
    resize: none;
}

.form-help {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Custom autocomplete dropdown */
.custom-select-wrapper {
    position: relative;
}

.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #141029;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    max-height: 180px;
    overflow-y: auto;
    z-index: 50;
    display: none;
    box-shadow: var(--shadow-premium);
}

.autocomplete-dropdown.active {
    display: block;
}

.dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: rgba(139, 92, 246, 0.15);
    color: white;
}

/* Stepper Component */
.reminders-stepper {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 4px;
    width: fit-content;
}

.step-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.step-btn:hover { background: rgba(255, 255, 255, 0.05); }
.step-btn:active { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.step-val {
    width: 44px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

/* Submit Buttons */
.submit-btn {
    position: relative;
    width: 100%;
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    border: none;
    border-radius: var(--radius-md);
    padding: 14px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.25);
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
}

.submit-btn:hover {
    box-shadow: 0 4px 25px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 10px rgba(139, 92, 246, 0.2);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: all 0.5s ease;
    animation: buttonGlow 3s infinite linear;
}

@keyframes buttonGlow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Priority Badges */
.priority-badges {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.prio-badge input[type="radio"],
.regularity-chips input[type="radio"] {
    display: none;
}

.prio-badge {
    cursor: pointer;
}

.prio-badge .badge-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 4px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    transition: all 0.2s ease;
}

.badge-low input:checked + .badge-inner { background: rgba(16, 185, 129, 0.1); border-color: var(--accent-emerald); color: var(--accent-emerald); }
.badge-medium input:checked + .badge-inner { background: rgba(245, 158, 11, 0.1); border-color: var(--accent-amber); color: var(--accent-amber); }
.badge-high input:checked + .badge-inner { background: rgba(244, 63, 94, 0.1); border-color: var(--accent-rose); color: var(--accent-rose); }

/* Regularity chips */
.regularity-chips {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}
.reg-chip { cursor: pointer; }
.reg-chip .chip-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 4px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    transition: all 0.2s ease;
}
.reg-chip input:checked + .chip-inner {
    background: var(--bg-card);
    border-color: var(--accent-purple);
    color: white;
}

/* --- PREMIUM CALENDAR PICKER --- */
.datetime-picker-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}
.datetime-picker-trigger:active { border-color: var(--accent-purple); background: rgba(139, 92, 246, 0.03); }
.picker-value { color: white; font-weight: 500; }
.picker-icon { width: 16px; height: 16px; color: var(--text-secondary); }

.calendar-modal {
    background: #110d24;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 10px;
    box-shadow: var(--shadow-premium);
    display: none;
    flex-direction: column;
    gap: 12px;
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.calendar-modal.active { display: flex; }

.ids-table th, .ids-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}
.ids-table th {
    color: var(--text-secondary);
    font-weight: 500;
}
.copyable {
    cursor: pointer;
    transition: color 0.2s;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
}
.copyable:hover {
    color: var(--primary);
    background: rgba(255,255,255,0.1);
}

.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    text-shadow: 0 0 10px rgba(111, 66, 193, 0.3);
}
.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}
.stat-card.complete .stat-value { color: #10b981; }
.stat-card.staff .stat-value { color: #3b82f6; }
.stat-card.bridges .stat-value { color: #f59e0b; }

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

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

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.calendar-nav-btn {
    background: transparent;
    border: none;
    color: var(--accent-purple);
    font-size: 14px;
    padding: 6px 12px;
    cursor: pointer;
}
.calendar-month-year { font-size: 14px; font-weight: 700; color: white; font-family: 'Outfit', sans-serif; }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 6px;
}
.weekday-lbl { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; padding: 4px 0; }

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}
.calendar-day {
    padding: 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s ease;
}
.calendar-day:hover { background: rgba(255, 255, 255, 0.05); }
.calendar-day.empty { pointer-events: none; }
.calendar-day.selected {
    background: linear-gradient(135deg, var(--accent-indigo), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.2);
}
.calendar-day.today {
    border: 1px solid var(--accent-purple);
    color: var(--accent-purple);
}
.calendar-day.today.selected { color: white; }

.calendar-time-picker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 12px;
    font-size: 13px;
}
.time-inputs { display: flex; align-items: center; gap: 4px; }
.time-inputs input {
    width: 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 6px;
    padding: 6px;
    color: white;
    text-align: center;
    outline: none;
    font-size: 13px;
}

.calendar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
}
.calendar-btn {
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: none;
}
.calendar-btn.btn-secondary { background: rgba(255, 255, 255, 0.05); color: var(--text-secondary); }
.calendar-btn.btn-primary { background: var(--accent-purple); color: white; }

/* --- VIEW 3: STAFF & TEAM PANEL --- */
.staff-action-panel { padding-bottom: 24px; }
.staff-action-panel h3 { font-size: 14px; font-weight: 700; margin-bottom: 12px; font-family: 'Outfit', sans-serif; }
.input-row { display: flex; gap: 10px; }
.add-btn {
    background: var(--accent-purple);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
}
.add-btn:active { transform: scale(0.95); }

.staff-section { margin-top: 10px; }
.section-subtitle { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }

.staff-member-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.staff-member-info { display: flex; align-items: center; gap: 10px; }
.staff-member-info .avatar { width: 32px; height: 32px; font-size: 12px; }
.staff-name { font-size: 13px; font-weight: 600; }
.staff-delete-btn {
    background: transparent;
    border: none;
    color: var(--accent-rose);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}
.staff-delete-btn:active { transform: scale(0.85); }

/* --- VIEW 4: PAYMENTS & FINANCE --- */
.payment-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
}
.pay-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
}
.pay-tab-btn.active { background: var(--bg-card); color: white; border: 1px solid rgba(255, 255, 255, 0.05); }

.pay-tab-content { display: none; }
.pay-tab-content.active { display: block; }

.finance-panel h3 { font-size: 14px; font-weight: 700; font-family: 'Outfit', sans-serif; }
.finance-submit { margin-top: 10px; font-size: 13px; padding: 12px; }

.finance-section { margin-top: 24px; }
.payment-route-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.payment-route-details { display: flex; flex-direction: column; gap: 2px; }
.route-service-name { font-size: 13px; font-weight: 700; color: var(--accent-purple); }
.route-email-val { font-size: 11px; color: var(--text-secondary); }

.crypto-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-premium);
}
.crypto-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.crypto-name { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 700; }
.crypto-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); padding: 2px 8px; border-radius: 10px; }
.crypto-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 16px; }

.address-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px;
}
.address-lbl { font-size: 10px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.address-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.address-val { font-family: monospace; font-size: 13px; color: white; }
.copy-btn { background: transparent; border: none; font-size: 14px; cursor: pointer; padding: 4px; }

/* --- VIEW 5: AI & MOTIVATION --- */
.ai-panel h3 { font-size: 14px; font-weight: 700; font-family: 'Outfit', sans-serif; }
.ai-brain-icon { font-size: 20px; }
.ai-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.ai-submit { margin-top: 10px; font-size: 13px; padding: 12px; }

.motivation-section {
    background: radial-gradient(circle at 10% 10%, #1d123b, var(--bg-surface));
    border: 1px solid rgba(139, 92, 246, 0.18);
    box-shadow: 0 10px 25px -10px rgba(139, 92, 246, 0.15);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 10px;
}
.motivation-header { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent-purple); margin-bottom: 12px; }
.motivation-quote { font-size: 14px; font-style: italic; color: white; line-height: 1.6; margin-bottom: 16px; }
.refresh-quote-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.refresh-quote-btn:active { background: rgba(255, 255, 255, 0.05); color: white; }

/* --- BOTTOM STICKY NAVIGATION BAR --- */
.app-nav {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background: rgba(18, 18, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    margin: 0 15px 15px 15px;
    padding: 12px 10px;
    position: sticky;
    bottom: 15px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
    border-radius: 12px;
    flex: 1;
}

.nav-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-label {
    font-size: 10px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-item.active {
    color: var(--accent-purple);
}

.nav-item.active .nav-icon {
    transform: scale(1.18) translateY(-2px);
    filter: drop-shadow(0 0 5px rgba(139, 92, 246, 0.4));
}

.nav-item.active .nav-label {
    font-weight: 700;
    color: white;
}

/* --- TOAST NOTIFICATIONS --- */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: calc(100% - 40px);
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: rgba(18, 14, 38, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-premium);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toastSlideIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.removing {
    opacity: 0;
    transform: translate(-50%, -20px) scale(0.9);
}

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

.toast-success { border-left: 3.5px solid var(--accent-emerald); }
.toast-error { border-left: 3.5px solid var(--accent-rose); }
.toast-info { border-left: 3.5px solid var(--accent-purple); }

.toast-icon { font-size: 16px; }

/* --- AUTHENTICATION VIEW STYLES --- */
.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px 0;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

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

.auth-icon {
    font-size: 48px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.5));
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
}

.auth-card {
    width: 100%;
    max-width: 350px;
    padding: 24px;
    text-align: left;
}

.auth-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.auth-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.4;
}

.auth-owner-hint {
    margin-top: 15px;
    border-style: dashed;
    background: rgba(255, 255, 255, 0.02);
}

.auth-owner-hint .auth-card-desc {
    margin-bottom: 0;
}

.auth-owner-hint code {
    background: rgba(139, 92, 246, 0.2);
    color: var(--accent-purple);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 14px;
}

/* --- SIDE DRAWER MENU --- */
.drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.drawer-overlay.active {
    opacity: 1;
    pointer-events: auto;
}
.side-drawer {
    position: fixed;
    top: 0; right: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-glass);
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}
.side-drawer.active {
    right: 0;
}
.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-glass);
}
.drawer-header h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
}
.close-drawer {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}
.drawer-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.drawer-item {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 16px;
    text-align: left;
    padding: 12px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}
.drawer-item:hover, .drawer-item:active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

/* --- ACTION SHEET (BOTTOM SHEET) --- */
.action-sheet {
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    background: var(--bg-surface);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    z-index: 1000;
    transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding-bottom: env(safe-area-inset-bottom, 20px);
    border-top: 1px solid var(--border-glass);
}
.action-sheet.active {
    bottom: 0;
}
.sheet-indicator {
    width: 40px;
    height: 5px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    margin: 12px auto;
}
.sheet-content {
    padding: 10px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.sheet-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-glass);
    padding: 15px;
    border-radius: 16px;
    color: white;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}
.sheet-item:active {
    background: rgba(255,255,255,0.1);
}
.sheet-icon {
    font-size: 24px;
}
.sheet-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sheet-text strong {
    font-size: 16px;
    font-weight: 600;
}
.sheet-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

