/* ====================
   CSS Variables & Reset
   ==================== */
:root {
    --bg-primary: #08090d;
    --bg-secondary: #0f1117;
    --bg-card: rgba(255, 255, 255, 0.035);
    --bg-card-hover: rgba(255, 255, 255, 0.065);
    --bg-elevated: rgba(255, 255, 255, 0.07);
    --bg-sidebar: #0b0c12;

    --text-primary: #eeeef3;
    --text-secondary: #8b8da0;
    --text-tertiary: #4e5064;

    --accent-primary: #FF5E4F;
    --accent-secondary: #ff7e6f;
    --accent-glow: rgba(255, 94, 79, 0.15);
    --accent-gradient: #FF5E4F;

    --border-color: transparent;
    --border-radius-sm: 12px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;

    --transition-fast: 0.18s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-normal: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --sidebar-width: 240px;
    --header-height: 80px;

    --glass-bg: rgba(255, 255, 255, 0.025);
    --glass-border: transparent;
    --glass-shadow: none;
}

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

html {
    height: 100%;
    width: 100%;
    overflow: hidden;
}

body {
    height: 100%;
    width: 100%;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====================
   App Layout
   ==================== */
.app-layout {
    display: flex;
    height: 100vh;
    position: relative;
}

/* ====================
   Sidebar
   ==================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 28px 16px;
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    transition: transform var(--transition-normal);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    margin-bottom: 36px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

@keyframes sparkle {

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

    50% {
        opacity: 0.7;
        transform: scale(0.9) rotate(10deg);
    }
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav .nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    width: 100%;
    text-align: left;
}

.sidebar-nav .nav-item:hover {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    transform: translateX(2px);
}

.sidebar-nav .nav-item.active {
    background: rgba(255, 94, 79, 0.08);
    color: var(--accent-primary);
    box-shadow: inset 3px 0 0 var(--accent-primary);
}

.sidebar-nav .nav-item.active svg {
    stroke: var(--accent-primary);
}

.sidebar-nav .nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* User Profile */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-info .user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-status {
    font-size: 12px;
    color: #4ade80;
}

/* ====================
   Mobile Menu
   ==================== */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 60;
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ====================
   Main Content
   ==================== */
.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto;
    padding: 40px 48px;
    min-width: 0;
}

/* ====================
   Header
   ==================== */
.main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 40px;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.header-date {
    font-size: 72px;
    font-weight: 300;
    letter-spacing: -3px;
    line-height: 1;
    color: var(--text-primary);
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    align-self: stretch;
    padding: 2px 0;
}

.header-logo-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.header-day {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: -0.2px;
}

/* Home Greeting (no card) */
.home-greeting {
    margin-bottom: 32px;
}

.greeting-hello {
    font-size: 17px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.greeting-hello strong {
    color: var(--text-primary);
    font-weight: 600;
}

.greeting-hello .emoji {
    font-size: 18px;
}

.greeting-summary {
    font-size: 16px;
    color: var(--text-tertiary);
    line-height: 1.7;
}

/* CTA Button */
.add-plan-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: #ffffff;
    border: none;
    border-radius: 50px;
    color: #111;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    margin-bottom: 48px;
}

.add-plan-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: translateY(-1px);
}

.add-plan-btn:active {
    transform: scale(0.97);
}

.btn-logo-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

/* ====================
   Schedule Section
   ==================== */
.schedule-section {
    margin-top: 16px;
}

.schedule-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 20px;
}

.schedule-title {
    font-size: 40px;
    font-weight: 300;
    letter-spacing: -1.5px;
    color: var(--text-primary);
    line-height: 1;
}

.schedule-subtitle {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-tertiary);
    letter-spacing: -0.2px;
}

.schedule-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.edit-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.edit-mode-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.edit-item {
    cursor: default;
    transition: transform 0.3s ease, background 0.3s ease;
    overflow: hidden;
    position: relative;
}

