/**
 * Seletivos edital identity (SESC Maranhão)
 * Source: docs/auditoria-interface-frontend.md
 * Loaded globally on AdminLTE pages (config/adminlte.php → SelectivePremium plugin).
 */

@import url("https://fonts.googleapis.com/css2?family=Familjen+Grotesk:wght@600;700&family=IBM+Plex+Mono:wght@500;600&family=Noto+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
    --ui-navy: #0b2c6b;
    --ui-gold: #e2b441;
    --ui-primary: #0b2c6b;
    --ui-primary-dark: #081f4c;
    --ui-primary-soft: #e8eef8;
    --ui-primary-mid: #1a3f8a;

    --ui-success: #2f9e5b;
    --ui-success-soft: #ebf8f0;

    --ui-danger: #dc5962;
    --ui-danger-soft: #fff0f1;

    --ui-warning: #8a6116;
    --ui-warning-soft: #fff8e8;

    --ui-text: #1a1f18;
    --ui-text-secondary: #5c6570;
    --ui-text-muted: #7a8490;

    --ui-border: #d9ddd6;
    --ui-border-strong: #c5cbc2;

    --ui-background: #f3f5f2;
    --ui-surface: #ffffff;
    --ui-surface-soft: #f7f8f5;

    --ui-font-body: "Noto Sans", "Segoe UI", sans-serif;
    --ui-font-display: "Familjen Grotesk", "Noto Sans", sans-serif;
    --ui-font-mono: "IBM Plex Mono", ui-monospace, monospace;

    --ui-scrollbar-track: #e8ebe6;
    --ui-scrollbar-thumb: #6b7a90;
    --ui-scrollbar-thumb-hover: var(--ui-primary);

    --ui-radius-sm: 8px;
    --ui-radius-md: 12px;
    --ui-radius-pill: 999px;
    /* The receipt is a paper object: square-ish corners on purpose. */
    --ui-radius-paper: 4px;

    --ui-shadow-sm: 0 1px 2px rgba(11, 44, 107, 0.04), 0 4px 12px rgba(11, 44, 107, 0.05);
    --ui-shadow-md: 0 12px 32px rgba(11, 44, 107, 0.08);
    --ui-shadow-overlay: 0 12px 32px rgba(15, 23, 42, 0.12);

    /* Type scale: the only font sizes the app uses. */
    --ui-fs-xs: 0.75rem;
    --ui-fs-sm: 0.875rem;
    --ui-fs-base: 1rem;
    --ui-fs-md: 1.125rem;
    --ui-fs-lg: 1.375rem;
    --ui-fs-xl: 1.75rem;
    --ui-fs-2xl: 2.25rem;

    --ui-transition: 180ms ease;
    --ui-focus-ring: rgba(226, 180, 65, 0.35);
}

@media (max-width: 575.98px) {
    :root {
        --ui-fs-xl: 1.5rem;
        --ui-fs-2xl: 1.75rem;
    }
}

html {
    font-family: var(--ui-font-body);
}

body,
.wrapper,
.content-wrapper,
.public-portal-body,
.auth-page {
    font-family: var(--ui-font-body);
    color: var(--ui-text);
    background: var(--ui-background);
}

/* Global scrollbar treatment for page, sidebar, modal, and table overflow. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--ui-scrollbar-thumb) var(--ui-scrollbar-track);
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: var(--ui-scrollbar-track);
}

*::-webkit-scrollbar-thumb {
    background: var(--ui-scrollbar-thumb);
    border-radius: var(--ui-radius-pill);
}

*::-webkit-scrollbar-thumb:hover,
*::-webkit-scrollbar-thumb:active {
    background: var(--ui-scrollbar-thumb-hover);
}

/* Match AdminLTE sidebar OverlayScrollbars without changing its generated layout. */
.main-sidebar .os-scrollbar > .os-scrollbar-track {
    background: var(--ui-scrollbar-track);
}

.main-sidebar .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle {
    background: var(--ui-scrollbar-thumb);
}

.main-sidebar .os-scrollbar:hover > .os-scrollbar-track > .os-scrollbar-handle {
    background: var(--ui-scrollbar-thumb-hover);
}

.main-sidebar .os-scrollbar > .os-scrollbar-track > .os-scrollbar-handle.active {
    background: var(--ui-scrollbar-thumb-hover);
}

body.dark-mode {
    --ui-scrollbar-track: #0d1a33;
    --ui-scrollbar-thumb: #6c7b91;
    --ui-scrollbar-thumb-hover: var(--ui-gold);
}

/* Soften AdminLTE chrome on curriculum pages */
.content-wrapper {
    background: var(--ui-background);
}

/* Staff sidebar: navy in both themes (never AdminLTE's default grey). */
:root {
    --ui-sidebar-bg: #081f4c;
}

body.dark-mode {
    --ui-sidebar-bg: #071428;
}

.main-sidebar,
.main-sidebar .brand-link {
    background: var(--ui-sidebar-bg) !important;
}

.main-sidebar .brand-link {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

.main-sidebar .nav-sidebar {
    padding: 8px;
}

.nav-sidebar .nav-link {
    margin-bottom: 4px;
    border-radius: var(--ui-radius-sm);
    color: rgba(255, 255, 255, 0.78) !important;
}

.nav-sidebar .nav-link:not(.active):hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

/* Room for the submenu chevron so it never touches the label. */
.nav-sidebar .nav-item:has(> .nav-treeview) > .nav-link {
    padding-right: 2.25rem;
}

.nav-sidebar .nav-link.active,
.sidebar-dark-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-dark-primary .nav-treeview > .nav-item > .nav-link.active,
.sidebar-light-primary .nav-sidebar > .nav-item > .nav-link.active,
.sidebar-light-primary .nav-treeview > .nav-item > .nav-link.active {
    background-color: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 #fff !important;
    font-weight: 600;
}

/* A group header (e.g. "Processos Seletivos") only opens/closes its submenu;
   it is never the current page, so it reads as a section label, not as a
   second active item. */
.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link,
.sidebar-light-primary .nav-sidebar > .nav-item.menu-open > .nav-link {
    background-color: transparent !important;
    box-shadow: none !important;
    color: rgba(255, 255, 255, 0.6) !important;
    font-size: var(--ui-fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sidebar-dark-primary .nav-sidebar > .nav-item.menu-open > .nav-link .nav-icon,
.sidebar-light-primary .nav-sidebar > .nav-item.menu-open > .nav-link .nav-icon {
    color: inherit !important;
    font-size: var(--ui-fs-sm);
}

.main-header {
    min-height: 58px;
    border-bottom: 1px solid var(--ui-border);
    box-shadow: none;
}

/* Long user names must not push the user menu past the phone width: shrink and end with "…". */
@media (max-width: 767.98px) {
    .main-header .navbar-nav.ml-auto {
        min-width: 0;
        max-width: 100%;
    }

    .main-header .user-menu,
    .main-header .user-menu > .nav-link {
        min-width: 0;
        max-width: 100%;
    }

    .main-header .user-menu > .nav-link {
        display: flex;
        align-items: center;
    }

    .main-header .user-menu > .nav-link > span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Page shell */
.curriculo-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

@media (max-width: 767.98px) {
    .curriculo-page {
        padding: 18px 14px 28px;
    }

    /* AdminLTE's .content + .container already give ~16px; the page adds no more. */
    .content-wrapper .app-page,
    .content-wrapper .curriculo-page {
        padding-left: 0;
        padding-right: 0;
    }
}

/* Header */
.curriculo-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

/* Page titles use the display face; section and card titles stay in Noto Sans. */
.curriculo-title {
    margin: 0;
    color: var(--ui-text);
    font-family: var(--ui-font-display);
    font-size: var(--ui-fs-xl);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.curriculo-header-main {
    min-width: 0;
}

.curriculo-header-meta {
    margin-top: 10px;
}

/* One back affordance app-wide: a quiet text link above the title. */
.page-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
    text-decoration: none;
}

.page-back-link:hover,
.page-back-link:focus-visible {
    color: var(--ui-primary);
    text-decoration: none;
}

.curriculo-subtitle {
    margin: 6px 0 0;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-base);
}

.curriculo-header-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.curriculo-header-status strong {
    margin-top: 4px;
    color: var(--ui-text);
    font-size: var(--ui-fs-sm);
}

/* Shell card */
.curriculo-shell {
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
}

.curriculo-shell-body {
    padding: 28px;
}

@media (max-width: 767.98px) {
    .curriculo-shell-body {
        padding: 20px 16px;
    }
}

/* Progress */
.progress-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
}

.curriculo-progress {
    height: 7px;
    background: #edf1f7;
    border-radius: var(--ui-radius-pill);
    overflow: hidden;
}

.curriculo-progress-bar {
    height: 100%;
    background: var(--ui-primary);
    border-radius: inherit;
    transition: width 300ms ease;
}

/* Stepper */
.curriculo-stepper {
    display: flex;
    align-items: flex-start;
    margin: 30px 0 38px;
}

.curriculo-step {
    position: relative;
    flex: 1;
    text-align: center;
}

.curriculo-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 17px;
    left: 58%;
    width: 84%;
    height: 2px;
    background: var(--ui-border);
}

.curriculo-step.is-complete:not(:last-child)::after,
.curriculo-step.is-filled:not(:last-child)::after {
    background: var(--ui-primary);
}

.step-circle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef2f7;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 700;
}

.curriculo-step span {
    display: block;
    margin-top: 10px;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.curriculo-step.is-complete .step-circle {
    background: var(--ui-success-soft);
    color: var(--ui-success);
}

.curriculo-step.is-active .step-circle {
    background: var(--ui-primary);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(11, 44, 107, 0.12);
}

.curriculo-step.is-active span {
    color: var(--ui-text);
    font-weight: 700;
}

button.curriculo-step {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: default;
}

button.curriculo-step.is-clickable {
    cursor: pointer;
}

button.curriculo-step.is-clickable:hover .step-circle {
    box-shadow: 0 0 0 6px rgba(11, 44, 107, 0.1);
}

button.curriculo-step.is-clickable:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 4px;
    border-radius: var(--ui-radius-md);
}

.content-wrapper .salary-input-group .input-group-text {
    background: var(--ui-surface-soft, #f5f7fb);
    border: 1px solid var(--ui-border-strong, #d0d5dd);
    border-right: 0;
    border-radius: var(--ui-radius-sm) 0 0 var(--ui-radius-sm);
    color: var(--ui-text-secondary, #667085);
    font-weight: 600;
    min-width: 3rem;
    justify-content: center;
}

.content-wrapper .salary-input-group .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.salary-input-group:focus-within .input-group-text {
    border-color: var(--ui-primary);
}

/* Section heading */
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px 28px;
    margin-bottom: 24px;
}

.section-heading-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    margin-bottom: 2px;
}

.section-heading h2 {
    margin: 0;
    color: var(--ui-text);
    font-size: var(--ui-fs-lg);
    font-weight: 700;
}

.section-heading > .btn-help,
.section-heading > .btn-primary-action,
.section-heading > .section-help-text {
    flex: 0 0 auto;
    margin-top: 2px;
}

.section-help-text {
    border: 0;
    background: transparent;
    padding: 0;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.section-heading p {
    margin: 6px 0 0;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    max-width: 42rem;
}

.btn-help {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
    border: 0;
    border-radius: var(--ui-radius-sm);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--ui-transition), color var(--ui-transition);
}

.btn-help:hover {
    color: var(--ui-primary-dark);
    background: #e0ebff;
}

/* Empty option block */
.empty-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 22px;
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    cursor: pointer;
    transition: border-color var(--ui-transition),
                background var(--ui-transition);
}

.empty-option:hover {
    border-color: #b8c8e8;
    background: #f6f9ff;
}

.empty-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--ui-primary);
}

.empty-option-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    flex-shrink: 0;
}

.empty-option strong,
.empty-option small {
    display: block;
}

.empty-option small {
    margin-top: 2px;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.empty-option.is-checked {
    border-color: #b8c8e8;
    background: #f6f9ff;
}

.empty-confirm {
    margin: -8px 0 22px;
    padding: 12px 14px;
    color: var(--ui-text-secondary);
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    font-size: var(--ui-fs-sm);
}

/* Entry cards */
.entry-card {
    margin-bottom: 20px;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-sm);
    overflow: hidden;
    transition: border-color var(--ui-transition),
                box-shadow var(--ui-transition);
}

.entry-card:focus-within {
    border-color: #a9bffc;
    box-shadow: var(--ui-shadow-md);
}

