/* =================================================================
   Bloco Checkin — design system (refinado)
   ================================================================= */

:root {
    /* Backgrounds */
    --bg: #f6f4fa;
    --bg-elev: #ffffff;
    --bg-soft: #ede7f7;

    /* Text */
    --fg: #14132b;
    --fg-soft: #3b3658;
    --muted: #6b6786;
    --muted-2: #a39fbb;

    /* Primary */
    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --primary-soft: #ede4fb;
    --primary-fg: #ffffff;

    /* Semantic */
    --ok: #15803d;
    --ok-soft: #dcf5e7;
    --erro: #b91c1c;
    --erro-soft: #fde2e2;
    --info: #1d4ed8;
    --info-soft: #e0eaff;
    --warn: #c2410c;
    --warn-soft: #fde6d4;

    /* Borders & shadows */
    --border: #ebe7f3;
    --border-2: #d8d2e8;
    --shadow-xs: 0 1px 2px rgba(20, 8, 40, 0.04);
    --shadow-sm: 0 2px 6px rgba(20, 8, 40, 0.05);
    --shadow-md: 0 4px 16px rgba(20, 8, 40, 0.07);
    --shadow-lg: 0 12px 28px rgba(20, 8, 40, 0.12);

    /* Radius & sizing */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 18px;
    --radius-full: 999px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bot: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
*::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--fg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    min-height: 100vh;
    overscroll-behavior-y: contain;
    font-size: 15px;
}

/* Ícones SVG: herdam cor do texto, alinham no flow do texto */
.ic {
    display: inline-block;
    vertical-align: -3px;
    flex-shrink: 0;
}
.ic-sm { width: 16px; height: 16px; }
.ic-md { width: 20px; height: 20px; }
.ic-lg { width: 24px; height: 24px; }

/* App container — limita a largura em desktop pra ficar com aspecto de app */
.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: calc(76px + var(--safe-bot));
    position: relative;
    isolation: isolate;
    /* Fundo com toque festivo, mas suave o suficiente pra não competir com o conteúdo */
    background:
        radial-gradient(ellipse 80% 50% at 80% 0%, rgba(236, 72, 153, 0.07), transparent 60%),
        radial-gradient(ellipse 70% 60% at 0% 30%, rgba(250, 204, 21, 0.06), transparent 60%),
        radial-gradient(ellipse 90% 50% at 100% 80%, rgba(34, 211, 238, 0.05), transparent 60%),
        var(--bg);
}

/* Confetes em modo muted: fundo do app interno */
.confetti-rain.muted {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}
.confetti-rain.muted .confetti {
    opacity: 0.55;
    filter: blur(0.5px);
}

/* Garante que conteúdo fique acima de qualquer fundo decorativo (z-index sem alterar position) */
.app > main,
.app > .page-head { position: relative; z-index: 5; }
.app > .appbar    { z-index: 50; }  /* fica sticky (já tem position:sticky) */
.app > .bottom-nav { z-index: 40; } /* fica fixed (já tem position:fixed) */
.app > .fab       { z-index: 30; }

/* ====================== Header ====================== */
.appbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px) saturate(150%);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    padding: calc(var(--safe-top) + 14px) 16px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}
/* Fita festiva colorida na base do appbar */
.appbar::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 3px;
    background: linear-gradient(90deg,
        #6d28d9 0%, #ec4899 25%, #f97316 50%, #facc15 75%, #22d3ee 100%);
    opacity: 0.85;
}
.appbar .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--fg);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}
.appbar .brand .logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ec4899, #6d28d9);
    display: grid;
    place-items: center;
    color: white;
    box-shadow: 0 4px 10px rgba(109, 40, 217, 0.35);
}

/* Botão voltar (seta) na appbar das telas internas */
.appbar .back-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--bg-soft);
    color: var(--fg);
    text-decoration: none;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.08s;
}
.appbar .back-btn:hover { background: var(--primary-soft); color: var(--primary); }
.appbar .back-btn:active { transform: scale(0.95); }

.appbar.with-back .appbar-title {
    flex: 1;
    min-width: 0;
}
.appbar.with-back .appbar-title-text {
    font-weight: 700;
    font-size: 1rem;
    color: var(--fg);
    letter-spacing: -0.01em;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appbar .user-chip {
    font-size: 0.85rem;
    color: var(--muted);
    max-width: 130px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.appbar .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: var(--bg-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s;
}
.appbar .icon-btn:active { transform: scale(0.95); }
.appbar .icon-btn:hover { background: var(--primary-soft); }

/* Page heading */
.page-head { padding: 20px 16px 4px; }
.page-head h1 {
    margin: 0 0 4px;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
}
.page-head .sub { color: var(--muted); margin: 0; font-size: 0.9rem; }

main.content { padding: 8px 16px 24px; flex: 1; }

/* ====================== Bottom nav (destacada) ====================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-elev);
    border-top: 1px solid var(--border);
    padding: 10px 10px calc(10px + var(--safe-bot));
    display: flex;
    justify-content: space-around;
    gap: 4px;
    z-index: 40;
    box-shadow: 0 -8px 24px rgba(20, 8, 40, 0.08);
}
.bottom-nav a {
    flex: 1;
    text-decoration: none;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: color 0.15s, background 0.2s;
    position: relative;
    min-width: 0;
}
.bottom-nav a .ic {
    color: inherit;
    width: 24px;
    height: 24px;
    transition: transform 0.2s;
}
.bottom-nav a.active {
    color: var(--primary);
    background: var(--primary-soft);
}
.bottom-nav a.active .ic {
    color: var(--primary);
    transform: scale(1.1);
}
.bottom-nav a:not(.active):active { background: var(--bg-soft); }

/* Botão "Mais" no bottom nav — visualmente igual a um link mas é button */
.bottom-nav .nav-more {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    border-radius: 14px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-family: inherit;
    cursor: pointer;
    transition: color 0.15s, background 0.2s;
}
.bottom-nav .nav-more:active { background: var(--bg-soft); }
.bottom-nav .nav-more .ic { width: 24px; height: 24px; }

/* Bottom sheet "Mais opções" */
.more-sheet {
    position: fixed;
    inset: 0;
    z-index: 100;
}
.more-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 8, 40, 0.5);
    opacity: 0;
    transition: opacity 0.25s;
    backdrop-filter: blur(2px);
}
.more-sheet.open .more-sheet-backdrop { opacity: 1; }
.more-sheet-panel {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 480px;
    background: var(--bg-elev);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 12px 16px calc(20px + var(--safe-bot));
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0.18, 1);
    box-shadow: 0 -10px 40px rgba(20, 8, 40, 0.25);
}
.more-sheet.open .more-sheet-panel {
    transform: translateX(-50%) translateY(0);
}
.more-sheet-handle {
    width: 40px;
    height: 4px;
    background: var(--border-2);
    border-radius: 4px;
    margin: 0 auto 14px;
}
.more-sheet-title {
    text-align: center;
    margin: 0 0 14px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.more-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--fg);
    transition: background 0.15s;
}
.more-item:hover { background: var(--bg-soft); }
.more-item .ico-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.more-item .text { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.more-item .text strong { font-weight: 700; font-size: 0.95rem; }
.more-item.danger .ico-wrap { background: var(--erro-soft); color: var(--erro); }
.more-item.danger .text strong { color: var(--erro); }

.bottom-nav .nav-badge {
    position: absolute;
    top: 2px;
    right: 8px;
    background: var(--erro);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-elev);
    line-height: 1;
}
.bottom-nav a span:not(.ic) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ====================== Cards ====================== */
.card {
    background: var(--bg-elev);
    border-radius: var(--radius-lg);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin: 10px 0;
}