.time-tag-btn {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(255, 107, 91, 0.12);
    border: 1px solid rgba(255, 107, 91, 0.25);
    border-radius: 12px;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    margin-bottom: 6px;
}

.time-tag-btn:hover {
    background: rgba(255, 107, 91, 0.22);
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.edit-title-btn {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.edit-title-btn:hover {
    color: var(--accent-secondary);
}

.swipe-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    opacity: 0.5;
    white-space: nowrap;
    flex-shrink: 0;
}

.edit-time {
    color: var(--accent-secondary) !important;
}

/* Delete Modal */
.delete-confirm-text {
    font-size: 16px;
    color: var(--text-secondary);
    text-align: center;
    padding: 8px 0;
}

.delete-footer {
    display: flex;
    gap: 12px;
}

.cancel-btn {
    flex: 1;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.cancel-btn:hover {
    background: var(--bg-elevated);
}

.delete-btn {
    flex: 1;
    padding: 14px;
    background: #dc3545;
    border: none;
    border-radius: var(--border-radius-md);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.delete-btn:hover {
    background: #c82333;
    transform: translateY(-1px);
}

/* Rename Input */
.rename-input-field {
    width: 100%;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 16px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.rename-input-field:focus {
    border-color: var(--accent-primary);
}

/* ====================
   Cards
   ==================== */
.card {
    background: var(--glass-bg);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 28px;
    position: relative;
    overflow: hidden;
}

/* Progress card on home */
.progress-card {
    margin-bottom: 32px;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.card-header .header-sub {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 400;
    font-style: italic;
}

.tag {
    display: inline;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 13px;
    white-space: nowrap;
}

.tag-time {
    background: rgba(255, 94, 79, 0.15);
    color: var(--accent-primary);
}

.tag-task {
    background: rgba(255, 138, 122, 0.1);
    color: var(--accent-secondary);
}

/* Progress Card */
.progress-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.progress-ring-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 8px 0 20px;
}

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

.progress-ring-bg {
    fill: none;
    stroke: var(--bg-elevated);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#progressGradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.73;
    stroke-dashoffset: 326.73;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.progress-percent {
    font-size: 32px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-label {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: 8px;
}

.progress-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    justify-content: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-tertiary);
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border-color);
}

/* Schedule Empty State */
.schedule-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 24px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: var(--border-radius-lg);
}

.empty-icon {
    font-size: 36px;
    opacity: 0.6;
}

.schedule-empty p {
    color: var(--text-tertiary);
    font-size: 14px;
}

.schedule-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Schedule Items */
.schedule-item {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 20px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: all var(--transition-fast);
    cursor: grab;
    user-select: none;
}

.schedule-item:active {
    cursor: grabbing;
}

.schedule-item.dragging {
    opacity: 0.4;
    transform: scale(0.97);
}

.schedule-item.drag-over {
    border-top: 2px solid var(--accent-primary);
    padding-top: 18px;
}

.schedule-item.completed {
    opacity: 0.5;
}

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

.item-content {
    flex: 1;
    min-width: 0;
}

.schedule-item-time {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.schedule-item-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
}

/* Check Button */
.check-btn {
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.check-btn::before {
    content: '';
    position: absolute;
    width: 36px;
    height: 36px;
    background: var(--bg-elevated);
    clip-path: polygon(50% 0%, 61% 12%, 79% 5%, 79% 23%, 98% 27%, 88% 42%,
            100% 55%, 85% 64%, 90% 82%, 72% 78%, 61% 95%, 50% 82%,
            39% 95%, 28% 78%, 10% 82%, 15% 64%, 0% 55%, 12% 42%,
            2% 27%, 21% 23%, 21% 5%, 39% 12%);
    transition: all var(--transition-fast);
}

.check-btn:hover::before {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.05);
}

.check-btn.checked::before {
    background: var(--accent-primary);
    box-shadow: none;
}

.check-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-icon svg {
    width: 16px;
    height: 16px;
    stroke: rgba(255, 255, 255, 0.6);
    stroke-width: 2.5;
    fill: none;
}

.check-btn.checked .check-icon svg {
    stroke: white;
}

/* ====================
   Modal
   ==================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Time Change Modal */
.time-change-panel {
    max-width: 400px;
}

.time-input-group {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.time-input-field {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-size: 24px;
    font-family: var(--font-family);
    outline: none;
    text-align: center;
    transition: border-color var(--transition-fast);
}

.time-input-field:focus {
    border-color: var(--accent-primary);
}

.modal-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    transform: translateY(20px) scale(0.95);
    transition: transform var(--transition-normal);
}

.modal-backdrop.active .modal-panel {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 28px 28px 0;
}

.modal-sparkle {
    font-size: 20px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 12px;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 6px;
}

.modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px 28px;
    flex: 1;
    overflow-y: auto;
}

.input-methods {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.method-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.method-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-secondary);
}

