/* ===== CSS RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Apple-inspired color palette */
    --primary: #007AFF;
    --primary-dark: #0051D5;
    --secondary: #5856D6;
    --success: #34C759;
    --warning: #FF9500;
    --danger: #FF3B30;
    
    /* Priority colors */
    --priority-high: #FF3B30;
    --priority-medium: #FF9500;
    --priority-low: #34C759;
    
    /* Glass effect colors */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-shadow: rgba(31, 38, 135, 0.15);
    
    /* Text colors */
    --text-primary: #FFFFFF;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-tertiary: rgba(255, 255, 255, 0.5);
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border radius */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== ANIMATED BACKGROUND ===== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 25%, 
        #F093FB 50%, 
        #4facfe 75%, 
        #00f2fe 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -2;
}

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

/* ===== FLOATING ORBS ===== */
.blur-orbs {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 107, 0.6) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(107, 203, 255, 0.6) 0%, transparent 70%);
    bottom: -250px;
    right: -250px;
    animation-delay: 7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(167, 107, 255, 0.6) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(100px, -100px) scale(1.1); }
    66% { transform: translate(-100px, 100px) scale(0.9); }
}

/* ===== GLASS CARD EFFECT ===== */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(31, 38, 135, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
.app-header {
    margin-bottom: var(--spacing-xl);
    animation: fadeInDown 0.6s ease-out;
}

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.app-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    box-shadow: 0 8px 32px rgba(0, 122, 255, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.app-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff, rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-stats {
    display: flex;
    gap: var(--spacing-sm);
}

.stat-card {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 100px;
}

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

.stat-card span:nth-child(2) {
    font-size: 1.75rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== CONTROLS SECTION ===== */
.controls-section {
    margin-bottom: var(--spacing-lg);
    animation: fadeInUp 0.6s ease-out 0.1s both;
    position: relative;
    z-index: 5;
}

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

.control-panel {
    padding: var(--spacing-md);
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    align-items: center;
}

.search-bar {
    flex: 1;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: var(--spacing-sm);
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.filters {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

/* ===== SHADCN-STYLE SELECT / LIQUID GLASS POPOVER ===== */
.shad-select {
    --shad-bg: rgba(255, 255, 255, 0.1);
    --shad-border: rgba(255, 255, 255, 0.22);
    --shad-fg: #ffffff;
    --shad-muted: rgba(255, 255, 255, 0.55);
    --shad-ring: rgba(0, 122, 255, 0.35);
    --shad-radius: 0.5rem;
    position: relative;
    min-width: 180px;
}

.shad-select-trigger {
    width: 100%;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(15, 18, 40, 0.45);
    border: 1px solid var(--shad-border);
    border-radius: var(--shad-radius);
    color: var(--shad-fg);
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    line-height: 1.25rem;
    cursor: pointer;
    text-align: left;
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.shad-select-trigger:hover {
    background: rgba(20, 24, 48, 0.55);
    border-color: rgba(255, 255, 255, 0.32);
}

.shad-select.is-open .shad-select-trigger,
.shad-select-trigger:focus-visible {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow:
        0 0 0 2px rgba(12, 14, 28, 0.55),
        0 0 0 4px var(--shad-ring),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.shad-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shad-select-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.55;
    font-size: 0.75rem;
    flex-shrink: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
}

.shad-select.is-open .shad-select-icon {
    transform: rotate(180deg);
    opacity: 0.9;
}

.shad-select-popover,
.glass-select-panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 50;
    min-width: 100%;
    width: max-content;
    max-width: 18rem;
    overflow: hidden;
    isolation: isolate;
    border-radius: calc(var(--shad-radius) + 2px);
    border: 1px solid rgba(255, 255, 255, 0.28);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.06) 42%, rgba(255, 255, 255, 0.1) 100%),
        rgba(18, 22, 48, 0.42);
    color: var(--shad-fg);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow:
        0 12px 40px rgba(20, 24, 60, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(255, 255, 255, 0.06);
    animation: shadPopoverIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: top center;
}

.shad-select-popover::before,
.glass-select-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(120% 80% at 10% -10%, rgba(255, 255, 255, 0.35), transparent 45%),
        radial-gradient(90% 60% at 90% 0%, rgba(120, 200, 255, 0.18), transparent 40%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 30%);
    opacity: 0.9;
    z-index: 0;
}

.shad-select-popover[hidden] {
    display: none;
}

@keyframes shadPopoverIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-4px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.shad-select-viewport {
    position: relative;
    z-index: 1;
    padding: 0.3rem;
    max-height: 15rem;
    overflow-y: auto;
    outline: none;
}

.shad-select-label {
    padding: 0.4rem 0.75rem 0.35rem 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--shad-muted);
    line-height: 1rem;
}

.shad-select-item {
    --refract-x: 50%;
    --refract-y: 50%;
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.45rem 0.65rem 0.45rem 2rem;
    border-radius: calc(var(--shad-radius) - 1px);
    border: 1px solid transparent;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: var(--shad-fg);
    cursor: pointer;
    user-select: none;
    outline: none;
    overflow: hidden;
    background: transparent;
    transition:
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.shad-select-item::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(
            140% 120% at var(--refract-x) var(--refract-y),
            rgba(255, 255, 255, 0.42) 0%,
            rgba(255, 255, 255, 0.14) 28%,
            rgba(120, 190, 255, 0.08) 52%,
            transparent 72%
        ),
        linear-gradient(
            125deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.04) 45%,
            rgba(255, 255, 255, 0.12) 100%
        );
    transition: opacity 0.16s ease;
    z-index: 0;
}

.shad-select-item > * {
    position: relative;
    z-index: 1;
}

.shad-select-item:hover,
.shad-select-item.is-highlighted {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 0 18px rgba(255, 255, 255, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.04);
}

.shad-select-item:hover::before,
.shad-select-item.is-highlighted::before {
    opacity: 1;
}

.shad-select-item:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
}

