/* ── Fonts ────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

/* ── Design tokens ───────────────────────────────────────── */
:root {
    --brand:         #6c63ff;
    --brand-dark:    #5a51e0;
    --brand-light:   #ede9ff;
    --green:         #22c55e;
    --green-light:   #dcfce7;
    --orange:        #f97316;
    --orange-light:  #fff7ed;
    --red:           #ef4444;
    --red-light:     #fee2e2;
    --yellow:        #eab308;
    --yellow-light:  #fefce8;
    --blue:          #3b82f6;
    --blue-light:    #eff6ff;
    --surface:       #f8fafc;
    --surface-card:  #ffffff;
    --border:        #e2e8f0;
    --text:          #1e293b;
    --text-muted:    #64748b;
    --radius-sm:     8px;
    --radius:        12px;
    --radius-lg:     20px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
    --shadow:        0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.05);
    --shadow-lg:     0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
}

/* ── Base ────────────────────────────────────────────────── */
html, body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--surface);
    color: var(--text);
    font-size: 15px;
}

a, .btn-link { color: var(--brand); }

/* ── Cards ───────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border-bottom: 1px solid var(--border);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all .15s ease;
}
.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}
.btn-primary:hover { background-color: var(--brand-dark); border-color: var(--brand-dark); }
.btn:focus, .btn:active:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(108,99,255,.25);
    outline: none;
}

/* ── Tables ──────────────────────────────────────────────── */
.table { --bs-table-border-color: var(--border); }
.table thead th {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted);
    background: var(--surface);
}

/* ── Forms ───────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
}

/* ── App Header (top nav) ────────────────────────────────── */
.app-header {
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}
.app-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    min-height: 60px;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center;
    gap: 1.5rem;
}
.app-nav {
    flex: 0 1 auto;
}
.app-brand {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.3rem;
    color: var(--brand) !important;
    text-decoration: none !important;
    white-space: nowrap;
}
.app-brand-mark {
    width: 28px;
    height: 28px;
    display: block;
    flex-shrink: 0;
}
.app-brand:hover { color: var(--brand-dark) !important; }

/* ── Nav links ───────────────────────────────────────────── */
.app-nav { display: flex !important; flex-direction: row !important; align-items: center; gap: .2rem; }
.app-nav-link {
    padding: .4rem .85rem;
    border-radius: var(--radius-sm);
    text-decoration: none !important;
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-muted);
    transition: all .15s ease;
    white-space: nowrap;
}
.app-nav-link:hover { color: var(--brand); background: var(--brand-light); }
.app-nav-link.active { color: var(--brand); background: var(--brand-light); }

/* ── Login display ───────────────────────────────────────── */
.login-display {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: .875rem;
    color: var(--text-muted);
}
.login-display a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.login-display a:hover { text-decoration: underline; }

/* ── Landing page ────────────────────────────────────────── */
.landing-page {
    max-width: 1160px;
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.landing-hero {
    display: grid;
    grid-template-columns: 1.35fr .95fr;
    gap: 2rem;
    align-items: center;
    padding: 2.25rem 0 1rem;
}

.landing-copy {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(108, 99, 255, 0.12);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06);
}

.eyebrow {
    display: inline-block;
    background: rgba(108, 99, 255, 0.1);
    color: var(--brand);
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .45rem .8rem;
    margin-bottom: 1rem;
}

.landing-copy h1 {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(2.6rem, 5vw, 4.2rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 1rem;
}

.landing-copy p {
    font-size: 1.08rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    max-width: 640px;
}

.landing-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .85rem;
    margin-bottom: 1.5rem;
}

.btn-lg {
    padding: .8rem 1.35rem;
    font-size: 1rem;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid rgba(108, 99, 255, 0.35);
    color: var(--brand);
}

.btn-outline-primary:hover {
    background: rgba(108, 99, 255, 0.05);
    color: var(--brand-dark);
}