.method-btn.active {
    background: rgba(255, 94, 79, 0.08);
    border-color: rgba(255, 94, 79, 0.2);
    color: var(--accent-primary);
}

.method-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.text-input-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 20px;
    min-height: 180px;
    transition: border-color var(--transition-fast);
}

.text-input-wrapper:focus-within {
    border-color: rgba(255, 94, 79, 0.3);
}

.plan-text-display {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-primary);
    min-height: 140px;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: var(--font-family);
}

.plan-text-display:empty::before {
    content: attr(data-placeholder);
    color: var(--text-tertiary);
}

.modal-footer {
    padding: 0 28px 28px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-family);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

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

.btn-sparkle {
    font-size: 14px;
}

/* ====================
   Voice Overlay
   ==================== */
.voice-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.voice-overlay.active {
    opacity: 1;
    visibility: visible;
}

.voice-content {
    text-align: center;
}

.voice-indicator {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 28px;
}

.voice-wave {
    width: 5px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: 3px;
    animation: wave 1s ease-in-out infinite;
}

.voice-wave:nth-child(2) {
    animation-delay: 0.1s;
}

.voice-wave:nth-child(3) {
    animation-delay: 0.2s;
}

.voice-wave:nth-child(4) {
    animation-delay: 0.3s;
}

.voice-wave:nth-child(5) {
    animation-delay: 0.15s;
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(0.3);
    }

    50% {
        transform: scaleY(1);
    }
}

.voice-status {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 28px;
}

.voice-stop-btn {
    padding: 14px 36px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-xl);
    color: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
    box-shadow: none;
}

.voice-stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

/* ====================
   Animations
   ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

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

.home-greeting {
    animation: fadeInUp 0.5s ease-out;
}

.add-plan-btn {
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.progress-card {
    animation: fadeInUp 0.5s ease-out 0.15s both;
}

.schedule-section {
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* ====================
   Page Content Toggle
   ==================== */
.page-content {
    display: none;
    animation: fadeInUp 0.35s ease-out;
}

.page-content.active {
    display: block;
}

/* ====================
   Calendar
   ==================== */
.calendar-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

.calendar-card {
    display: flex;
    flex-direction: column;
}

.calendar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.cal-month-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.3px;
    min-width: 140px;
    text-align: center;
}

.cal-nav-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cal-nav-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.12);
}

.cal-today-btn {
    margin-left: auto;
    padding: 8px 16px;
    background: rgba(255, 94, 79, 0.08);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-family);
}

.cal-today-btn:hover {
    background: rgba(255, 94, 79, 0.15);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.calendar-weekdays span:first-child {
    color: rgba(255, 94, 79, 0.6);
}

.calendar-weekdays span:last-child {
    color: rgba(100, 140, 255, 0.6);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    flex: 1;
}

.cal-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    gap: 4px;
}

.cal-day:hover {
    background: var(--bg-card-hover);
}

.cal-day.other-month {
    opacity: 0.25;
}

.cal-day .day-number {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1;
}