.entry-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    background: var(--ui-surface-soft);
    border-bottom: 1px solid var(--ui-border);
}

.entry-card-header small {
    display: block;
    margin-top: 2px;
    color: var(--ui-text-secondary);
}

.entry-index {
    color: var(--ui-text);
    font-size: var(--ui-fs-base);
    font-weight: 700;
}

.entry-card-body {
    padding: 22px 20px;
}

.btn-remove-entry {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    color: var(--ui-danger);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: background var(--ui-transition), border-color var(--ui-transition);
}

.btn-remove-entry:hover:not(:disabled) {
    background: var(--ui-danger-soft);
    border-color: #ffd4d8;
}

.btn-remove-entry:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Form fields inside curriculum */
.curriculo-page .form-group {
    margin-bottom: 18px;
}

.curriculo-page .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ui-label);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
}

.curriculo-page .form-control {
    min-height: 46px;
    padding: 10px 13px;
    color: var(--ui-text);
    background: #fff;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    box-shadow: none;
    transition: border-color var(--ui-transition),
                box-shadow var(--ui-transition);
}

.curriculo-page .form-control:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px var(--ui-focus-ring);
}

.curriculo-page .form-control:disabled,
.curriculo-page .form-control[readonly] {
    color: var(--ui-text-secondary);
    background: #f2f4f7;
    border-color: var(--ui-border);
}

.curriculo-page textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.curriculo-page .form-control.is-invalid {
    border-color: var(--ui-danger);
    box-shadow: 0 0 0 4px var(--ui-danger-ring);
}

.curriculo-page .invalid-feedback {
    display: block;
    margin-top: 6px;
    color: var(--ui-danger);
    font-size: var(--ui-fs-sm);
}

.curriculo-page .form-text,
.char-counter {
    margin-top: 6px;
    color: var(--ui-text-muted);
    font-size: var(--ui-fs-sm);
}

.char-counter {
    text-align: right;
}

.req-star {
    color: var(--ui-danger);
    font-weight: 700;
}

/* Inline check (Em andamento / Emprego atual) */
/* Higher specificity than ".form-group label" so the check sits level with the inputs beside it. */
.content-wrapper .form-group label.inline-check,
.curriculo-page .form-group label.inline-check,
.inline-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    margin: 29px 0 0;
    color: var(--ui-text);
    font-size: var(--ui-fs-sm);
    font-weight: 400;
    cursor: pointer;
}

.inline-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ui-primary);
}

@media (max-width: 767.98px) {
    .content-wrapper .form-group label.inline-check,
    .curriculo-page .form-group label.inline-check,
    .inline-check {
        margin: 4px 0 12px;
        min-height: auto;
    }
}

/* Input group (horas) */
.curriculo-page .input-group-text {
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border-strong);
    border-left: 0;
    border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0;
    color: var(--ui-text-secondary);
    font-weight: 600;
}

.curriculo-page .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Add entry */
.btn-add-entry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 15px;
    color: var(--ui-primary);
    background: #fff;
    border: 1px dashed #9fb8f7;
    border-radius: var(--ui-radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: background var(--ui-transition),
                border-color var(--ui-transition);
}

.btn-add-entry:hover:not(:disabled) {
    color: var(--ui-primary-dark);
    background: var(--ui-primary-soft);
    border-color: var(--ui-primary);
    border-style: solid;
}

.btn-add-entry:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-add-wrap {
    margin: 4px 0 8px;
}

/* Form actions footer */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px solid var(--ui-border);
}

.form-actions-end {
    justify-content: flex-end;
}

.btn-back,
.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    min-width: 9.5rem;
    padding: 11px 17px;
    border-radius: var(--ui-radius-sm);
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--ui-transition),
                box-shadow var(--ui-transition),
                background var(--ui-transition);
}

.btn-back {
    color: #475467;
    background: #fff;
    border: 1px solid var(--ui-border-strong);
}

.btn-back:hover {
    background: #f8fafc;
}

.btn-primary-action {
    color: #fff;
    background: linear-gradient(
        135deg,
        var(--ui-primary),
        var(--ui-primary-dark)
    );
    border: 0;
    box-shadow: none;
}

.btn-primary-action:hover:not(:disabled) {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--ui-shadow-sm);
}

.btn-primary-action:disabled {
    opacity: 0.75;
    cursor: wait;
}

/* Notice */
.curriculo-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 24px;
    padding: 15px 16px;
    color: var(--ui-warning);
    background: var(--ui-warning-soft);
    border: 1px solid #f2dfa8;
    border-radius: var(--ui-radius-md);
}

.notice-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--ui-radius-sm);
    background: rgba(138, 97, 22, 0.1);
    flex-shrink: 0;
}

.curriculo-notice strong {
    display: block;
    margin-bottom: 3px;
}

.curriculo-notice p {
    margin: 0;
    line-height: 1.5;
    font-size: var(--ui-fs-sm);
}

/* Completion / validation banner */
.curriculo-alert {
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: var(--ui-radius-sm);
    font-size: var(--ui-fs-sm);
}

.curriculo-alert-danger {
    color: var(--ui-danger);
    background: var(--ui-danger-soft);
    border: 1px solid #ffd4d8;
}

/* Tips modal polish */
.curriculo-modal .modal-content {
    border: 0;
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-md);
}

.curriculo-modal .modal-header {
    border-bottom: 1px solid var(--ui-border);
    padding: 18px 20px;
}

.curriculo-modal .modal-title {
    color: var(--ui-text);
    font-weight: 700;
}

.curriculo-modal .modal-body {
    color: var(--ui-text-secondary);
    line-height: 1.55;
    padding: 18px 20px;
}

.curriculo-modal .modal-footer {
    border-top: 1px solid var(--ui-border);
    padding: 14px 20px;
}

/* Manager curriculum: compact document-style ficha, without nested cards. */
.manager-curriculum-modal-header {
    align-items: flex-start;
}

.manager-curriculum-header-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.manager-curriculum-header-photo,
.manager-curriculum-header-photo-fallback {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--ui-border);
    border-radius: 50%;
}

.manager-curriculum-header-photo {
    object-fit: cover;
}

.manager-curriculum-header-photo-fallback {
    display: grid;
    place-items: center;
    color: var(--ui-text-muted);
    background: var(--ui-surface-soft);
}

.manager-curriculum-modal-kicker {
    color: var(--ui-text-muted);
    font-size: var(--ui-fs-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.manager-curriculum-position {
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.manager-curriculum-modal-body {
    padding: 0;
}

.manager-curriculum-ficha {
    color: var(--ui-text);
}

.manager-curriculum-section {
    padding: 18px 20px;
}

.manager-curriculum-section + .manager-curriculum-section {
    border-top: 1px solid var(--ui-border);
}

.manager-curriculum-section-band {
    margin: -18px -20px 16px;
    padding: 9px 20px;
    background: var(--ui-surface-soft);
    border-bottom: 1px solid var(--ui-border);
}

.manager-curriculum-section-title {
    margin: 0;
    color: var(--ui-text);
    font-size: var(--ui-fs-sm);
    font-weight: 700;
}

.manager-curriculum-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
}

.manager-curriculum-field-grid > div {
    min-width: 0;
}

.manager-curriculum-field-grid dt {
    margin-bottom: 3px;
    color: var(--ui-text-muted);
    font-size: var(--ui-fs-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.manager-curriculum-field-grid dd {
    margin: 0;
    color: var(--ui-text);
    font-size: var(--ui-fs-sm);
    overflow-wrap: anywhere;
}

.manager-curriculum-field-wide {
    grid-column: 1 / -1;
}

.manager-curriculum-entry-list {
    margin-top: 16px;
}

.manager-curriculum-entry {
    padding: 14px 0;
}

.manager-curriculum-entry + .manager-curriculum-entry {
    border-top: 1px solid var(--ui-border);
}

.manager-curriculum-entry-list .manager-curriculum-entry:last-child {
    padding-bottom: 0;
}

.manager-curriculum-empty {
    margin: 0;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.manager-curriculum-preline {
    white-space: pre-line;
}

/* Hide AdminLTE content header gap when empty */
.curriculo-page + * {
    /* noop */
}

.content-header:empty,
.content-header:has(> :empty) {
    display: none;
}

/* Responsive */
@media (max-width: 767.98px) {
    .section-heading,
    .curriculo-header,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .curriculo-header-status {
        align-items: flex-start;
    }

    .btn-primary-action,
    .btn-back,
    .btn-help,
    .btn-add-entry {
        width: 100%;
        justify-content: center;
    }

    /* Every step must stay visible on phones: shrink instead of scrolling. */
    .curriculo-stepper {
        margin: 20px 0 28px;
    }

    .curriculo-step {
        min-width: 0;
    }

    .curriculo-step span {
        padding: 0 2px;
        font-size: var(--ui-fs-xs);
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    /* Long wizards (5+ steps) only name the current step. */
    .curriculo-stepper:has(> :nth-child(5)) .curriculo-step:not(.is-active) span {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .entry-card-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .section-heading h2 {
        font-size: var(--ui-fs-md);
    }

    .manager-curriculum-section {
        padding: 16px;
    }

    .manager-curriculum-section-band {
        margin: -16px -16px 14px;
        padding: 9px 16px;
    }

    .manager-curriculum-field-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

}

/* Focus visible for a11y */
.curriculo-page :focus-visible {
    outline: 2px solid var(--ui-primary);
    outline-offset: 2px;
}

.btn-primary-action:focus-visible,
.btn-back:focus-visible,
.btn-help:focus-visible,
.btn-add-entry:focus-visible,
.btn-remove-entry:focus-visible {
    outline: 2px solid var(--ui-primary);
    outline-offset: 2px;
}

/* Premium pagination */
.premium-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    padding: 14px 16px;
    color: var(--ui-text-secondary);
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-sm);
    font-size: var(--ui-fs-sm);
}

.premium-pagination-meta,
.premium-pagination-page-count {
    margin: 0;
    white-space: nowrap;
}

.premium-pagination-page-count {
    color: var(--ui-text-muted);
}

.premium-pagination-list {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.premium-pagination-control,
.premium-pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 7px 10px;
    color: var(--ui-text-secondary);
    background: var(--ui-btn-secondary-bg);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    font: inherit;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background var(--ui-transition), border-color var(--ui-transition), color var(--ui-transition);
}

button.premium-pagination-control,
button.premium-pagination-page {
    cursor: pointer;
}

.premium-pagination-control:hover,
.premium-pagination-page:hover {
    color: var(--ui-primary-dark);
    background: var(--ui-primary-soft);
    border-color: var(--ui-primary);
    text-decoration: none;
}

.premium-pagination-page.is-current {
    color: #fff;
    background: var(--ui-primary);
    border-color: var(--ui-primary);
    font-weight: 700;
}

.premium-pagination-control.is-disabled {
    color: var(--ui-text-muted);
    background: var(--ui-surface-soft);
    cursor: not-allowed;
}

.premium-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    color: var(--ui-text-muted);
}

.premium-pagination-control:focus-visible,
.premium-pagination-page:focus-visible {
    outline: 2px solid var(--ui-primary);
    outline-offset: 2px;
}

@media (max-width: 767.98px) {
    .premium-pagination {
        flex-direction: column;
        align-items: stretch;
    }

    .premium-pagination-meta,
    .premium-pagination-page-count {
        text-align: center;
    }

    .premium-pagination-list {
        justify-content: flex-start;
        overflow-x: auto;
        padding: 2px;
    }
}

/* =============================================================================
   App-wide design system aliases
   ============================================================================= */

.app-page {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 24px 40px;
}

@media (max-width: 767.98px) {
    .app-page {
        padding: 18px 14px 28px;
    }
}

/* Form controls app-wide (authenticated AdminLTE pages) */
.content-wrapper .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ui-label);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
}

.content-wrapper .form-control {
    min-height: 46px;
    padding: 10px 13px;
    color: var(--ui-text);
    background: #fff;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    box-shadow: none;
    transition: border-color var(--ui-transition),
                box-shadow var(--ui-transition);
}

.content-wrapper .form-control:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px var(--ui-focus-ring);
}

.content-wrapper .form-control:disabled,
.content-wrapper .form-control[readonly] {
    color: var(--ui-text-secondary);
    background: #f2f4f7;
    border-color: var(--ui-border);
}

.content-wrapper textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

.content-wrapper .form-control.is-invalid {
    border-color: var(--ui-danger);
    box-shadow: 0 0 0 4px var(--ui-danger-ring);
}

.form-control.is-invalid {
    background-image: none;
}

.content-wrapper .invalid-feedback {
    display: block;
    margin-top: 6px;
    color: var(--ui-danger);
    font-size: var(--ui-fs-sm);
}

/* =============================================================================
   Meu perfil — show
   ============================================================================= */

.profile-layout {
    display: flex;
    flex-wrap: wrap;
    margin-left: -12px;
    margin-right: -12px;
}

.profile-layout > [class*="profile-"] {
    padding-left: 12px;
    padding-right: 12px;
}

.candidate-profile-sidebar,
.profile-sidebar {
    width: 100%;
}

.candidate-profile-main,
.profile-main {
    width: 100%;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .candidate-profile-sidebar,
    .profile-sidebar {
        flex: 0 0 28%;
        max-width: 28%;
    }

    .candidate-profile-main,
    .profile-main {
        flex: 0 0 72%;
        max-width: 72%;
        margin-top: 0;
    }

    .candidate-profile-summary,
    .profile-summary-card {
        position: sticky;
        top: 1rem;
    }
}

.profile-summary-card {
    text-align: center;
    padding: 28px 24px;
}

.profile-summary-photo {
    width: 112px;
    height: 112px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: var(--ui-shadow-sm);
    margin: 0 auto 16px;
    display: block;
}

.profile-summary-photo-placeholder {
    width: 112px;
    height: 112px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: var(--ui-surface-soft);
    color: var(--ui-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    font-size: var(--ui-fs-xs);
    border: 1px dashed var(--ui-border-strong);
}

.profile-summary-name {
    margin: 0 0 4px;
    color: var(--ui-text);
    font-size: var(--ui-fs-md);
    font-weight: 700;
}

.profile-summary-meta {
    margin: 0 0 4px;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    word-break: break-word;
}

.profile-completeness {
    text-align: left;
    margin: 20px 0 22px;
    padding: 14px 16px;
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
}

.profile-completeness-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
}

.profile-completeness-top strong {
    color: var(--ui-text);
}

.profile-summary-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-summary-actions .btn-primary-action,
.profile-summary-actions .btn-back {
    width: 100%;
    text-decoration: none;
}

.profile-info-card {
    margin-bottom: 16px;
}

.profile-info-card:last-child {
    margin-bottom: 0;
}

.profile-info-card-header {
    padding: 18px 22px 0;
}

.profile-info-card-header h2 {
    margin: 0;
    color: var(--ui-text);
    font-size: var(--ui-fs-md);
    font-weight: 700;
}

.profile-info-card-body {
    padding: 16px 22px 22px;
}

.candidate-profile-dl,
.profile-dl {
    display: grid;
    grid-template-columns: minmax(8rem, 12.5rem) minmax(0, 1fr);
    column-gap: 1rem;
    row-gap: 0.85rem;
    margin: 0;
}

.candidate-profile-dl dt,
.profile-dl dt {
    color: var(--ui-text-secondary);
    font-weight: 400;
    font-size: var(--ui-fs-sm);
    margin: 0;
}

.candidate-profile-dl dd,
.profile-dl dd {
    margin: 0;
    color: var(--ui-text);
    font-size: var(--ui-fs-base);
    font-weight: 400;
}

/* Phones: stack label over value so CPF, phone and course names never break or overflow. */
@media (max-width: 575.98px) {
    .candidate-profile-dl,
    .profile-dl {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 0.2rem;
    }

    .candidate-profile-dl dd,
    .profile-dl dd {
        margin-bottom: 0.65rem;
        overflow-wrap: anywhere;
    }
}

.profile-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--ui-radius-pill);
    font-size: var(--ui-fs-xs);
    font-weight: 700;
}

