* { box-sizing: border-box; }

body {
    margin: 0;
    background: oklch(97% 0.004 250);
    font-family: 'Inter', Helvetica, sans-serif;
    color: oklch(22% 0.01 250);
}

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

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px 96px;
}

.center-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Login ---- */
.login-card {
    width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: oklch(55% 0.09 195);
    margin-bottom: 22px;
}

.login-title {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: oklch(55% 0.01 250);
    margin-bottom: 36px;
}

.field-label {
    width: 100%;
    font-size: 13px;
    font-weight: 600;
    color: oklch(45% 0.01 250);
    margin-bottom: 8px;
}

.field-input {
    width: 100%;
    border: 1px solid oklch(90% 0.005 250);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 15px;
    margin-bottom: 18px;
    font-family: inherit;
    color: oklch(22% 0.01 250);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    width: 100%;
    background: oklch(55% 0.09 195);
    color: white;
}

.btn-secondary {
    flex: 1;
    background: white;
    border: 1px solid oklch(90% 0.005 250);
    color: oklch(45% 0.01 250);
    font-weight: 600;
    padding: 12px;
}

.error-text {
    width: 100%;
    color: oklch(50% 0.13 25);
    font-size: 13px;
    margin-bottom: 14px;
}

/* ---- Dashboard header ---- */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 36px;
}

.top-title { font-size: 22px; font-weight: 800; }
.top-subtitle { font-size: 14px; color: oklch(55% 0.01 250); margin-top: 2px; }

.new-habit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 10px;
    background: oklch(55% 0.09 195);
    color: white;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

/* ---- Habit rows ---- */
.habit-list { display: flex; flex-direction: column; gap: 14px; }

.habit-row {
    border: 1px solid oklch(93% 0.005 250);
    border-radius: 14px;
    padding: 24px 26px;
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
}

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

.habit-name-col { width: 150px; flex-shrink: 0; }
.habit-name { font-size: 16px; font-weight: 600; }
.habit-streak { font-size: 13px; color: oklch(55% 0.01 250); margin-top: 3px; }

.grid-wrap { display: flex; gap: 2.5px; flex: 1; min-width: 0; overflow-x: auto; }
.grid-week { display: flex; flex-direction: column; gap: 2.5px; }
.grid-day { width: 9px; height: 9px; border-radius: 2px; }

.habit-total-col { text-align: right; flex-shrink: 0; width: 90px; }
.habit-total { font-size: 20px; font-weight: 800; }
.habit-total-label { font-size: 12px; color: oklch(55% 0.01 250); }

.habit-actions { display: flex; gap: 8px; flex-shrink: 0; }

.mark-today-btn {
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid oklch(90% 0.005 250);
    background: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    color: oklch(45% 0.01 250);
}

.mark-today-btn.done {
    background: oklch(55% 0.09 195);
    color: white;
    border-color: oklch(55% 0.09 195);
}

.mark-today-btn.secondary.done {
    background: oklch(55% 0.01 250);
    color: white;
    border-color: oklch(55% 0.01 250);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: oklch(55% 0.01 250);
    font-size: 14px;
}

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: oklch(30% 0.01 250 / 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.modal-card {
    width: 420px;
    background: white;
    border-radius: 18px;
    padding: 36px;
    box-shadow: 0 20px 60px oklch(0% 0 0 / 0.25);
}

.modal-title { font-size: 19px; font-weight: 800; margin-bottom: 24px; }

.color-options { display: flex; gap: 10px; margin-bottom: 22px; }

.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
}

.color-option:has(input:checked) {
    box-shadow: 0 0 0 3px white, 0 0 0 5px currentColor;
}

.modal-actions { display: flex; gap: 10px; margin-top: 8px; }

/* ---- Detail page ---- */
.detail-top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 34px;
}

.back-link { font-size: 14px; color: oklch(55% 0.01 250); }

.delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 9px;
    border: 1px solid oklch(90% 0.01 20);
    background: white;
    color: oklch(50% 0.13 25);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.detail-heading {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 6px;
}

.detail-name { font-size: 26px; font-weight: 800; }
.detail-streak-label { width: 100%; font-size: 14px; color: oklch(55% 0.01 250); margin-bottom: 36px; }

.stat-row { display: flex; gap: 16px; margin-bottom: 40px; width: 100%; flex-wrap: wrap; }

.stat-card {
    width: 200px;
    padding: 20px 22px;
    border-radius: 14px;
    background: oklch(97% 0.004 250);
}

.stat-value { font-size: 26px; font-weight: 800; }
.stat-label { font-size: 13px; color: oklch(55% 0.01 250); margin-top: 2px; }

.detail-grid-scroll { width: 100%; overflow-x: auto; padding-bottom: 8px; }

.month-labels { display: flex; gap: 3px; margin-bottom: 6px; padding-left: 26px; }
.month-label { width: 11px; font-size: 11px; color: oklch(55% 0.01 250); }

.detail-grid-row { display: flex; gap: 6px; }

.weekday-labels {
    display: flex;
    flex-direction: column;
    gap: 3px;
    justify-content: space-between;
    height: 81px;
    padding-right: 6px;
}

.weekday-label { font-size: 10px; color: oklch(65% 0.005 250); }

.detail-weeks { display: flex; gap: 3px; }
.detail-week { display: flex; flex-direction: column; gap: 3px; }
.detail-day { width: 11px; height: 11px; border-radius: 2px; }

.detail-page {
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
