/* ChoreKeeper — Clean Stylesheet */

/* ===== 1. VARIABLES ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-soft: #e0e7ff;
    --secondary: #ec4899;
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --danger: #ef4444;

    --bg: #f3f4f6;
    --bg-card: #ffffff;
    --text: #1f2937;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    --streak-gold: #fbbf24;
    --streak-orange: #f97316;

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -1px rgba(0, 0, 0, .06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -2px rgba(0, 0, 0, .05);

    --transition-fast: 150ms cubic-bezier(.4, 0, .2, 1);
    --transition-normal: 300ms cubic-bezier(.4, 0, .2, 1);
}

/* ===== 2. RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100dvh;
    overflow-x: hidden;
    width: 100%;
}

#app {
    width: 100%;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
button,
input,
select,
textarea {
    font-family: inherit;
    color: inherit;
}

.hidden {
    display: none !important;
}

.screen {
    min-height: 100dvh;
}

/* ===== 3. LOGIN ===== */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.logo {
    text-align: center;
    margin-bottom: var(--space-xl);
    color: white;
}

.logo-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: var(--space-sm);
    animation: sparkle 2s ease-in-out infinite;
}

.logo h1 {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.login-form {
    width: 100%;
    max-width: 360px;
    background: var(--bg-card);
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.input-group {
    margin-bottom: var(--space-md);
}

.input-group label {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

.input-group input {
    width: 100%;
    padding: .75rem var(--space-md);
    font-size: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg);
    transition: all var(--transition-fast);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.error-message {
    color: var(--danger);
    font-size: .875rem;
    text-align: center;
    margin-top: var(--space-md);
    min-height: 1.25rem;
}

@keyframes sparkle {

    0%,
    100% {
        transform: scale(1) rotate(0);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* ===== 4. BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn:active {
    transform: scale(.97);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, .4);
}

.btn-primary:hover {
    background: var(--primary-dark);
}

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

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}

.btn-ghost:hover {
    background: rgba(0, 0, 0, .05);
    color: var(--text);
}

.btn-large {
    width: 100%;
    padding: .875rem var(--space-lg);
    font-size: 1rem;
}

.btn-small {
    padding: var(--space-xs) var(--space-md);
    font-size: .875rem;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
    background: white;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1.125rem;
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    color: var(--primary);
    border-color: var(--primary-soft);
}

/* ===== 5. HEADER ===== */
#main-screen {
    padding-bottom: 80px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(243, 244, 246, .9);
}

.greeting {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.lang-select {
    height: 40px;
    padding: 0 var(--space-sm);
    font-size: .875rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    color: var(--text);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.lang-select:focus {
    outline: none;
    border-color: var(--primary);
}

/* ===== 6. STREAK & REWARDS ===== */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.streak-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: 0 var(--space-lg);
    padding: var(--space-lg);
    background: linear-gradient(135deg, var(--streak-orange), var(--streak-gold));
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 20px -5px rgba(249, 115, 22, .4);
    color: white;
    position: relative;
    overflow: hidden;
}

.streak-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, .1), transparent);
    pointer-events: none;
}

.streak-flame {
    font-size: 2.5rem;
    animation: flame 2s ease-in-out infinite alternate;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .1));
}

.streak-info {
    flex: 1;
}

.streak-number {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
}

.streak-label {
    font-size: .875rem;
    font-weight: 600;
    opacity: .9;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 4px;
}

.streak-best {
    font-size: .75rem;
    font-weight: 600;
    opacity: .9;
    background: rgba(255, 255, 255, .2);
    padding: 4px 8px;
    border-radius: var(--radius-md);
}

.streak-card.no-streak {
    background: var(--bg-card);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.streak-card.no-streak .streak-flame {
    filter: grayscale(1);
    opacity: .5;
    animation: none;
}

.streak-card.no-streak .streak-number {
    color: var(--text);
}

.streak-card.no-streak .streak-best {
    background: var(--bg);
    color: var(--text-muted);
}

.reward-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin: 0 var(--space-sm);
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, .4);
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.reward-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: auto;
    padding-left: 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.history-bars {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 24px;
}

