/* ==========================================================================
   Portal de Vagas AGEX — Componentes do painel administrativo
   Todos os valores vêm de tokens.css. Não escreva cores/raios/sombras aqui.
   ========================================================================== */

/* --- Reset e base ------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    font-weight: var(--fw-regular);
    line-height: var(--lh-normal);
    color: var(--text-default);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: var(--fw-semibold); color: var(--text-strong); line-height: var(--lh-tight); }
p { margin: 0 0 var(--sp-3); }
p:last-child { margin-bottom: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img, svg { max-width: 100%; }
svg { flex-shrink: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--sp-5) 0; }
small { font-size: var(--fs-xs); }

/* Foco visível e consistente — nunca remova sem substituir */
:focus-visible {
    outline: 2px solid var(--info);
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* Conteúdo para leitores de tela */
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; top: -100px; left: var(--sp-4); z-index: var(--z-toast);
    background: var(--accent); color: var(--text-on-brand);
    padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); font-weight: var(--fw-medium);
}
.skip-link:focus { top: var(--sp-4); text-decoration: none; }

/* --- Estrutura ---------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    margin-left: var(--sidebar-w);
}

.app-content {
    flex: 1;
    padding: var(--content-pad);
    max-width: var(--content-max);
    width: 100%;
}

/* --- Menu lateral ------------------------------------------------------- */
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-w);
    background: var(--bg-sidebar);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    z-index: var(--z-drawer);
    transition: transform var(--dur-base) var(--ease);
}

.sidebar__brand {
    padding: var(--sp-5) var(--sp-5) var(--sp-4);
    flex-shrink: 0;
}
.sidebar__logo { display: block; line-height: 0; }
.sidebar__logo img { width: 130px; height: auto; display: block; }
.sidebar__system {
    display: block;
    margin-top: var(--sp-3);
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(184, 212, 216, 0.62);
}

.sidebar__cta { padding: 0 var(--sp-5) var(--sp-5); flex-shrink: 0; }
.sidebar__cta .btn { min-height: 44px; font-weight: var(--fw-semibold); }

.sidebar__nav {
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--sp-3) var(--sp-4);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
.sidebar__nav::-webkit-scrollbar { width: 6px; }
.sidebar__nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: var(--radius-full); }

.sidebar__group { margin-bottom: var(--sp-5); }
.sidebar__group:last-child { margin-bottom: 0; }
.sidebar__group-label {
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(184, 212, 216, 0.45);
    padding: 0 var(--sp-3);
    margin: var(--sp-2) 0 var(--sp-3);
}

.sidebar__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border-radius: var(--radius-sm);
    color: var(--brand-dark-text);
    font-size: var(--fs-md);
    font-weight: var(--fw-regular);
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
    margin-bottom: 2px;
    min-height: 44px;
}
.sidebar__link:hover { background: var(--brand-dark-700); color: #FFFFFF; text-decoration: none; }
.sidebar__link:focus-visible { outline-color: var(--brand-teal-300); }
.sidebar__link.is-active {
    background: var(--brand-dark-600);
    color: #FFFFFF;
    font-weight: var(--fw-medium);
}
/* Barra de destaque do item ativo, como na Central de Tickets */
.sidebar__link.is-active::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 24px;
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    background: var(--brand-teal-300);
}
.sidebar__link svg { opacity: 0.9; flex-shrink: 0; }
.sidebar__link.is-active svg { opacity: 1; }
.sidebar__link-label { flex: 1; min-width: 0; }
.sidebar__badge {
    background: var(--accent);
    color: var(--text-on-brand);
    font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold);
    padding: 2px var(--sp-2);
    border-radius: var(--radius-full);
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar__footer {
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.sidebar__user {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: var(--sp-2);
    border-radius: var(--radius-sm);
    color: var(--text-on-dark);
}
.sidebar__user-info { min-width: 0; }
.sidebar__user-name { font-size: var(--fs-base); font-weight: var(--fw-medium); color: #FFFFFF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar__user-role { font-size: var(--fs-2xs); color: rgba(233, 241, 243, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar__backdrop { display: none; }

/* --- Barra superior ----------------------------------------------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    min-height: var(--topbar-h);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: 0 var(--content-pad);
    flex-shrink: 0;
}
.topbar__toggle {
    display: none;
    background: none; border: 0; padding: var(--sp-2);
    color: var(--text-default); cursor: pointer; border-radius: var(--radius-sm);
}
.topbar__toggle:hover { background: var(--bg-muted); }

.topbar__search { position: relative; display: flex; align-items: center; width: min(320px, 42vw); }
.topbar__search svg { position: absolute; left: var(--sp-3); color: var(--text-subtle); pointer-events: none; }
.topbar__search-input {
    width: 100%;
    min-height: 40px;
    padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-8);
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text-strong);
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.topbar__search-input::placeholder { color: var(--text-subtle); }
.topbar__search-input:focus {
    outline: none;
    border-color: var(--brand-teal);
    box-shadow: var(--ring-focus);
}

.topbar__actions { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }

.topbar__user {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-1);
    background: none; border: 1px solid transparent; border-radius: var(--radius-full);
    color: var(--text-muted); cursor: pointer;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.topbar__user:hover { background: var(--bg-muted); border-color: var(--border); }

.topbar__bell {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: none; border: 0; border-radius: var(--radius-full);
    color: var(--text-muted); cursor: pointer;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.topbar__bell:hover { background: var(--bg-muted); color: var(--text-strong); }
.topbar__bell-count {
    position: absolute; top: 2px; right: 2px;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: grid; place-items: center;
    background: var(--accent); color: var(--text-on-brand);
    border: 2px solid var(--bg-surface);
    border-radius: var(--radius-full);
    font-size: 10px; font-weight: var(--fw-semibold); line-height: 1;
}

/* --- Breadcrumbs -------------------------------------------------------- */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--sp-4); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs__sep { color: var(--text-subtle); }
.breadcrumbs [aria-current="page"] { color: var(--text-default); font-weight: var(--fw-medium); }

/* --- Cabeçalho de página ------------------------------------------------ */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5);
}
.page-head__title { font-size: var(--fs-2xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; }
.page-head__title--display { font-family: var(--font-display); font-weight: var(--fw-medium); }
.page-head__subtitle { color: var(--text-muted); font-size: var(--fs-md); margin-top: var(--sp-1); }
.page-head__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* --- Cartões ------------------------------------------------------------ */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
}
.card__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: var(--sp-3); padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--border-subtle);
}
.card__title { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.card__title svg { color: var(--text-muted); }
.card__subtitle { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.card__body { padding: var(--sp-5); }
.card__body--flush { padding: 0; }
.card__footer { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border-subtle); background: var(--bg-surface-alt); border-radius: 0 0 var(--radius-md) var(--radius-md); }

/* --- Indicadores -------------------------------------------------------- */
.stat-grid {
    display: grid;
    /* 150px acomoda os sete indicadores em uma única faixa no desktop,
       como na Central de Tickets, e quebra sozinho em telas menores. */
    grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
}
.stat-grid > * { min-width: 0; }

.stat {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--sp-4);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
    display: block;
    color: inherit;
    text-decoration: none;
}
a.stat:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); text-decoration: none; }

.stat__label {
    display: flex; align-items: center; gap: var(--sp-2);
    font-size: var(--fs-xs);
    font-weight: var(--fw-regular);
    color: var(--text-muted);
}
.stat__label svg { color: var(--text-subtle); }
.stat__value {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--text-strong);
    line-height: 1.15;
    margin-top: var(--sp-2);
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.stat__meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: var(--sp-2); }
.stat__meta strong { color: var(--text-default); font-weight: var(--fw-medium); }

