/* ===== Dashboard CSS Variables ===== */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #a855f7;
    --secondary-light: #c084fc;
    
    --accent-green: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;
    
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-soft: linear-gradient(135deg, #e0e7ff 0%, #fae8ff 100%);
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    --sidebar-width: 260px;
    --header-height: 80px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
    
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
}

/* ===== Dark Mode Theme ===== */
[data-theme="dark"] {
    --white: #1e293b;
    --gray-50: #0f172a;
    --gray-100: #1e293b;
    --gray-200: #334155;
    --gray-300: #475569;
    --gray-400: #64748b;
    --gray-500: #94a3b8;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f1f5f9;
    --gray-900: #f8fafc;
    
    --gradient-soft: linear-gradient(135deg, #312e81 0%, #581c87 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .sidebar {
    background: var(--gray-100);
    border-right-color: var(--gray-200);
}

[data-theme="dark"] .main-content {
    background: var(--gray-50);
}

[data-theme="dark"] .header {
    background: var(--gray-100);
    border-bottom-color: var(--gray-200);
}

[data-theme="dark"] .stat-card,
[data-theme="dark"] .card,
[data-theme="dark"] .task-card,
[data-theme="dark"] .badge-card,
[data-theme="dark"] .community-post,
[data-theme="dark"] .settings-section {
    background: var(--gray-100);
    border-color: var(--gray-200);
}

[data-theme="dark"] .task-card:hover {
    background: var(--gray-200);
}

[data-theme="dark"] .chart-bar {
    background: var(--gray-200);
}

[data-theme="dark"] .modal-content {
    background: var(--gray-100);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--gray-50);
    border-color: var(--gray-200);
    color: var(--gray-700);
}

/* ===== Reset ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    background: var(--gray-50);
    min-height: 100vh;
    display: flex;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

ul {
    list-style: none;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ===== Sidebar ===== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-base);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--gray-900);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: var(--radius-md);
    font-size: 1.25rem;
}

.sidebar-close {
    display: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    padding: 0.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    color: var(--gray-600);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: var(--gradient-soft);
    color: var(--primary);
    font-weight: 500;
}

.nav-item svg {
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--gray-100);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.back-home,
.logout-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    transition: color var(--transition-fast);
}

.back-home:hover {
    color: var(--primary);
}

.logout-link:hover {
    color: var(--accent-rose);
}

/* ===== Main Content ===== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== Header ===== */
.dashboard-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: var(--header-height);
}

.menu-toggle {
    display: none;
    padding: 0.5rem;
    color: var(--gray-600);
}

.header-greeting {
    flex: 1;
}

.header-greeting h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.header-greeting p {
    font-size: 0.9375rem;
    color: var(--gray-500);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 1.25rem;
}

.theme-toggle:hover {
    background: var(--gray-200);
    transform: rotate(15deg);
}

[data-theme="dark"] .theme-toggle {
    background: var(--gray-200);
    border-color: var(--gray-300);
}

.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

.streak-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: var(--radius-full);
}

.streak-icon {
    font-size: 1.25rem;
}

.streak-count {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.streak-label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--primary-light);
    cursor: pointer;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Content Wrapper ===== */
