/* Family HQ — Mobile-first CSS */
:root {
    --season-color: #10B981;
    --bg: #F9FAFB;
    --card-bg: #FFFFFF;
    --text: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --nav-height: 60px;
    --header-height: 56px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--nav-height) + 16px);
}

/* ===== Header ===== */
.app-header {
    position: sticky; top: 0; z-index: 100;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    height: var(--header-height);
}
.header-inner {
    max-width: 600px; margin: 0 auto;
    padding: 0 16px; height: 100%;
    display: flex; align-items: center; gap: 12px;
}
.logo {
    font-weight: 700; font-size: 1.1rem;
    color: var(--season-color); text-decoration: none;
}
.season-badge {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: var(--season-color); opacity: 0.7;
}
.header-user {
    margin-left: auto; display: flex; align-items: center; gap: 8px;
    font-size: 0.85rem;
}
.user-dot {
    width: 10px; height: 10px; border-radius: 50%; display: inline-block;
}
.logout-link {
    color: var(--text-muted); text-decoration: none; font-size: 0.8rem;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    height: var(--nav-height);
    display: flex; justify-content: space-around; align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    text-decoration: none; color: var(--text-muted); font-size: 0.7rem;
    padding: 4px 12px; border-radius: var(--radius-sm);
    transition: color 0.15s;
}
.nav-item.active { color: var(--season-color); }
.nav-icon { font-size: 1.3rem; }

/* ===== Main ===== */
.app-main {
    max-width: 600px; margin: 0 auto; padding: 16px;
}

/* ===== Cards ===== */
.dash-card, .list-card, .announcement-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px; margin-bottom: 12px;
    box-shadow: var(--shadow);
}
.dash-card h2, .page-header h1 {
    font-size: 1.1rem; margin-bottom: 8px;
}

/* ===== Dashboard ===== */
.dash-header h1 { font-size: 1.4rem; }
.dash-date { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 16px; }

/* ===== Events ===== */
.event-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; margin: 4px 0; border-radius: var(--radius-sm);
    background: var(--bg);
}
.event-time { font-size: 0.8rem; color: var(--text-muted); min-width: 60px; }
.event-title { font-weight: 500; flex: 1; }
.event-cat { font-size: 0.7rem; color: var(--text-muted); }
.event-loc { font-size: 0.75rem; color: var(--text-muted); }
.agenda-date {
    font-weight: 600; font-size: 0.85rem; color: var(--season-color);
    margin-top: 12px; margin-bottom: 4px; padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

/* ===== Shopping ===== */
.list-card {
    display: block; text-decoration: none; color: var(--text);
    transition: transform 0.1s;
}
.list-card:active { transform: scale(0.98); }
.list-card h2 { font-size: 1rem; }
.list-meta { display: flex; gap: 12px; margin-top: 4px; font-size: 0.85rem; }

.shopping-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.shopping-item.checked { opacity: 0.5; }
.shopping-item.checked .item-name { text-decoration: line-through; }
.item-label { display: flex; align-items: center; gap: 10px; flex: 1; cursor: pointer; }
.item-check { width: 20px; height: 20px; accent-color: var(--season-color); }
.item-name { font-weight: 500; }
.item-qty { font-size: 0.8rem; color: var(--text-muted); background: var(--bg); padding: 2px 8px; border-radius: 4px; }
.item-note { font-size: 0.75rem; color: var(--text-muted); font-style: italic; }
.item-delete {
    background: none; border: none; font-size: 1.2rem; color: var(--text-muted);
    cursor: pointer; padding: 4px 8px;
}
.checked-divider {
    font-size: 0.8rem; color: var(--text-muted); margin: 12px 0 4px;
    text-transform: uppercase; letter-spacing: 0.05em;
}

.quick-add-form {
    display: flex; gap: 8px; margin-bottom: 16px;
}

.shopping-summary-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border);
    text-decoration: none; color: var(--text);
}
.list-count.has-items { font-weight: 600; color: var(--season-color); }

/* ===== Pantry ===== */
.pantry-category { margin-bottom: 16px; }
.pantry-category h3 { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 4px; }
.pantry-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--border);
}
.pantry-item.on-list .pantry-name { color: var(--text-muted); }