.profile-badge-yes {
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
}

.profile-badge-no {
    color: var(--ui-text-secondary);
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border);
}

.profile-muted {
    color: var(--ui-text-muted);
    font-weight: 400;
}

.profile-link {
    color: var(--ui-primary);
    font-weight: 600;
    text-decoration: none;
}

.profile-link:hover {
    color: var(--ui-primary-dark);
    text-decoration: underline;
}

/* =============================================================================
   Meu perfil — edit
   ============================================================================= */

.profile-edit-page .curriculo-shell-body,
.profile-form-shell .curriculo-shell-body {
    padding: 28px;
}

.profile-form-content {
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

/* Wide screens: settings layout (section intro on the left, fields on the right)
   so the form uses the whole card instead of a narrow centred column. */
@media (min-width: 992px) {
    .profile-form-content {
        max-width: none;
    }

    .profile-form-content .profile-form-section {
        display: grid;
        grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
        column-gap: 2.5rem;
        align-items: start;
    }

    .profile-form-content .profile-form-section > .profile-form-section-header {
        grid-column: 1;
        grid-row: 1 / span 20;
        margin-bottom: 0;
    }

    .profile-form-content .profile-form-section > :not(.profile-form-section-header) {
        grid-column: 2;
    }

    /* The hint and the actions line up with the fields column. */
    .profile-form-content > .profile-form-hint,
    .profile-form-content > .profile-form-actions {
        margin-left: calc(15rem + 2.5rem);
    }
}

.profile-form-hint {
    margin: 0 0 24px;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.profile-form-section {
    padding-bottom: 1.75rem;
    margin-bottom: 1.75rem;
    border-bottom: 1px solid var(--ui-border);
}

.profile-form-section-last {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: 0;
}

.profile-form-section-header {
    margin-bottom: 1.25rem;
}

.profile-form-section-title {
    margin: 0 0 0.25rem;
    color: var(--ui-text);
    font-size: var(--ui-fs-md);
    font-weight: 700;
}

.profile-form-section-description {
    margin: 0;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.profile-photo-upload {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 576px) {
    .profile-photo-upload {
        flex-direction: row;
        align-items: center;
    }
}

.profile-photo-preview {
    width: 88px;
    height: 88px;
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid var(--ui-border);
    box-shadow: var(--ui-shadow-sm);
}

.profile-photo-preview.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ui-primary-soft);
    color: var(--ui-primary);
    border: 0;
}

.profile-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.profile-file-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
    border: 0;
    border-radius: var(--ui-radius-sm);
    font-weight: 600;
    cursor: pointer;
}

.profile-file-btn:hover {
    background: #e0ebff;
}

.profile-disability-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
}

.profile-choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 8px 14px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-surface);
    cursor: pointer;
    font-weight: 600;
    color: var(--ui-text);
    transition: border-color var(--ui-transition), background var(--ui-transition);
}

.profile-choice:has(input:checked) {
    border-color: #b8c8e8;
    background: var(--ui-primary-soft);
    color: var(--ui-primary-dark);
}

.profile-choice input {
    margin: 0;
    accent-color: var(--ui-primary);
}

.profile-form-actions.form-actions {
    margin-top: 8px;
}

.profile-form-actions .btn-back,
.profile-form-actions .btn-primary-action {
    text-decoration: none;
}

/* Select2 alignment with premium fields */
#course-group .select2-container {
    width: 100% !important;
}

#course-group .select2-container .select2-selection--single {
    min-height: 46px;
    height: 46px;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
}

#course-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 13px;
    color: var(--ui-text);
}

#course-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
}

#course-group .select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #f2f4f7;
}

#course-group .select2-container--default.select2-container--focus .select2-selection--single,
#course-group .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px var(--ui-focus-ring);
}

/* Keep legacy class used by tests for progress bar color token */
.candidate-profile-progress {
    height: 7px;
    background: #edf1f7;
    border-radius: var(--ui-radius-pill);
    overflow: hidden;
}

.candidate-profile-progress .progress-bar,
.candidate-profile-progress .curriculo-progress-bar {
    height: 100%;
    background: var(--ui-primary);
    border-radius: inherit;
}

/* Header back link on edit */
.app-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

@media (max-width: 767.98px) {
    .app-header-actions {
        width: 100%;
    }

    .app-header-actions .btn-back {
        width: 100%;
    }
}

/* =============================================================================
   Auth pages (login, register, password)
   ============================================================================= */

body.login-page,
body.register-page {
    background: var(--ui-background) !important;
    /* AdminLTE centers in a fixed 100vh box, which clips the top of tall forms
       (registration). Grow with the content and only center when it fits. */
    height: auto;
    min-height: 100vh;
    justify-content: safe center;
}

.auth-premium-box.login-box,
.auth-premium-box.register-box {
    width: calc(100% - 2rem);
    max-width: 440px;
    margin: 2.5rem auto;
}

.register-page .auth-premium-box.register-box {
    max-width: 560px;
}

.auth-premium-logo {
    text-align: center;
    margin-bottom: 1.25rem;
}

.auth-premium-logo a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    color: var(--ui-text);
    text-decoration: none;
}

.auth-premium-logo img {
    height: 52px;
    width: auto;
}

/* Same SESC lockup as the public mural, so sign-in looks like the same product. */
.auth-premium-logo img.auth-brand-lockup {
    height: 56px;
}

.auth-premium-logo .brand-text {
    font-size: var(--ui-fs-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ui-text);
}

.auth-premium-card {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-sm);
    background: var(--ui-surface);
    overflow: hidden;
}

.auth-premium-card .card-header {
    background: transparent;
    border-bottom: 1px solid var(--ui-border);
    padding: 1.25rem 1.5rem 1rem;
}

.auth-premium-card .card-title {
    margin: 0;
    color: var(--ui-text);
    font-size: var(--ui-fs-md);
    font-weight: 700;
    text-align: center;
    float: none !important;
}

.auth-premium-card .card-body,
.auth-premium-card .login-card-body,
.auth-premium-card .register-card-body {
    padding: 1.5rem;
}

.auth-premium-card .card-footer {
    background: var(--ui-surface-soft);
    border-top: 1px solid var(--ui-border);
    padding: 1.1rem 1.5rem 1.35rem;
}

.auth-premium-card .card-footer a {
    color: var(--ui-primary);
    font-weight: 600;
}

.auth-premium-card .card-footer a:hover {
    color: var(--ui-primary-dark);
}

.auth-page .form-group label,
.auth-premium-card .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--ui-label);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
}

.auth-page .form-control,
.auth-premium-card .form-control {
    min-height: 46px;
    padding: 10px 13px;
    color: var(--ui-text);
    background: #fff;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    box-shadow: none;
    transition: border-color var(--ui-transition),
                box-shadow var(--ui-transition);
}

.auth-page .form-control:focus,
.auth-premium-card .form-control:focus {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px var(--ui-focus-ring);
}

.auth-page .form-control.is-invalid,
.auth-premium-card .form-control.is-invalid {
    border-color: var(--ui-danger);
    box-shadow: 0 0 0 4px var(--ui-danger-ring);
}

.auth-page .input-group,
.auth-premium-card .input-group {
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
    transition: border-color var(--ui-transition),
                box-shadow var(--ui-transition);
}

.auth-page .input-group:focus-within,
.auth-premium-card .input-group:focus-within {
    border-color: var(--ui-primary);
    box-shadow: 0 0 0 4px var(--ui-focus-ring);
}

.auth-page .input-group:has(.is-invalid),
.auth-premium-card .input-group:has(.is-invalid) {
    border-color: var(--ui-danger);
    box-shadow: 0 0 0 4px var(--ui-danger-ring);
}

.auth-page .input-group .form-control,
.auth-page .input-group .input-group-text,
.auth-page .input-group .btn,
.auth-premium-card .input-group .form-control,
.auth-premium-card .input-group .input-group-text,
.auth-premium-card .input-group .btn {
    border: 0;
    box-shadow: none;
}

.auth-page .input-group-text,
.auth-premium-card .input-group-text {
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border-strong);
    border-left: 0;
    border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0;
    color: var(--ui-text-secondary);
    min-width: 46px;
    justify-content: center;
}

.auth-page .btn-primary-action,
.auth-premium-card .btn-primary-action,
.auth-page .btn.btn-primary,
.auth-premium-card .btn.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 17px;
    border-radius: var(--ui-radius-sm);
    font-weight: 700;
    color: #fff !important;
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-dark)) !important;
    border: 0 !important;
    box-shadow: none;
    transition: transform var(--ui-transition), box-shadow var(--ui-transition);
}

.auth-page .btn-primary-action:hover,
.auth-premium-card .btn-primary-action:hover,
.auth-page .btn.btn-primary:hover,
.auth-premium-card .btn.btn-primary:hover {
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: var(--ui-shadow-sm);
}