/* Cores por natureza do indicador, como na Central de Tickets */
.stat--teal   .stat__value { color: var(--brand-teal); }
.stat--accent .stat__value { color: var(--accent); }
.stat--danger .stat__value { color: var(--danger); }
.stat--success .stat__value { color: var(--success); }

/* --- Botões ------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    padding: 0 var(--sp-4);
    min-height: 40px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--fs-base);
    font-weight: var(--fw-medium);
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; }

.btn--primary { background: var(--accent); color: var(--text-on-brand); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--text-on-brand); }
.btn--primary:active { background: var(--accent-active); }
.btn--primary:focus-visible { box-shadow: var(--ring-accent); outline-color: var(--accent); }

.btn--secondary { background: var(--bg-surface); color: var(--text-default); border-color: var(--border-strong); }
.btn--secondary:hover { background: var(--bg-muted); color: var(--text-strong); }

.btn--dark { background: var(--brand-dark); color: #FFFFFF; border-color: var(--brand-dark); }
.btn--dark:hover { background: var(--brand-dark-600); color: #FFFFFF; }

.btn--teal { background: var(--brand-teal); color: #FFFFFF; border-color: var(--brand-teal); }
.btn--teal:hover { background: var(--brand-teal-600); border-color: var(--brand-teal-600); color: #FFFFFF; }
.btn--teal:focus-visible { box-shadow: var(--ring-focus); }

.btn--ghost { background: transparent; color: var(--text-muted); border-color: transparent; }
.btn--ghost:hover { background: var(--bg-muted); color: var(--text-strong); }

.btn--danger { background: var(--danger); color: #FFFFFF; border-color: var(--danger); }
.btn--danger:hover { background: #A32B23; color: #FFFFFF; }
.btn--danger:focus-visible { box-shadow: var(--ring-danger); }

.btn--danger-soft { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.btn--danger-soft:hover { background: var(--danger); color: #FFFFFF; }

.btn--success { background: var(--success); color: #FFFFFF; border-color: var(--success); }
.btn--success:hover { background: #126732; color: #FFFFFF; }

.btn--sm { min-height: 30px; padding: 0 var(--sp-3); font-size: var(--fs-xs); }
.btn--sm svg { width: 14px; height: 14px; }
.btn--lg { min-height: 46px; padding: 0 var(--sp-6); font-size: var(--fs-md); }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 34px; min-height: 34px; }
.btn--icon.btn--sm { width: 30px; min-height: 30px; }

/* --- Formulários -------------------------------------------------------- */
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--sp-4) var(--sp-5); }
/* Itens de grade têm min-width:auto e um conteúdo largo empurraria a coluna */
.form-grid > * { min-width: 0; }
.col-12 { grid-column: span 12; }
.col-9  { grid-column: span 9; }
.col-8  { grid-column: span 8; }
.col-7  { grid-column: span 7; }
.col-6  { grid-column: span 6; }
.col-5  { grid-column: span 5; }
.col-4  { grid-column: span 4; }
.col-3  { grid-column: span 3; }

.field { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-strong); }
.field__label .req { color: var(--danger); margin-left: 2px; }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__error { font-size: var(--fs-xs); color: var(--danger); font-weight: var(--fw-medium); display: flex; align-items: center; gap: var(--sp-1); }

.input, .select, .textarea {
    width: 100%;
    min-height: 38px;
    padding: var(--sp-2) var(--sp-3);
    font-family: inherit;
    font-size: var(--fs-base);
    color: var(--text-strong);
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--gray-400); }
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--ring-accent);
}
.input:disabled, .select:disabled, .textarea:disabled { background: var(--bg-muted); color: var(--text-muted); cursor: not-allowed; }
.input.is-invalid, .select.is-invalid, .textarea.is-invalid { border-color: var(--danger); }
.input.is-invalid:focus, .textarea.is-invalid:focus { box-shadow: var(--ring-danger); }

.textarea { min-height: 96px; resize: vertical; line-height: var(--lh-normal); }

.select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B7684' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--sp-3) center;
    padding-right: var(--sp-8);
}

.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: 0; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.input-icon { position: relative; }
.input-icon svg { position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%); color: var(--text-subtle); width: 16px; height: 16px; pointer-events: none; }
.input-icon .input { padding-left: var(--sp-8); }

.checkbox, .radio { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; font-size: var(--fs-base); color: var(--text-default); line-height: var(--lh-snug); }
.checkbox input, .radio input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.checkbox--card {
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: var(--sp-3); transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.checkbox--card:hover { border-color: var(--gray-400); background: var(--bg-surface-alt); }
.checkbox--card:has(input:checked) { border-color: var(--accent); background: var(--brand-orange-050); }

.switch { display: inline-flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
    width: 38px; height: 22px; border-radius: var(--radius-full);
    background: var(--gray-300); position: relative; flex-shrink: 0;
    transition: background var(--dur-base) var(--ease);
}
.switch__track::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 18px; height: 18px; border-radius: 50%;
    background: #FFFFFF; box-shadow: var(--shadow-sm);
    transition: transform var(--dur-base) var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring-accent); }

fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-6); }
fieldset:last-child { margin-bottom: 0; }
legend {
    padding: 0; margin-bottom: var(--sp-4); font-size: var(--fs-sm);
    font-weight: var(--fw-semibold); color: var(--text-strong);
    text-transform: uppercase; letter-spacing: 0.06em;
}

.form-actions {
    display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap;
    padding-top: var(--sp-5); margin-top: var(--sp-5); border-top: 1px solid var(--border-subtle);
}
.form-actions--sticky {
    position: sticky; bottom: 0; background: var(--bg-surface);
    padding: var(--sp-4) var(--sp-5); margin: var(--sp-5) calc(var(--sp-5) * -1) calc(var(--sp-5) * -1);
    border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    box-shadow: 0 -4px 12px rgba(16, 36, 46, 0.04);
    z-index: 5;
}

/* --- Filtros ------------------------------------------------------------ */
.filters {
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: var(--sp-4);
    margin-bottom: var(--sp-4); box-shadow: var(--shadow-xs);
}
.filters__row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: flex-end; }
.filters__field { flex: 1 1 180px; min-width: 0; }
.filters__field--search { flex: 2 1 260px; }
.filters__actions { display: flex; gap: var(--sp-2); }
.filters__summary { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px dashed var(--border); font-size: var(--fs-xs); color: var(--text-muted); }

.chip {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    padding: 3px var(--sp-3); border-radius: var(--radius-full);
    background: var(--bg-muted); color: var(--text-default);
    font-size: var(--fs-xs); font-weight: var(--fw-medium);
}
.chip a { color: var(--text-muted); display: inline-flex; line-height: 0; }
.chip a:hover { color: var(--danger); }

/* --- Abas --------------------------------------------------------------- */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-4); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs__item {
    padding: var(--sp-3) var(--sp-4); font-size: var(--fs-base); font-weight: var(--fw-medium);
    color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap;
    text-decoration: none; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
    display: inline-flex; align-items: center; gap: var(--sp-2);
}
.tabs__item:hover { color: var(--text-strong); text-decoration: none; border-bottom-color: var(--border-strong); }
.tabs__item.is-active { color: var(--accent-active); border-bottom-color: var(--accent); }
.tabs__count {
    background: var(--bg-muted); color: var(--text-muted); font-size: var(--fs-2xs);
    font-weight: var(--fw-semibold); padding: 1px var(--sp-2); border-radius: var(--radius-full); min-width: 20px; text-align: center;
}
.tabs__item.is-active .tabs__count { background: var(--accent-soft); color: var(--accent-active); }

