/* =====================================================================
   PRAÇA DA CIDADANIA — DESIGN SYSTEM 2.0
   Mesma paleta de antes (verde-água + azul FUSSP), componentes novos
   e layout pensado primeiro para o celular.
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Cores FUSSP (identidade) */
    --fussp-teal: #00b4c5;
    --fussp-dark-blue: #2f368f;
    --fussp-yellow: #f6c845;
    --fussp-blue: #1b95c6;
    --fussp-light-blue: #a4dbe8;
    --fussp-orange: #e87717;

    /* Tema (os mesmos valores da versão anterior) */
    --primary: #2dd4bf;          /* verde-água */
    --primary-dark: #1d4ed8;     /* azul forte do degradê */
    --secondary: #1e3a8a;        /* azul escuro */
    --accent: #facc15;
    --gradient: linear-gradient(120deg, var(--primary) 0%, #0ea5e9 55%, var(--primary-dark) 100%);
    --gradient-soft: linear-gradient(120deg, rgba(45, 212, 191, 0.14), rgba(29, 78, 216, 0.10));

    /* Texto "de marca" legível sobre fundo claro */
    --ink: #1d4ed8;
    --ink-teal: #0f766e;

    --background: #f0f9ff;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-solid: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-soft: #94a3b8;

    --danger: #ef4444;
    --danger-hover: #dc2626;
    --danger-soft: #fee2e2;
    --success: #10b981;
    --success-soft: #d1fae5;
    --warning: #f59e0b;
    --warning-soft: #fef3c7;
    --info: #3b82f6;
    --info-soft: #dbeafe;
    --violet: #8b5cf6;
    --violet-soft: #ede9fe;
    --whatsapp: #25d366;

    --border: rgba(15, 23, 42, 0.08);
    --border-strong: #e2e8f0;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
    --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 25px 50px -12px rgba(15, 23, 42, 0.28);
    --ring: 0 0 0 4px rgba(45, 212, 191, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --header-h: 68px;
    --bottom-nav-h: 64px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---------- Base ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    position: relative;
    overflow-x: hidden;
}
/* Fundo com os cantos coloridos e a textura da marca.
   Fica num pseudo-elemento fixo porque background-attachment: fixed não funciona no iPhone. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: var(--background);
    background-image:
        url('../img/bg-corner-tl.png'),
        url('../img/bg-corner-tr.png'),
        url('../img/bg-corner-bl.png'),
        url('../img/bg-corner-br.png'),
        url('../img/bg-pattern.png');
    background-size:
        clamp(180px, 24vw, 460px) auto,
        clamp(180px, 24vw, 460px) auto,
        clamp(180px, 24vw, 460px) auto,
        clamp(180px, 24vw, 460px) auto,
        auto;
    background-position: top left, top right, bottom left, bottom right, top center;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
}
img { max-width: 100%; display: block; }
a { color: var(--ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid rgba(45, 212, 191, 0.6); outline-offset: 2px; }
::selection { background: rgba(45, 212, 191, 0.3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; display: flex; align-items: center; gap: 0.6rem; }
h3 { font-size: 1.1rem; }

/* ---------- Cabeçalho ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 24px -16px rgba(15, 23, 42, 0.4);
}
.app-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: var(--header-h);
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
.brand img { height: 46px; width: auto; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-title {
    font-weight: 800;
    font-size: 1.1rem;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}
.brand-sub { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.top-nav { display: flex; align-items: center; gap: 0.15rem; margin-left: auto; }
.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}
.nav-link i { font-size: 1.15rem; }
.nav-link:hover { color: var(--ink); background: rgba(29, 78, 216, 0.06); }
.nav-link.active { color: #fff; background: var(--gradient); box-shadow: 0 6px 16px -6px rgba(29, 78, 216, 0.5); }

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.3rem 0.4rem 0.3rem 0.3rem;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface-solid);
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-main);
    transition: var(--transition);
    margin-left: 0.5rem;
    max-width: 220px;
}
.user-chip:hover { border-color: var(--primary); box-shadow: var(--ring); }
.user-chip .user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .ph-caret-down { color: var(--text-soft); }
.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--gradient);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
    position: relative;
}
.avatar.lg { width: 56px; height: 56px; font-size: 1.3rem; }
.dot-novo {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--danger);
    border: 2px solid #fff;
}

/* Menu suspenso do usuário */
.menu-pop {
    position: fixed;
    top: calc(var(--header-h) - 6px);
    right: max(1rem, calc((100vw - 1280px) / 2 + 1rem));
    width: min(300px, calc(100vw - 2rem));
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    z-index: 300;
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}
.menu-pop.open { opacity: 1; transform: none; pointer-events: auto; }
.menu-pop-head { display: flex; gap: 0.75rem; align-items: center; padding: 0.75rem; border-bottom: 1px solid var(--border); margin-bottom: 0.35rem; }
.menu-pop-head strong { display: block; font-size: 0.95rem; }
.menu-pop-head span { font-size: 0.8rem; color: var(--text-muted); }
.menu-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    padding: 0.7rem 0.75rem;
    border: none;
    background: none;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    text-align: left;
}
.menu-item i { font-size: 1.2rem; color: var(--text-muted); }
.menu-item:hover { background: var(--surface-3); }
.menu-item.danger, .menu-item.danger i { color: var(--danger); }
.menu-item .tag-novo { margin-left: auto; }