.content-wrapper {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ===== Content Sections ===== */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-icon {
    font-size: 2rem;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.stat-progress {
    height: 4px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stat-progress .progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: var(--progress);
    border-radius: var(--radius-full);
}

.stat-trend {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.stat-trend.positive {
    color: var(--accent-green);
}

/* ===== Today's Tasks Card ===== */
.today-tasks-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

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

.card-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
}

.phase-badge {
    padding: 0.375rem 0.875rem;
    background: var(--gradient-soft);
    color: var(--primary);
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: var(--radius-full);
}

.tasks-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.task-preview-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.task-preview-item:hover {
    background: var(--gray-100);
}

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

.task-number {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 50%;
}

.task-preview-item.completed .task-number {
    background: var(--accent-green);
}

.task-preview-item.completed .task-number::after {
    content: '✓';
}

.task-preview-info {
    flex: 1;
}

.task-preview-title {
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.task-preview-type {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.task-optional {
    padding: 0.25rem 0.5rem;
    background: var(--accent-amber);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    transition: all var(--transition-base);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--white);
    color: var(--gray-700);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

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

/* ===== Chart Card ===== */
.chart-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.chart-filters {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    background: var(--gray-100);
}

.filter-btn.active {
    background: var(--gray-900);
    color: var(--white);
}

.chart-container {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    height: 200px;
}

.chart-y-axis {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray-400);
    padding: 0.5rem 0;
}

.chart-bars {
    flex: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 0.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.chart-bar {
    flex: 1;
    max-width: 60px;
    height: var(--height);
    background: var(--gray-200);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    position: relative;
    transition: all var(--transition-base);
}

.chart-bar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    border-radius: inherit;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.chart-bar:hover::before,
.chart-bar.active::before {
    opacity: 1;
}

.bar-value {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-700);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.chart-bar:hover .bar-value,
.chart-bar.active .bar-value {
    opacity: 1;
}

.bar-label {
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.6875rem;
    color: var(--gray-500);
    white-space: nowrap;
}

.chart-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--gradient-soft);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--gray-600);
}

.chart-note svg {
    flex-shrink: 0;
    color: var(--primary);
}

/* ===== Badges Preview ===== */
.badges-preview {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.view-all {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    text-align: center;
}

.badge-item.earned {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.badge-item.in-progress {
    background: var(--gradient-soft);
}

.badge-item.locked {
    opacity: 0.5;
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.badge-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-900);
}

.badge-date,
.badge-progress,
.badge-status {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ===== Daily Tasks Section ===== */
.section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.section-header-row h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
}

.phase-info {
    font-size: 0.9375rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.day-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 50%;
    color: var(--gray-600);
    transition: all var(--transition-fast);
}

.nav-btn:hover:not(:disabled) {
    background: var(--gray-100);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.day-indicator {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* ===== Tasks Container ===== */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.task-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: all var(--transition-base);
}

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

.task-card.active {
    border-color: var(--primary-light);
}

.task-card.completed {
    background: var(--gray-50);
    opacity: 0.7;
}

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

.task-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.task-type-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-soft);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.task-meta-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.task-type-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    text-transform: capitalize;
}

.task-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.optional-tag {
    padding: 0.25rem 0.625rem;
    background: var(--accent-amber);
    color: var(--white);
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.task-card-body {
    margin-bottom: 1.5rem;
}

.task-description {
    font-size: 1rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.task-template {
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    font-style: italic;
    color: var(--gray-600);
}

.task-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color var(--transition-fast);
}

.task-input:focus {
    outline: none;
    border-color: var(--primary);
}

.task-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.task-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.task-option:hover {
    border-color: var(--primary-light);
    background: var(--white);
}

.task-option.selected {
    border-color: var(--primary);
    background: var(--gradient-soft);
}

.task-option input {
    display: none;
}

.option-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.task-option.selected .option-radio {
    border-color: var(--primary);
    background: var(--primary);
}

.task-option.selected .option-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--white);
    border-radius: 50%;
}

.option-text {
    flex: 1;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.breathing-exercise {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.breathing-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: var(--gradient-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    animation: breathe 8s ease-in-out infinite;
}

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

.breathing-text {
    font-size: 1.125rem;
    color: var(--gray-600);
}

.breathing-timer {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-top: 0.5rem;
}

.tap-challenge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
}

.tap-button {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-fast);
}

.tap-button:active {
    transform: scale(0.95);
}

.tap-counter {
    font-size: 1.125rem;
    color: var(--gray-600);
}

.tap-counter span {
    font-weight: 700;
    color: var(--primary);
}

.task-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fallback-link {
    font-size: 0.875rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fallback-link:hover {
    color: var(--primary);
}

/* ===== Day Completion ===== */
.day-completion {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    animation: fadeIn 0.3s ease;
}

.completion-content {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 3rem;
    text-align: center;
    max-width: 400px;
    animation: slideUp 0.3s ease;
}

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

.completion-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.completion-content h3 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.completion-content p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.completion-rewards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--gradient-soft);
    border-radius: var(--radius-md);
}

.reward-icon {
    font-size: 1.25rem;
}

.reward-value {
    font-weight: 600;
    color: var(--gray-900);
}

/* ===== Failure Is OK Card ===== */
.failure-ok-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.failure-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.failure-content {
    flex: 1;
}

.failure-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.failure-content p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.reflect-btn {
    padding: 0.625rem 1rem;
    background: var(--white);
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: var(--radius-full);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.reflect-btn:hover {
    background: var(--gray-100);
}

/* ===== Progress Section ===== */
.progress-overview {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
}

.cycle-progress {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    align-items: center;
}

.cycle-visual {
    position: relative;
}

.cycle-ring {
    width: 100%;
    height: auto;
}

.cycle-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cycle-day {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

.cycle-total {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.cycle-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.cycle-info > p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.phase-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.phase-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    background: var(--gray-50);
    transition: all var(--transition-fast);
}

.phase-item.completed {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
}

.phase-item.active {
    background: var(--gradient-soft);
    border: 2px solid var(--primary-light);
}

.phase-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    flex-shrink: 0;
}

.phase-item.completed .phase-dot {
    background: var(--accent-green);
}

.phase-item.active .phase-dot {
    background: var(--primary);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0); }
}