.auth-page .btn-back,
.auth-premium-card .btn-back,
.auth-page .btn-outline-primary,
.auth-premium-card .btn-outline-primary,
.auth-page .btn-outline-secondary,
.auth-premium-card .btn-outline-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 11px 17px;
    border-radius: var(--ui-radius-sm);
    font-weight: 700;
    color: #475467 !important;
    background: #fff !important;
    border: 1px solid var(--ui-border-strong) !important;
    box-shadow: none;
    transition: background var(--ui-transition), border-color var(--ui-transition);
}

.auth-page .btn-outline-primary:hover,
.auth-premium-card .btn-outline-primary:hover {
    color: var(--ui-primary-dark) !important;
    background: var(--ui-primary-soft) !important;
    border-color: #b8c8e8 !important;
}

.auth-page .btn-outline-secondary:hover,
.auth-premium-card .btn-outline-secondary:hover {
    background: #f8fafc !important;
}

.auth-page label.auth-remember,
.auth-premium-card label.auth-remember,
.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    color: var(--ui-text);
    font-size: var(--ui-fs-sm);
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

.auth-remember input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--ui-primary);
}

.auth-actions-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 0.5rem;
}

.auth-actions-row .btn-primary-action {
    min-width: 9.5rem;
}

.auth-subtitle {
    margin: 0.35rem 0 0;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    text-align: center;
    font-weight: 500;
}

.auth-alert-success {
    margin-bottom: 1rem;
    padding: 12px 14px;
    border-radius: var(--ui-radius-sm);
    color: var(--ui-success);
    background: var(--ui-success-soft);
    border: 1px solid #c6ebd4;
    font-size: var(--ui-fs-sm);
}

/* Registration wizard on premium shell */
.register-page .auth-premium-box .curriculo-progress {
    margin-bottom: 1.25rem;
}

.register-page .section-heading h2,
.register-page .candidate-registration-step h2 {
    margin: 0 0 1rem;
    color: var(--ui-text);
    font-size: var(--ui-fs-md);
    font-weight: 700;
}

.register-page .candidate-registration-step .btn-block {
    width: 100%;
}

.register-page .form-actions-register {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0.5rem;
}

.register-page .form-actions-register .btn-back,
.register-page .form-actions-register .btn-primary-action {
    flex: 1 1 140px;
}

.validator-action-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.register-page .legal-block {
    padding: 14px 16px;
    margin-bottom: 1rem;
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
}

.register-page .legal-block p {
    margin: 0 0 0.75rem;
    color: var(--ui-text);
    font-weight: 700;
    font-size: var(--ui-fs-sm);
}

.register-page .profile-choice {
    margin-bottom: 0.35rem;
}

/* Registration photo: preview, file name and its actions on one aligned row. */
.registration-photo-selection {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.registration-photo-selection[hidden] {
    display: none;
}

.registration-photo-info {
    min-width: 0;
}

.registration-photo-info #photo-selected-name {
    display: block;
    overflow-wrap: anywhere;
}

.registration-photo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: -0.5rem;
}

.register-page .candidate-registration-upload-preview {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    border-radius: var(--ui-radius-sm);
    border: 1px solid var(--ui-border);
}

.register-page #course-group .select2-container {
    width: 100% !important;
}

.register-page #course-group .select2-container .select2-selection--single {
    min-height: 46px;
    height: 46px;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-sm);
}

.register-page #course-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 44px;
    padding-left: 13px;
    color: var(--ui-text);
}

.register-page #course-group .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
}

.register-page #course-group .select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #f2f4f7;
}

.register-page .input-group .btn {
    border-radius: 0 var(--ui-radius-sm) var(--ui-radius-sm) 0;
    min-height: 46px;
}

@media (max-width: 575.98px) {
    .auth-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-actions-row .btn-primary-action {
        width: 100%;
    }
}


/* Role badges (staff users) */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--ui-radius-pill);
    font-size: var(--ui-fs-xs);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.role-badge-admin {
    color: #6b21a8;
    background: #f3e8ff;
}

.role-badge-manager {
    color: #9a3412;
    background: #ffedd5;
}

.role-badge-validator {
    color: #1d4ed8;
    background: #dbeafe;
}

.role-badge-candidate {
    color: #065f46;
    background: #d1fae5;
}

.staff-users-table thead th {
    border-top: 0;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
}

.staff-users-table td {
    vertical-align: middle;
}

/* Identity column (number + title) keeps a readable width instead of wrapping word by word. */
.staff-users-table td.table-identity-cell {
    min-width: 10.5rem;
}

.staff-users-table td.table-text-cell {
    min-width: 13rem;
}

/* Inscription codes are read whole: never split across lines, body size inside tables. */
.staff-users-table .application-code {
    font-size: var(--ui-fs-base);
    white-space: nowrap;
}

/* Action buttons stack when the row is tight instead of pushing the table sideways. */
.staff-users-table td.table-actions-cell .btn-help {
    margin: 2px 0 2px 4px;
    white-space: nowrap;
}

/* Active filter applied from elsewhere (e.g. the dashboard queue link), removable in place. */
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 6px 4px 12px;
    border: 1px solid var(--ui-border-strong);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-primary-soft);
    color: var(--ui-text);
    font-size: var(--ui-fs-sm);
}

.filter-chip button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--ui-text-secondary);
}

.filter-chip button:hover,
.filter-chip button:focus-visible {
    background: var(--ui-surface);
    color: var(--ui-text);
}

/* Filters and the screen's primary action share one row. */
.staff-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 12px 20px;
}

/* .form-row pulls its edges out by 5px; keep it clear of the action button. */
.staff-toolbar .staff-users-filters > .form-row {
    margin-right: 0;
}

.staff-toolbar .staff-users-filters {
    flex: 1 1 auto;
    min-width: 0;
}

.staff-toolbar-action {
    flex: 0 0 auto;
}

@media (max-width: 767.98px) {
    .staff-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .staff-toolbar-action {
        order: -1;
    }
}

.staff-users-loading {
    min-height: 1.25rem;
}

/* Hints that a table scrolls horizontally, without needing JS to detect it:
   the radial shadows only render while there is more content to reveal on
   that side, because they scroll with the content while the flat fade
   layers stay pinned to the viewport. */
.table-scroll-shadow {
    background:
        linear-gradient(to right, var(--ui-surface) 30%, rgba(255, 255, 255, 0)),
        linear-gradient(to right, rgba(255, 255, 255, 0), var(--ui-surface) 70%) 100% 0,
        radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, .18), rgba(15, 23, 42, 0)),
        radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, .18), rgba(15, 23, 42, 0)) 100% 0;
    background-repeat: no-repeat;
    background-color: var(--ui-surface);
    background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
    background-attachment: local, local, scroll, scroll;
}

@media (max-width: 767.98px) {
    .table-stack-mobile thead {
        display: none;
    }

    .table-stack-mobile,
    .table-stack-mobile tbody {
        display: block;
        width: 100%;
    }

    /* Each row becomes a compact card: identity on top, facts in two columns, actions last. */
    .table-stack-mobile tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: .5rem 1rem;
        border: 1px solid var(--ui-border);
        border-radius: var(--ui-radius-md);
        margin-bottom: .75rem;
        padding: .85rem 1rem;
    }

    .table-stack-mobile td {
        display: block;
        /* Desktop minimum widths would overflow the two-column card. */
        min-width: 0 !important;
        border: 0;
        padding: 0;
        text-align: left !important;
        white-space: normal !important;
    }

    .table-stack-mobile td.table-identity-cell,
    .table-stack-mobile td.table-actions-cell,
    .table-stack-mobile td.table-wide-cell,
    .table-stack-mobile td[colspan] {
        grid-column: 1 / -1;
    }

    /* The identity cell (number, name or title) heads the card whatever its column. */
    .table-stack-mobile td.table-identity-cell {
        order: -1;
    }

    .table-stack-mobile td.table-identity-cell::before {
        display: none !important;
    }

    /* Rows without any action (e.g. not yet effective) end the card without an empty strip. */
    .table-stack-mobile td.table-actions-cell:not(:has(*)) {
        display: none;
    }

    .table-stack-mobile td.table-actions-cell {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .5rem;
        padding-top: .35rem;
    }

    .table-stack-mobile td.table-actions-cell::before {
        display: none !important;
    }

    .table-stack-mobile td.table-actions-cell > .btn-help,
    .table-stack-mobile td.table-actions-cell > .btn-back,
    .table-stack-mobile td.table-actions-cell > button,
    .table-stack-mobile td.table-actions-cell > a {
        width: auto;
        flex: 1 1 auto;
        justify-content: center;
    }

    .table-stack-mobile td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: var(--ui-fs-xs);
        font-weight: 400;
        color: var(--ui-text-secondary);
        margin-bottom: .1rem;
    }

    .table-stack-mobile td[data-label=""] {
        display: none;
    }
}

body.dark-mode .role-badge-admin {
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.2);
}

body.dark-mode .role-badge-manager {
    color: #fed7aa;
    background: rgba(249, 115, 22, 0.18);
}

body.dark-mode .role-badge-validator {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.18);
}

body.dark-mode .role-badge-candidate {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.16);
}

/* Workflow statuses deliberately use a separate semantic palette from user roles. */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--ui-radius-pill);
    font-size: var(--ui-fs-xs);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.status-process-draft {
    color: #344054;
    background: #eaecf0;
}

.status-process-applications-open {
    color: #0f766e;
    background: #ccfbf1;
}

.status-process-in-progress {
    color: #1d4ed8;
    background: #dbeafe;
}

.status-process-suspended {
    color: #92400e;
    background: #fef3c7;
}

.status-process-finished {
    color: #6b21a8;
    background: #f3e8ff;
}

.status-process-cancelled {
    color: #b42318;
    background: #fee4e2;
}

.status-application-awaiting-validation {
    color: #854d0e;
    background: #fef9c3;
}

.status-application-effective {
    color: #166534;
    background: #dcfce7;
}

.status-application-not-effective {
    color: #9a3412;
    background: #ffedd5;
}

/* Pending delivery that can no longer happen (process cancelled/suspended, deadline over): neutral, not an alert. */
.status-application-closed {
    color: #475467;
    background: #eaecf0;
}

.status-publication-draft {
    color: #1e3a5f;
    background: #dbeafe;
}

.status-publication-published {
    color: #047857;
    background: #d1fae5;
}

.status-publication-withdrawn {
    color: #5c6570;
    background: #eceef1;
    text-decoration: line-through;
}

.publication-withdrawal {
    max-width: 18rem;
    white-space: normal;
}

body.dark-mode .status-process-draft {
    color: #d0d5dd;
    background: rgba(152, 162, 179, 0.2);
}

body.dark-mode .status-process-applications-open {
    color: #99f6e4;
    background: rgba(20, 184, 166, 0.2);
}

body.dark-mode .status-process-in-progress {
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.2);
}

body.dark-mode .status-process-suspended {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.2);
}

body.dark-mode .status-process-finished {
    color: #e9d5ff;
    background: rgba(168, 85, 247, 0.2);
}

body.dark-mode .status-process-cancelled {
    color: #fecaca;
    background: rgba(220, 38, 38, 0.2);
}

body.dark-mode .status-application-awaiting-validation {
    color: #fef08a;
    background: rgba(202, 138, 4, 0.2);
}

body.dark-mode .status-application-effective {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.2);
}

body.dark-mode .status-application-not-effective {
    color: #fed7aa;
    background: rgba(249, 115, 22, 0.2);
}

body.dark-mode .status-application-closed {
    color: #c3c9d2;
    background: rgba(152, 162, 179, 0.18);
}

body.dark-mode .status-publication-draft {
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.22);
}

body.dark-mode .status-publication-published {
    color: #a7f3d0;
    background: rgba(16, 185, 129, 0.2);
}

/* Top navigation toggler (candidate/validator on phones): light icon on the dark navbar. */
body.dark-mode .main-header .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.25);
}

body.dark-mode .main-header .navbar-toggler-icon {
    filter: invert(1) brightness(1.4);
}

body.dark-mode .status-publication-withdrawn {
    color: #c3c9d2;
    background: rgba(152, 162, 179, 0.18);
}

/* =============================================================================
   Dark mode (AdminLTE toggles body.dark-mode)
   Premium tokens + overrides for remaining light hardcodes
   ============================================================================= */

