/*
 * LHPR — estilos da camada de apresentação (mobile-first, tema claro).
 * CSS próprio e leve, sem dependências externas. Os tokens abaixo concentram a identidade visual
 * para facilitar a adoção do Bootstrap 5.3 (pendente de autorização para baixar os arquivos oficiais).
 */

:root {
    --lhpr-navy: #1d2b6b;
    --lhpr-navy-700: #16215a;
    --lhpr-green: #138a43;
    --lhpr-green-50: #e7f6ed;
    --lhpr-amber-50: #fef3c7;
    --lhpr-amber-800: #92400e;
    --lhpr-blue-50: #e8edfb;
    --lhpr-ink: #172033;
    --lhpr-muted: #5b6475;
    --lhpr-line: #e3e7ef;
    --lhpr-bg: #f5f7fb;
    --lhpr-surface: #ffffff;
    --lhpr-soft: #f8faff;
    --lhpr-line-strong: #d6dbe6;
    --lhpr-accent: #1d2b6b;
    --radius: 14px;
    --shadow: 0 6px 24px rgba(23, 32, 51, 0.07);
    --container: 1120px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /*
     * Tipografia clean (18/10/2026): três pesos só. Nada acima de 600 no sistema — títulos e valores usam
     * --fw-strong; rótulos, botões e menus, --fw-medium; o texto corrido, --fw-regular.
     */
    --fw-regular: 400;
    --fw-medium: 500;
    --fw-strong: 600;
    color-scheme: light;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--font);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--lhpr-ink);
    background: var(--lhpr-bg);
}

h1,
h2,
h3 {
    line-height: 1.2;
    margin: 0 0 0.5rem;
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
    letter-spacing: -0.01em;
}

b,
strong,
th {
    font-weight: var(--fw-strong);
}

p {
    margin: 0 0 1rem;
}

a {
    color: var(--lhpr-accent);
}

:focus-visible {
    outline: 3px solid var(--lhpr-green);
    outline-offset: 3px;
    border-radius: 6px;
}

.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 16px;
}

.muted {
    color: var(--lhpr-muted);
}

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

.skip-link {
    position: absolute;
    left: 16px;
    top: -48px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--lhpr-navy);
    color: #fff;
    border-radius: 8px;
    text-decoration: none;
}

.skip-link:focus {
    top: 12px;
}

/* ---------------------------------------------------------------- cabeçalho */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: saturate(160%) blur(8px);
    border-bottom: 1px solid var(--lhpr-line);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 12px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--lhpr-accent);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--lhpr-navy), var(--lhpr-green));
    color: #fff;
    font-weight: var(--fw-strong);
    letter-spacing: 0.5px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-text strong {
    font-size: 1.05rem;
}

.brand-text small {
    font-size: 0.8rem;
    color: var(--lhpr-muted);
}

.nav-toggle {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--lhpr-line);
    border-radius: 10px;
    background: var(--lhpr-surface);
    cursor: pointer;
}

.nav-toggle-bar,
.nav-toggle-bar::before,
.nav-toggle-bar::after {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--lhpr-navy);
    border-radius: 2px;
    content: "";
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle-bar::before {
    position: absolute;
    top: -6px;
}

.nav-toggle-bar::after {
    position: absolute;
    top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar {
    background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before {
    transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after {
    transform: translateY(-6px) rotate(-45deg);
}

.site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    padding: 8px 16px 16px;
    background: var(--lhpr-surface);
    border-bottom: 1px solid var(--lhpr-line);
    box-shadow: var(--shadow);
}

.site-nav.is-open {
    display: grid;
    gap: 4px;
}

.site-nav a {
    display: block;
    padding: 12px 10px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: var(--fw-medium);
    color: var(--lhpr-ink);
}

.site-nav a:hover {
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

/* Sem JavaScript (classe "no-js" mantida no <html>), o menu fica sempre visível e o botão é ocultado. */
.no-js .nav-toggle {
    display: none;
}

.no-js .site-nav {
    display: grid;
    position: static;
    box-shadow: none;
}

/* ---------------------------------------------------------------- apresentação */

.hero {
    padding: 40px 0 32px;
    background:
        radial-gradient(1200px 400px at 85% -10%, var(--lhpr-green-50), transparent 60%),
        linear-gradient(180deg, var(--lhpr-surface), var(--lhpr-bg));
    border-bottom: 1px solid var(--lhpr-line);
}

.hero-grid {
    display: grid;
    gap: 28px;
}

.eyebrow {
    margin-bottom: 8px;
    font-size: 0.8rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lhpr-green);
}

.hero h1 {
    font-size: clamp(1.75rem, 6vw, 2.75rem);
    letter-spacing: -0.01em;
}

.lead {
    font-size: 1.08rem;
    color: var(--lhpr-muted);
    max-width: 38rem;
}

.notice {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0 0;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--lhpr-amber-50);
    color: var(--lhpr-amber-800);
    font-weight: var(--fw-medium);
    font-size: 0.92rem;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}

.principles {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.principles li {
    display: grid;
    gap: 2px;
    padding: 16px 18px;
    background: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line);
    border-left: 4px solid var(--lhpr-green);
    border-radius: var(--radius);
}

.principles strong {
    color: var(--lhpr-accent);
}

.principles span {
    color: var(--lhpr-muted);
    font-size: 0.95rem;
}

/* ---------------------------------------------------------------- seções */

.section {
    padding: 40px 0;
    scroll-margin-top: 64px;
}

.hero {
    scroll-margin-top: 64px;
}

.section-alt {
    background: var(--lhpr-surface);
    border-top: 1px solid var(--lhpr-line);
    border-bottom: 1px solid var(--lhpr-line);
}

.section-head {
    margin-bottom: 20px;
}

.section-head h2 {
    font-size: 1.5rem;
}

.section-head p {
    color: var(--lhpr-muted);
    margin: 0;
}

.cards {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card h3 {
    font-size: 1.1rem;
}

.card p {
    color: var(--lhpr-muted);
}

.card-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

.card-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: auto 0 0;
    padding-top: 8px;
    font-size: 0.85rem;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: var(--fw-strong);
    white-space: nowrap;
}

.badge-ready,
.badge-done {
    background: var(--lhpr-green-50);
    color: var(--tone-green);
}

.badge-current {
    background: var(--lhpr-amber-50);
    color: var(--lhpr-amber-800);
}

.badge-next {
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

.badge-planned {
    background: var(--tone-gray-50);
    color: var(--lhpr-muted);
}

.timeline {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.timeline-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px 12px;
    padding: 14px 16px;
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
    background: var(--lhpr-bg);
}

.timeline-item .badge {
    grid-column: 2;
    justify-self: start;
}

.timeline-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--lhpr-line-strong);
    background: var(--lhpr-surface);
}

.timeline-done .timeline-dot {
    border-color: var(--lhpr-green);
    background: var(--lhpr-green);
}

.timeline-current .timeline-dot {
    border-color: #d97706;
    background: var(--lhpr-amber-50);
}

.timeline-name {
    font-weight: var(--fw-medium);
}

/* ---------------------------------------------------------------- rodapé */

.site-footer {
    padding: 24px 0 32px;
    font-size: 0.9rem;
}

.footer-bar {
    display: grid;
    gap: 4px;
}

.footer-bar p {
    margin: 0;
}

/* ---------------------------------------------------------------- páginas internas */

.site-nav a[aria-current="page"] {
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

.page {
    padding: 24px 0 48px;
}

.container-narrow {
    max-width: 820px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
    margin-bottom: 16px;
}

.page-head h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
}

.page-head p {
    margin: 0;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-bottom: 4px;
    font-weight: var(--fw-medium);
    text-decoration: none;
}

.card-link {
    text-decoration: none;
}

.card-link:hover {
    text-decoration: underline;
}

/* Botões (alvo de toque de 44 px) */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: inherit;
    font-weight: var(--fw-strong);
    text-decoration: none;
    cursor: pointer;
}

.button-primary {
    background: var(--lhpr-navy);
    color: #fff;
}

.button-primary:hover {
    background: var(--lhpr-navy-700);
}

.button-ghost {
    background: var(--lhpr-surface);
    border-color: var(--lhpr-line);
    color: var(--lhpr-accent);
}

.button-ghost:hover {
    background: var(--lhpr-blue-50);
}

/* Avisos */
.alert {
    margin: 0 0 16px;
    padding: 12px 16px;
    border-radius: var(--radius);
    border: 1px solid transparent;
}

.alert p,
.alert ul {
    margin: 0;
}

.alert ul {
    padding-left: 20px;
    margin-top: 6px;
}

.alert a {
    color: inherit;
}

.alert-demo {
    background: var(--lhpr-amber-50);
    border-color: #fcd34d;
    color: var(--lhpr-amber-800);
}

.alert-info {
    background: var(--lhpr-blue-50);
    border-color: #c7d2f4;
    color: var(--lhpr-accent);
}

.alert-error {
    background: var(--tone-red-50);
    border-color: #f5b5b5;
    color: var(--tone-red);
}

.alert-success {
    background: var(--lhpr-green-50);
    border-color: #a7dcb9;
    color: var(--tone-green);
}

.tag-demo {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--lhpr-amber-50);
    color: var(--lhpr-amber-800);
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    vertical-align: middle;
}

/* Campos de formulário (fonte de 16 px para evitar zoom no iOS) */
.field {
    display: grid;
    align-content: start;
    gap: 6px;
    margin-bottom: 14px;
}

.field label {
    font-weight: var(--fw-medium);
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 10px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    font: inherit;
    font-size: 1rem;
}

.field textarea {
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--lhpr-accent);
}

.field [aria-invalid="true"] {
    border-color: #c53030;
    background: var(--tone-red-50);
}

.field-hint {
    margin: 0;
    font-size: 0.85rem;
    color: var(--lhpr-muted);
}

.field-error {
    margin: 0;
    font-size: 0.88rem;
    font-weight: var(--fw-medium);
    color: var(--tone-red);
}

.required {
    color: var(--tone-red);
}

.form-grid {
    display: grid;
    gap: 0 16px;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

/* Filtros da listagem */
/* No celular: busca em linha inteira e as duas seleções lado a lado, para os resultados aparecerem logo. */
.filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 10px;
    padding: 12px;
    margin-bottom: 12px;
    background: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
}

.filters .field {
    margin-bottom: 10px;
    min-width: 0;
}

.filters .field label {
    font-size: 0.85rem;
}

.filters .field-grow,
.filters-actions {
    grid-column: 1 / -1;
}

.filters-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.filters-actions .button {
    flex: 1;
}

.result-count {
    margin: 4px 0 12px;
    color: var(--lhpr-muted);
    font-size: 0.92rem;
}

/* Tabela: cartões no celular, tabela a partir de 768 px */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    display: none;
}

.data-table tr {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    padding: 14px 16px;
    background: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.data-table td {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 8px;
    align-items: baseline;
}

.data-table td::before {
    content: attr(data-label);
    color: var(--lhpr-muted);
    font-size: 0.82rem;
}

.data-table td[data-label="Nome"] {
    display: block;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--lhpr-line);
}

.data-table td[data-label="Nome"]::before {
    content: none;
}

.data-table td .badge {
    justify-self: start;
}

.row-link {
    font-weight: var(--fw-strong);
    font-size: 1.05rem;
    text-decoration: none;
}

.row-link:hover {
    text-decoration: underline;
}

.cell-sub {
    display: block;
    font-size: 0.8rem;
}

.badge-status-active {
    background: var(--lhpr-green-50);
    color: var(--tone-green);
}

.badge-status-inactive {
    background: var(--tone-gray-50);
    color: var(--lhpr-muted);
}

.badge-status-suspended {
    background: var(--tone-red-50);
    color: var(--tone-red);
}

.empty-state {
    padding: 32px 20px;
    text-align: center;
    background: var(--lhpr-surface);
    border: 1px dashed var(--lhpr-line-strong);
    border-radius: var(--radius);
}

.error-code {
    margin: 0;
    font-size: 2.5rem;
    font-weight: var(--fw-strong);
    color: var(--lhpr-green);
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
}

/* Painéis e detalhes */
.panel {
    padding: 20px;
    margin-bottom: 16px;
    background: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line);
    border-radius: 16px; /* igual ao .card-box: mesmo cartão em todas as telas */
    box-shadow: var(--shadow);
}

.panel-muted {
    background: var(--lhpr-bg);
    box-shadow: none;
}

.panel h2 {
    font-size: 1.05rem;
}

.details {
    display: grid;
    gap: 14px 24px;
    margin: 0;
}

.details dt {
    font-size: 0.82rem;
    color: var(--lhpr-muted);
}

.details dd {
    margin: 2px 0 0;
    font-weight: var(--fw-medium);
    overflow-wrap: anywhere;
}

.soon-list {
    margin: 0;
    padding-left: 20px;
    color: var(--lhpr-muted);
}

@media (min-width: 640px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }

    .form-grid-city {
        grid-template-columns: 1fr 120px;
    }

    .details {
        grid-template-columns: 1fr 1fr;
    }

    .details-wide {
        grid-column: 1 / -1;
    }
}

@media (min-width: 768px) {
    .filters {
        grid-template-columns: 2fr 1fr 1fr auto;
        align-items: end;
        gap: 0 12px;
        padding: 16px;
    }

    .filters .field {
        margin-bottom: 0;
    }

    .filters .field-grow,
    .filters-actions {
        grid-column: auto;
    }

    .filters-actions .button {
        flex: none;
    }

    .table-wrap {
        overflow-x: auto;
        background: var(--lhpr-surface);
        border: 1px solid var(--lhpr-line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }

    .data-table thead {
        display: table-header-group;
    }

    .data-table tr {
        display: table-row;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .data-table th,
    .data-table td {
        display: table-cell;
        padding: 12px 16px;
        text-align: left;
        border-bottom: 1px solid var(--lhpr-line);
    }

    .data-table th {
        font-size: 0.82rem;
        font-weight: var(--fw-strong);
        color: var(--lhpr-muted);
        background: var(--lhpr-bg);
    }

    .data-table tbody tr:last-child td {
        border-bottom: 0;
    }

    .data-table tbody tr:hover {
        background: var(--lhpr-soft);
    }

    .data-table td::before {
        content: none;
    }

    .data-table td[data-label="Nome"] {
        display: table-cell;
        padding-bottom: 12px;
    }
}

/* ---------------------------------------------------------------- telas maiores */

@media (min-width: 640px) {
    .cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .timeline-item {
        grid-template-columns: auto 1fr auto;
    }

    .timeline-item .badge {
        grid-column: auto;
    }
}

@media (min-width: 900px) {
    .nav-toggle {
        display: none;
    }

    .site-nav,
    .site-nav.is-open {
        display: flex;
        position: static;
        gap: 4px;
        padding: 0;
        background: none;
        border: 0;
        box-shadow: none;
    }

    .site-nav a {
        padding: 8px 12px;
    }

    .hero {
        padding: 72px 0 56px;
    }

    .hero-grid {
        grid-template-columns: 1.4fr 1fr;
        align-items: center;
        gap: 48px;
    }

    .section {
        padding: 56px 0;
    }

    .cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .footer-bar {
        grid-template-columns: 1fr auto;
    }
}

/* ---------------------------------------------------------------- acesso (FASE 3) */

.alert-warning {
    background: var(--lhpr-amber-50);
    border-color: #fcd34d;
    color: var(--lhpr-amber-800);
}

.tag-self {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    vertical-align: middle;
}

.button-block {
    width: 100%;
}

.button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.page-auth {
    padding: 24px 0 40px;
}

.auth-wrap {
    display: grid;
    justify-items: center;
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.auth-head {
    display: grid;
    justify-items: center;
    gap: 4px;
    margin-bottom: 18px;
    text-align: center;
}

.auth-head h1 {
    margin: 8px 0 0;
}

.auth-head p {
    margin: 0;
}

.brand-mark-lg {
    width: 52px;
    height: 52px;
    font-size: 1.1rem;
}

.auth-foot {
    margin: 16px 0 0;
    font-size: 0.9rem;
    text-align: center;
}

/* Conta no menu: nome (leva a "Minha senha") e botão Sair, que é um formulário POST com CSRF */
.nav-account {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px solid var(--lhpr-line);
}

.nav-account form {
    margin: 0;
}

.nav-user {
    display: inline-block;
    max-width: 16ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.nav-logout {
    padding: 10px 12px;
    border: 1px solid var(--lhpr-line);
    border-radius: 10px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    font: inherit;
    font-weight: var(--fw-medium);
    cursor: pointer;
}

.nav-logout:hover {
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

.site-nav a.nav-login {
    color: var(--lhpr-accent);
}

/* Papéis (caixas de seleção) */
.role-options {
    border: 0;
    padding: 0;
    margin: 0 0 14px;
    min-width: 0;
}

.role-options legend {
    margin-bottom: 6px;
    font-weight: var(--fw-medium);
}

.check {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px solid var(--lhpr-line);
    border-radius: 10px;
    background: var(--lhpr-surface);
    cursor: pointer;
}

.check input {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--lhpr-accent);
}

.action-row {
    display: grid;
    gap: 8px;
}

.action-row form {
    margin: 0;
}

.action-row .button {
    width: 100%;
}

/* Senha temporária: fonte monoespaçada, grande e fácil de copiar */
.secret {
    margin: 0 0 16px;
    padding: 14px 16px;
    border: 1px dashed var(--lhpr-navy);
    border-radius: var(--radius);
    background: var(--lhpr-blue-50);
    text-align: center;
}

.secret code {
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: 1.35rem;
    letter-spacing: 0.08em;
    word-break: break-all;
    user-select: all;
}

@media (min-width: 640px) {
    .page-auth {
        padding: 48px 0 64px;
    }

    .action-row {
        display: flex;
        flex-wrap: wrap;
    }

    .action-row .button {
        width: auto;
    }

    .role-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        column-gap: 8px;
    }

    .role-options legend,
    .role-options .field-error {
        grid-column: 1 / -1;
    }
}

@media (min-width: 900px) {
    .nav-account {
        padding: 0 0 0 8px;
        margin: 0 0 0 8px;
        border-top: 0;
        border-left: 1px solid var(--lhpr-line);
    }
}

/* ---------------------------------------------------------------- profissionais (seção 24) */

/* Visões do cadastro: rolam na horizontal no celular, sem quebrar a página */
.tabs {
    display: flex;
    gap: 6px;
    margin: 0 -16px 12px;
    padding: 0 16px 4px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tabs a {
    flex: none;
    padding: 8px 14px;
    border: 1px solid var(--lhpr-line);
    border-radius: 999px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    font-weight: var(--fw-medium);
    font-size: 0.92rem;
    text-decoration: none;
    white-space: nowrap;
}

.tabs a:hover {
    background: var(--lhpr-blue-50);
}

.tabs a[aria-current="page"] {
    background: var(--lhpr-navy);
    border-color: var(--lhpr-accent);
    color: #fff;
}

/* Histórico de eventos na página do profissional */
.history {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 10px 0;
    border-top: 1px solid var(--lhpr-line);
}

.history li:first-child {
    border-top: 0;
}

.history .muted {
    grid-column: 1;
    font-size: 0.9rem;
}

.history .badge {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
}

.tag-pending {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--lhpr-amber-50);
    color: var(--lhpr-amber-800);
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    vertical-align: middle;
}

form[aria-busy="true"] {
    cursor: progress;
}

@media (min-width: 768px) {
    .filters.filters-4 {
        grid-template-columns: 2fr 1fr 1fr 1fr auto;
    }

    .tabs {
        margin: 0 0 14px;
        padding: 0;
        flex-wrap: wrap;
        overflow: visible;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition: none !important;
    }
}

/* ==========================================================================
   Área logada: barra lateral por módulo, barra superior, trilha e componentes dos módulos
   ========================================================================== */

.site-nav-public,
.site-nav-public.is-open {
    display: flex;
    position: static;
    gap: 4px;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
}

.site-nav-public a {
    padding: 8px 12px;
}

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: 264px;
    max-width: 85vw;
    overflow-y: auto;
    padding: 16px 12px 24px;
    background: var(--lhpr-navy);
    color: #dfe5f6;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
}

.sidebar.is-open {
    transform: none;
    box-shadow: 0 0 0 100vmax rgba(15, 20, 40, 0.45);
}

.no-js .sidebar {
    position: static;
    width: auto;
    max-width: none;
    transform: none;
}

.sidebar-brand {
    margin: 0 6px 18px;
    color: #fff;
}

.sidebar-brand .brand-text strong,
.sidebar-brand .brand-text small {
    color: #fff;
}

.sidebar-brand .brand-mark {
    background: var(--lhpr-surface);
    color: var(--lhpr-accent);
}

.side-group {
    margin: 18px 10px 6px;
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9fabd3;
}

.side-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-nav a {
    display: block;
    padding: 9px 12px;
    border-radius: 10px;
    color: #e8ecfa;
    text-decoration: none;
    font-weight: var(--fw-medium);
}

.side-nav a:hover {
    background: rgba(255, 255, 255, 0.08);
}

.side-nav a[aria-current="page"] {
    background: var(--lhpr-surface);
    color: var(--lhpr-accent);
}

.app-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.app-main main {
    flex: 1;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 8px 16px;
    background: var(--lhpr-surface);
    border-bottom: 1px solid var(--lhpr-line);
}

.topbar-title {
    font-weight: var(--fw-strong);
    color: var(--lhpr-accent);
}

.breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
}

.breadcrumbs li + li::before {
    content: "/";
    margin-right: 4px;
    color: var(--lhpr-muted);
}

.breadcrumbs a {
    color: var(--lhpr-muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.breadcrumbs [aria-current="page"] {
    font-weight: var(--fw-strong);
    color: var(--lhpr-ink);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.topbar-name {
    display: none;
    line-height: 1.2;
}

.topbar-name small {
    display: block;
}

.avatar {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
}

.flash-stack {
    max-width: var(--container);
    margin: 16px auto 0;
    padding: 0 16px;
}

.flash-stack .alert {
    margin: 0 0 8px;
}

.button-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.button-danger {
    background: #b42318;
    border-color: var(--tone-red);
    color: #fff;
}

.button-danger:hover {
    background: #912018;
}

@media (min-width: 640px) {
    .topbar-name {
        display: block;
    }
}

@media (min-width: 1024px) {
    .app-shell {
        display: grid;
        grid-template-columns: 264px minmax(0, 1fr);
    }

    .sidebar,
    .no-js .sidebar {
        position: sticky;
        top: 0;
        height: 100vh;
        width: auto;
        max-width: none;
        transform: none;
        box-shadow: none;
    }

    .sidebar.is-open {
        box-shadow: none;
    }

    .topbar .nav-toggle {
        display: none;
    }
}

/* Indicadores do painel */
.kpis {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin: 0 0 20px;
}

.kpi {
    display: block;
    padding: 16px;
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--lhpr-ink);
}

a.kpi:hover {
    border-color: var(--lhpr-accent);
}

.kpi-label {
    display: block;
    font-size: 0.82rem;
    color: var(--lhpr-muted);
    font-weight: var(--fw-medium);
}

.kpi-value {
    display: block;
    margin-top: 4px;
    font-size: 1.6rem;
    font-weight: var(--fw-strong);
    color: var(--lhpr-accent);
    font-variant-numeric: tabular-nums;
}

.kpi-sub {
    display: block;
    font-size: 0.82rem;
    color: var(--lhpr-muted);
}

.kpi-warn .kpi-value {
    color: var(--lhpr-amber-800);
}

.grid-2 {
    display: grid;
    gap: 16px;
}

@media (min-width: 900px) {
    .grid-2 {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }

    .grid-2-even {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.chart {
    width: 100%;
    height: auto;
    display: block;
}

.chart text {
    font-size: 11px;
    fill: var(--lhpr-muted);
}

.chart .bar-calculated {
    fill: var(--lhpr-navy);
}

.chart .bar-paid {
    fill: var(--lhpr-green);
}

.chart .axis {
    stroke: var(--lhpr-line);
}

.chart-legend {
    display: flex;
    gap: 16px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
}

.chart-legend li::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 6px;
    border-radius: 2px;
    background: var(--lhpr-navy);
}

.chart-legend .legend-paid::before {
    background: var(--lhpr-green);
}

.shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 20px;
}

/* Situações */
.badge-open,
.badge-pending,
.badge-partial {
    background: var(--lhpr-amber-50);
    color: var(--lhpr-amber-800);
}

.badge-closed,
.badge-confirmed,
.badge-paid {
    background: var(--lhpr-green-50);
    color: var(--tone-green);
}

.badge-inactive,
.badge-cancelled,
.badge-reversed {
    background: var(--tone-red-50);
    color: var(--tone-red);
}

.badge-upcoming,
.badge-info {
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

.money,
.num {
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.data-table tfoot td,
.data-table tfoot th {
    font-weight: var(--fw-strong);
    border-top: 2px solid var(--lhpr-line);
}

/* Ação rápida: formulário curto aberto no lugar (sem sair da página). */
.quick-action {
    display: inline-block;
    vertical-align: top;
}

.quick-action > summary {
    list-style: none;
    cursor: pointer;
}

.quick-action > summary::-webkit-details-marker {
    display: none;
}

.quick-action[open] > summary {
    margin-bottom: 8px;
}

.quick-action .quick-body {
    padding: 14px;
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
    min-width: min(420px, 85vw);
}

.inline-form {
    display: inline;
}

.stack {
    display: grid;
    gap: 16px;
}

.form-section {
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    min-width: 0;
}

.form-section legend {
    margin-bottom: 10px;
    font-size: 1.05rem;
    font-weight: var(--fw-strong);
    color: var(--lhpr-accent);
}

.input-money {
    max-width: 140px;
    text-align: right;
}

.definition {
    display: grid;
    gap: 6px 16px;
    margin: 0;
}

.definition dt {
    font-weight: var(--fw-strong);
    color: var(--lhpr-muted);
    font-size: 0.85rem;
}

.definition dd {
    margin: 0 0 8px;
}

@media (min-width: 640px) {
    .definition {
        grid-template-columns: 200px minmax(0, 1fr);
    }

    .definition dd {
        margin: 0;
    }
}

.diff {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
}

.diff code {
    word-break: break-word;
}

.pending-list {
    margin: 0;
    padding-left: 18px;
}

.pending-list li {
    margin-bottom: 4px;
}

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

@media (min-width: 768px) {
    .filters.filters-auto {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .filters.filters-auto .field-grow {
        grid-column: span 2;
    }

    .form-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.demo-banner {
    margin: 0;
    padding: 8px 16px;
    background: var(--lhpr-amber-50);
    color: var(--lhpr-amber-800);
    border-bottom: 1px solid #f3d27a;
    font-size: 0.9rem;
}

/* Ações rápidas como janela modal: o conteúdo abre centralizado sobre um fundo escurecido, fora da tabela
   (não estoura a largura da página). Funciona sem JavaScript; com ele, ganha título, botão Fechar e Esc. */
.quick-action[open]::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(15, 20, 40, 0.5);
}

.quick-action[open] > .quick-body {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 51;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 32px));
    min-width: 0;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 20px;
    border-radius: 16px;
    text-align: left;
    white-space: normal;
    box-shadow: 0 20px 60px rgba(15, 20, 40, 0.3);
}

.quick-body h3 {
    margin: 0 0 12px;
    font-size: 1.15rem;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--lhpr-line);
}

.modal-head strong {
    font-size: 1.1rem;
    color: var(--lhpr-accent);
}

.modal-close {
    border: 0;
    background: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--lhpr-muted);
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--lhpr-ink);
}

.quick-body .field {
    margin-bottom: 0;
}

.quick-body .field select,
.quick-body .field input,
.quick-body .field textarea {
    width: 100%;
}

.pending-actions {
    margin: 0;
    padding: 0;
    list-style: none;
}

.pending-actions li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    padding: 8px 0;
    border-top: 1px solid rgba(146, 64, 14, 0.15);
}

