:root {
    /* Base Colors - Safe & Elite Blue */
    --bg: #FAFAFA;
    --surface: #FFFFFF;
    --surface-secondary: #F3F4F6;
    --border: #E5E7EB;
    
    /* Text */
    --text-primary: #0F172A;
    --text-secondary: #334155;
    --text-muted: #64748B;
    
    /* Accents */
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --success: #0D9488;
    --danger: #E11D48;
    --warning: #D97706;
    
    /* System */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Urgency Colors (Professional & Solid) */
    --u-red: #FEE2E2;
    --u-red-text: #991B1B;
    --u-orange: #FFEDD5;
    --u-orange-text: #9A3412;
    --u-yellow: #FEF9C3;
    --u-yellow-text: #854D0E;
    --u-green: #DCFCE7;
    --u-green-text: #166534;
    --u-blue: #DBEAFE;
    --u-blue-text: #1E40AF;
    --u-neutral: #F3F4F6;
    --u-neutral-text: #374151;
}

[data-theme="dark"] {
    --bg: #0B0F14;
    --surface: #111827;
    --surface-secondary: #1F2937;
    --border: #2A3342;
    
    --text-primary: #E5E7EB;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    
    --primary: #3B82F6;
    --primary-hover: #60A5FA;
    --success: #22D3EE;
    --danger: #FB7185;
    --warning: #F59E0B;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);

    /* Urgency Dark */
    --u-red: #450A0A;
    --u-red-text: #FCA5A5;
    --u-orange: #431407;
    --u-orange-text: #FDBA74;
    --u-yellow: #422006;
    --u-yellow-text: #FDE047;
    --u-green: #064E3B;
    --u-green-text: #6EE7B7;
    --u-blue: #1E3A8A;
    --u-blue-text: #93C5FD;
    --u-neutral: #111827;
    --u-neutral-text: #D1D5DB;
}

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

body {
    background-color: var(--bg);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

/* Typography */
h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
    margin-bottom: 2rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
}

p {
    color: var(--text-secondary);
}

/* Base UI Components */
.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    text-decoration: none;
    gap: 0.5rem;
    white-space: nowrap;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background-color: var(--border);
}

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

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

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

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.2s ease, ring 0.2s ease;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Dashboard Specifics */
.todo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.list-card {
    position: relative;
    border-top: 4px solid var(--primary);
}

.list-card.has-urgent {
    border-top-color: var(--danger);
}

.urgent-indicator {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 10px;
    height: 10px;
    background-color: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--u-red);
    display: none;
}

.has-urgent .urgent-indicator {
    display: block;
}

/* Task List Styles */
.task-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 2rem 0 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.task-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border);
}

.task-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 0.75rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.task-item:hover {
    box-shadow: var(--shadow-sm);
}

.task-checkbox {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--border);
    margin-right: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

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

.task-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    font-weight: 900;
}

.task-content {
    flex: 1;
}

.task-item.completed {
    opacity: 0.6;
}

.task-item.completed .task-content {
    text-decoration: line-through;
    color: var(--text-muted);
}

/* Urgency Elements */
.urgency-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.urgency-red { background: var(--u-red); color: var(--u-red-text); border-left: 3px solid var(--danger); }
.urgency-orange { background: var(--u-orange); color: var(--u-orange-text); border-left: 3px solid var(--warning); }
.urgency-yellow { background: var(--u-yellow); color: var(--u-yellow-text); border-left: 3px solid #EAB308; }
.urgency-green { background: var(--u-green); color: var(--u-green-text); border-left: 3px solid var(--success); }
.urgency-blue { background: var(--u-blue); color: var(--u-blue-text); border-left: 3px solid var(--primary); }
.urgency-purple { background: var(--u-neutral); color: var(--u-neutral-text); border-left: 3px solid var(--text-muted); }

/* Navigation */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--primary);
}

/* Collaborator UI */
.collab-tag {
    display: inline-flex;
    align-items: center;
    background-color: var(--surface-secondary);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    margin: 0.5rem 0.5rem 0 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.remove-collab {
    margin-left: 0.5rem;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
}

.search-results {
    position: absolute;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    width: 100%;
    z-index: 50;
    max-height: 200px;
    overflow-y: auto;
}

.search-item {
    padding: 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.search-item:hover {
    background-color: var(--primary);
    color: white;
}

/* Task Metadata */
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: slideUp 0.3s ease-out forwards;
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding-top: 5rem;
    padding-bottom: 2rem;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 650px;
    margin: 0 auto 3rem;
    color: var(--text-secondary);
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn-hero {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
}

/* Auth Pages */
.auth-container {
    max-width: 400px;
    margin: 4rem auto;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Responsive Overrides */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem 1rem;
    }

    nav {
        flex-direction: column;
        gap: 1.25rem;
        align-items: flex-start;
        margin-bottom: 2rem;
    }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .nav-links a, .nav-links span {
        font-size: 0.8125rem;
    }

    .nav-links .btn {
        padding: 0.5rem 0.75rem;
    }

    h1 {
        font-size: 1.75rem;
        margin-bottom: 1.5rem;
    }

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

    /* List View Specifics */
    .list-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch !important;
    }

    #task-form {
        flex-direction: column;
    }

    #task-form input, #task-form select, #task-form button {
        width: 100% !important;
        flex: none !important;
    }

    .task-item {
        padding: 0.875rem;
    }

    .task-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    /* Dashboard Action Buttons */
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .dashboard-header .btn {
        width: 100%;
    }

    .list-card-actions {
        flex-wrap: wrap;
    }
    
    .list-card-actions .btn {
        flex: 1;
        font-size: 0.75rem;
        padding: 0.5rem;
    }

    /* Hero Section */
    .hero-section {
        padding-top: 2rem;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
        gap: 1rem;
    }

    .hero-actions .btn {
        width: 100%;
    }

    .btn-hero {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .stack-on-mobile {
        flex-direction: column !important;
    }

    .stack-on-mobile > * {
        width: 100% !important;
        flex: none !important;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.25rem;
    }

    .card {
        padding: 1rem;
    }

    .auth-container {
        margin-top: 2rem;
    }
}