/* ====================== Forms ====================== */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field > .lbl {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--fg-soft);
    letter-spacing: 0.01em;
}
.field .hint { font-size: 0.78rem; color: var(--muted); }

input[type=text],
input[type=email],
input[type=password],
input[type=tel],
input[type=number],
input[type=datetime-local],
input[type=search],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: inherit;
    background: white;
    color: var(--fg);
    transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 84px; }
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    font-size: 0.92rem;
}
.checkbox-row input[type=checkbox] {
    width: 20px; height: 20px;
    accent-color: var(--primary);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .grid-2 { grid-template-columns: 1fr; } }

/* ====================== Buttons ====================== */
.btn {
    -webkit-appearance: none;
    appearance: none;
    border: 1px solid transparent;
    background: var(--bg-elev);
    color: var(--primary);
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    transition: transform 0.08s, background 0.15s, box-shadow 0.15s;
    box-shadow: var(--shadow-xs);
    user-select: none;
    line-height: 1.2;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}
.btn.primary:active { background: var(--primary-hover); }
.btn.ghost {
    background: transparent;
    color: var(--fg-soft);
    box-shadow: none;
    border: 1px solid var(--border-2);
}
.btn.ghost:hover { background: var(--bg-soft); color: var(--fg); }
.btn.danger-outline {
    background: transparent;
    color: var(--erro);
    border: 1px solid var(--erro);
    box-shadow: none;
}
.btn.danger-outline:hover { background: var(--erro-soft); }
.btn.block { width: 100%; }
.btn.small {
    padding: 6px 10px;
    min-height: 32px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}
.btn.huge {
    padding: 16px;
    min-height: 56px;
    font-size: 1.05rem;
    border-radius: var(--radius);
}
.btn .ic { width: 18px; height: 18px; }

/* Floating action button */
.fab {
    position: fixed;
    right: max(16px, calc((100vw - 480px) / 2 + 16px));
    bottom: calc(92px + var(--safe-bot));
    background: linear-gradient(135deg, #ec4899, #6d28d9);
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    box-shadow: 0 10px 24px rgba(109, 40, 217, 0.5);
    display: grid;
    place-items: center;
    z-index: 30;
    text-decoration: none;
    cursor: pointer;
    animation: fab-pulse 2.5s ease-in-out infinite;
}
.fab:active { transform: scale(0.95); animation: none; }
.fab .ic { width: 24px; height: 24px; }
@keyframes fab-pulse {
    0%, 100% { box-shadow: 0 10px 24px rgba(109, 40, 217, 0.5), 0 0 0 0 rgba(236, 72, 153, 0.5); }
    50%      { box-shadow: 0 10px 24px rgba(109, 40, 217, 0.5), 0 0 0 12px rgba(236, 72, 153, 0); }
}

/* ====================== Alert/Flash messages ====================== */
.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    margin: 10px 0;
    font-size: 0.9rem;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.45;
}
.flash.info    { background: var(--info-soft); color: #1d3a91; }
.flash.sucesso { background: var(--ok-soft);   color: #0d5a29; }
.flash.erro    { background: var(--erro-soft); color: #8a1818; }
.flash.warn    { background: var(--warn-soft); color: #7a3300; }
.flash .ic { color: currentColor; }

/* Banner pra "confirme seu email" */
.banner-email {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--warn-soft);
    border: 1px solid #f9d8a3;
    color: #7a3300;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
}
.banner-email .ic { flex-shrink: 0; margin-top: 2px; }
.banner-email strong { display: block; font-weight: 700; }
.banner-email p { margin: 2px 0 0; font-size: 0.82rem; line-height: 1.4; }
.banner-email code { background: rgba(255,255,255,0.5); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }

/* Zona de "Mensagens importantes" — pílula + lista expandível no /checkin.php */
.msg-zone {
    margin: 8px 16px 0;
}
.msg-pill {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg);
    transition: background 0.15s, border-color 0.15s;
}
.msg-pill:hover { background: rgba(0,0,0,0.02); }
.msg-pill .pulse-dot.red {
    background: var(--erro);
    box-shadow: 0 0 0 0 rgba(176, 24, 24, 0.7);
    animation: pulse-red 1.6s infinite;
}
@keyframes pulse-red {
    0%   { box-shadow: 0 0 0 0 rgba(176, 24, 24, 0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(176, 24, 24, 0); }
    100% { box-shadow: 0 0 0 0 rgba(176, 24, 24, 0); }
}
.msg-pill-label { flex: 1; text-align: left; }
.msg-count {
    background: var(--erro);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
}
.msg-chev {
    transition: transform 0.2s ease;
    color: var(--muted);
}
.msg-pill.open .msg-chev { transform: rotate(90deg); }

.msg-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: msg-list-in 0.2s ease;
}
@keyframes msg-list-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.msg-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
    max-height: 600px;
    overflow: hidden;
}
.msg-item.leaving {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
}
.msg-item.warn      { background: var(--warn-soft); border-color: #f9d8a3; color: #7a3300; }
.msg-item.risco     { background: var(--warn-soft); border-color: #f9d8a3; color: #7a3300; }
.msg-item.excedeu   { background: var(--erro-soft); border-color: #f4baba; color: #8a1818; }
.msg-item.aviso     { border-left: 4px solid var(--brand); }
.msg-item.push      { background: rgba(109,40,217,0.06); border-color: rgba(109,40,217,0.2); }

.msg-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,0.6);
    display: grid;
    place-items: center;
}
.msg-item.aviso .msg-icon { background: rgba(109,40,217,0.10); color: var(--brand); }
.msg-item.push .msg-icon  { background: rgba(109,40,217,0.10); color: var(--brand); }

.msg-body { flex: 1; min-width: 0; }
.msg-body strong {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.92rem;
    font-weight: 700;
    margin-bottom: 2px;
}
.msg-body p {
    margin: 2px 0 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: inherit;
    opacity: 0.9;
}
.msg-body code {
    background: rgba(255,255,255,0.5);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}
.msg-body .aviso-msg { white-space: pre-wrap; word-break: break-word; }
.msg-body .aviso-meta { font-size: 0.72rem; opacity: 0.7; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; }

.msg-dismiss {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s, color 0.15s;
}
.msg-dismiss:hover { background: rgba(0,0,0,0.06); color: var(--fg); }

.msg-reenviar {
    flex-shrink: 0;
    align-self: center;
}

/* Banner compacto de alerta de frequência (mostrado no /checkin.php) */
.freq-alerts {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 16px 0;
}
.freq-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: 1px solid;
    text-decoration: none;
}
.freq-alert.risco {
    background: var(--warn-soft);
    border-color: #f9d8a3;
    color: #7a3300;
}
.freq-alert.excedeu {
    background: var(--erro-soft);
    border-color: #f4baba;
    color: #8a1818;
}
.freq-alert .ic { flex-shrink: 0; }
.freq-alert-text { flex: 1; min-width: 0; }
.freq-alert-text strong { display: block; font-size: 0.92rem; font-weight: 700; line-height: 1.2; }
.freq-alert-text p { margin: 2px 0 0; font-size: 0.8rem; line-height: 1.35; }

/* Avisos do bloco */
.aviso-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 16px;
}
.aviso-card {
    position: relative;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius);
    padding: 12px 36px 12px 14px;
    transition: opacity 0.2s ease, transform 0.2s ease, max-height 0.25s ease, margin 0.25s ease, padding 0.25s ease;
    max-height: 800px;
    overflow: hidden;
}
.aviso-card.leaving {
    opacity: 0;
    transform: translateX(20px);
    max-height: 0;
    margin: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-width: 0;
    border-bottom-width: 0;
}
.aviso-dismiss {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 50%;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s, color 0.15s;
}
.aviso-dismiss:hover { background: rgba(0,0,0,0.06); color: var(--fg); }
.aviso-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.aviso-head h3 {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--fg);
    line-height: 1.25;
}
.aviso-msg {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: var(--fg);
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}
.aviso-meta {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.aviso-meta .ic { color: var(--muted); }
.aviso-bloco-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
}

