/* =================== NidoPro: schermate multi-nido =================== */
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-sub { font-size: .78rem; font-weight: 800; color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topnav { flex-wrap: wrap; justify-content: flex-end; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 8px 4px 16px; }
.page-head .page-title { margin: 0; }
.month-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.narrow { max-width: 640px; margin: 0 auto; }
h4 { font-family: var(--font-head); margin: 14px 0 8px; }
.privacy-note { margin: -6px 4px 16px; }

/* banner */
.banner { padding: 12px 16px; border-radius: 18px; background: #e3f1ff; color: #2a6fb0; font-weight: 700; margin-bottom: 14px; animation: pop-in .35s both; }
.banner.warn { background: #fff1c7; color: #7a5200; }
.banner.err { background: #ffe2e7; color: #c02a4f; cursor: pointer; }
.link-btn { border: 0; background: none; color: inherit; text-decoration: underline; font-weight: 800; }

/* appello */
.appello-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 4px 4px 16px; }
.day-title { text-align: center; min-width: 190px; }
.day-title h1 { font-size: 2rem; line-height: 1; }
.day-title span { color: var(--muted); font-weight: 700; }
.nav-btn:disabled { opacity: .35; cursor: default; transform: none; }
.counters { display: flex; flex-wrap: wrap; gap: 8px; }
.counter { padding: 7px 12px; border-radius: 99px; font-weight: 700; background: var(--card); box-shadow: 0 4px 0 var(--line); font-size: .92rem; }
.counter b { font-family: var(--font-head); font-size: 1.1rem; }
.c-in { background: var(--present); color: var(--present-ink); }
.c-meal { background: #fff1c7; color: #7a5200; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.search { flex: 1 1 220px; max-width: 360px; }

.kids-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.kid-card {
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 24px;
    background: var(--card); border: 2px solid var(--line); box-shadow: 0 6px 0 var(--line);
    animation: pop-in .45s cubic-bezier(.2, 1.4, .4, 1) both; transition: transform .18s, box-shadow .18s;
}
.kid-card:hover { transform: translateY(-2px); }
.kid-card.st-in { background: var(--present); border-color: color-mix(in srgb, var(--mint) 50%, transparent); box-shadow: 0 6px 0 color-mix(in srgb, var(--mint) 45%, transparent); }
.kid-card.st-out { opacity: .85; }
.kid-card.st-off { background: var(--off); }
.kid-main { display: flex; gap: 12px; align-items: center; border: 0; background: none; padding: 0; text-align: left; width: 100%; }
.kid-avatar {
    width: 56px; height: 56px; flex: none; display: grid; place-items: center; font-size: 34px; border-radius: 18px;
    background: linear-gradient(135deg, #ffe7a3, #ffc2a8); box-shadow: 0 4px 0 #f2a97c;
}
.kid-avatar.sm { width: 42px; height: 42px; font-size: 24px; border-radius: 14px; box-shadow: 0 3px 0 #f2a97c; }
.st-in .kid-avatar { background: linear-gradient(135deg, #b9f5de, #9fdcff); box-shadow: 0 4px 0 #6cc4b0; animation: bob 3s ease-in-out infinite; }
.st-off .kid-avatar { filter: grayscale(.6); }
.kid-info { display: flex; flex-direction: column; min-width: 0; }
.kid-name { font-family: var(--font-head); font-size: 1.25rem; font-weight: 600; }
.kid-name small { color: var(--muted); font-weight: 500; }
.kid-status { color: var(--muted); font-weight: 700; font-size: .88rem; }
.st-in .kid-status { color: var(--present-ink); }
.kid-balance { position: absolute; top: 12px; right: 12px; font-size: .78rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: #e3f1ff; color: #2a6fb0; }
.kid-balance.low { background: #fff1c7; color: #7a5200; }
.kid-balance.neg { background: #ffe2e7; color: #c02a4f; }
.kid-actions { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.kid-actions .btn { flex: 1; }
.meal-pill {
    width: 44px; height: 40px; border-radius: 14px; border: 0; font-size: 1.3rem; background: var(--card-2);
    box-shadow: 0 4px 0 var(--line); filter: grayscale(1); opacity: .55; transition: .2s;
}
.meal-pill.on { filter: none; opacity: 1; background: #fff1c7; box-shadow: 0 4px 0 #f2c94c; animation: yum .5s; }
.icon-link { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 14px; text-decoration: none; background: var(--card-2); box-shadow: 0 4px 0 var(--line); }

/* famiglie */
.meal-chip, .balance-chip { padding: 10px 14px; border-radius: 18px; font-weight: 800; background: var(--card-2); color: var(--muted); }
.meal-chip.on { background: #fff1c7; color: #7a5200; }
.balance-chip { background: #e3f1ff; color: #2a6fb0; }
.balance-chip.low { background: #fff1c7; color: #7a5200; }
.balance-chip.neg { background: #ffe2e7; color: #c02a4f; }
.balance-chip small { font-weight: 700; }
.hero + .hero { margin-top: 18px; }
.date-chip input { border: 0; background: transparent; padding: 0; width: auto; box-shadow: none; }

/* scheda bambino */
.kid-title { display: flex; gap: 14px; align-items: center; }
.balance-big { padding: 14px; border-radius: 18px; background: #e3f1ff; color: #2a6fb0; display: grid; gap: 6px; margin-bottom: 12px; }
.balance-big b { font-family: var(--font-head); font-size: 1.8rem; }
.balance-big.low { background: #fff1c7; color: #7a5200; }
.balance-big.neg { background: #ffe2e7; color: #c02a4f; }
.bar.big { height: 12px; display: block; background: rgba(255, 255, 255, .6); }
.bar.big span { animation: none; }
.parent-picks { display: grid; gap: 8px; margin: 10px 0 14px; }
.parent-picks small { font-weight: 600; }

/* elenchi */
.kid-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.kid-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card-2); border-radius: 18px; }
.kid-row.inactive, .user-row.inactive { opacity: .55; }
.user-list.compact .user-row { padding: 8px 10px; }
.role-select { width: auto; padding: 6px 8px; font-size: .85rem; }
.emoji-select { width: 70px; }
.tag-pill { display: inline-block; padding: 4px 10px; border-radius: 99px; background: var(--card-2); font-weight: 800; font-size: .8rem; color: var(--muted); }
details.advanced { margin: 12px 0; padding: 10px 14px; border-radius: 16px; background: var(--card-2); }
details.advanced summary { cursor: pointer; font-weight: 800; }
details.danger-zone { background: #fff0f2; color: #8a1f3b; }
.modal.wide { width: min(640px, 100%); }

/* piattaforma */
.nidi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.nido-card.suspended { opacity: .6; filter: grayscale(.5); }
.nido-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nido-stats { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0; font-weight: 700; }

/* impostazioni: modalità di pagamento */
.mode-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.mode-opt {
    display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: left; padding: 14px; border-radius: 20px;
    border: 2px solid var(--line); background: var(--card-2); transition: transform .2s cubic-bezier(.2, 1.6, .4, 1);
}
.mode-opt:hover { transform: translateY(-2px); }
.mode-opt.active { border-color: var(--mint); background: var(--present); box-shadow: 0 5px 0 color-mix(in srgb, var(--mint) 50%, transparent); }
.mode-emoji { font-size: 1.8rem; }
.mode-opt small { color: var(--muted); font-weight: 600; }

/* report */
.table-card { overflow-x: auto; margin-bottom: 20px; }
table.report { width: 100%; border-collapse: collapse; font-weight: 600; }
table.report th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.report td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.report td a { color: var(--ink); text-decoration: none; font-weight: 800; }
table.report td.low { color: #b2541a; font-weight: 800; }
table.report td.neg { color: #c02a4f; font-weight: 800; }
.ack { font-weight: 800; font-size: .85rem; white-space: normal; }
.ack-ok { color: var(--present-ink); }
.ack-wait { color: var(--muted); }
.ack-bad { color: #c02a4f; }
.audit { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; max-height: 420px; overflow: auto; font-size: .9rem; }
.audit li { padding: 6px 10px; border-radius: 10px; background: var(--card-2); }
.audit-at { font-family: ui-monospace, Consolas, monospace; color: var(--muted); }
.privacy ul { display: grid; gap: 6px; }

@media (max-width: 640px) {
    .brand-sub { max-width: 110px; }
    .mode-picker { grid-template-columns: 1fr; }
    .kids-grid { grid-template-columns: 1fr; }
    .appello-head { justify-content: center; }
    .counters { justify-content: center; }
    .nidi-grid { grid-template-columns: 1fr; }
    .page-head { justify-content: center; text-align: center; }
}

/* ---------- diario di bordo ---------- */
.kind-picker { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 14px; }
.kind-opt {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px;
    border: 2px solid var(--line); background: var(--card-2); font-weight: 800; font-size: .8rem;
    transition: transform .15s cubic-bezier(.2, 1.6, .4, 1);
}
.kind-opt span { font-size: 1.6rem; }
.kind-opt:hover { transform: translateY(-2px); }
.kind-opt.active { border-color: var(--peach); background: #fff1e8; box-shadow: 0 4px 0 #f2a97c; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.choice { border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 14px; font-weight: 800; }
.choice.active { background: var(--present); border-color: var(--mint); color: var(--present-ink); }
.kid-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kid-pick { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 99px; background: var(--card); border: 2px solid var(--line); font-weight: 700; cursor: pointer; }
.kid-pick input { width: 16px; height: 16px; accent-color: var(--mint); }
.kid-pick.on { border-color: var(--mint); background: var(--present); }

.diary-card { margin-top: 18px; }
.diary-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.diary-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.diary-nav h3 { margin: 0; }
.month-nav.small { gap: 8px; }
.nav-btn.sm { width: 34px; height: 34px; font-size: 1.2rem; border-radius: 12px; }
.diary { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; display: grid; gap: 10px; }
.diary::before { content: ""; position: absolute; left: 25px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--line); }
.diary-item { position: relative; display: flex; gap: 12px; align-items: flex-start; animation: pop-in .4s both; }
.diary-dot {
    position: relative; z-index: 1; flex: none; width: 40px; height: 40px; display: grid; place-items: center; font-size: 1.3rem;
    border-radius: 14px; background: var(--card-2); box-shadow: 0 3px 0 var(--line);
}
.kind-meal .diary-dot { background: #fff1c7; }
.kind-nap .diary-dot { background: #e6dcff; }
.kind-diaper .diary-dot { background: #e3f1ff; }
.kind-activity .diary-dot { background: #ffe2ea; }
.kind-mood .diary-dot { background: var(--present); }
.diary-body { flex: 1; min-width: 0; padding-top: 2px; }
.diary-head { font-size: .85rem; color: var(--muted); font-weight: 700; }
.diary-head b { color: var(--ink); font-family: var(--font-head); }
.diary-text { font-weight: 700; }
.diary-empty { margin: 4px 0; }
.diary-btn { position: relative; border: 0; }
.diary-btn .badge {
    position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px;
    background: var(--rose); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center;
}

/* ---------- ritiro ---------- */
.pickup-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-bottom: 12px; }
.pickup-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; border-radius: 18px;
    border: 2px solid var(--line); background: var(--card-2); transition: transform .15s;
}
.pickup-opt small { color: var(--muted); font-weight: 700; }
.pickup-opt:hover { transform: translateY(-2px); }
.pickup-opt.active { border-color: var(--mint); background: var(--present); box-shadow: 0 4px 0 color-mix(in srgb, var(--mint) 50%, transparent); }
.pickup-opt.other.active { border-color: var(--rose); background: #ffe2e7; box-shadow: 0 4px 0 #f3b6c2; }

/* ---------- avvisi ---------- */
.banner.alert { background: #ffe2e7; color: #8a1f3b; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.alert-kid { background: #fff; border-radius: 99px; padding: 4px 10px; font-weight: 800; }
.alert-kid.unreached { background: #c02a4f; color: #fff; animation: glow 1.4s infinite; }
.alert-config { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .85rem; font-weight: 700; color: var(--muted); margin: -4px 4px 14px; }
.kid-card.unscheduled { opacity: .55; }
.weekday-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.wd { border: 2px solid var(--line); background: var(--card-2); border-radius: 12px; padding: 8px 10px; font-weight: 800; min-width: 52px; }
.wd.on { background: var(--present); border-color: var(--mint); color: var(--present-ink); }
.narrow-field { max-width: 220px; }

/* ---------- notifiche ---------- */
.banner.notify-cta { display: block; text-decoration: none; background: linear-gradient(135deg, #fff1c7, #ffe2ea); color: #7a3b00; }
.notify-prefs { display: grid; gap: 8px; margin-top: 12px; }
.check.disabled { opacity: .7; }
.form-msg.info { background: #e3f1ff; color: #2a6fb0; }

@media (max-width: 640px) {
    .kind-picker { grid-template-columns: repeat(3, 1fr); }
    .pickup-options { grid-template-columns: 1fr 1fr; }
}
.alert-kid.resolved { background: var(--present); color: var(--present-ink); animation: none; }
.backup-card { margin-bottom: 18px; }
.backup-card.warn { border-color: #f3b6c2; background: #fff6f7; }