/* --- Tabelas ------------------------------------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Tabela que se ajusta à largura disponível em vez de empurrar uma barra de
   rolagem horizontal.
   Com table-layout auto, a largura mínima de cada coluna é a do seu conteúdo:
   um e-mail comprido ou um status de nome longo esticam a tabela inteira. Com
   fixed, as proporções do <colgroup> mandam e o texto que não couber é cortado
   com reticências. */
.table--ajustada { table-layout: fixed; }
.table--ajustada td > .truncate,
.table--ajustada .cell-strong,
.table--ajustada .cell-muted { max-width: 100%; }
.table--ajustada .person__name,
.table--ajustada .person__meta,
.table--ajustada .cell-strong {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
/* A coluna de ações não encolhe: botão cortado pela metade é pior que texto
   truncado, porque deixa de ser clicável. */
.table--ajustada .cell-actions { width: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th, .table td { padding: var(--sp-3) var(--sp-4); text-align: left; vertical-align: middle; }
.table thead th {
    font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.05em;
    background: var(--bg-surface-alt); border-bottom: 1px solid var(--border);
    white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.table thead th a { color: inherit; display: inline-flex; align-items: center; gap: var(--sp-1); }
.table thead th a:hover { color: var(--text-strong); text-decoration: none; }
.table tbody tr { border-bottom: 1px solid var(--border-subtle); transition: background var(--dur-fast) var(--ease); }
.table tbody tr:last-child { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-surface-alt); }
.table td { color: var(--text-default); }
.table .cell-strong { color: var(--text-strong); font-weight: var(--fw-medium); }
.table .cell-muted { color: var(--text-muted); font-size: var(--fs-sm); }
.table .cell-num { text-align: right; font-variant-numeric: tabular-nums; }
.table .cell-actions { text-align: right; white-space: nowrap; width: 1%; }
.table .cell-actions .btn + .btn { margin-left: var(--sp-1); }

/* Identidade de pessoa dentro da tabela */
.person { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: var(--bg-muted); color: var(--text-default);
    display: grid; place-items: center;
    font-size: var(--fs-xs); font-weight: var(--fw-semibold); letter-spacing: 0.02em;
}
.avatar--sm { width: 26px; height: 26px; font-size: var(--fs-2xs); }
.avatar--lg { width: 52px; height: 52px; font-size: var(--fs-md); }
.avatar--accent { background: var(--accent-soft); color: var(--accent-active); }
.avatar--dark { background: var(--brand-dark); color: #FFFFFF; }
.person__body { min-width: 0; }
.person__name { font-weight: var(--fw-medium); color: var(--text-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person__meta { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- Badges ------------------------------------------------------------- */
.badge {
    display: inline-flex; align-items: center; gap: var(--sp-2);
    padding: 2px var(--sp-3); border-radius: var(--radius-full);
    font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap;
    border: 1px solid transparent; line-height: 1.6;
}
.badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.badge--neutral { background: var(--bg-muted); color: var(--text-muted); border-color: var(--border); }
.badge--success { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge--warning { background: var(--warning-bg); color: var(--warning); border-color: var(--warning-border); }
.badge--danger  { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.badge--info    { background: var(--info-bg); color: var(--info); border-color: var(--info-border); }
.badge--accent  { background: var(--accent-soft); color: var(--accent-active); border-color: var(--brand-orange-100); }
.badge--new     { background: var(--accent); color: var(--text-on-brand); border-color: var(--accent); }

/* Badge de status da candidatura: a cor vem do banco, via style inline */
.badge--status { background: color-mix(in srgb, var(--status-color) 12%, white); color: var(--status-color); border-color: color-mix(in srgb, var(--status-color) 30%, white); }

/* --- Alertas ------------------------------------------------------------ */
.alert {
    display: flex; gap: var(--sp-3); align-items: flex-start;
    padding: var(--sp-4); border-radius: var(--radius-md);
    border: 1px solid; font-size: var(--fs-base); margin-bottom: var(--sp-4);
}
.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert__title { font-weight: var(--fw-semibold); margin-bottom: var(--sp-1); }
.alert__body { min-width: 0; }
.alert--info { background: var(--info-bg); border-color: var(--info-border); color: #14417F; }
.alert--success { background: var(--success-bg); border-color: var(--success-border); color: #10592C; }
.alert--warning { background: var(--warning-bg); border-color: var(--warning-border); color: #8A3F07; }
.alert--danger { background: var(--danger-bg); border-color: var(--danger-border); color: #8F2721; }

/* --- Toasts ------------------------------------------------------------- */
.toasts { position: fixed; top: var(--sp-5); right: var(--sp-5); z-index: var(--z-toast); display: flex; flex-direction: column; gap: var(--sp-3); max-width: 380px; }
.toast {
    display: flex; gap: var(--sp-3); align-items: flex-start;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-left: 3px solid var(--info);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    padding: var(--sp-4); font-size: var(--fs-base); color: var(--text-default);
    animation: toast-in var(--dur-slow) var(--ease-out);
}
.toast--sucesso { border-left-color: var(--success); }
.toast--erro { border-left-color: var(--danger); }
.toast--aviso { border-left-color: var(--warning); }
.toast__icon { flex-shrink: 0; margin-top: 1px; }
.toast--sucesso .toast__icon { color: var(--success); }
.toast--erro .toast__icon { color: var(--danger); }
.toast--aviso .toast__icon { color: var(--warning); }
.toast--info .toast__icon { color: var(--info); }
.toast__body { flex: 1; min-width: 0; }
.toast__close { background: none; border: 0; color: var(--text-subtle); cursor: pointer; padding: 0; line-height: 0; }
.toast__close:hover { color: var(--text-strong); }
.toast.is-leaving { animation: toast-out var(--dur-base) var(--ease) forwards; }

@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(24px); } }

/* --- Estado vazio ------------------------------------------------------- */
.empty { text-align: center; padding: var(--sp-12) var(--sp-6); color: var(--text-muted); }
.empty__icon {
    width: 52px; height: 52px; border-radius: var(--radius-lg);
    background: var(--bg-muted); color: var(--text-subtle);
    display: grid; place-items: center; margin: 0 auto var(--sp-4);
}
.empty__title { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); margin-bottom: var(--sp-2); }
.empty__text { max-width: 420px; margin: 0 auto var(--sp-5); font-size: var(--fs-base); }

/* --- Skeleton ----------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-050) 50%, var(--gray-100) 75%);
    background-size: 200% 100%;
    animation: skeleton 1.4s ease-in-out infinite;
    border-radius: var(--radius-xs);
}
.skeleton--text { height: 12px; margin-bottom: var(--sp-2); }
.skeleton--title { height: 20px; width: 40%; margin-bottom: var(--sp-3); }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* --- Paginação ---------------------------------------------------------- */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border-subtle); }
.pagination__info { font-size: var(--fs-xs); color: var(--text-muted); }
.pagination__info strong { color: var(--text-default); font-weight: var(--fw-medium); }
.pagination__nav { display: flex; gap: var(--sp-1); align-items: center; }
.pagination__link {
    min-width: 32px; height: 32px; padding: 0 var(--sp-2);
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: var(--fs-sm); color: var(--text-default); background: var(--bg-surface);
    transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.pagination__link:hover { background: var(--bg-muted); text-decoration: none; border-color: var(--border-strong); }
.pagination__link.is-active { background: var(--accent); border-color: var(--accent); color: var(--text-on-brand); font-weight: var(--fw-medium); }
.pagination__link.is-disabled { opacity: 0.4; pointer-events: none; }
.pagination__gap { padding: 0 var(--sp-1); color: var(--text-subtle); }

/* --- Modal -------------------------------------------------------------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(16, 36, 46, 0.55);
    backdrop-filter: blur(2px); z-index: var(--z-modal);
    display: grid; place-items: center; padding: var(--sp-4);
    animation: fade-in var(--dur-base) var(--ease);
}
.modal {
    background: var(--bg-surface); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl); width: 100%; max-width: 520px;
    max-height: calc(100vh - var(--sp-8));
    display: flex; flex-direction: column;
    animation: modal-in var(--dur-slow) var(--ease-out);
}
.modal--lg { max-width: 760px; }
.modal--xl { max-width: 980px; }
.modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-5); border-bottom: 1px solid var(--border-subtle); flex-shrink: 0; }
.modal__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); }
.modal__subtitle { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.modal__close { background: none; border: 0; color: var(--text-muted); cursor: pointer; padding: var(--sp-1); line-height: 0; border-radius: var(--radius-xs); }
.modal__close:hover { background: var(--bg-muted); color: var(--text-strong); }
.modal__body { padding: var(--sp-5); overflow-y: auto; flex: 1; }
.modal__footer { display: flex; gap: var(--sp-3); justify-content: flex-end; padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border-subtle); background: var(--bg-surface-alt); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-shrink: 0; flex-wrap: wrap; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }

/* --- Drawer (gaveta) ---------------------------------------------------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(16, 36, 46, 0.5); z-index: var(--z-drawer); animation: fade-in var(--dur-base) var(--ease); }
.drawer {
    position: fixed; top: 0; bottom: 0; right: 0; width: min(420px, 92vw);
    background: var(--bg-surface); box-shadow: var(--shadow-xl);
    z-index: calc(var(--z-drawer) + 1); display: flex; flex-direction: column;
    animation: drawer-in var(--dur-slow) var(--ease-out);
}
.drawer--left { right: auto; left: 0; animation: drawer-in-left var(--dur-slow) var(--ease-out); }
.drawer__header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--sp-5); }
.drawer__footer { padding: var(--sp-4) var(--sp-5); border-top: 1px solid var(--border); background: var(--bg-surface-alt); flex-shrink: 0; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes drawer-in-left { from { transform: translateX(-100%); } to { transform: none; } }

/* --- Menu suspenso ------------------------------------------------------ */
.dropdown { position: relative; display: inline-flex; }
.dropdown__menu {
    /* Fixed, e não absolute.
       Estes menus abrem dentro de tabelas que rolam na horizontal
       (.table-wrap tem overflow-x: auto). Um elemento absolute é recortado
       pelo contêiner que rola: em vez de flutuar por cima da tela, o menu
       ficava cortado e ainda empurrava uma barra de rolagem dentro da lista.
       Fixed tira o menu do alcance de qualquer ancestral que corte conteúdo.

       A contrapartida é que fixed ignora a posição do botão, então as
       coordenadas são calculadas em app.js a partir do retângulo do gatilho —
       inclusive virando o menu para cima quando não há espaço embaixo. */
    position: fixed; top: 0; left: 0; z-index: var(--z-dropdown);
    min-width: 200px; background: var(--bg-surface);
    border: 1px solid var(--border); border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg); padding: var(--sp-1); display: none;
}
.dropdown__menu[data-open="true"] { display: block; animation: fade-in var(--dur-fast) var(--ease); }
.dropdown__item {
    display: flex; align-items: center; gap: var(--sp-3); width: 100%;
    padding: var(--sp-2) var(--sp-3); border: 0; background: none;
    font-family: inherit; font-size: var(--fs-base); color: var(--text-default);
    text-align: left; border-radius: var(--radius-xs); cursor: pointer; text-decoration: none;
}
.dropdown__item:hover { background: var(--bg-muted); color: var(--text-strong); text-decoration: none; }
.dropdown__item svg { width: 15px; height: 15px; color: var(--text-muted); }
.dropdown__item--danger { color: var(--danger); }
.dropdown__item--danger:hover { background: var(--danger-bg); color: var(--danger); }
.dropdown__item--danger svg { color: var(--danger); }
.dropdown__divider { height: 1px; background: var(--border-subtle); margin: var(--sp-1) 0; }
.dropdown__menu--wide { min-width: 340px; }
.dropdown__head { padding: var(--sp-3); border-bottom: 1px solid var(--border-subtle); margin-bottom: var(--sp-1); gap: var(--sp-3); }
.dropdown__list { max-height: 380px; overflow-y: auto; }
.dropdown__empty { padding: var(--sp-8) var(--sp-4); text-align: center; color: var(--text-muted); font-size: var(--fs-sm); }
.dropdown__empty svg { color: var(--text-subtle); margin-bottom: var(--sp-3); }

.notification {
    display: block; padding: var(--sp-3); border-radius: var(--radius-xs);
    color: inherit; text-decoration: none;
    transition: background var(--dur-fast) var(--ease);
}
.notification:hover { background: var(--bg-muted); text-decoration: none; }
.notification.is-unread { background: var(--brand-teal-050); }
.notification.is-unread:hover { background: var(--brand-teal-100); }
.notification__title { display: block; font-size: var(--fs-base); font-weight: var(--fw-medium); color: var(--text-strong); }
.notification__text { display: block; font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); margin-top: 2px; }
.notification__time { display: block; font-size: var(--fs-2xs); color: var(--text-subtle); margin-top: var(--sp-1); }

/* --- Feed de atividades ------------------------------------------------- */
.feed { position: relative; padding-left: var(--sp-6); }
.feed::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.feed__item { position: relative; padding-bottom: var(--sp-5); }
.feed__item:last-child { padding-bottom: 0; }
.feed__dot {
    position: absolute; left: calc(var(--sp-6) * -1); top: 3px;
    width: 19px; height: 19px; border-radius: 50%;
    background: var(--bg-surface); border: 2px solid var(--border-strong);
    display: grid; place-items: center; color: var(--text-muted);
}
.feed__dot svg { width: 10px; height: 10px; }
.feed__dot--accent { border-color: var(--accent); color: var(--accent); }
.feed__dot--success { border-color: var(--success); color: var(--success); }
.feed__dot--danger { border-color: var(--danger); color: var(--danger); }
.feed__text { font-size: var(--fs-sm); color: var(--text-default); line-height: var(--lh-snug); }
.feed__text strong { color: var(--text-strong); font-weight: var(--fw-medium); }
.feed__meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* --- Lista de descrição ------------------------------------------------- */
.datalist { display: grid; gap: var(--sp-4); }
.datalist__item { display: grid; gap: 2px; min-width: 0; }
.datalist__label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.datalist__value { font-size: var(--fs-base); color: var(--text-strong); word-break: break-word; }
.datalist__value a { word-break: break-all; }
.datalist--cols { grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); }

/* --- Utilitários -------------------------------------------------------- */
.stack     { display: flex; flex-direction: column; }
.stack-2   { gap: var(--sp-2); }
.stack-3   { gap: var(--sp-3); }
.stack-4   { gap: var(--sp-4); }
.stack-5   { gap: var(--sp-5); }
.stack-6   { gap: var(--sp-6); }
.row       { display: flex; align-items: center; }
.row-2     { gap: var(--sp-2); }
.row-3     { gap: var(--sp-3); }
.row-4     { gap: var(--sp-4); }
.row-wrap  { flex-wrap: wrap; }
.row-between { justify-content: space-between; }
.row-end   { justify-content: flex-end; }
.row-top   { align-items: flex-start; }
.grow      { flex: 1; min-width: 0; }
.text-muted { color: var(--text-muted); }
.text-subtle { color: var(--text-subtle); }
.text-strong { color: var(--text-strong); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-accent { color: var(--accent-active); }
.text-xs   { font-size: var(--fs-xs); }
.text-sm   { font-size: var(--fs-sm); }
.text-lg   { font-size: var(--fs-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.nowrap    { white-space: nowrap; }
.truncate  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); } .mb-6 { margin-bottom: var(--sp-6); }
.hidden { display: none !important; }

/* --- Conteúdo formatado (saída do editor rico) -------------------------- */
.prose { font-size: var(--fs-md); line-height: var(--lh-relaxed); color: var(--text-default); }
.prose h1, .prose h2, .prose h3 { margin: var(--sp-6) 0 var(--sp-3); line-height: var(--lh-snug); }
.prose h1 { font-size: var(--fs-xl); }
.prose h2 { font-size: var(--fs-lg); }
.prose h3 { font-size: var(--fs-md); }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 var(--sp-4); }
.prose ul, .prose ol { margin: 0 0 var(--sp-4); padding-left: var(--sp-6); }
.prose li { margin-bottom: var(--sp-2); }
.prose li::marker { color: var(--accent); }
.prose a { color: var(--accent); text-decoration: underline; }
.prose strong { font-weight: var(--fw-semibold); color: var(--text-strong); }
.prose blockquote { margin: 0 0 var(--sp-4); padding-left: var(--sp-4); border-left: 3px solid var(--border-strong); color: var(--text-muted); }

/* --- Impressão ---------------------------------------------------------- */
@media print {
    .sidebar, .topbar, .no-print, .btn, .tabs, .filters, .pagination, .toasts { display: none !important; }
    .app-main { margin-left: 0; }
    .app-content { padding: 0; max-width: none; }
    .card { border: 0; box-shadow: none; break-inside: avoid; }
    .card__header { border-bottom: 1px solid #000; }
    body { background: #FFFFFF; font-size: 11pt; color: #000; }
    a { color: #000; text-decoration: none; }
    .print-only { display: block !important; }
}
.print-only { display: none; }

/* ==========================================================================
   Responsividade
   Validado em 360, 390, 430, 768, 1366 e 1920 px.
   ========================================================================== */

@media (max-width: 1200px) {
    :root { --sidebar-w: 224px; }
}

@media (max-width: 1024px) {
    :root { --content-pad: var(--sp-4); }

    .app-main { margin-left: 0; }

    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-xl); }
    .sidebar[data-open="true"] { transform: none; }
    .sidebar__backdrop {
        display: block; position: fixed; inset: 0;
        background: rgba(16, 36, 46, 0.5); z-index: calc(var(--z-drawer) - 1);
        animation: fade-in var(--dur-base) var(--ease);
    }
    .topbar__toggle { display: inline-flex; }

    .form-grid { gap: var(--sp-4); }
    .col-9, .col-8, .col-7, .col-6, .col-5 { grid-column: span 12; }
    .col-4, .col-3 { grid-column: span 6; }
}

@media (max-width: 640px) {
    :root { --content-pad: var(--sp-3); --topbar-h: 56px; }

    .page-head { flex-direction: column; align-items: stretch; gap: var(--sp-3); }
    .page-head__title { font-size: var(--fs-xl); }
    .page-head__actions { width: 100%; }
    .page-head__actions .btn { flex: 1; }

    .card__body, .card__header, .card__footer { padding: var(--sp-4); }
    .stat-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
    .stat { padding: var(--sp-4); }
    .stat__value { font-size: var(--fs-2xl); }

    .col-12, .col-9, .col-8, .col-7, .col-6, .col-5, .col-4, .col-3 { grid-column: span 12; }

    .filters__row { flex-direction: column; align-items: stretch; }
    /* Em coluna o flex-basis vale para a altura; zerar evita campos esticados */
    .filters__field,
    .filters__field--search { flex: 0 0 auto; }
    .filters__actions { display: grid; grid-template-columns: 1fr auto; }

    /* Tabelas viram cartões empilhados, sem cortar ações */
    .table--cards thead { display: none; }
    .table--cards tbody tr {
        display: block; border: 1px solid var(--border); border-radius: var(--radius-md);
        margin-bottom: var(--sp-3); padding: var(--sp-3); background: var(--bg-surface);
    }
    .table--cards tbody tr:hover { background: var(--bg-surface); }
    .table--cards td { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; text-align: right; border: 0; }
    .table--cards td::before {
        content: attr(data-label); font-size: var(--fs-xs); font-weight: var(--fw-medium);
        color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em;
        text-align: left; flex-shrink: 0;
    }
    .table--cards td:empty { display: none; }
    .table--cards td[data-label=""]::before { display: none; }
    .table--cards .cell-actions { justify-content: flex-end; padding-top: var(--sp-3); margin-top: var(--sp-2); border-top: 1px solid var(--border-subtle); width: auto; }
    .table--cards .person { justify-content: flex-start; }

    .pagination { flex-direction: column-reverse; align-items: stretch; gap: var(--sp-3); }
    .pagination__nav { justify-content: center; flex-wrap: wrap; }
    .pagination__info { text-align: center; }

    .modal { max-height: calc(100vh - var(--sp-4)); }
    .modal__footer { flex-direction: column-reverse; }
    .modal__footer .btn { width: 100%; }

    .toasts { top: auto; bottom: var(--sp-4); left: var(--sp-3); right: var(--sp-3); max-width: none; }

    .form-actions { flex-direction: column-reverse; align-items: stretch; }
    .form-actions .btn { width: 100%; }
    .form-actions--sticky { margin-left: calc(var(--sp-4) * -1); margin-right: calc(var(--sp-4) * -1); margin-bottom: calc(var(--sp-4) * -1); }

    .datalist--cols { grid-template-columns: 1fr; }
}

/* Alvos de toque confortáveis em telas sensíveis */
@media (hover: none) and (pointer: coarse) {
    .btn { min-height: 42px; }
    .btn--sm { min-height: 36px; }
    .btn--icon { width: 42px; }
    .input, .select, .textarea { min-height: 44px; font-size: 16px; } /* 16px evita zoom automático no iOS */
    .sidebar__link { min-height: 44px; }
    .dropdown__item { padding: var(--sp-3); }
}

/* ==========================================================================
   Painel — gráficos leves em CSS puro (sem biblioteca externa)
   ========================================================================== */

.dash-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); gap: var(--sp-5); align-items: start; }
/* Item de grade tem min-width:auto por padrão e o conteúdo pode empurrar a
   coluna para além do contêiner. Zerar é o que impede rolagem horizontal. */
.dash-columns > * { min-width: 0; }

/* Barras de evolução */
.chart-bars {
    display: flex; align-items: flex-end; gap: 3px;
    height: 180px; padding-top: var(--sp-5);
}
.chart-bars__col { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 0; }
.chart-bars__bar {
    width: 100%; min-height: 3px;
    background: linear-gradient(180deg, var(--brand-teal), var(--brand-teal-600));
    border-radius: var(--radius-xs) var(--radius-xs) 0 0;
    position: relative;
    transition: opacity var(--dur-fast) var(--ease);
}
.chart-bars__bar.is-empty { background: var(--gray-200); }
.chart-bars__col:hover .chart-bars__bar { opacity: 0.75; }
.chart-bars__value {
    position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
    font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--text-muted);
    margin-bottom: 3px; opacity: 0; transition: opacity var(--dur-fast) var(--ease);
    pointer-events: none; white-space: nowrap;
}
.chart-bars__col:hover .chart-bars__value { opacity: 1; }

/* Linhas de funil e ranking */
.funnel-row {
    display: grid; grid-template-columns: minmax(120px, 1.1fr) 2fr auto;
    align-items: center; gap: var(--sp-3);
    color: inherit; text-decoration: none;
    padding: var(--sp-1) 0;
}
a.funnel-row:hover { text-decoration: none; }
a.funnel-row:hover .funnel-row__fill { opacity: 0.82; }
.funnel-row__label { font-size: var(--fs-sm); color: var(--text-default); min-width: 0; }
.funnel-row__track { height: 8px; background: var(--bg-muted); border-radius: var(--radius-full); overflow: hidden; }
.funnel-row__fill {
    display: block; height: 100%; background: var(--brand-teal);
    border-radius: var(--radius-full); transition: opacity var(--dur-fast) var(--ease);
}
.funnel-row--roxo .funnel-row__fill { background: var(--brand-purple); }
.funnel-row--laranja .funnel-row__fill { background: var(--accent); }
.funnel-row__track { height: 10px; }
.funnel-row__value {
    font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong);
    font-variant-numeric: tabular-nums; min-width: 32px; text-align: right;
}

/* Linha de entrevista */
.interview-row {
    display: flex; align-items: center; gap: var(--sp-4);
    padding: var(--sp-3) var(--sp-5); color: inherit; text-decoration: none;
    transition: background var(--dur-fast) var(--ease);
}
.interview-row:hover { background: var(--bg-surface-alt); text-decoration: none; }
.interview-row__date {
    display: grid; place-items: center; flex-shrink: 0;
    width: 48px; padding: var(--sp-2) 0;
    background: var(--bg-muted); border-radius: var(--radius-sm);
    line-height: 1.3;
}
.interview-row__date strong { font-size: var(--fs-sm); color: var(--text-strong); font-weight: var(--fw-semibold); }
.interview-row__date span { font-size: var(--fs-2xs); color: var(--text-muted); }

@media (max-width: 640px) {
    .dash-columns { grid-template-columns: 1fr; gap: var(--sp-4); }
    .chart-bars { height: 130px; }
    .funnel-row { grid-template-columns: minmax(96px, 1fr) 1.4fr auto; gap: var(--sp-2); }
    .interview-row { padding: var(--sp-3) var(--sp-4); }
}

/* Formulário lateral + lista (filiais, áreas, status) */
.split-form { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: var(--sp-5); align-items: start; }
.split-form > * { min-width: 0; }
@media (max-width: 900px) { .split-form { grid-template-columns: 1fr; } }

/* Matriz de permissões */
.perm-module { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.perm-module + .perm-module { margin-top: var(--sp-4); }
.perm-module__head {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    padding: var(--sp-3) var(--sp-4); background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-subtle);
}
.perm-module__title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.perm-module__body { padding: var(--sp-4); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: var(--sp-3); }
.perm-item { display: flex; align-items: flex-start; gap: var(--sp-3); cursor: pointer; }
.perm-item input { margin-top: 2px; accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; }
.perm-item__label { font-size: var(--fs-sm); color: var(--text-default); line-height: var(--lh-snug); }
.perm-item__code { display: block; font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-subtle); margin-top: 1px; }

/* Entrada de auditoria */
.audit-row { display: flex; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border-subtle); }
.audit-row:last-child { border-bottom: 0; }
.audit-row__icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm); flex-shrink: 0;
    display: grid; place-items: center; background: var(--bg-muted); color: var(--text-muted);
}
.audit-row__icon--criar { background: var(--success-bg); color: var(--success); }
.audit-row__icon--excluir { background: var(--danger-bg); color: var(--danger); }
.audit-row__icon--login { background: var(--info-bg); color: var(--info); }
.audit-row__body { min-width: 0; flex: 1; }
.audit-row__desc { font-size: var(--fs-base); color: var(--text-strong); }
.audit-row__meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.audit-row__changes {
    margin-top: var(--sp-3); padding: var(--sp-3); background: var(--bg-surface-alt);
    border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
    font-size: var(--fs-xs); color: var(--text-muted); overflow-x: auto;
}
.audit-row__changes dl { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-1) var(--sp-3); margin: 0; }
.audit-row__changes dt { font-weight: var(--fw-medium); color: var(--text-default); }
.audit-row__changes dd { margin: 0; word-break: break-word; }
.audit-row__changes del { color: var(--danger); text-decoration: line-through; opacity: 0.75; }
.audit-row__changes ins { color: var(--success); text-decoration: none; }