body.dark-mode {
    --ui-navy: #0b2c6b;
    --ui-gold: #e2b441;
    --ui-primary: #9db0d8;
    --ui-primary-dark: #c5d0ea;
    --ui-primary-soft: rgba(157, 176, 216, 0.14);

    --ui-success: #3dcf7a;
    --ui-success-soft: rgba(61, 207, 122, 0.14);

    --ui-danger: #f07178;
    --ui-danger-soft: rgba(240, 113, 120, 0.14);

    --ui-warning: #e0b35a;
    --ui-warning-soft: rgba(224, 179, 90, 0.14);

    --ui-text: #f3f5f2;
    --ui-text-secondary: #b7c0cc;
    --ui-text-muted: #8b96a6;

    --ui-border: #243356;
    --ui-border-strong: #31456e;

    --ui-background: #071428;
    --ui-surface: #0e1c38;
    --ui-surface-soft: #0b1830;

    --ui-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.28);
    --ui-shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);

    --ui-progress-track: #1a2c4e;
    --ui-step-circle: #1a2c4e;
    --ui-input-bg: #0b1830;
    --ui-input-disabled: #122140;
    --ui-hover-soft: rgba(157, 176, 216, 0.08);
    --ui-focus-ring: rgba(226, 180, 65, 0.28);
    --ui-danger-ring: rgba(240, 113, 120, 0.18);
    --ui-danger-border: rgba(240, 113, 120, 0.35);
    --ui-warning-border: rgba(224, 179, 90, 0.35);
    --ui-success-border: rgba(61, 207, 122, 0.3);
    --ui-label: #c5cddb;
    --ui-btn-secondary-text: #c5cddb;
    --ui-btn-secondary-bg: #0e1c38;
    --ui-btn-secondary-hover: #1a2c4e;
    --ui-primary-mid: #c5d0ea;
}

/* Light defaults for variables used only in dark overrides first (define on :root) */
:root {
    --ui-progress-track: #edf1f7;
    --ui-step-circle: #eef2f7;
    --ui-input-bg: #fff;
    --ui-input-disabled: #f2f4f7;
    --ui-hover-soft: #f6f9ff;
    --ui-focus-ring: rgba(226, 180, 65, 0.35);
    --ui-danger-ring: rgba(220, 89, 98, 0.10);
    --ui-danger-border: #ffd4d8;
    --ui-warning-border: #f2dfa8;
    --ui-success-border: #c6ebd4;
    --ui-label: #344054;
    --ui-btn-secondary-text: #475467;
    --ui-btn-secondary-bg: #fff;
    --ui-btn-secondary-hover: #f8fafc;
    --ui-primary-mid: #1a3f8a;
}

/* Page chrome */
body.dark-mode .content-wrapper,
body.dark-mode.login-page,
body.dark-mode.register-page {
    background: var(--ui-background) !important;
    color: var(--ui-text);
}

body.dark-mode .main-header {
    background-color: var(--ui-surface) !important;
    border-bottom-color: var(--ui-border) !important;
    color: var(--ui-text);
}

body.dark-mode .main-header .nav-link,
body.dark-mode .main-header .navbar-nav .nav-link {
    color: var(--ui-text-secondary) !important;
}

body.dark-mode .main-header .nav-link:hover {
    color: var(--ui-text) !important;
}

body.dark-mode .content-header,
body.dark-mode .content-header h1 {
    color: var(--ui-text);
}

/* Surfaces */
body.dark-mode .curriculo-shell,
body.dark-mode .auth-premium-card,
body.dark-mode .entry-card,
body.dark-mode .card {
    background: var(--ui-surface) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text);
    box-shadow: var(--ui-shadow-md);
}

body.dark-mode .entry-card-header,
body.dark-mode .auth-premium-card .card-footer,
body.dark-mode .profile-completeness,
body.dark-mode .empty-option,
body.dark-mode .empty-confirm,
body.dark-mode .legal-block {
    background: var(--ui-surface-soft) !important;
    border-color: var(--ui-border) !important;
    color: var(--ui-text);
}

body.dark-mode .empty-option:hover,
body.dark-mode .empty-option.is-checked {
    border-color: rgba(157, 176, 216, 0.45);
    background: var(--ui-hover-soft) !important;
}

body.dark-mode .entry-card:focus-within {
    border-color: rgba(157, 176, 216, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Typography */
body.dark-mode .curriculo-title,
body.dark-mode .section-heading h2,
body.dark-mode .profile-summary-name,
body.dark-mode .profile-form-section-title,
body.dark-mode .profile-info-card-header h2,
body.dark-mode .entry-index,
body.dark-mode .auth-premium-logo .brand-text,
body.dark-mode .auth-premium-card .card-title,
body.dark-mode .candidate-registration-step h2 {
    color: var(--ui-text) !important;
}

body.dark-mode .curriculo-subtitle,
body.dark-mode .section-heading p,
body.dark-mode .profile-summary-meta,
body.dark-mode .profile-form-section-description,
body.dark-mode .profile-form-hint,
body.dark-mode .auth-subtitle,
body.dark-mode .form-text,
body.dark-mode .char-counter,
body.dark-mode .text-muted,
body.dark-mode .profile-muted,
body.dark-mode .empty-option small {
    color: var(--ui-text-secondary) !important;
}

body.dark-mode .candidate-profile-dl dt,
body.dark-mode .profile-dl dt {
    color: var(--ui-text-secondary) !important;
}

body.dark-mode .candidate-profile-dl dd,
body.dark-mode .profile-dl dd {
    color: var(--ui-text) !important;
}

/* Progress / stepper */
body.dark-mode .curriculo-progress,
body.dark-mode .candidate-profile-progress {
    background: var(--ui-progress-track) !important;
}

body.dark-mode .curriculo-progress-bar,
body.dark-mode .candidate-profile-progress .progress-bar,
body.dark-mode .candidate-profile-progress .curriculo-progress-bar {
    background: linear-gradient(90deg, var(--ui-primary), var(--ui-primary-mid)) !important;
}

body.dark-mode .step-circle {
    background: var(--ui-step-circle);
    color: var(--ui-text-secondary);
}

body.dark-mode .curriculo-step:not(:last-child)::after {
    background: var(--ui-border);
}

body.dark-mode .curriculo-step.is-complete:not(:last-child)::after,
body.dark-mode .curriculo-step.is-filled:not(:last-child)::after {
    background: var(--ui-primary);
}

body.dark-mode .curriculo-step.is-complete .step-circle {
    background: var(--ui-success-soft);
    color: var(--ui-success);
}

body.dark-mode .curriculo-step.is-active .step-circle {
    background: var(--ui-primary);
    color: #fff;
    box-shadow: 0 0 0 6px var(--ui-focus-ring);
}

body.dark-mode .curriculo-step.is-active span {
    color: var(--ui-text);
}

/* Forms */
body.dark-mode .form-group label,
body.dark-mode .content-wrapper .form-group label,
body.dark-mode .auth-page .form-group label,
body.dark-mode .auth-premium-card .form-group label,
body.dark-mode .curriculo-page .form-group label {
    color: var(--ui-label) !important;
}

body.dark-mode .form-control,
body.dark-mode .content-wrapper .form-control,
body.dark-mode .auth-page .form-control,
body.dark-mode .auth-premium-card .form-control,
body.dark-mode .curriculo-page .form-control,
body.dark-mode select.form-control,
body.dark-mode textarea.form-control {
    color: var(--ui-text) !important;
    background-color: var(--ui-input-bg) !important;
    border-color: var(--ui-border-strong) !important;
}

body.dark-mode .form-control:focus,
body.dark-mode .content-wrapper .form-control:focus,
body.dark-mode .auth-page .form-control:focus,
body.dark-mode .auth-premium-card .form-control:focus,
body.dark-mode .curriculo-page .form-control:focus {
    border-color: var(--ui-primary) !important;
    box-shadow: 0 0 0 4px var(--ui-focus-ring) !important;
    background-color: var(--ui-input-bg) !important;
    color: var(--ui-text) !important;
}

body.dark-mode .form-control:disabled,
body.dark-mode .form-control[readonly],
body.dark-mode .content-wrapper .form-control:disabled,
body.dark-mode .content-wrapper .form-control[readonly] {
    color: var(--ui-text-secondary) !important;
    background-color: var(--ui-input-disabled) !important;
    border-color: var(--ui-border) !important;
}

body.dark-mode .form-control.is-invalid,
body.dark-mode .content-wrapper .form-control.is-invalid {
    border-color: var(--ui-danger) !important;
    box-shadow: 0 0 0 4px var(--ui-danger-ring) !important;
}

body.dark-mode .invalid-feedback,
body.dark-mode .content-wrapper .invalid-feedback {
    color: var(--ui-danger) !important;
}

body.dark-mode .input-group-text,
body.dark-mode .auth-page .input-group-text,
body.dark-mode .auth-premium-card .input-group-text,
body.dark-mode .curriculo-page .input-group-text {
    background: var(--ui-surface-soft) !important;
    border-color: var(--ui-border-strong) !important;
    color: var(--ui-text-secondary) !important;
}

body.dark-mode .auth-page .input-group .form-control,
body.dark-mode .auth-page .input-group .input-group-text,
body.dark-mode .auth-page .input-group .btn,
body.dark-mode .auth-premium-card .input-group .form-control,
body.dark-mode .auth-premium-card .input-group .input-group-text,
body.dark-mode .auth-premium-card .input-group .btn {
    border: 0 !important;
    box-shadow: none !important;
}

body.dark-mode .auth-page .input-group:focus-within,
body.dark-mode .auth-premium-card .input-group:focus-within {
    border-color: var(--ui-primary) !important;
    box-shadow: 0 0 0 4px var(--ui-focus-ring) !important;
}

body.dark-mode .auth-page .input-group:has(.is-invalid),
body.dark-mode .auth-premium-card .input-group:has(.is-invalid) {
    border-color: var(--ui-danger) !important;
    box-shadow: 0 0 0 4px var(--ui-danger-ring) !important;
}

body.dark-mode .form-control::placeholder {
    color: var(--ui-text-muted);
    opacity: 1;
}

/* Buttons */
body.dark-mode .btn-help,
body.dark-mode .profile-file-btn {
    color: var(--ui-primary) !important;
    background: var(--ui-primary-soft) !important;
}

body.dark-mode .btn-help:hover,
body.dark-mode .profile-file-btn:hover {
    color: var(--ui-primary-mid) !important;
    background: rgba(157, 176, 216, 0.24) !important;
}

body.dark-mode .btn-back,
body.dark-mode .auth-page .btn-back,
body.dark-mode .auth-premium-card .btn-back,
body.dark-mode .auth-page .btn-outline-primary,
body.dark-mode .auth-premium-card .btn-outline-primary,
body.dark-mode .auth-page .btn-outline-secondary,
body.dark-mode .auth-premium-card .btn-outline-secondary {
    color: var(--ui-btn-secondary-text) !important;
    background: var(--ui-btn-secondary-bg) !important;
    border-color: var(--ui-border-strong) !important;
}

body.dark-mode .btn-back:hover,
body.dark-mode .auth-page .btn-outline-secondary:hover,
body.dark-mode .auth-premium-card .btn-outline-secondary:hover {
    background: var(--ui-btn-secondary-hover) !important;
    color: var(--ui-text) !important;
}

body.dark-mode .auth-page .btn-outline-primary:hover,
body.dark-mode .auth-premium-card .btn-outline-primary:hover {
    color: var(--ui-primary-mid) !important;
    background: var(--ui-primary-soft) !important;
    border-color: rgba(157, 176, 216, 0.45) !important;
}

body.dark-mode .btn-add-entry {
    color: var(--ui-primary) !important;
    background: transparent !important;
    border-color: rgba(157, 176, 216, 0.45) !important;
}

body.dark-mode .btn-add-entry:hover:not(:disabled) {
    color: var(--ui-primary-mid) !important;
    background: var(--ui-primary-soft) !important;
    border-color: var(--ui-primary) !important;
}

body.dark-mode .btn-remove-entry {
    color: var(--ui-danger) !important;
}

body.dark-mode .btn-remove-entry:hover:not(:disabled) {
    background: var(--ui-danger-soft) !important;
    border-color: var(--ui-danger-border) !important;
}

body.dark-mode .btn-primary-action,
body.dark-mode .auth-page .btn-primary-action,
body.dark-mode .auth-premium-card .btn-primary-action,
body.dark-mode .auth-page .btn.btn-primary,
body.dark-mode .auth-premium-card .btn.btn-primary {
    /* Light fill in dark mode, so the label must be dark to stay readable. */
    color: var(--ui-background) !important;
    background: linear-gradient(135deg, var(--ui-primary), var(--ui-primary-dark)) !important;
    box-shadow: none;
}

/* Choices / badges */
body.dark-mode .profile-choice {
    background: var(--ui-surface);
    border-color: var(--ui-border);
    color: var(--ui-text);
}

body.dark-mode .profile-choice:has(input:checked) {
    border-color: rgba(157, 176, 216, 0.45);
    background: var(--ui-primary-soft);
    color: var(--ui-primary-mid);
}

body.dark-mode .profile-badge-yes {
    color: var(--ui-primary-mid);
    background: var(--ui-primary-soft);
}

body.dark-mode .profile-badge-no {
    color: var(--ui-text-secondary);
    background: var(--ui-surface-soft);
    border-color: var(--ui-border);
}

body.dark-mode .profile-link {
    color: var(--ui-primary-mid);
}

body.dark-mode .profile-link:hover {
    color: #9db4ff;
}

/* Link to the record an audit event affected (navy; --ui-primary turns light in dark mode). */
.audit-subject-link {
    color: var(--ui-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.audit-subject-link:hover,
.audit-subject-link:focus-visible {
    color: var(--ui-primary-dark);
}

/* Notices / alerts */
body.dark-mode .curriculo-notice {
    color: var(--ui-warning);
    background: var(--ui-warning-soft);
    border-color: var(--ui-warning-border);
}

body.dark-mode .notice-icon {
    background: rgba(224, 179, 90, 0.16);
}

body.dark-mode .curriculo-alert-danger {
    color: var(--ui-danger);
    background: var(--ui-danger-soft);
    border-color: var(--ui-danger-border);
}

body.dark-mode .auth-alert-success {
    color: var(--ui-success);
    background: var(--ui-success-soft);
    border-color: var(--ui-success-border);
}

/* Photos / placeholders */
body.dark-mode .profile-summary-photo {
    border-color: var(--ui-surface);
}

body.dark-mode .profile-summary-photo-placeholder,
body.dark-mode .profile-photo-preview.placeholder {
    background: var(--ui-primary-soft);
    color: var(--ui-primary-mid);
}

body.dark-mode .profile-photo-preview {
    border-color: var(--ui-border);
}

/* Select2 dark */
body.dark-mode #course-group .select2-container .select2-selection--single {
    background: var(--ui-input-bg) !important;
    border-color: var(--ui-border-strong) !important;
    color: var(--ui-text);
}

body.dark-mode #course-group .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--ui-text) !important;
}

body.dark-mode #course-group .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: var(--ui-text-muted) !important;
}

body.dark-mode #course-group .select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: var(--ui-input-disabled) !important;
}