.history-bar {
    width: 3px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 1px;
    transition: height 0.3s ease;
}

.history-bar:last-child {
    background: #fff;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.redeem-unit-btn {
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.reward-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, .1), transparent);
    pointer-events: none;
}

.reward-card.empty-balance {
    background: var(--bg-card);
    color: var(--text);
    box-shadow: none;
    border: 2px dashed var(--border);
    opacity: 0.7;
}

.reward-card.empty-balance .reward-icon {
    filter: grayscale(1) opacity(0.5);
    animation: none;
}

.reward-card.empty-balance .reward-number {
    color: var(--text-muted);
}

.reward-card.empty-balance .reward-history {
    border-left-color: var(--border);
}

.reward-card.empty-balance .history-bar {
    background: var(--border);
}

.reward-card.empty-balance::after {
    display: none;
}

.reward-icon {
    font-size: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .1));
    animation: sparkle 3s ease-in-out infinite alternate;
}

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

.reward-number {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.05em;
}

.reward-label {
    font-size: .75rem;
    font-weight: 600;
    opacity: .9;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes flame {
    from {
        transform: scale(1) rotate(-5deg);
    }

    to {
        transform: scale(1.1) rotate(5deg);
    }
}

/* ===== 7. TASK SECTIONS ===== */
.date-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-lg);
    margin: var(--space-md) auto var(--space-sm);
    max-width: 600px;
    padding: 0 var(--space-lg);
}

.date-header h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    min-width: 120px;
    text-align: center;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.task-section {
    padding: 0 var(--space-lg) var(--space-lg);
    max-width: 600px;
    margin: 0 auto;
}

.section-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.section-title-overdue {
    color: var(--warning);
}

/* ===== 8. TIME SLOTS ===== */
.time-slot {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: var(--space-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.time-slot.collapsed {
    opacity: .6;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}

.time-slot-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 1rem;
    font-weight: 700;
    padding: var(--space-md);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid var(--border-light);
    transition: background var(--transition-fast);
}

.time-slot.collapsed .time-slot-title {
    border-bottom: none;
}

.time-slot-title:hover {
    background: var(--bg);
}

.time-icon {
    opacity: .8;
}

.slot-summary {
    margin-left: auto;
    background: var(--bg);
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: var(--radius-md);
}

/* Active time slot */
.time-slot.active {
    border-color: var(--primary-light);
    box-shadow: 0 4px 20px -5px rgba(99, 102, 241, .15);
    position: relative;
}

.time-slot.active::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: -2px;
    width: 4px;
    background: var(--primary);
    border-radius: 4px;
    z-index: 1;
}

.time-slot.active .time-slot-title {
    color: var(--primary);
    background: #fbfbfe;
}

/* ===== 9. TASK LIST & ITEMS ===== */
.task-list {
    display: flex;
    flex-direction: column;
}

.time-slot.collapsed .task-list {
    display: none;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.task-item:last-child {
    border-bottom: none;
}

.task-item:hover {
    background: #fdfdfd;
}

.task-item:active {
    background: var(--bg);
}

.task-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    background: white;
    flex-shrink: 0;
    margin-top: 2px;
    transition: all var(--transition-fast);
}

.task-item:hover .task-checkbox {
    border-color: var(--primary-light);
}

/* Completed */
.task-item.completed {
    background: #fafafa;
}

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

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

.task-item.completed .task-description {
    opacity: .5;
}

/* Overdue */
.task-item.overdue {
    background: #fffbf0;
}

.task-item.overdue .task-checkbox {
    border-color: var(--warning);
}

/* Typography */
.task-content {
    flex: 1;
    min-width: 0;
}

.task-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.4;
}

.task-description {
    font-size: .875rem;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.4;
}

.task-badge {
    display: inline-block;
    font-size: .7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg);
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.task-badge.extra {
    background: #fdf2f8;
    color: var(--secondary);
}

/* Subtasks */
.task-item.subtask {
    padding-left: var(--space-xl);
    background: #fcfcfc;
}

.task-item.subtask .task-checkbox {
    width: 20px;
    height: 20px;
    font-size: .875rem;
}