/* ==========================================================================
   Editor rico
   ========================================================================== */
.editor {
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
    overflow: hidden;
}
.editor:focus-within { border-color: var(--accent); box-shadow: var(--ring-accent); }

/* A barra fica fixa no topo do editor por construção: quem rola é a área de
   texto, logo abaixo dela. Não use position:sticky aqui — o .editor tem
   overflow:hidden e viraria o contexto de rolagem, empurrando a barra. */
.editor__toolbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 2px;
    padding: var(--sp-2); background: var(--bg-surface-alt);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}
.editor__btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 var(--sp-2);
    border: 1px solid transparent; border-radius: var(--radius-xs);
    background: transparent; color: var(--text-muted);
    cursor: pointer; font-family: inherit;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.editor__btn:hover { background: var(--bg-muted); color: var(--text-strong); }
.editor__btn.is-active { background: var(--accent-soft); color: var(--accent-active); border-color: var(--brand-orange-100); }
.editor__btn-text { font-size: var(--fs-xs); font-weight: var(--fw-semibold); line-height: 1; }
.editor__sep { width: 1px; height: 18px; background: var(--border); margin: 0 var(--sp-1); }

.editor__area {
    min-height: 200px; max-height: 620px; overflow-y: auto;
    padding: var(--sp-4); outline: none;
    font-size: var(--fs-base); line-height: var(--lh-relaxed);
}
.editor__area:empty::before {
    content: attr(data-placeholder);
    color: var(--text-subtle);
}
.editor__area > :first-child { margin-top: 0; }
.editor__area h2 { font-size: var(--fs-lg); margin: var(--sp-4) 0 var(--sp-2); }
.editor__area h3 { font-size: var(--fs-md); margin: var(--sp-4) 0 var(--sp-2); }
.editor__area p { margin: 0 0 var(--sp-3); }
.editor__area ul, .editor__area ol { margin: 0 0 var(--sp-3); padding-left: var(--sp-6); }