/* Member-side avisos banner — compact card at top of checkin */
.avisos-feed {
    margin: 8px 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.avisos-feed .aviso-card {
    border-left-color: var(--brand);
}

/* Garante que `[hidden]` vença regras como `.btn { display: flex }` */
[hidden] { display: none !important; }

/* Cards de frequência (perfil do membro) */
.bloco-card-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.bloco-card-wrap .bloco-card {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.bloco-card-wrap .freq-card {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: 0;
}
.freq-card {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
}
.freq-card.risco    { background: var(--warn-soft); border-color: #f9d8a3; }
.freq-card.excedeu  { background: var(--erro-soft); border-color: #f4baba; }
.freq-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}
.freq-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.freq-card.risco .freq-title    { color: #7a3300; }
.freq-card.excedeu .freq-title  { color: #8a1818; }
.freq-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.freq-badge.ok       { background: var(--ok-soft);   color: var(--ok); }
.freq-badge.risco    { background: #f9d8a3; color: #7a3300; }
.freq-badge.excedeu  { background: #f4baba; color: #8a1818; }
.freq-bar {
    height: 8px;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    overflow: hidden;
    margin: 4px 0 8px;
}
.freq-bar-fill {
    height: 100%;
    background: var(--ok);
    border-radius: 999px;
    transition: width 0.3s ease;
}
.freq-card.risco .freq-bar-fill    { background: #c84d0a; }
.freq-card.excedeu .freq-bar-fill  { background: var(--erro); }
.freq-line {
    margin: 0;
    font-size: 0.85rem;
    color: var(--fg);
}
.freq-line .muted { font-size: 0.78rem; }
.freq-msg {
    margin: 6px 0 0;
    font-size: 0.82rem;
    font-weight: 600;
}
.freq-msg.risco    { color: #7a3300; }
.freq-msg.excedeu  { color: #8a1818; }

/* Lista de frequência no admin */
.freq-rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.freq-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}
a.freq-row:hover    { background: rgba(0,0,0,0.02); }
.freq-row.risco        { border-left: 4px solid #c84d0a; }
.freq-row.excedeu      { border-left: 4px solid var(--erro); }
.freq-row.ok           { border-left: 4px solid var(--ok); }
.freq-row.presente     { border-left: 4px solid var(--ok); }
.freq-row.ausente      { border-left: 4px solid var(--erro); }
.freq-row.justificada  { border-left: 4px solid var(--info); }
.freq-row form { margin: 0; }

/* Form inline pra justificar uma falta */
.freq-just-form {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
    margin-top: -4px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.freq-just-form .field { margin: 0; }

/* Badge "info" pra justificada */
.freq-badge.info { background: var(--info-soft); color: var(--info); }
.freq-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.freq-row-name { font-size: 0.95rem; color: var(--fg); }
.freq-row-email { font-size: 0.78rem; color: var(--muted); }
.freq-row-counter { display: flex; flex-direction: column; align-items: flex-end; }
.freq-row-num { font-size: 1.1rem; font-weight: 700; color: var(--fg); line-height: 1; }
.freq-row-num-lbl { font-size: 0.7rem; color: var(--muted); }

/* Banner de ativação de Push */
.push-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(109,40,217,0.10), rgba(236,72,153,0.10));
    border: 1px solid rgba(109,40,217,0.25);
    color: var(--fg);
    padding: 12px 14px;
    border-radius: var(--radius);
    margin: 8px 16px 0;
}
.push-banner.warn {
    background: var(--warn-soft);
    border-color: #f9d8a3;
    color: #7a3300;
}
.push-banner .ic { color: var(--brand); flex-shrink: 0; }
.push-banner.warn .ic { color: #c84d0a; }
.push-text { flex: 1; min-width: 0; }
.push-text strong { display: block; font-size: 0.95rem; font-weight: 700; }
.push-text p { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.push-banner.warn .push-text p { color: #7a3300; }

/* Toast */
.toast-wrap {
    position: fixed;
    top: calc(var(--safe-top) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: 90%;
    max-width: 420px;
    pointer-events: none;
}
.toast {
    background: var(--fg);
    color: white;
    padding: 12px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    margin-bottom: 8px;
    animation: toast-in 0.3s ease;
    pointer-events: auto;
}
.toast.ok   { background: var(--ok); }
.toast.erro { background: var(--erro); }
@keyframes toast-in {
    from { transform: translateY(-20px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

/* ====================== Hero / empty states ====================== */
.hero { text-align: center; padding: 36px 16px 28px; }
.hero .icon-circle {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin: 0 auto 14px;
}
.hero h2 { margin: 0 0 6px; font-size: 1.15rem; }
.hero p { color: var(--muted); margin: 0; font-size: 0.92rem; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .icon-circle {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--muted-2);
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
}
.empty h3 { color: var(--fg); margin: 0 0 6px; font-size: 1.05rem; }
.empty p { margin: 0; font-size: 0.9rem; }

/* Pulse dot (chamada ativa) */
.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.7);
    animation: pulse 1.6s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0.6); }
    70%  { box-shadow: 0 0 0 10px rgba(21, 128, 61, 0); }
    100% { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); }
}

/* Pílula de polling "ao vivo" (admin/chamada.php) */
.polling-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 8px 0 0;
    padding: 4px 10px 4px 8px;
    background: rgba(21, 128, 61, 0.10);
    color: var(--ok);
    border: 1px solid rgba(21, 128, 61, 0.25);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease;
}
.polling-pill.updating {
    background: rgba(21, 128, 61, 0.18);
}
.polling-pill .polling-time {
    color: var(--muted);
    font-weight: 500;
    font-size: 0.7rem;
}

/* ====================== Card de bloco (usado em listas) ====================== */
.bloco-cards {
    display: flex; flex-direction: column; gap: 10px;
    margin: 12px 0;
}
.bloco-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.1s, box-shadow 0.15s, border-color 0.15s;
}
.bloco-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-2);
}
a.bloco-card:active { transform: scale(0.99); }
.bloco-card.sem-admin {
    border-color: var(--erro);
    background: linear-gradient(to right, var(--erro-soft), var(--bg-elev) 30%);
}
.bc-avatar {
    width: 50px; height: 50px;
    border-radius: 14px;
    color: white;
    font-weight: 800;
    font-size: 1rem;
    display: grid; place-items: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.bc-info { flex: 1; min-width: 0; }
.bc-nome { font-weight: 700; font-size: 1rem; }
.bc-meta {
    display: flex; align-items: center; gap: 4px;
    color: var(--muted); font-size: 0.82rem; margin-top: 2px;
}
.bc-stats {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 6px;
    color: var(--fg-soft); font-size: 0.78rem;
}
.bc-stats span { display: inline-flex; align-items: center; gap: 4px; }
.bc-warn {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--erro); font-weight: 600; font-size: 0.78rem;
    margin-top: 6px;
}
.bc-chevron { color: var(--muted-2); flex-shrink: 0; }

/* ====================== Bloco chip (identidade visual do bloco) ====================== */
.bloco-line {
    margin: 0 0 8px;
}
.bloco-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    background: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    line-height: 1.4;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bloco-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
    flex-shrink: 0;
}
/* Quando o chip aparece dentro de cards já coloridos (aberta/em-andamento/confirmada/expirada/chamada-perdida), reforça contraste */
.ensaio-card.aberta .bloco-chip,
.ensaio-card.em-andamento .bloco-chip,
.ensaio-card.confirmada .bloco-chip,
.ensaio-card.expirada .bloco-chip,
.ensaio-card.chamada-perdida .bloco-chip {
    box-shadow: 0 2px 6px rgba(0,0,0,0.2), 0 0 0 1px rgba(255,255,255,0.25);
}

/* Picker de blocos no cadastro */
.bloco-picker {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bloco-pick {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.bloco-pick input { display: none; }
.bloco-pick .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bloco, var(--primary));
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.5) inset;
}
.bloco-pick .nome { flex: 1; font-weight: 600; font-size: 0.94rem; }
.bloco-pick .check {
    width: 22px; height: 22px;
    border-radius: 50%;
    background: var(--border);
    color: white;
    display: grid; place-items: center;
    transition: background 0.15s;
}
.bloco-pick .check .ic { width: 14px; height: 14px; }
.bloco-pick.on {
    border-color: var(--bloco, var(--primary));
    background: var(--bg-elev);
}
.bloco-pick.on .check { background: var(--bloco, var(--primary)); }

/* ====================== Ensaio card (4 estados) ====================== */
.ensaio-card {
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    margin: 10px 0;
    position: relative;
    overflow: hidden;
}
.ensaio-card .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.ensaio-card h2 {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    position: relative;
}
.ensaio-card h3 {
    margin: 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}
.ensaio-card .row-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    margin: 2px 0;
}
.ensaio-card .row-meta .ic { width: 16px; height: 16px; opacity: 0.85; }

/* Estado: programado */
.ensaio-card.programado {
    background: var(--bg-elev);
    color: var(--fg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}
.ensaio-card.programado .row-flex {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.ensaio-card.programado .nome-ensaio {
    margin: 4px 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
}
.ensaio-card.programado .meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--fg-soft);
    font-size: 0.88rem;
    margin: 2px 0;
}
.ensaio-card.programado .meta-row .ic { width: 16px; height: 16px; color: var(--muted); }
.ensaio-card.programado .desc-ensaio {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.4;
}
.ensaio-card.programado .hint-info {
    margin: 12px 0 0;
    padding: 10px 12px;
    background: var(--bg);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.ensaio-card.programado .hint-info .ic { color: var(--muted-2); flex-shrink: 0; }

/* Estado: em andamento (laranja chapado) */
.ensaio-card.em-andamento {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    color: white;
    box-shadow: var(--shadow-md);
}
.ensaio-card.em-andamento::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.12), transparent 60%);
    pointer-events: none;
}
.ensaio-card.em-andamento .tag {
    background: rgba(255,255,255,0.20);
    color: white;
}
.ensaio-card.em-andamento .wait-box {
    background: rgba(255,255,255,0.16);
    color: white;
    padding: 12px 14px;
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Estado: aberta (roxo chapado, ação primária) */
.ensaio-card.aberta {
    background: linear-gradient(135deg, var(--primary), #a21caf);
    color: white;
    box-shadow: var(--shadow-lg);
}
.ensaio-card.aberta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.13), transparent 60%);
    pointer-events: none;
}
.ensaio-card.aberta .tag {
    background: var(--ok);
    color: white;
    box-shadow: 0 1px 6px rgba(21, 128, 61, 0.5);
}
.ensaio-card.aberta .tag .pulse-dot {
    background: white;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
    animation: pulse-white 1.6s infinite;
}
@keyframes pulse-white {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}
.ensaio-card.aberta .row-meta { opacity: 0.95; }

/* Countdown */
.countdown {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.16);
    color: white;
    padding: 12px 14px;
    border-radius: var(--radius);
    margin: 14px 0 16px;
    font-weight: 600;
    position: relative;
    transition: background 0.3s;
}
.countdown .ic { color: white; }
.countdown .time {
    font-size: 1.5rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
    line-height: 1;
}
.countdown .lbl { font-size: 0.78rem; opacity: 0.85; margin-left: auto; text-transform: uppercase; letter-spacing: 0.05em; }
.countdown.warn {
    background: rgba(217, 119, 6, 0.92);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}
