/* ============================================================
   APPrendiz Online — Design System (padrão Google / Material)
   Sério, profissional, confiável e otimizado.
   ============================================================ */

:root {
/* Cores — paleta sóbria e profissional */
--primary: #1034a6;
    --primary-dark: #185abc;
    --primary-soft: #e8f0fe;       /* fundo de itens ativos */
    --bg: #f0f4f8;                 /* fundo geral — azul claro (padrão Google/KPI) */
    --surface: #ffffff;
    --border: #dadce0;
    --border-strong: #c4c7c5;
    --text: #202124;               /* texto principal */
    --muted: #5f6368;              /* texto secundário */
    --success: #1e8e3e;
    --success-soft: #e6f4ea;
    --danger: #d93025;
    --danger-soft: #fce8e6;
    --warning: #f9ab00;
    --warning-soft: #fef7e0;
    --info-soft: #e8f0fe;
    --indigo: #3949ab;          /* Material Indigo 600 — destaque Aprendizes */
    --btn-text: #000000;

    /* Tipografia */
    --font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    --font-size: 14px;

    /* Formas e sombras (Material — elevação sutil) */
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;             /* cards de dashboard/gráficos */
    --shadow-sm: 0 1px 2px rgba(60, 64, 67, 0.08), 0 1px 3px rgba(60, 64, 67, 0.1);
    --shadow-md: 0 1px 3px rgba(60, 64, 67, 0.15), 0 4px 8px rgba(60, 64, 67, 0.12);

    /* Layout */
    --topbar-h: 64px;
    --content-max: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--font);
    font-size: var(--font-size);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

/* ============================================================
   Topbar
   ============================================================ */
.topbar {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand .logo {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--primary);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700;
}
.brand small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); line-height: 1.2; }

/* ===== USER DROPDOWN (topbar) ===== */
.topbar .user {
    display: flex; align-items: center; gap: 12px;
    font-size: 13px; color: var(--muted);
    position: relative;
}

.topbar .user-info {
    display: flex; flex-direction: column; line-height: 1.3;
}
.topbar .user-info strong { color: var(--text); font-weight: 500; font-size: 13px; }
.topbar .user-info span { font-size: 12px; color: var(--muted); }