/* Task Notes */
.task-notes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 4px 8px;
    background: var(--bg);
    border-radius: 6px;
    font-size: .8125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.task-notes:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.task-notes.readonly {
    cursor: default;
    background: transparent;
    padding-left: 0;
    margin-top: 4px;
}

.task-notes.readonly:hover {
    background: transparent;
}

.note-icon {
    opacity: .7;
}

/* Timer button on tasks */
.task-timer-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    opacity: .6;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    flex-shrink: 0;
}

.task-timer-btn:hover,
.task-timer-btn:active {
    opacity: 1;
    transform: scale(1.15);
}

.task-item.completed .task-timer-btn {
    display: none;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border);
    margin-top: var(--space-lg);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    opacity: .5;
}

/* Staggered slide-in */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-item {
    animation: slideIn .2s ease-out backwards;
}

.task-item:nth-child(1) {
    animation-delay: 50ms;
}

.task-item:nth-child(2) {
    animation-delay: 100ms;
}

.task-item:nth-child(3) {
    animation-delay: 150ms;
}

.task-item:nth-child(4) {
    animation-delay: 200ms;
}

.task-item:nth-child(5) {
    animation-delay: 250ms;
}

/* ===== 10. DAILY GOALS / REWARDS ===== */
.slot-goal-container {
    padding: var(--space-sm) var(--space-md) var(--space-lg);
    margin-top: 0;
}

.goal-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    border: 2px dashed var(--streak-gold);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    min-height: 80px;
    opacity: .7;
    filter: grayscale(.5);
    transition: all .4s ease;
}

.goal-card.completed {
    opacity: 1;
    filter: none;
    border-style: solid;
    box-shadow: 0 4px 12px -2px rgba(251, 191, 36, .3);
    background: linear-gradient(135deg, white 0%, #fffbeb 100%);
}

.goal-card.blocked {
    opacity: .5;
}

.goal-icon {
    font-size: 2rem;
    transition: transform .5s ease;
}

.goal-card.completed .goal-icon {
    animation: bounce .6s cubic-bezier(.28, .84, .42, 1);
}

.goal-text-content {
    flex: 1;
    text-align: left;
}

.goal-slot-name {
    display: none;
}

.goal-reward-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.goal-status-icon {
    font-size: 1rem;
    opacity: .5;
    color: var(--text-muted);
}

.goal-card.completed .goal-status-icon {
    color: var(--success);
    opacity: 1;
    font-weight: 900;
}

@keyframes bounce {
    0% {
        transform: scale(.8);
    }

    50% {
        transform: scale(1.4);
    }

    100% {
        transform: scale(1);
    }
}

/* ===== 11. FOCUS MODE ===== */

/* Keep the time-slot card look, just hide the active stripe */
body.focus-mode .time-slot::before {
    display: none;
}

body.focus-mode .section-title {
    display: none;
}

/* Slightly enlarge title text */
body.focus-mode .task-title {
    font-size: 1.15rem;
    font-weight: 700;
}

body.focus-mode .task-checkbox {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
}

/* Parent task as label */
body.focus-mode .task-group>.task-item.parent-task {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0;
    margin-bottom: var(--space-sm);
    opacity: .8;
    pointer-events: none;
}

body.focus-mode .task-group>.task-item.parent-task .task-title {
    font-size: .85rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

body.focus-mode .task-group>.task-item.parent-task .task-icon,
body.focus-mode .task-group>.task-item.parent-task .expand-chevron,
body.focus-mode .task-group>.task-item.parent-task .subtask-progress,
body.focus-mode .task-group>.task-item.parent-task .task-description {
    display: none;
}

/* Reward card spacing inside time-slot */
.goal-header {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.slot-goal-container {
    padding: var(--space-sm) var(--space-md) var(--space-md);
}

/* Up-next reset */
body.focus-mode .up-next-item {
    transform: none;
    box-shadow: none;
    border: none;
    padding: 6px 0;
    margin: 0;
}

/* Animation */
body.focus-mode .task-section.focus-active {
    animation: slideUpFade .4s ease-out;
}

body.focus-mode .up-next-container {
    animation: slideUpFade .5s ease-out .2s both;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== 12. FOCUS MODE COMPONENTS ===== */
.focus-task-container {
    padding: var(--space-sm) var(--space-md);
    position: relative;
}

.focus-task-container::before {
    content: none;
}

.focus-label {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .1em;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--space-xs);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.focus-label::before {
    content: '👉';
    font-size: 1rem;
}

.focus-task-container .task-item {
    border: none;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

.focus-task-container .task-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.focus-task-container .task-checkbox {
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
}

/* Up Next */
.focus-upcoming-section {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: rgba(255, 255, 255, .5);
    border-radius: var(--radius-md);
    border: 1px dashed var(--border);
}

.focus-upcoming-label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: .05em;
    margin-bottom: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 6px;
}

.focus-upcoming-label::before {
    content: '⏭️';
    font-size: .8rem;
}

.focus-upcoming-item {
    padding: 6px 0;
    font-size: .95rem;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.focus-upcoming-item:last-child {
    border-bottom: none;
}

.focus-upcoming-more {
    font-size: .85rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
    font-style: italic;
}

/* Completed Section */
.focus-completed-section {
    opacity: .7;
    margin-top: var(--space-lg);
}

.focus-completed-label {
    font-size: .875rem;
    font-weight: 600;
    color: var(--success);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) 0;
}

.focus-completed-list {
    margin-top: var(--space-sm);
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease-out;
}

.focus-completed-section:hover .focus-completed-list {
    max-height: 500px;
}

/* Up Next (old style) */
.up-next-container {
    margin-top: var(--space-xl);
    padding: var(--space-lg) var(--space-md) var(--space-sm);
    border-top: 1px solid var(--border);
}

.up-next-header {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-light);
    margin-bottom: var(--space-sm);
}

.up-next-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 0;
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
}

.up-next-icon {
    font-size: .5rem;
    line-height: 1;
    color: var(--text-light);
}

/* ===== 13. SYNC & OFFLINE ===== */
.sync-status {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: white;
    padding: 8px 16px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .875rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

.sync-icon {
    animation: spin 1s linear infinite;
}

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--text);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: .75rem;
    font-weight: 600;
    z-index: 300;
}

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

/* ===== 14. MODALS ===== */
.reward-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: var(--space-lg);
}