@media (max-width: 640px) {
    .editor__area { min-height: 160px; padding: var(--sp-3); }
    .editor__btn { min-width: 34px; height: 34px; }
}

/* ==========================================================================
   Perfil da candidatura — três colunas no desktop, empilhado no celular
   ========================================================================== */

.profile {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr) 320px;
    gap: var(--sp-5);
    align-items: start;
}

.profile__side { position: sticky; top: calc(var(--topbar-h) + var(--sp-5)); max-height: calc(100vh - var(--topbar-h) - var(--sp-10)); }
.profile__side-list { flex: 1; overflow-y: auto; min-height: 0; }
.profile__side-toggle { display: none; }
.profile__main { min-width: 0; }
.profile__aside { min-width: 0; }

/* Candidato na lista lateral */
.sibling {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-4); color: inherit; text-decoration: none;
    border-left: 2px solid transparent;
    transition: background var(--dur-fast) var(--ease);
}
.sibling:hover { background: var(--bg-surface-alt); text-decoration: none; }
.sibling.is-current { background: var(--brand-orange-050); border-left-color: var(--accent); }
.sibling__body { min-width: 0; }
.sibling__name {
    display: block; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-strong);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sibling__status { display: block; font-size: var(--fs-2xs); font-weight: var(--fw-medium); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Visualizador de currículo */
.resume-viewer {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    overflow: hidden; background: var(--bg-muted);
}
.resume-viewer iframe { display: block; width: 100%; height: min(70vh, 780px); border: 0; background: #FFFFFF; }
.resume-viewer img { display: block; width: 100%; height: auto; background: #FFFFFF; }

/* Observação registrada */
.note {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    background: var(--bg-surface-alt); padding: var(--sp-4);
}
.note__head { display: flex; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-2); }
.note__body { font-size: var(--fs-base); color: var(--text-default); line-height: var(--lh-relaxed); white-space: pre-line; }

/* Entrevista */
.interview {
    border: 1px solid var(--border); border-radius: var(--radius-md);
    padding: var(--sp-4); background: var(--bg-surface);
}
.interview--cancelada { opacity: 0.68; }
.interview__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.interview__when { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--text-strong); }
.interview__meta { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.interview__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-3); }

