/* Os dois temas preservam a logo original e usam a mesma hierarquia visual. */
.portal-theme {
    --portal-green: #13583e;
    --portal-green-dark: #0b422d;
    --portal-green-soft: #e3efe5;
    --portal-gold: #b39a46;
    --portal-ink: #203c2e;
    --portal-muted: #536c5e;
    --portal-border: #ccdcd0;
    --portal-canvas: #edf4ef;
    --portal-surface: #fff;
    --portal-surface-soft: #f4f8f3;
    --portal-hover: #e3efe5;
    --portal-input-border: #718b79;
    --portal-action-text: #fff;
    --portal-active: #13583e;
    --portal-active-text: #fff;
    --portal-welcome: #164d37;
    --portal-welcome-text: #effaf2;
    --portal-welcome-muted: #cae2d0;
    --portal-welcome-gold: #e1c970;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--portal-ink);
    background: var(--portal-canvas);
    line-height: 1.55;
}
[data-portal-theme="dark"] .portal-theme {
    --portal-green: #89dbaa;
    --portal-green-dark: #b1f0c8;
    --portal-green-soft: #244633;
    --portal-gold: #d4bd6a;
    --portal-ink: #e6f1e9;
    --portal-muted: #a7bdb0;
    --portal-border: #304d3e;
    --portal-canvas: #0b1913;
    --portal-surface: #13261d;
    --portal-surface-soft: #193125;
    --portal-hover: #244633;
    --portal-input-border: #719580;
    --portal-action-text: #092819;
    --portal-active: #28764f;
    --portal-active-text: #fff;
    --portal-welcome: #1c4833;
}
.portal-theme a { color: var(--portal-green); }
.portal-theme a:hover { color: var(--portal-green-dark); }
.portal-theme :is(a, button, input, select, textarea):focus-visible {
    outline: 3px solid var(--portal-green);
    outline-offset: 3px;
}
.portal-theme a:focus:not(:focus-visible), .portal-theme button:focus:not(:focus-visible) { outline: none; }
.portal-theme .text-muted { color: var(--portal-muted) !important; }
.portal-theme .text-dark { color: var(--portal-ink) !important; }
.portal-theme .content-wrapper { background: var(--portal-canvas); }
.portal-theme .content-header { padding: 28px 20px 20px; }
.portal-theme .content-header h1 { font-size: clamp(1.45rem, 2vw, 1.85rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.3; }
.portal-theme .content { padding: 0 20px 32px; }
.portal-theme .content > .container-fluid > .col-md-12 { padding: 0; }

/* Acompanhamento das funções administrativas */
.portal-theme .portal-function-progress { padding: 18px; border: 1px solid var(--portal-border); border-radius: 10px; background: var(--portal-surface-soft); }
.portal-theme .portal-function-track { height: 9px; overflow: hidden; border-radius: 8px; background: var(--portal-border); }
.portal-theme .portal-function-fill { height: 100%; background: var(--portal-green); border-radius: inherit; transition: width .3s ease; }
.portal-theme .portal-function-log { max-height: 168px; overflow-y: auto; margin: 12px 0 0; padding: 10px 12px; list-style: none; border: 1px solid var(--portal-border); border-radius: 7px; background: var(--portal-surface); font-size: .8rem; }
.portal-theme .portal-function-log li { display: grid; grid-template-columns: 5em minmax(0, 1fr) 3em; gap: 10px; padding: 5px 0; }
.portal-theme .portal-function-log time, .portal-theme .portal-function-log small { color: var(--portal-muted); font-variant-numeric: tabular-nums; }
.portal-theme .portal-function-log span { overflow-wrap: anywhere; }
.portal-theme .portal-function-log small { text-align: right; }

/* Navegação */
.portal-theme .main-sidebar {
    background: var(--portal-surface);
    border-right: 1px solid var(--portal-border);
    box-shadow: 3px 0 18px rgba(27, 57, 40, .025) !important;
}
.portal-theme .brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 76px;
    padding: 10px 18px;
    color: var(--portal-ink);
    border-bottom: 1px solid var(--portal-border);
    white-space: normal;
}
.portal-theme .brand-link .brand-image {
    float: none;
    flex: 0 0 auto;
    width: 38px;
    height: 42px;
    max-height: 42px;
    object-fit: contain;
    margin: 0;
}
.portal-theme .main-sidebar .brand-link:is(:hover, :focus, :active) { color: var(--portal-green-dark); }
.portal-theme .brand-text { display: block; font-size: 1rem; font-weight: 650; line-height: 1.25; }
.portal-theme .brand-text small { display: block; margin-bottom: 3px; font-size: .62rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--portal-muted); }
.portal-theme .sidebar { padding: 8px 12px 24px; }
.portal-theme .nav-sidebar .nav-header { margin-top: 16px; padding: 8px 12px; font-size: .65rem; font-weight: 700; letter-spacing: .085em; color: var(--portal-muted); white-space: normal; }
.portal-theme .nav-sidebar > .nav-header:first-child { margin-top: 2px; }
.portal-theme .nav-sidebar > .nav-item { margin-bottom: 4px; }
.portal-theme .nav-sidebar .nav-link {
    width: auto;
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-height: 44px;
    margin: 0;
    padding: 11px 12px;
    border-radius: 8px;
    color: var(--portal-ink);
    font-size: .86rem;
    font-weight: 500;
    transition: background-color .15s, color .15s;
}
.portal-theme .nav-sidebar .nav-link .nav-icon { flex: 0 0 20px; width: 20px; margin: 3px 0 0; font-size: .98rem; color: var(--portal-muted); text-align: center; }
.portal-theme .nav-sidebar .nav-link p { flex: 1; margin: 0; padding-right: 16px; white-space: normal; line-height: 1.55; }
.portal-theme .nav-sidebar .nav-link > .right, .portal-theme .nav-sidebar .nav-link p > .right { top: 16px; right: 12px; font-size: .75rem; }
/* Sobrescreve também o foco do AdminLTE, que usa texto escuro no menu claro. */
.portal-theme .main-sidebar .nav-sidebar .nav-item > .nav-link:is(:hover, :focus, :active),
.portal-theme .main-sidebar .nav-sidebar .nav-item.menu-open > .nav-link { background: var(--portal-surface-soft); color: var(--portal-ink); }
.portal-theme .main-sidebar .nav-sidebar .nav-link:is(:hover, :focus, :active) .nav-icon { color: inherit; }
.portal-theme .nav-sidebar .nav-link.active { background: var(--portal-active) !important; color: var(--portal-active-text) !important; box-shadow: inset 3px 0 var(--portal-gold) !important; font-weight: 650; }
.portal-theme .nav-sidebar .nav-link.active .nav-icon { color: inherit; }
.portal-theme .nav-sidebar .nav-treeview { padding: 4px 0 4px 12px; }
.portal-theme .nav-sidebar .nav-treeview > .nav-item > .nav-link { color: var(--portal-ink); font-size: .82rem; padding-left: 12px; margin-left: 0 !important; }
.portal-theme .nav-sidebar .nav-treeview .nav-link .nav-icon { font-size: .85rem; }
.portal-theme .main-header { min-height: 76px; padding: 10px 24px; border-bottom: 1px solid var(--portal-border); background: var(--portal-surface); }
.portal-theme .main-header .navbar-nav { flex-direction: row; align-items: center; }
.portal-theme .main-header .nav-link { color: var(--portal-muted); min-width: 40px; min-height: 40px; border-radius: 8px; }
.portal-theme .main-header .navbar-nav .nav-link:is(:hover, :focus, :active),
.portal-theme .main-header .navbar-nav .show > .nav-link { background: var(--portal-hover); color: var(--portal-ink); }
.portal-theme .portal-context { display: flex; align-items: center; margin-left: 12px; font-size: .8rem; color: var(--portal-muted); }
.portal-theme .portal-context::before { content: ""; width: 3px; height: 18px; background: var(--portal-gold); margin-right: 12px; border-radius: 2px; }
.portal-theme .user-menu > .nav-link { display: flex; align-items: center; gap: 9px; height: auto; padding: 4px 10px; font-size: .83rem; font-weight: 600; }
.portal-theme .portal-avatar { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; background: var(--portal-green-soft); color: var(--portal-green-dark); font-size: .82rem; }
.portal-theme .dropdown-menu { background: var(--portal-surface); color: var(--portal-ink); border: 1px solid var(--portal-border); border-radius: 10px; box-shadow: 0 8px 28px rgba(27, 57, 40, .1); }
.portal-theme .navbar-nav > .user-menu > .dropdown-menu > .user-footer { background: var(--portal-surface-soft); border-radius: 10px; }
.portal-theme .dropdown-item { color: var(--portal-ink); }
.portal-theme .dropdown-item:hover, .portal-theme .dropdown-item:focus { background: var(--portal-hover); color: var(--portal-green-dark); }
.portal-theme .dropdown-item.active, .portal-theme .dropdown-item:active { background: var(--portal-active); color: var(--portal-active-text); }
.portal-theme .main-header .navbar-nav > .portal-theme-control { display: flex; align-items: center; margin-right: 12px; }
.portal-theme .portal-theme-toggle { display: inline-flex; gap: 8px; align-items: center; justify-content: center; min-height: 38px; background: var(--portal-green-soft); color: var(--portal-green); border: 1px solid var(--portal-input-border); white-space: nowrap; }
.portal-theme .portal-theme-toggle:hover { background: var(--portal-green); color: var(--portal-action-text); border-color: var(--portal-green); }
.portal-theme [data-theme-toggle][hidden] { display: none !important; }
.portal-theme .portal-login-toolbar { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.portal-theme .portal-skip-link { position: fixed; top: -90px; left: 16px; z-index: 10000; padding: 10px 16px; background: var(--portal-surface); border: 2px solid var(--portal-green); border-radius: 8px; }
.portal-theme .portal-skip-link:focus { top: 12px; }
.portal-theme .portal-environment { position: relative; z-index: 1100; padding: 7px 20px; text-align: center; font-size: .78rem; line-height: 1.5; background: #fff6dd; color: #6d5315; border-bottom: 1px solid #eddfb5; }
.portal-theme .portal-environment--readonly { background: #eaf3f7; color: #27586b; border-color: #cddfe7; }

/* Componentes compartilhados */
.portal-theme .card { background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: 12px; box-shadow: 0 2px 8px rgba(26, 52, 36, .035); margin-bottom: 22px; }
.portal-theme .card-header { padding: 18px 22px; background: var(--portal-green-soft); border-bottom: 1px solid var(--portal-border); border-radius: 11px 11px 0 0; }
.portal-theme .card-secondary:not(.card-outline) > .card-header { background: var(--portal-green-soft); color: var(--portal-ink); }
.portal-theme .card-title { font-size: .96rem; font-weight: 650; line-height: 1.5; }
.portal-theme .card-body { padding: 22px; }
.portal-theme .card-footer { background: var(--portal-surface-soft); border-top: 1px solid var(--portal-border); border-radius: 0 0 11px 11px; }
.portal-theme .list-group-item { padding: 16px 18px; background: var(--portal-surface); border-color: var(--portal-border); color: var(--portal-ink); }
.portal-theme .list-group-item-action:hover { background: var(--portal-hover); color: var(--portal-green-dark); }
.portal-theme .list-group-item:first-child { border-radius: 8px 8px 0 0; }
.portal-theme .list-group-item:last-child { border-radius: 0 0 8px 8px; }
.portal-theme .btn { padding: .55rem 1rem; min-height: 40px; border-radius: 7px; font-size: .875rem; font-weight: 600; box-shadow: none; transition: background-color .15s, border-color .15s; }
.portal-theme .btn-sm { padding: .4rem .7rem; min-height: 34px; font-size: .78rem; }
.portal-theme .btn-primary, .portal-theme .btn-info { background: var(--portal-green); border-color: var(--portal-green); color: var(--portal-action-text); }
.portal-theme .btn-primary:hover, .portal-theme .btn-info:hover, .portal-theme .btn-primary:active, .portal-theme .btn-info:active { background: var(--portal-green-dark) !important; border-color: var(--portal-green-dark) !important; color: var(--portal-action-text) !important; }
.portal-theme .btn-secondary, .portal-theme .btn-default { background: var(--portal-surface-soft); border-color: var(--portal-input-border); color: var(--portal-ink); }
.portal-theme .btn-light { background: var(--portal-surface-soft); border-color: var(--portal-input-border); color: var(--portal-ink); }
.portal-theme .btn-light:hover, .portal-theme .btn-light:focus, .portal-theme .show > .btn-light.dropdown-toggle { background: var(--portal-hover); border-color: var(--portal-input-border); color: var(--portal-ink); }
.portal-theme .btn-secondary:hover, .portal-theme .btn-default:hover { background: var(--portal-hover); border-color: var(--portal-input-border); color: var(--portal-green-dark); }
.portal-theme .btn-secondary:active, .portal-theme .btn-default:active { background: var(--portal-hover) !important; border-color: var(--portal-input-border) !important; color: var(--portal-green-dark) !important; }
.portal-theme .btn-success, .portal-theme .btn-success:focus { background: var(--portal-green); border-color: var(--portal-green); color: var(--portal-action-text); }
.portal-theme .btn-success:hover, .portal-theme .btn-success:active { background: var(--portal-green-dark) !important; border-color: var(--portal-green-dark) !important; color: var(--portal-action-text) !important; }
.portal-theme .btn-outline-success { color: var(--portal-green); border-color: var(--portal-input-border); background: var(--portal-surface); }
.portal-theme .btn-outline-success:hover { color: var(--portal-action-text); background: var(--portal-green); border-color: var(--portal-green); }
.portal-theme .btn-link { color: var(--portal-green) !important; }
.portal-theme .btn:disabled, .portal-theme .btn.disabled { opacity: .55; }
.portal-theme .form-control, .portal-theme .custom-select { height: 42px; background-color: var(--portal-surface); border-color: var(--portal-input-border); border-radius: 7px; color: var(--portal-ink); font-size: .9rem; }
.portal-theme .custom-select { appearance: auto; background-image: none; }
.portal-theme textarea.form-control { height: auto; }
.portal-theme .form-control-sm, .portal-theme .custom-select-sm { height: 38px; font-size: .85rem; }
.portal-theme .form-control::placeholder { color: var(--portal-muted); opacity: 1; }
.portal-theme .form-control:focus, .portal-theme .custom-select:focus { border-color: var(--portal-green); box-shadow: 0 0 0 3px rgba(23, 99, 72, .13); }
.portal-theme .form-control.is-invalid, .portal-theme .custom-select.is-invalid { border-color: #b8423d; }
.portal-theme .form-control:disabled, .portal-theme .form-control[readonly] { background: var(--portal-surface-soft); }
.portal-theme input[type="checkbox"], .portal-theme input[type="radio"] { accent-color: var(--portal-green); }
.portal-theme .input-group-text { border-color: var(--portal-input-border); background: var(--portal-green-soft); color: var(--portal-muted); }
.portal-theme .input-group .portal-password-toggle {
    min-width: 44px; justify-content: center; cursor: pointer; color: var(--portal-green);
}
.portal-theme .input-group .portal-password-toggle:hover,
.portal-theme .input-group .portal-password-toggle[aria-pressed="true"] {
    background: var(--portal-hover); color: var(--portal-green);
}
.portal-theme .input-group .portal-password-toggle:focus-visible {
    outline: 2px solid var(--portal-green); outline-offset: 2px; z-index: 4;
}
.portal-theme label { font-size: .85rem; font-weight: 600; }
.portal-theme .alert { border-radius: 8px; padding: 15px 18px; line-height: 1.6; font-size: .88rem; box-shadow: none; }
.portal-theme .alert-danger { color: #823c35; background: #fff1ee; border-color: #efd1cb; }
.portal-theme .alert-info { color: #285d6d; background: #eef6f8; border-color: #cbdfe5; }
.portal-theme .alert-success { color: #25603a; background: #edf7ee; border-color: #c9e0cb; }
.portal-theme .alert-primary { background: var(--portal-green-soft); color: var(--portal-ink); border-color: var(--portal-border); }
.portal-theme .table { color: var(--portal-ink); font-size: .84rem; }
.portal-theme .table td, .portal-theme .table th { padding: .85rem 1rem !important; border-color: var(--portal-border); vertical-align: middle; }
.portal-theme .table thead th { background: var(--portal-green-soft); color: var(--portal-muted); font-size: .76rem; font-weight: 650; border-bottom-width: 1px; }
.portal-theme .table.table-head-fixed thead tr th { background: var(--portal-green-soft); color: var(--portal-muted); }
.portal-theme .table-striped tbody tr:nth-of-type(odd) { background: var(--portal-surface-soft); }
.portal-theme .table-hover tbody tr:hover { background: var(--portal-hover); color: var(--portal-ink); }
.portal-theme .table-responsive { border-radius: 0 0 11px 11px; }
.portal-theme .nav-tabs { border-color: var(--portal-border); gap: 8px; }
.portal-theme .nav-tabs .nav-link { padding: 11px 16px; font-size: .875rem; font-weight: 600; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--portal-muted); }
.portal-theme .nav-tabs .nav-link.active { color: var(--portal-green); border-bottom-color: var(--portal-green); }
.portal-theme .nav-tabs .nav-link:hover { background: var(--portal-hover); color: var(--portal-green-dark); }
.portal-theme .page-link { background: var(--portal-surface); color: var(--portal-green); border-color: var(--portal-border); }
.portal-theme .page-link:hover { background: var(--portal-hover); color: var(--portal-green-dark); }
.portal-theme .page-item.active .page-link { background: var(--portal-green); border-color: var(--portal-green); color: var(--portal-action-text); }
.portal-theme .page-item.disabled .page-link { background: var(--portal-surface-soft); border-color: var(--portal-border); color: var(--portal-muted); }

/* Página inicial */
.portal-theme .portal-home > .content-header { display: none; }
.portal-theme .portal-home > .content { padding-top: 18px; }
.portal-theme .portal-eyebrow { margin: 0 0 8px; color: var(--portal-muted); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.portal-theme .portal-welcome { position: relative; padding: 16px 20px; margin-bottom: 16px; background: var(--portal-welcome); border: 1px solid var(--portal-welcome); border-left: 4px solid var(--portal-welcome-gold); border-radius: 12px; }
.portal-theme .portal-welcome .portal-eyebrow { margin-bottom: 4px; color: var(--portal-welcome-gold); font-size: .64rem; }
.portal-theme .portal-welcome h1 { margin: 0 0 6px; color: var(--portal-welcome-text); font-size: clamp(1.3rem, 2vw, 1.55rem); line-height: 1.3; font-weight: 650; letter-spacing: -.03em; }
.portal-theme .portal-welcome p:last-child { margin-bottom: 0; color: var(--portal-welcome-muted); font-size: .85rem; line-height: 1.45; }
.portal-theme .portal-welcome + .portal-section-heading { margin-top: 16px; margin-bottom: 12px; }
.portal-theme .portal-section-heading { margin: 26px 0 16px; font-size: 1.05rem; font-weight: 650; }
.portal-theme .portal-services { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.portal-theme .portal-service { position: relative; display: flex; flex-direction: column; padding: 22px; color: var(--portal-ink); background: var(--portal-surface); border: 1px solid var(--portal-border); border-radius: 12px; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.portal-theme .portal-service:hover { color: var(--portal-green-dark); border-color: var(--portal-input-border); box-shadow: 0 4px 14px rgba(27, 57, 40, .07); }
.portal-theme .portal-service-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: var(--portal-green-soft); color: var(--portal-green); margin-bottom: 18px; font-size: 1.1rem; }
.portal-theme .portal-service strong { font-size: .94rem; margin-bottom: 7px; }
.portal-theme .portal-service span:last-child { font-size: .8rem; color: var(--portal-muted); line-height: 1.6; }
.portal-theme .portal-service-arrow { position: absolute; top: 24px; right: 20px; color: var(--portal-muted); font-size: .8rem; }
.portal-theme .portal-campaign .card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px 24px; }
.portal-theme .portal-campaign img { display: block; width: auto; height: auto; max-width: min(100%, 680px); max-height: 240px; margin: auto; object-fit: contain; }
.portal-theme .portal-campaign .card-body { padding: 16px; background: var(--portal-surface-soft); border-radius: 0 0 11px 11px; }
.portal-theme .portal-campaign .portal-eyebrow { margin-bottom: 4px; }

/* Acesso */
.portal-theme.login-page { min-height: 100vh; height: auto; padding: 44px 20px; background: var(--portal-canvas); }
.portal-theme.login-page .portal-environment { position: absolute; inset: 0 0 auto; }
.portal-theme .login-box { width: min(420px, 100%); }
.portal-theme .login-logo { font-size: 1.5rem; font-weight: 650; margin-bottom: 8px; }
.portal-theme .login-logo img { width: 66px; height: 74px; object-fit: contain; margin-bottom: 10px; }
.portal-theme .login-logo a { color: var(--portal-green-dark); }
.portal-theme .portal-login-subtitle { text-align: center; color: var(--portal-muted); font-size: .84rem; margin-bottom: 24px; }
.portal-theme .login-card-body { padding: 30px; background: var(--portal-surface); color: var(--portal-ink); border-radius: 12px; }
.portal-theme .login-box-msg { padding: 0 0 24px; font-size: .9rem; color: var(--portal-muted); }
.portal-theme .login-card-body .row a { font-size: .78rem; }

/* Cadastro: a superfície e os campos acompanham a paleta do portal. */
.portal-theme .register-card-body { background: var(--portal-surface); color: var(--portal-ink); border-radius: 12px; }
.portal-theme .register-card-body .input-group .form-control { background-color: var(--portal-surface-soft); }
.portal-theme .register-card-body .input-group .input-group-text {
    background: var(--portal-green-soft); color: var(--portal-muted); border-color: var(--portal-input-border);
    border-radius: 0 7px 7px 0;
}
.portal-theme .register-card-body .input-group:focus-within {
    border-radius: 7px; outline: 2px solid var(--portal-green); outline-offset: 2px;
}
.portal-theme .register-card-body .input-group .form-control:focus { outline: none; box-shadow: none; }
.portal-theme .register-card-body .input-group .form-control:focus ~ .input-group-append .input-group-text { border-color: var(--portal-green); }
.portal-theme .register-card-body .input-group .form-control.is-invalid ~ .input-group-append .input-group-text { border-color: #b8423d; }
[data-portal-theme="dark"] .portal-theme .register-card-body .input-group .form-control.is-invalid ~ .input-group-append .input-group-text { border-color: #ffb2a6; }
.portal-theme .register-card-body .form-control:is(:-webkit-autofill, :autofill) {
    -webkit-text-fill-color: var(--portal-ink); caret-color: var(--portal-ink);
    box-shadow: 0 0 0 1000px var(--portal-surface-soft) inset;
}
/* Componentes de terceiros e estados de aviso também acompanham o tema. */
.portal-theme .modal-content, .portal-theme .popover { background: var(--portal-surface); color: var(--portal-ink); border-color: var(--portal-border); }
.portal-theme .modal-header, .portal-theme .modal-footer, .portal-theme hr { border-color: var(--portal-border); }
.portal-theme .close { color: var(--portal-ink); text-shadow: none; }
.portal-theme .bootstrap-select .dropdown-menu.inner { background: var(--portal-surface); }
.portal-theme .bootstrap-select .no-results { background: var(--portal-surface-soft); }
.portal-theme .login-card-body .input-group .input-group-text { color: var(--portal-muted); border-color: var(--portal-input-border); }
.portal-theme .login-card-body .input-group .form-control:focus ~ .input-group-append .input-group-text { border-color: var(--portal-green); }
[data-portal-theme="dark"] .portal-theme .bg-white,
[data-portal-theme="dark"] .portal-theme .bg-light { background: var(--portal-surface-soft) !important; color: var(--portal-ink) !important; }
[data-portal-theme="dark"] .portal-theme .text-primary,
[data-portal-theme="dark"] .portal-theme .text-success { color: #89dbaa !important; }
[data-portal-theme="dark"] .portal-theme .text-danger,
[data-portal-theme="dark"] .portal-theme .invalid-feedback { color: #ffb2a6 !important; }
[data-portal-theme="dark"] .portal-theme .alert-danger { background: #402824; color: #ffc4b9; border-color: #76514a; }
[data-portal-theme="dark"] .portal-theme .alert-info { background: #193840; color: #b5e1eb; border-color: #426570; }
[data-portal-theme="dark"] .portal-theme .alert-success { background: #203c29; color: #b3e6bf; border-color: #416c4d; }
[data-portal-theme="dark"] .portal-theme .alert-warning,
[data-portal-theme="dark"] .portal-theme .portal-environment { background: #39331c; color: #ecd994; border-color: #625938; }
[data-portal-theme="dark"] .portal-theme .portal-environment--readonly { background: #193840; color: #b5e1eb; border-color: #426570; }
[data-portal-theme="dark"] .portal-theme .form-control.is-invalid,
[data-portal-theme="dark"] .portal-theme .custom-select.is-invalid { border-color: #ffb2a6; }

@media (min-width: 992px) {
    .portal-theme.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-link { padding-left: 20px; gap: 0; }
    .portal-theme.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .brand-text { display: none; }
    .portal-theme.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-link { padding-left: 14px; }
    .portal-theme.sidebar-mini.sidebar-collapse .main-sidebar:not(:hover) .nav-link p { display: block; position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (max-width: 1199.98px) {
    .portal-theme .portal-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .portal-theme .main-header { min-height: 64px; padding: 8px 12px; }
    .portal-theme .portal-context { display: none; }
    .portal-theme .main-header .navbar-nav > .portal-theme-control { margin-right: 8px; }
    .portal-theme .main-header .portal-theme-toggle { width: 44px; padding: 8px; }
    .portal-theme .main-header .portal-theme-toggle [data-theme-label] { display: none; }
    .portal-theme .content-header { padding: 22px 10px 16px; }
    .portal-theme .content { padding: 0 10px 24px; }
    .portal-theme .card-header, .portal-theme .card-body { padding: 18px; }
    .portal-theme .btn { min-height: 44px; }
    .portal-theme .btn:not(input) { display: inline-flex; align-items: center; justify-content: center; }
    .portal-theme .portal-welcome { padding: 14px 16px; }
    .portal-theme .portal-services { gap: 12px; }
    .portal-theme .portal-service { padding: 18px; }
    .portal-theme .nav-tabs .nav-link { padding: 10px; font-size: .82rem; }
    .portal-theme .user-menu > .nav-link > span:not(.portal-avatar) { max-width: 165px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .portal-theme .form-row > [class*="col-"] { margin-bottom: 8px; }
    .portal-theme #colaboradores-filtros > .row > [class*="col"] { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 399.98px) {
    .portal-theme .portal-services { grid-template-columns: 1fr; }
    .portal-theme .portal-service-icon { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .portal-theme *, .portal-theme *::before, .portal-theme *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Cap compartilhado pelos formulários de acesso. */
.portal-theme .portal-cap { margin: 0 0 22px; font-size: .84rem; }
.portal-theme .portal-cap cap-widget {
    display: block; width: 100%; min-height: 64px;
    --cap-widget-width: 100%; --cap-widget-height: 64px; --cap-border-radius: 10px;
    --cap-background: var(--portal-surface-soft); --cap-color: var(--portal-ink);
    --cap-border-color: var(--portal-input-border); --cap-checkbox-border: 1px solid var(--portal-input-border);
    --cap-checkbox-background: var(--portal-surface);
    --cap-spinner-color: var(--portal-green); --cap-spinner-background-color: var(--portal-border);
    --cap-focus-ring: var(--portal-green); --cap-troubleshoot-color: var(--portal-green); --cap-font: inherit;
}
.portal-theme .portal-cap [data-cap-error]:not([hidden]) { margin-top: 8px; }