.reward-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

/* ===== 15. TIMER ===== */
.timer-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    animation: fadeIn var(--transition-normal);
}

.timer-modal-overlay.hidden {
    display: none;
}

.timer-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    width: min(320px, 90vw);
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideUp .3s ease-out;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.timer-task-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    text-align: left;
}

.timer-close {
    font-size: 1.2rem;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-xs);
    flex-shrink: 0;
}

.timer-visual {
    position: relative;
    width: 200px;
    height: 200px;
    margin: var(--space-md) auto;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-pie-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.timer-pie-fg {
    fill: none;
    stroke: #10b981;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 282.74;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 2s ease;
}

.timer-time {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.timer-time.hidden-numbers {
    font-size: 0;
}

.timer-controls {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    margin-top: var(--space-md);
}

.timer-controls .btn {
    min-width: 80px;
}

.timer-modal-overlay.timer-done .timer-modal {
    animation: timerDonePulse 1.5s ease-in-out infinite;
}

@keyframes timerDonePulse {

    0%,
    100% {
        box-shadow: var(--shadow-lg);
    }

    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, .4);
    }
}

/* ===== 16. CONFETTI ===== */
#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
}

/* ===== 17. FADE IN ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ===== 18. DARK MODE ===== */
.dark-mode {
    --bg: #111827;
    --bg-card: #1f2937;
    --text: #f3f4f6;
    --text-muted: #9ca3af;
    --text-light: #6b7280;
    --border: #374151;
    --border-light: #1f2937;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, .3), 0 2px 4px -1px rgba(0, 0, 0, .2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .3), 0 4px 6px -2px rgba(0, 0, 0, .2);
}

.dark-mode .login-form {
    box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, .3);
}

.dark-mode .input-group input {
    background: var(--bg);
}

.dark-mode .input-group input:focus {
    background: var(--bg-card);
}

