/*
 * Points Pals look: soft gradient backdrop, frosted cards, serif section titles, big friendly touch targets.
 * Inspired by the wall-display reference; MudBlazor handles controls via AppTheme.
 */

:root {
    --ink: #1e293b;
    --ink-soft: #64748b;
    --ink-faint: #94a3b8;
    --primary: #6366f1;
    --primary-soft: #eef2ff;
    --glass: rgba(255, 255, 255, .62);
    --glass-strong: rgba(255, 255, 255, .82);
    --glass-border: rgba(255, 255, 255, .85);
    --line: rgba(148, 163, 184, .22);
    --shadow: 0 12px 40px rgba(79, 70, 229, .08), 0 2px 8px rgba(15, 23, 42, .04);
    --radius: 26px;
    --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
    --rail-w: 76px;
    --header-h: 64px;
}

html, body {
    min-height: 100%;
}

body {
    background:
        radial-gradient(1200px 600px at 10% -10%, #dbeafe 0%, transparent 60%),
        radial-gradient(900px 600px at 100% 0%, #ede9fe 0%, transparent 55%),
        radial-gradient(900px 700px at 60% 110%, #fce7f3 0%, transparent 60%),
        #f5f7fb;
    background-attachment: fixed;
    color: var(--ink);
}

.boot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    margin-top: 25vh;
    font-family: Inter, sans-serif;
    color: var(--ink-soft);
}

.boot-logo { font-size: 3rem; }

/* ---------- Shell: header, rail, main ---------- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 1.25rem;
    background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--glass-border);
}

.app-header .brand {
    font-family: var(--serif);
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
}

.app-header .meta {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-size: .78rem;
    color: var(--ink-soft);
}

.app-header .spacer { flex: 1; }

.app-header .who {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .9rem;
    font-weight: 500;
}

.app-main {
    padding: 1.25rem 1.5rem 2rem;
    width: 100%;          /* use the whole screen - no max width */
}

.app-main.with-rail {
    padding-left: calc(var(--rail-w) + 2rem);
}

.app-main.narrow {
    max-width: 560px;
    margin: 0 auto;        /* sign-in / kid / join pages sit in the middle */
    padding-top: 8vh;
}

/* Slim icon menu (parents) */
.rail {
    position: fixed;
    z-index: 15;
    top: calc(var(--header-h) + 1rem);
    left: 1rem;
    bottom: 1rem;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: .75rem .35rem;
    background: var(--glass);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    box-shadow: var(--shadow);
}

.rail-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    width: 100%;
    padding: .55rem 0;
    border-radius: 22px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: .68rem;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.rail-item:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.rail-item.active { background: #fff; color: var(--primary); box-shadow: 0 2px 10px rgba(99, 102, 241, .12); }

.rail-item .rail-badge {
    position: absolute;
    top: .25rem;
    right: .6rem;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: .65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rail .rail-fab {
    margin-top: auto;
}

@media (max-width: 959px) {
    /* Rail becomes a bottom bar on phones / small tablets */
    .rail {
        top: auto;
        left: .75rem;
        right: .75rem;
        bottom: .75rem;
        width: auto;
        height: 64px;
        flex-direction: row;
        justify-content: space-around;
        padding: .35rem .5rem;
    }

    .rail-item { width: auto; flex: 1; padding: .35rem 0; }
    .rail .rail-fab { margin-top: 0; }

    .app-main.with-rail {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-bottom: 6rem;
    }

    .app-header .meta { display: none; }
}

/* ---------- Cards & sections ---------- */

.app-card {
    background: var(--glass);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.35rem 1.5rem;
}

@media (max-width: 600px) {
    .app-card {
        padding: 1rem;
        border-radius: 20px;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .9rem;
    min-height: 40px;
}

.section-title {
    font-family: var(--serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -.01em;
}

.section-count {
    font-size: .9rem;
    color: var(--ink-soft);
    font-weight: 500;
}

.page-title {
    font-family: var(--serif);
    font-size: 1.9rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
}

/* Generic rows (requests, ledger, inbox, members) */
.item-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: 18px;
    margin-bottom: .55rem;
    transition: background .15s, transform .15s;
}

.item-row:hover { background: #fff; }

.item-row .item-name {
    flex: 1;
    min-width: 0;
    font-size: .95rem;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-row .item-sub {
    display: block;
    font-size: .76rem;
    color: var(--ink-faint);
}

/* ---------- Task rows: title + coin points, big tap circle on the right ---------- */

.task-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 68px;
    padding: .7rem .9rem .7rem 1.1rem;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-bottom: .6rem;
    transition: background .15s;
}

.task-row:hover { background: #fff; }

.task-row .task-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.task-row .task-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-row.is-done .task-title {
    text-decoration: line-through;
    color: var(--ink-faint);
}

.task-row .task-meta {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .78rem;
    color: var(--ink-soft);
}

.coin {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    font-weight: 600;
    color: #92400e;
}

.coin::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 70%);
    box-shadow: inset 0 0 0 1.5px rgba(146, 64, 14, .25);
}

.check {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    background: rgba(255, 255, 255, .9);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    transition: .15s;
    padding: 0;
}

.check:hover:not(:disabled) { border-color: var(--primary); transform: scale(1.06); }
.check:disabled { cursor: default; }
.check.approved { background: #22c55e; border-color: #22c55e; }
.check.pending { background: #f59e0b; border-color: #f59e0b; }
.check.rejected { background: #fff; border-color: #ef4444; color: #ef4444; }

/* ---------- Reward cards ---------- */

.reward-card {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: .9rem;
    align-items: center;
    padding: .8rem;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
    margin-bottom: .6rem;
    transition: background .15s;
}

.reward-card:hover { background: #fff; }

.reward-card .reward-art {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.1rem;
    background: linear-gradient(145deg, #e0e7ff, #fce7f3);
}

.reward-card .reward-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.reward-card .reward-name {
    font-size: .98rem;
    font-weight: 500;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reward-card .reward-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    min-height: 32px;
}

.reward-card .reward-sub {
    font-size: .75rem;
    color: var(--ink-faint);
}

/* Warm pill button used for Redeem (matches the reference) */
.pill-btn {
    border: none;
    border-radius: 20px;
    padding: .4rem 1rem;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #e0956b, #c9734a);
    box-shadow: 0 3px 10px rgba(201, 115, 74, .3);
    cursor: pointer;
    white-space: nowrap;
}

.pill-btn:hover:not(:disabled) { filter: brightness(1.05); }
.pill-btn:disabled { background: #e2e8f0; color: var(--ink-faint); box-shadow: none; cursor: default; }

/* ---------- Badges ---------- */

.pts {
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-soft);
    padding: .12rem .65rem;
    border-radius: 30px;
    flex-shrink: 0;
    white-space: nowrap;
}

.pts.neg { color: #dc2626; background: #fef2f2; }
.pts.pos { color: #16a34a; background: #dcfce7; }

.status {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .72rem;
    font-weight: 500;
    padding: .18rem .7rem;
    border-radius: 30px;
    flex-shrink: 0;
    white-space: nowrap;
    color: var(--ink-soft);
    background: #f1f5f9;
}

.status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.status.pending { color: #b45309; background: #fef3c7; }
.status.approved { color: #15803d; background: #dcfce7; }
.status.denied { color: #b91c1c; background: #fee2e2; }

.reward-icon {
    font-size: 1.5rem;
    width: 2.2rem;
    text-align: center;
    flex-shrink: 0;
}

.empty-state {
    color: var(--ink-faint);
    font-size: .92rem;
    text-align: center;
    padding: 2rem 0;
}

.empty-state .empty-art {
    display: block;
    font-size: 2.6rem;
    margin-bottom: .4rem;
    opacity: .75;
}

/* ---------- Avatars (character faces) ---------- */

.avatar {
    --c: #6366f1;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 55%),
        var(--c);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .12), inset 0 -3px 6px rgba(15, 23, 42, .08);
}

.avatar svg { width: 100%; height: 100%; display: block; }

/* ---------- Profile row (parent dashboard) ---------- */

.profile-row {
    display: flex;
    gap: .5rem 1.75rem;
    flex-wrap: wrap;
    align-items: center;
    padding: .25rem .25rem 1.25rem;
}

.profile {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .35rem .9rem .35rem .35rem;
    background: none;
    border: none;
    border-radius: 40px;
    font: inherit;
    color: var(--ink);
    cursor: pointer;
    opacity: .55;
    transition: opacity .15s, background .15s;
    text-align: left;
}

.profile:hover { opacity: .85; }

@media (max-width: 600px) {
    .profile-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: .5rem;
        margin: 0 -1rem;
        padding: .25rem 1rem 1rem;
        scrollbar-width: none;
    }

    .profile { flex-shrink: 0; }
}

.profile.active {
    opacity: 1;
    background: var(--glass);
    box-shadow: var(--shadow);
}

.profile .profile-name {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 500;
}

.profile .profile-info {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.profile .profile-stats {
    display: flex;
    align-items: center;
    gap: .4rem;
    font-size: .78rem;
}

.today-pill {
    font-size: .68rem;
    font-weight: 600;
    color: #b45309;
    background: #fef3c7;
    padding: .05rem .5rem;
    border-radius: 20px;
}

.missed-pill {
    font-size: .68rem;
    font-weight: 600;
    color: #b91c1c;
    background: #fee2e2;
    padding: .05rem .5rem;
    border-radius: 20px;
}

/* ---------- Last-7-days strip ---------- */

.day-strip {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: .4rem;
    margin-bottom: .9rem;
}

.day-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .15rem;
    padding: .55rem .15rem;
    border-radius: 14px;
    background: rgba(241, 245, 249, .85);
    color: var(--ink-soft);
    border: 2px solid transparent;
}

.day-tile .day-name { font-size: .7rem; font-weight: 500; }
.day-tile .day-score { font-size: .98rem; font-weight: 700; }
.day-tile.good { background: #dcfce7; color: #15803d; }
.day-tile.partial { background: #fef3c7; color: #b45309; }
.day-tile.bad { background: #fee2e2; color: #b91c1c; }
.day-tile.today { background: #fff; border-color: #c7d2fe; color: #4338ca; }

/* ---------- Kid page header ---------- */

.kid-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.balance {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: var(--glass-strong);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
    color: #92400e;
    border-radius: 40px;
    padding: .4rem 1.1rem;
    font-weight: 700;
    font-size: 1.4rem;
}

.balance small { font-size: .8rem; font-weight: 500; color: var(--ink-soft); }

/* ---------- Kid login ---------- */

.profile-pick {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    background: none;
    border: 2px solid transparent;
    border-radius: 24px;
    padding: 1rem 1.2rem;
    cursor: pointer;
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink);
    transition: .15s;
}

.profile-pick:hover { background: rgba(255, 255, 255, .7); border-color: var(--glass-border); }

.pin-dots {
    display: flex;
    gap: .8rem;
    justify-content: center;
    margin: 1rem 0 1.5rem;
}

.pin-dots span {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--primary);
}

.pin-dots span.filled { background: var(--primary); }

.pin-pad {
    display: grid;
    grid-template-columns: repeat(3, 76px);
    gap: .8rem;
    justify-content: center;
}

.pin-pad button {
    height: 76px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, .75);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
    font: inherit;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
}

.pin-pad button:hover { background: #fff; }
.pin-pad button:disabled { visibility: hidden; }

/* ---------- Misc ---------- */

.swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    padding: 0;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .12);
}

.swatch.selected { border-color: var(--ink); }

.code-box {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 1.3rem;
    letter-spacing: .2rem;
    font-weight: 600;
    background: rgba(255, 255, 255, .8);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .3rem .8rem;
}

/* MudBlazor tables/inputs sitting on glass */
.app-card .mud-table,
.app-card .mud-table-container {
    background: transparent;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 2000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}


/* ===================== Dashboard polish ===================== */

/* Greeting banner with family stats */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    padding: 1.4rem 1.75rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius);
    color: #fff;
    background:
        radial-gradient(600px 220px at 85% -20%, rgba(255, 255, 255, .28), transparent 60%),
        linear-gradient(120deg, #6366f1 0%, #8b5cf6 45%, #ec4899 100%);
    box-shadow: 0 18px 40px rgba(99, 102, 241, .28);
}

.hero-text { display: flex; flex-direction: column; gap: .2rem; }

.hero-greeting {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.1;
}

.hero-date { font-size: .92rem; opacity: .85; }

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: .75rem;
    flex: 1;
    max-width: 820px;
}

.stat-tile {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: .65rem;
    align-items: center;
    padding: .7rem .95rem;
    border-radius: 18px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .28);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.stat-tile .stat-icon {
    grid-row: span 2;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(255, 255, 255, .9);
}

.stat-tile .stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat-tile .stat-label { font-size: .74rem; opacity: .9; }
.stat-tile.attention { background: rgba(255, 255, 255, .95); color: #4338ca; }
.stat-tile.warn { background: rgba(254, 226, 226, .95); color: #b91c1c; }

@media (max-width: 900px) {
    .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
    .hero-greeting { font-size: 1.5rem; }
}

/* Inbox: glows when something is waiting; items flow in columns on wide screens */
.app-card.inbox.has-items {
    border-color: #c7d2fe;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .12), var(--shadow);
}

.inbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
    gap: 0 .75rem;
}

@media (max-width: 600px) {
    .inbox-grid { grid-template-columns: 1fr; }
}

/* Equal-height column cards; long lists scroll inside instead of stretching the page */
.column-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.scroll-list {
    max-height: 68vh;
    overflow-y: auto;
    margin-right: -.5rem;
    padding-right: .5rem;
    scrollbar-width: thin;
}

.scroll-list.tall { max-height: 78vh; }

.app-card {
    transition: box-shadow .2s, transform .2s;
}

.app-card:hover {
    box-shadow: 0 16px 48px rgba(79, 70, 229, .12), 0 2px 8px rgba(15, 23, 42, .05);
}

/* Reward cards flow into as many columns as fit */
.reward-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: .6rem;
}

.reward-grid .reward-card { margin-bottom: 0; }

/* Small segmented filter (All / Tasks / Rewards) */
.seg {
    display: inline-flex;
    padding: 3px;
    border-radius: 20px;
    background: rgba(241, 245, 249, .9);
}

.seg button {
    border: none;
    background: none;
    font: inherit;
    font-size: .74rem;
    font-weight: 600;
    color: var(--ink-soft);
    padding: .25rem .7rem;
    border-radius: 16px;
    cursor: pointer;
}

.seg button.on { background: #fff; color: var(--primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .1); }

/* Approval history timeline */
.timeline { position: relative; padding-left: .25rem; }

.timeline::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(#c7d2fe, rgba(199, 210, 254, 0));
}

.tl-item {
    position: relative;
    display: flex;
    gap: .75rem;
    padding-bottom: .9rem;
}

.tl-dot {
    position: relative;
    z-index: 1;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin-top: .2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    color: #fff;
    background: #94a3b8;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, .9);
}

.tl-item.ok .tl-dot { background: #22c55e; }
.tl-item.no .tl-dot { background: #ef4444; }

.tl-body {
    flex: 1;
    min-width: 0;
    padding: .6rem .85rem;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: 16px;
}

.tl-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.tl-title {
    font-size: .92rem;
    color: var(--ink);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .45rem;
    margin-top: .3rem;
    font-size: .76rem;
    color: var(--ink-soft);
}

.tl-sub {
    margin-top: .15rem;
    font-size: .72rem;
    color: var(--ink-faint);
}
/* Kids get a warmer banner */
.hero.kid {
    background:
        radial-gradient(600px 220px at 85% -20%, rgba(255, 255, 255, .3), transparent 60%),
        linear-gradient(120deg, #f59e0b 0%, #ec4899 50%, #8b5cf6 100%);
    box-shadow: 0 18px 40px rgba(236, 72, 153, .25);
}

.hero.kid .stat-tile.attention { color: #92400e; }

.stat-tiles.three { grid-template-columns: repeat(3, minmax(140px, 1fr)); max-width: 640px; }

@media (max-width: 600px) {
    .stat-tiles, .stat-tiles.three { grid-template-columns: 1fr; }
    .hero { padding: 1.1rem; }
}

/* Kid page on big screens: the three cards reach the bottom of the window
   (header + banner + padding is roughly 250px), so there's no empty band underneath. */
@media (min-width: 1280px) {
    .fill-height .column-card { min-height: calc(100vh - 250px); }
}

/* Banner: greeting on the left, stat tiles pushed to the right (next to refresh) instead of floating mid-banner */
.hero { justify-content: flex-start; }
.hero .stat-tiles { flex: 0 1 820px; margin-left: auto; }
.hero .stat-tiles.three { flex-basis: 640px; }

@media (max-width: 900px) {
    .hero .stat-tiles { flex-basis: 100%; margin-left: 0; }
}

/* ---------- Kid chore ideas ---------- */
.suggest-btn {
    width: 100%;
    margin-top: .25rem;
    padding: .75rem;
    border: 2px dashed #c7d2fe;
    border-radius: 18px;
    background: rgba(238, 242, 255, .6);
    color: var(--primary);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s;
}

.suggest-btn:hover:not(:disabled) { background: #eef2ff; border-color: var(--primary); }

.points-picker { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .35rem; }

.points-picker button {
    min-width: 56px;
    padding: .5rem .8rem;
    border-radius: 14px;
    border: 2px solid var(--line);
    background: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 1rem;
}

.points-picker button.on { border-color: var(--primary); background: #eef2ff; }

.item-row.idea { border-color: #fde68a; background: rgba(254, 249, 195, .55); }

.idea-quote {
    line-height: 1.6;
    padding: .8rem 1rem;
    border-radius: 14px;
    background: rgba(254, 249, 195, .6);
    border: 1px solid #fde68a;
    font-size: .92rem;
}

.idea-note { display: block; font-size: .78rem; color: var(--ink-soft); }

/* Keep card titles on one line; let the filter buttons drop below if space is tight */
.section-header { flex-wrap: wrap; }
.section-title { white-space: nowrap; }
/* ---------- Refunds ---------- */
.status.refunded { color: #6d28d9; background: #ede9fe; }
.item-row.refund { border-color: #ddd6fe; background: rgba(237, 233, 254, .55); }
.refund-line { color: #6d28d9; }

.link-btn {
    display: inline-block;
    margin-top: .15rem;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: .76rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-btn:disabled { color: var(--ink-faint); cursor: default; }

.link-btn.danger { color: #dc2626; }


/* ===================== Feature batch ===================== */

/* Day arrows (parent chores card, reports) */
.day-nav {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .6rem;
    padding: 3px;
    border-radius: 20px;
    background: rgba(241, 245, 249, .9);
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink);
}

.day-nav span { min-width: 92px; text-align: center; }

.day-nav button {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .1);
}

.day-nav button:disabled { opacity: .35; cursor: default; }

.past-note { font-size: .76rem; color: #b45309; margin: -.2rem 0 .6rem; }

.dayoff-banner {
    padding: .6rem .9rem;
    margin-bottom: .7rem;
    border-radius: 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    font-size: .85rem;
}

/* Time of day */
.time-seg { margin-bottom: .7rem; flex-wrap: wrap; }
.time-group { font-size: .78rem; font-weight: 600; color: var(--ink-soft); margin: .4rem 0 .35rem .25rem; }
.carried { color: #b45309; font-weight: 500; }
.time-chip { font-size: .72rem; color: var(--ink-soft); background: #f1f5f9; border-radius: 12px; padding: .05rem .5rem; margin-left: .35rem; white-space: nowrap; }

/* Streaks */
.streak-pill {
    font-size: .68rem;
    font-weight: 700;
    color: #c2410c;
    background: #ffedd5;
    padding: .05rem .5rem;
    border-radius: 20px;
}

.day-tile.off { background: #ecfdf5; color: #047857; }

/* Kid banner + savings goal */
.kid-hero-text { flex-direction: row; align-items: center; gap: 1rem; }
.kid-hero-words { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }

.goal { display: flex; flex-direction: column; gap: .25rem; margin-top: .35rem; max-width: 420px; }
.goal-label { font-size: .8rem; }

.goal-bar {
    height: 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .3);
    overflow: hidden;
}

.goal-bar span {
    display: block;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(90deg, #fde68a, #fff);
    transition: width .4s;
}

.reward-actions { display: inline-flex; align-items: center; gap: .35rem; }

.goal-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: #fff;
    color: #f59e0b;
    font-size: 1.05rem;
    cursor: pointer;
}

.goal-btn.on { background: #fef3c7; border-color: #fcd34d; }

/* Family board: bigger profile row */
.profile-row.large { gap: .75rem 2.25rem; padding-bottom: 1.5rem; }
.profile-row.large .profile-name { font-size: 1.4rem; }

/* Weekly report */
.report-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.report-head .day-nav { margin-bottom: 0; }
.report-head .day-nav span { min-width: 140px; }

.report-kid { display: flex; align-items: center; gap: .8rem; margin-bottom: .8rem; }
.report-kid > span:nth-child(2) { display: flex; flex-direction: column; flex: 1; }
.report-balance { font-size: 1.1rem; }

.report-bar { height: 8px; border-radius: 6px; background: #f1f5f9; overflow: hidden; margin-bottom: 1rem; }
.report-bar span { display: block; height: 100%; background: linear-gradient(90deg, #6366f1, #22c55e); border-radius: 6px; }

.report-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-bottom: 1rem;
}

.report-stats > div {
    display: flex;
    flex-direction: column;
    padding: .55rem .7rem;
    border-radius: 14px;
    background: var(--glass-strong);
    border: 1px solid var(--line);
}

.report-stats b { font-size: 1.15rem; }
.report-stats span { font-size: .72rem; color: var(--ink-soft); }
.report-stats .bad b { color: #dc2626; }
.report-stats .good b { color: #16a34a; }

.report-rewards { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-top: auto; }
.report-none { font-size: .8rem; color: var(--ink-faint); }

/* ---------- App admin ---------- */
.admin-code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-weight: 700;
    letter-spacing: .12em;
    padding: .1rem .45rem;
    margin: 0 .35rem;
    border-radius: 6px;
    background: rgba(99, 102, 241, .1);
    color: #4338ca;
}
.admin-invite-form {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: .5rem;
    align-items: center;
    margin-bottom: .75rem;
}
.admin-family {
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 14px;
    padding: .6rem .8rem;
    margin-bottom: .6rem;
    background: rgba(255, 255, 255, .55);
}
.admin-family.off { background: rgba(254, 226, 226, .35); }
.admin-family-head { display: flex; align-items: center; gap: .5rem; }
.admin-family-head .item-name { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.admin-family-head .item-sub { display: block; font-size: .76rem; font-weight: 400; color: var(--ink-faint); }
.admin-parent { padding-left: .75rem; }
.admin-email-edit { display: flex; gap: .4rem; align-items: center; margin-top: .25rem; }
@media (max-width: 600px) {
    .admin-invite-form { grid-template-columns: 1fr; }
}