.cal-day.today .day-number {
    color: var(--accent-primary);
    font-weight: 700;
}

.cal-day.today {
    background: rgba(255, 94, 79, 0.06);
    border: none;
}

.cal-day.selected {
    background: rgba(255, 94, 79, 0.12);
    border: none;
}

.cal-day.selected .day-number {
    color: var(--accent-primary);
    font-weight: 700;
}

.cal-day.sunday .day-number {
    color: rgba(255, 94, 79, 0.7);
}

.cal-day.saturday .day-number {
    color: rgba(100, 140, 255, 0.7);
}

.cal-day.selected.sunday .day-number,
.cal-day.selected.saturday .day-number,
.cal-day.today.sunday .day-number,
.cal-day.today.saturday .day-number {
    color: var(--accent-primary);
}

.cal-day-dots {
    display: flex;
    gap: 3px;
    height: 6px;
}

.cal-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
    opacity: 0.6;
}

.cal-dot.completed {
    background: var(--text-tertiary);
    opacity: 0.3;
}

/* Calendar Tasks Panel */
.cal-tasks-card {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 160px);
}

.cal-tasks-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cal-task-count {
    font-size: 13px;
    color: var(--accent-primary);
    font-weight: 600;
    background: rgba(255, 94, 79, 0.08);
    padding: 4px 10px;
    border-radius: var(--border-radius-xl);
}

.cal-tasks-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.cal-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.cal-task-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-fast);
}

.cal-task-item:hover {
    background: var(--bg-card-hover);
}

.cal-task-item.completed {
    opacity: 0.5;
}

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

.cal-task-time {
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 600;
    min-width: 42px;
}

.cal-task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.cal-task-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.cal-task-check.checked {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.cal-task-check.checked::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 1024px) {
    .calendar-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .cal-tasks-card {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .cal-day .day-number {
        font-size: 13px;
    }

    .cal-month-title {
        font-size: 17px;
        min-width: 110px;
    }
}

/* ====================
   Stats
   ==================== */
.stats-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}

/* Year Navigation */
.stats-year-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 8px 0 4px;
}

.stats-year-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.stats-year-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.stats-year-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text-primary);
    min-width: 80px;
    text-align: center;
}

/* Monthly Bar Chart */
.stats-monthly-card {
    padding: 24px 24px 20px;
}

.stats-monthly-header {
    margin-bottom: 20px;
}

.stats-monthly-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stats-monthly-chart-wrap {
    display: flex;
    gap: 8px;
    height: 180px;
    position: relative;
}

.stats-y-axis {
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    width: 24px;
    flex-shrink: 0;
    padding-bottom: 2px;
}

.stats-y-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-align: right;
    line-height: 1;
}

.stats-monthly-chart {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex: 1;
    position: relative;
    border-bottom: 1px solid var(--border-color);
}

.stats-m-bar-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    justify-content: flex-end;
}

.stats-m-bar {
    width: 100%;
    max-width: 32px;
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    transition: height 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: var(--text-tertiary);
    opacity: 0.5;
}

.stats-m-bar.current {
    background: var(--accent-gradient);
    opacity: 1;
}

.stats-m-bar.has-data {
    background: var(--text-secondary);
    opacity: 0.7;
}

.stats-m-bar.current.has-data {
    background: var(--accent-gradient);
    opacity: 1;
}

.stats-month-labels {
    display: flex;
    gap: 6px;
    padding-left: 32px;
    margin-top: 8px;
}

.stats-month-lbl {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.stats-month-lbl.current {
    color: var(--accent-primary);
    font-weight: 700;
}

/* Dual Summary Cards */
.stats-dual-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stats-big-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 24px 28px;
}

.stats-big-value {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1;
}

.stats-big-label {
    font-size: 13px;
    font-weight: 500;
}

.stats-big-neutral .stats-big-value {
    color: var(--text-primary);
}

.stats-big-neutral .stats-big-label {
    color: var(--text-tertiary);
}

