/* =========================================================================
   Alistlog — design system
   Sage / terra / slate palette · Fraunces + DM Sans · Tabler Icons
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400;1,9..144,500&family=DM+Sans:wght@400;500;600;700&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/dist/tabler-icons.min.css');

/* ----- 1. Tokens --------------------------------------------------------- */
:root {
    --page-bg:        #FAF7F2;
    --panel-bg:       #F2EDE3;
    --card-bg:        #FFFFFF;

    --sage-mist:      #EBF0EB;
    --sage-200:       #A8C4A8;
    --sage-500:       #5C7A5E;
    --sage-700:       #3D5C40;
    --sage-900:       #243829;

    --terra-50:       #F7EAE2;
    --terra-400:      #D9956A;
    --terra-600:      #B5704A;
    --terra-800:      #7A4530;

    --slate-50:       #E8EEF5;
    --slate-400:      #7A96B0;
    --slate-600:      #4A6580;
    --slate-800:      #2C4560;

    --text-primary:   #2C2820;
    --text-secondary: #6B6158;
    --text-hint:      #9B9188;

    --border-default: rgba(44,40,32,0.08);
    --border-soft:    rgba(44,40,32,0.06);
    --border-emphasis:rgba(61,92,64,0.25);

    --sidebar-w:      220px;
    --sidebar-w-c:    68px;
    --topbar-pad:     22px;

    --radius:         14px;
    --radius-card:    14px;
    --radius-pill:    999px;

    --t-fast:         150ms ease;
    --t-base:         250ms ease;
}

/* ----- 2. Reset + base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    background: var(--page-bg);
    color: var(--text-primary);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--sage-700); text-decoration: none; }
a:hover { color: var(--sage-900); }

button { font-family: inherit; cursor: pointer; }

img { max-width: 100%; display: block; }

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

h1,h2,h3,h4 { margin: 0 0 .5em; line-height: 1.2; color: var(--text-primary); }

.font-display { font-family: 'Fraunces', serif; font-weight: 400; }
.italic       { font-style: italic; }

/* ----- 3. App shell ------------------------------------------------------ */
.app {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow-y: auto;
    background: var(--page-bg);
}

/* ----- 4. Sidebar -------------------------------------------------------- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sage-900);
    color: #BFD8C2;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    transition: width var(--t-base);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.app.is-collapsed .sidebar { width: var(--sidebar-w-c); }

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 4px 4px 0;
}
.brand {
    display: flex; align-items: center; gap: 10px;
    overflow: hidden;
}
.brand-mark {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--sage-700);
    color: #fff;
    font-family: 'Fraunces', serif;
    font-weight: 500;
    font-size: 18px;
    display: grid; place-items: center;
    flex-shrink: 0;
    letter-spacing: -0.02em;
}
.brand-text {
    font-family: 'Fraunces', serif;
    font-size: 17px;
    color: #EBF0EB;
    font-weight: 500;
    letter-spacing: -0.01em;
    white-space: nowrap;
    transition: opacity var(--t-fast);
}
.app.is-collapsed .brand-text { opacity: 0; width: 0; }

.sidebar-toggle {
    background: transparent;
    border: 0;
    color: #7AAB80;
    width: 26px; height: 26px;
    border-radius: 7px;
    display: grid; place-items: center;
    transition: background var(--t-fast), transform var(--t-base);
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: rgba(255,255,255,0.06); color: #BFD8C2; }
.app.is-collapsed .sidebar-toggle { transform: rotate(180deg); }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px 0;
}
.nav-section {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #4A7050;
    padding: 14px 12px 6px;
    font-weight: 600;
    transition: opacity var(--t-fast);
    white-space: nowrap;
}
.app.is-collapsed .nav-section { opacity: 0; height: 0; padding: 6px 0; pointer-events: none; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #7AAB80;
    font-weight: 500;
    font-size: 13px;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
    overflow: hidden;
}
.nav-item i { font-size: 17px; flex-shrink: 0; width: 20px; text-align: center; }
.nav-item span { transition: opacity var(--t-fast), width var(--t-fast); }
.app.is-collapsed .nav-item { justify-content: center; padding: 9px; }
.app.is-collapsed .nav-item span { opacity: 0; width: 0; }

.nav-item:hover { background: rgba(255,255,255,0.05); color: #BFD8C2; }
.nav-item.is-active {
    background: var(--sage-700);
    color: var(--sage-mist);
}
.nav-item.is-active i { color: var(--sage-mist); }

.sidebar-foot {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding-top: 12px;
    margin-top: 8px;
}
.user-block {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 6px;
    border-radius: 10px;
}
.user-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--sage-500);
    color: #fff;
    display: grid; place-items: center;
    font-weight: 600;
    font-size: 12px;
    flex-shrink: 0;
}
.user-meta { line-height: 1.15; overflow: hidden; transition: opacity var(--t-fast); }
.user-name { color: #EBF0EB; font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { color: #7AAB80; font-size: 10px; }
.app.is-collapsed .user-meta { opacity: 0; width: 0; }

/* ----- 5. Topbar --------------------------------------------------------- */
.topbar {
    padding: 18px var(--topbar-pad) 0;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--page-bg);
}
.topbar-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.date-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    background: var(--sage-mist);
    color: var(--sage-700);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}