@media (max-width: 1400px) {
    .profile { grid-template-columns: 232px minmax(0, 1fr) 300px; gap: var(--sp-4); }
}

@media (max-width: 1200px) {
    /* Duas colunas: a lista lateral vira gaveta acionada pelo botão do cabeçalho */
    .profile { grid-template-columns: minmax(0, 1fr) 300px; }
    .profile__side {
        position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw);
        z-index: calc(var(--z-drawer) + 1); max-height: none;
        transform: translateX(-100%); transition: transform var(--dur-base) var(--ease);
        padding: var(--sp-3); background: var(--bg-app);
    }
    .profile__side.is-open { transform: none; box-shadow: var(--shadow-xl); }
    .profile__side-toggle { display: inline-flex; }
}

@media (max-width: 900px) {
    .profile { grid-template-columns: minmax(0, 1fr); }
    .profile__aside { order: 2; }
    .profile__main { order: 1; }
    .resume-viewer iframe { height: min(60vh, 560px); }
}

/* --- Mensagens de WhatsApp ---------------------------------------------- */
.whatsapp-preview {
    background: #E7FFDB; border: 1px solid #C5E8B7; border-radius: var(--radius-md);
    padding: var(--sp-4); font-size: var(--fs-base); line-height: var(--lh-relaxed);
    color: var(--gray-900); white-space: pre-line; position: relative;
    border-bottom-right-radius: var(--radius-xs);
    max-width: 560px;
}