.countdown.danger {
    background: rgba(185, 28, 28, 0.95);
    animation: countdown-shake 1s infinite;
}
.countdown.zero { background: rgba(0,0,0,0.4); animation: none; }
@keyframes countdown-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

.ensaio-card.aberta .btn-grande {
    width: 100%;
    background: white;
    color: var(--primary);
    border: none;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    min-height: 52px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.1s;
    position: relative;
}
.ensaio-card.aberta .btn-grande:active { transform: scale(0.97); }
.ensaio-card.aberta .btn-grande:disabled { opacity: 0.7; cursor: not-allowed; }
.ensaio-card.aberta .btn-test {
    width: 100%;
    margin-top: 10px;
    background: rgba(255,255,255,0.12);
    color: white;
    border: 1px dashed rgba(255,255,255,0.4);
    padding: 8px;
    border-radius: var(--radius);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.ensaio-card.aberta .btn-test:active { transform: scale(0.97); }

/* Estado: confirmada (verde) */
.ensaio-card.confirmada {
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: white;
    box-shadow: var(--shadow-md);
    text-align: center;
    padding: 26px 20px;
}
.ensaio-card.confirmada .check-mark {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.22);
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    position: relative;
}
.ensaio-card.confirmada .check-mark .ic { width: 32px; height: 32px; }
.ensaio-card.confirmada .tag {
    display: inline-flex;
    background: rgba(255,255,255,0.22);
    color: white;
    margin-bottom: 10px;
}
.ensaio-card.confirmada h2 { font-size: 1.15rem; margin-bottom: 6px; }
.ensaio-card.confirmada .row-meta { justify-content: center; opacity: 0.95; }
.ensaio-card.confirmada .ts {
    margin: 8px 0 0;
    opacity: 0.85;
    font-size: 0.82rem;
}