.avatar-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--primary-soft); color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 16px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
    flex-shrink: 0;
}
.avatar-btn:hover,
.avatar-btn:focus {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
    outline: none;
}
.avatar-btn[aria-expanded="true"] {
    background: var(--primary); color: #fff; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.avatar-btn--logout {
    text-decoration: none;
    color: var(--muted);
    background: transparent;
    border-color: transparent;
    border-radius: 8px;
}
.avatar-btn--logout:hover,
.avatar-btn--logout:focus {
    background: var(--danger-soft, #fce8e6);
    color: var(--danger, #d93025);
    border-color: transparent;
    box-shadow: none;
}

.user-menu {
    position: absolute; top: calc(100% + 8px); right: 0;
    min-width: 180px; max-width: 240px;
    background: var(--bg-elevated, #fff); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg, 0 8px 24px rgba(0,0,0,.12));
    padding: 6px 0; opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    z-index: 100;
}
.user-menu[aria-hidden="false"] {
    opacity: 1; visibility: visible; transform: translateY(0);
}

.user-menu-item {
    display: block; padding: 10px 14px;
    font-size: 13px; color: var(--text); text-decoration: none;
    transition: background .1s ease;
}
.user-menu-item:hover { background: var(--bg); color: var(--text); }
.user-menu-item--danger { color: var(--danger, #d93025); }
.user-menu-item--danger:hover { background: var(--danger-soft, #fce8e6); }

@media (max-width: 640px) {
    .topbar .user { gap: 8px; }
    .user-menu { right: -8px; min-width: 180px; }
}

/* ============================================================
   Navegação do portal (abaixo da topbar) — fundo azul, itens brancos
   ============================================================ */
.nav {
    background: var(--primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    display: flex;
    gap: 4px;
    padding: 0 24px;
    overflow-x: auto;
    overflow-y: visible;
    justify-content: center;
    position: -webkit-sticky;
    position: sticky;
    top: var(--topbar-h); /* gruda logo abaixo da topbar sticky */
    z-index: 90;
}
.nav a {
    text-decoration: none; color: rgba(255, 255, 255, 0.85);
    font-size: 14px; font-weight: 500;
    padding: 13px 16px; border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, background 0.15s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.nav a.active { color: #fff; border-bottom-color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.08); }

/* Dropdown Cadastros */
.nav-dropdown { position: relative; display: flex; flex-direction: column; }
.nav-dropdown__toggle { display: flex; align-items: center; justify-content: space-between; gap: 4px; cursor: pointer; padding: 10px 14px; font-size: 14px; color: rgba(255,255,255,.75); border-bottom: 1px solid rgba(255,255,255,.08); transition: all .15s; }
.nav-dropdown__toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
.nav-dropdown__toggle.active { color: #fff; font-weight: 600; background: rgba(255, 255, 255, 0.08); }
.nav-dropdown__toggle svg { transition: transform .2s; flex-shrink: 0; }
.nav-dropdown.is-open .nav-dropdown__toggle svg { transform: rotate(180deg); }
.nav-dropdown__menu {
    display: none; flex-direction: column; padding: 4px 0;
}
.nav-dropdown.is-open .nav-dropdown__menu { display: flex; }
.nav-dropdown:hover .nav-dropdown__menu,
.nav-dropdown:focus-within .nav-dropdown__menu { display: flex; }
.nav-dropdown__menu a {
    color: rgba(255,255,255,.7); padding: 8px 14px 8px 28px; font-size: 13px;
    border-bottom: none !important; font-weight: 400; background: transparent;
    transition: all .15s;
}
.nav-dropdown__menu a:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.nav-dropdown__menu a.active { background: rgba(255, 255, 255, 0.15); color: #fff; font-weight: 600; }

/* ============================================================
   Layout de conteúdo
   ============================================================ */
.container { max-width: var(--content-max); margin: 0 auto; padding: 28px 24px 48px; }

h1 { font-size: 22px; font-weight: 600; color: var(--text); margin-bottom: 6px; letter-spacing: -0.2px; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
h3 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--text); }

.subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; }

.page-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; margin-bottom: 24px;
}
.page-head__actions {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ============================================================
   Botões — Design System v2
   ============================================================ */

/* ── Base ── */
.btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 18px !important;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    border: 1px solid transparent;
    text-decoration: none;
    line-height: 1.2;
    transition: background 0.15s, box-shadow 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
    white-space: nowrap;
    position: relative;
    user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.btn:disabled, .btn[disabled] {
    opacity: 0.5; cursor: not-allowed; pointer-events: none;
}
.btn .icon { flex-shrink: 0; }

/* ── Primary (ação principal) ── */
.btn-primary {     background: #2593e6 !important; color: #fff !important; box-shadow: var(--shadow-sm); }
.btn-primary:hover {     background: #2086d2 !important; color: #fff !important; box-shadow: var(--shadow-md); }

/* ── Secondary (cancelar/voltar) ── */
.btn-secondary { background: #2593e6 !important; color: #fff !important; border-color: #2593e6; }
.btn-secondary:hover { background: #2086d2 !important; color: #fff !important; border-color: #2086d2; }

/* ── Criação (sempre destacada à direita nas barras de ações) ── */
.btn-create, .btn-primary.btn-create { background: #198754; color: #fff; border-color: #198754; }
.btn-create:hover, .btn-primary.btn-create:hover { background: #157347; color: #fff; border-color: #146c43; }

/* ── Outline (alternativas) ── */
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

/* ── Ghost (discreto) ── */
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); }

/* ── Success (aprovar/ativar) ── */
.btn-success { background: var(--success); color: #fff; box-shadow: var(--shadow-sm); }
.btn-success:hover { background: #177a34; box-shadow: var(--shadow-md); }

/* ── Danger (excluir/destrutivo) ── */
.btn-danger { background: var(--danger); color: #fff; box-shadow: var(--shadow-sm); }
.btn-danger:hover { background: #c22a20; box-shadow: var(--shadow-md); }

/* ── Warning (atenção) ── */
.btn-warning { background: var(--warning); color: #202124; box-shadow: var(--shadow-sm); }
.btn-warning:hover { background: #e09b00; box-shadow: var(--shadow-md); }

/* ── Ghost variants ── */
.btn-danger-ghost { background: none; color: var(--danger); border: none; font-size: 13px; cursor: pointer; padding: 4px; }
.btn-danger-ghost:hover { text-decoration: underline; }
.btn-success-ghost { background: none; color: var(--success); border: none; font-size: 13px; cursor: pointer; padding: 4px; }
.btn-success-ghost:hover { text-decoration: underline; }

/* ── Link ── */
.btn-link { color: var(--primary); font-size: 13px; text-decoration: none; margin-right: 12px; background: none; border: none; }
.btn-link:hover { text-decoration: underline; }

/* ── Tamanhos ── */
.btn-xs { padding: 4px 10px; font-size: 12px; gap: 4px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-md { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 12px 24px; font-size: 15px; gap: 10px; }
.btn-xl { padding: 14px 32px; font-size: 16px; gap: 12px; }

/* ── Icon Button (só ícone) ── */
.btn-icon {
    padding: 8px; width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon.btn-xs { width: 28px; height: 28px; padding: 4px; }
.btn-icon.btn-sm { width: 32px; height: 32px; padding: 6px; }
.btn-icon.btn-lg { width: 44px; height: 44px; padding: 10px; }
.btn-icon.btn-xl { width: 52px; height: 52px; padding: 12px; }

/* ── Loading ── */
.btn--loading { color: transparent !important; pointer-events: none; position: relative; }
.btn--loading::after {
    content: '';
    position: absolute;
    width: 16px; height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}
.btn-primary.btn--loading::after,
.btn-secondary.btn--loading::after,
.btn-create.btn--loading::after { border-color: rgba(0,0,0,.3); border-right-color: transparent; }
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ── Button Group ── */
.btn-group {
    display: inline-flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.btn-group .btn {
    border-radius: 0;
    border-right-width: 0;
    box-shadow: none;
}
.btn-group .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-group .btn:last-child { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-right-width: 1px; }
.btn-group .btn:only-child { border-radius: var(--radius-sm); border-right-width: 1px; }
.btn-group .btn:hover { z-index: 1; }

/* ── Split Button ── */
.btn-split {
    display: inline-flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.btn-split .btn { border-radius: 0; box-shadow: none; }
.btn-split .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.btn-split__toggle {
    padding: 0 8px;
    border-left: 1px solid rgba(255,255,255,.2);
    background: inherit; color: inherit; border: none;
    border-left: 1px solid rgba(255,255,255,.2);
    cursor: pointer; display: flex; align-items: center;
}
.btn-split__toggle .icon { width: 14px; height: 14px; }

/* ── Soft variants (fundo claro) ── */
.btn-soft-primary { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn-soft-primary:hover { background: #d2e3fc; }
.btn-soft-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.btn-soft-success:hover { background: #ceead6; }
.btn-soft-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-soft-danger:hover { background: #f9d0cd; }
.btn-soft-warning { background: var(--warning-soft); color: #b7791f; border-color: transparent; }
.btn-soft-warning:hover { background: #fef0c3; }
.btn-soft-gray { background: var(--bg); color: var(--muted); border-color: transparent; }
.btn-soft-gray:hover { background: var(--border); }

/* ── Pill (arredondado total) ── */
.btn-pill { border-radius: 999px; }

/* ── Legacy: mantido para compatibilidade ── */
.btn-gear {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 0; width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn-gear:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

.btn-opcoes {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 6px 12px; background: var(--primary); color: #fff;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    cursor: pointer; font-weight: 500; font-size: 13px;
    font-family: var(--font); text-decoration: none;
    transition: background 0.15s, box-shadow 0.15s;
    white-space: nowrap; box-shadow: var(--shadow-sm);
}
.btn-opcoes:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); }
.btn-opcoes__icon { font-size: 16px; }
.btn-opcoes__text { white-space: nowrap; }

/* ============================================================
   Flash messages
   ============================================================ */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
.flash-success { background: var(--success-soft); color: var(--success); border: 1px solid #b7dfbd; }
.flash-error, .flash-danger { background: var(--danger-soft); color: var(--danger); border: 1px solid #f3c1bb; }
.flash-info { background: var(--info-soft); color: var(--primary); border: 1px solid #c8ddfa; }
.flash-warning { background: var(--warning-soft); color: #b7791f; border: 1px solid #f0d9a8; }

/* ============================================================
   Cards (KPIs) — base
   ============================================================ */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-bottom: 24px; }
.cards--turmas { grid-template-columns: repeat(5, 1fr); }
.cards--4 { grid-template-columns: repeat(4, 1fr); }
    .cards--5 { grid-template-columns: repeat(5, 1fr); }
.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
    display: flex; align-items: center; gap: 16px;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 500; margin-bottom: 4px; }
.card .value { font-size: 26px; font-weight: 600; color: var(--text); line-height: 1.2; }
.card .small { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---- Cards KPI — padrão "cards métricos" (Financeiro / Dashboard / Comunicação) ----
   Título no topo, valor GRANDE e colorido no meio, descrição embaixo e
   ícone semântico à direita. SEM bordas coloridas — o número é a estrela. */
.card__content {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; justify-content: center;
    container-type: inline-size; /* referência para o auto-ajuste de fonte (--fit) */
}
.card__label {
    font-size: 12px; color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.4px; font-weight: 600; margin-bottom: 2px;
}
.card__value {
    font-size: 32px; font-weight: 800; color: var(--text); line-height: 1.15;
    letter-spacing: -0.5px; font-variant-numeric: tabular-nums;
    white-space: nowrap; /* o número nunca quebra de linha */
}
.card__desc {
    font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap;
}

/* Ícone semântico — à direita, fundo suave + cor da categoria */
.card__icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; flex-shrink: 0;
}

/* Blue — agendado / empresas */
.card--scheduled .card__icon { background: var(--info-soft); color: var(--primary); }
.card--companies .card__icon { background: var(--info-soft); color: var(--primary); }
.card--scheduled .card__value { color: var(--primary); }
.card--companies .card__value { color: var(--primary); }

/* Green — enviado / ativas / recebido */
.card--sent .card__icon { background: var(--success-soft); color: var(--success); }
.card--active .card__icon { background: var(--success-soft); color: var(--success); }
.card--received .card__icon { background: var(--success-soft); color: var(--success); }
.card--sent .card__value { color: var(--success); }
.card--active .card__value { color: var(--success); }
.card--received .card__value { color: var(--success); }

/* Red — falha / atrasado */
.card--failed .card__icon { background: var(--danger-soft); color: var(--danger); }
.card--overdue .card__icon { background: var(--danger-soft); color: var(--danger); }
.card--failed .card__value { color: var(--danger); }
.card--overdue .card__value { color: var(--danger); }

/* Amber — grupos / remetente / a receber */
.card--groups .card__icon { background: var(--warning-soft); color: #b7791f; }
.card--phone .card__icon { background: var(--warning-soft); color: #b7791f; }
.card--open .card__icon { background: var(--warning-soft); color: #b7791f; }
.card--groups .card__value { color: var(--warning); }
.card--phone .card__value { color: #b7791f; }
.card--open .card__value { color: var(--warning); }

/* Indigo — aprendizes */
.card--apprentices .card__icon { background: var(--indigo-soft); color: var(--indigo); }
.card--apprentices .card__value { color: var(--indigo); }

/* Gray — total (valor permanece na cor padrão do texto) */
.card--total .card__icon { background: var(--bg); color: var(--muted); }

/* Indigo — plano */
.card--plan .card__icon { background: var(--indigo-soft); color: var(--indigo); }
.card--plan .card__value { color: var(--indigo); }

/* ---- Filtros inline da tela de frequência (mês + dias + busca em uma única linha) ---- */
    .freq-filters {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    .month-nav {
        display: flex;
        align-items: center;
        gap: 8px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .month-nav .btn { padding: 4px 8px; font-size: .85rem; }
    .filter-divider { color: #ccc; font-weight: bold; flex-shrink: 0; }
    .day-grid { display: flex; gap: 6px; white-space: nowrap; flex-shrink: 0; min-width: 0; }
    .filter-btn {
        padding: 6px 12px;
        border: 1px solid #ddd;
        background: #f5f5f5;
        border-radius: 4px;
        cursor: pointer;
        font-size: 13px;
        white-space: nowrap;
    }
    .filter-btn.active {
        background: #3b82f6;
        color: #fff;
        border-color: #3b82f6;
    }
    .day-grid .filter-btn small {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        margin-left: 5px;
        border-radius: 999px;
        font-size: 13px;
        font-weight: 600;
        line-height: 1;
        background: #e5e7eb;
        color: #374151;
    }
    .day-grid .filter-btn.active small {
        background: #fff;
        color: #2563eb;
    }
    .search-box { flex: 1 1 200px; min-width: 0; }
    .search-box input {
        width: 100%;
        padding: 6px 12px;
        border: 1px solid #ddd;
        border-radius: 4px;
        font-size: 14px;
    }
    @media (max-width: 720px) {
        .freq-filters { flex-wrap: wrap; }
    }

    /* ---- Cards de filtro por dia da semana (Controle de Frequência) ----
    5 cards clicáveis, sem ícone: título + contagem. Ativo = destaque azul. */
    .cards--5 { grid-template-columns: repeat(5, 1fr); gap: 12px; }
    .card--metric {
        padding: 12px 14px; text-decoration: none; color: inherit;
        transition: transform .12s, box-shadow .12s, border-color .12s;
        border: 1px solid var(--border);
    }
    .card--metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
    .card--metric .card__label { font-size: 11px; margin-bottom: 2px; }
    .card--metric .card__value { font-size: 26px; color: var(--text); }
    .card--metric.card--active {
        border-color: var(--primary); background: var(--info-soft);
        box-shadow: 0 0 0 1px var(--primary);
    }
    .card--metric.card--active .card__value { color: var(--primary); }

    /* Valores longos (e-mail/perfil) — não estouram o card */
.card__value--sm { font-size: 20px; letter-spacing: 0; }
.card__value--ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* ---- Cards KPI compactos e clicáveis — padrão unificado do portal Cliente
   (dashboard/aprovados/jornada/aprendizes/gestores/relatórios/vagas/pendências):
   título em UMA linha no topo, número grande à esquerda, ícone grande à direita. ---- */
.cards--kpi { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.cards--kpi .card {
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    transition: transform .12s, box-shadow .12s;
}
.cards--kpi .card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.cards--kpi .card__label {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 11px; margin-bottom: 2px;
}
.cards--kpi .card__value { font-size: 26px; }
.cards--kpi .card__icon { width: 40px; height: 40px; border-radius: 10px; font-size: 20px; }

/* Variante colorida sem card__icon (borda esquerda + número colorido, padrão
   usado nas listagens: aprovados, jornada, aprendizes, gestores, relatórios) */
.cards--kpi .card--tint { display: block; }
.cards--kpi .card--tint .card__value { color: inherit; }

/* Cards de pendência (botões) seguem a mesma anatomia do cards--kpi */
.pend-card { padding: 14px 16px; }
.pend-card__count { font-size: 26px; }

/* Valores monetários longos (R$ 81.222,00) — encolhem só quando não cabem;
   com espaço sobrando permanece em 32px */
.card__value--fit { font-size: clamp(18px, 17cqw, 32px); }

/* ---- Tooltip nativo (data-tooltip) — usado nos cards KPI ---- */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    background: #202124; color: #fff; font-size: 12px; font-weight: 500;
    padding: 6px 10px; border-radius: 6px; white-space: nowrap;
    z-index: 50; pointer-events: none; box-shadow: var(--shadow-sm);
}
[data-tooltip]:hover::before {
    content: ''; position: absolute; bottom: calc(100% + 2px); left: 50%; transform: translateX(-50%);
    border: 5px solid transparent; border-top-color: #202124; pointer-events: none;
}

@media (max-width: 560px) {
    .card { padding: 14px 16px; gap: 12px; }
    .card .value { font-size: 22px; }
    .card__value { font-size: 26px; }
    .card__icon { width: 38px; height: 38px; font-size: 18px; }
}

/* ============================================================
   Painel (cartão de conteúdo / tabela)
   ============================================================ */
.panel {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 20px 24px; margin-bottom: 20px;
}
.panel--narrow { max-width: 640px; }
.panel > h3 { margin-bottom: 14px; }

/* ── Turma: linhas de horário (grid 12 colunas: dia 2 · início 2 · fim 2 · local 6) ── */
.turma-horario-item {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 2fr) minmax(0, 6fr);
    gap: 10px 12px;
    align-items: end;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 10px;
}
.turma-horario-item .form-group { margin-bottom: 0; }
/* Labels: linhas do servidor usam .form-group; linhas via JS usam <div><label> */
.turma-horario-item label { text-transform: uppercase; }
.turma-horario-item input[type="text"],
.turma-horario-item select { text-transform: uppercase; }
.panel h4 { font-size: 14px; font-weight: 600; color: var(--text); margin: 18px 0 12px; }
.panel h4:first-child { margin-top: 0; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; font-size: 14px; }

/* ---- Enhanced empty state (for Comunicação and elsewhere) ---- */
.empty-state {
    text-align: center; padding: 48px 24px;
}
.empty-state__icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state__title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state__desc { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.empty-state .btn { margin-top: 8px; }

/* ---- Table wrapper (horizontal scroll on mobile) ---- */
.table-wrapper { overflow-x: auto; }
.table-wrapper table { min-width: 720px; }

/* ============================================================
   Tabelas
   ============================================================ */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
    text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.4px;
    padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.table-actions { text-align: right; white-space: nowrap; }

/* ============================================================
   Badges
   ============================================================ */
.badge {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 3px 10px; border-radius: 6px;
    font-size: 12px; font-weight: 500;
    background: var(--bg); color: var(--muted); border: 1px solid var(--border);
}
.badge-green { background: var(--success-soft); color: var(--success); border-color: #b7dfbd; }
.badge-yellow { background: var(--warning-soft); color: #b7791f; border-color: #f0d9a0; }
.badge-red { background: var(--danger-soft); color: var(--danger); border-color: #f3c1bb; }
.badge-blue { background: var(--info-soft); color: var(--primary); border-color: #c8ddfa; }
.badge-gray { background: var(--bg); color: var(--muted); border-color: var(--border); }

/* ---- Error tooltip in table ---- */
.error-tooltip { font-size: 12px; color: var(--danger); margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.error-tooltip__icon { font-size: 11px; }
.error-tooltip:hover { opacity: 0.85; }

.cancel-form { margin: 0; }

/* ---- SVG Icon system ---- */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
    color: inherit; /* herda cor do texto pai */
}
.btn__icon { margin-right: 6px; }
.btn .btn__icon:last-child { margin-right: 0; margin-left: 6px; }
.icon--compose { color: inherit; }
.icon--calendar { color: inherit; }

/* Card icons - cores semânticas definidas na seção "Cards KPI" acima */
.card__icon { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Empty state icon */
.empty-state__icon { color: var(--muted); opacity: 0.7; }

/* Error tooltip icon */
.error-tooltip__icon { color: var(--danger); flex-shrink: 0; }

/* Modal close icon */
.actions-modal__close .icon { color: var(--muted); }
.actions-modal__close:hover .icon { color: var(--text); }

/* ---- Form in modal adjustments ---- */
.action-panel--form .form-stack .form-group { margin-bottom: 14px; }
.action-panel--form .form-stack label { font-size: 13px; }
.action-panel--form .form-stack input,
.action-panel--form .form-stack select,
.action-panel--form .form-stack textarea {
    font-size: 14px; padding: 10px 12px;
}
.action-panel--form .form-stack .form-actions { margin-top: 18px; }
.action-panel--form .form-stack .btn { width: 100%; }

/* ============================================================
   Formulários
   ============================================================ */
.form-group { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; }
.col-1 { grid-column: span 1; } .col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; } .col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; } .col-10 { grid-column: span 10; }
.col-11 { grid-column: span 11; } .col-12 { grid-column: span 12; }

label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; text-transform: uppercase; }

/* Marcador * de campos obrigatórios — vermelho em todos os formulários */
label.required::after,
.form-label.required::after { content: " *"; color: var(--danger, #d93025); font-weight: 700; }
.form-label.required { color: var(--text); }
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="search"], input[type="time"], input[type="date"], select, textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font); color: #1058f3;
    background: var(--surface); transition: border-color 0.15s, box-shadow 0.15s;
    margin-bottom: 0;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer; opacity: 0.6; transition: opacity 0.15s;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}
/* Opções dos dropdowns nativos (<select> e <datalist>) com fundo amarelo claro —
   o branco se fundia ao branco da página. O popup do <datalist> no Chrome não é
   estilizável; por isso os campos de busca usam o dropdown próprio (.ac-dropdown). */
option {
    background-color: #fffde7;
}

/* ============================================================
   Autocomplete próprio (substitui o popup nativo do <datalist>)
   ============================================================ */
.ac-dropdown {
    position: fixed;
    z-index: 1200;
    max-height: 240px;
    overflow-y: auto;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fffde7;
    border: 1px solid #f0e68c;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.ac-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #f7efb0;
    background: #fffde7;
    color: #111827;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover,
.ac-item.ac-active { background: #fff59d; outline: none; }
.form-checkbox { display: flex; align-items: center; gap: 10px; }
.form-checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); }
.form-checkbox label { margin-bottom: 0; font-weight: 400; }

/* Checkboxes expanded (ChoiceType) em linha única — ex.: Setores do gestor */
.checkbox-inline { display: flex; flex-wrap: nowrap; align-items: center; }
.checkbox-inline > div { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; gap: 8px 20px !important; align-items: center; width: 100%; }
.checkbox-inline label { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; margin-bottom: 0; cursor: pointer; font-weight: 400; font-size: 14px; }
.checkbox-inline input[type="checkbox"] { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.opcao-nota { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }
.opcao-nota:hover { border-color: var(--primary); background: var(--primary-soft); }
.opcao-nota:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.opcao-nota input { accent-color: var(--primary); margin: 0; }
.help-text { font-size: 12px; color: var(--muted); margin-top: 4px; }
.mb-14 { margin-bottom: 14px; }
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }
.form-error ul { list-style: none; padding: 0; margin: 0; }
.form-error li { color: var(--danger); }
.form-group:has(.form-error) > input,
.form-group:has(.form-error) > textarea,
.form-group:has(.form-error) > select,
.form-group div:has(.form-error) > input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(217, 48, 37, 0.15); }
form ul li { color: var(--danger); font-size: 12px; margin-top: 4px; list-style: none; padding: 0; }
/* Cards condicionais reabrem automaticamente se contiverem erro de validação (422 visível) */
.panel:has(.form-error) { display: block !important; }
form .col-2 ul li,
form .col-6 ul li { margin-top: 2px; }
.form-actions { display: flex; gap: 10px; margin-top: 20px; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-stack ul { list-style: none; padding: 0; margin: 4px 0 0; }
.form-stack ul li { color: var(--danger); font-size: 12px; }

/* Central de Comunicação — badges de canal/recorrência na tabela de histórico */
.row-badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }

/* Compositor WhatsApp — seleção de contatos da agenda no modal */
.contact-checkboxes {
    max-height: 220px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; margin-top: 6px;
}
.contact-checkboxes input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--success); margin-right: 8px; vertical-align: middle; }
.contact-checkboxes label { font-weight: 400; font-size: 13px; display: block; margin-bottom: 8px; }
.contact-checkboxes label:last-of-type { margin-bottom: 0; }

/* ---- Config WhatsApp — cards de provider (Brevo / Evolution) ---- */
.provider-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.provider-card {
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 20px; background: var(--bg);
}
.provider-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.provider-card__title h4 { margin: 0; font-size: 14px; font-weight: 600; }
.provider-card__sub { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.provider-card__icon {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.provider-card--brevo .provider-card__icon { background: var(--info-soft); color: var(--primary); }
.provider-card--evolution .provider-card__icon { background: var(--warning-soft); color: #b7791f; }
.provider-card__head .badge { margin-left: auto; }

/* Lista numerada de passos (Como configurar) */
.step-list { margin: 0; padding-left: 20px; }
.step-list li { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 10px; }
.step-list li:last-child { margin-bottom: 0; }
.step-list a { color: var(--primary); }

/* Código inline (chaves, código de pareamento do WhatsApp) */
code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
    background: var(--surface); border: 1px solid var(--border);
    padding: 1px 6px; border-radius: 4px; font-size: 0.9em; color: var(--text);
}

/* QR Code / código de pareamento (Evolution) */
.qr-code { max-width: 300px; width: 100%; margin: 0 auto; }
.pairing-code { font-size: 20px; font-weight: 700; letter-spacing: 2px; }

/* ============================================================
   Login
   ============================================================ */
.auth-wrap {
    min-height: calc(100vh - var(--topbar-h) - 56px); /* desconta topbar e footer */
    display: flex; align-items: center; justify-content: center;
    background: var(--bg); padding: 0;
    margin: -28px -24px -48px; /* cancela padding do .container pai */
}
.auth-card {
    width: 100%; max-width: 400px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; box-shadow: var(--shadow-md); padding: 40px 36px;
}
.auth-card .brand { justify-content: center; margin-bottom: 8px; }
.auth-card .auth-title { text-align: center; font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.auth-card .auth-sub { text-align: center; color: var(--muted); font-size: 13px; margin-bottom: 28px; }
.auth-card .btn { width: 100%; }
.auth-card .auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--muted); }

/* ============================================================
   Grid de listas (empresas/grupos)
   ============================================================ */
.list-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.list-filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list-filters .form-group { margin-bottom: 0; flex: 1; min-width: 180px; }
.list-filters .form-group input,
.list-filters .form-group select { margin-bottom: 0; }
.list-filters input[type="search"], .list-filters select { width: auto; margin-bottom: 0; }
.list-filters input[type="search"] { width: 240px; }

/* ============================================================
   Rodapé do portal
   ============================================================ */
.app-footer {
    text-align: center; padding: 24px; color: var(--muted); font-size: 12px;
    border-top: 1px solid var(--border); margin-top: 40px;
}

/* ============================================================
   Modal de ações (substitui os links da coluna "Ações")
   ============================================================ */

/* ============================================================
   Stateful Button (Status Ativo/Inativo) — usado em empresas/novo
   ============================================================ */
.stateful-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.stateful-btn--active {
    background: var(--success-soft);
    color: var(--success);
    border-color: #b7dfbd;
}
.stateful-btn--active .stateful-btn__dot { background: var(--success); }
.stateful-btn--inactive {
    background: var(--danger-soft);
    color: var(--danger);
    border-color: #f3c1bb;
}
.stateful-btn--inactive .stateful-btn__dot { background: var(--danger); }
.stateful-btn__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}
.stateful-btn__label { white-space: nowrap; }

/* ============================================================
   Toggle Switch (Status Ativo/Inativo) — azul/vermelho
   ============================================================ */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 28px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-switch__slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #dc2626; /* vermelho inativo */
    transition: .3s;
    border-radius: 28px;
    border: 2px solid #b91c1c;
}
.toggle-switch__slider:before {
    position: absolute;
    content: "";
    height: 20px; width: 20px;
    left: 2px; bottom: 2px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,.2);
}
.toggle-switch input:checked + .toggle-switch__slider {
    background-color: #2563eb; /* azul ativo */
    border-color: #1d4ed8;
}
.toggle-switch input:checked + .toggle-switch__slider:before {
    transform: translateX(28px);
}
.toggle-switch input:focus-visible + .toggle-switch__slider {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.toggle-switch__label {
    position: absolute;
    top: 50%; left: 100%; transform: translateY(-50%);
    margin-left: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--muted);
    white-space: nowrap;
    pointer-events: none;
}
.toggle-switch input:checked + .toggle-switch__slider + .toggle-switch__label {
    color: #2563eb;
}
.toggle-switch input:not(:checked) + .toggle-switch__slider + .toggle-switch__label {
    color: #dc2626;
}

.actions-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(0, 0, 0, 0.45);
    display: none; align-items: flex-start; justify-content: center;
    padding: 48px 16px; overflow-y: auto;
}
.actions-overlay.open { display: flex; }

.actions-modal {
    width: 100%; max-width: 840px; /* 3 cards por linha no grid (pedido do dono 2026-09-27) */
    background: var(--surface); border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column;
    max-height: calc(100vh - 96px);
}
.actions-modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.actions-modal__title { font-size: 17px; font-weight: 600; color: var(--text); }
.actions-modal__close {
    background: none; border: none; cursor: pointer;
    font-size: 20px; line-height: 1; color: var(--muted);
    padding: 4px 8px; border-radius: 6px;
}
.actions-modal__close:hover { background: var(--bg); color: var(--text); }

.actions-modal__body { padding: 20px; overflow-y: auto; }

.actions-modal__grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.action-card {
    display: flex; flex-direction: row; align-items: flex-start; gap: 16px;
    padding: 18px 20px;
    border: 1px solid var(--border); border-left: 4px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface); cursor: pointer; text-align: left;
    font-family: var(--font);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.action-card:hover { box-shadow: var(--shadow-sm); }
.action-card__icon {
    width: 52px; height: 52px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 26px;
    flex-shrink: 0;
}
.action-card__text { display: flex; flex-direction: column; min-width: 0; }
.action-card__label { font-size: 16px; font-weight: 600; color: var(--text); display: block; }
.action-card__desc { font-size: 13px; color: var(--muted); display: block; margin-top: 4px; line-height: 1.4; }

/* Cores semânticas (Material): borda esquerda + círculo do ícone por tipo de ação */
.action-card--blue { border-left-color: var(--primary); }
.action-card--green { border-left-color: var(--success); }
.action-card--yellow { border-left-color: var(--warning); }
.action-card--red { border-left-color: var(--danger); }
.action-card--gray { border-left-color: var(--muted); }
.action-card--blue .action-card__icon { background: var(--info-soft); }
.action-card--green .action-card__icon { background: var(--success-soft); }
.action-card--yellow .action-card__icon { background: var(--warning-soft); }
.action-card--red .action-card__icon { background: var(--danger-soft); }
.action-card--gray .action-card__icon { background: var(--bg); }
.action-card--blue:hover { background: var(--info-soft); }
.action-card--green:hover { background: var(--success-soft); }
.action-card--yellow:hover { background: var(--warning-soft); }
.action-card--red:hover { background: var(--danger-soft); }
.action-card--gray:hover { background: var(--bg); }

/* ---- Importação (índice): tiles de ação em painel full-width (3 colunas) ---- */
.import-tiles { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.import-tile { display: flex; flex-direction: column; gap: 10px; padding: 18px 22px; }
.import-tile + .import-tile { border-left: 1px solid var(--border); }
.import-tile__head { display: flex; align-items: center; gap: 10px; }
.import-tile__icon { width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.import-tile__title { margin: 0; font-size: 16px; font-weight: 700; color: var(--text); }
.import-tile__desc { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; flex: 1; }
.import-tile__actions { display: flex; flex-wrap: nowrap; gap: 8px; margin-top: 12px; }
.import-tile__actions .btn { flex: 0 1 auto; padding: 6px 10px; }
.import-tile__actions .btn__icon { width: 16px; height: 16px; }
@media (max-width: 1024px) {
    .import-tiles { grid-template-columns: 1fr; }
    .import-tile + .import-tile { border-left: 0; border-top: 1px solid var(--border); }
}

.actions-modal__panel { padding: 0 20px 20px; }

.action-panel {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-top: 16px; overflow: hidden;
}
.action-panel--expand { border-color: #d4a72c; }
.action-panel--confirm { border-color: var(--border-strong); }
.action-panel__head {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; background: var(--bg); border-bottom: 1px solid var(--border);
}
.action-panel__icon { font-size: 18px; }
.action-panel__label { font-size: 14px; font-weight: 600; color: var(--text); }
.action-panel__close {
    margin-left: auto; background: none; border: none; cursor: pointer;
    font-size: 16px; line-height: 1; color: var(--muted); padding: 2px 6px; border-radius: 4px;
}
.action-panel__close:hover { background: var(--border); color: var(--text); }
.action-panel__body { padding: 14px; }

.action-option {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer; text-align: left; font-family: var(--font);
    margin-bottom: 8px; transition: border-color 0.15s, background 0.15s;
}
.action-option:last-child { margin-bottom: 0; }
.action-option:hover { border-color: var(--primary); background: var(--primary-soft); }
.action-option strong { font-size: 14px; color: var(--text); display: block; }
.action-option small { font-size: 12px; color: var(--muted); display: block; }
.action-option__icon { font-size: 18px; }
.action-option__arrow { margin-left: auto; color: var(--muted); }

.action-confirm__msg { font-size: 14px; color: var(--text); margin-bottom: 14px; }
.action-confirm__actions { display: flex; gap: 10px; justify-content: flex-end; }

.action-panel--form { border-color: var(--border-strong); }
.action-form__loading, .action-form__error { font-size: 14px; color: var(--muted); padding: 4px 0; }
.action-form__error { color: var(--danger); margin-bottom: 12px; }
.action-panel__body form { margin: 0; }
.action-panel__body .form-actions { margin-top: 16px; }

/* Financeiro (modais de baixa): dropdowns em uppercase */
.baixa-financeiro select { text-transform: uppercase; }

.actions-modal__foot {
    padding: 14px 20px; border-top: 1px solid var(--border); text-align: right;
}

/* Responsivo */
@media (max-width: 720px) {
    .topbar { padding: 0 16px; }
    .container { padding: 20px 16px 40px; }
    .form-grid { grid-template-columns: repeat(6, 1fr); }
    .provider-grid { grid-template-columns: 1fr; }
    .list-toolbar { flex-direction: column; align-items: stretch; }
    .list-filters input[type="search"] { width: 100%; }
    .turma-horario-item { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Pagamento PIX/Boleto (Fase10 — PagBank) ---------- */
.hidden { display: none !important; }

.pagamento-overlay {
    position: fixed; inset: 0; z-index: 1100;
    background: rgba(0, 0, 0, 0.45);
    display: none; align-items: center; justify-content: center;
    padding: 16px; overflow-y: auto;
}
.pagamento-overlay.open { display: flex; }

.pagamento-modal {
    width: 100%; max-width: 420px;
    background: var(--surface); border-radius: 12px;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column;
}
.pagamento-modal__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px; border-bottom: 1px solid var(--border);
}
.pagamento-modal__title { font-size: 17px; font-weight: 600; color: var(--text); }
.pagamento-modal__close {
    background: none; border: none; cursor: pointer;
    font-size: 20px; line-height: 1; color: var(--muted);
    padding: 4px 8px; border-radius: 6px;
}
.pagamento-modal__close:hover { background: var(--bg); color: var(--text); }
.pagamento-modal__body { padding: 24px 20px; text-align: center; }
.pagamento-modal__body p { margin: 8px 0; }

.pagamento__qr {
    width: 220px; height: 220px;
    border: 1px solid var(--border); border-radius: 10px;
    margin: 8px auto 16px;
    object-fit: contain; background: #fff;
}
.pagamento__text {
    width: 100%; font-family: monospace; font-size: 12px;
    padding: 10px; border: 1px dashed var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text);
    resize: none; overflow-wrap: anywhere; word-break: break-all;
}
.pagamento__actions { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
.pagamento__msg { font-size: 13px; margin-top: 12px; }
.pagamento__msg--err { color: var(--danger); }
.pagamento__msg--ok { color: var(--success); }
.pagamento__loading { color: var(--muted); font-size: 14px; padding: 40px 0; }

@media (max-width: 720px) {
    .pagamento__qr { width: 180px; height: 180px; }
}

/* ── Calendário (Fase11 — Central de Comunicação) ─────────────── */
.cal-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; gap: 10px;
}
.cal-title { margin: 0; font-size: 18px; color: var(--text); }
.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}
.cal-grid--head {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
}
.cal-grid--head span {
    text-align: center; font-size: 12px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: .03em;
    padding: 4px 0;
}
.cal-cell {
    min-height: 92px;
    border: 1px solid var(--border); border-radius: 10px;
    padding: 8px; cursor: default;
    display: flex; flex-direction: column; gap: 6px;
    background: var(--surface);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.cal-cell--empty { border-color: transparent; background: transparent; }
.cal-cell--has-events { cursor: pointer; }
.cal-cell--has-events:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    background: var(--primary-soft);
}
.cal-cell--today {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: inset 0 0 0 2px var(--primary);
}
.cal-cell--today .cal-day-number { color: var(--primary); }

.cal-day-number { font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.2; }

/* Dots container - better layout */
.cal-dots {
    display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px;
}
.cal-dot {
    width: 8px; height: 8px; border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.cal-dot:hover { transform: scale(1.25); }
.cal-dot--expiration { background: var(--danger); }
.cal-dot--alert { background: var(--warning); }
.cal-dot--holiday { background: var(--primary); }
.cal-more {
    font-size: 11px; color: var(--muted);
    padding: 0 4px; line-height: 1;
    background: var(--bg); border-radius: 999px;
}

.cal-legend {
    display: flex; flex-wrap: wrap; gap: 16px;
    margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
    font-size: 12px; color: var(--muted);
}
.cal-legend__dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }

.cal-events { display: flex; flex-direction: column; gap: 8px; }
.cal-event {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
    padding: 12px;
    transition: border-color 0.15s;
}
.cal-event:hover { border-color: var(--primary); }
.cal-event small { display: block; color: var(--muted); margin-top: 2px; font-size: 12px; }
.cal-event__dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 3px; flex: none; }
.cal-event--expiration .cal-event__dot { background: var(--danger); }
.cal-event--alert .cal-event__dot { background: var(--warning); }
.cal-event--holiday .cal-event__dot { background: var(--primary); }

/* Modal overlay for calendar - inherits .actions-overlay / .actions-modal styles */
.actions-overlay[data-calendario-target="overlay"] .actions-modal {
    max-width: 480px;
}

@media (max-width: 720px) {
    .cal-cell { min-height: 64px; padding: 6px; }
    .cal-dot { width: 7px; height: 7px; }
    .cal-day-number { font-size: 13px; }
    .cal-head { flex-wrap: wrap; }
    .cal-title { font-size: 16px; }
}

/* ============================================================
   Helpdesk / KBase (Fase 13 — Ajuda e IA)
   ============================================================ */
.help-search-hero { margin-bottom: 32px; }
.help-search-hero .search-form { display: flex; gap: 8px; max-width: 720px; margin: 0 auto; }
.help-search-hero input[name="q"] { flex: 1; padding: 12px 16px; font-size: 15px;
    border: 1px solid var(--border-strong); border-radius: var(--radius); }
.help-search-hero .btn { min-width: 44px; }
.help-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; border-radius: 999px;
    font-size: 13px; background: var(--bg); border: 1px solid var(--border);
    color: var(--text); transition: background 0.15s; }
.chip:hover { background: var(--primary-soft); color: var(--primary); }
.chip--source { background: var(--info-soft); color: var(--primary); border-color: #c8ddfa; }
.chip--sm { padding: 3px 10px; font-size: 11px; }
.help-section { margin-bottom: 32px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.faq-item summary { cursor: pointer; font-weight: 500; font-size: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.faq-item[open] summary { color: var(--primary); }
.faq-item p { margin-top: 12px; font-size: 14px; line-height: 1.6; }
.help-article-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.help-article-row:last-child { border-bottom: none; }
.help-article-row strong { display: block; font-size: 14px; margin-bottom: 4px; }
.help-question { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.6; }
.help-question strong { flex: 1; }
.help-answer { font-size: 15px; line-height: 1.7; }
.help-feedback { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.help-feedback form { display: inline; }
.help-chunk { margin-bottom: 14px; font-size: 14px; line-height: 1.6; }
.help-chunk footer { font-size: 12px; color: var(--muted); margin-top: 6px; }
.card--featured { flex-direction: column; text-align: center; }

/* Dashboard responsivo: 12 → 6 → 1 coluna. Em 6 colunas TODO card vira
   full-width, o que garante linhas sem célula vazia em qualquer
   combinação de dados (com/sem alertas, com/sem pendências). */
@media (max-width: 1100px) {
    .dash-grid { grid-template-columns: repeat(6, 1fr); }
    .dash-grid > .dash-span-3,
    .dash-grid > .dash-span-4,
    .dash-grid > .dash-span-5,
    .dash-grid > .dash-span-7,
    .dash-grid > .dash-span-8,
    .dash-grid > .dash-span-12 { grid-column: span 6; }
}
@media (max-width: 768px) {
    .dash-grid { grid-template-columns: 1fr; gap: 14px; }
    .dash-grid > [class*="dash-span-"] { grid-column: 1 / -1; }
    .dash-two-col { grid-template-columns: 1fr !important; }
    .chart-bars { gap: 12px; height: 240px; }
    .chart-bars__stack { height: 190px; }
}

.company-analytics-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.company-analytics-card { min-width: 0; margin-bottom: 0 !important; }
.company-analytics-card .dash-card__body { overflow: auto; }
.company-analytics-card--cotas .dash-stats { grid-template-columns: 1fr; }
.company-analytics-card--cotas .dash-card__desc { margin-top: 12px; }
@media (max-width: 900px) {
    .company-analytics-row { grid-template-columns: 1fr; }
}

/* ============================================================
   Importação CSV — zona de upload (1A.56.2)
   ============================================================ */
.import-steps {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
    margin-bottom: 20px;
}
.import-step {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
}
.import-step__num {
    flex: 0 0 26px; height: 26px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
}
.import-step strong { display: block; font-size: 13px; margin-bottom: 3px; }
.import-step small { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.import-step code { font-size: 11px; }

.import-chips { display: inline-flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.import-chip {
    display: inline-block; padding: 2px 8px; font-size: 11px; font-weight: 600;
    background: var(--info-soft); color: var(--primary); border: 1px solid #c8ddfa;
    border-radius: 999px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.import-dropzone {
    position: relative;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg);
    padding: 42px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
    outline: none;
}
.import-dropzone:hover,
.import-dropzone:focus-visible {
    border-color: var(--primary);
    background: var(--primary-soft);
}
.import-dropzone--drag {
    border-color: var(--primary);
    background: var(--primary-soft);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.12);
}
.import-dropzone__input {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.import-dropzone__empty { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.import-dropzone__icon { width: 44px; height: 44px; color: var(--primary); margin-bottom: 6px; }
.import-dropzone__title { font-size: 15px; color: var(--text); }
.import-dropzone__hint { font-size: 12px; color: var(--muted); }
.import-dropzone__preview {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    flex-wrap: wrap;
}
.import-dropzone__file-icon { width: 26px; height: 26px; color: var(--primary); }
.import-dropzone__file-info { text-align: left; min-width: 0; }
.import-dropzone__file-info strong { display: block; font-size: 14px; word-break: break-all; }
.import-dropzone__file-info small { color: var(--muted); font-size: 12px; }
.import-preview { margin-top: 8px; }

/* Ícones SVG dentro de botões/headings */
.icon { width: 22px; height: 22px; vertical-align: -4px; }

@media (max-width: 720px) {
    .import-steps { grid-template-columns: 1fr; }
}

/* ============================================================
   Dashboard da instituição — grade de 12 colunas (1A.67)
   UMA grade para a página inteira: cada card declara seu span
   (.dash-span-N) e as linhas fecham em 12. Não existe grid
   aninhado — era o que deixava 2–3 células vazias no canto
   inferior direito (os "buracos" do layout anterior).
   ============================================================ */
.dash-grid {
    display: grid; grid-template-columns: repeat(12, 1fr);
    gap: 20px; margin-bottom: 24px;
}
.dash-grid > .dash-span-3 { grid-column: span 3; }
.dash-grid > .dash-span-4 { grid-column: span 4; }
.dash-grid > .dash-span-5 { grid-column: span 5; }
.dash-grid > .dash-span-6 { grid-column: span 6; }
.dash-grid > .dash-span-7 { grid-column: span 7; }
.dash-grid > .dash-span-8 { grid-column: span 8; }
.dash-grid > .dash-span-12 { grid-column: span 12; }

/* ── Casca única dos cards ──
   Altura igual na linha (stretch do grid) + flex interno: o
   rodapé sempre cola embaixo, sem faixa em branco sobrando. */
.dash-card {
    display: flex; flex-direction: column; height: 100%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
}
.dash-card__head {
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; margin-bottom: 16px; flex: 0 0 auto;
}
.dash-card__head--tight { margin-bottom: 4px; }
.dash-card__title {
    margin: 0; font-size: 14px; font-weight: 700; color: #1e293b;
    display: flex; align-items: center; gap: 8px;
}
.dash-card__desc { margin: 0 0 14px; font-size: 12px; color: var(--muted); }
.dash-card__body { flex: 1 1 auto; min-height: 0; overflow: auto; }
.dash-card__foot {
    flex: 0 0 auto; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: var(--muted);
}
.dash-card__legend { padding-top: 8px; flex: 0 0 auto; }
.dash-alert__link { font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; align-self: flex-end; }
.dash-alert__link:hover { text-decoration: underline; }
.dash-alert--danger .dash-alert__link { color: #b91c1c; }
.dash-alert--warning .dash-alert__link { color: #92400e; }
.dash-alert--orange .dash-alert__link { color: #9a3412; }
.dash-card__empty { margin: 0; color: var(--muted); font-size: 13px; }
.dash-card__count { padding: 2px 8px; border-radius: 8px; font-size: 11px; font-weight: 700; }
.dash-card__count--warning { background: var(--warning-soft); color: #b45309; }
.dash-card__count--success { background: var(--success-soft); color: var(--success); }

/* ── Linha inline de cards de analytics (empresas hub) — 3 cards em linha no desktop, empilhados em mobile */
.dash-analytics-row--inline > .dash-card {
    display: inline-block;
    width: 30%;
    margin: 0 1.5%;
    vertical-align: top;
    float: none;
}
@media (max-width: 1024px) {
    .dash-analytics-row--inline > .dash-card {
        display: block;
        width: 100%;
        margin: 0 0 16px;
    }
}

/* ── KPIs métricos — mesmo padrão dos cards do Financeiro (1A.67)
   Label em UMA linha no topo, valor grande no meio, ícone semântico À
   DIREITA do valor e SEM descrição embaixo (pedido do dono). Só o que o
   Financeiro não tem: clique (o KPI da dashboard é link). */
.dash-kpis {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px; margin-bottom: 24px;
}
.dash-kpis .card {
    height: 100%; text-decoration: none; color: inherit;
    transition: transform .12s, box-shadow .12s;
}
.dash-kpis .card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.dash-kpis .card__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-kpis .card__value { font-size: 22px; }

/* ── Banner de conferência ── */
.dash-banner {
    display: flex; align-items: center; gap: 12px; text-decoration: none;
    background: #fffbeb; border: 1px solid #f59e0b; border-left: 4px solid #f59e0b;
    border-radius: 10px; padding: 14px 18px; margin-bottom: 24px;
}
.dash-banner__icon { font-size: 22px; }
.dash-banner__text { flex: 1; }
.dash-banner__title { display: block; font-size: 14px; color: #92400e; }
.dash-banner__desc { font-size: 13px; color: #a16207; }
.dash-banner__cta { pointer-events: none; }

/* ── Alertas ── */
.dash-alerts {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px; margin-bottom: 24px;
}
.dash-alert {
    display: flex; align-items: center; gap: 10px; padding: 14px 18px;
    border-radius: 10px; text-decoration: none; transition: box-shadow .15s;
}
.dash-alert:hover { box-shadow: var(--shadow-md); }
.dash-alert__icon {
    width: 36px; height: 36px; border-radius: var(--radius); color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 16px;
}
.dash-alert__title { display: block; font-weight: 700; font-size: 14px; }
.dash-alert__hint { display: block; font-size: 12px; opacity: .8; }
.dash-alert__chevron { margin-left: auto; display: flex; }
.dash-alert--warning { background: var(--warning-soft); border: 1px solid #fde68a; color: #92400e; }
.dash-alert--warning .dash-alert__icon { background: #f59e0b; }
.dash-alert__body { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.dash-alert__list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dash-alert__list li { font-size: 13px; line-height: 1.4; }
.dash-alert__list a { text-decoration: underline; }
.dash-alert__list a:hover { text-decoration: none; }
.dash-alert--orange { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.dash-alert--orange .dash-alert__icon { background: #f97316; }
.dash-alert--danger { background: var(--danger-soft); border: 1px solid #fca5a5; color: #991b1b; }
.dash-alert--danger .dash-alert__icon { background: var(--danger); }

/* Cores das etapas do funil: por classe (nunca hex em template) */
.dash-card__foot-value { font-weight: 700; color: var(--success); }

/* ── Funil do Pipeline de Contratos (dono, 2026-10-03) ──
   Faixas empilhadas com largura proporcional ao maior estágio, centralizadas,
   com chevron entre elas. Tom 700 em cada status para manter o texto branco
   acima de 4.5:1 (o tom 500 dos dots não garante contraste). */
.dash-funnel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.dash-funnel__step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 152px;
    padding: 9px 14px;
    border-radius: 9px;
    color: #fff;
    text-decoration: none;
    background-image: linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,0) 55%);
    transition: transform .15s ease, filter .15s ease, box-shadow .15s ease;
}
.dash-funnel__step:hover {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.07);
    box-shadow: var(--shadow-md);
}
.dash-funnel__step:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.dash-funnel__label {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-funnel__count {
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.dash-funnel__arrow {
    display: flex;
    justify-content: center;
    height: 12px;
    color: var(--muted);
    opacity: .65;
}
.dash-funnel__arrow svg { width: 14px; height: 14px; }
.dash-funnel__step--warning { background-color: #b45309; }
.dash-funnel__step--orange { background-color: #c2410c; }
.dash-funnel__step--success { background-color: #15803d; }
.dash-funnel__step--indigo { background-color: #4f46e5; }
.dash-funnel__step--danger { background-color: #b91c1c; }

/* Funil financeiro: o valor em R$ precisa caber na faixa estreita */
.dash-funnel--moeda .dash-funnel__count { font-size: 14px; }
.dash-funnel--moeda .dash-funnel__label { font-size: 10.5px; letter-spacing: .02em; }
.dash-funnel--moeda .dash-funnel__step { padding: 9px 12px; }

/* ── Blocos de estatística (Aprendizes) ── */
.dash-stats { display: flex; flex-direction: column; gap: 8px; }
.dash-stats--row { flex-direction: row; flex-wrap: wrap; }
.dash-stats--row > .dash-stat { flex: 1 1 180px; }
.dash-stat {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-radius: var(--radius);
}
.dash-stat__icon { font-size: 18px; }
.dash-stat__label {
    display: block; font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: .3px;
}
.dash-stat__value { display: block; font-size: 22px; font-weight: 800; }
.dash-stat--success { background: var(--success-soft); }
.dash-stat--success .dash-stat__label, .dash-stat--success .dash-stat__value { color: var(--success); }
.dash-stat--primary { background: var(--primary-soft); }
.dash-stat--primary .dash-stat__label, .dash-stat--primary .dash-stat__value { color: var(--primary); }
.dash-stat--warning { background: #fef9c3; }
.dash-stat--warning .dash-stat__label, .dash-stat--warning .dash-stat__value { color: #b45309; }
.dash-stat--danger { background: var(--danger-soft); }
.dash-stat--danger .dash-stat__label, .dash-stat--danger .dash-stat__value { color: var(--danger); }
.dash-stat--orange { background: #fff7ed; }
.dash-stat--orange .dash-stat__label, .dash-stat--orange .dash-stat__value { color: #c2410c; }
.dash-stat--indigo { background: var(--indigo-soft); }
.dash-stat--indigo .dash-stat__label, .dash-stat--indigo .dash-stat__value { color: var(--indigo); }
/* Caixa de estatística clicável (card Gov.Br) — mesma caixa, com alvo de link */
a.dash-stat { text-decoration: none; color: inherit; transition: filter .15s ease, box-shadow .15s ease; }
a.dash-stat:hover { color: inherit; filter: brightness(.97); box-shadow: var(--shadow-md); }
a.dash-stat:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Tabelas ── */
.dash-table-wrap { overflow: auto; }
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table th {
    padding: 8px 12px; text-align: left; font-size: 11px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: .5px;
    border-bottom: 2px solid var(--border); white-space: nowrap;
}
.dash-table td { padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.dash-table tbody tr:last-child td { border-bottom: 0; }
.dash-table__num { font-weight: 600; color: #1e293b; }
.dash-table__muted { color: #4b5563; }
.dash-table__center { text-align: center; }
.dash-table__cnpj { color: #6b7280; font-size: 12px; white-space: nowrap; }
.dash-table__sub { display: block; color: var(--muted); font-size: 11px; }
.dash-table__action { color: var(--primary); text-decoration: none; font-weight: 500; font-size: 12px; white-space: nowrap; }
.dash-table__action:hover { text-decoration: underline; }
.dash-table__company { text-decoration: none; color: #1e293b; font-weight: 500; }
.dash-table__company:hover { text-decoration: underline; }
.dash-badge {
    display: inline-block; padding: 3px 10px; border-radius: 10px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.dash-badge--warning { background: #fef9c3; color: #b45309; }
.dash-badge--orange { background: #fff7ed; color: #c2410c; }
.dash-badge--success { background: var(--success-soft); color: var(--success); }

/* ── Acesso Rápido ── */
.dash-section-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; color: #1e293b; }
.dash-links {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px;
}
.dash-link {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    text-decoration: none; color: #374151; font-size: 13px; font-weight: 500;
    transition: box-shadow .15s, transform .15s;
}
.dash-link:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dash-link__icon {
    width: 32px; height: 32px; border-radius: var(--radius); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.dash-link__icon--amber { background: #fef3c7; color: #d97706; }
.dash-link__icon--purple { background: #ede9fe; color: #7c3aed; }
.dash-link__icon--cyan { background: #cffafe; color: #0891b2; }
.dash-link__icon--primary { background: var(--primary-soft); color: var(--primary); }
.dash-link__icon--emerald { background: #d1fae5; color: #059669; }
.dash-link__icon--red { background: #fee2e2; color: #dc2626; }
.dash-link__icon--blue { background: #dbeafe; color: #2563eb; }
.page-head__actions { display: flex; gap: 8px; }

/* ============================================================
   Gráficos em CSS puro — Evolução + Empresas com Mais Contratos
   A casca dos cards é a .dash-card (acima). Sem Chart.js: a única
   propriedade inline que sobra é a ALTURA do segmento (`height:%`),
   que é dado calculado — estaticamente tudo aqui é classe.
   ============================================================ */

/* ── Evolução de contratos: uma coluna empilhada por mês ── */
/* 6 colunas (dono, 2026-10-03): gap menor para as 6 pilhas caberem no card */
.chart-bars {
    height: 300px; display: flex; align-items: flex-end;
    gap: 18px; padding: 2px 6px;
}
.chart-bars__col {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: flex-end; height: 100%; min-width: 0;
}
/* Pilha de segmentos: altura fixa = 100% da escala do gráfico */
.chart-bars__stack {
    position: relative; width: 100%; max-width: 92px; height: 240px;
    display: flex; flex-direction: column; align-items: center;
    justify-content: flex-end; gap: 2px; border-bottom: 1px solid var(--border);
}
/* O NÚMERO SEMPRE DENTRO DA COR (dono, 2026-10-03): min-height garante
   espaço para o texto e a fonte escala conforme a altura do segmento. */
.chart-bars__seg {
    width: 100%; min-height: 14px; color: #fff;
    text-shadow: 0 1px 2px rgba(15, 23, 42, .35);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; line-height: 1;
}
.chart-bars__seg--celebradas { background: rgba(26, 115, 232, .85); border-radius: 5px 5px 0 0; }
.chart-bars__seg--desligadas { background: rgba(217, 48, 37, .85); border-radius: 5px 5px 0 0; }
/* Desligados empilhado sobre celebrados = sem arredondamento no topo */
.chart-bars__seg--empilhado { border-radius: 0; }
.chart-bars__num--12 { font-size: 12px; }
.chart-bars__num--10 { font-size: 10px; }
.chart-bars__num--9  { font-size: 9px; }
.chart-bars__label { margin-top: 8px; font-size: 12px; color: var(--muted); font-weight: 600; text-align: center; }

/* ── Legenda ── */
.chart-legend { display: flex; gap: 16px; justify-content: center; margin-top: 12px; font-size: 11px; }
.chart-legend__item { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend__swatch { width: 10px; height: 10px; border-radius: 3px; }
.chart-legend__swatch--celebradas { background: rgba(26, 115, 232, .85); }
.chart-legend__swatch--desligadas { background: rgba(217, 48, 37, .85); }

/* ── Empresas com mais contratos: barras horizontais ── */
.chart-hbars { display: flex; flex-direction: column; gap: 6px; }
/* --fill: distribui as barras pela altura do card (sem faixa em branco) */
.chart-hbars--fill { flex: 1 1 auto; justify-content: flex-start; }
.chart-hbars__row {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    color: inherit; padding: 4px 8px; border-radius: var(--radius);
    transition: background .1s;
}
.chart-hbars__row:hover { background: var(--primary-soft); }
.chart-hbars__label {
    flex: 0 0 42%; max-width: 160px; font-size: 13px; color: #374151;
    font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chart-hbars__track { flex: 1; height: 18px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.chart-hbars__fill { display: block; height: 100%; background: rgba(26, 115, 232, .85); border-radius: 5px; }
.chart-hbars__fill--verde { background: rgba(34, 197, 94, .85); }
.chart-hbars__fill--azul { background: rgba(26, 115, 232, .85); }
.chart-hbars__value { flex: 0 0 36px; text-align: right; font-size: 13px; font-weight: 700; color: #1e293b; }

/* Garante que o atributo hidden sempre vença sobre display de componentes */
[hidden] { display: none !important; }

/* ---- Matriz de frequência (visual alinhado ao Demonstrativo Mensal · 2026-10-16) ---- */
.freq-modal {
    position: fixed; inset: 0; z-index: 10000;
    background: rgba(15, 23, 42, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.freq-modal__content {
    width: min(100%, 520px); max-height: 90vh; overflow-y: auto;
    padding: 24px; background: var(--surface, #fff);
    border-radius: 12px; box-shadow: 0 18px 48px rgba(15, 23, 42, .25);
}
.freq-modal__content h3 { margin: 0 0 16px; }
.freq-modal__dados {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
    margin: 0 0 18px; padding: 14px; background: var(--bg, #f8fafc); border-radius: 8px;
}
.freq-modal__dados div { min-width: 0; }
.freq-modal__dados dt { color: var(--muted, #64748b); font-size: 11px; }
.freq-modal__dados dd { margin: 3px 0 0; color: var(--text, #1e293b); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.freq-modal__fieldset { display: grid; gap: 10px; margin: 0 0 14px; padding: 12px; border: 1px solid var(--border, #e2e8f0); border-radius: 8px; }
.freq-modal__fieldset label { display: flex; align-items: center; gap: 8px; }
.freq-modal__content > label { display: block; margin-bottom: 6px; }
.freq-modal__content > input[type="date"],
.freq-modal__fieldset select,
.freq-modal__fieldset input[type="time"] { width: 100%; min-height: 40px; padding: 8px; }
.freq-modal__aviso { margin: 12px 0; color: var(--muted, #64748b); font-size: 12px; }
.curso-agendado { color: #9a6700; font-weight: 600; }
@media (max-width: 520px) {
    .freq-modal__content { padding: 18px; }
    .freq-modal__dados { grid-template-columns: 1fr; }
}

.freq-table { border-collapse: collapse; font-size: 13px; }
.freq-table th,
.freq-table td { padding: 6px 8px; font-size: 13px; }
.freq-table thead th {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #666;
    white-space: nowrap;
}
.freq-table .col-contrato {
    width: 80px;
    text-align: center;
    font-weight: 600;
    color: #666;
}
.freq-table .col-aprendiz {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.freq-table .col-dia { width: 36px; text-align: center; padding: 4px 2px; }
.freq-table .col-dia .badge { margin: 0 1px; }
.freq-table tbody tr:hover td { background-color: #f8fafc; }
.freq-table tbody td[style*="background:#fff"]:hover { background-color: #f8fafc; }

/* Badges de frequência (matriz) — redesign pastel (dono, 2026-10-17):
   quadrado menor (24px), cantos suaves, fundo pastel + texto escuro da mesma família. */
.freq-table td .attendance-badge,
td .attendance-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    margin: 0 2px !important;
    padding: 0 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    border: none !important;
    transition: transform .2s ease, box-shadow .2s ease;
}

.freq-table td .attendance-badge:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.freq-table td .attendance-badge.status-PRESENTE,
td .attendance-badge.status-PRESENTE {
    background-color: #d1fae5 !important; /* verde pastel */
    color: #065f46 !important;            /* verde escuro */
    border: none !important;
}

.freq-table td .attendance-badge.status-AUSENTE,
td .attendance-badge.status-AUSENTE {
    background-color: #fecaca !important; /* vermelho pastel */
    color: #991b1b !important;            /* vermelho escuro */
    border: none !important;
}

.freq-table td .attendance-badge.status-JUSTIFICADO,
td .attendance-badge.status-JUSTIFICADO {
    background-color: #bfdbfe !important; /* azul pastel */
    color: #1e40af !important;            /* azul escuro */
    border: none !important;
}

.freq-table td .attendance-badge.status-FERIADO,
td .attendance-badge.status-FERIADO,
.freq-table td .attendance-badge.status-PONTE,
td .attendance-badge.status-PONTE {
    background-color: #fde68a !important; /* amarelo pastel */
    color: #92400e !important;            /* âmbar escuro */
    border: none !important;
}

.freq-table td .attendance-badge.status-vazio,
td .attendance-badge.status-vazio {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    border: none !important;
}

.badge-desligado {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    background-color: #fee2e2;
    color: #dc2626;
    font-size: 10px;
    font-weight: 600;
    border-radius: 4px;
    white-space: nowrap;
}

.attendance-badge.blocked {
    background-color: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

/* Demonstrativo Financeiro Mensal — desligados antecipados (dono, 2026-10-17) */
.linha-desligado-antecipado {
    background-color: #fff3cd;
}
.linha-desligado-antecipado td {
    color: #92400e;
}
.linha-residual td {
    background-color: #ffdfe4;
    color: #991b1b;
    font-style: italic;
    font-size: 11px;
    padding: 3px 8px;
}