.date-chip i { font-size: 13px; }
.page-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: 22px;
    color: var(--text-primary);
    line-height: 1.2;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.icon-btn {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--card-bg);
    border: 0.5px solid var(--border-default);
    color: var(--text-secondary);
    display: grid; place-items: center;
    transition: border-color var(--t-fast), color var(--t-fast);
    text-decoration: none;
}
.icon-btn:hover { border-color: var(--border-emphasis); color: var(--sage-700); }
.icon-btn i { font-size: 16px; }

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-pill);
    padding: 4px 12px 4px 5px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 12px;
    text-decoration: none;
    transition: border-color var(--t-fast);
}
.profile-chip:hover { border-color: var(--border-emphasis); }
.profile-chip .user-avatar { width: 26px; height: 26px; font-size: 11px; }

/* ----- 6. Page area ------------------------------------------------------ */
.content {
    padding: 18px var(--topbar-pad) 36px;
    flex: 1;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}

/* ----- 7. Cards ---------------------------------------------------------- */
.card {
    background: var(--card-bg);
    border: 0.5px solid var(--border-default);
    border-radius: var(--radius-card);
    padding: 16px;
    transition: border-color var(--t-fast);
}
.card:hover { border-color: var(--border-emphasis); }
.card + .card { margin-top: 14px; }

.card-pad-lg { padding: 22px; }

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.card-title {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}
.card-sub { color: var(--text-secondary); font-size: 12px; margin-top: -2px; }

/* Hero card (sage-700 dark) */
.hero {
    background: var(--sage-700);
    border-radius: 16px;
    padding: 18px 22px;
    color: #fff;
    display: flex;
    align-items: stretch;
    gap: 22px;
    flex-wrap: wrap;
}
.hero-left { flex: 1; min-width: 240px; }
.hero-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch; }
.hero-title {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 22px;
    color: #fff;
    margin: 6px 0 6px;
    letter-spacing: -0.01em;
}
.hero-text { color: #BFD8C2; font-size: 12.5px; max-width: 56ch; }

.kpi-chip {
    background: rgba(255,255,255,0.09);
    border-radius: 11px;
    padding: 10px 14px;
    min-width: 92px;
    display: flex; flex-direction: column; gap: 2px;
}
.kpi-value {
    font-family: 'Fraunces', serif;
    font-weight: 400;
    font-size: 20px;
    color: #fff;
    line-height: 1.1;
}
.kpi-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #6B9970;
    font-weight: 600;
}