body.dark-mode #course-group .select2-container--default.select2-container--focus .select2-selection--single,
body.dark-mode #course-group .select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--ui-primary) !important;
    box-shadow: 0 0 0 4px var(--ui-focus-ring) !important;
}

body.dark-mode .select2-dropdown {
    background: var(--ui-surface);
    border-color: var(--ui-border);
    color: var(--ui-text);
}

body.dark-mode .select2-container--default .select2-results__option--highlighted[aria-selected],
body.dark-mode .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background: var(--ui-primary) !important;
    color: #fff !important;
}

body.dark-mode .select2-container--default .select2-search--dropdown .select2-search__field {
    background: var(--ui-input-bg);
    border-color: var(--ui-border-strong);
    color: var(--ui-text);
}

/* Auth extras */
body.dark-mode .auth-premium-logo a {
    color: var(--ui-text);
}

body.dark-mode .auth-remember {
    color: var(--ui-text);
}

body.dark-mode .auth-premium-card .card-footer a,
body.dark-mode .auth-premium-card .card-footer {
    color: var(--ui-text-secondary);
}

body.dark-mode .auth-premium-card .card-footer a {
    color: var(--ui-primary-mid);
}

body.dark-mode .register-page .input-group .btn {
    background: var(--ui-surface-soft);
    color: var(--ui-text-secondary);
}

/* Modal */
body.dark-mode .curriculo-modal .modal-content {
    background: var(--ui-surface);
    color: var(--ui-text);
}

body.dark-mode .curriculo-modal .modal-header,
body.dark-mode .curriculo-modal .modal-footer {
    border-color: var(--ui-border);
}

body.dark-mode .curriculo-modal .modal-title {
    color: var(--ui-text);
}

body.dark-mode .curriculo-modal .modal-body {
    color: var(--ui-text-secondary);
}

body.dark-mode .curriculo-modal .close {
    color: var(--ui-text);
    text-shadow: none;
    opacity: 0.75;
}

body.dark-mode .manager-curriculum-section-band {
    background: var(--ui-surface-soft);
    border-color: var(--ui-border);
}

body.dark-mode .manager-curriculum-section + .manager-curriculum-section,
body.dark-mode .manager-curriculum-entry + .manager-curriculum-entry {
    border-color: var(--ui-border);
}

/* Form action separators */
body.dark-mode .form-actions {
    border-top-color: var(--ui-border);
}

body.dark-mode .profile-form-section {
    border-bottom-color: var(--ui-border);
}

/* Empty option icon */
body.dark-mode .empty-option-icon {
    background: var(--ui-primary-soft);
    color: var(--ui-primary-mid);
}

/* Inline checks */
body.dark-mode .inline-check {
    color: var(--ui-text);
}

/* Soften AdminLTE default dark body so premium surfaces stand out */
body.dark-mode {
    background-color: var(--ui-background) !important;
}

/* ===== Selection processes (candidate / manager / validator) ===== */
.process-hero-stats {
    gap: 1rem;
}