.variable-row {
    display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
    width: 100%; text-align: left; cursor: pointer;
    padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-surface);
    font-family: inherit;
    transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.variable-row:hover { border-color: var(--accent); background: var(--brand-orange-050); }
.variable-row__code { display: block; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--accent-active); }
.variable-row__desc { display: block; font-size: var(--fs-2xs); color: var(--text-muted); }
.variable-row__value { font-size: var(--fs-xs); color: var(--text-default); text-align: right; max-width: 45%; }

/* --- Calendário mensal da agenda ---------------------------------------- */
.calendario { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.calendario__cabecalho { background: var(--bg-surface-alt); padding: var(--sp-2); text-align: center; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.calendario__dia { background: var(--bg-surface); min-height: 104px; padding: var(--sp-2); display: flex; flex-direction: column; gap: 3px; }
.calendario__dia--vazio { background: var(--bg-surface-alt); }
.calendario__dia.is-hoje { background: var(--brand-orange-050); box-shadow: inset 0 2px 0 var(--accent); }
.calendario__numero { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); }
.calendario__dia.is-hoje .calendario__numero { color: var(--accent-active); font-weight: var(--fw-semibold); }
.calendario__evento {
    display: block; padding: 2px var(--sp-2); border-radius: var(--radius-xs);
    background: var(--info-bg); color: var(--info); border-left: 2px solid var(--info);
    font-size: var(--fs-2xs); line-height: 1.35; text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.calendario__evento:hover { text-decoration: none; filter: brightness(0.96); }
.calendario__evento strong { font-weight: var(--fw-semibold); }
.calendario__evento span { margin-left: 3px; }
.calendario__evento--realizada { background: var(--success-bg); color: var(--success); border-left-color: var(--success); }
.calendario__evento--cancelada { background: var(--bg-muted); color: var(--text-muted); border-left-color: var(--gray-400); text-decoration: line-through; }
.calendario__evento--nao_compareceu { background: var(--danger-bg); color: var(--danger); border-left-color: var(--danger); }
.calendario__mais { font-size: var(--fs-2xs); color: var(--text-muted); padding-left: var(--sp-2); }

@media (max-width: 900px) {
    /* Sete colunas em telas pequenas ficariam ilegíveis: vira lista por dia */
    .calendario { grid-template-columns: 1fr; }
    .calendario__cabecalho { display: none; }
    .calendario__dia--vazio { display: none; }
    .calendario__dia { min-height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3); }
    .calendario__numero { min-width: 28px; font-size: var(--fs-base); }
    .calendario__evento { flex: 1 1 200px; white-space: normal; }
}

/* --- Linha de métricas (blocos "Vencimento" da Central de Tickets) ------- */
.metric-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr));
    gap: var(--sp-4);
}
.metric { min-width: 0; }
.metric__label {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--sp-2);
}
.metric__value {
    display: block;
    font-size: var(--fs-2xl);
    font-weight: var(--fw-bold);
    color: var(--text-strong);
    letter-spacing: -0.02em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.metric__value--teal    { color: var(--brand-teal); }
.metric__value--accent  { color: var(--accent); }
.metric__value--danger  { color: var(--danger); }
.metric__value--success { color: var(--success); }

/* ==========================================================================
   Painel de relatórios
   --------------------------------------------------------------------------
   Gráficos em SVG e CSS puro, sem biblioteca. O volume de dados aqui é
   pequeno — sete etapas, doze status, uma dúzia de barras — e não justifica
   carregar um motor de gráficos inteiro no navegador do RH.
   ========================================================================== */

/* --- Barra de filtros ---------------------------------------------------- */
.rpt-filters {
    display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-4); align-items: flex-end;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
    padding: var(--sp-4) var(--sp-5); margin-bottom: var(--sp-5);
}
.rpt-filters__field { display: flex; flex-direction: column; gap: var(--sp-2); flex: 1 1 170px; min-width: 0; }
.rpt-filters__actions { display: flex; gap: var(--sp-2); margin-left: auto; }

/* --- Indicadores --------------------------------------------------------- */
.kpi-grid {
    display: grid; gap: var(--sp-4);
    grid-template-columns: repeat(auto-fit, minmax(min(184px, 100%), 1fr));
}
/* Os seis indicadores contam uma história na ordem em que estão. Quebrar em
   5 + 1 esconde o último; a partir daqui cabem todos na mesma linha. */