/* Estado: chamada_perdida (membro não marcou + chamada já fechada/expirou, ensaio rolando) */
.ensaio-card.chamada-perdida {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    box-shadow: var(--shadow-md);
}
.ensaio-card.chamada-perdida::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255,255,255,0.10), transparent 60%);
    pointer-events: none;
}
.ensaio-card.chamada-perdida .tag {
    background: rgba(255,255,255,0.22);
    color: white;
}
.ensaio-card.chamada-perdida h2 { font-size: 1.2rem; margin-bottom: 6px; }
.ensaio-card.chamada-perdida .row-meta { opacity: 0.92; }
.ensaio-card.chamada-perdida .wait-box {
    background: rgba(255,255,255,0.16);
    color: white;
    padding: 12px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.4;
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: flex-start;
}
.ensaio-card.chamada-perdida .wait-box .ic { flex-shrink: 0; }

/* Estado: expirada (cinza opaco) */
.ensaio-card.expirada {
    background: linear-gradient(135deg, #4a3f63, #2d1545);
    color: white;
    box-shadow: var(--shadow-md);
}
.ensaio-card.expirada .tag { background: rgba(255,255,255,0.18); color: white; }
.ensaio-card.expirada h2 { font-size: 1.1rem; margin-bottom: 6px; }
.ensaio-card.expirada .wait-box {
    background: rgba(255,255,255,0.12);
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 0.88rem;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ====================== List item (cards de ensaio no admin) ====================== */
.list-item {
    background: var(--bg-elev);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin: 10px 0;
}
.list-item h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 700;
}
.list-item .meta {
    color: var(--muted);
    font-size: 0.86rem;
    margin: 2px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.list-item .meta .ic { width: 14px; height: 14px; }
.list-item.inativo { opacity: 0.55; }

/* Toggle switch (iOS-style) */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #d8d4e4;
    border-radius: 999px;
    transition: 0.2s;
}
.switch .slider::before {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:disabled + .slider { opacity: 0.5; cursor: not-allowed; }

/* ====================== Badges ====================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    background: var(--bg-soft);
    color: var(--fg-soft);
}
.badge .ic { width: 12px; height: 12px; }
.badge.ok   { background: var(--ok-soft);   color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.erro { background: var(--erro-soft); color: var(--erro); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.off  { background: #f0eef5; color: var(--muted); }

/* ====================== Stats grid ====================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 6px 0 14px;
}
.stat {
    background: var(--bg-elev);
    border-radius: var(--radius);
    padding: 14px 10px;
    text-align: center;
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
}
.stat .n {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--fg);
    display: block;
    line-height: 1.1;
    letter-spacing: -0.02em;
}
.stat .lbl {
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
    display: block;
}

/* ====================== Segmented control (tabs) ====================== */
.segmented {
    display: flex;
    background: var(--bg-soft);
    padding: 4px;
    border-radius: var(--radius);
    margin: 14px 0 12px;
    gap: 4px;
}
.segmented button {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 10px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.segmented button .count {
    background: rgba(0,0,0,0.06);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.72rem;
    color: inherit;
}
.segmented button.active {
    background: var(--bg-elev);
    color: var(--fg);
    box-shadow: var(--shadow-xs);
}
.segmented button.active .count { background: var(--primary-soft); color: var(--primary); }

/* ====================== Search bar ====================== */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-elev);
    border: 1px solid var(--border-2);
    border-radius: var(--radius);
    padding: 0 12px;
    margin: 8px 0 14px;
    gap: 8px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.search-bar .ic { color: var(--muted); }
.search-bar input {
    border: none;
    background: transparent;
    flex: 1;
    padding: 10px 0;
    font-size: 0.95rem;
    outline: none;
    box-shadow: none;
}
.search-bar input:focus { outline: none; box-shadow: none; }
.search-bar .clear {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
    display: grid;
    place-items: center;
}
.search-bar .clear:hover { color: var(--fg); }

/* Auditoria */
.audit-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.audit-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.audit-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(109, 40, 217, 0.10);
    color: var(--brand);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.audit-body { flex: 1; min-width: 0; }
.audit-head {
    margin: 0;
    font-size: 0.92rem;
    color: var(--fg);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.audit-meta {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: var(--muted);
    word-break: break-word;
}
.audit-foot {
    margin: 4px 0 0;
    font-size: 0.72rem;
    color: var(--muted);
}
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 12px 0;
    justify-content: center;
}
.pagination a {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-elev);
    color: var(--fg);
    text-decoration: none;
    font-size: 0.85rem;
}
.pagination a.active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* ====================== Dashboard ====================== */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 8px 0 16px;
}
.dash-stat {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}
.dash-stat.highlight {
    background: linear-gradient(135deg, rgba(109,40,217,0.08), rgba(236,72,153,0.08));
    border-color: rgba(109,40,217,0.2);
}
.dash-stat.warn {
    background: var(--warn-soft);
    border-color: #f9d8a3;
}
.dash-stat-n {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--fg);
    line-height: 1.1;
}
.dash-stat.highlight .dash-stat-n { color: var(--brand); }
.dash-stat.warn .dash-stat-n { color: #c84d0a; }
.dash-stat-l {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.25;
}
.dash-stat-link {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}
@media (min-width: 480px) { .dash-stats { grid-template-columns: repeat(3, 1fr); } }

/* Card soft (usado em várias seções do dashboard) */
.card-soft {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    margin: 0 0 12px;
}

/* Gráfico SVG */
.dash-chart {
    width: 100%;
    height: auto;
    max-height: 140px;
    display: block;
}

/* Barras horizontais (distribuição de chegada) */
.dash-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dash-bar-row {
    display: grid;
    grid-template-columns: 90px 1fr 32px;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
}
.dash-bar-lbl { color: var(--muted); }
.dash-bar-track {
    height: 12px;
    background: rgba(0,0,0,0.06);
    border-radius: 999px;
    overflow: hidden;
}
.dash-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ok), #84cc16);
    transition: width 0.3s ease;
}
.dash-bar-fill.fora { background: linear-gradient(90deg, var(--erro), #c84d0a); }
.dash-bar-val {
    text-align: right;
    font-weight: 700;
    color: var(--fg);
}

/* Colunas lado a lado pra rankings */
.dash-cols {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 0 12px;
}
@media (min-width: 480px) { .dash-cols { grid-template-columns: 1fr 1fr; } }

.dash-rank {
    list-style: none;
    counter-reset: dash-rank;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dash-rank li {
    counter-increment: dash-rank;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.88rem;
}
.dash-rank li::before {
    content: counter(dash-rank);
    width: 22px;
    height: 22px;
    background: rgba(109,40,217,0.10);
    color: var(--brand);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}
.dash-rank-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-rank-val { font-weight: 700; }
.dash-rank-val.ok      { color: var(--ok); }
.dash-rank-val.danger  { color: var(--erro); }

/* Ensaios menos engajados */
.dash-ensaios-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.dash-ensaio-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.dash-ensaio-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-ensaio-info strong { font-size: 0.92rem; color: var(--fg); }
.dash-ensaio-pct { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.dash-ensaio-n {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--erro);
    line-height: 1;
}

/* ====================== Member rows (lista compacta) ====================== */
.member-rows { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-elev);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.member-row .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-soft);
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    text-transform: uppercase;
}
.member-row.presente .avatar  { background: var(--ok-soft);   color: var(--ok); }
.member-row.ja-conf .avatar   { background: var(--info-soft); color: var(--info); }
.member-row.ausente .avatar   { background: var(--erro-soft); color: var(--erro); }
.member-row .info { flex: 1; min-width: 0; }
.member-row .nome {
    font-weight: 600;
    font-size: 0.94rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-row .meta {
    color: var(--muted);
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.member-row .status-ic {
    width: 26px; height: 26px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.member-row.presente .status-ic { background: var(--ok); color: white; }
.member-row.ja-conf  .status-ic { background: var(--info); color: white; }
.member-row.ausente  .status-ic { background: var(--erro-soft); color: var(--erro); }
.member-row.hidden { display: none; }
.member-row .status-ic .ic { width: 14px; height: 14px; }

/* Row suspeito: presença com fingerprint compartilhada ou precisão GPS muito baixa */
.member-row.suspeito { border-color: #f9d8a3; background: rgba(249, 216, 163, 0.18); }
.member-row .nome .row-warn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    width: 18px;
    height: 18px;
    background: #f9d8a3;
    color: #7a3300;
    border-radius: 50%;
    cursor: help;
    vertical-align: -3px;
}
.member-row .nome .row-warn .ic { width: 11px; height: 11px; }

/* ====================== Checkin history list ====================== */
.checkin-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.checkin-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--bg-elev);
    padding: 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
}
.checkin-item.presente  { border-left-color: var(--ok); }
.checkin-item.ausente   { border-left-color: var(--erro); }
.checkin-item.em_aberto { border-left-color: var(--info); background: var(--info-soft); }
.checkin-item .status-ic {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: white;
    background: var(--muted);
}
.checkin-item.presente .status-ic  { background: var(--ok); }
.checkin-item.ausente .status-ic   { background: var(--erro); }
.checkin-item.em_aberto .status-ic { background: var(--info); }
.checkin-item .info { flex: 1; min-width: 0; }
.checkin-item .nome { font-weight: 700; font-size: 0.94rem; }
.checkin-item .meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.checkin-item .meta-tag { color: var(--ok);   margin-top: 4px; font-size: 0.82rem; }
.checkin-item.ausente   .meta-tag { color: var(--erro); }
.checkin-item.em_aberto .meta-tag { color: var(--info); }

/* ====================== Simple list ====================== */
.simple-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
    background: var(--bg-elev);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    border: 1px solid var(--border);
    overflow: hidden;
}
.simple-list li {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.simple-list li:last-child { border-bottom: none; }
.simple-list .nome { font-weight: 600; font-size: 0.92rem; }
.simple-list .meta { color: var(--muted); font-size: 0.78rem; display: flex; align-items: center; gap: 4px; }
.simple-list a.row-link { color: inherit; text-decoration: none; }

/* ====================== Spinner ====================== */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
.spinner.dark {
    border-color: rgba(109, 40, 217, 0.25);
    border-top-color: var(--primary);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ====================== Pagination ====================== */
.paginacao {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 14px 0;
    flex-wrap: wrap;
}
.paginacao a {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--fg-soft);
    background: var(--bg-elev);
    border: 1px solid var(--border-2);
    font-size: 0.85rem;
}
.paginacao a.atual {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ====================== Section headers ====================== */
.section-title {
    color: var(--muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 16px 0 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}
.section-title .count {
    background: var(--bg-soft);
    color: var(--muted);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 0.7rem;
}

/* ====================== Utilities ====================== */
.muted { color: var(--muted); }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 18px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 18px; }
.gap-8 { display: flex; gap: 8px; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
code {
    background: var(--bg-soft);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* ====================== Splash (abertura) ====================== */
.splash {
    position: fixed;
    inset: 0;
    z-index: 9999;
    overflow: hidden;
    background: linear-gradient(135deg, #6d28d9 0%, #a21caf 35%, #db2777 70%, #ea580c 100%);
    background-size: 200% 200%;
    animation: splash-bg 6s ease-in-out infinite, splash-bg-pop 0.6s ease-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    user-select: none;
    cursor: pointer;
}
@keyframes splash-bg {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}
@keyframes splash-bg-pop {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.splash.leaving {
    animation: splash-leave 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    pointer-events: none;
}
@keyframes splash-leave {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(1.08); }
}

/* Blobs de luz girando ao fundo */
.splash::before,
.splash::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    pointer-events: none;
}
.splash::before {
    width: 360px; height: 360px;
    background: #facc15;
    top: -90px; left: -120px;
    animation: splash-blob1 8s ease-in-out infinite;
}
.splash::after {
    width: 400px; height: 400px;
    background: #22d3ee;
    bottom: -140px; right: -140px;
    animation: splash-blob2 9s ease-in-out infinite;
}
@keyframes splash-blob1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(60px, 50px) scale(1.2); }
}
@keyframes splash-blob2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-50px, -40px) scale(1.15); }
}