.process-stat {
    display: flex;
    flex-direction: column;
    min-width: 7rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface-soft, #f5f7fb);
    border: 1px solid var(--ui-border, #e5e9f2);
}

.process-stat strong {
    font-size: var(--ui-fs-lg);
    line-height: 1.2;
    color: var(--ui-text, #1f2937);
}

.process-stat span {
    font-size: var(--ui-fs-xs);
    color: var(--ui-text-secondary, #6b7280);
}

.process-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.15rem 1.2rem;
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface, #fff);
    border: 1px solid var(--ui-border, #e5e9f2);
    box-shadow: var(--ui-shadow-sm);
}

.process-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
}

.process-card-ref {
    font-size: var(--ui-fs-xs);
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--ui-text-secondary, #6b7280);
}

.process-card-title {
    font-size: var(--ui-fs-md);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    color: var(--ui-text, #1f2937);
}

.process-card-job {
    font-weight: 400;
    color: var(--ui-text-secondary);
}

.process-card-meta li {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
    font-size: var(--ui-fs-sm);
    color: var(--ui-text-secondary, #4b5563);
}

/* Label/value rows: the label is quiet, the value carries the information. */
.meta-label {
    color: var(--ui-text-secondary);
    font-weight: 400;
}

.process-card-meta li:has(.meta-label) {
    color: var(--ui-text);
}

/* Job title inside a process summary: below the section title in the hierarchy. */
.process-position-title {
    margin: 4px 0 8px;
    color: var(--ui-text);
    font-size: var(--ui-fs-base);
    font-weight: 600;
}

.process-card-meta i {
    width: 1rem;
    margin-top: 0.2rem;
    color: var(--ui-primary-mid, #0b2c6b);
    opacity: 0.85;
}

.process-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
}

a.process-card-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

a.process-card-link:hover,
a.process-card-link:focus {
    color: inherit;
    text-decoration: none;
}

a.process-card-link:hover .process-card {
    border-color: var(--ui-navy);
}

.public-food-note {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    font-size: var(--ui-fs-sm);
    color: var(--ui-text-secondary, #4b5563);
}

.public-food-note i {
    color: var(--ui-primary-mid, #0b2c6b);
}

.process-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    font-weight: 700;
    font-size: var(--ui-fs-sm);
    color: var(--ui-primary-mid, #0b2c6b);
}

a.process-card-link:hover .process-card-cta,
a.process-card-link:focus .process-card-cta {
    text-decoration: underline;
}

/* Candidate home: each application appears once, with its status and next step. */
.my-application {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem 1.25rem;
    padding: 1rem 0;
    border-top: 1px solid var(--ui-border, #e5e9f2);
}

.my-application:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.my-application-body {
    flex: 1 1 18rem;
    min-width: 0;
}

.my-application-title {
    font-size: var(--ui-fs-md);
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.5rem;
    color: var(--ui-text, #1f2937);
}

.my-application-job {
    display: block;
    margin-top: 2px;
    font-size: var(--ui-fs-sm);
    font-weight: 400;
    color: var(--ui-text-secondary);
}

/* Phones: extra filters wait behind the "Filtros" toggle so the list comes first. */
@media (max-width: 767.98px) {
    .home-more-filters:not(.is-open) {
        display: none;
    }
}

.process-header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.process-stat-card .process-stat-value {
    font-size: var(--ui-fs-lg);
    font-weight: 700;
    color: var(--ui-text, #1f2937);
}

.dashboard-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.dashboard-kpi,
.dashboard-context-metric {
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-sm);
}

.dashboard-kpi {
    display: grid;
    gap: 8px;
    min-height: 0;
    padding: 16px 18px;
}

.dashboard-kpi-icon,
.dashboard-context-metric-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--ui-radius-md);
    color: var(--ui-primary);
    background: var(--ui-primary-soft);
}

.dashboard-kpi > span,
.dashboard-context-metric span {
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
}

.dashboard-kpi > strong,
.dashboard-context-metric strong {
    color: var(--ui-text);
    font-size: var(--ui-fs-xl);
    line-height: 1.15;
}

.dashboard-kpi small,
.dashboard-context-metric small {
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
}

.dashboard-kpi a {
    align-self: end;
    color: var(--ui-primary);
    font-size: var(--ui-fs-sm);
    font-weight: 700;
}

.dashboard-kpi--warning .dashboard-kpi-icon {
    color: var(--ui-warning);
    background: var(--ui-warning-soft);
}

.dashboard-kpi--success .dashboard-kpi-icon,
.dashboard-context-metric--success .dashboard-context-metric-icon {
    color: var(--ui-success);
    background: var(--ui-success-soft);
}

.dashboard-kpi--danger .dashboard-kpi-icon,
.dashboard-context-metric--danger .dashboard-context-metric-icon {
    color: var(--ui-danger);
    background: var(--ui-danger-soft);
}

.dashboard-context-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.dashboard-context-metric {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
}

.dashboard-context-metric > div:last-child {
    display: grid;
    gap: 4px;
}

@media (max-width: 991px) {
    .dashboard-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575px) {
    .dashboard-kpis,
    .dashboard-context-metrics {
        grid-template-columns: 1fr;
    }
}

.attention-item {
    color: var(--ui-text, #1f2937);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.attention-item:hover {
    background: var(--ui-surface-soft, #f5f7fb);
    border-color: var(--ui-border, #e5e9f2);
    text-decoration: none;
    color: var(--ui-text, #1f2937);
}

.application-code {
    font-size: var(--ui-fs-lg);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.application-qr img {
    border-radius: var(--ui-radius-md);
    border: 1px solid var(--ui-border, #e5e9f2);
    padding: 0.5rem;
    background: #fff;
}

.wizard-steps .btn-help.is-active {
    background: var(--ui-primary-soft, #e8efff);
    color: var(--ui-primary-mid, #0b2c6b);
    border-color: var(--ui-primary-mid, #0b2c6b);
}

.process-position-block + .process-position-block {
    border-top: 1px solid var(--ui-border, #e5e9f2);
    padding-top: 1rem;
}

body.dark-mode .process-card,
body.dark-mode .process-stat {
    background: var(--ui-surface);
    border-color: var(--ui-border);
}

body.dark-mode .process-card-title,
body.dark-mode .process-stat strong,
body.dark-mode .process-stat-value {
    color: var(--ui-text);
}

body.dark-mode .application-qr img {
    background: #fff;
}

.delivery-result {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 1.5rem;
}

.delivery-result-card {
    width: 100%;
    max-width: 560px;
    padding: 2.25rem 2rem 2rem;
    text-align: center;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-sm);
}

.delivery-result-card--success {
    border-color: color-mix(in srgb, var(--ui-success) 28%, var(--ui-border));
}

.delivery-result-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 88px;
    height: 88px;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    color: var(--ui-success);
    background: var(--ui-success-soft);
    font-size: var(--ui-fs-2xl);
}

.delivery-result-title {
    margin: 0 0 0.5rem;
    color: var(--ui-text);
    font-size: var(--ui-fs-xl);
    font-weight: 700;
    line-height: 1.2;
}

.delivery-result-lead {
    margin: 0 auto 1.75rem;
    max-width: 28rem;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-md);
    line-height: 1.45;
}

.delivery-result-facts {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1.75rem;
    padding: 0;
    list-style: none;
    text-align: left;
}

.delivery-result-facts li {
    display: grid;
    gap: 0.15rem;
    padding: 0.85rem 1rem;
    background: var(--ui-surface-soft);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
}

.delivery-result-facts span {
    color: var(--ui-text-muted);
    font-size: var(--ui-fs-xs);
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.delivery-result-facts strong {
    color: var(--ui-text);
    font-size: var(--ui-fs-base);
    font-weight: 600;
}

.delivery-result-card .btn-back {
    justify-content: center;
}

/* Confirm (primary) above the way back, both full width on the desk's phone. */
.delivery-result-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 1.25rem;
}

.delivery-result-actions .btn-primary-action {
    min-height: 52px;
    justify-content: center;
}

body.dark-mode .delivery-result-card {
    background: var(--ui-surface);
    border-color: var(--ui-border);
}

body.dark-mode .delivery-result-card--success {
    border-color: color-mix(in srgb, var(--ui-success) 40%, var(--ui-border));
}

body.dark-mode .delivery-result-facts li {
    background: var(--ui-surface-soft);
    border-color: var(--ui-border);
}

/* ===== Public portal ===== */
.public-portal-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--ui-background, #f4f6fb);
    color: var(--ui-text, #1f2937);
}

.public-header {
    background: #fff;
    border-bottom: 1px solid var(--ui-border, #e5e9f2);
    box-shadow: 0 1px 0 var(--ui-border);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.public-header-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    min-height: 4.75rem;
    padding: 0.85rem 1.25rem;
    width: 100%;
    max-width: 1320px;
    margin-left: auto;
    margin-right: auto;
}

.public-brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    text-decoration: none;
    color: inherit;
    line-height: 0;
}

.public-brand:hover {
    text-decoration: none;
    color: inherit;
    opacity: 0.92;
}

/* Logo is a wide horizontal mark — size by height, never force a square box */
.public-brand-logo {
    display: block;
    height: 3.75rem;
    width: auto;
    max-width: none;
    object-fit: contain;
    object-position: left center;
}

.public-nav-links {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.public-nav-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.55rem;
}

.public-nav-link {
    color: var(--ui-text-secondary, #4b5563);
    font-weight: 600;
    font-size: var(--ui-fs-base);
    line-height: 1.2;
    text-decoration: none;
    padding: 0.6rem 0.9rem;
    border-radius: var(--ui-radius-sm);
    white-space: nowrap;
}

/* External tab (previous processes on the SESC site): a quiet icon says it leaves the platform. */
.public-nav-link-external i {
    margin-left: 0.3rem;
    font-size: var(--ui-fs-xs);
    opacity: 0.7;
}

.public-nav-link:hover,
.public-nav-link.is-active {
    color: var(--ui-primary-mid, #0b2c6b);
    background: var(--ui-primary-soft, #e8efff);
    text-decoration: none;
}

.public-nav-cta {
    white-space: nowrap;
    min-height: 2.6rem;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    font-size: var(--ui-fs-base);
}

.public-header .public-nav-cta.btn-back,
.public-header .public-nav-cta.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

/* Tablets and small laptops: logo, four tabs and two buttons do not fit one row; tabs get their own. */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .public-header-inner {
        flex-wrap: wrap;
        gap: 0.5rem 1rem;
    }

    .public-nav-links {
        order: 3;
        flex: 1 1 100%;
        margin-left: 0;
    }
}

@media (max-width: 767.98px) {
    .public-header-inner {
        flex-wrap: wrap;
        align-items: center;
        min-height: 0;
        padding: 0.55rem 0.75rem 0.45rem;
        gap: 0.45rem 0.65rem;
        overflow: visible;
    }

    .public-brand {
        flex: 0 1 auto;
        min-width: 0;
    }

    .public-brand-logo {
        height: 2.25rem;
        max-width: none;
        width: auto;
        object-fit: contain;
        object-position: left center;
    }

    .public-nav-links {
        order: 3;
        flex: 1 1 100%;
        margin-left: 0;
        min-width: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
    }

    .public-nav-actions {
        flex: 0 0 auto;
        margin-left: auto;
        width: auto;
        flex-wrap: nowrap;
    }

    /* Four tabs share the phone width instead of pushing the last one off screen. */
    .public-nav-link {
        flex: 1 1 auto;
        font-size: var(--ui-fs-sm);
        padding: 0.5rem 0.35rem;
        text-align: center;
    }

    .public-nav-link-external i {
        margin-left: 0.2rem;
    }

    .public-nav-cta {
        min-height: 2.4rem;
        font-size: var(--ui-fs-sm);
        padding-left: 0.8rem !important;
        padding-right: 0.8rem !important;
    }
}

/* Narrow phones (below 390px): tighter tabs, no external icon (screen readers keep the hint). */
@media (max-width: 389.98px) {
    .public-nav-link {
        font-size: var(--ui-fs-xs);
        padding: 0.5rem 0.2rem;
    }

    .public-nav-link-external i {
        display: none;
    }
}

/* Keep public header actions compact even under global mobile full-width button rules */
@media (max-width: 767.98px) {
    .public-header .public-nav-cta.btn-back,
    .public-header .public-nav-cta.btn-primary-action {
        width: auto;
    }
}

.public-main {
    flex: 1 0 auto;
}

/* AdminLTE narrows .container to 7.5px gutters; the public pages keep 16px. */
.public-main > .container,
.public-header-inner,
.public-footer .container,
.public-footer .container-xl {
    padding-left: 16px;
    padding-right: 16px;
}

.public-footer {
    margin-top: auto;
    background: #1e3a5f;
    color: rgba(255, 255, 255, 0.88);
    padding: 1.5rem 0;
}

.public-footer a {
    color: #fff;
    text-decoration: underline;
}

.public-footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.public-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.public-footer-logo {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: contain;
    border-radius: var(--ui-radius-sm);
    background: #fff;
    padding: 0.25rem;
}

.public-hero-kicker {
    font-size: var(--ui-fs-xs);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ui-primary-mid, #0b2c6b);
    margin: 0;
}

.public-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.public-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--ui-border, #e5e9f2);
    background: var(--ui-surface, #fff);
    color: var(--ui-text-secondary, #4b5563);
    border-radius: var(--ui-radius-pill);
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    font-size: var(--ui-fs-sm);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.public-tab:hover {
    border-color: var(--ui-primary-mid, #0b2c6b);
    color: var(--ui-primary-mid, #0b2c6b);
}

.public-tab.is-active {
    background: var(--ui-primary-soft, #e8efff);
    border-color: var(--ui-primary-mid, #0b2c6b);
    color: var(--ui-primary-mid, #0b2c6b);
}

.public-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: var(--ui-radius-pill);
    background: rgba(11, 44, 107), 0.12);
    font-size: var(--ui-fs-xs);
    font-weight: 700;
}

.public-empty {
    border: 1px dashed var(--ui-border, #e5e9f2);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface-soft, #f8fafc);
}

/* ===== Public home (minimal list) ===== */
.public-page-header {
    max-width: 40rem;
}

.public-page-header .curriculo-title {
    font-size: var(--ui-fs-xl);
}

.public-process-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.public-process-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface, #fff);
    border: 1px solid var(--ui-border, #e5e9f2);
    box-shadow: var(--ui-shadow-sm);
}

.public-process-row-main {
    flex: 1 1 16rem;
    min-width: 0;
}

.public-process-row-title {
    font-size: var(--ui-fs-md);
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 0.35rem;
    color: var(--ui-text, #1f2937);
}

.public-process-row-meta {
    font-size: var(--ui-fs-sm);
    color: var(--ui-text-secondary, #6b7280);
}

.public-meta-sep {
    margin: 0 0.35rem;
    opacity: 0.6;
}

.public-process-row-action {
    flex: 0 0 auto;
}

.public-home-minimal .public-empty {
    border-radius: var(--ui-radius-md);
    border: 1px dashed var(--ui-border, #e5e9f2);
    background: var(--ui-surface, #fff);
}

.public-previous-note {
    display: flex;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.85rem 1rem;
    border: 1px solid var(--ui-border, #e5e9f2);
    border-radius: var(--ui-radius-md);
    background: var(--ui-surface, #fff);
    font-size: var(--ui-fs-sm);
    color: var(--ui-text-secondary, #5c6570);
}

.public-previous-note > .fa-archive {
    color: var(--ui-primary, #0b2c6b);
}

.public-previous-note strong {
    color: var(--ui-text, #1a1f18);
}

.public-previous-note a {
    font-weight: 600;
    color: var(--ui-primary, #0b2c6b);
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .public-process-row-action {
        width: 100%;
    }

    .public-process-row-action .btn-primary-action {
        width: 100%;
        justify-content: center;
    }
}

/* City combobox (Alpine searchable, Maranhão municipalities) */
.city-combobox {
    position: relative;
}

.city-combobox-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    text-align: left;
    color: var(--ui-text, #1f2937);
    background: #fff;
    border: 1px solid var(--ui-border-strong, #d0d5dd);
    border-radius: var(--ui-radius-sm);
    font-size: var(--ui-fs-base);
    line-height: 1.4;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.city-combobox.is-invalid .city-combobox-trigger {
    border-color: var(--ui-danger, #dc5962);
}

.city-combobox-trigger:hover,
.city-combobox-trigger:focus {
    border-color: var(--ui-primary-mid, #0b2c6b);
    outline: none;
    box-shadow: 0 0 0 3px rgba(11, 44, 107, 0.12);
}

.city-combobox-value {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.city-combobox-value.is-placeholder {
    color: var(--ui-text-secondary, #6b7280);
}

.city-combobox-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--ui-text-secondary, #6b7280);
    flex: 0 0 auto;
}

.city-combobox-clear {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: var(--ui-radius-pill);
    color: var(--ui-text-secondary, #6b7280);
}

.city-combobox-clear:hover {
    background: var(--ui-surface-soft, #f5f7fb);
    color: var(--ui-text, #1f2937);
}

.city-combobox-caret {
    font-size: var(--ui-fs-xs);
    opacity: 0.75;
}

.city-combobox-panel {
    position: absolute;
    z-index: 1060;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--ui-border, #e5e9f2);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-overlay);
}

.city-combobox-search {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.8rem;
    border-bottom: 1px solid var(--ui-border, #e5e9f2);
    color: var(--ui-text-secondary, #6b7280);
}

.city-combobox-search-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--ui-text, #1f2937);
    font-size: var(--ui-fs-base);
}

.city-combobox-list {
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    max-height: 240px;
    overflow-y: auto;
}

.city-combobox-option {
    padding: 0.55rem 0.7rem;
    border-radius: var(--ui-radius-sm);
    cursor: pointer;
    color: var(--ui-text, #1f2937);
    font-size: var(--ui-fs-base);
}

.city-combobox-option.is-active,
.city-combobox-option:hover {
    background: var(--ui-primary-soft, #e8efff);
    color: var(--ui-primary-mid, #0b2c6b);
}

.city-combobox-option.is-selected {
    font-weight: 600;
}

.city-combobox-empty {
    padding: 0.85rem 0.7rem;
    color: var(--ui-text-secondary, #6b7280);
    font-size: var(--ui-fs-sm);
    text-align: center;
}

body.dark-mode .city-combobox-trigger,
body.dark-mode .city-combobox-panel {
    background: var(--ui-surface);
    border-color: var(--ui-border);
    color: var(--ui-text);
}

body.dark-mode .city-combobox-search {
    border-bottom-color: var(--ui-border);
}

body.dark-mode .city-combobox-search-input {
    color: var(--ui-text);
}

body.dark-mode .city-combobox-option.is-active,
body.dark-mode .city-combobox-option:hover {
    background: var(--ui-primary-soft);
}

/* =============================================================================
   Edital identity: process numbers, receipt, mural, validator desk, chrome
   ============================================================================= */

.process-number,
.process-card-ref,
.public-edital-ref {
    font-family: var(--ui-font-display);
    font-weight: 700;
    font-size: var(--ui-fs-lg);
    letter-spacing: -0.03em;
    color: var(--ui-navy);
    line-height: 1.1;
}

body.dark-mode .process-number,
body.dark-mode .process-card-ref,
body.dark-mode .public-edital-ref {
    color: var(--ui-primary-dark);
}

.application-code,
.validator-code-input,
.text-monospace.application-code {
    font-family: var(--ui-font-mono);
    font-weight: 600;
    letter-spacing: 0.04em;
}

.btn-primary-action:focus-visible,
.btn-back:focus-visible,
.form-control:focus-visible,
a.public-process-row:focus-visible {
    outline: 2px solid var(--ui-gold);
    outline-offset: 2px;
}

/* Bootstrap's <small>/.small (80%) maps onto the scale instead of a stray 12.8px. */
small,
.small {
    font-size: var(--ui-fs-xs);
}

/* Display face for figures and hero titles (page titles are set on .curriculo-title). */
.dashboard-kpi > strong,
.dashboard-context-metric strong,
.process-stat strong,
.process-stat-card .process-stat-value,
.delivery-result-title,
.auth-premium-card .card-title {
    font-family: var(--ui-font-display);
    letter-spacing: -0.01em;
}

/* Brand form controls: checks/radios in navy (never Bootstrap blue) and one
   select chevron for native selects, matching the city/course pickers. */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--ui-navy);
}

/* Navy disappears on the dark surface: use the light primary there. */
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
    accent-color: var(--ui-primary);
    color-scheme: dark;
}

/* The course picker uses select2's bootstrap4 theme, which the dark overrides above don't cover. */
body.dark-mode .select2-container--bootstrap4 .select2-selection {
    background-color: var(--ui-input-bg);
    border-color: var(--ui-border-strong);
}

body.dark-mode .select2-container--bootstrap4 .select2-selection__rendered {
    color: var(--ui-text) !important;
}

body.dark-mode .select2-container--bootstrap4 .select2-selection__placeholder {
    color: var(--ui-text-muted) !important;
}

.custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--ui-navy);
    background-color: var(--ui-navy);
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 3px var(--ui-focus-ring);
}

.custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
    border-color: var(--ui-border-strong);
}

/* Beats AdminLTE's "label:not(...) { font-weight: 700 }": option labels are not field labels. */
.custom-control label.custom-control-label {
    font-size: var(--ui-fs-sm);
    font-weight: 400;
}

select.form-control:not([multiple]):not([size]) {
    appearance: none;
    padding-right: 2.25rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235c6570' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px 8px;
}

body.dark-mode select.form-control:not([multiple]):not([size]) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23b7c0cc' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
}

/* An invalid field keeps one signal while focused: the error colour. */
.form-control.is-invalid:focus-visible {
    outline-color: var(--ui-danger);
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    .receipt-stamp--strike {
        animation: none;
    }
}

.layout-topnav .content-wrapper,
.layout-navbar-fixed.layout-topnav .content-wrapper {
    margin-left: 0 !important;
}

.layout-topnav .main-sidebar {
    display: none !important;
}

.receipt {
    position: relative;
    overflow: hidden;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-paper);
    box-shadow: var(--ui-shadow-sm);
    padding: 1.5rem 1.35rem 1.35rem;
    text-align: center;
}

.receipt::before {
    content: "";
    position: absolute;
    top: -12px;
    right: -28px;
    width: 88px;
    height: 12px;
    background: var(--ui-gold);
    transform: rotate(32deg);
}

.receipt-kicker {
    margin: 0 0 0.35rem;
    font-size: var(--ui-fs-xs);
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ui-text-secondary);
}

.receipt-ref {
    font-family: var(--ui-font-display);
    font-size: var(--ui-fs-xl);
    font-weight: 700;
    color: var(--ui-navy);
    margin: 0 0 0.35rem;
}

.receipt-qr {
    margin: 1rem auto;
    width: 180px;
    height: 180px;
}

.receipt-qr img {
    width: 100%;
    height: 100%;
}

.receipt-code {
    font-family: var(--ui-font-mono);
    font-size: var(--ui-fs-md);
    font-weight: 600;
    letter-spacing: 0.08em;
    margin: 0;
}

.receipt-stamp {
    display: inline-block;
    margin-top: 0.85rem;
    padding: 0.2rem 0.65rem;
    border: 2px solid var(--ui-navy);
    color: var(--ui-navy);
    font-family: var(--ui-font-display);
    font-weight: 700;
    font-size: var(--ui-fs-sm);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transform: rotate(-6deg);
}

.receipt-stamp.is-effective {
    border-color: #166534;
    color: #166534;
}

@keyframes receipt-stamp-in {
    0% {
        opacity: 0;
        transform: rotate(-22deg) scale(1.55);
    }
    70% {
        opacity: 1;
        transform: rotate(-4deg) scale(1.04);
    }
    100% {
        opacity: 1;
        transform: rotate(-6deg) scale(1);
    }
}

.receipt-stamp--strike {
    animation: receipt-stamp-in 560ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.dark-mode .receipt-ref,
body.dark-mode .receipt-stamp {
    color: var(--ui-gold);
    border-color: var(--ui-gold);
}

.public-edital {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    padding: 1.5rem 1.5rem 1.35rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--ui-shadow-sm);
    position: relative;
    overflow: hidden;
}

.public-edital::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    /* Navy, not gold: gold is reserved for the receipt. */
    background: var(--ui-navy);
}

a.public-edital,
a.public-edital:link,
a.public-edital:visited,
a.public-process-row,
a.public-process-row:link,
a.public-process-row:visited {
    color: var(--ui-text);
    text-decoration: none;
}

.public-edital:hover,
.public-edital:focus,
a.public-process-row:hover {
    text-decoration: none;
    color: var(--ui-text);
    border-color: var(--ui-navy);
}

.public-edital-kicker {
    font-size: var(--ui-fs-xs);
    font-weight: 600;
    color: var(--ui-text-secondary);
    margin: 0 0 0.35rem;
}

.public-edital-title {
    font-size: var(--ui-fs-lg);
    font-weight: 700;
    margin: 0.35rem 0 0.5rem;
    color: var(--ui-text);
}

.public-edital-meta,
.cargo-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.75rem;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-base);
}

.cargo-chip {
    display: inline-flex;
    padding: 0.15rem 0.55rem;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-pill);
    font-size: var(--ui-fs-xs);
    color: var(--ui-text-secondary) !important;
}

a.public-process-row {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

a.public-process-row:hover {
    border-color: var(--ui-navy);
    text-decoration: none;
    color: inherit;
}

.public-process-row-title {
    font-size: var(--ui-fs-md);
}

.validator-desk input.validator-code-input,
.validator-desk .validator-code-input {
    min-height: 64px !important;
    font-size: var(--ui-fs-lg) !important;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: center;
    font-family: var(--ui-font-mono);
}

.validator-desk .btn-primary-action {
    min-height: 52px;
    width: 100%;
}

.validator-guide .btn-back {
    width: 100%;
    justify-content: center;
}

.validator-camera {
    margin-top: 1rem;
    overflow: hidden;
    border-radius: var(--ui-radius-sm);
    background: #071428;
}

.validator-camera-video {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

[x-cloak] {
    display: none !important;
}

body.dark-mode .receipt-stamp.is-effective,
body.dark-mode .receipt-stamp--strike {
    color: #bbf7d0;
    border-color: #bbf7d0;
}

body.dark-mode .public-edital::before {
    background: var(--ui-primary);
}

.validator-recent {
    margin-top: 1.5rem;
}

.validator-recent h2 {
    font-size: var(--ui-fs-base);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.validator-recent-item {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0;
    border-top: 1px solid var(--ui-border);
    font-size: var(--ui-fs-sm);
}

.auth-footer-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    font-size: var(--ui-fs-base);
}

.auth-premium-card .card-footer .auth-footer-links a {
    display: block;
    width: 100%;
    text-align: center;
}

.auth-footer-links a {
    color: var(--ui-navy);
    font-weight: 600;
}

.auth-inline-error {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--ui-radius-sm);
    background: var(--ui-danger-soft);
    color: var(--ui-danger);
    font-size: var(--ui-fs-base);
}

.profile-photo-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 120px;
    border-radius: 50%;
    background: var(--ui-surface-soft);
    border: 1px dashed var(--ui-border-strong);
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-xs);
    text-align: center;
    padding: 1rem;
}

.public-footer {
    background: var(--ui-navy);
}

@media (max-width: 767.98px) {
    .public-header .public-nav-cta i {
        display: none;
    }

    .public-header .public-nav-cta {
        min-height: 2.15rem;
        min-width: 0;
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
        font-size: var(--ui-fs-xs);
    }

    /* On phones the header scrolls away so the content keeps the whole screen. */
    .public-header {
        position: static;
    }

    a.public-process-row .public-process-row-action,
    .public-process-row-action {
        display: none;
    }

    .public-edital,
    a.public-process-row {
        padding: 1rem 1rem 0.9rem;
    }
}

/* Panorama (Visão geral) */
.overview {
    margin-bottom: 24px;
}

/* Analytics overview (Visão geral) */
:root {
    --ui-chart-line: #0B2C6B;
    --ui-chart-area: rgba(11, 44, 107, 0.12);
    --ui-chart-muted: #9AA3AE;
    --ui-chart-grid: #E3E7EE;
    --ui-chart-seq-1: #0B2C6B;
    --ui-chart-seq-2: #3A64B0;
    --ui-chart-seq-3: #A9BEE6;
}

body.dark-mode {
    --ui-chart-line: #86A3E8;
    --ui-chart-area: rgba(134, 163, 232, 0.18);
    --ui-chart-muted: #5C6B82;
    --ui-chart-grid: rgba(255, 255, 255, 0.08);
    --ui-chart-seq-1: #C9D7F5;
    --ui-chart-seq-2: #86A3E8;
    --ui-chart-seq-3: #3F5E9E;
}

.echart {
    width: 100%;
}

.echart-sm {
    height: 32px;
}

.echart-md {
    height: 240px;
}

.echart-lg {
    height: 300px;
}

.bi-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.bi-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-pill);
    background: var(--ui-surface);
}

.bi-tab {
    padding: 6px 18px;
    border: 0;
    border-radius: var(--ui-radius-pill);
    background: transparent;
    color: var(--ui-text-secondary);
    font-size: var(--ui-fs-sm);
    font-weight: 600;
    cursor: pointer;
}

.bi-tab:hover {
    color: var(--ui-text);
}

.bi-tab:focus-visible {
    outline: 2px solid var(--ui-primary);
    outline-offset: 2px;
}

.bi-tab.is-active {
    background: var(--ui-primary);
    color: #FFFFFF;
}

body.dark-mode .bi-tab.is-active {
    background: var(--ui-chart-line);
    color: var(--ui-surface);
}

.bi-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bi-toolbar .form-group {
    margin-bottom: 0;
}

.bi-kpis {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 576px) {
    .bi-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .bi-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.bi-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    color: var(--ui-text);
    text-decoration: none;
    background: var(--ui-surface);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-md);
    box-shadow: var(--ui-shadow-sm);
    transition: border-color var(--ui-transition), box-shadow var(--ui-transition);
}

.bi-kpi:hover,
.bi-kpi:focus-visible {
    color: var(--ui-text);
    text-decoration: none;
    border-color: var(--ui-border-strong);
    box-shadow: var(--ui-shadow-md);
}

body.dark-mode .bi-kpi:hover,
body.dark-mode .bi-kpi:focus-visible {
    color: var(--ui-text);
}

.bi-kpi-label {
    font-size: var(--ui-fs-sm);
    color: var(--ui-text-secondary);
}

.bi-kpi-value {
    font-family: var(--ui-font-display);
    font-size: var(--ui-fs-2xl);
    font-weight: 700;
    line-height: 1.1;
    color: var(--ui-text);
}

.bi-kpi-delta,
.bi-kpi-note {
    font-size: var(--ui-fs-xs);
    color: var(--ui-text-secondary);
}

.bi-charts {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 992px) {
    .bi-charts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.bi-charts-single {
    grid-template-columns: minmax(0, 1fr);
}

.chart-card {
    margin: 0;
}

.chart-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
    font-family: var(--ui-font-display);
    font-size: var(--ui-fs-md);
    font-weight: 700;
    color: var(--ui-text);
}

.chart-note {
    font-family: var(--ui-font-body);
    font-size: var(--ui-fs-xs);
    font-weight: 400;
    color: var(--ui-text-muted);
}

.chart-data {
    margin-top: 8px;
    font-size: var(--ui-fs-sm);
}

.chart-data summary {
    cursor: pointer;
    color: var(--ui-primary);
}

.bi-kpi .echart-sm {
    margin-top: auto;
}