/* Live dot */
.live-dot {
    display: inline-block;
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--sage-200);
    animation: pulse 2s infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* ----- 8. Layout helpers ------------------------------------------------- */
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0,1fr)); }
@media (max-width: 1100px) {
    .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 600px) {
    .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.gap-sm { gap: 6px; } .gap-md { gap: 12px; } .gap-lg { gap: 18px; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 14px; } .mt-3 { margin-top: 22px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 14px; }
.text-hint  { color: var(--text-hint); }
.text-soft  { color: var(--text-secondary); }
.text-sage  { color: var(--sage-700); }
.text-terra { color: var(--terra-600); }
.text-slate { color: var(--slate-600); }
.small { font-size: 11px; }
.tiny  { font-size: 10px; }
.mono  { font-variant-numeric: tabular-nums; }

/* ----- 9. Tab bar -------------------------------------------------------- */
.tabbar {
    display: inline-flex;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 4px;
    border: 0.5px solid var(--border-default);
    gap: 2px;
    flex-wrap: wrap;
    max-width: 100%;
}
.tab {
    padding: 7px 14px;
    border-radius: 9px;
    color: var(--text-hint);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--t-fast), color var(--t-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.tab i { font-size: 14px; }
.tab:hover { color: var(--text-primary); }
.tab.is-active { background: var(--sage-700); color: #fff; }
.tab.is-active:hover { color: #fff; }

/* ----- 10. Forms --------------------------------------------------------- */
.form-row { margin-bottom: 12px; }
.form-row.row-flex { display: flex; gap: 10px; }
.form-row.row-flex > * { flex: 1; }
.label, .form-row label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}
.input, .select, .textarea {
    width: 100%;
    border: 0.5px solid rgba(44,40,32,0.15);
    border-radius: 9px;
    background: #FDFAF6;
    padding: 9px 12px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: var(--text-primary);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--sage-500);
    box-shadow: 0 0 0 3px rgba(92,122,94,0.12);
}
.textarea { min-height: 78px; resize: vertical; line-height: 1.45; }
.form-help { font-size: 11px; color: var(--text-hint); margin-top: 4px; }

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
}
.checkbox input { width: 14px; height: 14px; accent-color: var(--sage-700); }

/* Chip group (for picking enums) */
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 11px;
    background: #FDFAF6;
    border: 0.5px solid var(--border-default);
    color: var(--text-secondary);
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t-fast);
    user-select: none;
}
.chip:hover { border-color: var(--border-emphasis); color: var(--text-primary); }
.chip.is-active {
    background: var(--sage-700); color: #fff; border-color: var(--sage-700);
}
.chip.tone-terra.is-active { background: var(--terra-600); border-color: var(--terra-600); }
.chip.tone-slate.is-active { background: var(--slate-600); border-color: var(--slate-600); }
.chip input { display: none; }

/* Emoji picker (mood, etc.) */
.emoji-picker {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.emoji-pick {
    width: 44px; height: 44px;
    border-radius: 12px;
    background: #FDFAF6;
    border: 0.5px solid var(--border-default);
    display: grid; place-items: center;
    font-size: 22px;
    cursor: pointer;
    transition: all var(--t-fast);
}
.emoji-pick:hover { border-color: var(--border-emphasis); }
.emoji-pick.is-active {
    background: var(--sage-mist);
    border-color: var(--sage-500);
    box-shadow: 0 0 0 3px rgba(92,122,94,0.12);
}
.emoji-pick input { display: none; }

/* ----- 11. Buttons ------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
    text-decoration: none;
}
.btn i { font-size: 15px; }
.btn-primary   { background: var(--sage-700); color: #fff; }
.btn-primary:hover { background: var(--sage-900); color: #fff; }
.btn-secondary { background: var(--card-bg); color: var(--sage-700); border-color: rgba(61,92,64,0.3); }
.btn-secondary:hover { border-color: var(--sage-700); }
.btn-danger    { background: var(--terra-50); color: var(--terra-800); }
.btn-danger:hover { background: #f0d9c8; color: var(--terra-800); }
.btn-block     { display: flex; width: 100%; justify-content: center; }
.btn-sm        { padding: 6px 11px; font-size: 12px; }

/* Quick action pill button (for dashboard) */
.quick-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: var(--radius-pill);
    background: var(--card-bg);
    color: var(--text-primary);
    border: 0.5px solid var(--border-default);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: border-color var(--t-fast), color var(--t-fast);
}
.quick-pill i { color: var(--sage-700); font-size: 15px; }
.quick-pill:hover { border-color: var(--border-emphasis); color: var(--sage-900); }

/* ----- 12. Badges -------------------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-pill);
    font-size: 10.5px;
    font-weight: 600;
    background: var(--panel-bg);
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}
.badge-sage  { background: var(--sage-mist); color: var(--sage-700); }
.badge-terra { background: var(--terra-50);  color: var(--terra-800); }
.badge-slate { background: var(--slate-50);  color: var(--slate-800); }

/* ----- 13. Alerts -------------------------------------------------------- */
.alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    margin-bottom: 12px;
    border: 0.5px solid var(--border-default);
}
.alert-success { background: var(--sage-mist);  color: var(--sage-700);   border-color: rgba(61,92,64,0.18); }
.alert-error   { background: var(--terra-50);   color: var(--terra-800);  border-color: rgba(181,112,74,0.22); }
.alert-info    { background: var(--slate-50);   color: var(--slate-800);  border-color: rgba(74,101,128,0.18); }