/* Streamers (fitas serpentina caindo) */
.splash-streamers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.streamer {
    position: absolute;
    top: -20%;
    width: 4px;
    height: 50vh;
    border-radius: 4px;
    opacity: 0;
    transform-origin: top center;
    animation: streamer-fall 1.8s cubic-bezier(0.3, 0, 0.3, 1) forwards;
}
@keyframes streamer-fall {
    0%   { opacity: 0; transform: translateY(-100%) rotate(var(--rot, 0deg)); }
    20%  { opacity: 0.9; }
    100% { opacity: 0.7; transform: translateY(120vh) rotate(var(--rot, 0deg)); }
}

/* Conteúdo central (logo + texto) */
.splash-content {
    position: relative;
    z-index: 5;
    text-align: center;
    color: white;
}
.splash-logo {
    width: 110px;
    height: 110px;
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
    color: var(--primary);
    display: grid;
    place-items: center;
    margin: 0 auto 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35), 0 0 0 8px rgba(255,255,255,0.12);
    transform: scale(0) rotate(-30deg);
    opacity: 0;
    animation: splash-logo-pop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s forwards,
               splash-logo-pulse 2s ease-in-out 1.4s infinite;
}
.splash-logo .ic { width: 56px; height: 56px; }
@keyframes splash-logo-pop {
    0%   { opacity: 0; transform: scale(0) rotate(-30deg); }
    60%  { opacity: 1; transform: scale(1.15) rotate(8deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes splash-logo-pulse {
    0%, 100% { transform: scale(1) rotate(0); }
    50%      { transform: scale(1.04) rotate(-2deg); }
}

.splash-title {
    margin: 0 0 8px;
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    opacity: 0;
    transform: translateY(20px);
    animation: splash-fade-up 0.6s ease-out 0.9s forwards;
}
.splash-sub {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: splash-fade-up 0.6s ease-out 1.2s forwards;
}
@keyframes splash-fade-up {
    to { opacity: 0.95; transform: translateY(0); }
}

/* Confetes do splash usam mesma classe .confetti, mas o container fica fixed */
.splash .confetti-rain {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
}

.splash-skip {
    position: absolute;
    top: calc(var(--safe-top) + 16px);
    right: 16px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    color: white;
    border: 1px solid rgba(255,255,255,0.25);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    z-index: 10;
    letter-spacing: 0.04em;
    opacity: 0;
    animation: splash-fade-up 0.5s ease-out 1.8s forwards;
}
.splash-skip:hover { background: rgba(255,255,255,0.25); }

/* ====================== Auth screens — Carnaval mode ====================== */
.auth-screen {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px 16px;
    position: relative;
    overflow: hidden;

    /* Fundo vibrante de carnaval com gradient animado */
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(250, 204, 21, 0.45), transparent 60%),
        radial-gradient(ellipse 70% 70% at 90% 20%, rgba(236, 72, 153, 0.55), transparent 55%),
        radial-gradient(ellipse 75% 65% at 80% 90%, rgba(34, 211, 238, 0.45), transparent 60%),
        radial-gradient(ellipse 80% 70% at 10% 95%, rgba(249, 115, 22, 0.5), transparent 60%),
        linear-gradient(135deg, #6d28d9 0%, #a21caf 35%, #db2777 70%, #ea580c 100%);
    background-size: 200% 200%, 200% 200%, 200% 200%, 200% 200%, 250% 250%;
    animation: carnaval-shift 18s ease-in-out infinite;
}
@keyframes carnaval-shift {
    0%, 100% {
        background-position: 0% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 50%;
    }
    50% {
        background-position: 30% 20%, 70% 30%, 70% 70%, 30% 80%, 100% 50%;
    }
}

/* Blobs decorativos flutuando ao fundo */
.auth-screen::before,
.auth-screen::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
    pointer-events: none;
    z-index: 0;
}
.auth-screen::before {
    width: 280px; height: 280px;
    background: #facc15;
    top: -60px; left: -80px;
    animation: blob-1 14s ease-in-out infinite;
}
.auth-screen::after {
    width: 320px; height: 320px;
    background: #22d3ee;
    bottom: -100px; right: -100px;
    animation: blob-2 16s ease-in-out infinite;
}
@keyframes blob-1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(50px, 40px) scale(1.15); }
}
@keyframes blob-2 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(-40px, -30px) scale(1.1); }
}

