/* ─── STATS ROW ─── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
    cursor: default;
}

.stat-card:nth-child(1) {
    animation-delay: 0ms;
}

.stat-card:nth-child(2) {
    animation-delay: 80ms;
}

.stat-card:nth-child(3) {
    animation-delay: 160ms;
}

.stat-card:hover {
    border-color: var(--accent-purple);
}

.stat-label {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1;
    color: var(--text-primary);
}

.stat-sub {
    font-size: 11.5px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

/* ─── SECTION ─── */
.section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

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

.section-count {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-tertiary);
    background: var(--bg-active);
    border: 1px solid var(--border);
    padding: 1px 7px;
    border-radius: 20px;
}

/* ─── CONTENT TABS ─── */
.content-tabs {
    display: flex;
    gap: 2px;
    background: var(--bg-surface);
    border-radius: 8px;
    padding: 3px;
}

.content-tab {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-tertiary);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.content-tab:hover {
    color: var(--text-secondary);
}

.content-tab.active {
    background: var(--bg-active);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.tab-actions {
    display: flex;
    gap: 6px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* ─── TASK ITEM ─── */
.task-list {
    display: flex;
    flex-direction: column;
}

.task-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    will-change: transform, opacity;
    animation: fadeSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

.task-item:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}

.task-check {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    cursor: pointer;
}

.task-check:hover {
    border-color: var(--accent-purple);
}

.task-check.done {
    background: var(--accent-green);
    border-color: var(--accent-green);
    animation: checkPop 0.25s ease;
}

@keyframes checkPop {
    0% {
        transform: scale(0.8);
    }

    60% {
        transform: scale(1.2);
    }

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

.check-icon {
    color: #fff;
    font-size: 10px;
    display: none;
}

.task-check.done .check-icon {
    display: block;
}

.task-body {
    flex: 1;
}

.task-name {
    font-size: 13.5px;
    color: var(--text-primary);
    font-weight: 400;
    transition: color 0.2s;
}

.task-item.done-item {
    opacity: 0.5;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s ease;
}

.task-item.done-item .task-name {
    text-decoration: line-through;
    color: var(--text-tertiary);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.tag {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
}

.tag-work {
    background: var(--accent-blue-dim);
    color: var(--accent-blue);
}

.tag-health {
    background: var(--accent-green-dim);
    color: var(--accent-green);
}

.tag-personal {
    background: var(--accent-purple-dim);
    color: var(--accent-purple);
}

.tag-focus {
    background: var(--accent-amber-dim);
    color: var(--accent-amber);
}

.task-time {
    font-size: 10px;
    font-family: var(--mono);
    color: var(--text-tertiary);
}

.task-priority {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.p-high {
    background: var(--accent-rose);
    box-shadow: 0 0 6px var(--accent-rose);
}

.p-mid {
    background: var(--accent-amber);
}

.p-low {
    background: var(--text-tertiary);
}

/* ─── EMPTY STATE ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    gap: 12px;
}

.empty-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-active);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 4px;
}

.empty-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--accent-purple);
    stroke-width: 1.8;
}

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

.empty-desc {
    font-size: 12.5px;
    color: var(--text-tertiary);
    text-align: center;
    max-width: 200px;
    line-height: 1.6;
}

/* ─── HABIT CARDS ─── */
.habit-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.habit-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.1s;
}

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

.habit-item:hover {
    background: var(--bg-hover);
    transform: translateX(2px);
}

.habit-icon-wrap {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.habit-icon-wrap svg {
    width: 17px;
    height: 17px;
    stroke-width: 1.8;
    stroke: var(--text-secondary);
}

.habit-body {
    flex: 1;
}

.habit-name {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-primary);
}

.habit-streak-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 3px;
}

.streak-dots {
    display: flex;
    gap: 3px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--bg-active);
    border: 1px solid var(--border);
}

.dot.filled {
    border: none;
}

.streak-label {
    font-size: 10px;
    font-family: var(--mono);
    color: var(--text-tertiary);
}

.habit-check-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--bg-active);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.habit-check-btn:hover {
    border-color: var(--accent-green);
    background: var(--accent-green-dim);
    transform: scale(1.1);
}

.habit-check-btn.checked {
    background: var(--accent-green);
    border-color: var(--accent-green);
    color: #fff;
}

/* ─── RING CHART ─── */
.ring-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

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

.ring-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.ring-wrap {
    position: relative;
    width: 150px;
    height: 150px;
}

.ring-svg {
    transform: rotate(-90deg);
    width: 150px;
    height: 150px;
}

.ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
}

.ring-pct {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1;
}

.ring-sub {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
    margin-top: 2px;
}

.ring-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-val {
    margin-left: auto;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

/* ─── STREAK CALENDAR ─── */
.calendar-section {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.cal-title {
    font-size: 13px;
    font-weight: 600;
}

.cal-month {
    font-size: 11px;
    color: var(--text-tertiary);
    font-family: var(--mono);
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.cal-day-label {
    font-size: 9px;
    font-family: var(--mono);
    color: var(--text-tertiary);
    text-align: center;
    padding-bottom: 4px;
    text-transform: uppercase;
}

.cal-cell {
    aspect-ratio: 1;
    border-radius: 4px;
    background: var(--bg-active);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.cal-cell:hover {
    border-color: var(--accent-purple);
}

.cal-cell.l1 {
    background: rgba(124, 108, 255, 0.2);
    border-color: transparent;
}

.cal-cell.l2 {
    background: rgba(124, 108, 255, 0.45);
    border-color: transparent;
}

.cal-cell.l3 {
    background: rgba(124, 108, 255, 0.7);
    border-color: transparent;
}

.cal-cell.l4 {
    background: var(--accent-purple);
    border-color: transparent;
    box-shadow: 0 0 8px var(--accent-purple-glow);
}

.cal-cell.today {
    border: 1.5px solid var(--accent-purple) !important;
}