/* Navegação inferior (celular) */
.bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 150;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(160%) blur(18px);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    border-top: 1px solid var(--border);
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -8px 30px -20px rgba(15, 23, 42, 0.5);
}
.bottom-nav-inner { display: grid; grid-template-columns: repeat(5, 1fr); height: var(--bottom-nav-h); }
.bottom-nav a, .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: none;
    background: none;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
    position: relative;
    -webkit-tap-highlight-color: transparent;
}
.bottom-nav i { font-size: 1.45rem; transition: transform 0.2s ease; }
.bottom-nav .active { color: var(--ink); }
.bottom-nav .active i { transform: translateY(-1px); }
.bottom-nav .active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 32px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: var(--gradient);
}
.bottom-nav .dot-novo { top: 10px; right: calc(50% - 18px); }

/* ---------- Página ---------- */
.page {
    flex: 1;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.page-narrow { max-width: 860px; }
.page-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.page-hero h1 {
    font-size: clamp(1.45rem, 2.6vw, 2rem);
    font-weight: 800;
    color: var(--secondary);
}
.page-hero p { color: var(--text-muted); margin-top: 0.3rem; max-width: 640px; }
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-teal);
    background: rgba(45, 212, 191, 0.15);
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

/* ---------- Cartões / painéis ---------- */
.card, .glass-panel {
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    animation: subir 0.4s ease both;
}
.card-solid { background: var(--surface-solid); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.card-head h2 { margin: 0; }
.card-head p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }
.section-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.section-title i { color: var(--ink); }