.landing-proof {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: .9rem 1.2rem;
    margin: 0;
    padding: 0;
    color: var(--text);
    font-weight: 600;
}

.landing-proof li {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(108,99,255,0.08);
    border-radius: 999px;
    padding: .5rem .8rem;
}

.landing-panel {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.07);
    padding: 1.4rem;
}

.mini-stat {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border-radius: 18px;
    padding: 1rem 1.1rem;
    margin-bottom: 1rem;
}

.mini-stat.accent {
    background: linear-gradient(135deg, #ecfeff, #f5f3ff);
}

.mini-label {
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.mini-stat strong {
    font-size: 1.8rem;
    font-family: 'Nunito', sans-serif;
    color: var(--text);
}

.mini-stat small {
    color: var(--text-muted);
}

.mini-list {
    display: grid;
    gap: .8rem;
}

.mini-item {
    display: flex;
    align-items: center;
    gap: .8rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: .8rem .9rem;
}

.mini-item span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.08);
    font-size: 1.2rem;
}

.mini-item div {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.mini-item strong {
    font-size: .95rem;
}

.mini-item small {
    color: var(--text-muted);
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 1.5rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.feature-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(108, 99, 255, 0.1);
    font-size: 1.6rem;
    margin-bottom: .9rem;
}

.feature-card h3 {
    font-family: 'Nunito', sans-serif;
    margin-bottom: .5rem;
    font-size: 1.2rem;
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

@media (max-width: 991.98px) {
    .landing-page {
        padding: 1.25rem 1rem 2rem;
    }

    .landing-hero {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-top: 1rem;
    }

    .landing-copy {
        padding: 2rem 1.25rem;
    }

    .landing-panel {
        padding: 1rem;
    }

    .landing-features {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .landing-page {
        padding: 1rem .75rem 2rem;
    }

    .landing-copy {
        border-radius: 20px;
        padding: 1.15rem 1rem;
    }

    .landing-copy h1 {
        font-size: clamp(2.2rem, 11vw, 3.1rem);
    }

    .landing-copy p {
        font-size: 1rem;
    }

    .landing-actions {
        flex-direction: column;
    }

    .landing-actions .btn {
        width: 100%;
        text-align: center;
    }

    .landing-proof {
        display: grid;
        gap: .7rem;
    }

    .landing-proof li {
        width: 100%;
        text-align: center;
    }

    .landing-panel,
    .feature-card {
        border-radius: 18px;
    }

    .mini-stat strong {
        font-size: 1.5rem;
    }

    .mini-item {
        padding: .7rem .75rem;
    }
}

/* ── Login page ───────────────────────────────────────────── */
.login-page-shell {
    display: grid;
    grid-template-columns: 1.2fr .9fr;
    gap: 2rem;
    align-items: center;
    max-width: 1180px;
    margin: 0 auto;
    padding: 2rem 0 3rem;
}

.login-hero-panel {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.08), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(108, 99, 255, 0.12);
    border-radius: 32px;
    padding: 2.5rem;
    box-shadow: 0 20px 44px rgba(15, 23, 42, 0.06);
}

.login-badge {
    display: inline-block;
    padding: .45rem .8rem;
    border-radius: 999px;
    background: rgba(108, 99, 255, 0.12);
    color: var(--brand);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.login-hero-panel h1 {
    font-family: 'Nunito', sans-serif;
    font-size: clamp(2.4rem, 4vw, 3.8rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 1rem;
}

.login-hero-panel p {
    font-size: 1.06rem;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.login-value-grid {
    display: grid;
    gap: 1rem;
}

.value-item {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(108,99,255,.08);
    border-radius: 18px;
    padding: 1rem 1.1rem;
}

.value-item span {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(108, 99, 255, 0.08);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.value-item div {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.value-item strong {
    font-size: 1rem;
    color: var(--text);
}

.value-item small {
    color: var(--text-muted);
    line-height: 1.45;
}

.login-card-wrap {
    display: flex;
    justify-content: center;
}

.login-card {
    width: min(100%, 460px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.login-card-header {
    padding: 1.5rem 1.5rem 0;
}

.login-kicker {
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand);
    font-weight: 800;
    margin-bottom: .35rem;
}

.login-card-header h2 {
    font-family: 'Nunito', sans-serif;
    font-size: 1.9rem;
    font-weight: 800;
    margin: 0;
    color: var(--text);
}

.login-card-body {
    padding: 1.5rem;
}

.login-instructions {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: .9rem 1rem;
    margin-bottom: 1.25rem;
}

.login-instructions p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.login-instructions p + p {
    margin-top: .4rem;
}

.login-primary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    font-weight: 700;
    padding: .9rem 1rem;
    border-radius: 14px;
}

.login-dev-panel {
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #f8fafc, #ffffff);
    padding: 1rem 1rem .2rem;
    margin-top: 1rem;
}

.login-dev-header {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
}

.login-dev-header h5 {
    margin: 0;
    font-weight: 800;
    color: var(--text);
}

.login-dev-panel p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(290px, .9fr);
    gap: 1.5rem;
    align-items: start;
}

.dashboard-main-col,
.dashboard-side-col {
    min-width: 0;
}

.dashboard-side-col {
    margin-top: .1rem;
}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
}

.logs-page-shell {
    max-width: 1280px;
    margin: 0 auto;
}

.logs-page-header {
    margin-bottom: 1.25rem;
}

.logs-page-header h1 {
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    color: var(--text);
    margin: 0;
}

.logs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr);
    gap: 1.5rem;
    align-items: start;
}

.logs-main-panel,
.activity-panel,
.empty-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.04);
}

.logs-main-panel {
    padding: 1.25rem;
}

.logs-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.filter-wrap {
    width: min(260px, 100%);
}

.filter-wrap label {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .35rem;
}

.empty-log-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 18px;
    color: var(--text-muted);
    padding: 1rem 1.1rem;
}