/* ===== Announcements ===== */
.announcement-card { position: relative; }
.announcement-card.pinned { border-left: 3px solid var(--season-color); }
.announcement-card h3 { font-size: 1rem; margin-bottom: 4px; }
.announcement-card p { font-size: 0.9rem; color: var(--text); margin-bottom: 8px; }
.pin-badge {
    position: absolute; top: 8px; right: 12px;
    font-size: 0.65rem; text-transform: uppercase;
    color: var(--season-color); font-weight: 600;
}

/* ===== Forms & Buttons ===== */
.input {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 1rem;
    background: var(--card-bg); color: var(--text);
    margin-bottom: 8px;
}
.input:focus { outline: none; border-color: var(--season-color); }
.input-sm { padding: 8px 10px; font-size: 0.9rem; }
textarea.input { resize: vertical; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border: none; border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 500; cursor: pointer;
    transition: opacity 0.15s;
}
.btn:active { opacity: 0.8; }
.btn-primary { background: var(--season-color); color: white; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-warning { background: #F59E0B; color: white; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }

.fab {
    position: fixed; bottom: calc(var(--nav-height) + 16px); right: 16px;
    width: 56px; height: 56px; border-radius: 50%;
    font-size: 1.5rem; z-index: 50;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.badge {
    font-size: 0.75rem; padding: 2px 8px; border-radius: 999px;
}
.badge-active { background: var(--season-color); color: white; }
.badge-done { background: var(--bg); color: var(--text-muted); }

.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 0; cursor: pointer;
}

/* ===== Modal ===== */
.modal {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: flex-end; justify-content: center;
}
.modal-content {
    background: var(--card-bg); border-radius: var(--radius) var(--radius) 0 0;
    padding: 24px 16px; width: 100%; max-width: 600px; max-height: 80vh;
    overflow-y: auto;
}
.modal-content h2 { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ===== Login ===== */
.login-body {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 16px; background: var(--bg);
}
.login-container {
    width: 100%; max-width: 400px;
    background: var(--card-bg); border-radius: var(--radius);
    padding: 32px 24px; box-shadow: var(--shadow);
}
.login-title {
    font-size: 1.8rem; text-align: center;
    color: var(--season-color); margin-bottom: 4px;
}
.login-season {
    text-align: center; color: var(--text-muted);
    font-size: 0.85rem; margin-bottom: 24px;
}
.login-section { margin-bottom: 16px; }
.login-section h2 { font-size: 1rem; margin-bottom: 8px; }
.login-divider {
    text-align: center; color: var(--text-muted);
    margin: 20px 0; font-size: 0.85rem;
    display: flex; align-items: center; gap: 12px;
}
.login-divider::before, .login-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
}
.child-tiles {
    display: flex; gap: 12px; flex-wrap: wrap;
}
.child-tile {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 16px; border: 2px solid var(--border); border-radius: var(--radius);
    background: var(--card-bg); cursor: pointer; font-size: 0.9rem;
    transition: border-color 0.15s;
}
.child-tile:hover { border-color: var(--season-color); }
.tile-avatar {
    width: 48px; height: 48px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 700; font-size: 1.2rem;
}
.pin-input {
    text-align: center; font-size: 1.5rem; letter-spacing: 0.5em;
    max-width: 200px;
}

/* ===== Calendar nav ===== */
.cal-nav {
    display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.cal-nav span { font-weight: 600; flex: 1; text-align: center; }

/* ===== Utilities ===== */
.text-muted { color: var(--text-muted); }
.loading { color: var(--text-muted); font-size: 0.9rem; }
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin: 8px 0; font-size: 0.9rem; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-success { background: #D1FAE5; color: #065F46; }
.back-link { color: var(--season-color); text-decoration: none; font-size: 0.85rem; }
.page-header { margin-bottom: 16px; }

/* ===== Dark mode (optional, follows system) ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111827;
        --card-bg: #1F2937;
        --text: #F9FAFB;
        --text-muted: #9CA3AF;
        --border: #374151;
    }
    .login-body { background: var(--bg); }
    .input { background: var(--bg); color: var(--text); border-color: var(--border); }
}