/* ----- 14. Progress bars ------------------------------------------------- */
.progress {
    background: var(--panel-bg);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}
.progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}
.progress-fill.sage  { background: var(--sage-500); }
.progress-fill.terra { background: var(--terra-600); }
.progress-fill.slate { background: var(--slate-600); }
.progress-fill.amber { background: var(--terra-400); }

.kpi-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
}
.kpi-row .label { font-weight: 600; color: var(--text-primary); margin: 0; font-size: 12px; }
.kpi-row .value { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.kpi-block + .kpi-block { margin-top: 12px; }

/* ----- 15. Ritual cards ------------------------------------------------- */
.ritual-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0,1fr));
    gap: 10px;
}
@media (max-width: 900px)  { .ritual-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 540px)  { .ritual-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

.ritual-card {
    border-radius: 13px;
    padding: 14px 10px;
    text-align: center;
    background: #FDFAF6;
    border: 0.5px solid var(--border-default);
    cursor: pointer;
    transition: all var(--t-fast);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}
.ritual-card:hover { border-color: var(--border-emphasis); }
.ritual-card.done {
    background: var(--sage-mist);
    border-color: rgba(61,92,64,0.2);
}
.ritual-emoji { font-size: 28px; line-height: 1; }
.ritual-name {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.25;
}
.ritual-time { font-size: 10px; color: var(--text-hint); }
.ritual-dot {
    width: 18px; height: 18px;
    border-radius: 50%;
    display: grid; place-items: center;
    margin-top: 2px;
}
.ritual-dot.done    { background: var(--sage-700); color: #fff; }
.ritual-dot.pending { background: var(--panel-bg); border: 1px solid #D3D1C7; color: transparent; }
.ritual-dot i { font-size: 11px; }
.ritual-card form { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.ritual-card button {
    background: none; border: 0; padding: 0;
    width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    cursor: pointer;
    color: inherit; font-family: inherit;
}

/* ----- 16. Meal items --------------------------------------------------- */
.meal-list { display: flex; flex-direction: column; gap: 8px; }
.meal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    background: #FDFAF6;
    border-radius: 10px;
    border: 0.5px solid var(--border-default);
}
.meal-img {
    width: 38px; height: 38px;
    border-radius: 8px;
    background: var(--panel-bg);
    flex-shrink: 0;
    display: grid; place-items: center;
    color: var(--text-hint);
    overflow: hidden;
    font-size: 18px;
}
.meal-img img { width: 100%; height: 100%; object-fit: cover; }
.meal-body { flex: 1; min-width: 0; }
.meal-name { font-size: 12.5px; font-weight: 600; color: var(--text-primary); }
.meal-meta { font-size: 11px; color: var(--text-hint); }
.meal-add {
    border: 1.5px dashed rgba(44,40,32,0.15);
    border-radius: 10px;
    padding: 11px;
    text-align: center;
    color: var(--text-hint);
    font-size: 12px;
    background: transparent;
    transition: border-color var(--t-fast), color var(--t-fast);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%;
}
.meal-add:hover { border-color: var(--border-emphasis); color: var(--sage-700); }

/* ----- 17. Photo upload zone -------------------------------------------- */
.photo-zone {
    border: 1.5px dashed rgba(44,40,32,0.15);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    background: #FDFAF6;
    transition: border-color var(--t-fast);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-hint);
}
.photo-zone:hover { border-color: var(--border-emphasis); color: var(--sage-700); }
.photo-zone i { font-size: 22px; color: var(--text-hint); }
.photo-zone input[type=file] { display: none; }
.photo-zone strong { color: var(--text-primary); font-weight: 600; font-size: 12.5px; }
.photo-zone small { font-size: 11px; color: var(--text-hint); }
.photo-zone.has-file { border-style: solid; border-color: var(--sage-500); color: var(--sage-700); }

/* ----- 18. Timeline ----------------------------------------------------- */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}
.timeline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 0.5px solid var(--border-soft);
}
.timeline-item:last-child { border-bottom: 0; }
.timeline-time {
    font-size: 11px;
    color: var(--text-hint);
    font-weight: 600;
    min-width: 64px;
    font-variant-numeric: tabular-nums;
}
.timeline-icon {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: var(--panel-bg);
    color: var(--sage-700);
    display: grid; place-items: center;
    flex-shrink: 0;
    font-size: 13px;
}
.timeline-icon.tone-terra { background: var(--terra-50); color: var(--terra-800); }
.timeline-icon.tone-slate { background: var(--slate-50); color: var(--slate-800); }
.timeline-icon.tone-sage  { background: var(--sage-mist); color: var(--sage-700); }
.timeline-body { flex: 1; min-width: 0; }
.timeline-title { font-size: 12px; color: var(--text-primary); font-weight: 500; }
.timeline-meta  { font-size: 11px; color: var(--text-hint); }