.pending-actions li:first-child {
    border-top: 0;
}

.pending-actions .action-row {
    margin: 0;
}

body.modal-open {
    overflow: hidden;
}

/* Logos e menu lateral com ícones; no computador, pode ser recolhido para mostrar só os ícones. */
.brand-logo {
    display: block;
    height: 40px;
    width: auto;
}

.auth-logo {
    display: block;
    width: 150px;
    height: auto;
    margin: 0 auto 12px;
}

.sidebar-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 4px 12px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 6px;
    border-radius: 10px;
    background: var(--lhpr-surface);
}

.sidebar-brand img {
    display: block;
    height: 40px;
    width: auto;
}

.sidebar-brand .logo-mini {
    display: none;
}

.sidebar-collapse {
    display: none;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    background: transparent;
    color: #e8ecfa;
    cursor: pointer;
}

.sidebar-collapse:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-collapse svg {
    width: 18px;
    height: 18px;
    transition: transform 0.2s ease;
}

.side-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon {
    width: 20px;
    height: 20px;
    flex: none;
}

@media (min-width: 1024px) {
    .sidebar-collapse {
        display: inline-grid;
    }

    .sidebar-collapsed .app-shell {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    .sidebar-collapsed .sidebar {
        padding-left: 10px;
        padding-right: 10px;
        overflow-x: hidden;
    }

    .sidebar-collapsed .sidebar-top {
        flex-direction: column;
        margin: 0 0 12px;
    }

    .sidebar-collapsed .sidebar-brand .logo-full {
        display: none;
    }

    .sidebar-collapsed .sidebar-brand .logo-mini {
        display: block;
    }

    .sidebar-collapsed .sidebar-collapse svg {
        transform: rotate(180deg);
    }

    .sidebar-collapsed .nav-label {
        display: none;
    }

    .sidebar-collapsed .side-nav a {
        justify-content: center;
        padding: 10px 0;
    }

    .sidebar-collapsed .side-group {
        height: 1px;
        margin: 12px 8px;
        background: rgba(255, 255, 255, 0.18);
    }

    .sidebar-collapsed .side-group span {
        display: none;
    }
}

/* ==========================================================================
   Menu em barra de ícones (rail): nome em balão ao passar o mouse; o clique abre o painel do módulo.
   ========================================================================== */
.rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 64px;
    max-width: none;
    padding: 10px 0;
    overflow: visible;
    background: var(--lhpr-navy);
}

.rail-logo {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    border-radius: 10px;
    background: var(--lhpr-surface);
}

.rail-logo img {
    display: block;
    height: 38px;
    width: auto;
}

.rail-nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.rail-item {
    position: relative;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    color: #d6dcf5;
    text-decoration: none;
}

.rail-item:hover,
.rail-item[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.rail-item.is-current {
    background: var(--lhpr-surface);
    color: var(--lhpr-accent);
}

.rail-item .nav-icon {
    width: 22px;
    height: 22px;
}

.rail-bottom {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Balão com o nome (tooltip), à direita do ícone. */
.rail [data-tooltip] {
    position: relative;
}

.rail [data-tooltip]:hover::after,
.rail [data-tooltip]:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    left: calc(100% + 12px);
    z-index: 70;
    transform: translateY(-50%);
    padding: 6px 10px;
    border-radius: 6px;
    background: #111827;
    color: #fff;
    font-size: 0.8rem;
    font-weight: var(--fw-medium);
    white-space: nowrap;
    pointer-events: none;
}

.rail [data-tooltip]:hover::before,
.rail [data-tooltip]:focus-visible::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(100% + 6px);
    z-index: 70;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #111827;
    border-left: 0;
    pointer-events: none;
}

.rail [aria-expanded="true"]::after,
.rail [aria-expanded="true"]::before {
    display: none;
}

/* Painel do módulo, ao lado da barra, sobre o conteúdo. */
.rail-panel {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 64px;
    z-index: 65;
    width: 270px;
    padding: 12px 0;
    overflow-y: auto;
    background: var(--lhpr-navy-700);
    color: #e8ecfa;
    box-shadow: 8px 0 24px rgba(15, 20, 40, 0.35);
}

.rail-panel[hidden] {
    display: none;
}

.rail-panel-brand {
    margin: 0 14px 14px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--lhpr-surface);
}

.rail-panel-brand img {
    display: block;
    height: 36px;
    width: auto;
    margin: 0 auto;
}

.rail-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    font-weight: var(--fw-strong);
    color: #fff;
}

.rail-panel-title .nav-icon {
    width: 22px;
    height: 22px;
}

.rail-panel ul {
    list-style: none;
    margin: 0;
    padding: 0 8px;
}

.rail-panel a {
    display: block;
    padding: 10px 12px;
    border-radius: 8px;
    color: #e8ecfa;
    text-decoration: none;
    font-weight: var(--fw-medium);
}

.rail-panel a:hover,
.rail-panel a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

@media (min-width: 1024px) {
    .app-shell {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .sidebar.rail,
    .no-js .sidebar.rail {
        width: 64px;
        overflow: visible;
    }
}

/* Visual "clean" do menu: barra discreta e painel claro, sem blocos pesados. */
.rail {
    width: 60px;
    padding: 12px 0;
}

.rail-logo {
    width: 40px;
    height: 40px;
    margin-bottom: 18px;
    border-radius: 10px;
}

.rail-logo img {
    height: 32px;
}

.rail-nav {
    gap: 6px;
}

.rail-item {
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.72);
}

.rail-item .nav-icon {
    width: 20px;
    height: 20px;
}

.rail-item:hover,
.rail-item[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.rail-item.is-current {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.rail-item.is-current::before {
    content: "";
    position: absolute;
    left: -10px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--lhpr-surface);
}

.rail-item.is-current:hover::before {
    left: -10px;
    top: 10px;
    border: 0;
    transform: none;
}

.rail-bottom {
    border-top-color: rgba(255, 255, 255, 0.1);
}

.rail-panel {
    top: 12px;
    bottom: auto;
    left: 68px;
    width: 230px;
    max-height: calc(100vh - 24px);
    padding: 10px 0 8px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    box-shadow: 0 12px 32px rgba(23, 32, 51, 0.14);
}

.rail-panel-brand {
    display: none;
}

.rail-panel-title {
    gap: 8px;
    margin: 0 0 4px;
    padding: 4px 16px 8px;
    border-bottom: 0;
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lhpr-muted);
}

.rail-panel-title .nav-icon {
    display: none;
}

.rail-panel ul {
    padding: 0 6px;
}

.rail-panel a {
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--lhpr-ink);
    font-weight: var(--fw-medium);
    font-size: 0.95rem;
}

.rail-panel a:hover {
    background: var(--lhpr-bg);
    color: var(--lhpr-accent);
}

.rail-panel a[aria-current="page"] {
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
}

@media (min-width: 1024px) {
    .app-shell {
        grid-template-columns: 60px minmax(0, 1fr);
    }

    .sidebar.rail,
    .no-js .sidebar.rail {
        width: 60px;
    }
}

/* O conteúdo do modal não herda a cor do aviso em que o botão está. */
.quick-action .quick-body {
    color: var(--lhpr-ink);
}

/* ==========================================================================
   Menu lateral que expande ao clicar (substitui o painel flutuante).
   ========================================================================== */
.rail {
    align-items: stretch;
    padding: 12px 10px;
    transition: width 0.15s ease;
}

.rail-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.rail-head .rail-logo {
    flex: none;
    margin: 0;
}

.rail-wordmark {
    display: none;
    height: 30px;
    width: auto;
    padding: 4px 8px;
    border-radius: 8px;
    background: var(--lhpr-surface);
}

.rail-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 40px;
    height: 40px;
    margin-bottom: 8px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
    font: inherit;
    font-weight: var(--fw-medium);
}

.rail-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.rail-nav {
    align-items: stretch;
}

.rail-group {
    display: flex;
    flex-direction: column;
}

.rail-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 40px;
    padding: 0 10px;
    white-space: nowrap;
    overflow: visible;
}

.rail-label,
.rail-chevron,
.rail-sub {
    display: none;
}

.rail-chevron {
    width: 16px;
    height: 16px;
    margin-left: auto;
    flex: none;
    transition: transform 0.15s ease;
}

/* Expandido: largura com nomes, sobre o conteúdo. */
.rail.is-expanded {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    width: 260px;
    overflow-y: auto;
    box-shadow: 8px 0 30px rgba(15, 20, 40, 0.25);
    transform: none;
}

.rail.is-expanded .rail-wordmark,
.rail.is-expanded .rail-label,
.rail.is-expanded .rail-chevron {
    display: block;
}

.rail.is-expanded .rail-toggle,
.rail.is-expanded .rail-item {
    width: 100%;
}

.rail.is-expanded .rail-item.is-current::before {
    display: none;
}

.rail.is-expanded [data-tooltip]::after,
.rail.is-expanded [data-tooltip]::before {
    display: none;
}

.rail.is-expanded .rail-group.is-open .rail-sub {
    display: block;
}

.rail.is-expanded .rail-group.is-open .rail-chevron {
    transform: rotate(90deg);
}

.rail-sub {
    list-style: none;
    margin: 2px 0 8px;
    padding: 0 0 0 42px;
}

.rail-sub a {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 0.92rem;
}

.rail-sub a:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.rail-sub a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: var(--fw-strong);
}

.rail-bottom {
    display: flex;
    flex-direction: column;
}

/* Fundo escurecido enquanto o menu está expandido. */
body.rail-expanded::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(15, 20, 40, 0.25);
}

/* Expandido, o menu flutua sobre o conteúdo: o conteúdo continua na 2ª coluna e nada se desloca. */
.rail {
    transition: none;
}

@media (min-width: 1024px) {
    .app-main {
        grid-column: 2;
    }

    .sidebar.rail.is-expanded {
        width: 260px;
    }
}

/* Campo de filtro acima de uma tabela. */
.table-filter {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
}

.table-filter input {
    flex: 1;
    max-width: 420px;
}

tr[hidden] {
    display: none;
}

/* Componentes no padrão visual do Bootstrap 5 (input-group, form-control, input-group-text, form-text), em CSS
   próprio enquanto o Bootstrap não é instalado no projeto (D-21.1). Mesmas medidas, bordas e anel de foco. */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 440px;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--lhpr-muted);
    background-color: var(--lhpr-soft);
    border: 1px solid var(--lhpr-line-strong);
    border-right: 0;
    border-radius: 0.375rem 0 0 0.375rem;
}

.input-group-text svg {
    width: 16px;
    height: 16px;
}

.form-control {
    display: block;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    padding: 0.375rem 0.75rem;
    font: inherit;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--lhpr-ink);
    background-color: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 0.375rem;
    appearance: none;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.input-group > .input-group-text + .form-control {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.form-control::placeholder {
    color: var(--lhpr-muted);
    opacity: 1;
}

.form-control:focus {
    color: var(--lhpr-ink);
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.input-group:focus-within .input-group-text {
    border-color: #86b7fe;
}

.form-text {
    font-size: 0.875em;
    color: var(--lhpr-muted);
    white-space: nowrap;
}

/* No computador, o menu expandido fica fixo ao lado do conteúdo (empurra, não cobre) e sem fundo escurecido;
   no celular continua como gaveta sobre a página. */
@media (min-width: 1024px) {
    body.rail-expanded::after {
        display: none;
    }

    body.rail-expanded .app-shell {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .sidebar.rail.is-expanded {
        position: sticky;
        top: 0;
        bottom: auto;
        left: auto;
        height: 100vh;
        box-shadow: none;
        z-index: 30;
    }
}

/* Telas internas na largura total, com margem lateral padrão (24px; 16px no celular). */
.has-sidebar .container,
.has-sidebar .container-narrow {
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
}

.has-sidebar .flash-stack {
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
}

@media (max-width: 639px) {
    .has-sidebar .container,
    .has-sidebar .container-narrow,
    .has-sidebar .flash-stack {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* Menu: uma única logo (o escudo); expandido, o nome aparece em texto ao lado. */
.rail-wordmark {
    display: none !important;
}

.rail-brand-text {
    display: none;
    line-height: 1.15;
    color: #fff;
    white-space: nowrap;
}

.rail-brand-text strong {
    display: block;
    font-size: 1.05rem;
}

.rail-brand-text small {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.rail.is-expanded .rail-brand-text {
    display: block;
}

/* Escala do evento: resumo em cartões e tabela de uma linha por pessoa. */
.kpis-compact {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin-bottom: 16px;
}

.kpis-compact .kpi {
    padding: 12px 14px;
    box-shadow: none;
}

.kpis-compact .kpi-value {
    font-size: 1.3rem;
}

.kpi-total {
    background: var(--lhpr-navy);
    border-color: var(--lhpr-accent);
}

.kpi-total .kpi-label,
.kpi-total .kpi-value {
    color: #fff;
}

.escala-table td,
.escala-table th {
    vertical-align: middle;
}

.escala-table tbody tr:hover {
    background: var(--lhpr-soft);
}

.escala-table .cell-sub {
    display: block;
    margin-top: 2px;
}

.value-minus {
    color: var(--tone-red);
}

.actions-col {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.row-actions {
    display: inline-flex;
    gap: 6px;
}

.entry-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
    border: 1px solid var(--lhpr-line);
    border-radius: 10px;
}

.entry-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-top: 1px solid var(--lhpr-line);
}

.entry-list li:first-child {
    border-top: 0;
}

.entry-list li span {
    flex: 1;
}

.entry-list form {
    margin: 0;
}

.entry-form {
    padding-top: 4px;
}

/* ==========================================================================
   Visual 2: ícones, botões com cor, filtros em botões (chips), listas e faixa de dados.
   ========================================================================== */
:root {
    --tone-blue: #2563eb;
    --tone-blue-50: #eaf1ff;
    --tone-green: #15803d;
    --tone-green-50: #e8f7ee;
    --tone-amber: #b45309;
    --tone-amber-50: #fff4e0;
    --tone-red: #b42318;
    --tone-red-50: #fdecea;
    --tone-gold: #a16207;
    --tone-gold-50: #fdf6dc;
    --tone-gray: #5b6475;
    --tone-gray-50: #eef0f4;
}

.icon {
    width: 18px;
    height: 18px;
    flex: none;
    vertical-align: -3px;
}

/* Botões */
.button-icon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.button-icon .icon {
    width: 18px;
    height: 18px;
}

.button-primary {
    background: linear-gradient(180deg, #2747a8, var(--lhpr-navy));
    border-color: var(--lhpr-accent);
    box-shadow: 0 4px 12px rgba(29, 43, 107, 0.25);
}

.button-primary:hover {
    background: var(--lhpr-navy-700);
}

.button-ghost {
    background: var(--lhpr-surface);
}

.no-js-only {
    display: none;
}

.no-js .no-js-only {
    display: inline-flex;
}

/* Barra de filtros */
.toolbar {
    display: grid;
    gap: 12px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
    background: var(--lhpr-surface);
}

.toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 20px;
}

.toolbar-search {
    flex: 1 1 280px;
    max-width: 460px;
}

.toolbar-field {
    display: grid;
    gap: 4px;
    min-width: 150px;
    font-size: 0.8rem;
    font-weight: var(--fw-strong);
    color: var(--lhpr-muted);
}

.toolbar-field-wide {
    min-width: 240px;
}

.toolbar-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.375rem 2rem 0.375rem 0.75rem;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--lhpr-ink);
    background-color: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 0.375rem;
}

.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Filtros em botões (seleção múltipla) */
.chip-group {
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.chip-group legend {
    margin-bottom: 4px;
    padding: 0;
    font-size: 0.8rem;
    font-weight: var(--fw-strong);
    color: var(--lhpr-muted);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    position: relative;
    cursor: pointer;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 999px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    font-size: 0.88rem;
    font-weight: var(--fw-medium);
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.chip:hover span {
    border-color: var(--tone-blue);
}

.chip-check {
    display: none;
    width: 14px;
    height: 14px;
}

.chip input:checked + span {
    background: var(--tone-blue);
    border-color: var(--tone-blue);
    color: #fff;
}

.chip input:checked + span .chip-check {
    display: inline;
}

.chip input:focus-visible + span {
    outline: 3px solid var(--lhpr-green);
    outline-offset: 2px;
}

.chip-green input:checked + span {
    background: var(--tone-green);
    border-color: var(--tone-green);
}

.chip-amber input:checked + span {
    background: var(--tone-amber);
    border-color: var(--tone-amber);
}

.chip-red input:checked + span {
    background: var(--tone-red);
    border-color: var(--tone-red);
}

.chip-gray input:checked + span {
    background: var(--tone-gray);
    border-color: var(--tone-gray);
}

.chip-blue input:checked + span {
    background: var(--tone-blue);
    border-color: var(--tone-blue);
}

/* Listas */
.list-table tbody tr[data-href] {
    cursor: pointer;
    transition: background 0.1s ease;
}

.list-table tbody tr[data-href]:hover {
    background: var(--lhpr-soft);
}

.list-table td {
    vertical-align: middle;
}

.cell-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cell-main .row-link {
    font-weight: var(--fw-strong);
}

.cell-icon {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: none;
    border-radius: 10px;
}

.cell-icon .icon {
    width: 20px;
    height: 20px;
}

.tone-blue {
    background: var(--tone-blue-50);
    color: var(--tone-blue);
}

.tone-gold {
    background: var(--tone-gold-50);
    color: var(--tone-gold);
}

.tone-green {
    background: var(--tone-green-50);
    color: var(--tone-green);
}

.meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lhpr-ink);
}

.meta .icon {
    color: var(--lhpr-muted);
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
}

.pill .icon {
    width: 15px;
    height: 15px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: var(--fw-strong);
    white-space: nowrap;
}

.tag .icon {
    width: 15px;
    height: 15px;
}

.tag-blue {
    background: var(--tone-blue-50);
    color: var(--tone-blue);
}

.tag-green {
    background: var(--tone-green-50);
    color: var(--tone-green);
}

.tag-gold {
    background: var(--tone-gold-50);
    color: var(--tone-gold);
}

.tag-amber {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.tag-gray {
    background: var(--tone-gray-50);
    color: var(--tone-gray);
}

.avatar-blue {
    background: var(--tone-blue-50);
    color: var(--tone-blue);
}

.avatar-green {
    background: var(--tone-green-50);
    color: var(--tone-green);
}

.avatar-gold {
    background: var(--tone-gold-50);
    color: var(--tone-gold);
}

.avatar-gray {
    background: var(--tone-gray-50);
    color: var(--tone-gray);
}

.badge-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.badge-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.row-go {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: var(--lhpr-muted);
}

.row-go:hover {
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

.empty-icon {
    width: 44px;
    height: 44px;
    color: #a9b3c8;
    margin-bottom: 6px;
}

/* Faixa de dados do evento */
.eyebrow-line {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 6px;
}

.fact-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    margin: 0 0 16px;
}

.fact {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-surface);
}

.fact-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: var(--lhpr-blue-50);
    color: var(--lhpr-accent);
}

.fact small {
    display: block;
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lhpr-muted);
}

.fact strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.25;
}