.activity-eyebrow {
    display: inline-block;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: .35rem;
}

.activity-panel {
    padding: 1.1rem;
    position: sticky;
    top: 1rem;
}

.empty-panel {
    padding: 1.1rem;
}

.activity-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.activity-panel-header h3 {
    margin: 0;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
}

.activity-panel-header a {
    font-size: .85rem;
    font-weight: 700;
    text-decoration: none;
}

.activity-section {
    margin-top: 1rem;
}

.activity-section h4 {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .75rem;
}

.activity-leaderboard {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .6rem .7rem;
}

.leaderboard-rank {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(108, 99, 255, 0.1);
    color: var(--brand);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: .8rem;
}

.leaderboard-name-wrap {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.leaderboard-name-wrap strong {
    font-size: .9rem;
}

.leaderboard-name-wrap small {
    color: var(--text-muted);
}

.activity-feed {
    display: grid;
    gap: .6rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .7rem .6rem;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.activity-item.is-good { border-color: rgba(34, 197, 94, 0.18); }
.activity-item.is-warning { border-color: rgba(234, 179, 8, 0.2); }
.activity-item.is-danger { border-color: rgba(239, 68, 68, 0.2); }

.activity-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(108, 99, 255, 0.08);
    font-size: 1rem;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.activity-content strong {
    font-size: .88rem;
    line-height: 1.3;
}

.activity-content small {
    color: var(--text-muted);
}

.activity-points {
    font-size: .78rem;
    font-weight: 800;
    color: var(--brand);
    white-space: nowrap;
}

.empty-state {
    margin: 0;
    color: var(--text-muted);
    font-size: .9rem;
}

/* ── Content area ────────────────────────────────────────── */
.app-main { background: var(--surface); min-height: calc(100vh - 60px); }
.app-content { max-width: 1200px; margin: 0 auto; padding: 2rem 1.5rem; }

/* ────────────────────────────────────────────────────────── */
/* KID-FRIENDLY THEME  (.kid-theme on root wrapper)          */
/* ────────────────────────────────────────────────────────── */
.kid-theme {
    font-family: 'Nunito', 'Helvetica Neue', Arial, sans-serif !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 0;
}

/* Kid page wrapper */
.kid-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

.kid-page-layout {
    max-width: 1180px;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(260px, .8fr);
    gap: 1.5rem;
    align-items: start;
}

.kid-main-column {
    min-width: 0;
}

.kid-sidebar-column {
    min-width: 0;
}

/* Points hero */
.kid-points-hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 24px;
    color: #fff;
    padding: 1.5rem 2rem;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(240,147,251,.45);
}
.kid-points-hero .kid-name    { font-size: 1.5rem; font-weight: 800; margin-bottom: .2rem; }
.kid-points-hero .points-row  { display: flex; align-items: baseline; justify-content: center; gap: .4rem; }
.kid-points-hero .points-num  { font-size: 3.5rem; font-weight: 800; line-height: 1; }
.kid-points-hero .points-label{ font-size: 1.1rem; font-weight: 600; opacity: .9; }

/* Section panels */
.kid-section {
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid rgba(255,255,255,.25);
}
.kid-section-heading {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* Card grid for chores/rewards */
.kid-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
}
.kid-card {
    background: #fff;
    border-radius: 18px;
    padding: 1rem .75rem;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0,0,0,.1);
    transition: transform .15s ease, box-shadow .15s ease;
    border: 3px solid transparent;
}
.kid-card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.15); }
.kid-card-icon  { font-size: 2.2rem; margin-bottom: .4rem; }
.kid-card-name  { font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: .4rem; line-height: 1.2; }
.kid-card-pts   { font-size: .95rem; font-weight: 800; margin-bottom: .6rem; }
.kid-card .btn  { border-radius: 999px; font-size: .8rem; padding: .28rem .85rem; font-weight: 700; }
.kid-card.chore-card                { border-color: #a7f3d0; }
.kid-card.chore-card .kid-card-pts  { color: #16a34a; }
.kid-card.reward-card               { border-color: #fde68a; }
.kid-card.reward-card .kid-card-pts { color: #d97706; }
.kid-card.reward-card.cant-afford   { opacity: .5; filter: grayscale(.4); }

/* Pending items */
.kid-pending-item {
    background: rgba(255,255,255,.18);
    border-radius: 12px;
    padding: .65rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .5rem;
    color: #fff;
    gap: .5rem;
}
.kid-pending-item .pi-name { font-weight: 700; font-size: .9rem; }
.kid-pending-item .pi-pts  { font-size: .82rem; opacity: .85; white-space: nowrap; }
.kid-pending-item .btn     { border-radius: 999px; font-size: .78rem; padding: .2rem .65rem; font-weight: 700; }

/* Toast / success message */
.kid-toast {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    border-radius: 14px;
    padding: .7rem 1rem;
    font-weight: 700;
    color: #14532d;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* History table inside kid theme */
.kid-history-table { width: 100%; border-radius: 14px; overflow: hidden; font-size: .85rem; }
.kid-history-table thead th {
    background: rgba(255,255,255,.2) !important;
    color: #fff !important;
    font-weight: 700;
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .05em;
    border: none;
}
.kid-history-table tbody td { border-color: rgba(255,255,255,.1); }
.kid-history-table tbody tr.table-success td { background: #d1fae5 !important; color: #14532d; }
.kid-history-table tbody tr.table-warning td { background: #fef9c3 !important; color: #713f12; }
.kid-history-table tbody tr.table-danger  td { background: #fee2e2 !important; color: #7f1d1d; }

/* Kid header bar (inside kid page) */
.kid-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}
.kid-header-bar .btn { border-radius: 999px; font-size: .82rem; font-weight: 700; }

/* Password gate */
.kid-password-gate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.kid-password-card {
    background: rgba(255,255,255,.97);
    border-radius: 28px;
    padding: 2.5rem 2rem;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.kid-password-card .avatar-emoji { font-size: 4rem; margin-bottom: .75rem; display: block; }
.kid-password-card h2 { font-family: 'Nunito', sans-serif; font-weight: 800; margin-bottom: .25rem; }
.kid-password-card .subtitle { color: var(--text-muted); font-size: .9rem; margin-bottom: 1.5rem; }
.kid-password-card .form-control {
    border-radius: 999px;
    padding: .6rem 1.25rem;
    font-size: 1.1rem;
    text-align: center;
    letter-spacing: .2em;
    border: 2px solid var(--border);
    margin-bottom: .75rem;
}
.kid-password-card .form-control:focus { border-color: var(--brand); }
.kid-password-card .btn-unlock {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 999px;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 800;
    font-size: 1rem;
    padding: .65rem 2rem;
    width: 100%;
    margin-bottom: .5rem;
}
.kid-password-card .btn-unlock:hover { opacity: .92; }
.kid-password-card .btn-back {
    background: none;
    border: 2px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: .9rem;
    padding: .5rem 1.5rem;
    width: 100%;
}

/* ── Validation ──────────────────────────────────────────── */
h1:focus { outline: none; }
.valid.modified:not([type=checkbox]) { outline: 1px solid var(--green); }
.invalid { outline: 1px solid var(--red); }
.validation-message { color: var(--red); }

/* ── Blazor errors ───────────────────────────────────────── */
.blazor-error-boundary {
    background: var(--red-light);
    border: 1px solid var(--red);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    color: #7f1d1d;
}
.blazor-error-boundary::after { content: "An error has occurred. Please refresh the page."; }

#blazor-error-ui {
    background: var(--yellow-light);
    border: 1px solid var(--yellow);
    border-radius: var(--radius);
    padding: .75rem 1rem;
    font-size: .875rem;
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 9999;
    box-shadow: var(--shadow);
}
#blazor-error-ui .dismiss { cursor: pointer; font-weight: 700; }

.darker-border-checkbox.form-check-input { border-color: #929292; }

/* ── Responsive layout ──────────────────────────────────── */
@media (max-width: 991.98px) {
    .app-header-inner {
        padding: .7rem 1rem;
        min-height: auto;
        flex-wrap: wrap !important;
        gap: .75rem;
    }

    .app-header .ms-auto {
        margin-left: auto !important;
    }

    .app-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: .2rem;
    }

    .app-nav-link {
        flex: 0 0 auto;
    }

    .app-content {
        padding: 1.25rem 1rem;
    }
}

@media (max-width: 767.98px) {
    .login-page-shell {
        grid-template-columns: 1fr;
        padding-top: 1rem;
    }

    .login-hero-panel,
    .login-card {
        border-radius: 22px;
    }

    .login-hero-panel {
        padding: 1.5rem 1.1rem;
    }

    .login-card-body {
        padding: 1.1rem;
    }

    .app-brand {
        font-size: 1.15rem;
    }

    .app-nav {
        gap: .35rem;
    }

    .app-nav-link {
        font-size: .85rem;
        padding: .4rem .65rem;
    }

    .login-display {
        font-size: .8rem;
        gap: .5rem;
    }

    .display-4 {
        font-size: 2rem;
    }

    .nav-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

    .table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .kid-page {
        padding: 1rem .75rem;
    }

    .kid-header-bar {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .kid-points-hero {
        padding: 1.2rem 1rem;
    }

    .kid-points-hero .kid-name {
        font-size: 1.25rem;
    }

    .kid-points-hero .points-num {
        font-size: 2.6rem;
    }

    .kid-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    .kid-pending-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .kid-pending-item .btn {
        align-self: flex-end;
    }
}