/* ---------- Botões ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.65rem 1.2rem;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.btn i { font-size: 1.15rem; }
.btn:disabled, .btn.is-loading { opacity: 0.65; pointer-events: none; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--gradient); color: #fff; box-shadow: 0 10px 22px -10px rgba(29, 78, 216, 0.65); }
.btn-primary:hover { box-shadow: 0 14px 28px -10px rgba(29, 78, 216, 0.7); transform: translateY(-1px); }
.btn-secondary { background: var(--surface-solid); color: var(--text-main); border-color: var(--border-strong); }
.btn-secondary:hover { border-color: #94a3b8; background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text-main); }
.btn-soft { background: rgba(29, 78, 216, 0.08); color: var(--ink); }
.btn-soft:hover { background: rgba(29, 78, 216, 0.14); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 10px 22px -12px rgba(239, 68, 68, 0.8); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-danger-soft { background: var(--danger-soft); color: #b91c1c; }
.btn-success { background: linear-gradient(120deg, #34d399, #059669); color: #fff; box-shadow: 0 10px 22px -12px rgba(5, 150, 105, 0.8); }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: #1fb457; }
.btn-sm { min-height: 36px; padding: 0.45rem 0.8rem; font-size: 0.85rem; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0.9rem 1.5rem; font-size: 1.02rem; }
.btn-block { width: 100%; }
.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: var(--surface-3);
    color: var(--text-muted);
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    transition: var(--transition);
}
.btn-icon i { font-size: 1.2rem; }
.btn-icon:hover { background: #e2e8f0; color: var(--text-main); }
.btn-icon.tone-blue { background: var(--info-soft); color: var(--ink); }
.btn-icon.tone-teal { background: rgba(45, 212, 191, 0.18); color: var(--ink-teal); }
.btn-icon.tone-green { background: var(--success-soft); color: #047857; }
.btn-icon.tone-amber { background: var(--warning-soft); color: #b45309; }
.btn-icon.tone-violet { background: var(--violet-soft); color: #6d28d9; }
.btn-icon.tone-red { background: var(--danger-soft); color: #b91c1c; }
.btn-icon.tone-whats { background: rgba(37, 211, 102, 0.15); color: #15803d; }
.btn-icon.tone-navy { background: rgba(30, 58, 138, 0.1); color: var(--secondary); }
.btn-icon:hover { filter: brightness(0.96); transform: translateY(-1px); }

.spinner {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 3px solid rgba(29, 78, 216, 0.15);
    border-top-color: var(--ink);
    animation: girar 0.8s linear infinite;
    display: inline-block;
}
.spinner.lg { width: 40px; height: 40px; border-width: 4px; }
.btn .spinner { width: 18px; height: 18px; border-width: 2.5px; border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
.btn-secondary .spinner, .btn-ghost .spinner, .btn-soft .spinner { border-color: rgba(29, 78, 216, 0.15); border-top-color: var(--ink); }

/* ---------- Alternador de visões (abas grandes) ---------- */
.segmented {
    display: flex;
    gap: 0.4rem;
    padding: 0.35rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    scrollbar-width: none;
    width: fit-content;
    max-width: 100%;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.1rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.92rem;
    white-space: nowrap;
    transition: var(--transition);
    flex: 1 0 auto;
    justify-content: center;
}
.segmented button i { font-size: 1.15rem; }
.segmented button:hover { color: var(--text-main); }
.segmented button.active { background: var(--gradient); color: #fff; box-shadow: 0 8px 18px -10px rgba(29, 78, 216, 0.7); }
.segmented button.tone-heart { color: #be123c; }
.segmented button.tone-heart.active { background: linear-gradient(120deg, #fb7185, #e11d48); color: #fff; }

/* Abas pequenas (sublinhadas) */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border-strong); margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
    padding: 0.7rem 1rem;
    border: none;
    background: none;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text-muted);
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.tab.active { color: var(--ink); border-bottom-color: var(--ink); }
.tab .count { background: var(--surface-3); color: var(--text-muted); border-radius: 999px; padding: 0 0.5rem; font-size: 0.75rem; }
.tab.active .count { background: var(--info-soft); color: var(--ink); }

/* ---------- Formulários ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.25rem; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 0.4rem; min-width: 0; }
.field > label, .field-label { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); }
.field-hint { font-size: 0.8rem; color: var(--text-soft); }
.field-error { font-size: 0.82rem; color: var(--danger); font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], input[type="number"], input[type="search"], select, textarea, .input {
    width: 100%;
    min-height: 46px;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 12px;
    background: var(--surface-solid);
    font-size: 1rem;
    color: var(--text-main);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
textarea { min-height: 96px; resize: vertical; }
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748b' viewBox='0 0 256 256'%3E%3Cpath d='M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.4rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: var(--ring); }
input.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15); }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ink); width: 18px; height: 18px; }

.input-icon { position: relative; }
.input-icon > i { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); color: var(--text-soft); font-size: 1.15rem; pointer-events: none; }
.input-icon > input, .input-icon > select { padding-left: 2.5rem; }
.input-icon .input-status { position: absolute; right: 0.85rem; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }

/* Opções em "pílula" (radio/checkbox) */
.pills { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 44px;
    padding: 0.55rem 0.95rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface-solid);
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:has(input:checked) { border-color: var(--ink); background: rgba(29, 78, 216, 0.07); color: var(--ink); }
.pill:has(input:focus-visible) { box-shadow: var(--ring); }
.pill i { font-size: 1.1rem; }

.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1.25rem; }

.alert {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
}
.alert i { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
.alert-danger { background: var(--danger-soft); color: #991b1b; }
.alert-heart { background: #ffe4e6; color: #9f1239; }
.alert-info { background: var(--info-soft); color: #1e40af; }
.alert-warning { background: var(--warning-soft); color: #92400e; }
.alert-success { background: var(--success-soft); color: #065f46; }

/* Barra de busca */
.search-bar { display: grid; grid-template-columns: 2fr 1fr auto; gap: 0.75rem; align-items: end; }
.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: stretch; }
.filters > * { flex: 1 1 180px; min-width: 0; }
.filters .grow { flex: 2 1 240px; }
.filters .shrink { flex: 0 0 auto; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-muted);
}
.badge i { font-size: 0.9rem; }
.badge-success { background: var(--success-soft); color: #047857; }
.badge-danger { background: var(--danger-soft); color: #b91c1c; }
.badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-info { background: var(--info-soft); color: #1d4ed8; }
.badge-violet { background: var(--violet-soft); color: #6d28d9; }
.badge-teal { background: rgba(45, 212, 191, 0.18); color: var(--ink-teal); }
.badge-solid-danger { background: var(--danger); color: #fff; }
.tag-novo { background: var(--danger); color: #fff; font-size: 0.65rem; padding: 0.1rem 0.45rem; border-radius: 999px; font-weight: 800; letter-spacing: 0.04em; }

/* ---------- Listas de pessoas ---------- */
.list { display: flex; flex-direction: column; gap: 0.6rem; }
.list-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: var(--transition);
    min-width: 0;
}
.list-item.clicavel { cursor: pointer; }
.list-item.clicavel:hover { border-color: rgba(45, 212, 191, 0.6); box-shadow: 0 10px 24px -16px rgba(29, 78, 216, 0.6); transform: translateY(-1px); }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .titulo { font-weight: 700; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; }
.list-item .meta { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.list-item .meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.list-item .acoes { display: flex; gap: 0.4rem; flex-shrink: 0; }
.num { color: var(--ink); font-weight: 800; min-width: 1.6rem; }
.copiavel { cursor: pointer; border-radius: 6px; padding: 0 0.2rem; margin: 0 -0.2rem; }
.copiavel:hover { background: var(--surface-3); color: var(--text-main); }

/* ---------- Tabelas ---------- */
.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-solid);
    -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th {
    background: var(--surface-2);
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    font-weight: 700;
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}
.table td { padding: 0.85rem 1rem; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fbfdff; }
.table .r { text-align: right; }
.table .c { text-align: center; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }

/* ---------- Estados (carregando / vazio) ---------- */
.state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0.6rem;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
}
.state i { font-size: 2.6rem; color: var(--text-soft); }
.state strong { color: var(--text-main); font-size: 1.02rem; }
.state.erro i { color: var(--danger); }
.skeleton {
    background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
    background-size: 400% 100%;
    animation: brilho 1.3s ease infinite;
    border-radius: 12px;
}
.skeleton-item { height: 68px; margin-bottom: 0.6rem; }

/* ---------- KPIs ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.kpi {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    box-shadow: var(--shadow-sm);
}
.kpi h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 700; }
.kpi .valor { font-size: 1.8rem; font-weight: 900; color: var(--text-main); line-height: 1.1; margin-top: 0.25rem; }
.kpi .icone { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; flex-shrink: 0; }
.kpi.tone-success { background: linear-gradient(180deg, #f0fdf4, #fff); border-color: #bbf7d0; }

/* Anéis de meta */
.metas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.meta-card {
    border-radius: 18px;
    padding: 1.2rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1.1rem;
    position: relative;
    overflow: hidden;
}
.meta-card.dark { background: linear-gradient(135deg, #1e293b, #0f172a); }
.meta-card.blue { background: linear-gradient(135deg, var(--fussp-dark-blue), var(--primary-dark)); }
.meta-card .ring { position: relative; width: 88px; height: 88px; flex-shrink: 0; }
.meta-card svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.meta-card .ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 1.15rem; }
.meta-card h4 { font-size: 1rem; }
.meta-card small { opacity: 0.7; font-size: 0.78rem; }
.meta-card .bg-icon { position: absolute; right: -14px; top: -14px; font-size: 6.5rem; opacity: 0.06; }

/* ---------- Portal (início) ---------- */
.hero {
    border-radius: var(--radius-lg);
    padding: 2rem;
    background: var(--gradient);
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 30px 60px -30px rgba(29, 78, 216, 0.7);
}
.hero::after {
    content: '';
    position: absolute;
    right: -60px;
    top: -60px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}
.hero::before {
    content: '';
    position: absolute;
    right: 90px;
    bottom: -90px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(250, 204, 21, 0.18);
}
.hero h1 { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 900; position: relative; z-index: 1; }
.hero p { opacity: 0.92; max-width: 560px; margin-top: 0.4rem; position: relative; z-index: 1; }
.hero .hero-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; position: relative; z-index: 1; }
.hero .chip { background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.3); padding: 0.35rem 0.75rem; border-radius: 999px; font-weight: 600; font-size: 0.85rem; display: inline-flex; gap: 0.4rem; align-items: center; color: #fff; text-decoration: none; }
.hero .chip:hover { background: rgba(255, 255, 255, 0.28); }

.modulos { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.modulo {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    animation: subir 0.45s ease both;
    text-align: left;
    width: 100%;
}
.modulo:hover { transform: translateY(-3px); box-shadow: var(--shadow); background: var(--surface-solid); }
.modulo .icone {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    color: #fff;
    background: var(--gradient);
    box-shadow: 0 10px 20px -10px rgba(29, 78, 216, 0.7);
}
.modulo .txt { display: flex; flex-direction: column; }
.modulo .t { font-size: 1.02rem; font-weight: 800; }
.modulo .d { font-size: 0.88rem; color: var(--text-muted); margin-top: 0.2rem; }
.modulo .icone.tone-pink { background: linear-gradient(135deg, #fb7185, #e11d48); box-shadow: 0 10px 20px -10px rgba(225, 29, 72, 0.7); }
.modulo .icone.tone-amber { background: linear-gradient(135deg, #fcd34d, #f59e0b); box-shadow: 0 10px 20px -10px rgba(245, 158, 11, 0.7); }
.modulo .icone.tone-navy { background: linear-gradient(135deg, #3b49b8, var(--fussp-dark-blue)); }
.modulo .icone.tone-teal { background: linear-gradient(135deg, #5eead4, #0d9488); }
.modulo .icone.tone-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }

/* Calendário de aniversariantes */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; font-weight: 700; font-size: 0.75rem; color: var(--text-soft); margin-bottom: 6px; text-transform: uppercase; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dia {
    min-height: 64px;
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    background: var(--surface-solid);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.cal-dia.vazio { background: transparent; border-style: dashed; opacity: 0.5; }
.cal-dia.hoje { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.cal-dia .n { font-size: 0.72rem; font-weight: 700; color: var(--text-soft); text-align: right; }
.cal-dia.tem { background: #fff1f2; border-color: #fda4af; }
.cal-dia .pessoa { font-size: 0.66rem; line-height: 1.15; font-weight: 600; color: #be123c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: none; background: none; text-align: left; padding: 0; }
.aniv-lista { display: none; }

/* ---------- Modais ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
    background: var(--surface-solid);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: calc(100dvh - 2rem);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2);
    overflow: hidden;
}
.modal-overlay.active .modal { transform: none; }
.modal.sm { max-width: 420px; }
.modal.lg { max-width: 860px; }
.modal.xl { max-width: 1280px; }
.modal-header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal-header .grow { flex: 1; min-width: 0; }
.modal-header h3 { font-size: 1.15rem; font-weight: 800; }
.modal-header p { color: var(--text-muted); font-size: 0.88rem; margin-top: 0.15rem; overflow-wrap: anywhere; }
.modal-close { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--surface-3); color: var(--text-muted); display: grid; place-items: center; flex-shrink: 0; transition: var(--transition); }
.modal-close:hover { background: var(--danger-soft); color: var(--danger); }
.modal-close i { font-size: 1.15rem; }
.modal-body { padding: 1.25rem; overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; flex-shrink: 0; background: var(--surface-2); }
.modal-footer .btn { flex: 0 1 auto; }
.modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
    background: var(--info-soft);
    color: var(--ink);
}
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal-icon.success { background: var(--success-soft); color: var(--success); }
.modal-icon.whats { background: rgba(37, 211, 102, 0.15); color: #15803d; }
.modal-center { text-align: center; }
.modal-center p { color: var(--text-muted); }
.opcoes { display: flex; flex-direction: column; gap: 0.6rem; }
.opcao {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 0.95rem 1rem;
    border: 1.5px solid var(--border-strong);
    border-radius: 14px;
    background: var(--surface-solid);
    transition: var(--transition);
}
.opcao:hover { border-color: var(--primary); box-shadow: var(--ring); }
.opcao i { font-size: 1.5rem; flex-shrink: 0; }
.opcao strong { display: block; font-size: 0.98rem; }
.opcao small { color: var(--text-muted); font-size: 0.83rem; }

/* Dossiê do aluno */
.perfil-topo { display: flex; gap: 1rem; align-items: center; }
.perfil-contatos { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.25rem; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.mini-stat { background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px; padding: 0.9rem; text-align: center; }
.mini-stat i { font-size: 1.6rem; }
.mini-stat .rotulo { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; margin-top: 0.2rem; }
.mini-stat .valor { font-size: 1.45rem; font-weight: 900; }
.mini-stat .sub { font-size: 0.75rem; color: var(--text-muted); }

/* Tabela de presença */
.presenca-wrap { max-height: 60dvh; overflow: auto; border: 1px solid var(--border-strong); border-radius: 14px; }
.presenca { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 0.9rem; }
.presenca th { position: sticky; top: 0; z-index: 3; background: var(--surface-2); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 0.6rem 0.4rem; border-bottom: 1px solid var(--border-strong); text-align: center; white-space: nowrap; }
.presenca th:first-child, .presenca td:first-child { position: sticky; left: 0; z-index: 2; text-align: left; background: var(--surface-solid); min-width: 170px; max-width: 220px; box-shadow: 1px 0 0 var(--border-strong); }
.presenca th:first-child { z-index: 4; background: var(--surface-2); padding-left: 0.9rem; }
.presenca td { border-bottom: 1px solid #f1f5f9; padding: 0; text-align: center; }
.presenca td:first-child { padding: 0.55rem 0.9rem; }
.presenca .aluno-nome { font-weight: 700; color: var(--ink); font-size: 0.85rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.presenca .aluno-cpf { font-size: 0.72rem; color: var(--text-soft); }
.presenca tr.evasao td:first-child, .presenca tr.evasao td.faltas { background: #fff1f2; }
.presenca tr.evasao .aluno-nome { color: var(--danger); }
.marca {
    width: 100%;
    min-width: 46px;
    height: 48px;
    border: none;
    background: transparent;
    font-weight: 900;
    font-size: 0.95rem;
    color: #cbd5e1;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.marca.P { background: var(--success-soft); color: #047857; }
.marca.F { background: var(--danger-soft); color: #b91c1c; }
.marca:active { filter: brightness(0.95); }
.presenca td.faltas { font-weight: 800; color: var(--ink); min-width: 64px; }
.presenca tr.evasao td.faltas { color: var(--danger); }
.legenda { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.82rem; color: var(--text-muted); }
.legenda span { display: inline-flex; gap: 0.35rem; align-items: center; }
.legenda .q { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- Toast ---------- */
.toast-area {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: min(440px, calc(100vw - 2rem));
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 1rem;
    border-radius: 14px;
    background: #0f172a;
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: var(--shadow-lg);
    pointer-events: none; /* não bloqueia toques no que está atrás */
    animation: toastIn 0.3s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
}
.toast i { font-size: 1.3rem; flex-shrink: 0; }
.toast.sucesso i { color: #34d399; }
.toast.erro { background: #7f1d1d; }
.toast.erro i { color: #fca5a5; }
.toast.info i { color: var(--primary); }
.toast .toast-acao { pointer-events: auto; margin-left: auto; background: rgba(255, 255, 255, 0.15); color: #fff; border: none; padding: 0.35rem 0.7rem; border-radius: 8px; font-weight: 700; font-size: 0.85rem; white-space: nowrap; }
.toast.saindo { animation: toastOut 0.25s ease forwards; }

/* ---------- Rodapé ---------- */
.app-footer { padding: 2rem 1.25rem 2.25rem; margin-top: auto; }
.app-footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.easter { display: flex; align-items: center; gap: 1rem; }
.easter-texto { text-align: right; }
.easter-texto strong { display: block; font-style: italic; color: var(--text-muted); font-size: 1.05rem; }
.easter-texto small { color: var(--danger); font-weight: 700; font-size: 0.78rem; opacity: 0; transition: opacity 0.3s ease; }
.easter-texto small.visivel { opacity: 1; }
.easter img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; cursor: pointer; box-shadow: 0 8px 18px -8px rgba(15, 23, 42, 0.5); border: 3px solid #fff; -webkit-tap-highlight-color: transparent; }
.logos-footer { display: flex; justify-content: center; align-items: center; gap: 2rem; flex-wrap: wrap; }
.logos-footer img { height: 54px; width: auto; object-fit: contain; transition: transform 0.2s ease; }
.logos-footer img:hover { transform: scale(1.05); }
.creditos { color: var(--text-soft); font-size: 0.85rem; font-weight: 500; text-align: center; }
.creditos a { color: inherit; }

/* ---------- Novidades ---------- */
.release { position: relative; padding-left: 1.5rem; border-left: 2px solid var(--border-strong); }
.release + .release { margin-top: 2rem; }
.release::before { content: ''; position: absolute; left: -8px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: var(--gradient); box-shadow: 0 0 0 4px #fff; }
.release h2 { font-size: 1.3rem; }
.release .data { color: var(--text-muted); font-size: 0.85rem; font-weight: 600; }
.release h3 { font-size: 0.95rem; margin: 1.1rem 0 0.5rem; display: flex; gap: 0.4rem; align-items: center; }
.release ul { list-style: none; display: flex; flex-direction: column; gap: 0.45rem; }
.release li { position: relative; padding-left: 1.2rem; color: var(--text-main); font-size: 0.93rem; }
.release li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

/* ---------- Login ---------- */
.login-page {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.5rem 1rem calc(1.5rem + var(--safe-bottom));
    background-image: linear-gradient(135deg, rgba(47, 54, 143, 0.92) 0%, rgba(27, 149, 198, 0.82) 100%), url('../img/login-bg.jpg');
    background-size: cover;
    background-position: center;
}
.login-page::before { display: none; }
.login-card {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 26px;
    padding: 2.25rem 2rem;
    box-shadow: 0 40px 80px -30px rgba(2, 6, 23, 0.6);
    animation: subir 0.5s ease both;
}
.login-card .logo { height: 96px; margin: 0 auto 1.25rem; }
.login-card h1 { text-align: center; font-size: 1.45rem; font-weight: 900; color: var(--secondary); }
.login-card .sub { text-align: center; color: var(--text-muted); font-size: 0.92rem; margin: 0.3rem 0 1.5rem; }
.senha-wrap { position: relative; }
.senha-wrap input { padding-right: 3rem; }
.senha-wrap button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: none; background: none; width: 40px; height: 40px; color: var(--text-soft); display: grid; place-items: center; }
.senha-wrap button i { font-size: 1.25rem; }
.check-linha { display: flex; align-items: center; gap: 0.55rem; font-size: 0.92rem; color: var(--text-muted); cursor: pointer; user-select: none; }

/* ---------- Choices.js (select pesquisável) ---------- */
.choices { margin-bottom: 0; font-size: 1rem; }
.choices__inner {
    background: var(--surface-solid) !important;
    border: 1.5px solid var(--border-strong) !important;
    border-radius: 12px !important;
    min-height: 46px;
    padding: 0.4rem 0.75rem !important;
    display: flex;
    align-items: center;
}
.choices.is-focused .choices__inner, .choices.is-open .choices__inner { border-color: var(--primary) !important; box-shadow: var(--ring); }
.choices[data-type*="select-one"]::after { right: 14px; }
.choices__list--dropdown, .choices__list[aria-expanded] {
    border: 1px solid var(--border-strong) !important;
    border-radius: 12px !important;
    box-shadow: var(--shadow-lg) !important;
    z-index: 60 !important;
    word-break: break-word;
    margin-top: 6px !important;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted { background-color: rgba(45, 212, 191, 0.12) !important; color: var(--text-main) !important; }
.choices__input { background-color: var(--surface-3) !important; border-radius: 8px !important; padding: 0.55rem !important; margin-bottom: 0.4rem !important; font-size: 1rem !important; }
.choices__list--multiple .choices__item { background: var(--gradient) !important; border: none !important; border-radius: 999px !important; font-weight: 600; }
.choices__heading { font-weight: 800 !important; color: var(--ink) !important; font-size: 0.75rem !important; text-transform: uppercase; letter-spacing: 0.05em; }

/* ---------- Animações ---------- */
@keyframes subir { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes brilho { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes socoBalanco {
    0% { transform: scale(1); }
    10% { transform: scale(1.12) translate(-10px, 10px) rotate(-10deg); filter: brightness(1.2); }
    30% { transform: scale(1.06) translate(10px, -10px) rotate(10deg); filter: brightness(0.85); }
    50% { transform: scale(1.03) translate(-6px, 6px) rotate(-5deg); }
    70% { transform: scale(1.01) translate(6px, -6px) rotate(4deg); }
    100% { transform: none; filter: none; }
}
.soco { animation: socoBalanco 0.4s cubic-bezier(.36,.07,.19,.97) both; }
.ph-spin { animation: girar 1s linear infinite; }

/* ---------- Utilitários ---------- */
.muted { color: var(--text-muted); }
.soft { color: var(--text-soft); }
.small { font-size: 0.85rem; }
.bold { font-weight: 700; }
.row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; }
.w-100 { width: 100%; }
.only-mobile { display: none !important; }
.only-mobile-flex { display: none !important; }
.texto-quebra { overflow-wrap: anywhere; }

/* =====================================================================
   RESPONSIVO
   ===================================================================== */
@media (max-width: 1240px) {
    .top-nav .nav-link span { display: none; }
    .top-nav .nav-link { padding: 0.6rem; }
}

@media (max-width: 860px) {
    :root { --header-h: 60px; }
    html { font-size: 15px; }
    .top-nav { display: none; }
    .bottom-nav { display: block; }
    body { padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom)); }
    .user-chip { margin-left: auto; padding: 0.2rem; border: none; background: none; }
    .user-chip .user-name, .user-chip .ph-caret-down { display: none; }
    .brand img { height: 38px; }
    .page { padding: 1.1rem 1rem 1.75rem; gap: 1.1rem; }
    .card, .glass-panel { padding: 1.1rem; border-radius: 18px; }
    .form-grid { grid-template-columns: 1fr; }
    .search-bar { grid-template-columns: 1fr; }
    .metas { grid-template-columns: 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
    .hero { padding: 1.5rem 1.25rem; }
    .only-mobile { display: initial !important; }
    .only-mobile-flex { display: flex !important; }
    .menu-pop.from-bottom { top: auto; bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 8px); right: 0.75rem; }
    .hide-mobile { display: none !important; }
    .toast-area { bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 0.75rem); }
    .menu-pop { right: 0.75rem; }
    .segmented { width: 100%; overflow: visible; }
    .segmented button { flex: 1 1 0; min-width: 0; flex-direction: column; gap: 0.2rem; padding: 0.55rem 0.3rem; font-size: 0.78rem; white-space: normal; line-height: 1.15; text-align: center; }
    .segmented button i { font-size: 1.3rem; }
    .modal .kpi-grid { gap: 0.5rem; }
    .modal .kpi { padding: 0.7rem 0.6rem; }
    .modal .kpi h4 { font-size: 0.62rem; letter-spacing: 0.02em; overflow-wrap: anywhere; }
    .modal .kpi .valor { font-size: 1.4rem; }

    /* Modais viram "folhas" que sobem de baixo */
    .modal-overlay { align-items: flex-end; padding: 0; }
    .modal, .modal.sm, .modal.lg, .modal.xl {
        max-width: 100%;
        max-height: 92dvh;
        border-radius: 22px 22px 0 0;
        transform: translateY(100%);
        padding-bottom: var(--safe-bottom);
    }
    .modal::before { content: ''; display: block; width: 42px; height: 5px; border-radius: 99px; background: #cbd5e1; margin: 8px auto 0; flex-shrink: 0; }
    .modal-overlay.active .modal { transform: none; }
    .modal-footer .btn { flex: 1 1 0; }

    .mini-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
    .mini-stat { padding: 0.7rem 0.4rem; }
    .mini-stat .valor { font-size: 1.2rem; }
    .mini-stat .sub { display: none; }

    .list-item { flex-wrap: wrap; padding: 0.85rem; }
    .list-item .acoes { width: 100%; justify-content: flex-end; border-top: 1px dashed var(--border-strong); padding-top: 0.6rem; margin-top: 0.1rem; }

    /* Tabelas que viram cartões no celular */
    .table-cards thead { display: none; }
    .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
    .table-cards tr { border-bottom: 1px solid var(--border-strong); padding: 0.75rem 0.9rem; }
    .table-cards tbody tr:last-child { border-bottom: none; }
    .table-cards td { border: none; padding: 0.2rem 0; text-align: left !important; }
    .table-cards td[data-label]::before { content: attr(data-label); display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-soft); font-weight: 700; }
    .table-cards td.td-acoes { padding-top: 0.6rem; }

    .cal-dia { min-height: 42px; }
    .cal-dia .pessoa { display: none; }
    .cal-dia.tem::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #e11d48; margin: auto auto 4px; }
    .aniv-lista { display: flex; }

    .logos-footer { gap: 1.25rem; }
    .logos-footer img { height: 40px; }
    .easter img { width: 68px; height: 68px; }
    .easter-texto strong { font-size: 0.95rem; }

    /* Evita o zoom automático do iPhone ao tocar em campos */
    input, select, textarea, .choices__input { font-size: 16px !important; }
}

@media (max-width: 420px) {
    .brand-sub { display: none; }
    .kpi .valor { font-size: 1.5rem; }
    .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .kpi { flex-direction: column-reverse; align-items: flex-start; padding: 0.9rem; }
    .kpi .icone { width: 38px; height: 38px; font-size: 1.2rem; }
    .modulos { grid-template-columns: 1fr; }
    .login-card { padding: 1.75rem 1.25rem; }
}

@media (hover: none) {
    .list-item.clicavel:hover, .modulo:hover, .btn-primary:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

@media print {
    .app-header, .bottom-nav, .app-footer, .toast-area { display: none !important; }
    body::before { display: none; }
    body { padding: 0; background: #fff; }
    .card, .glass-panel { box-shadow: none; border: 1px solid #ddd; backdrop-filter: none; }
}

/* Choices múltiplo: campo de busca sem "caixa dentro da caixa" */
.choices[data-type*="select-multiple"] .choices__input { background: transparent !important; margin-bottom: 0 !important; padding: 0.35rem 0.25rem !important; min-width: 9ch; }
.choices[data-type*="select-multiple"] .choices__inner { flex-wrap: wrap; gap: 0.25rem; }

/* Selo que aparece só nos testes em localhost */
.selo-teste {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 6000;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.75rem;
    border-radius: 0 0 10px 10px;
    background: var(--warning);
    color: #3b2604;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    white-space: nowrap;
    max-width: calc(100vw - 1rem);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    box-shadow: 0 4px 12px -6px rgba(0, 0, 0, 0.4);
}

/* Login: painel do modo demonstração */
.painel-demo { background: var(--warning-soft); border: 1px solid #fcd34d; border-radius: 16px; padding: 0.9rem; }
.painel-demo strong { color: #92400e; }
.demo-perfis { display: grid; gap: 0.45rem; margin-top: 0.7rem; }
.demo-perfis .opcao { padding: 0.55rem 0.7rem; background: #fff; }
.demo-perfis .opcao small { display: block; }

/* =====================================================================
   SALA DE AULA (2.1): Área do Professor, diário e relatos
   ===================================================================== */
.segmented .count { background: rgba(255, 255, 255, 0.25); border-radius: 999px; padding: 0 0.45rem; font-size: 0.72rem; min-width: 1.3rem; text-align: center; }
.segmented button:not(.active) .count { background: var(--warning-soft); color: #b45309; }
.segmented.compacto { padding: 0.25rem; border-radius: 12px; }
.segmented.compacto button { padding: 0.45rem 0.8rem; font-size: 0.85rem; border-radius: 9px; }

/* Cartões das turmas do professor */
.turmas-prof { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.turma-prof {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.2rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    animation: subir 0.4s ease both;
    position: relative;
    overflow: hidden;
}
.turma-prof::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--gradient); }
.turma-prof.encerrada { opacity: 0.85; }
.turma-prof.encerrada::before { background: var(--border-strong); }
.turma-prof-topo { display: flex; gap: 0.8rem; align-items: center; }
.turma-prof-topo .grow { min-width: 0; }
.turma-prof h3 { font-size: 1.1rem; color: var(--secondary); }
.turma-prof-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.turma-prof-acoes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; margin-top: auto; }
.turma-prof-acoes .btn { padding-left: 0.4rem; padding-right: 0.4rem; justify-content: center; }
details.anteriores > summary { cursor: pointer; list-style: none; margin-bottom: 1rem; }
details.anteriores > summary::-webkit-details-marker { display: none; }

/* Barra de progresso fina */
.barra { display: block; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.barra > span { display: block; height: 100%; background: var(--gradient); border-radius: inherit; transition: width 0.6s ease; }

/* Diário: uma "sanfona" por aula */
.diario-topo { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
#diario-resumo { flex: 1; min-width: 200px; }
#diario-resumo .barra { margin-top: 0.35rem; }
.aulas { display: flex; flex-direction: column; gap: 0.5rem; }
details.aula { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-solid); transition: var(--transition); }
details.aula[open] { border-color: rgba(45, 212, 191, 0.7); box-shadow: 0 10px 24px -18px rgba(29, 78, 216, 0.7); }
details.aula.hoje { border-left: 4px solid var(--primary); }
details.aula > summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.75rem 0.9rem; cursor: pointer; list-style: none; min-height: 52px; }
details.aula > summary::-webkit-details-marker { display: none; }
details.aula > summary .grow { flex: 1; min-width: 0; }
details.aula .seta { color: var(--text-soft); transition: transform 0.2s ease; }
details.aula[open] .seta { transform: rotate(180deg); }
.aula-resumo { display: block; font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.aula[open] .aula-resumo { display: none; }
.aula-form { padding: 0 0.9rem 0.9rem; }
.aula-form textarea, .relatos textarea { resize: vertical; }

/* Relatos */
.relatos { display: flex; flex-direction: column; gap: 0.75rem; }
.relato { border: 1px solid var(--border-strong); border-left: 4px solid var(--warning); border-radius: var(--radius); padding: 0.9rem 1rem; background: var(--surface-solid); display: flex; flex-direction: column; gap: 0.5rem; }
.relato.resolvido { border-left-color: var(--success); }
.relato-topo { display: flex; gap: 0.7rem; align-items: flex-start; }
.relato-topo .grow { flex: 1; min-width: 0; }
.relato-icone { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--warning-soft); color: #b45309; font-size: 1.2rem; flex-shrink: 0; }
.relato.resolvido .relato-icone { background: var(--success-soft); color: #047857; }
.relato-texto { white-space: pre-wrap; overflow-wrap: anywhere; }
.relato-resposta { display: flex; gap: 0.5rem; background: var(--surface-2); border-radius: var(--radius-sm); padding: 0.6rem 0.75rem; font-size: 0.9rem; }
.relato-resposta > i { color: var(--ink-teal); margin-top: 0.2rem; }
.relato-resposta p { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 0.15rem; }
.relato-acoes { display: flex; justify-content: flex-end; }

/* Acompanhamento no dossiê da turma */
.acomp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.acomp-bloco { border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0.9rem; background: var(--surface-2); }
.acomp-bloco .section-title { margin-bottom: 0.5rem; }

@media (max-width: 860px) {
    .turmas-prof { grid-template-columns: 1fr; }
    .acomp-grid { grid-template-columns: 1fr; }
    .segmented.compacto button { flex-direction: row; font-size: 0.8rem; }
    details.aula > summary .badge { font-size: 0.68rem; padding: 0.1rem 0.45rem; }
}

/* Login: link de volta para o site público */
.voltar-site { display: flex; justify-content: center; align-items: center; gap: 0.4rem; margin-top: 1.25rem; font-weight: 600; font-size: 0.9rem; text-decoration: none; color: var(--text-muted); }
.voltar-site:hover { color: var(--ink); }

/* =====================================================================
   ENVIAR PARA A FUSSP (fussp.html)
   ===================================================================== */
.kpi.tone-teal { background: linear-gradient(180deg, rgba(45, 212, 191, 0.12), #fff); border-color: rgba(45, 212, 191, 0.45); }
.kpi.tone-info { background: linear-gradient(180deg, #eff6ff, #fff); border-color: #bfdbfe; }
.kpi.tone-danger { background: linear-gradient(180deg, #fef2f2, #fff); border-color: #fecaca; }
.kpi.tone-warning { background: linear-gradient(180deg, #fffbeb, #fff); border-color: #fde68a; }
.pessoa-fussp.verificar { border-left: 3px solid var(--warning); }
.pessoa-fussp.pendente { border-left: 3px solid var(--violet); }
.totais-fussp { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem; }
.totais-fussp .kpi { padding: 0.8rem 0.9rem; }
.totais-fussp .valor { font-size: 1.5rem; }

.lista-check .list-item { cursor: pointer; }
.lista-check input[type="checkbox"] { width: 22px; height: 22px; flex-shrink: 0; accent-color: var(--primary-dark); cursor: pointer; }
.lista-check .list-item:has(input:checked) { border-color: rgba(29, 78, 216, 0.55); background: rgba(29, 78, 216, 0.04); }

details.turma-fussp { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-solid); }
details.turma-fussp > summary { display: flex; align-items: center; gap: 0.6rem; padding: 0.8rem 0.9rem; cursor: pointer; list-style: none; min-height: 56px; }
details.turma-fussp > summary::-webkit-details-marker { display: none; }
details.turma-fussp > summary .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
details.turma-fussp .contagens { display: flex; flex-wrap: wrap; gap: 0.25rem; flex-shrink: 0; justify-content: flex-end; }
details.turma-fussp .seta { color: var(--text-soft); transition: transform 0.2s ease; }
details.turma-fussp[open] .seta { transform: rotate(180deg); }
.pessoa-fussp { align-items: flex-start; }
.pessoa-fussp.manual { border-left: 3px solid var(--info); }
.pessoa-fussp.erro { border-left: 3px solid var(--danger); }
.pessoa-fussp.ja_enviado { opacity: 0.75; }
.texto-aviso { color: #b45309; }
.texto-erro { color: #b91c1c; }

.lote-atual { border: 1.5px solid rgba(16, 185, 129, 0.45); }
.passos-fussp { margin: 1rem 0 0 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; color: var(--text-muted); }
.chips-status { display: flex; gap: 0.45rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.2rem; }
.chips-status::-webkit-scrollbar { display: none; }
.chip-status { flex-shrink: 0; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.8rem; min-height: 40px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: #fff; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); cursor: pointer; }
.chip-status .count { background: var(--surface-3); border-radius: 999px; padding: 0 0.45rem; font-size: 0.75rem; }
.chip-status.ativo { border-color: var(--ink); color: var(--ink); background: rgba(29, 78, 216, 0.07); }

@media (max-width: 860px) {
    details.turma-fussp > summary { flex-wrap: wrap; }
    details.turma-fussp .contagens { order: 3; width: 100%; }
    .pessoa-fussp { flex-wrap: wrap; }
}