.event-notes {
    margin: -6px 0 16px;
    font-size: 0.9rem;
}

.toolbar-field .form-control {
    width: 100%;
    min-width: 150px;
}

/* Ações das linhas da escala: botões coloridos com ícone. */
.button-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: var(--fw-strong);
    cursor: pointer;
    list-style: none;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.button-action::-webkit-details-marker {
    display: none;
}

.button-action .icon {
    width: 17px;
    height: 17px;
}

.action-blue {
    background: var(--tone-blue-50);
    color: var(--tone-blue);
    border-color: #cfe0ff;
}

.action-blue:hover {
    background: var(--tone-blue);
    color: #fff;
}

.action-amber {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
    border-color: #fbdcae;
}

.action-amber:hover {
    background: var(--tone-amber);
    color: #fff;
}

.action-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--tone-amber);
    color: #fff;
    font-size: 0.72rem;
}

.action-amber:hover .action-count {
    background: var(--lhpr-surface);
    color: var(--tone-amber);
}

.person-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.tag-sm {
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
}

.escala-table .avatar {
    flex: none;
}

/* Tabela de taxas: cartões por função, campos de valor com "R$", barra de salvar fixa. */
.rate-groups {
    display: grid;
    gap: 16px;
}

.rate-card {
    border: 1px solid var(--lhpr-line);
    border-radius: var(--radius);
    background: var(--lhpr-surface);
    overflow: hidden;
}

.rate-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--lhpr-line);
    background: var(--lhpr-soft);
}

.rate-card-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.rate-rows {
    display: grid;
}

.rate-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.4fr) minmax(140px, 1fr) minmax(140px, 1fr) minmax(120px, 0.8fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid var(--lhpr-line);
}

.rate-row:first-child {
    border-top: 0;
}

.rate-row-head {
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 0.75rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--lhpr-muted);
}

.rate-row:hover:not(.rate-row-head) {
    background: var(--lhpr-soft);
}

.rate-formula {
    grid-column: span 2;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--tone-blue-50);
    color: var(--tone-blue);
    font-size: 0.9rem;
}

.rate-formula-pending {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.rate-value {
    font-weight: var(--fw-strong);
    font-variant-numeric: tabular-nums;
}

.rate-actions {
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
}

.money-input {
    display: flex;
    align-items: stretch;
    max-width: 170px;
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 8px;
    background: var(--lhpr-surface);
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.money-input:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.2);
}

.money-prefix {
    display: grid;
    place-items: center;
    padding: 0 10px;
    background: var(--lhpr-soft);
    color: var(--lhpr-muted);
    font-size: 0.85rem;
    font-weight: var(--fw-strong);
}

.money-input input {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 0;
    outline: 0;
    font: inherit;
    font-weight: var(--fw-strong);
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.money-input.is-changed {
    border-color: var(--tone-amber);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.15);
}

.money-input.is-changed .money-prefix {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.hidden-trigger > summary {
    display: none;
}

.save-bar {
    position: sticky;
    bottom: 16px;
    z-index: 25;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 18px;
    border-radius: 14px;
    background: var(--lhpr-navy);
    color: #fff;
    box-shadow: 0 12px 30px rgba(23, 32, 51, 0.3);
}

.save-bar[hidden] {
    display: none;
}

.save-bar > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.save-bar-actions {
    display: inline-flex;
    gap: 8px;
}

.save-bar .button-primary {
    background: var(--lhpr-surface);
    color: var(--lhpr-accent);
    box-shadow: none;
}

@media (max-width: 899px) {
    .rate-row {
        grid-template-columns: 1fr 1fr;
    }

    .rate-row-head {
        display: none;
    }

    .rate-cat,
    .rate-actions {
        grid-column: 1 / -1;
    }

    .rate-actions {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Menu do usuário (canto superior direito): Minha senha, modo escuro e Sair.
   ========================================================================== */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.user-menu-trigger::-webkit-details-marker {
    display: none;
}

.user-menu-trigger:hover,
.user-menu[open] .user-menu-trigger {
    background: var(--lhpr-soft);
    border-color: var(--lhpr-line);
}

.user-menu-chevron {
    width: 16px;
    height: 16px;
    color: var(--lhpr-muted);
    transform: rotate(90deg);
}

.user-menu[open] .user-menu-chevron {
    transform: rotate(-90deg);
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 270px;
    padding: 8px;
    background: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 20, 40, 0.18);
}

.user-menu-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--lhpr-line);
    line-height: 1.25;
}

.user-menu-head small {
    display: block;
}

.avatar-large {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    flex: none;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--lhpr-ink);
    font: inherit;
    font-weight: var(--fw-medium);
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.user-menu-item .icon {
    width: 18px;
    height: 18px;
    color: var(--lhpr-muted);
}

.user-menu-item:hover,
.user-menu-item:focus-visible,
.user-menu-item.is-current {
    background: var(--lhpr-soft);
    color: var(--lhpr-accent);
}

.user-menu-panel form {
    margin: 6px 0 0;
    padding-top: 6px;
    border-top: 1px solid var(--lhpr-line);
}

.user-menu-exit,
.user-menu-exit .icon,
.user-menu-exit:hover {
    color: var(--tone-red);
}

.user-menu-exit:hover {
    background: var(--tone-red-50);
}

/* ==========================================================================
   Mensagens da ação anterior: avisos flutuantes que somem sozinhos.
   ========================================================================== */
.toast-stack {
    position: fixed;
    top: 72px;
    right: 20px;
    z-index: 80;
    display: grid;
    gap: 10px;
    width: min(400px, calc(100vw - 32px));
    pointer-events: none;
}

.toast-card {
    --toast: var(--tone-green);
    --toast-50: var(--tone-green-50);
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px 16px 14px;
    overflow: hidden;
    background: var(--lhpr-surface);
    border: 1px solid var(--lhpr-line);
    border-left: 4px solid var(--toast);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(15, 20, 40, 0.18);
    color: var(--lhpr-ink);
    pointer-events: auto;
    animation: toast-in 0.25s ease-out;
}

.toast-error {
    --toast: var(--tone-red);
    --toast-50: var(--tone-red-50);
}

.toast-icon {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--toast-50);
    color: var(--toast);
    flex: none;
}

.toast-icon .icon {
    width: 18px;
    height: 18px;
}

.toast-text {
    flex: 1;
    margin: 0;
    line-height: 1.4;
}

.toast-text strong {
    display: block;
    color: var(--toast);
}

.toast-close {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: none;
    color: var(--lhpr-muted);
    cursor: pointer;
    flex: none;
}

.toast-close:hover {
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
}

.toast-close .icon {
    width: 16px;
    height: 16px;
}

.toast-bar {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--toast);
    opacity: 0.55;
    transform-origin: left;
    animation: toast-timer var(--toast-time, 5s) linear forwards;
}

.toast-card:hover .toast-bar {
    animation-play-state: paused;
}

.toast-card.is-leaving {
    opacity: 0;
    transform: translateX(24px);
    transition: opacity 0.2s, transform 0.2s;
}

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

@keyframes toast-timer {
    to {
        transform: scaleX(0);
    }
}

@media (max-width: 639px) {
    .toast-stack {
        top: auto;
        bottom: 16px;
        right: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast-card,
    .toast-bar {
        animation: none;
    }
}

/* ==========================================================================
   Modo escuro: o tema troca só as variáveis; abaixo, os poucos ajustes de componentes com cor própria.
   ========================================================================== */
html[data-theme="dark"] {
    color-scheme: dark;
    --lhpr-navy: #24357f;
    --lhpr-navy-700: #1c2a6a;
    --lhpr-ink: #e4e8f1;
    --lhpr-muted: #9aa4b8;
    --lhpr-line: #283044;
    --lhpr-line-strong: #384259;
    --lhpr-bg: #0d1220;
    --lhpr-surface: #161c2c;
    --lhpr-soft: #1c2336;
    --lhpr-accent: #9cb3ff;
    --lhpr-blue-50: #1d2a4f;
    --lhpr-green-50: #122d1f;
    --lhpr-amber-50: #33260d;
    --lhpr-amber-800: #fbbf24;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
    --tone-blue: #82a7ff;
    --tone-blue-50: #1a2647;
    --tone-green: #4fd18b;
    --tone-green-50: #10291c;
    --tone-amber: #f5a524;
    --tone-amber-50: #33240b;
    --tone-red: #ff7b72;
    --tone-red-50: #3a1618;
    --tone-gold: #f2c94c;
    --tone-gold-50: #30280c;
    --tone-gray: #a7b0c2;
    --tone-gray-50: #232a3b;
}

html[data-theme="dark"] .alert-info,
html[data-theme="dark"] .alert-success,
html[data-theme="dark"] .alert-error,
html[data-theme="dark"] .alert-warning,
html[data-theme="dark"] .alert-demo {
    border-color: var(--lhpr-line-strong);
}

html[data-theme="dark"] .alert-success {
    color: var(--tone-green);
}

html[data-theme="dark"] .rail,
html[data-theme="dark"] .sidebar {
    background: #10172b;
    border-right: 1px solid var(--lhpr-line);
}

html[data-theme="dark"] .button-primary {
    background: linear-gradient(180deg, #3557c4, #26398a);
    border-color: #2c42a0;
    color: #fff;
}

html[data-theme="dark"] .save-bar .button-primary {
    background: #fff;
    color: #1d2b6b;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
    background-color: var(--lhpr-soft);
    border-color: var(--lhpr-line-strong);
    color: var(--lhpr-ink);
}

html[data-theme="dark"] .user-menu-panel,
html[data-theme="dark"] .toast-card {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .demo-banner {
    background: var(--lhpr-amber-50);
    color: var(--lhpr-amber-800);
}

html[data-theme="dark"] img.logo-img {
    filter: brightness(1.1);
}

html[data-theme="dark"] .site-header {
    background: rgba(22, 28, 44, 0.94);
}

/* Abas de uma área com várias telas (ex.: Pagamentos): um item no menu, as telas em abas no topo. */
.section-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 20px;
    border-bottom: 1px solid var(--lhpr-line);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.section-tabs::-webkit-scrollbar {
    display: none;
}

.section-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    padding: 10px 16px;
    margin-bottom: -1px;
    border-bottom: 3px solid transparent;
    color: var(--lhpr-muted);
    font-weight: var(--fw-medium);
    text-decoration: none;
    white-space: nowrap;
}

.section-tabs a .icon {
    width: 18px;
    height: 18px;
}

.section-tabs a:hover {
    color: var(--lhpr-ink);
    background: var(--lhpr-soft);
    border-radius: 10px 10px 0 0;
}

.section-tabs a[aria-current="page"] {
    color: var(--lhpr-accent);
    border-bottom-color: var(--lhpr-accent);
}

/* ==========================================================================
   Acabamento: movimento suave nos componentes (respeita "reduzir movimento" do sistema).
   ========================================================================== */
.button,
.button-action,
.icon-button,
.chip span,
.rail-item,
.rail-sub a,
.section-tabs a,
.user-menu-trigger,
.user-menu-item,
.list-table tbody tr,
.data-table tbody tr {
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease,
        transform 0.18s ease;
}

.button:hover:not(:disabled),
.button-action:hover {
    transform: translateY(-1px);
}

.button:active:not(:disabled),
.button-action:active {
    transform: translateY(0) scale(0.98);
}

.button-primary:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(29, 43, 107, 0.32);
}

.button-danger:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(180, 35, 24, 0.3);
}

.button-lg {
    min-height: 48px;
    padding: 12px 22px;
    font-size: 1rem;
}

.kpi,
.rate-card,
.fact {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.kpi:hover,
.rate-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(23, 32, 51, 0.1);
}

/* Conteúdo entra com um leve deslizar. */
.app-main .page {
    animation: page-in 0.32s ease-out backwards;
}

@keyframes page-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

/* Janelas de ação: fundo esfumaçado e janela que surge com escala. */
.quick-action[open]::before {
    backdrop-filter: blur(3px);
    animation: fade-in 0.2s ease-out;
}

.quick-action[open] > .quick-body {
    animation: modal-in 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.user-menu[open] .user-menu-panel {
    animation: drop-in 0.18s ease-out;
    transform-origin: top right;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, -46%) scale(0.96);
    }
}

@keyframes drop-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.97);
    }
}

/* ==========================================================================
   Topo: botão de tema (lua no claro, sol no escuro) e menu do usuário.
   ========================================================================== */
.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--lhpr-line);
    border-radius: 50%;
    background: var(--lhpr-surface);
    color: var(--lhpr-muted);
    cursor: pointer;
}

.icon-button:hover {
    background: var(--lhpr-soft);
    color: var(--lhpr-accent);
    border-color: var(--lhpr-line-strong);
}

.icon-button .icon {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon {
    grid-area: 1 / 1;
    transition: transform 0.35s ease, opacity 0.25s ease;
}

.theme-sun,
html[data-theme="dark"] .theme-moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.6);
}

html[data-theme="dark"] .theme-sun {
    opacity: 1;
    transform: none;
    color: #fbbf24;
}

/* ==========================================================================
   Janela de confirmação (substitui a caixa padrão do navegador).
   ========================================================================== */
.confirm-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(15, 20, 40, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.18s ease;
}

.confirm-backdrop.is-open {
    opacity: 1;
}

.confirm-dialog {
    --tone: var(--tone-blue);
    --tone-50: var(--tone-blue-50);
    width: min(440px, 100%);
    padding: 28px 28px 22px;
    border: 1px solid var(--lhpr-line);
    border-radius: 20px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    text-align: center;
    box-shadow: 0 30px 80px rgba(15, 20, 40, 0.35);
    transform: translateY(12px) scale(0.95);
    transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.confirm-backdrop.is-open .confirm-dialog {
    transform: none;
}

.confirm-dialog.tone-danger {
    --tone: var(--tone-red);
    --tone-50: var(--tone-red-50);
}

.confirm-dialog.tone-warning {
    --tone: var(--tone-amber);
    --tone-50: var(--tone-amber-50);
}

.confirm-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--tone-50);
    color: var(--tone);
    box-shadow: 0 0 0 8px color-mix(in srgb, var(--tone-50) 50%, transparent);
}

.confirm-icon svg {
    width: 30px;
    height: 30px;
}

.confirm-dialog h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    color: var(--lhpr-ink);
}

.confirm-dialog p {
    margin: 0;
    color: var(--lhpr-muted);
    line-height: 1.5;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 24px;
}

.confirm-actions .button {
    width: 100%;
}

.button-warning {
    background: linear-gradient(180deg, #f59e0b, #d97706);
    border-color: #d97706;
    color: #fff;
}

.button-warning:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.32);
}

/* ==========================================================================
   Fechamento do evento.
   ========================================================================== */
.closing-card {
    padding: 24px;
}

.closing-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.closing-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--lhpr-navy), #3b5bd6);
    color: #fff;
    box-shadow: 0 10px 24px rgba(29, 43, 107, 0.3);
    flex: none;
}

.closing-icon .icon {
    width: 26px;
    height: 26px;
}

.closing-title {
    flex: 1;
    min-width: 220px;
}

.closing-title h2 {
    margin: 0 0 2px;
}

.closing-title p {
    margin: 0;
}

.closing-total {
    padding: 10px 18px;
    border-radius: 14px;
    background: var(--lhpr-soft);
    border: 1px solid var(--lhpr-line);
    text-align: right;
}

.closing-total small {
    display: block;
    color: var(--lhpr-muted);
    font-size: 0.78rem;
    font-weight: var(--fw-medium);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.closing-total strong {
    font-size: 1.4rem;
    color: var(--lhpr-accent);
}

.closing-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.closing-steps li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    background: var(--lhpr-soft);
}

.closing-steps strong {
    display: block;
    font-size: 0.95rem;
}

.closing-steps small {
    color: var(--lhpr-muted);
    line-height: 1.4;
}

.closing-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--lhpr-line);
}

.closing-check {
    margin: 0;
    flex: 1;
    min-width: 260px;
}

.closing-check:has(input:checked) {
    border-color: var(--tone-green);
    background: var(--tone-green-50);
}

@media (prefers-reduced-motion: reduce) {
    .app-main .page,
    .quick-action[open]::before,
    .quick-action[open] > .quick-body,
    .user-menu[open] .user-menu-panel {
        animation: none;
    }

    .confirm-backdrop,
    .confirm-dialog {
        transition: none;
    }
}

html[data-theme="dark"] .kpi:hover,
html[data-theme="dark"] .rate-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

/* Janela de ação fechada não ocupa espaço (evita rolagem lateral da página). */
.quick-action:not([open]) > .quick-body {
    display: none;
}

.cell-icon.tone-amber {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.cell-icon.tone-gray {
    background: var(--tone-gray-50);
    color: var(--tone-gray);
}

/* Textos só para leitor de tela dentro de tabelas roláveis ficam presos à tabela (sem rolagem lateral). */
.table-wrap {
    position: relative;
}

/* ==========================================================================
   Bootstrap 5.3 (local, em assets/vendor): as variáveis dele seguem a identidade do LHPR, para os componentes
   do Bootstrap e os do sistema ficarem iguais nos dois temas.
   ========================================================================== */
:root,
[data-bs-theme="light"],
[data-bs-theme="dark"] {
    --bs-font-sans-serif: var(--font);
    --bs-body-font-family: var(--font);
    --bs-body-color: var(--lhpr-ink);
    --bs-body-bg: var(--lhpr-bg);
    --bs-secondary-color: var(--lhpr-muted);
    --bs-border-color: var(--lhpr-line);
    --bs-border-radius: 10px;
    --bs-border-radius-lg: var(--radius);
    --bs-primary: var(--lhpr-navy);
    --bs-primary-rgb: 29, 43, 107;
    --bs-success-rgb: 21, 128, 61;
    --bs-link-color: var(--lhpr-accent);
    --bs-link-hover-color: var(--lhpr-accent);
    --bs-link-color-rgb: 29, 43, 107;
    --bs-emphasis-color: var(--lhpr-ink);
    --bs-tertiary-bg: var(--lhpr-soft);
    --bs-secondary-bg: var(--lhpr-soft);
    --bs-focus-ring-color: rgba(37, 99, 235, 0.25);
}

[data-bs-theme="dark"] {
    --bs-link-color-rgb: 156, 179, 255;
}

/* O Bootstrap redefine alguns elementos básicos; o sistema mantém os seus. */
body {
    font-size: 1rem;
    line-height: 1.5;
}

legend {
    float: none;
    width: auto;
    font-size: inherit;
    line-height: inherit;
}

/* ==========================================================================
   Navegação fluida: barra de progresso no topo enquanto a página nova carrega.
   ========================================================================== */
.nav-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--tone-blue), var(--tone-green));
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.5);
    opacity: 0;
    pointer-events: none;
}