.stats-big-accent {
    background: var(--accent-gradient) !important;
    border-color: transparent !important;
}

.stats-big-accent .stats-big-value {
    color: white;
}

.stats-big-accent .stats-big-label {
    color: rgba(255, 255, 255, 0.7);
}

/* Insight Card */
.stats-insight-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 28px;
}

.stats-insight-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.stats-insight-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stats-insight-text>span {
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-insight-highlight {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

.stats-insight-value {
    font-size: 32px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.stats-insight-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stats-insight-bar-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    text-align: right;
}

.stats-insight-bar-track {
    width: 100%;
    height: 28px;
    background: var(--bg-card);
    border-radius: 6px;
    overflow: hidden;
}

.stats-insight-bar-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 4px;
}

.stats-streak-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-streak-icon {
    font-size: 18px;
}

.stats-streak-value {
    margin-left: auto;
    font-size: 20px;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 768px) {
    .stats-container {
        max-width: 100%;
    }

    .stats-big-value {
        font-size: 28px;
    }
}

/* ====================
   Scrollbar
   ==================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 3px;
}

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

/* ====================
   Responsive
   ==================== */
@media (max-width: 1024px) {
    .progress-card {
        flex-direction: row;
        justify-content: space-around;
    }

    .progress-card .card-header {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        z-index: 50;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar.open~.mobile-menu-btn {
        opacity: 0;
        pointer-events: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .mobile-overlay.active {
        display: block;
    }

    .main-content {
        padding: 24px 20px;
        padding-top: 76px;
    }

    .header-date {
        font-size: 56px;
    }

    .schedule-title {
        font-size: 28px;
    }

    .add-plan-btn {
        padding: 12px 22px;
        font-size: 14px;
        margin-bottom: 32px;
    }

    .progress-card {
        flex-direction: column;
    }

    .schedule-list {
        grid-template-columns: 1fr;
    }

    .modal-panel {
        width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 16px 16px;
        padding-top: 72px;
    }

    .card {
        padding: 20px;
    }

    .main-header {
        margin-bottom: 24px;
    }

    .header-date {
        font-size: 48px;
    }

    .greeting-hello {
        font-size: 15px;
    }

    .greeting-summary {
        font-size: 14px;
    }

    .schedule-title {
        font-size: 24px;
    }
}

/* ====================
   Hidden Utility
   ==================== */
.hidden {
    display: none !important;
}

/* ====================
   Auth Screen
   ==================== */
.auth-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 500;
}

.auth-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 40px;
}

.auth-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    display: block;
    margin: 0 auto 12px;
}

.auth-title {
    font-size: 36px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.auth-tagline {
    font-size: 14px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

.auth-form {
    background: var(--glass-bg);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 32px;
}

.auth-form-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: -0.3px;
}

.auth-error {
    background: rgba(255, 80, 80, 0.1);
    border: 1px solid rgba(255, 80, 80, 0.2);
    color: #ff6b6b;
    font-size: 13px;
    padding: 10px 14px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 16px;
    display: none;
}

.auth-error.show {
    display: block;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-family);
    outline: none;
    transition: border-color var(--transition-fast);
}

.auth-field input:focus {
    border-color: rgba(255, 94, 79, 0.4);
}

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

.auth-submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--border-radius-md);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: none;
    font-family: var(--font-family);
    margin-top: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

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

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--text-tertiary);
}

.auth-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    font-family: var(--font-family);
}

.auth-link:hover {
    color: var(--accent-secondary);
}

/* ====================
   Logout Button
   ==================== */
.logout-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    border-radius: 50%;
    transition: all var(--transition-fast);
    flex-shrink: 0;
    margin-left: auto;
}

.logout-btn:hover {
    background: rgba(255, 80, 80, 0.1);
    color: #ff6b6b;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
}

@media (max-width: 480px) {
    .auth-container {
        padding: 16px;
    }

    .auth-form {
        padding: 24px;
    }
}