.shad-select-item.is-selected {
    background: rgba(0, 122, 255, 0.18);
    border-color: rgba(126, 200, 255, 0.28);
}

.shad-select-item.is-selected:hover,
.shad-select-item.is-selected.is-highlighted {
    background: rgba(0, 122, 255, 0.28);
}

.shad-select-item-indicator {
    position: absolute;
    left: 0.55rem;
    display: inline-flex;
    width: 0.875rem;
    height: 0.875rem;
    align-items: center;
    justify-content: center;
    opacity: 0;
    font-size: 0.8rem;
    color: #ffffff;
    z-index: 1;
}

.shad-select-item.is-selected .shad-select-item-indicator {
    opacity: 1;
}

.shad-select-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.priority-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    flex-shrink: 0;
}

.priority-dot.priority-high {
    background: var(--priority-high);
}

.priority-dot.priority-medium {
    background: var(--priority-medium);
}

.priority-dot.priority-low {
    background: var(--priority-low);
}

/* ===== PRIORITY SEGMENTED CONTROL ===== */
.priority-segmented {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
    padding: 0.35rem;
    background: rgba(15, 18, 40, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.priority-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.65rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.priority-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.priority-option.is-active {
    background: rgba(0, 122, 255, 0.35);
    border-color: rgba(126, 200, 255, 0.35);
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.priority-option:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.28);
}

/* ===== BUTTONS ===== */
.btn-primary {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

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

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== TASKS SECTION ===== */
.tasks-section {
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-count {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== TASKS GRID ===== */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

.task-card {
    padding: var(--spacing-md);
    animation: scaleIn 0.3s ease-out;
    cursor: default;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.task-card.task-completed {
    opacity: 0.7;
}

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

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.task-checkbox {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
}

.task-checkbox:hover {
    transform: scale(1.1);
    color: var(--success);
}

.task-checkbox.checked {
    color: var(--success);
}

.task-meta {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.priority-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.priority-high {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger);
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.priority-medium {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning);
    border: 1px solid rgba(255, 149, 0, 0.3);
}

.priority-low {
    background: rgba(52, 199, 89, 0.2);
    color: var(--success);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

.category-badge {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.task-content {
    margin-bottom: var(--spacing-sm);
}

.task-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.task-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.task-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.tag {
    padding: 0.25rem 0.6rem;
    background: rgba(88, 86, 214, 0.2);
    border: 1px solid rgba(88, 86, 214, 0.3);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--secondary);
}

.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.date-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
}

.action-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.delete-btn:hover {
    background: rgba(255, 59, 48, 0.2);
    color: var(--danger);
}

/* ===== EMPTY STATE ===== */
.empty-state {
    padding: var(--spacing-xl);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.empty-icon {
    font-size: 5rem;
    color: var(--text-tertiary);
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    font-weight: 600;
}

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

/* ===== DELETED TASKS ===== */
.deleted-tasks-grid {
    display: grid;
    gap: var(--spacing-sm);
}

.deleted-task-card {
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.deleted-task-content h4 {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.deleted-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.deleted-task-actions {
    display: flex;
    gap: var(--spacing-xs);
}

.btn-restore {
    padding: 0.5rem 1rem;
    background: rgba(52, 199, 89, 0.2);
    border: 1px solid rgba(52, 199, 89, 0.3);
    border-radius: 8px;
    color: var(--success);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-restore:hover {
    background: rgba(52, 199, 89, 0.3);
}

.btn-delete-permanent {
    padding: 0.5rem;
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: 8px;
    color: var(--danger);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete-permanent:hover {
    background: rgba(255, 59, 48, 0.3);
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

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

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--spacing-lg);
    animation: slideUp 0.3s ease-out;
}

.modal-content:has(.shad-select.is-open) {
    overflow: visible;
}

.form-group .shad-select {
    width: 100%;
    min-width: 0;
}

.form-group .shad-select-popover {
    z-index: 60;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
}

.modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.glass-input {
    width: 100%;
    padding: 0.75rem var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.glass-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.glass-input::placeholder {
    color: var(--text-tertiary);
}

textarea.glass-input {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.modal-actions button {
    flex: 1;
}

/* ===== TOAST NOTIFICATION ===== */
.toast {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(52, 199, 89, 0.9);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
}

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

.toast i {
    font-size: 1.25rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .app-title {
        font-size: 1.75rem;
    }
    
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-panel {
        flex-direction: column;
    }
    
    .search-bar,
    .filters {
        width: 100%;
    }
    
    .filters {
        flex-direction: column;
    }

    .shad-select {
        width: 100%;
    }
    
    .tasks-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: var(--spacing-sm);
    }
}

/* ===== AUTHENTICATION PAGES ===== */
.auth-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    min-height: 100vh;
    align-items: center;
}

.auth-card {
    padding: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out;
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.auth-header .app-icon {
    margin: 0 auto var(--spacing-sm);
}

.auth-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group-checkbox {
    display: flex;
    align-items: center;
    margin: var(--spacing-xs) 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn-full {
    width: 100%;
    justify-content: center;
    margin-top: var(--spacing-sm);
}

.auth-footer {
    margin-top: var(--spacing-lg);
    text-align: center;
    color: var(--text-secondary);
}

.auth-footer p {
    margin: var(--spacing-xs) 0;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.auth-info {
    padding: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.auth-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
}

.auth-info ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.auth-info li {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
}

.auth-info li i {
    font-size: 1.5rem;
    color: var(--success);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.auth-info li span {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== FLASH MESSAGES ===== */
.flash-message {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideInRight 0.3s ease-out;
    z-index: 9999;
    max-width: 400px;
}

.flash-success {
    background: rgba(52, 199, 89, 0.9);
    color: white;
}

.flash-danger {
    background: rgba(255, 59, 48, 0.9);
    color: white;
}

.flash-warning {
    background: rgba(255, 149, 0, 0.9);
    color: white;
}

.flash-info {
    background: rgba(0, 122, 255, 0.9);
    color: white;
}

.flash-message i {
    font-size: 1.25rem;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ===== ADMIN DASHBOARD ===== */
.stats-section {
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.admin-section {
    margin-bottom: var(--spacing-xl);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.admin-table {
    padding: var(--spacing-md);
    overflow-x: auto;
}

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

.admin-table thead {
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.admin-table th {
    padding: var(--spacing-sm);
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

.badge-admin {
    background: rgba(255, 149, 0, 0.2);
    color: var(--warning);
    border: 1px solid rgba(255, 149, 0, 0.3);
}

.badge-user {
    background: rgba(0, 122, 255, 0.2);
    color: var(--primary);
    border: 1px solid rgba(0, 122, 255, 0.3);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

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

/* ===== ACTIVITY SECTION ===== */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-md);
}

.activity-card {
    padding: var(--spacing-md);
}

.activity-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.activity-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.activity-item i {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.activity-item div {
    flex: 1;
}

.activity-item strong {
    display: block;
    margin-bottom: 0.25rem;
}

.activity-item span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ===== HEADER UPDATES ===== */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.user-info {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-admin {
    padding: 0.5rem 1rem;
    background: rgba(255, 149, 0, 0.2);
    border: 1px solid rgba(255, 149, 0, 0.3);
    border-radius: var(--radius-sm);
    color: var(--warning);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-admin:hover {
    background: rgba(255, 149, 0, 0.3);
}

.btn-logout {
    padding: 0.5rem 1rem;
    background: rgba(255, 59, 48, 0.2);
    border: 1px solid rgba(255, 59, 48, 0.3);
    border-radius: var(--radius-sm);
    color: var(--danger);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background: rgba(255, 59, 48, 0.3);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.guest-badge {
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.guest-badge i {
    color: var(--warning);
}

/* Responsive auth pages */
@media (max-width: 768px) {
    .auth-container {
        grid-template-columns: 1fr;
        padding: var(--spacing-md);
    }
    
    .auth-info {
        display: none;
    }
    
    .flash-message {
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        max-width: none;
    }
    
    .admin-table {
        overflow-x: scroll;
    }
    
    .activity-grid {
        grid-template-columns: 1fr;
    }
    
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .user-menu,
    .auth-buttons {
        width: 100%;
        flex-wrap: wrap;
    }
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}