.nav-progress.is-loading {
    opacity: 1;
    animation: nav-progress 8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
}

.nav-progress.is-done {
    width: 100%;
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
}

@keyframes nav-progress {
    0% {
        width: 0;
    }

    10% {
        width: 35%;
    }

    100% {
        width: 92%;
    }
}

html.is-navigating .app-main main {
    opacity: 0.55;
    transition: opacity 0.15s ease 0.12s;
    pointer-events: none;
}

html.is-navigating,
html.is-navigating * {
    cursor: progress;
}

code {
    color: inherit;
    font-size: 0.875em;
}

/* ==========================================================================
   Relatórios e auditoria.
   ========================================================================== */
.avatar-small {
    width: 30px;
    height: 30px;
    font-size: 0.75rem;
    flex: none;
}

.icon-flip {
    transform: rotate(180deg);
}

.button.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.report-table td,
.audit-table td {
    vertical-align: middle;
}

.audit-table code {
    font-size: 0.78rem;
}

.quick-action[open] > .quick-body.quick-body-wide {
    width: min(760px, calc(100vw - 32px));
}

.audit-reason {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    margin: 0 0 12px;
    border-radius: 10px;
    background: var(--tone-amber-50);
    color: var(--lhpr-ink);
}

.audit-reason .icon {
    width: 18px;
    height: 18px;
    color: var(--tone-amber);
    flex: none;
    margin-top: 2px;
}

.audit-diff th[scope="row"] {
    white-space: nowrap;
    font-weight: var(--fw-medium);
}

.audit-diff td {
    word-break: break-word;
    font-size: 0.9rem;
}

.audit-diff tr.is-changed .audit-before {
    background: var(--tone-red-50);
    color: var(--tone-red);
    text-decoration: line-through;
    text-decoration-color: color-mix(in srgb, var(--tone-red) 45%, transparent);
}

.audit-diff tr.is-changed .audit-after {
    background: var(--tone-green-50);
    color: var(--tone-green);
    font-weight: var(--fw-medium);
}

.verify-card {
    --tone: var(--tone-green);
    --tone-50: var(--tone-green-50);
    margin-top: 12px;
    padding: 40px 28px 28px;
    border: 1px solid var(--lhpr-line);
    border-top: 4px solid var(--tone);
    border-radius: 20px;
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
    text-align: center;
}

.verify-card.is-broken {
    --tone: var(--tone-red);
    --tone-50: var(--tone-red-50);
}

.verify-icon {
    display: inline-grid;
    place-items: center;
    width: 76px;
    height: 76px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--tone-50);
    color: var(--tone);
    box-shadow: 0 0 0 10px color-mix(in srgb, var(--tone-50) 50%, transparent);
    animation: modal-in-soft 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.verify-icon .icon {
    width: 36px;
    height: 36px;
}

.verify-card h1 {
    margin: 0 0 6px;
    color: var(--tone);
}

.verify-ids {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.verify-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

@keyframes modal-in-soft {
    from {
        opacity: 0;
        transform: scale(0.7);
    }
}

.audit-diff tr.is-added .audit-after {
    color: var(--tone-green);
    font-weight: var(--fw-medium);
}

/* Evento fechado: faixa com cadeado e ação de reabrir. */
.closed-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--lhpr-line);
    border-left: 4px solid var(--tone-green);
    border-radius: var(--radius);
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
}

.closed-banner-icon {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--tone-green-50);
    color: var(--tone-green);
    flex: none;
}

.closed-banner-icon .icon {
    width: 20px;
    height: 20px;
}

.closed-banner-text {
    flex: 1;
    min-width: 220px;
    line-height: 1.4;
}

.closed-banner-text strong,
.closed-banner-text span {
    display: block;
}

.reopen-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.reopen-list li {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    line-height: 1.4;
}

.reopen-list .icon {
    width: 18px;
    height: 18px;
    color: var(--tone-amber);
    flex: none;
    margin-top: 2px;
}
/* Pagamento na escala do evento fechado. */
.button-success {
    background: linear-gradient(180deg, #22a55a, #15803d);
    border-color: #15803d;
    color: #fff;
}

.button-success:hover:not(:disabled) {
    box-shadow: 0 8px 20px rgba(21, 128, 61, 0.3);
}

.action-green {
    background: var(--tone-green-50);
    color: var(--tone-green);
    border-color: color-mix(in srgb, var(--tone-green) 30%, transparent);
}

.pay-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.pay-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: var(--fw-strong);
    white-space: nowrap;
}

.pay-status .icon {
    width: 20px;
    height: 20px;
    padding: 3px;
    border-radius: 50%;
}

.pay-status.is-paid {
    background: var(--tone-green-50);
    color: var(--tone-green);
}

.pay-status.is-paid .icon {
    background: var(--tone-green);
    color: #fff;
    stroke-width: 3;
}

.pay-status.is-partial {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.pay-status.is-partial .icon {
    background: var(--tone-amber);
    color: #fff;
    stroke-width: 2.6;
}

/* Nada pago ainda: vermelho com ✗. */
.pay-status.is-unpaid {
    background: var(--tone-red-50);
    color: var(--tone-red);
}

.pay-status.is-unpaid .icon {
    background: var(--tone-red);
    color: #fff;
    stroke-width: 3;
}

.pay-status.is-open {
    background: var(--tone-gray-50);
    color: var(--tone-gray);
}

.kpi-paid .kpi-value {
    color: var(--tone-green);
}

.pay-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--tone-green-50);
}

.pay-summary span {
    color: var(--lhpr-muted);
    font-size: 0.9rem;
}

.pay-summary strong {
    font-size: 1.3rem;
    color: var(--tone-green);
    white-space: nowrap;
}
/* Janela logo depois do fechamento: sugere registrar os pagamentos. */
.after-close {
    display: grid;
    gap: 12px;
    text-align: center;
}

.after-close-icon {
    display: inline-grid;
    place-items: center;
    justify-self: center;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--tone-green);
    color: #fff;
    box-shadow: 0 0 0 10px var(--tone-green-50);
    animation: modal-in-soft 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

.after-close-icon .icon {
    width: 34px;
    height: 34px;
    stroke-width: 2.6;
}

.after-close h3 {
    margin: 4px 0 0;
    font-size: 1.25rem;
}

.after-close p {
    margin: 0;
}

.after-close-actions {
    display: grid;
    gap: 8px;
}

.after-close-actions .button {
    width: 100%;
}
/* ==========================================================================
   Visual 3 (painel moderno): menu com a logo em destaque e seta na borda para abrir/fechar, situações em cor
   sólida, avatares coloridos e cartões de indicador com ícone.
   ========================================================================== */
.rail {
    background: linear-gradient(180deg, #1f2e72 0%, #141d4f 100%);
}

.rail-head {
    justify-content: center;
    width: 100%;
    padding: 4px 0 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rail.is-expanded .rail-head {
    justify-content: flex-start;
    padding-left: 4px;
}

.rail-logo,
.rail-head .rail-logo {
    width: 50px;
    height: 50px;
    margin: 0;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28), 0 0 0 3px rgba(255, 255, 255, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rail-logo:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(74, 222, 128, 0.45);
}

.rail-logo img {
    height: 40px;
}

/* Seta na borda do menu: abre e fecha (gira quando aberto). */
.rail .rail-toggle,
.rail.is-expanded .rail-toggle {
    position: absolute;
    top: 78px;
    right: -14px;
    z-index: 70;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--lhpr-line);
    border-radius: 50%;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    box-shadow: 0 3px 10px rgba(15, 20, 40, 0.2);
}

.rail .rail-toggle:hover {
    background: var(--lhpr-surface);
    color: var(--lhpr-accent);
    transform: scale(1.1);
}

.rail-toggle .nav-icon {
    width: 16px;
    height: 16px;
    transition: transform 0.25s ease;
}

.rail.is-expanded .rail-toggle .nav-icon {
    transform: rotate(180deg);
}

.rail .rail-toggle .rail-label {
    display: none !important;
}

.rail.is-expanded {
    overflow: visible;
}

.rail.is-expanded .rail-nav {
    flex: 1;
    min-height: 0;
    width: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* Item atual: ícone em destaque verde (cor da LHPR). */
.rail-item.is-current {
    background: rgba(34, 197, 94, 0.16);
    color: #4ade80;
}

.rail-item.is-current .nav-icon {
    color: #4ade80;
}

/* Topo mais leve. */
.topbar {
    min-height: 64px;
    background: color-mix(in srgb, var(--lhpr-surface) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
}

/* Situações em cor sólida (bem visíveis nas listas). */
.badge {
    padding: 4px 10px;
    border-radius: 7px;
    font-size: 0.76rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.01em;
}

.badge-dot::before {
    display: none;
}

.badge-closed,
.badge-confirmed,
.badge-paid,
.badge-done,
.badge-ready,
.badge-status-active {
    background: #15803d;
    color: #fff;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.25);
}

.badge-open,
.badge-pending,
.badge-partial,
.badge-current {
    background: #f59e0b;
    color: #3b2400;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.badge-inactive,
.badge-cancelled,
.badge-reversed,
.badge-status-suspended {
    background: #dc2626;
    color: #fff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.badge-upcoming,
.badge-info,
.badge-next {
    background: #2563eb;
    color: #fff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.badge-planned,
.badge-status-inactive {
    background: #64748b;
    color: #fff;
}

/* Avatares com cor cheia e iniciais em branco. */
.avatar {
    background: linear-gradient(135deg, #3b5bd6, #1d2b6b);
    color: #fff;
}

.avatar-green {
    background: linear-gradient(135deg, #22c55e, #15803d);
    color: #fff;
}

.avatar-blue {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
}

.avatar-gold {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #fff;
}

.avatar-gray {
    background: linear-gradient(135deg, #94a3b8, #64748b);
    color: #fff;
}

/* Etiquetas com contorno da própria cor. */
.tag {
    border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}

/* Tabelas: cabeçalho suave e linha destacada ao passar o mouse. */
.data-table thead th {
    background: var(--lhpr-soft);
    color: var(--lhpr-muted);
    font-size: 0.8rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.02em;
}

.data-table tbody tr:hover > * {
    background: color-mix(in srgb, var(--tone-blue-50) 55%, transparent);
}

/* Cartões de indicador com ícone colorido (painel). */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.stat {
    --tone: var(--tone-blue);
    --tone-50: var(--tone-blue-50);
    position: relative;
    display: block;
    padding: 18px 20px;
    border: 1px solid var(--lhpr-line);
    border-radius: 16px;
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
    color: var(--lhpr-ink);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.stat:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--tone) 40%, var(--lhpr-line));
    box-shadow: 0 14px 30px rgba(23, 32, 51, 0.1);
}

.stat.tone-green {
    --tone: var(--tone-green);
    --tone-50: var(--tone-green-50);
}

.stat.tone-amber {
    --tone: var(--tone-amber);
    --tone-50: var(--tone-amber-50);
}

.stat.tone-gold {
    --tone: var(--tone-gold);
    --tone-50: var(--tone-gold-50);
}

.stat.tone-red {
    --tone: var(--tone-red);
    --tone-50: var(--tone-red-50);
}

.stat.tone-gray {
    --tone: var(--tone-gray);
    --tone-50: var(--tone-gray-50);
}

.stat-label {
    display: block;
    padding-right: 52px;
    color: var(--lhpr-muted);
    font-size: 0.86rem;
    font-weight: var(--fw-medium);
}

.stat-value {
    display: block;
    margin-top: 8px;
    font-size: 1.75rem;
    font-weight: var(--fw-strong);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.stat-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    color: var(--lhpr-muted);
    font-size: 0.8rem;
    font-weight: var(--fw-medium);
}

.stat-sub .icon {
    width: 15px;
    height: 15px;
}

.stat-sub.is-good {
    color: var(--tone-green);
}

.stat-sub.is-warn {
    color: var(--tone-amber);
}

.stat-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--tone-50);
    color: var(--tone);
}

.stat-icon .icon {
    width: 22px;
    height: 22px;
}

/* Cartões de conteúdo do painel (título, subtítulo e "ver todos"). */
.card-box {
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--lhpr-line);
    border-radius: 16px;
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.card-head h2 {
    margin: 0;
    font-size: 1.1rem;
}

.card-head p {
    margin: 2px 0 0;
    color: var(--lhpr-muted);
    font-size: 0.86rem;
}

.view-all {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--tone-green);
    font-weight: var(--fw-strong);
    font-size: 0.88rem;
    text-decoration: none;
    white-space: nowrap;
}

.view-all .icon {
    width: 16px;
    height: 16px;
}

.view-all:hover {
    text-decoration: underline;
}

.card-box .table-wrap {
    margin: 0 -20px -20px;
    border: 0;
    border-top: 1px solid var(--lhpr-line);
    border-radius: 0 0 16px 16px;
    box-shadow: none;
}

.dash-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 1100px) {
    .dash-grid {
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    }
}

.chart .bar-calculated {
    fill: #3b5bd6;
}

.chart .bar-paid {
    fill: #22c55e;
}

.chart .grid-line {
    stroke: var(--lhpr-line);
    stroke-dasharray: 3 4;
}

.chart text {
    fill: var(--lhpr-muted);
    font-size: 11px;
}

.legend-row {
    display: flex;
    gap: 14px;
}

.legend-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lhpr-muted);
    font-size: 0.8rem;
    font-weight: var(--fw-medium);
}

.legend-dot::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: #3b5bd6;
}

.legend-dot.is-paid::before {
    background: #22c55e;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--lhpr-muted);
}

.icon-up {
    transform: rotate(-90deg);
}

/* ==========================================================================
   Eventos: alternância Lista / Calendário e calendário mensal.
   ========================================================================== */
.view-switch {
    display: inline-flex;
    padding: 4px;
    gap: 2px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-soft);
}

.view-switch a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 9px;
    color: var(--lhpr-muted);
    font-weight: var(--fw-strong);
    font-size: 0.9rem;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.view-switch a .icon {
    width: 17px;
    height: 17px;
}

.view-switch a:hover {
    color: var(--lhpr-ink);
}

.view-switch a[aria-current="page"] {
    background: var(--lhpr-surface);
    color: var(--lhpr-accent);
    box-shadow: 0 1px 4px rgba(15, 20, 40, 0.12);
}

.cal-layout {
    display: grid;
    gap: 16px;
    align-items: start;
}

@media (min-width: 1100px) {
    .cal-layout {
        grid-template-columns: minmax(0, 1fr) 340px;
    }

    .cal-side {
        position: sticky;
        top: 84px;
    }
}

.cal-card {
    padding: 18px;
}

.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.cal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.cal-nav .icon-button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.cal-nav h2 {
    margin: 0 0 0 6px;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
}

.cal-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.cal-filters .chip-group legend {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

.cal-filters .toolbar-field {
    min-width: 200px;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--lhpr-line);
    gap: 1px;
}

.cal-weekday {
    padding: 10px 6px;
    background: var(--lhpr-soft);
    color: var(--lhpr-muted);
    font-size: 0.78rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.04em;
    text-align: center;
    text-transform: uppercase;
}

.cal-day {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-height: 116px;
    padding: 8px 6px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.cal-day:hover {
    background: var(--lhpr-soft);
}

.cal-day.is-other {
    background: color-mix(in srgb, var(--lhpr-soft) 70%, var(--lhpr-bg));
}

.cal-day.is-other .cal-num {
    color: var(--lhpr-muted);
    opacity: 0.6;
}

.cal-day.is-selected {
    background: color-mix(in srgb, var(--tone-green-50) 80%, var(--lhpr-surface));
    box-shadow: inset 0 0 0 2px var(--tone-green);
}

.cal-num {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: 0 0 2px 2px;
    border-radius: 50%;
    font-weight: var(--fw-strong);
    font-size: 0.9rem;
}

.cal-day.is-today .cal-num {
    background: var(--lhpr-navy);
    color: #fff;
    box-shadow: 0 3px 8px rgba(29, 43, 107, 0.35);
}

/* Faixas dos eventos (eventos de vários dias aparecem emendados). */
.cal-event {
    --kind: var(--tone-blue);
    --kind-50: var(--tone-blue-50);
    display: block;
    margin: 0 -6px;
    padding: 3px 8px;
    border-left: 0;
    background: var(--kind-50);
    color: var(--kind);
    font-size: 0.76rem;
    font-weight: var(--fw-strong);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cal-event.is-start {
    margin-left: 0;
    border-left: 3px solid var(--kind);
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.cal-event.is-end {
    margin-right: 0;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.kind-upcoming {
    --kind: var(--tone-blue);
    --kind-50: var(--tone-blue-50);
}

.kind-ongoing {
    --kind: #7c3aed;
    --kind-50: #f1eafe;
}

.kind-due {
    --kind: var(--tone-amber);
    --kind-50: var(--tone-amber-50);
}

.kind-closed {
    --kind: var(--tone-green);
    --kind-50: var(--tone-green-50);
}

html[data-theme="dark"] .kind-ongoing {
    --kind: #b794f6;
    --kind-50: #2a1f45;
}

.cal-more {
    padding: 0 4px;
    color: var(--lhpr-muted);
    font-size: 0.74rem;
    font-weight: var(--fw-strong);
}

.cal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.cal-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lhpr-muted);
    font-size: 0.8rem;
    font-weight: var(--fw-medium);
}

.cal-legend li::before {
    content: "";
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: var(--kind-50);
    border-left: 3px solid var(--kind);
}

/* Painel do dia e próximos eventos. */
.cal-side {
    display: grid;
    gap: 16px;
}

.cal-side .card-box {
    margin: 0;
}

.cal-panel .card-head h2 {
    font-size: 1rem;
}

.cal-empty {
    padding: 18px 0 6px;
    text-align: center;
}

.cal-agenda,
.cal-upcoming {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cal-item {
    --kind: var(--tone-blue);
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--lhpr-line);
    border-left: 4px solid var(--kind);
    border-radius: 12px;
    color: var(--lhpr-ink);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cal-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.1);
}

.cal-item .meta {
    font-size: 0.84rem;
    color: var(--lhpr-muted);
}

.cal-item-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.cal-upcoming a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 12px;
    color: var(--lhpr-ink);
    text-decoration: none;
}

.cal-upcoming a:hover {
    background: var(--lhpr-soft);
}

.cal-date-chip {
    display: grid;
    place-items: center;
    width: 46px;
    height: 50px;
    border-radius: 12px;
    background: var(--tone-blue-50);
    color: var(--tone-blue);
    line-height: 1.05;
    flex: none;
}

.cal-date-chip small {
    font-size: 0.68rem;
    font-weight: var(--fw-strong);
    text-transform: uppercase;
}

.cal-date-chip strong {
    font-size: 1.25rem;
}

/* Celular: grade compacta (só bolinhas), detalhes no painel abaixo. */
@media (max-width: 699px) {
    .cal-day {
        min-height: 64px;
        padding: 4px 2px;
        align-items: center;
    }

    .cal-event {
        width: 8px;
        height: 8px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--kind);
        font-size: 0;
    }

    .cal-more {
        font-size: 0.65rem;
    }
}

/* Visão selecionada (Lista / Calendário) bem marcada. */
.view-switch a[aria-current="page"] {
    background: var(--lhpr-navy);
    color: #fff;
    box-shadow: 0 4px 12px rgba(29, 43, 107, 0.3);
}

html[data-theme="dark"] .view-switch a[aria-current="page"] {
    background: #3557c4;
}

/* Voltar: padrão único "← Voltar" no canto direito do topo do conteúdo (volta para a tela anterior). */
.back-link {
    display: flex;
    width: max-content;
    min-height: 32px;
    margin: 0 0 6px auto;
    color: var(--lhpr-accent);
    font-size: 0.95rem;
    transition: transform 0.18s ease;
}

.back-link:hover {
    transform: translateX(-3px);
    text-decoration: underline;
}

/* ==========================================================================
   Painel do profissional.
   ========================================================================== */
.profile-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 22px 24px;
    margin-bottom: 16px;
    border: 1px solid var(--lhpr-line);
    border-radius: 18px;
    background:
        radial-gradient(circle at 100% 0, color-mix(in srgb, var(--tone-green) 12%, transparent), transparent 45%),
        radial-gradient(circle at 0 100%, color-mix(in srgb, var(--tone-blue) 10%, transparent), transparent 50%),
        var(--lhpr-surface);
    box-shadow: var(--shadow);
}

.avatar-xl {
    width: 84px;
    height: 84px;
    border-radius: 24px;
    font-size: 1.9rem;
    flex: none;
    box-shadow: 0 10px 24px rgba(23, 32, 51, 0.18);
}

.profile-id {
    flex: 1;
    min-width: 240px;
}