.phase-name {
    flex: 1;
    font-weight: 500;
    color: var(--gray-700);
}

.phase-days {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.stats-detailed {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.stats-detailed h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.stats-grid-detailed {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.detail-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
}

.detail-icon {
    font-size: 2rem;
}

.detail-info {
    display: flex;
    flex-direction: column;
}

.detail-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.detail-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

/* ===== Badges Section ===== */
#badges-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2rem;
}

.badge-category {
    margin-bottom: 2rem;
}

.badge-category h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 1rem;
}

.badges-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.badge-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.badge-card.earned {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.badge-card.in-progress {
    border: 2px solid var(--primary-light);
}

.badge-card.locked {
    opacity: 0.6;
}

.badge-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(251, 191, 36, 0.3) 0%, transparent 70%);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.badge-icon-large {
    font-size: 3rem;
    margin-bottom: 1rem;
    position: relative;
}

.badge-card h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.badge-card p {
    font-size: 0.8125rem;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.badge-earned-date,
.badge-unlock {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.badge-progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
}

.badge-progress-text {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 500;
}

/* ===== Avatar Section ===== */
.avatar-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    margin-top: 2rem;
}

.avatar-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.avatar-section > p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.avatar-emotions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.emotion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    min-width: 80px;
}

.emotion.unlocked {
    background: var(--gradient-soft);
}

.emotion.locked {
    opacity: 0.5;
}

.emotion span {
    font-size: 2rem;
}

.emotion label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* ===== Community Section ===== */
.community-intro {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    max-width: 600px;
}

.community-feed {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.community-post {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.community-post.your-post {
    border: 2px solid var(--primary-light);
    background: var(--gradient-soft);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.post-avatar {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: 50%;
    font-size: 1.5rem;
}

.post-info {
    display: flex;
    flex-direction: column;
}

.post-user {
    font-weight: 600;
    color: var(--gray-900);
}

.post-achievement {
    font-size: 0.875rem;
    color: var(--gray-600);
}

.post-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.reaction-btn:hover {
    background: var(--gray-200);
}

.reaction-btn.active {
    background: var(--gradient-soft);
}

.reaction-btn span {
    font-weight: 500;
    color: var(--gray-600);
}

.reaction-btn.add-reaction {
    color: var(--gray-400);
}

.community-note {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: var(--radius-md);
}

.community-note svg {
    color: var(--accent-green);
    flex-shrink: 0;
}

.community-note p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* ===== Settings Section ===== */
#settings-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 2rem;
}

.settings-group {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
}

.settings-group h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.setting-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-info label {
    display: block;
    font-weight: 500;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.setting-info p {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.setting-input {
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    min-width: 200px;
}

.setting-input:focus {
    outline: none;
    border-color: var(--primary);
}

.setting-input.time-input {
    min-width: 120px;
}

.setting-select {
    padding: 0.625rem 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    min-width: 200px;
    background: var(--white);
    cursor: pointer;
}

.toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--gray-300);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: var(--white);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.settings-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

.ethics-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.ethics-note svg {
    color: var(--accent-green);
}

/* ===== Modals ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--gray-400);
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--gray-600);
}

.reflection-modal {
    text-align: center;
}

.reflection-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.reflection-modal h3 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.reflection-modal > .modal-body > p {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.reflection-modal textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    resize: vertical;
    margin-bottom: 1rem;
}

.reflection-modal textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.reflection-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
    margin-bottom: 1.5rem;
}

.reflection-options label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.reflection-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .badges-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid-detailed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .cycle-progress {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .cycle-visual {
        max-width: 200px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-greeting h1 {
        font-size: 1.25rem;
    }
    
    .streak-badge {
        display: none;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .badges-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .section-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .day-navigation {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .failure-ok-card {
        flex-direction: column;
        text-align: center;
    }
    
    .stats-grid-detailed {
        grid-template-columns: 1fr;
    }
    
    .badges-row {
        grid-template-columns: 1fr;
    }
    
    .settings-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .badges-grid {
        grid-template-columns: 1fr;
    }
    
    .avatar-emotions {
        justify-content: center;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .setting-input,
    .setting-select {
        width: 100%;
    }
}