.dark-mode .btn-ghost:hover {
    background: rgba(255, 255, 255, .1);
    color: var(--text);
}

.dark-mode .btn-icon {
    background: #374151;
    border-color: #4b5563;
    color: #d1d5db;
}

.dark-mode .btn-icon:hover {
    color: white;
    border-color: var(--primary-light);
    background: #4b5563;
}

.dark-mode .header {
    background: rgba(17, 24, 39, .8);
}

.dark-mode .lang-select {
    background: #374151;
    color: var(--text);
    border-color: #4b5563;
}

.dark-mode .streak-card.no-streak {
    background: var(--bg-card);
    color: var(--text-muted);
    border-color: var(--border);
}

.dark-mode .streak-card.no-streak .streak-number {
    color: var(--text);
}

.dark-mode .streak-card.no-streak .streak-best {
    background: var(--bg);
    color: var(--text-muted);
}

.dark-mode .time-slot {
    background: var(--bg-card);
    border-color: var(--border);
}

.dark-mode .time-slot-title:hover {
    background: var(--bg);
}

.dark-mode .time-slot.active {
    border-color: var(--primary);
}

.dark-mode .time-slot.active .time-slot-title {
    background: #1d2535;
}

.dark-mode .slot-summary {
    background: var(--bg);
    color: var(--text-muted);
}

.dark-mode .task-item,
.dark-mode .task-item.subtask {
    background: var(--bg-card);
    border-color: var(--border-light);
}

.dark-mode .task-item:hover {
    background: #2a3649;
}

.dark-mode .task-item:active {
    background: var(--bg);
}

.dark-mode .task-checkbox {
    background: #4b5563;
    border-color: #6b7280;
}

.dark-mode .task-item:hover .task-checkbox {
    border-color: var(--primary-light);
}

.dark-mode .task-item.completed {
    background: #1f2937;
    opacity: .7;
}

.dark-mode .task-item.completed .task-title {
    color: var(--text-light);
}

.dark-mode .task-item.overdue {
    background: #2c211a;
}

.dark-mode .task-item.overdue .task-checkbox {
    border-color: var(--warning);
}

.dark-mode .task-badge {
    background: var(--bg);
    color: var(--text-muted);
}

.dark-mode .task-badge.extra {
    background: #4a1d33;
    color: var(--secondary);
}

.dark-mode .empty-state {
    background: var(--bg-card);
    border-color: var(--border);
}

.dark-mode .reward-modal {
    background: var(--bg-card);
}

.dark-mode .timer-modal {
    background: var(--bg-card);
}

.dark-mode .timer-pie-bg {
    stroke: var(--border);
}

.dark-mode .goal-card {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1) 0%, rgba(245, 158, 11, 0.1) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

.dark-mode .goal-card.completed {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(251, 191, 36, 0.15) 100%);
    border-color: var(--streak-gold);
    box-shadow: 0 4px 12px -2px rgba(251, 191, 36, 0.2);
}

.dark-mode .focus-upcoming-section {
    background: rgba(0, 0, 0, 0.2);
}

/* Milestone Progress Styling */
.milestones-container {
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
}

.milestone-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
    padding: 0 var(--space-sm);
}

.milestone-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-sm);
    display: flex;
    gap: var(--space-md);
    align-items: center;
}

.milestone-icon {
    font-size: 1.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    background: var(--bg-card);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.milestone-content {
    flex: 1;
}

.milestone-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.milestone-title {
    font-size: 0.875rem;
    font-weight: 600;
}

.milestone-progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
}

.milestone-bar-bg {
    width: 100%;
    height: 8px;
    background: var(--bg);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.milestone-bar-fg {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.milestone-item.completed {
    opacity: 0.8;
    border-color: var(--success);
}

.milestone-item.completed .milestone-bar-fg {
    background: var(--success);
}

/* ===== 21. FUTURE TASKS ===== */
.task-item.future {
    opacity: 0.6;
    cursor: default;
}

.task-item.future .task-checkbox {
    background: var(--bg);
    border-color: var(--border-light);
}

.task-item.future:hover {
    background: var(--bg-card) !important;
}