.profile-id h1 {
    margin: 2px 0 8px;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.profile-contact {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.contact-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px solid var(--lhpr-line);
    border-radius: 999px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    font-size: 0.86rem;
    font-weight: var(--fw-medium);
    text-decoration: none;
    transition: border-color 0.18s ease, color 0.18s ease;
}

.contact-chip .icon {
    width: 16px;
    height: 16px;
    color: var(--lhpr-muted);
}

.contact-chip:hover {
    border-color: var(--lhpr-accent);
    color: var(--lhpr-accent);
}

.contact-whatsapp {
    border-color: color-mix(in srgb, var(--tone-green) 35%, transparent);
    background: var(--tone-green-50);
    color: var(--tone-green);
}

.contact-whatsapp .icon {
    color: var(--tone-green);
}

.profile-grid {
    display: grid;
    gap: 16px;
    align-items: start;
}

@media (min-width: 1100px) {
    .profile-grid {
        grid-template-columns: minmax(0, 1fr) 360px;
    }
}

.profile-side {
    display: grid;
    gap: 16px;
}

.profile-side .card-box {
    margin: 0;
}

.profile-side .card-head h2 {
    font-size: 1rem;
}

/* Funções exercidas em barras. */
.function-bars {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.function-bars li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
}

.function-name {
    font-weight: var(--fw-medium);
    font-size: 0.92rem;
}

.function-count {
    color: var(--lhpr-muted);
    font-weight: var(--fw-strong);
    font-size: 0.85rem;
}

.function-track {
    grid-column: 1 / -1;
    height: 8px;
    border-radius: 999px;
    background: var(--tone-gray-50);
    overflow: hidden;
}

.function-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #3b82f6, #22c55e);
    transition: width 0.6s cubic-bezier(0.2, 0.9, 0.3, 1);
}

/* Dados do cadastro. */
.profile-facts {
    display: grid;
    gap: 12px;
    margin: 0;
}

.profile-facts div {
    display: grid;
    gap: 2px;
}

.profile-facts dt {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--lhpr-muted);
    font-size: 0.8rem;
    font-weight: var(--fw-medium);
}

.profile-facts dt .icon {
    width: 15px;
    height: 15px;
}

.profile-facts dd {
    margin: 0 0 0 21px;
    font-weight: var(--fw-medium);
    overflow-wrap: anywhere;
}

.profile-notes {
    display: flex;
    gap: 8px;
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--lhpr-soft);
    color: var(--lhpr-muted);
    font-size: 0.88rem;
}

.profile-notes .icon {
    width: 16px;
    height: 16px;
    flex: none;
    margin-top: 2px;
}

/* Lista curta (últimos pagamentos). */
.mini-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mini-list a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 10px;
    color: var(--lhpr-ink);
    text-decoration: none;
}

.mini-list a:hover {
    background: var(--lhpr-soft);
}

/* Observações do cadastro logo abaixo da faixa de dados. */
.fact-strip + .profile-notes {
    margin: 0 0 16px;
}

/* ==========================================================================
   Menu lateral (visual 4): azul profundo com curvas no rodapé, escudo sem moldura, itens maiores e o item
   atual em verde com barra à esquerda (expandido) ou ícone em destaque (recolhido).
   ========================================================================== */
.rail {
    padding: 16px 0;
    background:
        url("../img/menu-ondas.svg") center bottom / 100% auto no-repeat,
        linear-gradient(180deg, #13277a 0%, #0d1c62 55%, #08124a 100%);
}

.rail.is-expanded {
    padding: 16px 14px;
}

@media (min-width: 1024px) {
    .app-shell {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .sidebar.rail,
    .no-js .sidebar.rail {
        width: 72px;
    }

    .sidebar.rail.is-expanded {
        width: 260px;
    }
}

/* Marca: escudo direto sobre o azul e divisória fina abaixo. */
.rail-head {
    gap: 14px;
    padding: 4px 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rail.is-expanded .rail-head {
    padding-left: 6px;
}

.rail-logo,
.rail-head .rail-logo {
    width: 48px;
    height: 56px;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.rail-logo:hover {
    transform: translateY(-1px) scale(1.04);
    box-shadow: none;
}

.rail-logo img {
    width: auto;
    height: 54px;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.35));
}

.rail-brand-text strong {
    font-size: 1.2rem;
    letter-spacing: 0.01em;
}

.rail-brand-text small {
    margin-top: 2px;
    font-size: 0.8rem;
}

/* Seta de abrir/fechar na altura da divisória. */
.rail .rail-toggle,
.rail.is-expanded .rail-toggle {
    top: 80px;
}

/* Itens. */
.rail-nav {
    gap: 8px;
}

.rail-item {
    position: relative;
    gap: 16px;
    width: 48px;
    height: 48px;
    padding: 0 12px;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.86);
    font-size: 1.02rem;
    font-weight: var(--fw-medium);
}

.rail:not(.is-expanded) .rail-item {
    margin-inline: auto;
}

.rail.is-expanded .rail-item {
    width: 100%;
    padding: 0 14px 0 18px;
}

.rail-item .nav-icon {
    width: 24px;
    height: 24px;
    flex: none;
}

.rail-item:hover,
.rail-item[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.rail-chevron {
    color: rgba(255, 255, 255, 0.6);
}

/* Item atual: texto e ícone verdes sobre fundo levemente claro. */
.rail-item.is-current,
.rail-item.is-current:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #4ade80;
    font-weight: var(--fw-medium);
}

.rail-item.is-current .nav-icon {
    color: #4ade80;
}

/* Barra verde à esquerda só com o menu expandido (recolhido, o ícone verde já destaca). */
.rail.is-expanded .rail-item.is-current::before {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 4px;
    border: 0;
    border-radius: 0 4px 4px 0;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
    transform: none;
}

.rail:not(.is-expanded) .rail-item.is-current:not(:hover)::before {
    display: none;
}

/* Subitens (Cadastros, Financeiro...). */
.rail-sub {
    padding-left: 58px;
}

.rail-sub a {
    color: rgba(255, 255, 255, 0.75);
}

.rail-sub a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.08);
    color: #4ade80;
}

html[data-theme="dark"] .rail {
    background:
        url("../img/menu-ondas.svg") center bottom / 100% auto no-repeat,
        linear-gradient(180deg, #121b44 0%, #0d1433 55%, #090e26 100%);
}

/* ==========================================================================
   Tela de login: cartão central sobre um fundo animado de handebol (quadras, faixas azul/verde e bolas).
   ========================================================================== */
.auth-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 0% 100%, rgba(29, 78, 216, 0.22), transparent 45%),
        radial-gradient(ellipse at 100% 0%, rgba(22, 163, 74, 0.14), transparent 40%),
        radial-gradient(ellipse at 100% 70%, rgba(59, 130, 246, 0.2), transparent 45%),
        linear-gradient(135deg, #dfe9fd 0%, #f3f7ff 45%, #dce7fc 100%);
}

.auth-body main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: grid;
    align-items: center;
}

.auth-body .site-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    border: 0;
    background: transparent;
}

.auth-body .footer-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    text-align: center;
    color: #55607a;
    font-size: 0.85rem;
}

.page-auth {
    padding: 32px 0;
}

/* Fundo: só decoração, atrás de tudo e sem receber cliques. */
.auth-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.auth-court {
    position: absolute;
    width: min(1000px, 85vw);
    height: auto;
    opacity: 0.9;
    filter: drop-shadow(0 0 2px rgba(29, 63, 174, 0.25));
    animation: auth-drift 18s ease-in-out infinite;
}

.auth-court-left {
    top: 4vh;
    left: -28vw;
    transform: perspective(1200px) rotateY(28deg) rotate(84deg);
}

.auth-court-right {
    right: -42vw;
    bottom: -4vh;
    transform: perspective(1200px) rotateY(-24deg) rotate(-12deg);
    animation-delay: -9s;
}