/* Chuva de confetes */
.confetti-rain {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.confetti {
    position: absolute;
    top: -20px;
    will-change: transform, opacity;
    animation-name: confetti-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    box-shadow: 0 0 4px rgba(0,0,0,0.1);
}
.confetti-sq    { border-radius: 2px; }
.confetti-circ  { border-radius: 50%; }
.confetti-strip { width: 6px !important; height: 16px !important; border-radius: 1px; }
@keyframes confetti-fall {
    0% {
        transform: translate(0, -20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translate(var(--sway, 0), 110vh) rotate(var(--rot, 720deg));
        opacity: 0.6;
    }
}

/* Explosão de confetes ao confirmar checkin (one-shot, ancorado no card) */
.confetti-burst {
    position: fixed;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 200;
}
.confetti-burst .confetti {
    position: absolute;
    top: 0;
    left: 0;
    will-change: transform, opacity;
    border-radius: 2px;
    animation: none;
}
.confetti-burst .confetti.confetti-circ  { border-radius: 50%; }
.confetti-burst .confetti.confetti-strip { width: 5px !important; height: 14px !important; }

/* Card glassmorphism por cima do fundo vibrante */
.auth-card {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 400px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: var(--radius-lg);
    padding: 30px 24px;
    box-shadow:
        0 20px 60px rgba(20, 8, 40, 0.4),
        0 2px 8px rgba(20, 8, 40, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.auth-card .logo-big {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ec4899, #6d28d9);
    color: white;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    box-shadow: 0 8px 20px rgba(109, 40, 217, 0.45);
    animation: logo-pop 3s ease-in-out infinite;
}
@keyframes logo-pop {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%      { transform: scale(1.05) rotate(-3deg); }
}
.auth-card .logo-big .ic { width: 32px; height: 32px; }
.auth-card h1 {
    text-align: center;
    margin: 0 0 6px;
    font-size: 1.6rem;
    letter-spacing: -0.02em;
    font-weight: 800;
    background: linear-gradient(135deg, #6d28d9, #db2777);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-card .auth-sub {
    text-align: center;
    color: var(--muted);
    margin: 0 0 24px;
    font-size: 0.95rem;
}
.auth-card .auth-foot {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--muted);
}
.auth-card .auth-foot a {
    color: var(--primary);
    font-weight: 700;
    text-decoration: none;
}
.auth-card .auth-foot a:hover { text-decoration: underline; }

/* Tagline acima do card (em branco, sobre o fundo) */
.auth-tagline {
    position: relative;
    z-index: 10;
    text-align: center;
    color: white;
    margin: 0 0 18px;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ============================================================
   DESKTOP LAYOUT (>= 900px)
   Sidebar à esquerda, conteúdo principal centralizado e mais largo.
   Mobile-first stays intact below 900px.
   ============================================================ */

/* Por padrão (mobile), a side-nav fica escondida */
.side-nav { display: none; }

@media (min-width: 900px) {
    /* App vira layout com grid: sidebar + main */
    .app {
        max-width: none;
        display: grid;
        grid-template-columns: 260px 1fr;
        grid-auto-rows: max-content;
        align-content: start;
        padding-bottom: 0;
        min-height: 100vh;
    }
    /* Por padrão, todo filho direto do .app vai na coluna 2 (área principal) */
    .app > * { grid-column: 2; min-width: 0; }
    .app > .side-nav { grid-column: 1; grid-row: 1 / span 99; }

    /* Sidebar */
    .side-nav {
        display: flex;
        flex-direction: column;
        grid-column: 1;
        grid-row: 1 / 3;
        background: var(--bg-elev);
        border-right: 1px solid var(--border);
        padding: 18px 14px;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        gap: 6px;
    }
    .side-brand {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: var(--fg);
        font-weight: 700;
        font-size: 1rem;
        padding: 4px 8px 14px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
    }
    .side-brand .logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        background: linear-gradient(135deg, #ec4899, #6d28d9);
        display: grid;
        place-items: center;
        color: white;
        box-shadow: 0 4px 10px rgba(109, 40, 217, 0.35);
        flex-shrink: 0;
    }
    .side-user {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 8px 10px;
        background: var(--bg-soft);
        border-radius: 12px;
        margin-bottom: 8px;
    }
    .side-user-avatar {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--primary);
        color: white;
        display: grid;
        place-items: center;
        font-weight: 700;
        flex-shrink: 0;
    }
    .side-user-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
    .side-user-info strong {
        font-size: 0.88rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .side-user-info .muted { font-size: 0.7rem; }

    .side-section {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .side-section-title {
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        color: var(--muted);
        padding: 14px 12px 6px;
        margin: 0;
    }
    .side-link {
        display: flex;
        align-items: center;
        gap: 10px;
        text-decoration: none;
        color: var(--fg);
        padding: 9px 12px;
        border-radius: 10px;
        font-size: 0.88rem;
        font-weight: 500;
        transition: background 0.15s, color 0.15s;
        position: relative;
    }
    .side-link:hover { background: var(--bg-soft); }
    .side-link .ico-wrap { color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
    .side-link .lbl { flex: 1; }
    .side-link.active {
        background: var(--primary-soft);
        color: var(--primary);
        font-weight: 600;
    }
    .side-link.active .ico-wrap { color: var(--primary); }
    .side-link.danger { color: var(--erro); }
    .side-link.danger .ico-wrap { color: var(--erro); }
    .side-link.danger:hover { background: var(--erro-soft); }
    .side-badge {
        background: var(--erro);
        color: #fff;
        font-size: 0.65rem;
        font-weight: 700;
        padding: 2px 7px;
        border-radius: 999px;
        min-width: 18px;
        text-align: center;
    }

    /* Esconde bottom-nav e more-sheet no desktop */
    .bottom-nav { display: none !important; }
    .more-sheet { display: none !important; }

    /* Appbar — fica acima do content area, abre espaço pra ele */
    .appbar {
        grid-column: 2;
        grid-row: 1;
        padding: 18px 32px;
    }

    /* User chip da appbar e botão de logout — escondidos no desktop (sidebar tem) */
    .appbar .user-chip,
    .appbar .icon-btn[href*="logout"] { display: none; }

    /* Brand da appbar fica menos proeminente (sidebar tem brand maior) */
    .appbar .brand { display: none; }
    .appbar.with-back .brand { display: none; }

    /* Content area — wider, max 1100px, centered */
    main.content,
    .page-head {
        grid-column: 2;
        max-width: 1100px;
        width: 100%;
        margin-left: 32px;
        margin-right: 32px;
        padding-left: 0;
        padding-right: 0;
    }
    .page-head { margin-top: 16px; }
    main.content { padding: 16px 0 40px; }

    /* Banner email, flash, avisos-feed, msg-zone, freq-alerts: ajustar a margem */
    .banner-email,
    .flash,
    .msg-zone,
    .avisos-feed,
    .freq-alerts {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Dashboard: stats grid pode ir até 6 colunas */
    .dash-stats { grid-template-columns: repeat(3, 1fr); }
    .dash-cols { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1200px) {
    .dash-stats { grid-template-columns: repeat(6, 1fr); }

    /* Member rows do admin/chamada em 2 colunas */
    .member-rows {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .member-rows .section-title,
    .member-rows .group-title {
        grid-column: 1 / -1;
    }

    /* Avisos do admin podem ir em 2 colunas tb */
    .aviso-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}