/* ----- 19. Goal checklist ---------------------------------------------- */
.goal-list { display: flex; flex-direction: column; gap: 6px; }
.goal {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    background: #FDFAF6;
    border-radius: 10px;
    border: 0.5px solid var(--border-default);
    transition: all var(--t-fast);
}
.goal.done { background: var(--sage-mist); }
.goal.done .goal-text { text-decoration: line-through; color: var(--text-secondary); }
.goal-check {
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1px solid #D3D1C7;
    display: grid; place-items: center;
    background: var(--panel-bg);
    color: transparent;
    flex-shrink: 0;
}
.goal.done .goal-check { background: var(--sage-700); border-color: var(--sage-700); color: #fff; }
.goal-check i { font-size: 11px; }
.goal-text   { font-size: 12.5px; color: var(--text-primary); flex: 1; }
.goal-time   { font-size: 11px; color: var(--text-hint); }
.goal form, .goal button { display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 0; width: 100%; text-align: left; cursor: pointer; color: inherit; font-family: inherit; }

/* ----- 20. Bar chart (simple CSS) -------------------------------------- */
.bars {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    align-items: end;
    height: 90px;
    padding: 6px 0 0;
}
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.bar {
    width: 100%;
    background: var(--sage-500);
    border-radius: 4px 4px 0 0;
    min-height: 2px;
    flex: 1 1 auto;
    align-self: stretch;
    transition: height 0.4s ease;
}
.bar.empty { background: var(--panel-bg); }
.bar.tone-terra { background: var(--terra-600); }
.bar-label { font-size: 9px; color: var(--text-hint); font-weight: 600; }
.bar-value { font-size: 10px; color: var(--text-secondary); font-weight: 600; }
.bar-track { width: 100%; height: 100%; background: transparent; display: flex; align-items: flex-end; }

/* ----- 21. Empty state -------------------------------------------------- */
.empty {
    text-align: center;
    padding: 22px 10px;
    color: var(--text-hint);
}
.empty i { font-size: 26px; color: var(--text-hint); margin-bottom: 6px; }
.empty p { margin: 0; font-size: 12px; }

/* ----- 22. Login page --------------------------------------------------- */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--page-bg);
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    border: 0.5px solid var(--border-default);
    border-radius: 16px;
    padding: 32px 28px;
}
.auth-brand {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 6px;
}
.auth-brand .brand-mark {
    width: 38px; height: 38px;
    background: var(--sage-700);
}
.auth-brand .brand-text { color: var(--text-primary); }
.auth-title {
    font-family: 'Fraunces', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 24px;
    color: var(--text-primary);
    margin: 14px 0 4px;
}
.auth-sub { color: var(--text-secondary); margin-bottom: 22px; font-size: 13px; }

/* ----- 23. Tables ------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.table th, .table td {
    text-align: left;
    padding: 9px 11px;
    border-bottom: 0.5px solid var(--border-soft);
    vertical-align: top;
}
.table th {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-hint);
    font-weight: 600;
    background: transparent;
}
.table tr:last-child td { border-bottom: 0; }

/* ----- 24. FAQ ---------------------------------------------------------- */
.faq-item {
    border-top: 0.5px solid var(--border-soft);
    padding: 12px 0;
}
.faq-item:first-child { border-top: 0; }
.faq-q {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q i { color: var(--sage-700); transition: transform var(--t-fast); }
.faq-item[open] .faq-q i { transform: rotate(45deg); }
.faq-a { padding-top: 8px; color: var(--text-secondary); font-size: 12.5px; line-height: 1.55; }

/* ----- 25. Mobile adjust ----------------------------------------------- */
@media (max-width: 720px) {
    .sidebar { position: absolute; z-index: 30; height: 100vh; transform: translateX(-100%); }
    .app.is-mobile-open .sidebar { transform: translateX(0); box-shadow: 0 8px 32px rgba(0,0,0,0.18); }
    .topbar { padding-top: 14px; }
    .page-title { font-size: 19px; }
    .hero { padding: 16px; }
    .hero-title { font-size: 19px; }
}