.auth-stripe {
    position: absolute;
    width: 60vw;
    height: 120px;
    background: linear-gradient(180deg, #22a06b 0 30%, transparent 30% 38%, #1d4ed8 38% 100%);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%);
    mask-image: linear-gradient(90deg, transparent, #000 45%);
    opacity: 0.85;
    animation: auth-stripe 12s ease-in-out infinite;
}

.auth-stripe-top {
    top: 4vh;
    right: -22vw;
    transform: rotate(-52deg);
}

.auth-stripe-bottom {
    bottom: 2vh;
    left: -26vw;
    transform: rotate(36deg) scaleX(-1);
    animation-delay: -6s;
}

/* Trajetória do arremesso (arco tracejado) e as bolas. */
.auth-throw {
    position: absolute;
    left: 6vw;
    top: 30vh;
    width: 70vw;
    height: 70vw;
    border: 3px dashed rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 255, 255, 0.75) transparent transparent;
    border-radius: 50%;
    transform: rotate(-18deg);
}

.auth-ball {
    position: absolute;
    height: auto;
    filter: drop-shadow(0 10px 14px rgba(15, 31, 92, 0.25));
}

.auth-ball-1 {
    left: 9vw;
    bottom: 12vh;
    width: 84px;
    animation: auth-bounce 2.6s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.auth-ball-2 {
    top: 18vh;
    right: 12vw;
    width: 54px;
    animation: auth-float 7s ease-in-out infinite;
}

.auth-ball-3 {
    top: 0;
    left: 0;
    width: 40px;
    offset-path: path("M -80 620 Q 520 -60 1180 260");
    offset-rotate: 0deg;
    animation: auth-fly 9s ease-in-out infinite;
}

@keyframes auth-drift {
    0%, 100% { translate: 0 0; }
    50% { translate: 1.5vw -1.5vh; }
}

@keyframes auth-stripe {
    0%, 100% { translate: 0 0; opacity: 0.85; }
    50% { translate: -2vw 1.5vh; opacity: 0.65; }
}

@keyframes auth-bounce {
    0%, 100% { translate: 0 0; rotate: 0deg; scale: 1.06 0.94; }
    12% { scale: 1; }
    50% { translate: 0 -140px; rotate: 180deg; scale: 1; }
    88% { scale: 1; }
}

@keyframes auth-float {
    0%, 100% { translate: 0 0; rotate: 0deg; }
    50% { translate: -16px 22px; rotate: -160deg; }
}

@keyframes auth-fly {
    0% { offset-distance: 0%; rotate: 0deg; opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { offset-distance: 100%; rotate: 540deg; opacity: 0; }
}

@keyframes auth-rise {
    from { opacity: 0; translate: 0 16px; }
    to { opacity: 1; translate: 0 0; }
}

/* Cartão. */
.auth-card {
    width: 100%;
    max-width: 460px;
    padding: 32px 36px 24px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 18px;
    background: var(--lhpr-surface);
    box-shadow: 0 30px 70px rgba(15, 31, 92, 0.16), 0 4px 14px rgba(15, 31, 92, 0.06);
    animation: auth-rise 0.6s ease-out both;
}

.auth-head {
    gap: 6px;
    margin-bottom: 22px;
}

.auth-logo {
    width: 112px;
    margin-bottom: 10px;
    filter: drop-shadow(0 8px 14px rgba(15, 31, 92, 0.2));
}

.auth-head h1 {
    margin: 0;
    color: #0f1f5c;
    font-size: 1.9rem;
    font-weight: var(--fw-strong);
    letter-spacing: -0.01em;
}

.auth-head p {
    color: var(--lhpr-muted);
}

.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 0.95rem;
}

.auth-alert .icon {
    width: 22px;
    height: 22px;
    flex: none;
}

.auth-alert-info {
    border-color: #bfd3fb;
    background: #eaf1ff;
    color: #1d3a8a;
}

.auth-alert-error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.auth-form .field label {
    color: #0f1f5c;
    font-weight: var(--fw-strong);
}

.auth-input {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 46px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: #eef3fd;
    color: var(--lhpr-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.auth-input input[type="password"],
.auth-input input#password {
    padding-right: 52px;
}

.auth-input input:focus {
    border-color: #3b5bdb;
    background: var(--lhpr-surface);
    box-shadow: 0 0 0 4px rgba(59, 91, 219, 0.15);
    outline: 0;
}

.auth-input-icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: #1d2b6b;
    pointer-events: none;
}

.auth-reveal {
    position: absolute;
    right: 8px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #44516b;
    cursor: pointer;
}

.auth-reveal:hover {
    background: rgba(29, 43, 107, 0.08);
}

.auth-reveal .icon {
    width: 20px;
    height: 20px;
}

.auth-reveal .auth-reveal-hide,
.auth-reveal[aria-pressed="true"] .auth-reveal-show {
    display: none;
}

.auth-reveal[aria-pressed="true"] .auth-reveal-hide {
    display: block;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 50px;
    margin-top: 6px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(180deg, #1d3fae 0%, #0f1f6b 100%);
    box-shadow: 0 10px 22px rgba(15, 31, 107, 0.28);
    font-size: 1.05rem;
    font-weight: var(--fw-strong);
}

.auth-submit:hover {
    background: linear-gradient(180deg, #2449c4 0%, #13267f 100%);
}

.auth-submit .icon {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.auth-submit:hover .icon {
    transform: translateX(4px);
}

.auth-divider {
    position: relative;
    height: 1px;
    margin: 24px 0 18px;
    background: var(--lhpr-line);
}

.auth-divider::after {
    content: "";
    position: absolute;
    top: -1px;
    left: 50%;
    width: 48px;
    height: 3px;
    border-radius: 3px;
    background: #b6c7ef;
    transform: translateX(-50%);
}

.auth-help {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.auth-help-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: none;
    border-radius: 50%;
    background: #eef3fd;
    color: #1d2b6b;
}

.auth-help-icon .icon {
    width: 22px;
    height: 22px;
}

.auth-help p {
    margin: 0;
    font-size: 0.88rem;
    color: var(--lhpr-muted);
}

.auth-help strong {
    display: block;
    color: #0f1f5c;
    font-size: 0.95rem;
    font-weight: var(--fw-medium);
}

@media (max-width: 639px) {
    .auth-card {
        padding: 24px 20px 20px;
    }

    .auth-head h1 {
        font-size: 1.6rem;
    }

    .auth-court {
        width: 140vw;
    }

    .auth-ball-1 {
        width: 56px;
    }
}

/* Modo escuro: mesmo desenho em azul-noite. */
html[data-theme="dark"] .auth-body {
    background:
        radial-gradient(ellipse at 0% 100%, rgba(29, 78, 216, 0.3), transparent 45%),
        radial-gradient(ellipse at 100% 0%, rgba(22, 163, 74, 0.18), transparent 40%),
        linear-gradient(135deg, #0b1230 0%, #111a3f 50%, #0a1129 100%);
}

html[data-theme="dark"] .auth-court {
    opacity: 0.25;
}

html[data-theme="dark"] .auth-card {
    border-color: var(--lhpr-line);
}

html[data-theme="dark"] .auth-head h1,
html[data-theme="dark"] .auth-form .field label,
html[data-theme="dark"] .auth-help strong {
    color: var(--lhpr-ink);
}

html[data-theme="dark"] .auth-input input,
html[data-theme="dark"] .auth-help-icon {
    background: var(--lhpr-soft);
}

html[data-theme="dark"] .auth-input-icon,
html[data-theme="dark"] .auth-help-icon {
    color: var(--lhpr-accent);
}

html[data-theme="dark"] .auth-alert-info {
    border-color: #2b3f78;
    background: #16224a;
    color: #c7d6ff;
}

html[data-theme="dark"] .auth-body .footer-bar {
    color: var(--lhpr-muted);
}

@media (prefers-reduced-motion: reduce) {
    .auth-scene *,
    .auth-card {
        animation: none !important;
    }

    .auth-ball-3 {
        display: none;
    }
}

/* ==========================================================================
   Calendário (visual 2): grade mais marcada, números maiores, eventos em faixas de cor sólida com ícone e seta,
   legenda com bolinhas e próximos eventos em cartões.
   ========================================================================== */
.kind-upcoming { --kind-solid: #2563eb; }
.kind-ongoing { --kind-solid: #7c3aed; }
.kind-due { --kind-solid: #d97706; }
.kind-closed { --kind-solid: #16a34a; }

.cal-card {
    padding: 20px;
}

.cal-nav h2 {
    color: var(--lhpr-accent);
    font-size: 1.5rem;
    font-weight: var(--fw-strong);
}

/* Grade com bordas em cada célula (linhas sempre visíveis entre as colunas). */
.cal-grid {
    gap: 0;
    background: var(--lhpr-surface);
}

.cal-weekday,
.cal-day {
    border-right: 1px solid var(--lhpr-line);
    border-bottom: 1px solid var(--lhpr-line);
}

.cal-weekday:nth-child(7n),
.cal-day:nth-child(7n) {
    border-right: 0;
}

.cal-day:nth-last-child(-n + 7) {
    border-bottom: 0;
}

.cal-weekday {
    padding: 12px 6px;
    color: #44516b;
    font-size: 0.8rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.06em;
}

.cal-day {
    gap: 6px;
    min-height: 116px;
    padding: 10px 8px;
}

.cal-day.is-other {
    background: var(--lhpr-soft);
}

.cal-day.is-selected {
    box-shadow: inset 0 0 0 2px var(--tone-green);
}

.cal-num {
    width: 32px;
    height: 32px;
    margin: 0;
    color: var(--lhpr-ink);
    font-size: 1.05rem;
    font-weight: var(--fw-strong);
}

.cal-day.is-other .cal-num {
    opacity: 0.45;
}

.cal-day.is-today .cal-num {
    background: var(--lhpr-navy);
    color: #fff;
    box-shadow: 0 4px 10px rgba(29, 43, 107, 0.35);
}

/* Faixa do evento: cor sólida, ícone de troféu no início e seta no fim (emenda entre os dias). */
.cal-event {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin: 0 -9px;
    padding: 6px 8px;
    border: 0;
    border-radius: 0;
    background: var(--kind-solid);
    color: #fff;
    font-size: 0.78rem;
    font-weight: var(--fw-strong);
    line-height: 1.25;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--kind-solid) 30%, transparent);
    -webkit-line-clamp: unset;
}

.cal-event.is-start {
    margin-left: -2px;
    border-left: 5px solid color-mix(in srgb, var(--kind-solid) 65%, #000);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.cal-event.is-end {
    margin-right: -2px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.cal-event-icon {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
}

.cal-event-icon .icon {
    width: 15px;
    height: 15px;
}

.cal-event-name {
    min-width: 0;
    overflow: hidden;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.cal-event-arrow {
    width: 16px;
    height: 16px;
    margin-left: auto;
    flex: none;
}

.cal-day:hover .cal-event {
    filter: brightness(1.06);
}

/* Legenda com bolinhas sólidas. */
.cal-legend {
    gap: 22px;
    margin-top: 16px;
}

.cal-legend li {
    color: var(--lhpr-ink);
    font-size: 0.88rem;
    font-weight: var(--fw-medium);
}

.cal-legend li::before {
    width: 14px;
    height: 14px;
    border: 0;
    border-radius: 50%;
    background: var(--kind-solid);
}

/* Painel lateral. */
.cal-side .card-head h2 {
    color: var(--lhpr-accent);
    font-size: 1.1rem;
    font-weight: var(--fw-strong);
}

.cal-upcoming a {
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cal-upcoming a:hover {
    background: var(--lhpr-surface);
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.1);
}

.cal-upcoming-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 12px;
    background: color-mix(in srgb, var(--kind-solid) 14%, var(--lhpr-surface));
    color: var(--kind-solid);
}

.cal-upcoming-icon .icon {
    width: 22px;
    height: 22px;
}

.cal-upcoming-body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.cal-upcoming-body strong {
    color: var(--lhpr-accent);
}

.cal-upcoming-body .meta {
    color: var(--lhpr-ink);
    font-size: 0.85rem;
}

.cal-upcoming-arrow {
    width: 18px;
    height: 18px;
    margin-left: auto;
    flex: none;
    color: var(--lhpr-muted);
}

/* Celular: grade compacta (só bolinhas coloridas), detalhes no painel abaixo. */
@media (max-width: 699px) {
    .cal-day {
        min-height: 64px;
        padding: 4px 2px;
    }

    .cal-num {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .cal-event {
        width: 8px;
        height: 8px;
        min-height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 50%;
        box-shadow: none;
    }

    .cal-event > * {
        display: none;
    }
}

/* ==========================================================================
   Menu lateral aberto: silhueta de jogador ao fundo e créditos no rodapé (no lugar do rodapé da página).
   ========================================================================== */
.rail.is-expanded {
    background:
        url("../img/menu-jogador.svg") 30px calc(100% - 96px) / 190px auto no-repeat,
        url("../img/menu-ondas.svg") center bottom / 100% auto no-repeat,
        linear-gradient(180deg, #13277a 0%, #0d1c62 55%, #08124a 100%);
}

html[data-theme="dark"] .rail.is-expanded {
    background:
        url("../img/menu-jogador.svg") 30px calc(100% - 96px) / 190px auto no-repeat,
        url("../img/menu-ondas.svg") center bottom / 100% auto no-repeat,
        linear-gradient(180deg, #121b44 0%, #0d1433 55%, #090e26 100%);
}

.rail-foot {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 14px 6px 4px;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.78rem;
    line-height: 1.4;
    white-space: nowrap;
}

.rail.is-expanded .rail-foot {
    display: flex;
}

.has-sidebar .site-footer {
    display: none;
}

/* ==========================================================================
   Painel inicial (visual 2): cartões com ícone à esquerda e seta, gráfico com eixo de valores, próximos eventos
   em cartões com a data em destaque e títulos de cartão com ícone.
   ========================================================================== */
.dash-greeting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dash-greeting-icon {
    width: 34px;
    height: 34px;
    flex: none;
}

.dash-greeting-icon.is-sun {
    color: #f59e0b;
}

.dash-greeting-icon.is-moon {
    color: #6366f1;
}

.stat.tone-purple {
    --tone: #7c3aed;
    --tone-50: #f1eafe;
}

html[data-theme="dark"] .stat.tone-purple {
    --tone: #b794f6;
    --tone-50: #2a1f45;
}

.dash-stats .stat {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto;
    column-gap: 16px;
    align-items: center;
    padding: 18px 18px 18px 16px;
}

.dash-stats .stat-icon {
    position: static;
    grid-row: 1 / 4;
    grid-column: 1;
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.dash-stats .stat-icon .icon {
    width: 26px;
    height: 26px;
}

.dash-stats .stat-label {
    grid-column: 2;
    padding-right: 0;
    color: var(--lhpr-ink);
    font-weight: var(--fw-medium);
}

.dash-stats .stat-value {
    grid-column: 2;
    margin-top: 4px;
}

.dash-stats .stat-sub {
    grid-column: 2;
    margin-top: 6px;
}

.dash-stats .stat-value.is-good {
    color: var(--tone-green);
}

.stat-go {
    grid-row: 1 / 4;
    grid-column: 3;
    width: 20px;
    height: 20px;
    color: var(--lhpr-muted);
    transition: transform 0.2s ease, color 0.2s ease;
}

a.stat:hover .stat-go {
    color: var(--tone);
    transform: translateX(3px);
}

.dash-stats-money .stat-icon {
    width: 64px;
    height: 64px;
}

.dash-stats-money .stat {
    grid-template-columns: 64px minmax(0, 1fr) auto;
}

.dash-stats-money .stat-value {
    font-size: 1.85rem;
}

/* Título dos cartões com ícone à esquerda e ação/legenda à direita. */
.dash-card .card-head {
    align-items: center;
    justify-content: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.card-head-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    flex: none;
    border-radius: 12px;
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
}

.card-head-icon .icon {
    width: 24px;
    height: 24px;
}

.dash-card .card-head h2 {
    color: var(--lhpr-accent);
    font-size: 1.2rem;
    font-weight: var(--fw-strong);
}

.dash-head-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-left: auto;
}

.dash-card .view-all {
    color: var(--lhpr-accent);
}

.chart-range {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--lhpr-line);
    border-radius: 10px;
    color: var(--lhpr-ink);
    font-size: 0.82rem;
    font-weight: var(--fw-medium);
}

.chart-range .icon {
    width: 15px;
    height: 15px;
    color: var(--lhpr-muted);
}

.legend-dot::before {
    border-radius: 50%;
}

.chart .bar-calculated {
    fill: #2563eb;
}

.chart .grid-line {
    stroke-dasharray: none;
}

.chart .axis-label {
    font-size: 11px;
}

.chart-tip rect {
    fill: #0f1f5c;
}

.chart-tip text {
    fill: #fff;
    font-size: 11px;
    font-weight: var(--fw-strong);
}

html[data-theme="dark"] .chart-tip rect {
    fill: #3557c4;
}

/* Próximos eventos em cartões. */
.dash-events {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dash-event {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    color: var(--lhpr-ink);
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.dash-event:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--lhpr-accent) 30%, var(--lhpr-line));
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.1);
}

.dash-date {
    display: grid;
    place-items: center;
    align-content: center;
    width: 58px;
    height: 62px;
    flex: none;
    border-radius: 12px;
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
    line-height: 1.05;
}

.dash-date strong {
    font-size: 1.5rem;
    font-weight: var(--fw-strong);
}

.dash-date small {
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dash-event-body {
    display: grid;
    justify-items: start;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.dash-event-body strong {
    color: var(--lhpr-accent);
    line-height: 1.25;
}

.dash-event-body .meta {
    color: var(--lhpr-muted);
    font-size: 0.84rem;
}

.dash-event .badge {
    flex: none;
}

.dash-event-go {
    width: 18px;
    height: 18px;
    flex: none;
    color: var(--lhpr-muted);
}

/* Últimos pagamentos: coluna de ações. */
.dash-actions {
    width: 64px;
    text-align: center;
}

.dash-actions .icon-button {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
}

@media (max-width: 639px) {
    .dash-event {
        flex-wrap: wrap;
    }

    .dash-event .badge {
        margin-left: 72px;
    }

    .dash-event-go {
        display: none;
    }
}

/* ==========================================================================
   Listas com filtros (visual 2, começando por Profissionais): título com ícone, filtros num cartão, botões
   "Todos" e bolinhas de situação, resumo em cartões, lista num cartão com ordenação e menu de ações (⋮).
   ========================================================================== */
.page-title {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    flex: none;
    border-radius: 14px;
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
}

.page-title-icon .icon {
    width: 30px;
    height: 30px;
}

.page-title h1 {
    color: var(--lhpr-accent);
}

/* Cartão de filtros. */
.filter-card {
    display: grid;
    gap: 14px;
    margin-bottom: 16px;
    padding: 20px;
    border: 1px solid var(--lhpr-line);
    border-radius: 16px;
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
}

.filter-card .toolbar-row {
    margin: 0;
}

.filter-card-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.filter-card .toolbar-search {
    flex: 1 1 360px;
    max-width: 520px;
}

.filter-card .toolbar-search .form-control,
.filter-card .toolbar-search .input-group-text {
    min-height: 44px;
    background: var(--lhpr-soft);
}

.filter-card .chip-group legend {
    margin-bottom: 6px;
    color: var(--lhpr-ink);
    font-size: 0.86rem;
}

.filter-clear {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    padding: 8px 4px;
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
    font-size: 0.9rem;
    text-decoration: none;
}

.filter-clear .icon {
    width: 16px;
    height: 16px;
}

.filter-clear:hover {
    text-decoration: underline;
}

/* Botões de filtro: selecionado em azul-marinho; "Todos" é um link que limpa o grupo. */
.chip span {
    padding: 7px 14px;
    border-radius: 10px;
    font-weight: var(--fw-medium);
}

.chip input:checked + span,
.chip-all.is-on span {
    background: var(--lhpr-navy);
    border-color: var(--lhpr-navy);
    color: #fff;
    font-weight: var(--fw-strong);
    box-shadow: 0 4px 10px rgba(29, 43, 107, 0.25);
}

.chip-all {
    text-decoration: none;
}

.chip-all:hover span {
    border-color: var(--tone-blue);
}

.chip-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--tone-blue);
}

.chip-green .chip-dot { background: #22c55e; }
.chip-gray .chip-dot { background: #64748b; }
.chip-red .chip-dot { background: #dc2626; }
.chip-amber .chip-dot { background: #f59e0b; }

.chip input:checked + span .chip-dot {
    background: #fff;
}

/* Resumo por situação. */
.people-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.people-summary-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--lhpr-line);
    border-radius: 16px;
    background: var(--lhpr-surface);
    box-shadow: var(--shadow);
}

.people-summary-icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: none;
    border-radius: 14px;
}

.people-summary-icon .icon {
    width: 26px;
    height: 26px;
}

.people-summary-icon.tone-red {
    background: var(--tone-red-50);
    color: var(--tone-red);
}

.people-summary-icon.tone-amber {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.people-summary-item strong {
    display: block;
    color: var(--lhpr-accent);
    font-size: 1.6rem;
    font-weight: var(--fw-strong);
    line-height: 1.1;
}

.people-summary-item small {
    color: var(--lhpr-muted);
    font-size: 0.9rem;
}

/* Lista num cartão, com ordenação no topo. */
.people-list .card-head {
    align-items: center;
    flex-wrap: wrap;
}

.people-list .card-head h2 {
    color: var(--lhpr-accent);
    font-size: 1.15rem;
    font-weight: var(--fw-strong);
}

.people-order {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.people-order label {
    color: var(--lhpr-muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.people-order .form-select {
    min-width: 220px;
}

.people-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.people-actions .row-go {
    vertical-align: middle;
}

/* Menu de ações da linha (⋮). */
.row-menu {
    position: relative;
    display: inline-block;
    vertical-align: middle;
}

.row-menu summary {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    list-style: none;
    cursor: pointer;
}

.row-menu summary::-webkit-details-marker {
    display: none;
}

.row-menu-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 20;
    display: grid;
    min-width: 170px;
    padding: 6px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-surface);
    box-shadow: 0 14px 30px rgba(23, 32, 51, 0.16);
    text-align: left;
}

/* Aberto, o painel flutua sobre a página (posição calculada pelo app.js). */
.row-menu-panel.is-floating {
    z-index: 80;
    min-width: 190px;
}

.row-menu-panel a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--lhpr-ink);
    font-weight: var(--fw-medium);
    font-size: 0.9rem;
    text-decoration: none;
}

.row-menu-panel a:hover {
    background: var(--lhpr-soft);
    color: var(--lhpr-accent);
}

.row-menu-panel .icon {
    width: 17px;
    height: 17px;
    color: var(--lhpr-muted);
}

/* Menu lateral: subitens com ícone e o atual em verde com barra à esquerda. */
.rail-sub {
    padding-left: 18px;
}

.rail-sub a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
}

.rail-sub a .nav-icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.rail-sub a[aria-current="page"] {
    background: rgba(255, 255, 255, 0.1);
    color: #4ade80;
    font-weight: var(--fw-strong);
}

.rail-sub a[aria-current="page"]::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: #22c55e;
}

@media (max-width: 639px) {
    .people-order {
        width: 100%;
        margin-left: 0;
    }

    .people-order .form-select {
        flex: 1;
        min-width: 0;
    }
}

/* ==========================================================================
   Voltar como botão com contorno (canto direito do topo, em todas as telas).
   ========================================================================== */
.back-link {
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--lhpr-line);
    border-radius: 10px;
    background: var(--lhpr-surface);
    box-shadow: 0 2px 8px rgba(23, 32, 51, 0.06);
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
    text-decoration: none;
}

.back-link:hover {
    transform: none;
    border-color: color-mix(in srgb, var(--lhpr-accent) 35%, var(--lhpr-line));
    text-decoration: none;
}

/* ==========================================================================
   Painel do profissional (visual 2): cabeçalho com silhueta ao fundo e caixa de funções, faixa de dados com
   ícones maiores, resumo em blocos coloridos e histórico com competição e ações.
   ========================================================================== */
.person-hero {
    position: relative;
    gap: 24px;
    padding: 24px 28px;
    overflow: hidden;
    background:
        url("../img/menu-jogador.svg") 58% 30% / 200px auto no-repeat,
        linear-gradient(100deg, color-mix(in srgb, var(--tone-blue) 9%, var(--lhpr-surface)) 0%, var(--lhpr-surface) 75%);
}

.person-hero .avatar-xl {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    font-size: 2.3rem;
}

.person-hero .profile-id h1 {
    font-size: 2.2rem;
    font-weight: var(--fw-strong);
    letter-spacing: -0.01em;
}

.person-hero .profile-tags .meta {
    color: var(--lhpr-ink);
    font-size: 1rem;
}

.hero-functions {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    min-width: 260px;
    padding: 14px 18px;
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    background: color-mix(in srgb, var(--lhpr-surface) 85%, transparent);
}

.hero-functions-icon {
    color: var(--lhpr-accent);
}

.hero-functions-icon .icon {
    width: 24px;
    height: 24px;
}

.hero-functions small {
    display: block;
    color: var(--lhpr-muted);
    font-size: 0.82rem;
}

.hero-functions strong {
    display: block;
    margin-bottom: 4px;
    color: var(--lhpr-accent);
    font-size: 1.5rem;
    line-height: 1.1;
}

.person-hero .profile-contact .button {
    min-height: 46px;
}

.person-hero .row-menu summary.hero-more {
    width: 46px;
    height: 46px;
    padding: 0;
}

.person-hero .row-menu-panel {
    min-width: 200px;
}

/* Faixa de dados. */
.person-facts {
    gap: 14px;
}

.person-facts .fact {
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.person-facts .fact-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.person-facts .fact-icon .icon {
    width: 22px;
    height: 22px;
}

.person-facts .fact small {
    font-size: 0.82rem;
    font-weight: var(--fw-medium);
    letter-spacing: 0;
    text-transform: none;
}

.person-facts .fact strong {
    color: var(--lhpr-accent);
    font-size: 1rem;
    font-weight: var(--fw-strong);
}

.person-facts .fact .tag {
    margin-top: 2px;
}

/* Coluna principal e resumo em blocos coloridos. */
.profile-main {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.profile-main .card-box {
    margin: 0;
}

.person-stats {
    margin: 0;
}

.person-stats .stat {
    border-color: transparent;
    background: color-mix(in srgb, var(--tone-50) 70%, var(--lhpr-surface));
    box-shadow: none;
}

.person-stats {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 12px;
}

.person-stats .stat-value.is-discount {
    color: var(--tone-red);
}

/* Seis indicadores numa linha: blocos mais compactos. */
@media (min-width: 1100px) {
    .person-stats {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .person-stats .stat {
        grid-template-columns: 38px minmax(0, 1fr) auto;
        column-gap: 10px;
        padding: 14px 10px 14px 12px;
    }

    .person-stats .stat-icon {
        width: 38px;
        height: 38px;
    }

    .person-stats .stat-icon .icon {
        width: 19px;
        height: 19px;
    }

    .person-stats .stat-value {
        font-size: 1.2rem;
    }

    .person-stats .stat-go {
        width: 16px;
        height: 16px;
    }
}

.person-stats .stat,
.profile-main,
.profile-main > *,
.profile-side > * {
    min-width: 0;
}

.person-stats .stat {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    column-gap: 12px;
    padding: 14px 12px 14px 14px;
}

.person-stats .stat-icon {
    width: 44px;
    height: 44px;
    background: var(--lhpr-surface);
}

.person-stats .stat-icon .icon {
    width: 22px;
    height: 22px;
}

.person-stats .stat-value {
    white-space: nowrap;
}

.person-stats .stat-value {
    font-size: 1.35rem;
}

.profile-side .dash-card .card-head {
    gap: 12px;
}

.profile-side .dash-card .card-head-icon {
    width: 40px;
    height: 40px;
}

.profile-side .dash-card .card-head h2 {
    font-size: 1.05rem;
}

/* Histórico. */
.history-filter .form-select {
    min-width: 190px;
}

.history-empty {
    margin: 16px 0 0;
    text-align: center;
}

.person-payments a {
    padding: 12px;
    border: 1px solid var(--lhpr-line);
}

.person-payments .cell-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
}

.person-payments strong {
    font-size: 1.1rem;
}

.person-payments-go {
    width: 18px;
    height: 18px;
    margin-left: auto;
    color: var(--lhpr-muted);
}

@media (max-width: 899px) {
    .person-hero {
        background-position: 110% 30%, 0 0;
    }

    .hero-functions {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   Listas com filtros (complementos usados em Competições): divisória entre grupos, cartões de resumo
   clicáveis, título da lista com ícone e situação com bolinha.
   ========================================================================== */
.filter-divider {
    align-self: stretch;
    width: 1px;
    margin: 18px 4px 0;
    background: var(--lhpr-line);
}

a.people-summary-item {
    color: var(--lhpr-ink);
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

a.people-summary-item:hover {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--lhpr-accent) 25%, var(--lhpr-line));
    box-shadow: 0 14px 30px rgba(23, 32, 51, 0.1);
}

.people-summary-item.is-green {
    background: color-mix(in srgb, var(--tone-green-50) 55%, var(--lhpr-surface));
}

.people-summary-item .stat-go {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    margin-left: auto;
    padding: 8px;
    border-radius: 50%;
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
}

.people-summary-item.is-green .stat-go {
    background: var(--tone-green-50);
    color: var(--tone-green);
}

.people-summary-icon.tone-purple {
    background: #f1eafe;
    color: #7c3aed;
}

html[data-theme="dark"] .people-summary-icon.tone-purple {
    background: #2a1f45;
    color: #b794f6;
}

.people-list .card-head {
    justify-content: flex-start;
    gap: 14px;
}

.people-list .card-head p {
    margin-top: 2px;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: var(--fw-strong);
}

.status-dot::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: currentColor;
}

.status-dot.is-active {
    background: var(--tone-green-50);
    color: var(--tone-green);
}

.status-dot.is-inactive {
    background: var(--tone-gray-50);
    color: var(--tone-gray);
}

@media (max-width: 899px) {
    .filter-divider {
        display: none;
    }
}

/* ==========================================================================
   Painel da competição: sigla em bloco azul, ícones da faixa por tom, setas redondas nos números e busca na
   lista de eventos.
   ========================================================================== */
.competition-hero .avatar-xl {
    width: 112px;
    height: 112px;
    border-radius: 26px;
    font-size: 2rem;
    letter-spacing: 0.02em;
}

.fact-icon.fact-amber {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.competition-stats .stat-go,
.row-go-round {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 50%;
    background: var(--tone-50, var(--tone-blue-50));
    color: var(--tone, var(--lhpr-accent));
}

.competition-stats .stat {
    background: color-mix(in srgb, var(--tone-50) 35%, var(--lhpr-surface));
}

.row-go-round {
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
}

.row-go-round .icon {
    width: 18px;
    height: 18px;
}

.competition-search .input-group {
    width: 300px;
    max-width: 100%;
}

@media (max-width: 639px) {
    .competition-search,
    .competition-search .input-group {
        width: 100%;
    }
}

/* ==========================================================================
   Lista de eventos: campos de filtro com rótulo, período De/Até lado a lado, barra com total e ordenação,
   ícone da modalidade e escala em destaque.
   ========================================================================== */
.filter-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.filter-field > span,
.filter-field > label,
.filter-field > legend {
    padding: 0;
    color: var(--lhpr-ink);
    font-size: 0.86rem;
    font-weight: var(--fw-strong);
}

.filter-field .form-select,
.filter-field .form-control,
.filter-field .input-group-text {
    min-height: 44px;
}

.filter-field-search {
    flex: 1 1 380px;
    max-width: 540px;
}

.filter-field-search .input-group {
    max-width: none;
}

.events-filters .filter-field:not(.filter-field-search):not(.filter-period) {
    flex: 0 1 220px;
}

.events-filters .filter-field-wide:not(.filter-field-search) {
    flex: 1 1 260px;
}

.filter-period-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--lhpr-muted);
    font-size: 0.9rem;
}

.filter-date span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-date .icon {
    width: 18px;
    height: 18px;
    color: var(--lhpr-accent);
}

.filter-date .form-control {
    width: 170px;
}

.filter-clear-button {
    min-height: 44px;
    margin-left: auto;
}

.list-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 12px;
}

.list-bar .result-count {
    margin: 0;
    color: var(--lhpr-ink);
    font-size: 1.1rem;
}

.list-bar .people-order {
    margin-left: 0;
}

.events-list .table-wrap {
    margin: -20px;
    border-top: 0;
    border-radius: 16px;
}

.event-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    flex: none;
    border-radius: 12px;
}

.event-icon .icon {
    width: 26px;
    height: 26px;
}

.event-icon.tone-blue {
    background: var(--tone-blue-50);
    color: var(--tone-blue);
}

.event-icon.tone-amber {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

.cell-sub-indent {
    padding-left: 24px;
}

.scale-box {
    display: inline-grid;
    justify-items: center;
    padding: 6px 14px;
    border-radius: 10px;
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
    line-height: 1.15;
}

.scale-box > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.scale-box .icon {
    width: 18px;
    height: 18px;
}

.scale-box strong {
    font-size: 1.15rem;
}

.scale-box small {
    font-size: 0.78rem;
}

.status-dot.is-amber {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

@media (max-width: 639px) {
    .filter-date .form-control {
        width: 100%;
    }

    .filter-clear-button {
        margin-left: 0;
    }
}

/* ==========================================================================
   Painel do evento: título com ícone, faixa de dados, faixa "evento fechado" em verde, resumo financeiro da
   escala em blocos coloridos e relação de árbitros num cartão com filtro e ações no topo.
   ========================================================================== */
.event-title .page-title-icon {
    width: 76px;
    height: 76px;
    border-radius: 18px;
}

.event-title .page-title-icon .icon {
    width: 38px;
    height: 38px;
}

.event-title h1 {
    font-size: 2rem;
    font-weight: var(--fw-strong);
}

.event-facts .fact {
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.event-facts .fact-icon {
    width: 40px;
    height: 40px;
}

.event-facts .fact strong {
    color: var(--lhpr-accent);
}

.closed-banner {
    padding: 16px 18px;
    border-color: color-mix(in srgb, var(--tone-green) 30%, var(--lhpr-line));
    background: color-mix(in srgb, var(--tone-green-50) 55%, var(--lhpr-surface));
}

.closed-banner-icon {
    width: 46px;
    height: 46px;
    background: var(--lhpr-surface);
}

.closed-banner-text strong {
    color: var(--lhpr-accent);
}

.event-escala {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.event-escala > .card-box {
    margin: 0;
}

/* Resumo financeiro: blocos com ícone; o total em azul-marinho. */
.escala-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
}

.escala-kpi {
    --tone: var(--tone-blue);
    --tone-50: var(--tone-blue-50);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--tone-50) 60%, var(--lhpr-surface));
    min-width: 0;
}

.escala-kpi.tone-green { --tone: var(--tone-green); --tone-50: var(--tone-green-50); }
.escala-kpi.tone-red { --tone: var(--tone-red); --tone-50: var(--tone-red-50); }
.escala-kpi.tone-amber { --tone: var(--tone-amber); --tone-50: var(--tone-amber-50); }
.escala-kpi.tone-purple { --tone: #7c3aed; --tone-50: #f1eafe; }

html[data-theme="dark"] .escala-kpi.tone-purple {
    --tone: #b794f6;
    --tone-50: #2a1f45;
}

.escala-kpi-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 12px;
    background: var(--lhpr-surface);
    color: var(--tone);
}

.escala-kpi-icon .icon {
    width: 22px;
    height: 22px;
}

.escala-kpi > span:last-child {
    display: grid;
    min-width: 0;
}

.escala-kpi small {
    color: var(--lhpr-muted);
    font-size: 0.8rem;
    line-height: 1.25;
}

.escala-kpi strong {
    color: var(--lhpr-accent);
    font-size: 1.3rem;
    font-weight: var(--fw-strong);
    line-height: 1.2;
    white-space: nowrap;
}

.escala-kpi strong.is-good {
    color: var(--tone-green);
}

.escala-kpi strong.is-warn,
.escala-kpi strong.value-minus {
    color: var(--tone-red);
}

.escala-kpi em {
    color: var(--lhpr-muted);
    font-size: 0.78rem;
    font-style: normal;
}

.escala-kpi.is-total {
    background: linear-gradient(135deg, #1d2b6b, #0f1f5c);
    box-shadow: 0 10px 22px rgba(15, 31, 92, 0.3);
}

.escala-kpi.is-total small,
.escala-kpi.is-total strong {
    color: #fff;
}

.escala-kpi.is-total .escala-kpi-icon {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

/* Relação de árbitros: filtro e botões no topo do cartão. */
.escala-card .card-head {
    flex-wrap: wrap;
}

.escala-tools {
    flex-wrap: wrap;
    gap: 10px;
}

.escala-tools .table-filter {
    margin: 0;
}

.escala-tools .table-filter .input-group {
    width: 340px;
    max-width: 100%;
}

.escala-card .table-wrap {
    margin-top: 0;
}

/* ==========================================================================
   Taxas e regras: listas de seleção com ícone, situação "Em uso" e tipos de lançamento.
   ========================================================================== */
.rates-filters .filter-field {
    flex: 1 1 320px;
    max-width: 580px;
}

.select-icon {
    position: relative;
    display: block;
}

.select-icon > .icon {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--lhpr-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.select-icon .form-select {
    width: 100%;
    padding-left: 42px;
}

.tone-purple {
    background: #f1eafe;
    color: #7c3aed;
}

html[data-theme="dark"] .tone-purple {
    background: #2a1f45;
    color: #b794f6;
}

.status-dot.is-blue {
    background: var(--tone-blue-50);
    color: var(--tone-blue);
}

.entry-types {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.entry-types li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--lhpr-line);
}

.entry-types strong {
    color: var(--lhpr-accent);
}

/* Pagamentos: abas em botões com ícone (a atual com sublinhado azul), cartões e valores em selos. */
.section-tabs {
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
    padding: 2px;
    border-bottom: 0;
    overflow: visible;
}

.section-tabs a {
    margin: 0;
    padding: 10px 18px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    box-shadow: 0 2px 6px rgba(23, 32, 51, 0.05);
}

.section-tabs a:hover {
    border-radius: 12px;
    border-color: color-mix(in srgb, var(--lhpr-accent) 30%, var(--lhpr-line));
    background: var(--lhpr-surface);
}

.section-tabs a[aria-current="page"] {
    border-color: var(--lhpr-line);
    border-bottom: 3px solid var(--tone-blue);
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
}

.section-tabs a[aria-current="page"] .icon {
    color: var(--tone-blue);
}

.finance-stats .stat {
    grid-template-columns: 64px minmax(0, 1fr);
}

.finance-stats .stat-icon {
    width: 64px;
    height: 64px;
}

.finance-stats .stat-value {
    font-size: 1.75rem;
}

.finance-stats .stat-value.is-pending {
    color: #ea580c;
}

.money-pill {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 8px;
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
    font-weight: var(--fw-strong);
}

.money-pill.is-warn {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

/* Usuários: total sob o título, filtros no topo do cartão, avatar e papéis em selos. */
.count-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
    font-size: 0.86rem;
    font-weight: var(--fw-strong);
}

.count-chip .icon {
    width: 15px;
    height: 15px;
}

.users-filters {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

.users-filters .filter-field:not(.filter-field-search) {
    flex: 0 1 300px;
}

.users-card .table-wrap {
    margin: 0 -20px -20px;
}

.user-avatar {
    width: 46px;
    height: 46px;
    background: var(--tone-blue-50);
    color: var(--lhpr-accent);
    font-size: 1.15rem;
    font-weight: var(--fw-strong);
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border: 1px solid var(--lhpr-line);
    border-radius: 8px;
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
    font-size: 0.84rem;
    font-weight: var(--fw-medium);
}

.role-chip .icon {
    width: 15px;
    height: 15px;
    color: var(--lhpr-muted);
}

/* Configurações: duas colunas (temporadas e catálogos | categorias) e catálogos em blocos com ícone. */
.settings-grid {
    display: grid;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

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

.settings-col {
    display: grid;
    gap: 16px;
}

.settings-grid .card-box {
    margin: 0;
}

.catalog-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.catalog-list li {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--lhpr-soft);
}

.catalog-icon {
    color: var(--lhpr-accent);
}

.catalog-icon .icon {
    width: 22px;
    height: 22px;
}

.catalog-list p {
    margin: 0;
}

.catalog-list strong,
.catalog-list p span {
    display: block;
}

.catalog-list strong {
    color: var(--lhpr-accent);
}

.catalog-list p span {
    color: var(--lhpr-muted);
    font-size: 0.9rem;
}

.settings-pending {
    margin: 0;
    padding-left: 20px;
}

.settings-pending li + li {
    margin-top: 6px;
}

/* Profissional (formulário): foto à esquerda e nome, e-mail e telefone à direita. */
.person-form-top {
    display: grid;
    gap: 20px;
    align-items: start;
    margin-bottom: 4px;
}

@media (min-width: 720px) {
    .person-form-top:not(.no-photo) {
        grid-template-columns: 170px minmax(0, 1fr);
    }
}

.person-form-main {
    min-width: 0;
}

/* Campo da foto: área tracejada de "arraste ou clique"; com foto, a imagem ocupa a área. */
.photo-field {
    position: relative;
    display: grid;
    gap: 6px;
}

.photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.photo-drop {
    position: relative;
    display: grid;
    place-items: center;
    width: 170px;
    height: 170px;
    overflow: hidden;
    border: 2px dashed #8cc7a8;
    border-radius: 16px;
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.photo-drop:hover,
.photo-drop.is-dragging {
    border-color: var(--tone-green);
    background: var(--tone-green-50);
}

.photo-input:focus-visible + .photo-drop {
    outline: 3px solid var(--lhpr-green);
    outline-offset: 2px;
}

.photo-drop-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 12px;
}

.photo-drop-empty .icon {
    width: 30px;
    height: 30px;
    color: var(--lhpr-muted);
}

.photo-drop-empty strong {
    font-size: 0.82rem;
    font-weight: var(--fw-medium);
    line-height: 1.3;
}

.photo-drop-empty small {
    color: var(--lhpr-muted);
    font-size: 0.72rem;
}

.photo-drop.has-photo {
    border-style: solid;
    border-color: var(--lhpr-line);
}

.photo-drop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-drop-overlay {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px;
    background: rgba(15, 31, 92, 0.72);
    color: #fff;
    font-size: 0.8rem;
    font-weight: var(--fw-strong);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.photo-drop-overlay .icon {
    width: 16px;
    height: 16px;
}

.photo-drop:hover .photo-drop-overlay,
.photo-input:focus-visible + .photo-drop .photo-drop-overlay {
    opacity: 1;
}

/* Arquivo escolhido (ou foto a remover): faixa no rodapé da área. */
.photo-drop-file {
    position: absolute;
    inset: auto 0 0;
    padding: 6px 8px;
    background: var(--tone-green);
    color: #fff;
    font-size: 0.72rem;
    font-weight: var(--fw-medium);
    line-height: 1.25;
    word-break: break-word;
}

.photo-drop.is-chosen {
    border-style: solid;
    border-color: var(--tone-green);
}

/* Prévia da foto escolhida (ainda não gravada): cobre a área inteira. */
.photo-drop-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-drop.has-preview .photo-drop-empty,
.photo-drop.has-preview > img:not(.photo-drop-preview) {
    visibility: hidden;
}

.photo-drop.has-preview .photo-drop-file {
    z-index: 1;
}

.photo-drop.is-removing img {
    opacity: 0.35;
}

.photo-drop.is-removing .photo-drop-file {
    background: var(--tone-red);
}

.photo-remove {
    position: absolute;
    top: 6px;
    left: 140px;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--tone-red);
    box-shadow: 0 2px 6px rgba(23, 32, 51, 0.25);
    cursor: pointer;
}

.photo-remove input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.photo-remove .icon {
    width: 14px;
    height: 14px;
}

.photo-remove:has(input:checked) {
    background: var(--tone-red);
    color: #fff;
}

.photo-remove:has(input:focus-visible) {
    outline: 3px solid var(--lhpr-green);
}

/* Avatar do profissional em todas as telas: a foto ou o ícone "sem foto" (no lugar das iniciais). */
.avatar-photo {
    overflow: hidden;
    padding: 0;
    background: var(--lhpr-soft);
}

.avatar-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-nophoto {
    background: #e2e8f0;
    color: #64748b;
    box-shadow: none;
}

.avatar-nophoto .icon {
    width: 58%;
    height: 58%;
}

html[data-theme="dark"] .avatar-nophoto {
    background: #2a3349;
    color: #9aa4b8;
}

.avatar-person.avatar-xl {
    border-radius: 50%;
}

/* Profissional (painel): dados cadastrais em largura total, itens lado a lado com divisórias. */
.person-hero {
    background: linear-gradient(100deg, color-mix(in srgb, var(--tone-blue) 7%, var(--lhpr-surface)) 0%, var(--lhpr-surface) 70%);
}

.registry-missing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--tone-amber);
    font-size: 0.86rem;
    font-weight: var(--fw-medium);
}

.registry-missing .icon {
    width: 16px;
    height: 16px;
}

.registry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 14px 0;
    margin: 0;
}

.registry-grid > div {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
    padding: 0 16px;
    border-left: 1px solid var(--lhpr-line);
}

/* Dados à esquerda, categorias ao lado (abaixo em telas estreitas). */
.registry-body {
    display: grid;
    gap: 18px;
}

.registry-categories {
    display: grid;
    align-content: start;
    gap: 10px;
    min-width: 0;
}

.registry-categories h3 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--lhpr-ink);
    font-size: 0.95rem;
}

.registry-categories ul {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Telas largas: 5 colunas e duas linhas (documentos e contato | endereço, conta e anos). */
@media (min-width: 1100px) {
    .registry-body {
        grid-template-columns: minmax(0, 1fr) 220px;
        gap: 0;
    }

    .registry-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 18px 0;
    }

    .registry-span-2 {
        grid-column: span 2;
    }

    .registry-categories {
        padding-left: 22px;
        border-left: 1px solid var(--lhpr-line);
    }

    .registry-categories ul {
        flex-direction: column;
        align-items: flex-start;
    }
}

.registry-grid dt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lhpr-muted);
    font-size: 0.82rem;
}

.registry-grid dt .icon {
    width: 16px;
    height: 16px;
}

.registry-grid dd {
    margin: 0;
    color: var(--lhpr-ink);
    font-weight: var(--fw-medium);
    overflow-wrap: anywhere;
}

.pill-purple {
    background: #f1eafe;
    color: #7c3aed;
}

html[data-theme="dark"] .pill-purple {
    background: #2a1f45;
    color: #b794f6;
}

.registry-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.registry-list > div {
    display: grid;
    gap: 2px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--lhpr-line);
}

.registry-list > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.registry-list dt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--lhpr-muted);
    font-size: 0.8rem;
}

.registry-list dt .icon {
    width: 15px;
    height: 15px;
}

.registry-list dd {
    margin: 0;
    color: var(--lhpr-ink);
    font-weight: var(--fw-medium);
    overflow-wrap: anywhere;
}

/* Profissional (formulário): seções de endereço e conta, com grades próprias. */
.form-section {
    margin: 0 0 16px;
    padding: 14px 16px 4px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
}

.form-section legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 6px;
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
}