@media (min-width: 1180px) {
    .kpi-grid { grid-template-columns: repeat(6, 1fr); }
}
.kpi {
    position: relative; min-width: 0;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
    padding: var(--sp-4) var(--sp-5); overflow: hidden;
}
/* Faixa colorida à esquerda: identifica o indicador antes da leitura */
.kpi::before {
    content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
    background: var(--brand-teal);
}
.kpi--positivo::before { background: var(--success); }
.kpi--negativo::before { background: var(--danger); }
.kpi--neutro::before   { background: var(--accent); }

.kpi__label {
    display: flex; align-items: center; gap: var(--sp-2);
    font-size: var(--fs-2xs); font-weight: var(--fw-semibold);
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.kpi__label svg { color: var(--text-subtle); flex: none; }
.kpi__row { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.kpi__value {
    font-family: var(--font-display); font-size: var(--fs-3xl); font-weight: var(--fw-medium);
    color: var(--text-strong); letter-spacing: -0.03em; line-height: 1;
}
.kpi__delta {
    display: inline-flex; align-items: center; gap: 1px;
    padding: 2px var(--sp-2); border-radius: var(--radius-full);
    font-size: var(--fs-2xs); font-weight: var(--fw-semibold);
}
.kpi__delta.is-good { background: var(--success-bg); color: var(--success); }
.kpi__delta.is-bad  { background: var(--danger-bg);  color: var(--danger); }
.kpi__foot { margin-top: var(--sp-3); font-size: var(--fs-2xs); color: var(--text-subtle); }
.kpi__foot strong { color: var(--text-muted); font-weight: var(--fw-semibold); }

/* --- Funil --------------------------------------------------------------- */
.funnel { list-style: none; display: flex; flex-direction: column; gap: var(--sp-4); margin: 0; padding: 0; }
.funnel__step { display: flex; gap: var(--sp-4); align-items: flex-start; }
.funnel__rank {
    flex: none; width: 30px; text-align: right;
    font-family: var(--font-display); font-size: var(--fs-md); font-weight: var(--fw-medium);
    color: var(--gray-300); letter-spacing: -0.02em; padding-top: 1px;
}
.funnel__body { flex: 1; min-width: 0; }
.funnel__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.funnel__name { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.funnel__count { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }
.funnel__count strong { color: var(--text-strong); font-size: var(--fs-base); }
.funnel__track {
    height: 12px; margin-top: var(--sp-2);
    background: var(--bg-muted); border-radius: var(--radius-full); overflow: hidden;
}
.funnel__fill { height: 100%; border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease-out); }
.funnel__meta {
    display: flex; gap: var(--sp-3); flex-wrap: wrap;
    margin-top: var(--sp-2); font-size: var(--fs-2xs); color: var(--text-subtle);
}
.funnel__rel::before { content: "·"; margin-right: var(--sp-3); color: var(--gray-300); }

/* --- Barras horizontais -------------------------------------------------- */
.vbars { list-style: none; display: flex; flex-direction: column; gap: var(--sp-3); margin: 0; padding: 0; }
.vbars__item { display: grid; grid-template-columns: 62px 1fr 44px; align-items: center; gap: var(--sp-3); }
.vbars__label { font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); }
.vbars__track { height: 10px; background: var(--bg-muted); border-radius: var(--radius-full); overflow: hidden; }
.vbars__fill {
    display: block; height: 100%; border-radius: var(--radius-full);
    background: linear-gradient(90deg, var(--brand-orange-600), var(--accent));
    transition: width var(--dur-slow) var(--ease-out);
}
/* Um período sem inscrição precisa aparecer como zero, não sumir do gráfico */
.vbars__fill.is-empty { background: var(--gray-200); width: 3px !important; }
.vbars__value { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); text-align: right; }

/* --- Rosca --------------------------------------------------------------- */
.donut-wrap { display: flex; gap: var(--sp-5); align-items: center; flex-wrap: wrap; }
.donut { width: 168px; height: 168px; flex: none; }
.donut circle { transition: stroke-dasharray var(--dur-slow) var(--ease-out); }
.donut__total {
    text-anchor: middle; font-family: var(--font-display); font-size: 26px;
    font-weight: 500; fill: var(--text-strong); letter-spacing: -0.03em;
}
.donut__unit { text-anchor: middle; font-size: 9.5px; fill: var(--text-subtle); letter-spacing: 0.06em; }

.legend { list-style: none; margin: 0; padding: 0; flex: 1 1 190px; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.legend__item { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-xs); min-width: 0; }
.legend__dot { width: 9px; height: 9px; border-radius: var(--radius-full); flex: none; }
.legend__label { color: var(--text-default); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend__value { margin-left: auto; font-weight: var(--fw-semibold); color: var(--text-strong); }

/* --- Apoio de tabela ----------------------------------------------------- */
.dot-label { display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-medium); }
.dot-label__dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex: none; }

.minibar {
    display: inline-block; vertical-align: middle; width: calc(100% - 52px); max-width: 260px;
    height: 7px; background: var(--bg-muted); border-radius: var(--radius-full); overflow: hidden;
}
.minibar__fill { display: block; height: 100%; border-radius: var(--radius-full); }
.minibar__pct { display: inline-block; width: 46px; text-align: right; font-size: var(--fs-2xs); color: var(--text-muted); }

.pill {
    display: inline-block; min-width: 30px; padding: 1px var(--sp-2);
    border: 1px solid; border-radius: var(--radius-full);
    font-size: var(--fs-xs); font-weight: var(--fw-semibold);
}

.table--compact th, .table--compact td { padding-top: var(--sp-3); padding-bottom: var(--sp-3); }
.table--compact th { white-space: nowrap; }
/* Tabela larga (uma coluna por status): o nome não pode quebrar em três linhas
   só porque o resto da tabela empurra. Ela rola na horizontal, o nome não. */
.table--wide td:first-child,
.table--wide th:first-child { white-space: nowrap; min-width: 150px; }

.section-title {
    font-family: var(--font-display); font-size: var(--fs-xl); font-weight: var(--fw-medium);
    color: var(--text-strong); letter-spacing: -0.02em;
}

/* --- Catálogo de relatórios ---------------------------------------------- */
.report-card {
    display: flex; align-items: flex-start; gap: var(--sp-3); height: 100%;
    background: var(--bg-surface); border: 1px solid var(--border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
    padding: var(--sp-4); text-decoration: none; color: inherit;
    transition: box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.report-card:hover {
    text-decoration: none; box-shadow: var(--shadow-md);
    border-color: var(--brand-orange-200); transform: translateY(-1px);
}
.report-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.report-card__icon {
    flex: none; width: 34px; height: 34px; border-radius: var(--radius-sm);
    display: grid; place-items: center;
    background: var(--brand-teal-050); color: var(--brand-teal);
}
.report-card__body { flex: 1; min-width: 0; display: block; }
.report-card__name { display: block; font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.report-card__desc { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); line-height: var(--lh-snug); }
.report-card__go { flex: none; color: var(--text-subtle); padding-top: var(--sp-2); }
.report-card:hover .report-card__go { color: var(--accent); }

@media (max-width: 640px) {
    .rpt-filters { padding: var(--sp-4); }
    .rpt-filters__field { flex: 0 0 auto; width: 100%; }
    .rpt-filters__actions { margin-left: 0; width: 100%; }
    .rpt-filters__actions .btn { flex: 1; }
    .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr)); gap: var(--sp-3); }
    .kpi { padding: var(--sp-4); }
    .kpi__value { font-size: var(--fs-2xl); }
    .funnel__rank { display: none; }
    .donut-wrap { justify-content: center; }
    .minibar { width: calc(100% - 50px); }
}