.form-section legend .icon {
    width: 18px;
    height: 18px;
}

@media (min-width: 720px) {
    .form-grid-address {
        grid-template-columns: 170px minmax(0, 1fr) 130px;
    }

    .form-grid-bank {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Profissional: categorias de árbitro por modalidade (Indoor, Praia, HCR). */
.modality-categories {
    margin: 0 0 16px;
    padding: 14px 16px 4px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-soft);
}

.modality-categories legend {
    padding: 0 6px;
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
}

.modality-categories .field-hint {
    margin-top: 0;
}

.modality-categories label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.modality-categories label .icon {
    width: 16px;
    height: 16px;
    color: var(--lhpr-muted);
}

.form-grid-3 {
    display: grid;
    gap: 12px;
}

@media (min-width: 640px) {
    .form-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Regras: abas em botões arredondados, cartões de resumo e aviso que pode ser fechado. */
.pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 16px;
}

.pill-tabs a {
    padding: 9px 22px;
    border: 1px solid var(--lhpr-line);
    border-radius: 999px;
    background: var(--lhpr-surface);
    color: var(--lhpr-accent);
    font-weight: var(--fw-strong);
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(23, 32, 51, 0.05);
}

.pill-tabs a:hover {
    border-color: color-mix(in srgb, var(--lhpr-accent) 35%, var(--lhpr-line));
}

.pill-tabs a[aria-current="page"] {
    border-color: var(--lhpr-navy);
    background: var(--lhpr-navy);
    color: #fff;
    box-shadow: 0 6px 14px rgba(29, 43, 107, 0.3);
}

.rules-stats .stat-label {
    color: var(--lhpr-ink);
}

.notice-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}

.notice-card[hidden] {
    display: none;
}

.notice-card-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    background: var(--tone-blue);
    color: #fff;
}

.notice-card-icon .icon {
    width: 20px;
    height: 20px;
}

.notice-card p {
    flex: 1;
}

.notice-card p strong,
.notice-card p span {
    display: block;
}

.notice-card p span {
    color: var(--lhpr-muted);
    font-size: 0.92rem;
}

.notice-close {
    flex: none;
}

/* Regra (detalhe): cabeçalho, grade de configuração em duas colunas e caixas de governança. */
.rule-hero {
    background:
        linear-gradient(100deg, color-mix(in srgb, var(--tone-blue) 8%, var(--lhpr-surface)) 0%, var(--lhpr-surface) 70%);
}

.rule-hero-icon {
    width: 84px;
    height: 84px;
    border-radius: 18px;
}

.rule-hero-icon .icon {
    width: 42px;
    height: 42px;
}

.rule-hero h1 {
    margin: 0 0 8px;
    font-size: 1.9rem;
    font-weight: var(--fw-strong);
}

.button-danger-outline {
    border: 1px solid color-mix(in srgb, var(--tone-red) 40%, var(--lhpr-line));
    background: var(--lhpr-surface);
    color: var(--tone-red);
}

.button-danger-outline:hover:not(:disabled) {
    background: var(--tone-red-50);
}

.rule-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    overflow: hidden;
}

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

.rule-grid-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--lhpr-line);
    border-right: 1px solid var(--lhpr-line);
    margin: 0 -1px -1px 0;
}

.rule-grid-item .fact-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
}

.rule-grid-item dt {
    color: var(--lhpr-muted);
    font-size: 0.84rem;
    font-weight: var(--fw-medium);
}

.rule-grid-item dd {
    margin: 0;
    color: var(--lhpr-ink);
    font-weight: var(--fw-strong);
}

.rule-notes {
    display: grid;
    gap: 10px;
}

.rule-note {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 12px;
}

.rule-note p {
    margin: 0;
}

.rule-note p strong,
.rule-note p span {
    display: block;
}

.rule-note-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 50%;
    color: #fff;
}

.rule-note-icon .icon {
    display: block;
    width: 20px;
    height: 20px;
}

.rule-note.is-warn strong {
    color: var(--tone-amber);
}

.rule-note.is-info {
    background: var(--tone-blue-50);
}

.rule-note.is-info strong {
    color: var(--lhpr-accent);
}

.rule-note.is-info .rule-note-icon {
    background: var(--tone-blue);
}

.rule-note.is-good {
    background: var(--tone-green-50);
}

.rule-note.is-good strong {
    color: var(--tone-green);
}

.rule-note.is-good .rule-note-icon {
    background: #16a34a;
}

.rule-note.is-warn {
    background: var(--tone-amber-50);
}

.rule-note.is-warn .rule-note-icon {
    background: #f59e0b;
}

/* Tabela de taxas (detalhe): avisos com ícone, cartões dos grupos com cabeçalho branco e linhas de tabela. */
.alert-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-icon > .icon {
    width: 20px;
    height: 20px;
    flex: none;
}

.rate-card {
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.rate-card:hover {
    transform: none;
}

.rate-card-head {
    gap: 14px;
    padding: 16px 20px;
    background: var(--lhpr-surface);
}

.rate-card-head h2 {
    color: var(--lhpr-accent);
    font-size: 1.15rem;
    font-weight: var(--fw-strong);
}

.rate-card-head .muted {
    font-size: 0.86rem;
}

.rate-row {
    padding: 8px 20px;
}

.rate-row-head {
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.82rem;
}

.rate-row .tag {
    font-weight: var(--fw-strong);
}

.money-input {
    max-width: 190px;
}

.money-input input {
    padding: 7px 12px;
}

@media (max-width: 639px) {
    .escala-tools,
    .escala-tools .table-filter,
    .escala-tools .table-filter .input-group {
        width: 100%;
    }
}

/* Período do evento no histórico do profissional: as duas datas na mesma linha. */
.cell-period {
    white-space: nowrap;
}

/* Login: perfis Árbitro (primeiro acesso por e-mail) e Equipe LHPR (senha pelo administrador), em cartões. */
.auth-roles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0 0 20px;
}

.auth-role {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 84px;
    padding: 14px 14px 14px 16px;
    border: 1px solid #dfe6f5;
    border-radius: 14px;
    background: var(--lhpr-surface);
    color: #0f1f5c;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 31, 92, 0.06);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.auth-role:hover {
    border-color: #b6c7ef;
    color: #0f1f5c;
    transform: translateY(-1px);
}

.auth-role-icon .icon {
    width: 30px;
    height: 30px;
}

.auth-role-text {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.auth-role-text strong {
    font-size: 1rem;
    font-weight: var(--fw-strong);
}

.auth-role-text small {
    color: var(--lhpr-muted);
    font-size: 0.78rem;
    line-height: 1.3;
}

.auth-role-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #cfd6e4;
    border-radius: 50%;
    background: #fff;
}

.auth-role.is-active {
    border-color: #6f8fe8;
    background: linear-gradient(135deg, #2541b8, #1d2b8f);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(111, 143, 232, 0.3), 0 8px 18px rgba(29, 43, 143, 0.28);
}

.auth-role.is-active .auth-role-text small {
    color: rgba(255, 255, 255, 0.85);
}

.auth-role.is-active .auth-role-radio {
    border-color: #fff;
    background: radial-gradient(circle, #6f9cff 0 45%, #fff 50%);
}

.auth-role:focus-visible {
    outline: 2px solid #1d2b6b;
    outline-offset: 3px;
}

@media (max-width: 479px) {
    .auth-roles {
        grid-template-columns: 1fr;
    }
}

/* Separador "ou" entre o botão de entrar e a ajuda. */
.auth-or {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0 14px;
    color: var(--lhpr-muted);
    font-size: 0.85rem;
}

.auth-or::before,
.auth-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dfe6f5;
}

/* Ajuda do login em caixa e silhueta de jogador no canto do cartão. */
.auth-card-player .auth-help {
    justify-content: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f3f6fd;
}

.auth-card-player {
    position: relative;
    background:
        url("../img/menu-jogador.svg") calc(100% + 34px) 40px / 150px auto no-repeat,
        var(--lhpr-surface);
    max-width: 520px;
}

.auth-help a {
    font-weight: var(--fw-medium);
}

.auth-alert strong {
    word-break: break-all;
}

/* Painel: calculado × pago por tipo (diárias, passagens, desconto APAH e outros ajustes). */
.paid-kinds {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.paid-kind {
    --tone: var(--tone-blue);
    --tone-50: var(--tone-blue-50);
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    background: var(--lhpr-surface);
}

.paid-kind-gold { --tone: var(--tone-gold); --tone-50: var(--tone-gold-50); }
.paid-kind-red { --tone: var(--tone-red); --tone-50: var(--tone-red-50); }
.paid-kind-purple { --tone: #7c3aed; --tone-50: #f1eafe; }

html[data-theme="dark"] .paid-kind-purple { --tone: #b794f6; --tone-50: #2a1f45; }

.paid-kind-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paid-kind-head .stat-icon {
    position: static;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.paid-kind-head .stat-icon .icon {
    width: 18px;
    height: 18px;
}

.paid-kind-label {
    flex: 1;
    color: var(--lhpr-ink);
    font-weight: var(--fw-strong);
}

.paid-kind-percent {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--tone-50);
    color: var(--tone);
    font-size: 0.8rem;
    font-weight: var(--fw-strong);
}

.paid-kind-value {
    display: grid;
    gap: 2px;
    margin: 0;
}

.paid-kind-value small {
    color: var(--lhpr-muted);
    font-size: 0.8rem;
}

.paid-kind-value strong {
    color: var(--tone);
    font-size: 1.35rem;
    line-height: 1.2;
}

.paid-kind-bar {
    display: block;
    width: 100%;
    height: 8px;
}

.paid-kind-track {
    fill: var(--tone-50);
}

.paid-kind-fill {
    fill: var(--tone);
}

.paid-kind-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0;
}

.paid-kind-meta dt {
    color: var(--lhpr-muted);
    font-size: 0.75rem;
    font-weight: var(--fw-medium);
}

.paid-kind-meta dd {
    margin: 0;
    color: var(--lhpr-ink);
    font-size: 0.9rem;
    font-weight: var(--fw-medium);
}

/* Painel do profissional: débitos (saldo devedor) e lançamento de débito. */
.debts-side {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.debt-balance {
    display: grid;
    justify-items: end;
    gap: 2px;
    padding: 8px 14px;
    border-radius: 12px;
    background: var(--tone-gray-50);
    color: var(--lhpr-ink);
}

.debt-balance small {
    color: var(--lhpr-muted);
    font-size: 0.75rem;
    font-weight: var(--fw-medium);
}

.debt-balance strong {
    font-size: 1.15rem;
}

.debt-balance.is-due {
    background: var(--tone-red-50);
    color: var(--tone-red);
}

.debt-amount {
    color: var(--tone-red);
    white-space: nowrap;
}

@media (max-width: 719px) {
    .debts-side {
        width: 100%;
        justify-content: space-between;
    }
}

/* Cabeçalho do profissional: botão "Lançar débito" (âmbar, para não confundir com o Inativar vermelho). */
.button-debt {
    border: 1px solid color-mix(in srgb, var(--tone-amber) 45%, var(--lhpr-line));
    background: var(--lhpr-surface);
    color: var(--tone-amber);
}

.button-debt:hover {
    background: var(--tone-amber-50);
    color: var(--tone-amber);
}

/* Resumo com o indicador de débitos: sete blocos numa linha em telas largas; quatro por linha no meio-termo. */
@media (min-width: 1100px) {
    .person-stats.has-debts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1500px) {
    .person-stats.has-debts {
        grid-template-columns: repeat(7, minmax(0, 1fr));
    }

    .person-stats.has-debts .stat-value {
        font-size: 1.1rem;
    }
}

/* Links secundários dentro das listas (ex.: evento na lista de valores a pagar): sem sublinhado até o hover. */
.cell-link {
    color: var(--lhpr-accent);
    font-weight: var(--fw-medium);
    text-decoration: none;
}

.cell-link:hover {
    text-decoration: underline;
}

/* Pagamento em lote: coluna de marcação estreita e o formulário do lote dentro do mesmo cartão da lista. */
.cell-check {
    width: 44px;
}

.batch-form .form-section {
    margin: 20px 4px 4px;
}

/* Valores dos indicadores nunca quebram no meio ("R$" numa linha e o número na outra). */
.stats .stat-value {
    white-space: nowrap;
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
}

/* Resumo do profissional com 7 indicadores numa linha: blocos compactos (sem a seta; o bloco todo é clicável). */
@media (min-width: 1500px) {
    .person-stats.has-debts .stat {
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 10px;
        padding: 14px 12px;
    }

    .person-stats.has-debts .stat-icon {
        width: 32px;
        height: 32px;
    }

    .person-stats.has-debts .stat-icon .icon {
        width: 17px;
        height: 17px;
    }

    .person-stats.has-debts .stat-go {
        display: none;
    }

    .person-stats.has-debts .stat-value {
        font-size: 1.05rem;
    }
}

/* Link "Esqueci minha senha" abaixo do campo de senha. */
.auth-forgot {
    margin: -4px 0 14px;
    text-align: right;
    font-size: 0.88rem;
}

.auth-forgot a {
    font-weight: 600;
}

/* Demonstrativo em PDF ao lado da situação do pagamento. */
.pay-cell {
    white-space: nowrap;
}

.pay-doc {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: 6px;
    border: 1px solid var(--lhpr-line);
    border-radius: 8px;
    color: var(--lhpr-muted);
    vertical-align: middle;
}

.pay-doc:hover {
    color: var(--lhpr-accent);
    border-color: var(--lhpr-accent);
}

.pay-doc .icon {
    width: 15px;
    height: 15px;
}

.pay-cell .pay-line {
    display: inline-flex;
}

/* Tela A pagar: linha marcada e valor a pagar editável. */
.pay-table tbody tr.is-selected > * {
    background: color-mix(in srgb, var(--tone-green-50) 75%, transparent);
}

.pay-table .cell-check input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.pay-amount {
    width: 140px;
    margin-left: auto;
}

.pay-amount input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.pay-bar strong {
    margin: 0 2px;
}

html[data-theme="dark"] .auth-card-player .auth-help {
    background: rgba(148, 163, 214, 0.1);
}

/* Botões de perfil do login só com o nome (mais compactos). */
.auth-role {
    min-height: 60px;
    padding: 12px 14px;
}

/* ==========================================================================
   Busca geral (Ctrl+K): campo centralizado no topo e janela de resultados.
   ========================================================================== */
.topbar-start {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.topbar-search {
    position: relative;
    display: none;
    align-items: center;
    width: 100%;
}

.topbar-search input {
    width: 100%;
    height: 40px;
    padding: 0 76px 0 40px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
    font-size: 0.92rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.topbar-search input:hover,
.topbar-search input:focus {
    border-color: #b6c7ef;
    outline: none;
    box-shadow: 0 0 0 3px rgba(111, 143, 232, 0.18);
}

.topbar-search-icon {
    position: absolute;
    left: 13px;
    width: 18px;
    height: 18px;
    color: var(--lhpr-muted);
    pointer-events: none;
}

.topbar-search-kbd,
.gsearch-kbd {
    padding: 2px 7px;
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 6px;
    background: var(--lhpr-surface);
    color: var(--lhpr-muted);
    font: 600 0.72rem/1.4 inherit;
    white-space: nowrap;
}

.topbar-search-kbd {
    position: absolute;
    right: 10px;
    pointer-events: none;
}

@media (min-width: 900px) {
    .topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 520px) minmax(0, 1fr);
    }

    .topbar-search {
        display: flex;
    }

    .topbar-actions {
        justify-self: end;
    }
}

/* Botão de busca no celular (o campo aparece só a partir de 900 px). */
.gsearch-mobile {
    display: inline-grid;
}

@media (min-width: 900px) {
    .gsearch-mobile {
        display: none;
    }
}

/* Janela de resultados. */
.gsearch {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    justify-items: center;
    align-items: start;
    padding: 10vh 16px 16px;
    background: rgba(10, 18, 40, 0.45);
    backdrop-filter: blur(3px);
    animation: gsearch-fade 0.12s ease-out;
}

.gsearch[hidden] {
    display: none;
}

@keyframes gsearch-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.gsearch-box {
    width: 100%;
    max-width: 640px;
    max-height: 76vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--lhpr-line);
    border-radius: 16px;
    background: var(--lhpr-surface);
    box-shadow: 0 30px 80px rgba(10, 18, 40, 0.35);
}

.gsearch-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--lhpr-line);
}

.gsearch-head .icon {
    width: 20px;
    height: 20px;
    color: var(--lhpr-muted);
    flex: none;
}

.gsearch-head input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--lhpr-ink);
    font-size: 1.05rem;
    outline: none;
}

.gsearch-body {
    overflow-y: auto;
    padding: 8px;
}

.gsearch-group-title,
.search-group-title {
    margin: 10px 10px 6px;
    color: var(--lhpr-muted);
    font-size: 0.72rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.gsearch-list,
.search-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gsearch-item,
.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--lhpr-ink);
    text-decoration: none;
}

.gsearch-item:hover,
.gsearch-item.is-active,
.search-item:hover {
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
}

.gsearch-item.is-active {
    box-shadow: inset 3px 0 0 var(--lhpr-accent);
}

.search-item-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: none;
    border-radius: 9px;
    background: #eef3fd;
    color: #1d2b6b;
}

.search-item-icon .icon {
    width: 18px;
    height: 18px;
}

.search-item-text {
    display: grid;
    min-width: 0;
}

.search-item-text strong {
    overflow: hidden;
    font-weight: var(--fw-medium);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-item-text small {
    overflow: hidden;
    color: var(--lhpr-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gsearch-empty {
    margin: 0;
    padding: 28px 16px;
    color: var(--lhpr-muted);
    text-align: center;
}

.gsearch-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 10px 16px;
    border-top: 1px solid var(--lhpr-line);
    color: var(--lhpr-muted);
    font-size: 0.8rem;
}

.search-group {
    margin-top: 18px;
}

html[data-theme="dark"] .search-item-icon {
    background: rgba(156, 179, 255, 0.12);
    color: #c9d6ff;
}

/* Aviso "Gerando demonstrativo..." enquanto o PDF é gerado para download. */
.download-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(10, 18, 40, 0.35);
    backdrop-filter: blur(2px);
}

.download-overlay[hidden] {
    display: none;
}

.download-box {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    border: 1px solid var(--lhpr-line);
    border-radius: 14px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    box-shadow: 0 20px 50px rgba(10, 18, 40, 0.3);
}

.download-spinner {
    width: 26px;
    height: 26px;
    flex: none;
    border: 3px solid #dbe4fb;
    border-top-color: #2541b8;
    border-radius: 50%;
    animation: download-spin 0.8s linear infinite;
}

@keyframes download-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .download-spinner {
        animation-duration: 2.4s;
    }
}

/* Crédito do desenvolvimento, discreto no rodapé. */
.dev-credit {
    margin: 0;
    padding: 10px 16px 14px;
    color: var(--lhpr-muted);
    font-size: 0.75rem;
    text-align: center;
    opacity: 0.75;
}

.footer-bar .dev-credit {
    padding: 0;
}

.dev-credit a {
    color: inherit;
    font-weight: var(--fw-medium);
    text-decoration: none;
}

.dev-credit a:hover {
    color: var(--lhpr-accent);
    text-decoration: underline;
}

/* Atalhos de período nos filtros (Esta semana, Este mês, Mês anterior). */
.no-js .js-only {
    display: none !important;
}

.quick-period {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    align-self: flex-end;
}

.quick-period-btn {
    padding: 5px 11px;
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 999px;
    background: var(--lhpr-surface);
    color: var(--lhpr-ink);
    font-size: 0.8rem;
    font-weight: var(--fw-medium);
    line-height: 1.3;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.quick-period-btn:hover {
    border-color: #b6c7ef;
    background: var(--lhpr-soft);
}

.quick-period-btn.is-on {
    border-color: #2541b8;
    background: #2541b8;
    color: #fff;
}

.quick-period-btn:focus-visible {
    outline: 2px solid #1d2b6b;
    outline-offset: 2px;
}

html[data-theme="dark"] .quick-period-btn.is-on {
    border-color: #6f8fe8;
    background: #3651c9;
}

/* Lista suspensa com busca (selects com data-searchable ou muitas opções). */
.ss {
    position: relative;
    min-width: 0;
}

.ss-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
    pointer-events: none;
}

.ss-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.ss-value {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ss.is-open .ss-trigger {
    border-color: #6f8fe8;
    box-shadow: 0 0 0 3px rgba(111, 143, 232, 0.2);
}

.ss-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 60;
    width: max(100%, 280px);
    max-width: min(440px, 92vw);
    padding: 8px;
    border: 1px solid var(--lhpr-line);
    border-radius: 12px;
    background: var(--lhpr-surface);
    box-shadow: 0 18px 40px rgba(10, 18, 40, 0.18);
}

.ss-panel[hidden] {
    display: none;
}

.ss-search {
    min-height: 38px !important;
    margin-bottom: 6px;
}

.ss-list {
    max-height: 260px;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    list-style: none;
}

.ss-option {
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--lhpr-ink);
    font-size: 0.9rem;
    cursor: pointer;
}

.ss-option.is-active {
    background: var(--lhpr-soft);
    box-shadow: inset 3px 0 0 var(--lhpr-accent);
}

.ss-option[aria-selected="true"] {
    font-weight: var(--fw-medium);
}

.ss-option.is-disabled {
    color: var(--lhpr-muted);
    cursor: not-allowed;
}

.ss-empty {
    padding: 10px;
    color: var(--lhpr-muted);
    font-size: 0.88rem;
    text-align: center;
}

/* Filtros compactos: busca, listas e situação numa linha; período e atalhos na linha de baixo. */
.filter-card {
    gap: 12px;
    padding: 16px 18px;
}

.filter-card .filter-field .form-select,
.filter-card .filter-field .form-control,
.filter-card .filter-field .input-group-text,
.filter-card .filter-field .ss-trigger {
    min-height: 40px;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(110px, 0.6fr) minmax(200px, 1.6fr) auto;
    align-items: end;
    gap: 12px 14px;
}

.filter-grid .filter-field-search {
    max-width: none;
}

.filter-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--lhpr-line);
}

.filter-period-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.filter-period-inline legend {
    display: inline-flex;
    float: left;
    align-items: center;
    gap: 6px;
    width: auto;
    margin: 0 4px 0 0;
    padding: 0;
    color: var(--lhpr-ink);
    font-size: 0.86rem;
    font-weight: var(--fw-strong);
}

.filter-period-inline legend .icon {
    width: 17px;
    height: 17px;
    color: var(--lhpr-accent);
}

.filter-period-inline .form-control {
    width: 160px;
    min-height: 38px;
}

.filter-date-sep {
    color: var(--lhpr-muted);
    font-size: 0.86rem;
}

.filter-period-inline .quick-period {
    margin: 0 0 0 6px;
}

.filter-line .filter-clear {
    margin-left: auto;
}

@media (max-width: 1099px) {
    .filter-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

@media (max-width: 639px) {
    .filter-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .filter-period-inline .form-control {
        width: calc(50% - 30px);
    }

    .filter-period-inline .quick-period {
        margin: 4px 0 0;
    }
}

/* Filtro com busca e uma lista (A pagar, Pagamentos feitos). */
.filter-grid-2 {
    grid-template-columns: minmax(240px, 2fr) minmax(200px, 1fr);
}

@media (min-width: 1100px) {
    .filter-grid-2 {
        grid-template-columns: minmax(240px, 560px) minmax(200px, 300px);
    }
}

@media (max-width: 639px) {
    .filter-grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.cell-action {
    width: 56px;
    text-align: right;
}

/* Detalhe do pagamento: linha do registro. */
.payment-registered {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    font-size: 0.86rem;
}

.payment-registered .icon {
    width: 16px;
    height: 16px;
}

/* Crédito do desenvolvimento: faixa azul mais escura no rodapé do menu lateral. */
.rail-credit {
    display: block;
    align-self: stretch;
    margin: auto 0 calc(-1 * var(--rail-pad-bottom, 16px));
    padding: 9px 12px;
    background: rgba(3, 8, 36, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.72rem;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.rail.is-expanded .rail-foot {
    margin-top: auto;
}

.rail.is-expanded .rail-foot + .rail-credit {
    margin-top: 8px;
}

.rail-credit strong {
    color: rgba(255, 255, 255, 0.85);
    font-weight: var(--fw-strong);
}

.rail-credit:hover {
    background: rgba(3, 8, 36, 0.75);
    color: #fff;
}

.rail-credit-short {
    display: none;
    font-weight: var(--fw-strong);
    letter-spacing: 0.04em;
}

.rail:not(.is-expanded) .rail-credit-full {
    display: none;
}

.rail:not(.is-expanded) .rail-credit-short {
    display: inline;
}

.rail.is-expanded .rail-credit {
    margin-left: -14px;
    margin-right: -14px;
}

/* Histórico do profissional: busca + situação no topo do cartão. */
.history-filter:not([hidden]) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.history-search {
    position: relative;
    display: flex;
    align-items: center;
}

.history-search .icon {
    position: absolute;
    left: 11px;
    width: 17px;
    height: 17px;
    color: var(--lhpr-muted);
    pointer-events: none;
}

.history-search .form-control {
    width: 280px;
    max-width: 100%;
    min-height: 40px;
    padding-left: 34px;
}

.history-filter .form-select {
    min-height: 40px;
}

@media (max-width: 639px) {
    .history-filter:not([hidden]),
    .history-search,
    .history-search .form-control {
        width: 100%;
    }
}

/* Tabela só para leitores de tela: a tabela ignora height: 1px e esticava a página (espaço vazio no fim). */
table.visually-hidden {
    display: block !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* Busca geral: campo bem visível (borda, fundo e foco) e botão X para fechar. */
.gsearch-head {
    gap: 10px;
    padding: 14px;
}

.gsearch-field {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    min-width: 0;
    margin: 0;
}

.gsearch-field .icon {
    position: absolute;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--lhpr-accent);
    pointer-events: none;
}

.gsearch-head .gsearch-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border: 2px solid #b6c7ef;
    border-radius: 12px;
    background: var(--lhpr-soft);
    color: var(--lhpr-ink);
    font-size: 1.02rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.gsearch-head .gsearch-field input::placeholder {
    color: var(--lhpr-muted);
}

.gsearch-head .gsearch-field input:focus {
    border-color: #2541b8;
    background: var(--lhpr-surface);
    box-shadow: 0 0 0 4px rgba(37, 65, 184, 0.15);
    outline: none;
}

.gsearch-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: none;
    padding: 0;
    border: 1px solid var(--lhpr-line-strong);
    border-radius: 10px;
    background: var(--lhpr-surface);
    color: var(--lhpr-muted);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.gsearch-close:hover {
    border-color: #f1b4b4;
    background: #fdecec;
    color: #b42318;
}

.gsearch-close:focus-visible {
    outline: 2px solid #1d2b6b;
    outline-offset: 2px;
}

.gsearch-close .icon {
    width: 20px;
    height: 20px;
}

html[data-theme="dark"] .gsearch-head .gsearch-field input {
    border-color: #3a4a7a;
}

html[data-theme="dark"] .gsearch-head .gsearch-field input:focus {
    border-color: #6f8fe8;
}

html[data-theme="dark"] .gsearch-close:hover {
    border-color: #7a2a2a;
    background: rgba(180, 35, 24, 0.18);
    color: #ffb4ab;
}

/* Login por AJAX: botão "Autenticando…" com indicador, cartão que balança na senha errada e tela de abertura. */
.auth-submit.is-busy {
    cursor: progress;
    opacity: 0.92;
}

.auth-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    border: 2.5px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -3px;
    animation: download-spin 0.75s linear infinite;
}

.auth-card.is-shake {
    animation: auth-shake 0.42s ease-in-out both;
}

@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(3px); }
}

.app-splash {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 20% 100%, rgba(22, 163, 74, 0.25), transparent 50%),
        radial-gradient(ellipse at 90% 0%, rgba(59, 130, 246, 0.35), transparent 50%),
        linear-gradient(160deg, #13277a 0%, #0d1c62 55%, #08124a 100%);
    color: #fff;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.app-splash.is-visible {
    opacity: 1;
}

.app-splash-box {
    display: grid;
    justify-items: center;
    gap: 10px;
    text-align: center;
}

.app-splash-logo {
    width: 132px;
    height: auto;
    margin-bottom: 8px;
    filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.35));
    animation: app-splash-pop 0.55s cubic-bezier(0.2, 0.9, 0.3, 1.2) both, app-splash-beat 1.6s 0.6s ease-in-out infinite;
}

.app-splash-title {
    font-size: 1.35rem;
    font-weight: var(--fw-strong);
    letter-spacing: 0.01em;
}

.app-splash-text {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
}

.app-splash-bar {
    position: relative;
    width: 180px;
    height: 4px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.18);
}

.app-splash-bar i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 40%;
    border-radius: 4px;
    background: linear-gradient(90deg, #22c55e, #60a5fa);
    animation: app-splash-load 1.1s ease-in-out infinite;
}

@keyframes app-splash-pop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes app-splash-beat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes app-splash-load {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(260%); }
}

@media (prefers-reduced-motion: reduce) {
    .app-splash-logo,
    .app-splash-bar i,
    .auth-card.is-shake {
        animation: none;
    }
}

/* Rodapé do login: "© 2026 Liga…" e "Desenvolvido por AMSetup" na mesma linha, mesmo tamanho, com separador. */
.auth-body .footer-bar {
    align-items: center;
    gap: 0;
}

.footer-bar p {
    margin: 0;
}

.footer-bar .dev-credit {
    padding: 0;
    font-size: inherit;
    opacity: 1;
}

.footer-bar .dev-credit::before {
    content: "|";
    margin: 0 12px;
    color: #a7b1c7;
}

/* Profissionais: cadastro incompleto (falta algum dado obrigatório) — barra amarela no início da linha e aviso */
.list-table tbody tr.is-incomplete {
    border-left: 4px solid #f59e0b;
}

@media (min-width: 768px) {
    .list-table tbody tr.is-incomplete {
        border-left: 0;
    }

    .list-table tbody tr.is-incomplete td:first-child {
        box-shadow: inset 4px 0 0 #f59e0b;
    }
}

.incomplete-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--tone-amber-50);
    color: var(--tone-amber);
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: help;
}

.incomplete-flag .icon {
    width: 13px;
    height: 13px;
}

/* Formulário do profissional: obrigatórios ainda vazios ao abrir a edição (cadastro incompleto) */
.field.is-missing input,
.field.is-missing select {
    border-color: #f59e0b;
    background-color: rgba(245, 158, 11, 0.08);
    box-shadow: inset 3px 0 0 #f59e0b;
}

.field.is-missing > label::after {
    content: "falta";
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--tone-amber-50);
    color: var(--tone-amber);
    font-size: 0.7rem;
    font-weight: 600;
    vertical-align: middle;
}

.missing-summary ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin: 8px 0 0;
    padding-left: 0;
    list-style: none;
}

.missing-summary li a {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    background: var(--tone-amber-50);
    color: var(--tone-amber);
    font-size: 0.82rem;
    text-decoration: none;
}

.missing-summary li a:hover {
    text-decoration: underline;
}

.missing-summary .icon {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: -3px;
}

/* Painel do profissional: tarja de cadastro incompleto dentro de "Dados cadastrais" */
.registry-missing-summary {
    margin: 0 0 16px;
}

.registry-missing-summary p {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.missing-summary li span {
    display: inline-block;
    padding: 1px 10px;
    border-radius: 999px;
    background: var(--tone-amber-50);
    color: var(--tone-amber);
    font-size: 0.82rem;
}

.missing-summary-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    font-weight: 600;
    color: var(--tone-amber);
}

/* Profissionais: indicador "cadastros incompletos" (atalho para o filtro) */
.people-summary-link {
    color: inherit;
    text-decoration: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.people-summary-link:hover,
.people-summary-link.is-on {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px #f59e0b;
}

.people-summary-link:hover {
    transform: translateY(-1px);
}
