:root {
    /* Paleta de Segurança e Confiança */
    --primary-navy: #0F172A;
    /* Azul Navy Profundo (Fundo da Navbar/Sidebar) */
    --accent-blue: #38BDF8;
    /* Ciano Claro (Destaque e Hovers) */
    --nav-text: #E2E8F0;
    /* Cinza muito claro (Texto da Sidebar) */

    /* Paleta de Organização e Limpeza */
    --bg-content: #F8FAFC;
    /* Cinza gelo (Fundo da página) */
    --text-content: #334155;
    /* Cinza Escuro (Conteúdo principal) */

    /* Ações de formulário (Salvar/Cadastrar), diferente do verde do WhatsApp */
    --form-submit-green: #2f8f5b;
    --form-submit-green-hover: #27774c;

    /* Dimensões */
    --sidebar-width: 250px;
    --navbar-height: 64px;

    /* Navbar de visitante (login, landing) */
    --guest-shell-nav-bg: linear-gradient(90deg, #0f2a44 0%, #5c2145 100%);
    --guest-shell-nav-text: #f1f5f9;
    --guest-shell-nav-hover-bg: rgba(255, 255, 255, 0.12);
    --landing-org-color: #0f2a44;
    --landing-org-color-hover: #163a5c;
    --landing-org-color-soft: rgba(15, 42, 68, 0.12);
    --landing-pro-color: #5c2145;
    --landing-pro-color-hover: #703052;
    --landing-pro-color-soft: rgba(92, 33, 69, 0.12);

    /* Sinalização de divergência recebimento × sessões (reutilizada em recebimentos e retenção) */
    --receivement-sessions-mismatch-bg: #fff7ed;
    --receivement-sessions-mismatch-bg-hover: #ffedd5;
}

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-content);
    color: var(--text-content);
    -webkit-font-smoothing: antialiased;
}

/* --- CLASSE CONSISTENTE DO NOME DO APP --- */
.brand-name {
    font-weight: 800;
    /* Peso pesado para confiança */
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    /* Visual mais robusto */
    color: white;
    /* Consistente em ambos os fundos (Navbar e Sidebar) */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand-mark {
    display: block;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

/* --- ESTILOS MOBILE (MOBILE FIRST) --- */

/* Barra superior */
.top-navbar {
    --shell-nav-bg: #0f172a;
    --shell-nav-text: #e2e8f0;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.08);
    --shell-nav-active-bg: rgba(56, 189, 248, 0.15);
    display: flex;
    align-items: center;
    background: var(--shell-nav-bg);
    height: var(--navbar-height);
    padding: 0 12px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1001;
    box-sizing: border-box;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.top-navbar .brand-name {
    font-size: 1.0625rem;
}

.top-navbar .brand-name__app-icon {
    display: none;
    width: 32px;
    height: 32px;
    border-radius: 22%;
    object-fit: cover;
    flex-shrink: 0;
}

.top-navbar--organization {
    --shell-nav-bg: #0f2a44;
    --shell-nav-text: #e6f1fb;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.1);
    --shell-nav-active-bg: rgba(56, 189, 248, 0.2);
}

.top-navbar--professional {
    --shell-nav-bg: #5c2145;
    --shell-nav-text: #f8eaf2;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.12);
    --shell-nav-active-bg: rgba(251, 191, 36, 0.22);
}

.top-navbar--guest {
    --shell-nav-bg: var(--guest-shell-nav-bg);
    --shell-nav-text: var(--guest-shell-nav-text);
    --shell-nav-hover-bg: var(--guest-shell-nav-hover-bg);
    --shell-nav-active-bg: rgba(255, 255, 255, 0.2);
}

.menu-btn {
    background: none;
    border: none;
    color: var(--shell-nav-text, var(--nav-text));
    font-size: 1.35rem;
    cursor: pointer;
    margin-right: 10px;
    padding: 0;
    display: flex;
    align-items: center;
}

/* Taskbar inferior: no DOM após .app-scroll; visível só no PWA instalado (mobile). */
.mobile-dock {
    --shell-nav-bg: #0f172a;
    --shell-nav-text: #e2e8f0;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.1);
    --shell-nav-active-bg: rgba(56, 189, 248, 0.22);
    position: relative;
    z-index: 1002;
    flex: 0 0 auto;
    display: none;
    align-items: stretch;
    justify-content: space-evenly;
    gap: 0;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 4px 6px;
    border-radius: 16px;
    box-sizing: border-box;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.28);
}

.mobile-dock--organization {
    --shell-nav-bg: #0f2a44;
    --shell-nav-text: #e6f1fb;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.12);
    --shell-nav-active-bg: rgba(56, 189, 248, 0.24);
    background: #0f2a44;
}

.mobile-dock--professional {
    --shell-nav-bg: #5c2145;
    --shell-nav-text: #f8eaf2;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.14);
    --shell-nav-active-bg: rgba(251, 191, 36, 0.28);
    background: #5c2145;
}

.mobile-dock--admin {
    --shell-nav-bg: #0f172a;
    --shell-nav-text: #e2e8f0;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.1);
    --shell-nav-active-bg: rgba(56, 189, 248, 0.22);
    background: #0f172a;
}

.mobile-dock__link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    flex: 1 1 auto;
    min-width: min-content;
    width: auto;
    height: auto;
    min-height: 48px;
    margin: 0;
    padding: 3px 2px 4px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--shell-nav-text);
    text-decoration: none;
    cursor: pointer;
}

.mobile-dock .menu-btn {
    font-size: inherit;
    margin: 0;
    color: var(--shell-nav-text);
}

.mobile-dock .menu-btn:hover,
.mobile-dock .menu-btn:focus-visible {
    color: #ffffff;
}

.mobile-dock__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 24px;
    border-radius: 999px;
}

.mobile-dock__link .material-icons-round {
    font-size: 22px;
    line-height: 1;
}

.mobile-dock__label {
    max-width: 100%;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.mobile-dock__link:hover,
.mobile-dock__link:focus-visible {
    color: #ffffff;
}

.mobile-dock__link:hover .mobile-dock__icon,
.mobile-dock__link:focus-visible .mobile-dock__icon {
    background: var(--shell-nav-hover-bg);
}

.mobile-dock__link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 1px;
}

.mobile-dock__link.is-active {
    color: #ffffff;
}

.mobile-dock__link.is-active .mobile-dock__icon {
    background: rgba(255, 255, 255, 0.24);
}

.mobile-dock__sep {
    width: 1px;
    height: 16px;
    margin: 0 2px;
    border-radius: 1px;
    background: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
    align-self: center;
}

body:has(.sidebar.active) .mobile-dock {
    visibility: hidden;
    pointer-events: none;
}

.sidebar-close {
    display: none;
}

/* Sidebar que desliza */
.sidebar {
    --shell-nav-bg: #0f172a;
    --shell-nav-text: #e2e8f0;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.08);
    --shell-nav-active-bg: rgba(56, 189, 248, 0.15);
    position: fixed;
    top: 0;
    left: -100%;
    width: var(--sidebar-width);
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    background: var(--shell-nav-bg);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(12px, env(safe-area-inset-bottom, 0px));
}

.sidebar--organization {
    --shell-nav-bg: #0f2a44;
    --shell-nav-text: #e6f1fb;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.1);
    --shell-nav-active-bg: rgba(56, 189, 248, 0.2);
}

.sidebar--professional {
    --shell-nav-bg: #5c2145;
    --shell-nav-text: #f8eaf2;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.12);
    --shell-nav-active-bg: rgba(251, 191, 36, 0.22);
}

.sidebar--guest {
    --shell-nav-bg: linear-gradient(180deg, #0f2a44 0%, #5c2145 100%);
    --shell-nav-text: #f1f5f9;
    --shell-nav-hover-bg: rgba(255, 255, 255, 0.12);
    --shell-nav-active-bg: rgba(255, 255, 255, 0.2);
}

/* Container do nome do app dentro da Sidebar no desktop */
.sidebar-header {
    display: none;
    /* Escondido no Mobile */
}

.sidebar-user {
    display: none;
}

.sidebar.active {
    left: 0;
    padding-top: calc(var(--navbar-height) + 8px);
}

/* Em mobile, deixa a scrollbar visível quando o menu for mais alto que a tela */
@media (max-width: 991px) {
    .sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: calc(var(--navbar-height) + 6px);
        right: 10px;
        z-index: 2;
        width: 32px;
        height: 32px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.1);
        color: var(--shell-nav-text, #e2e8f0);
        cursor: pointer;
        flex-shrink: 0;
    }

    .sidebar-close span {
        display: block;
        font-size: 1.25rem;
        font-weight: 400;
        line-height: 1;
        transform: translateY(-0.5px);
    }

    .sidebar-close:hover,
    .sidebar-close:focus-visible {
        background: rgba(255, 255, 255, 0.18);
        color: #ffffff;
    }

    .sidebar-close:focus-visible {
        outline: 2px solid rgba(255, 255, 255, 0.75);
        outline-offset: 2px;
    }

    .sidebar.active .nav-list {
        padding-top: 4px;
    }

    .sidebar {
        overflow-y: scroll;
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, 0.5) rgba(255, 255, 255, 0.1);
    }

    .sidebar::-webkit-scrollbar {
        width: 8px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.5);
        border-radius: 8px;
    }

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.7);
    }
}

/* Lista de Navegação */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.nav-item {
    padding: 0 12px;
}

.sidebar-section-label {
    padding: 16px 24px 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(226, 232, 240, 0.55);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--shell-nav-text, var(--nav-text));
    text-decoration: none;
    border-radius: 8px;
    /* Organização e suavidade */
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    color: white;
    background-color: var(--shell-nav-hover-bg, rgba(255, 255, 255, 0.05));
}

/* Item Ativo (Exemplo de Página Atual) */
.nav-link.active {
    color: white;
    background-color: var(--shell-nav-active-bg, rgba(56, 189, 248, 0.1));
    /* Sutil transparência do Accent */
}

.nav-icon {
    font-size: 19px;
    opacity: 0.85;
    flex-shrink: 0;
}

.nav-item--logout {
    margin-top: 6px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s;
}

.overlay.active {
    display: block;
    opacity: 1;
}

.main-content {
    /* width:auto (padrão): no desktop o margin-left da sidebar entra no cálculo
       e a área útil fica viewport − sidebar. width:100% + margin-left estoura a página. */
    box-sizing: border-box;
    min-width: 0;
    padding: 16px;
    margin-top: var(--navbar-height);
    overflow-x: hidden;
}

h1 {
    font-weight: 700;
    color: #1e293b;
}

@media (max-width: 991px) {
    /* No PWA autenticado: topo rola; ícone + nome; taskbar. Login/guest
       mantém topbar fixed (auth-body usa padding-top sob a barra fixa). */
    html.pwa-standalone body.shell-with-dock .top-navbar {
        position: relative;
        top: auto;
        width: 100%;
    }

    html.pwa-standalone body.shell-with-dock .main-content {
        margin-top: 0;
    }

    html.pwa-standalone body.shell-with-dock .top-navbar .brand-name__text {
        display: none;
    }

    html.pwa-standalone body.shell-with-dock .top-navbar .brand-name__app-icon {
        display: block;
    }

    html.pwa-standalone body.shell-with-dock .top-navbar .user-greeting {
        margin-left: 0.5rem;
    }

    html.pwa-standalone body.shell-with-dock .mobile-dock {
        display: flex;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
        z-index: 1002;
    }

    html.pwa-standalone body.shell-with-dock .top-navbar .menu-btn {
        display: none;
    }

    html.pwa-standalone body.shell-with-dock .app-scroll {
        padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }

    html.pwa-standalone body.shell-with-dock .pwa-install-btn,
    html.pwa-standalone body.shell-with-dock .pwa-banner--update,
    html.pwa-standalone body.shell-with-dock .pwa-ios-hint,
    html.pwa-standalone body.shell-with-dock .pwa-install-chip {
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 991px) and (display-mode: standalone),
       (max-width: 991px) and (display-mode: minimal-ui),
       (max-width: 991px) and (display-mode: fullscreen) {
    body.shell-with-dock .top-navbar {
        position: relative;
        top: auto;
        width: 100%;
    }

    body.shell-with-dock .main-content {
        margin-top: 0;
    }

    body.shell-with-dock .top-navbar .brand-name__text {
        display: none;
    }

    body.shell-with-dock .top-navbar .brand-name__app-icon {
        display: block;
    }

    body.shell-with-dock .top-navbar .user-greeting {
        margin-left: 0.5rem;
    }

    body.shell-with-dock .mobile-dock {
        display: flex;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: max(10px, env(safe-area-inset-bottom, 0px));
        z-index: 1002;
    }

    body.shell-with-dock .top-navbar .menu-btn {
        display: none;
    }

    body.shell-with-dock .app-scroll {
        padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }

    body.shell-with-dock .pwa-install-btn,
    body.shell-with-dock .pwa-banner--update,
    body.shell-with-dock .pwa-ios-hint,
    body.shell-with-dock .pwa-install-chip {
        bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px));
    }
}

@media (min-width: 992px) {
    :root {
        --navbar-height: 64px;
    }

    .mobile-dock {
        display: none;
    }

    .top-navbar {
        display: none;
        /* Esconde a barra superior */
    }

    .sidebar {
        left: 0;
        padding-top: 0;
        /* Começa do topo */
        box-shadow: 1px 0 1px rgba(0, 0, 0, 0.05);
    }

    /* No desktop, o nome do app aparece no topo da sidebar */
    .sidebar-header {
        display: flex;
        height: var(--navbar-height);
        align-items: center;
        padding: 0 24px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        margin-bottom: 16px;
        margin-top: 16px;
    }

    .sidebar-user {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin: 0 24px 16px;
        padding: 12px;
        border-radius: 10px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .sidebar-user-label {
        color: rgba(226, 232, 240, 0.75);
        font-size: 0.75rem;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .sidebar-user-name {
        color: #ffffff;
        font-size: 0.9rem;
        font-weight: 700;
        line-height: 1.3;
        word-break: break-word;
    }

    .role-badge {
        display: inline-block;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.06em;
        padding: 2px 8px;
        border-radius: 20px;
        margin-top: 4px;
        width: fit-content;
    }

    .role-badge--admin {
        background-color: rgba(56, 189, 248, 0.18);
        color: #38BDF8;
        border: 1px solid rgba(56, 189, 248, 0.35);
    }

    .main-content {
        /* Área útil = viewport − sidebar; evita estouro horizontal no desktop/laptop */
        margin-left: var(--sidebar-width);
        margin-top: 0;
        padding: 40px;
        width: calc(100% - var(--sidebar-width));
        max-width: calc(100% - var(--sidebar-width));
    }

    .overlay {
        display: none !important;
    }
}

/* --- USER GREETING --- */
.user-greeting {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 48vw;
    padding: 3px 8px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: var(--shell-nav-text, var(--nav-text));
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: auto;
}

/* --- PWA (Sprint 17) — modal de instalação --- */
.pwa-install-modal {
    position: fixed;
    inset: 0;
    z-index: 100250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
}

.pwa-install-modal[hidden] {
    display: none !important;
}

body.pwa-install-modal-open {
    overflow: hidden;
}

.pwa-install-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.pwa-install-modal__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 360px);
    margin: 0;
    padding: 28px 24px 22px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
    text-align: center;
    animation: pwa-install-modal-in 0.28s ease-out;
}

.pwa-install-modal__close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #64748b;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.pwa-install-modal__close:hover,
.pwa-install-modal__close:focus-visible {
    background: #f1f5f9;
    color: #0f172a;
    outline: none;
}

.pwa-install-modal__icon {
    display: block;
    width: 88px;
    height: 88px;
    margin: 4px auto 16px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

.pwa-install-modal__title {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.3;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.pwa-install-modal__text {
    margin: 0 0 18px;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #475569;
}

.pwa-install-modal__hint {
    margin: -8px 0 18px;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: #64748b;
}

.pwa-install-modal__hint--after-cta {
    margin: 12px 0 0;
}

.pwa-install-chip {
    position: fixed;
    z-index: 100240;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: max(16px, env(safe-area-inset-bottom, 0px));
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-width: calc(100vw - 24px);
    padding: 0.55rem 0.95rem 0.55rem 0.55rem;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.pwa-install-chip[hidden] {
    display: none !important;
}

.pwa-install-chip:hover,
.pwa-install-chip:focus-visible {
    border-color: #cbd5e1;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
    outline: none;
}

.pwa-install-chip__icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

body:has(.sidebar.active) .pwa-install-chip:not([hidden]) {
    visibility: hidden;
    pointer-events: none;
}

@media (min-width: 768px) {
    .pwa-install-chip {
        right: max(20px, env(safe-area-inset-right, 0px));
        bottom: max(20px, env(safe-area-inset-bottom, 0px));
    }
}

.pwa-install-modal__steps {
    margin: 0 0 18px;
    padding-left: 1.25rem;
    text-align: left;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #334155;
}

.pwa-install-modal__steps li + li {
    margin-top: 0.45rem;
}

.pwa-install-modal__inline-icon {
    font-size: 1rem;
    vertical-align: -0.15em;
}

.pwa-install-modal__cta {
    width: 100%;
    margin-bottom: 8px;
}

.pwa-install-modal__later {
    width: 100%;
}

@keyframes pwa-install-modal-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pwa-install-modal__panel {
        animation: none;
    }
}

.pwa-banner {
    position: fixed;
    left: 12px;
    right: 12px;
    z-index: 100300;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
    background: #0f172a;
    color: #e2e8f0;
}

.pwa-banner[hidden] {
    display: none !important;
}

.pwa-banner--offline {
    top: calc(var(--navbar-height) + 10px);
    border: 1px solid rgba(251, 191, 36, 0.45);
    background: #422006;
    color: #fef3c7;
}

.pwa-banner--update {
    bottom: 16px;
    top: auto;
    border: 1px solid rgba(56, 189, 248, 0.45);
    background: #0f172a;
}

.pwa-banner__icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.pwa-banner__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.35;
}

.pwa-banner__text strong {
    font-size: 0.9rem;
}

.pwa-banner__action {
    appearance: none;
    border: 0;
    border-radius: 8px;
    padding: 0.45rem 0.8rem;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    background: #38bdf8;
    color: #0f172a;
    flex-shrink: 0;
    align-self: center;
}

body.pwa-is-offline .main-content {
    filter: grayscale(0.15);
}

body.landing-body .pwa-banner--offline {
    top: 12px;
}

/* --- FLASH MESSAGES --- */
.flash-message[hidden] {
    display: none !important;
}

.flash-message {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    position: fixed;
    /* Mobile: rente ao topo da viewport (pode cobrir a navbar). Desktop sobrescreve abaixo. */
    top: max(0px, env(safe-area-inset-top, 0px));
    left: 16px;
    right: 16px;
    z-index: 100200;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 0;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    animation: flash-slide-in 220ms ease-out;
    overflow: hidden;
    pointer-events: auto;
}

.flash-message > span {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Inline no fluxo: só no desktop. No mobile vira toast no topo (mesmo visual). */
.flash-message--inline {
    position: fixed;
    top: max(0px, env(safe-area-inset-top, 0px));
    left: 16px;
    right: 16px;
    z-index: 100200;
    width: auto;
    margin: 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    animation: flash-slide-in 220ms ease-out;
}

@keyframes flash-slide-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flash-fade-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-8px);
    }
}

.flash-message.is-hiding {
    animation: flash-fade-out 300ms ease-in forwards;
}

.flash-timer {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background-color: currentColor;
    opacity: 0.3;
    transform-origin: left;
    animation: flash-timer-shrink 5s linear forwards;
}

@keyframes flash-timer-shrink {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .flash-message {
        animation: none;
    }

    .flash-timer {
        display: none;
    }
}

.flash-success {
    background-color: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.flash-error {
    background-color: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.flash-warning {
    background-color: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
    padding: 12px 16px;
    border-radius: 6px;
    margin: 0 0 16px;
}

.billing-invoices-sync-notice {
    margin-bottom: 16px;
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    padding: 0 0 0 8px;
    line-height: 1;
    flex: 0 0 auto;
}

@media (min-width: 992px) {
    .flash-message {
        /* Topo da viewport (como no mobile); laterais respeitam a área útil ao lado da sidebar */
        top: 0;
        left: calc(var(--sidebar-width) + 40px);
        right: 40px;
        align-items: center;
    }

    .flash-message--inline {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        z-index: auto;
        width: 100%;
        margin: 0 0 12px;
        box-shadow: none;
        animation: none;
    }

    .flash-close {
        font-size: 1.25rem;
        padding: 0 0 0 12px;
    }
}

/* --- ERROR PAGES --- */
.error-page {
    text-align: center;
    padding: 60px 20px;
}

.error-page h1 {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-navy);
    margin: 0 0 8px;
}

.error-page h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px;
}

.error-page p {
    color: #64748b;
    margin-bottom: 32px;
}

/* --- BUTTONS --- */
.btn {
    display: inline-block;
    box-sizing: border-box;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: background 0.2s, color 0.2s;
}

.btn-primary {
    background-color: var(--primary-navy);
    color: white;
}

.btn-primary:hover {
    background-color: #1e293b;
}

.btn-full {
    width: 100%;
}

.btn.btn-submit-positive,
button.btn-submit-positive,
input.btn-submit-positive {
    background-color: var(--form-submit-green);
    color: #ffffff;
}

.btn.btn-submit-positive:hover,
button.btn-submit-positive:hover,
input.btn-submit-positive:hover {
    background-color: var(--form-submit-green-hover);
}

/* --- AUTH PAGES --- */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: calc(100vh - var(--navbar-height) - 48px);
    padding: 40px 16px;
}

.auth-card {
    --auth-context-color: var(--primary-navy);
    --auth-context-color-hover: #1e293b;
    --auth-context-soft: rgba(15, 23, 42, 0.08);
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 10px 28px color-mix(in srgb, var(--auth-context-color) 45%, transparent);
}

.auth-card--professional {
    --auth-context-color: #5c2145;
    --auth-context-color-hover: var(--landing-pro-color-hover);
    --auth-context-soft: var(--landing-pro-color-soft);
}

.auth-card--organization {
    --auth-context-color: #0f2a44;
    --auth-context-color-hover: var(--landing-org-color-hover);
    --auth-context-soft: var(--landing-org-color-soft);
}

.auth-context-badge {
    display: inline-block;
    margin: 0 0 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--auth-context-soft);
    color: var(--auth-context-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--auth-context-color);
}

.auth-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0 0 24px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-card--professional .btn-primary,
.auth-card--organization .btn-primary {
    background-color: var(--auth-context-color);
    border-color: var(--auth-context-color);
}

.auth-card--professional .btn-primary:hover,
.auth-card--organization .btn-primary:hover {
    background-color: var(--auth-context-color-hover);
    border-color: var(--auth-context-color-hover);
}

.auth-card--professional .form-control:focus,
.auth-card--organization .form-control:focus,
.auth-card--professional input:not([type="checkbox"]):not([type="radio"]):focus,
.auth-card--organization input:not([type="checkbox"]):not([type="radio"]):focus {
    border-color: var(--auth-context-color);
    box-shadow: 0 0 0 3px var(--auth-context-soft);
}

.auth-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 20px;
    text-align: center;
}

.auth-links a {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-links a:hover {
    text-decoration: underline;
}

.auth-form .cf-turnstile,
.auth-form [data-turnstile-sitekey] {
    width: 100%;
    max-width: 100%;
}

.auth-card--register {
    max-width: 560px;
}

.auth-card--register .auth-form {
    gap: 12px;
}

.auth-card--register .form-fieldset {
    margin-bottom: 0;
}

.auth-card--register .form-fieldset .page-subtitle {
    margin-bottom: 12px;
    font-size: 0.8125rem;
}

.auth-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

@media (max-width: 520px) {
    .auth-form-row {
        grid-template-columns: 1fr;
    }
}

.auth-card--professional select:focus,
.auth-card--organization select:focus {
    border-color: var(--auth-context-color);
    box-shadow: 0 0 0 3px var(--auth-context-soft);
}

.auth-form .cf-turnstile iframe,
.auth-form [data-turnstile-sitekey] iframe {
    width: 100% !important;
    max-width: 100%;
}

.auth-context-switch {
    display: inline-flex;
    align-self: center;
    justify-content: center;
    margin-top: 4px;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
}

.auth-context-switch--organization {
    color: var(--landing-org-color);
    background: var(--landing-org-color-soft);
}

.auth-context-switch--organization:hover {
    color: var(--landing-org-color-hover);
    text-decoration: none;
    background: rgba(15, 42, 68, 0.18);
}

.auth-context-switch--professional {
    color: var(--landing-pro-color);
    background: var(--landing-pro-color-soft);
}

.auth-context-switch--professional:hover {
    color: var(--landing-pro-color-hover);
    text-decoration: none;
    background: rgba(92, 33, 69, 0.18);
}

.auth-tipo-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 0 0 20px;
    padding: 4px;
    border-radius: 10px;
    background: #f1f5f9;
}

.auth-tipo-switch button {
    appearance: none;
    border: none;
    margin: 0;
    padding: 10px 12px;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-family: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

.auth-tipo-switch button[aria-selected="true"] {
    background: #fff;
    color: var(--auth-context-color);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.auth-tipo-switch button:focus-visible {
    outline: 2px solid var(--auth-context-color);
    outline-offset: 2px;
}

.auth-body {
    margin: 0;
    background: var(--bg-content);
    color: var(--text-content);
    padding-top: var(--navbar-height);
}

.auth-navbar {
    display: flex;
    align-items: center;
}

.auth-navbar .brand-name {
    margin-left: 0;
}

.auth-navbar .brand-name__home-icon {
    font-size: 20px;
    line-height: 1;
    color: inherit;
    opacity: 0.9;
}

.auth-body .auth-container {
    min-height: calc(100vh - var(--navbar-height) - 72px);
}

/* --- GLOBAL FORM CONTROLS --- */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="reset"]),
    select,
    textarea,
    .form-control) {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-content);
    background: white;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="reset"]),
    select,
    textarea,
    .form-control):focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* --- FORMS --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 8px;
}

/* `display: flex` acima sobrescreve o [hidden] do UA; forçar ocultação. */
.form-group[hidden] {
    display: none !important;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.form-label-row label {
    margin: 0;
}

.form-label-row .btn {
    width: auto;
    flex: 0 0 auto;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
}

.form-checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    width: auto;
    max-width: 100%;
}

.form-checkbox-field input[type="checkbox"] {
    width: auto;
    min-width: auto;
    min-height: auto;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
}

.form-checkbox-field span {
    line-height: 1.4;
}

.form-checkbox-box {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: white;
    box-sizing: border-box;
}

.form-radio-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.form-radio-field {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    width: auto;
    max-width: 100%;
}

.form-radio-field input[type="radio"] {
    width: auto;
    min-width: auto;
    min-height: auto;
    margin: 0;
    flex: 0 0 auto;
    cursor: pointer;
}

.form-radio-field span {
    line-height: 1.4;
}

.billing-card-fields {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0 12px;
    padding: 16px;
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    box-sizing: border-box;
}

.billing-card-fields[hidden] {
    display: none !important;
}

.billing-card-fields__title {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #312e81;
}

.billing-card-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.billing-card-panel {
    padding: 16px;
}

.billing-card-panel .card-section-title {
    margin-top: 0;
}

.form-inline-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.form-inline-group input[name="countryCode"] {
    flex: 0 0 132px;
    width: 132px;
    min-width: 132px;
}

.form-inline-group input[name="phoneNumber"] {
    flex: 1 1 auto;
    min-width: 0;
}

.color-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.color-input-row input[type="color"] {
    width: 68px;
    min-width: 68px;
    height: 44px;
    padding: 4px;
    cursor: pointer;
}

.service-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.service-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.service-color-value {
    font-size: 0.875rem;
    font-weight: 700;
    color: #0f172a;
    letter-spacing: 0.04em;
}

/* --- PAGE CONTAINER --- */
.page-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.page-container.narrow {
    max-width: 960px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
    max-width: 100%;
}

.page-header > * {
    min-width: 0;
    max-width: 100%;
}

.page-header h1 {
    margin: 0;
}

.page-header--client-details {
    flex-direction: column;
    align-items: stretch;
}

.page-header-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.export-btn .material-icons-round {
    font-size: 18px;
    line-height: 1;
}

.page-subtitle {
    color: #64748b;
    font-size: 0.875rem;
    margin: 4px 0 0;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.page-container > .page-subtitle {
    margin-bottom: 16px;
}

/* --- CARD --- */
.card {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.card-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

/* --- FORM GRID --- */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 0.875rem;
    line-height: 1.4;
}

.detail-label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-label::after {
    content: ':';
}

.detail-value {
    color: var(--text-content);
}

/* Modal/detalhe de recebimento (dl) — empilha no mobile sem estourar a viewport */
.detail-list {
    margin: 0;
    display: grid;
    grid-template-columns: minmax(0, 10rem) minmax(0, 1fr);
    gap: 8px 12px;
    max-width: 100%;
    min-width: 0;
}

.detail-list dt {
    margin: 0;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}

.detail-list dd {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 480px) {
    .detail-list {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px 0;
    }

    .detail-list dt {
        margin-top: 8px;
    }

    .detail-list dt:first-child {
        margin-top: 0;
    }
}

.form-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
}

.form-actions--danger {
    padding-top: 0;
    margin-top: 6px;
    border-top: 1px solid #fee2e2;
    padding-top: 12px;
}

.form-actions--session-footer {
    flex-wrap: nowrap;
    gap: 6px;
    align-items: stretch;
    margin: 0;
    padding: 10px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #fff;
    overflow-x: hidden;
}

.form-actions--session-footer .btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  padding: 12px 4px;
  font-size: clamp(0.72rem, 2.5vw, 0.875rem);
  line-height: 1.2;
}

/* Miolo da sessão: layout; a rolagem fica em agenda-modal__body. */
.agenda-modal-session__scroll {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Header + footer fixos; body único com scroll (confiável no mobile). */
.agenda-modal:has(.agenda-modal__panel--session-actions).active {
    overflow: hidden;
    align-items: stretch;
}

.agenda-modal__panel--session-actions {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: min(100%, 760px);
    height: 100%;
    max-height: 100%;
    margin-inline: auto;
}

.agenda-modal__panel--session-actions .agenda-modal__header {
    position: relative;
    top: auto;
    flex-shrink: 0;
}

.agenda-modal__panel--session-actions .agenda-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 12px;
}

.agenda-modal__panel--session-actions > .form-actions--session-footer {
    flex-shrink: 0;
    z-index: 3;
    box-shadow: 0 -6px 16px rgba(15, 23, 42, 0.06);
}

.agenda-modal-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
}

.agenda-summary-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.agenda-summary-table {
    width: 100%;
    max-width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 0.78rem;
    line-height: 1.35;
}

.agenda-summary-table th,
.agenda-summary-table td {
    padding: 5px 0;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.agenda-summary-table tr:last-child th,
.agenda-summary-table tr:last-child td {
    border-bottom: none;
}

.agenda-summary-table th {
    width: 34%;
    padding-right: 12px;
    font-weight: 600;
    color: #374151;
    text-align: left;
    white-space: normal;
}

.agenda-summary-table td {
    width: 66%;
    color: var(--text-content);
}

.agenda-summary-table .badge {
    white-space: normal;
}

@media (max-width: 480px) {
    .agenda-summary-table {
        font-size: 0.72rem;
    }

    .agenda-summary-table th {
        width: 38%;
        padding-right: 8px;
    }

    .agenda-summary-table td {
        width: 62%;
    }
}

.agenda-modal-section__title {
    margin: 0 0 10px;
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

.agenda-modal-inline-action {
    margin-top: 6px;
}

.agenda-modal-flag {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #f59e0b;
    background-color: #fef3c7;
    color: #92400e;
    font-size: 0.82rem;
    font-weight: 700;
}

.agenda-modal-flag__note {
    font-weight: 500;
}

.modal-helper-text {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.3;
}

.modal-helper-text--counter {
    font-weight: 600;
}

.field-label-with-help {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.field-label-with-help--inline {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.form-radio-field .field-help__tooltip {
    left: 0;
    right: auto;
    width: min(280px, calc(100vw - 48px));
    max-width: none;
}

.field-help {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.field-help__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid #94a3b8;
    border-radius: 50%;
    background: #f8fafc;
    color: #475569;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    cursor: help;
}

.field-help__trigger:hover,
.field-help__trigger:focus-visible,
.field-help.is-open .field-help__trigger {
    border-color: #64748b;
    background: #e2e8f0;
    color: #0f172a;
    outline: none;
}

.field-help__tooltip {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 40;
    width: auto;
    max-width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: left;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.field-help__tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 12px;
    border: 6px solid transparent;
    border-bottom-color: #0f172a;
}

.field-help:hover .field-help__tooltip,
.field-help:focus-within .field-help__tooltip,
.field-help.is-open .field-help__tooltip {
    display: block;
}

.field-help--badge {
    position: relative;
}

.field-help--badge .field-help__trigger.badge {
    width: auto;
    height: auto;
    padding: 4px 10px;
    border: none;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: help;
}

.field-help--badge .field-help__trigger.badge:hover,
.field-help--badge .field-help__trigger.badge:focus-visible,
.field-help--badge.is-open .field-help__trigger.badge {
    border: none;
    outline: none;
    background: inherit;
    color: inherit;
    filter: brightness(0.97);
}

.field-help--badge .field-help__trigger.badge.badge-neutral,
.field-help--badge .field-help__trigger.badge.badge-neutral:hover,
.field-help--badge .field-help__trigger.badge.badge-neutral:focus-visible,
.field-help--badge.is-open .field-help__trigger.badge.badge-neutral {
    background-color: #e2e8f0;
    color: #334155;
    filter: none;
}

.session-slot-btn .field-help--badge .field-help__tooltip {
    left: 0;
    right: auto;
    width: max-content;
    max-width: min(260px, 70vw);
    z-index: 60;
}

.search-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 16px;
}

.search-btn {
    width: 100%;
    min-width: 44px;
    height: 42px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.search-icon {
    font-size: 1rem;
    line-height: 1;
}

/* --- BUTTONS SECONDARY & DANGER --- */
.btn-secondary {
    background-color: #e2e8f0;
    color: var(--text-content);
}

.btn-secondary:hover {
    background-color: #cbd5e1;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
}

/* --- DATA TABLE --- */
.table-responsive {
    max-width: 100%;
    min-width: 0;
    overflow-x: scroll;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    /* Desktop/laptop: scrollbar nativa fina. Mobile: trilha custom (.table-scroll). */
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Wrapper + barra custom (sempre visível no mobile quando há overflow) */
.table-scroll {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.table-scroll__track {
    display: none;
    box-sizing: border-box;
    height: 10px;
    margin-top: 8px;
    border-radius: 4px;
    background: #e2e8f0;
    cursor: pointer;
    touch-action: none;
}

.table-scroll__thumb {
    height: 100%;
    width: 28px;
    border-radius: 4px;
    background: #94a3b8;
    transform: translateX(0);
    will-change: transform;
    cursor: grab;
    touch-action: none;
}

.table-scroll__thumb.is-dragging,
.table-scroll__thumb:active {
    cursor: grabbing;
    background: #64748b;
}

@media (max-width: 991px) {
    /* iOS/Android: scrollbar overlay some — a trilha custom é a pista de interação */
    .table-scroll .table-responsive {
        scrollbar-width: none;
        scrollbar-gutter: auto;
    }

    .table-scroll .table-responsive::-webkit-scrollbar {
        display: none;
        height: 0;
    }

    .table-scroll.is-overflowing > .table-scroll__track {
        display: block;
    }
}

.table-responsive--desktop {
    display: none;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.data-table th {
    font-weight: 600;
    color: #475569;
    background-color: #f8fafc;
}

.data-table tbody tr:hover {
    background-color: #f1f5f9;
}

/* Linha clicável do fluxo de caixa — pista visual (borda esquerda), como session-slot */
.data-table tbody tr.cashflow-receivement-row {
    cursor: pointer;
}

.data-table tbody tr.cashflow-receivement-row > td:first-child {
    box-shadow: inset 4px 0 0 var(--accent-blue);
}

.data-table tbody tr.cashflow-receivement-row:hover {
    background-color: #eef8ff;
}

.data-table tbody tr.cashflow-receivement-row:hover > td:first-child {
    box-shadow: inset 4px 0 0 #0ea5e9;
}

.data-table tbody tr.cashflow-receivement-row:focus {
    outline: none;
}

.data-table tbody tr.cashflow-receivement-row:focus-visible {
    background-color: #eef8ff;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.28);
}

.data-table tbody tr.cashflow-receivement-row:focus-visible > td:first-child {
    box-shadow: inset 4px 0 0 #0ea5e9;
}

.data-table tfoot tr.data-table__totals td {
    font-weight: 700;
    color: #0f172a;
    background-color: #f1f5f9;
    border-top: 1px solid #e2e8f0;
    border-bottom: none;
}

.data-table tbody tr.is-soft-deleted,
.mobile-data-card.is-soft-deleted,
.admin-strip-row.is-muted {
    opacity: 0.72;
}

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

.actions-col .btn {
    margin-left: 4px;
}

.room-grid-scroll {
    position: relative;
}

.room-grid-scroll__viewport {
    overflow-x: auto;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}

.room-grid-scroll__viewport::-webkit-scrollbar {
    height: 8px;
}

.room-grid-scroll__viewport::-webkit-scrollbar-track {
    background: #e2e8f0;
}

.room-grid-scroll__viewport::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}

.room-grid-scroll.is-overflowing:not(.is-scrolled-end)::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 2.5rem;
    pointer-events: none;
    z-index: 1;
    background: linear-gradient(to right, transparent, #ffffff);
}

.room-grid-more-days {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    margin: 0;
    padding: 4px 8px;
    border-radius: 999px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    pointer-events: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

.room-grid-more-days[hidden] {
    display: none;
}

.room-grid-table {
    table-layout: fixed;
    width: 100%;
    min-width: 52rem;
}

.room-grid-table thead th:nth-child(1) {
    width: 4.5rem;
}

.room-grid-table thead th:nth-child(2) {
    width: 7rem;
}

.room-grid-table thead th:nth-child(n + 3) {
    min-width: 5.5rem;
}

.room-grid-table th,
.room-grid-table td {
    padding: 6px 8px;
    vertical-align: middle;
}

.room-grid-table .shift-cell {
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
    white-space: nowrap;
}

.room-grid-table .room-cell {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-grid-table select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.grid-validation-message {
    margin-bottom: 16px;
}

.room-grid-conflict {
    background-color: #fee2e2 !important;
    box-shadow: inset 0 0 0 2px #dc2626;
}

.room-grid-conflict select {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.room-grid-tenant-0 { background-color: hsl(0, 65%, 75%); }
.room-grid-tenant-1 { background-color: hsl(15, 65%, 75%); }
.room-grid-tenant-2 { background-color: hsl(30, 65%, 75%); }
.room-grid-tenant-3 { background-color: hsl(45, 65%, 75%); }
.room-grid-tenant-4 { background-color: hsl(60, 65%, 75%); }
.room-grid-tenant-5 { background-color: hsl(75, 65%, 75%); }
.room-grid-tenant-6 { background-color: hsl(90, 65%, 75%); }
.room-grid-tenant-7 { background-color: hsl(105, 65%, 75%); }
.room-grid-tenant-8 { background-color: hsl(120, 65%, 75%); }
.room-grid-tenant-9 { background-color: hsl(135, 65%, 75%); }
.room-grid-tenant-10 { background-color: hsl(150, 65%, 75%); }
.room-grid-tenant-11 { background-color: hsl(165, 65%, 75%); }
.room-grid-tenant-12 { background-color: hsl(180, 65%, 75%); }
.room-grid-tenant-13 { background-color: hsl(195, 65%, 75%); }
.room-grid-tenant-14 { background-color: hsl(210, 65%, 75%); }
.room-grid-tenant-15 { background-color: hsl(225, 65%, 75%); }
.room-grid-tenant-16 { background-color: hsl(240, 65%, 75%); }
.room-grid-tenant-17 { background-color: hsl(255, 65%, 75%); }
.room-grid-tenant-18 { background-color: hsl(270, 65%, 75%); }
.room-grid-tenant-19 { background-color: hsl(285, 65%, 75%); }
.room-grid-tenant-20 { background-color: hsl(300, 65%, 75%); }
.room-grid-tenant-21 { background-color: hsl(315, 65%, 75%); }
.room-grid-tenant-22 { background-color: hsl(330, 65%, 75%); }
.room-grid-tenant-23 { background-color: hsl(345, 65%, 75%); }

/* --- BADGES --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background-color: #dcfce7;
    color: #166534;
}

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

.mobile-data-card.receivement-row--promise {
    box-shadow: inset 3px 0 0 #fdba74;
}

.overdue-promises-block {
    margin-top: 1rem;
    padding: 1rem 1.125rem;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
}

.overdue-promises-block__header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    align-items: baseline;
    margin-bottom: 0.35rem;
}

.overdue-promises-block__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 650;
    color: #9a3412;
}

.overdue-promises-block__meta {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
}

.overdue-promises-block__hint {
    margin: 0 0 0.65rem;
    font-size: 0.8125rem;
    color: #c2410c;
}

.overdue-promises-block__list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.875rem;
}

.overdue-promises-block__list li + li {
    margin-top: 0.25rem;
}

.badge-inactive {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-pending {
    background-color: #e0f2fe;
    color: #075985;
}

.badge-rejected,
.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-revoked {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;

}

.badge-neutral {
    background-color: #e2e8f0;
    color: #334155;
}

.badge-extra {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #f59e0b;
}

.badge-online {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background-color: #e0f2fe;
    color: #075985;
    border: 1px solid #7dd3fc;
    padding: 2px 6px;
}

.badge-online .material-icons-round {
    font-size: 14px;
    line-height: 1;
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 40px 16px;
    font-size: 0.875rem;
}

/* --- BADGES (BEM variant used by Despesas e módulos correlatos) --- */
.badge--success {
    background-color: #dcfce7;
    color: #166534;
}

.badge--warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge--info {
    background-color: #e0f2fe;
    color: #075985;
}

.invoice-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.invoice-status-badge--muted {
    background-color: #f1f5f9;
    color: #64748b;
}

.invoice-filters-grid {
    margin-bottom: 1.5rem;
}

.invoice-filters-actions {
    align-self: end;
}

.invoice-detail-body h4 {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.invoice-detail-summary p {
    margin: 0.35rem 0;
}

.invoice-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.invoice-timeline__item {
    display: grid;
    gap: 0.15rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #e2e8f0;
}

.invoice-timeline__date,
.invoice-timeline__meta {
    color: #64748b;
    font-size: 0.875rem;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

/* --- NOTICE BANNERS (lembretes e avisos financeiros) --- */
.notice-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.notice-banner > div {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

.notice-banner[hidden] {
    display: none !important;
}

.notice-banner .material-icons-round {
    font-size: 1.25rem;
    line-height: 1.4;
    flex-shrink: 0;
}

.notice-banner .flash-close {
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
}

.notice-banner > p {
    margin: 0;
    flex: 1;
    align-self: center;
}

.notice-banner--warning {
    background-color: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.notice-banner--info {
    background-color: #eff6ff;
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.notice-banner--muted {
    background-color: #f8fafc;
    border-color: #e2e8f0;
    color: #475569;
}

.billing-notice-banner {
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.billing-notice-banner__link {
    font-weight: 600;
    color: inherit;
    white-space: nowrap;
}

.billing-notice-banner__link:hover {
    text-decoration: underline;
}

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

.notice-list li {
    margin-bottom: 2px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

/* --- SUMMARY TOTAL (painéis de totais em Despesas/Recebimentos) --- */
.summary-total__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.summary-total__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.summary-total__label {
    font-size: 0.8rem;
    color: #64748b;
}

.summary-total__value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #0f172a;
}

.summary-total__value--negative {
    color: #b91c1c;
}

.summary-total__count {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* --- MOBILE DATA CARD (destaque para lançamentos em aberto) --- */
.mobile-data-card--highlight {
    border-left: 4px solid #f59e0b;
    background-color: #fffbeb;
}

/* --- VISIBILITY TOGGLE --- */
.visibility-toggle {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.visibility-status {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.875rem;
}

.section-card {
    margin-top: 24px;
}

.finance-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.receivements-filters-row--main,
.receivements-filters-row--actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.receivements-filter-group--date,
.receivements-filter-group--professional {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.receivements-filters-row--main,
.receivements-filters-row--actions,
.receivements-filters-row--main .form-group,
.receivements-filters-row--main .form-control {
    min-width: 0;
    max-width: 100%;
}

.receivements-filters-row--actions {
    width: 100%;
}

.receivements-filters-row--actions .form-group--actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
}

@media (min-width: 992px) {
    .receivements-filters-row--main {
        flex-direction: row;
        align-items: flex-end;
        flex-wrap: wrap;
        gap: 12px;
    }

    .receivements-filter-group--date {
        flex: 0 0 180px;
        min-width: 180px;
        width: 180px;
    }

    .receivements-filter-group--professional {
        flex: 1 1 240px;
        min-width: 200px;
        max-width: 320px;
    }

    .receivements-filters-row--actions {
        margin-left: auto;
        width: auto;
        flex: 0 0 auto;
    }

    .receivements-filters-row--actions .form-group--actions {
        flex-wrap: nowrap;
    }
}

/* Sessões e recebimentos: min do campo = largura do label (sem quebrar a linha do rótulo). */
@media (min-width: 992px) {
    #pending-sessions-filters .receivements-filters-row--main {
        flex-wrap: wrap;
        gap: 8px;
    }

    /*
     * Coluna sized pelo label (max-content). O select usa width:0 + min-width:100%
     * para acompanhar a coluna sem inflar pelo texto das <option>.
     */
    #pending-sessions-filters .receivements-filters-row--main > .form-group {
        display: grid;
        grid-template-columns: minmax(max-content, 1fr);
        justify-items: stretch;
        flex: 1 1 auto;
        width: auto;
        min-width: max-content;
        max-width: none;
        padding-bottom: 0;
    }

    #pending-sessions-filters .receivements-filters-row--main > .form-group > label {
        white-space: nowrap;
    }

    #pending-sessions-filters .receivements-filters-row--main > .form-group > .form-control {
        width: 0;
        min-width: 100%;
        max-width: none;
        box-sizing: border-box;
    }

    /* Datas: o picker precisa de mais espaço que os rótulos "De" / "Até". */
    #pending-sessions-filters .receivements-filters-row--main > .receivements-filter-group--date {
        grid-template-columns: minmax(9rem, max-content);
        flex: 0 1 auto;
    }

    #pending-sessions-filters .receivements-filters-row--main > .receivements-filter-group--date > .form-control {
        width: 9rem;
        min-width: 9rem;
    }

    #pending-sessions-filters .receivements-filters-row--actions {
        flex: 0 0 auto;
        margin-left: 0;
        width: auto;
    }

    #pending-sessions-filters .receivements-filters-row--actions .btn {
        padding-left: 10px;
        padding-right: 10px;
        white-space: nowrap;
    }
}

.finance-panel--tabs {
    padding-top: 12px;
    padding-bottom: 12px;
}

.retention-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.retention-rule-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 8px;
}

.retention-rule-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.retention-rule-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.retention-rule-group__title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 650;
}

.retention-rule-group__versions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.retention-rule-until {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.8125rem;
}

.retention-filters-row.receivements-filters-row--main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.retention-filter-group--view,
.retention-filter-group--professional {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

#report-professional-group[hidden] {
    display: none !important;
}

/* Contenção mobile de /finance/retention-payouts (tabelas largas + painéis) */
#retention-report-panel,
#retention-rules-panel {
    min-width: 0;
    max-width: 100%;
}

.finance-stack .filter-form,
.finance-stack .form-row,
.finance-stack .card,
.finance-stack .mobile-data-card,
.finance-stack .retention-totals-block,
.finance-stack .retention-report-notices,
.finance-stack .retention-reconciliation,
.finance-stack .retention-help-panel,
.finance-stack .cash-balance-panel__header,
.finance-stack .form-hint {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

/* Sem display aqui: display:block anula .table-responsive--desktop { display:none } no mobile. */
.finance-stack .table-responsive {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.finance-stack .retention-report-table {
    width: max-content;
    min-width: 100%;
    max-width: none;
}

.finance-stack .retention-reconciliation__row > span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.retention-report-notices-panel {
    margin-bottom: 12px;
    min-width: 0;
    max-width: 100%;
}

.retention-report-notices-panel[hidden] {
    display: none;
}

.retention-report-notices {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background-color: var(--receivement-sessions-mismatch-bg);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    padding: 14px 16px;
    overflow-wrap: anywhere;
}

.retention-report-notices__heading {
    margin: 0 0 6px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.01em;
}

.retention-report-notices__intro {
    margin: 0 0 12px;
    font-size: 0.875rem;
    color: #64748b;
    line-height: 1.45;
}

.retention-report-notices__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.retention-report-notice {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #64748b;
    border-radius: 10px;
    background-color: var(--receivement-sessions-mismatch-bg-hover);
}

.retention-report-notice__title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
}

.retention-report-notice__description {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.55;
}

.retention-report-notice__action {
    margin: 0 0 6px;
    font-size: 0.875rem;
    color: #334155;
    line-height: 1.5;
}

.retention-report-notice__action strong {
    color: #1e293b;
}

.retention-report-notice__link {
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.retention-report-notice__link:hover {
    text-decoration: underline;
}

.retention-report-notice__scope {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
}

.retention-warnings {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.retention-warnings .alert {
    margin: 0;
}

.retention-report-section {
    box-sizing: border-box;
    display: block;
    min-width: 0;
    max-width: 100%;
}

.retention-report-section + .retention-report-section {
    margin-top: 24px;
}

.retention-report-section__title {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #0f172a;
}

#pro-report-tables,
#retention-report-tables,
#pro-report-totals-content,
#retention-totals-content {
    min-width: 0;
    max-width: 100%;
}

.retention-totals-grid {
    display: grid;
    gap: 16px;
}

#retention-totals-content {
    display: grid;
    gap: 16px;
}

#retention-totals-content > .form-hint {
    margin: 0;
}

.retention-totals-block {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    overflow-wrap: anywhere;
}

.retention-totals-block--income {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.retention-totals-block--expense {
    background: #fff1f2;
    border-color: #fecdd3;
}

.retention-totals-block--info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.retention-totals-block--warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.retention-totals-block--neutral {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.retention-totals-block h4 {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #334155;
}

.retention-totals-block p {
    margin: 0 0 4px;
}

.retention-totals-block--full {
    margin-top: 16px;
}

/* --- Saldo de caixa (inicial / movimento / final) --- */
.cash-balance-panel {
    display: grid;
    gap: 12px;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding: 14px 16px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
}

.cash-balance-panel__header h4 {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: #0f172a;
}

.cash-balance-panel__header .form-hint {
    margin: 0;
}

.cash-balance-panel__grid {
    display: grid;
    gap: 10px;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
}

.cash-balance-panel__op {
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #64748b;
    line-height: 1;
}

.cash-balance-card {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 14px;
    border-top: 3px solid #94a3b8;
}

.cash-balance-card--opening {
    border-top-color: #64748b;
}

.cash-balance-card--movement {
    border-top-color: #3b82f6;
}

.cash-balance-card--closing {
    border-top-color: #059669;
    background: #f0fdf4;
    border-color: #a7f3d0;
}

.cash-balance-card__title {
    margin: 0 0 2px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
}

.cash-balance-card__caption {
    margin: 0 0 10px;
    font-size: 0.75rem;
    color: #64748b;
}

.cash-balance-card__metrics {
    margin: 0;
    display: grid;
    gap: 8px;
}

.cash-balance-card__metric {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.cash-balance-card__metric dt {
    margin: 0;
    min-width: 0;
    font-size: 0.78rem;
    color: #64748b;
}

.cash-balance-card__metric dd {
    margin: 0;
    min-width: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    font-variant-numeric: tabular-nums;
    text-align: right;
    overflow-wrap: anywhere;
}

.cash-balance-card__metric--primary dd {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
}

.cash-balance-card--closing .cash-balance-card__metric--primary dd {
    color: #047857;
}

@media (min-width: 900px) {
    .cash-balance-panel__grid {
        grid-template-columns: 1fr auto 1fr auto 1fr;
        gap: 8px 10px;
        align-items: stretch;
    }

    .cash-balance-panel__op {
        display: flex;
        padding-top: 28px;
    }
}

#pro-report-totals-content {
    display: grid;
    gap: 16px;
}

#pro-report-totals-content > .form-hint {
    margin: 0;
}

.data-table--tone-income thead th,
.data-table--tone-income tfoot tr.data-table__totals td {
    background-color: #ecfdf5;
}

.data-table--tone-expense thead th,
.data-table--tone-expense tfoot tr.data-table__totals td {
    background-color: #fff1f2;
}

.data-table--tone-info thead th,
.data-table--tone-info tfoot tr.data-table__totals td {
    background-color: #eff6ff;
}

.data-table--tone-warning thead th,
.data-table--tone-warning tfoot tr.data-table__totals td {
    background-color: #fffbeb;
}

.data-table--tone-neutral thead th,
.data-table--tone-neutral tfoot tr.data-table__totals td {
    background-color: #f8fafc;
}

.retention-totals-group-title {
    margin: 16px 0 8px;
    font-size: 0.95rem;
    color: #0f172a;
}

.retention-totals-group-title:first-child {
    margin-top: 0;
}

.retention-report-section__summary {
    cursor: pointer;
    list-style: none;
}

.retention-report-section__summary::-webkit-details-marker {
    display: none;
}

.retention-report-section > .retention-report-section__summary::before {
    content: "▸ ";
    color: #64748b;
}

.retention-report-section[open] > .retention-report-section__summary::before {
    content: "▾ ";
}

.retention-reconciliation {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.retention-reconciliation__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
}

.retention-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: 1px solid #94a3b8;
    border-radius: 999px;
    background: #ffffff;
    color: #475569;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.retention-help-btn:hover,
.retention-help-btn[aria-expanded="true"] {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.retention-help-panel {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 0.875rem;
    color: #334155;
}

.retention-help-panel p {
    margin: 0 0 8px;
}

.retention-help-panel p:last-child {
    margin-bottom: 0;
}

@media (min-width: 768px) {
    .retention-totals-grid--dual {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    .retention-rule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .retention-filter-group--view {
        flex: 0 0 220px;
        min-width: 220px;
        width: 220px;
    }

    .retention-filter-group--professional {
        flex: 1 1 240px;
        min-width: 200px;
        max-width: 320px;
    }
}

.finance-panel {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.finance-panel--summary {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-color: #cbd5e1;
}

.finance-panel--summary h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    color: #0f172a;
    border-bottom: 1px solid #dbe5ef;
    padding-bottom: 8px;
}

.finance-panel--summary #summary-details h4,
.receivement-summary-card h4 {
    margin: 0 0 8px;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 700;
}

.receivement-summary-grid {
    display: grid;
    /* Empilha antes da 1ª coluna precisar quebrar palavras no meio (4 cols numéricas + nome). */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 12px;
    align-items: start;
}

.receivement-summary-details {
    display: contents;
}

.receivement-summary-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.receivement-summary-table {
    width: 100%;
    font-size: 0.78rem;
}

.receivement-summary-table th,
.receivement-summary-table td {
    padding: 6px 8px;
    white-space: nowrap;
    vertical-align: top;
}

.receivement-summary-table td:first-child,
.receivement-summary-table th:first-child {
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    min-width: 8rem;
}

.receivement-summary-table th {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
    background: transparent;
}

.receivement-summary-table--totals {
    max-width: 100%;
}

.u-text-right {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 767px) {
    .receivement-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .receivement-summary-table {
        font-size: 0.72rem;
    }

    .receivement-summary-table th,
    .receivement-summary-table td {
        padding: 5px 6px;
    }

    .receivement-summary-table td:first-child,
    .receivement-summary-table th:first-child {
        min-width: 0;
    }
}

.finance-panel--list .data-table th {
    background-color: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.pending-sessions-list-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.finance-panel--list .data-table tbody tr:hover {
    background-color: #eaf2ff;
}

.receivement-sessions-col {
    min-width: 9rem;
    max-width: 14rem;
    vertical-align: top;
    word-break: break-word;
}

.receivement-sessions-col--mismatch {
    background-color: var(--receivement-sessions-mismatch-bg);
}

.receivement-sessions-count {
    display: block;
    font-weight: 600;
    color: #0f172a;
}

.receivement-sessions-mismatch {
    display: block;
    margin-top: 4px;
    padding: 4px 8px;
    border-radius: 8px;
    background-color: var(--receivement-sessions-mismatch-bg-hover);
    color: #c2410c;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.mobile-data-card.receivement-row--sessions-mismatch {
    border-color: #fdba74;
    background: linear-gradient(180deg, var(--receivement-sessions-mismatch-bg) 0%, #ffffff 42%);
}

.mobile-data-card__field.receivement-sessions-col--mismatch .mobile-data-card__value {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 0;
}

.mobile-data-card__field.receivement-sessions-col--mismatch .receivement-sessions-mismatch {
    width: 100%;
}

.section-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.section-card-header h2 {
    margin: 0;
    font-size: 1.125rem;
    color: #1e293b;
}

.section-card-header__title-group {
    min-width: 0;
}

.chart-panel-subtitle {
    margin: 4px 0 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: #64748b;
}

.chart-export-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
}

.chart-export-btn:hover,
.chart-export-btn:focus-visible {
    background: #f1f5f9;
    color: #0f172a;
    outline: none;
}

.chart-export-btn .material-icons-round {
    font-size: 20px;
}

.chart-export-btn--labeled {
    width: auto;
    min-width: 32px;
    padding: 0 8px;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.section-card-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font-size: 0.875rem;
    font-weight: 700;
}

.history-header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.history-filter-label {
    font-size: 0.85rem;
    color: #334155;
}

.history-header-actions select {
    min-width: 220px;
}

.section-card--history .section-card-header {
    align-items: flex-start;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 260px;
    min-height: 200px;
    overflow: hidden;
    contain: layout paint;
}

.chart-wrapper canvas {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
}

.section-card-body {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.5fr);
    gap: 16px;
    align-items: start;
}

.section-card-body--table-only {
    grid-template-columns: 1fr;
}

.section-card-table {
    overflow-x: auto;
    min-width: 0;
}

.chart-drilldown-label {
    margin: 0 0 6px;
    font-size: 0.75rem;
    color: #64748b;
}

.chart-drilldown-table {
    font-size: 0.75rem;
}

.chart-drilldown-table th,
.chart-drilldown-table td {
    padding: 6px 8px;
}

.charts-section {
    margin-top: 20px;
}

.charts-section__title {
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

.charts-root {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    column-gap: 16px;
    row-gap: 28px;
    min-width: 0;
    align-items: stretch;
}

.chart-panel {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chart-panel .section-card-body {
    grid-template-columns: 1fr;
    flex: 1;
}

.chart-panel .section-card-body--table-only {
    grid-template-columns: 1fr;
}

.chart-panel[data-chart-panel='sessoes-por-profissional'] {
    grid-column: 1 / -1;
}

.chart-kpi {
    min-width: 0;
}

.charts-period-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
}

.charts-period-btn {
    flex: 1 1 auto;
    min-width: 80px;
    font-size: 0.9rem;
}

.chart-wrapper {
    position: relative;
    height: 320px;
}

@media (max-width: 767px) {
    .section-card-body {
        grid-template-columns: 1fr;
    }

    .charts-root {
        grid-template-columns: 1fr;
    }

    .chart-wrapper {
        height: 240px;
        min-height: 200px;
    }

    .charts-period-btn {
        flex: 1 1 calc(33% - 8px);
        font-size: 0.82rem;
        padding: 6px 8px;
    }

    .section-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .section-card-header .history-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    .section-card--history .section-card-header {
        flex-direction: column;
        gap: 10px;
    }

    .section-card--history .history-header-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .section-card--history .history-header-actions select {
        flex: 1 1 220px;
        min-width: 0;
    }
}

.audit-cell {
    font-size: 0.875rem;
    color: #0f172a;
}

.audit-cell-subtle {
    display: block;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #64748b;
}

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

.audit-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.client-profile-card {
    margin-bottom: 20px;
    padding: 14px;
}

.client-profile-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dbe5ef;
}

.client-profile-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.client-profile-card__edit {
    margin-left: auto;
    flex-shrink: 0;
}

.client-profile-card > .client-profile-card__title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #dbe5ef;
}

.client-profile-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px 28px;
    margin: 0;
}

.client-profile-field {
    margin: 0;
    min-width: 0;
}

.client-profile-field dt {
    margin: 0 0 2px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.client-profile-field dd {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 400;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}

.client-profile-field--contact {
    grid-column: 1 / -1;
}

.client-profile-field--contact dd {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.history-date-filters {
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    align-items: flex-start;
    margin: 0 0 16px;
    padding: 0;
}

.history-date-filters__primary {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px 16px;
    align-items: last baseline;
    flex: 1 1 auto;
    min-width: 0;
}

.history-date-filters__dates {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px 16px;
    align-items: flex-end;
    min-width: 0;
}

.history-date-filters .form-group {
    margin: 0;
    min-width: 0;
}

.history-date-filters__dates .form-group {
    flex: 0 1 160px;
}

.history-date-filters .form-group input[type="date"] {
    width: 100%;
    min-width: 0;
}

.history-date-filters .form-group--actions {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 0;
    padding-bottom: 0;
}

.history-date-filters__view {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
    margin-left: auto;
    padding: 0 0 0 16px;
    border-left: 1px solid #e2e8f0;
    flex: 0 0 auto;
}

.history-date-filters__view .form-group {
    padding-bottom: 0;
    min-width: 180px;
}

.history-date-filters__view .form-control,
.history-date-filters__view .input {
    min-width: 180px;
    width: 100%;
}

.history-date-filters__view .section-card-count {
    flex-shrink: 0;
    margin-bottom: 2px;
}

@media (max-width: 767px) {
    .history-date-filters {
        flex-direction: column;
        align-items: stretch;
        flex-wrap: wrap;
        gap: 12px;
    }

    .history-date-filters__primary {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .history-date-filters__dates {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
        gap: 10px 12px;
    }

    .history-date-filters__dates .form-group {
        flex: none;
        width: auto;
        min-width: 0;
    }

    .history-date-filters .form-group--actions {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        width: 100%;
    }

    .history-date-filters .form-group--actions .btn {
        flex: 1 1 0;
        white-space: nowrap;
    }

    .history-date-filters__view {
        margin-left: 0;
        padding: 12px 0 0;
        border-left: none;
        border-top: 1px solid #e2e8f0;
        width: 100%;
        flex-wrap: wrap;
    }

    .history-date-filters__view .form-group {
        flex: 1 1 160px;
        min-width: 0;
    }

    .history-date-filters__view .form-control,
    .history-date-filters__view .input {
        min-width: 0;
        width: 100%;
    }
}

.history-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.inline-form {
    display: inline;
}

.text-muted {
    color: #94a3b8;
}

.mobile-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bank-account-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-data-card {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #dbe5ef;
    border-radius: 14px;
    padding: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.mobile-data-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.mobile-data-card__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.mobile-data-card__subtitle {
    margin: 4px 0 0;
    color: #64748b;
    font-size: 0.82rem;
}

.mobile-data-card__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 120px), 1fr));
    gap: 12px;
    min-width: 0;
}

.mobile-data-card__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mobile-data-card__label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.mobile-data-card__value {
    font-size: 0.92rem;
    color: #0f172a;
    word-break: break-word;
}

.mobile-data-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.mobile-data-card__actions .btn {
    margin: 0;
}

.mobile-data-card__actions form {
    display: inline-flex;
}

.mobile-data-card__actions--compact {
    margin-top: 12px;
}

.pagination {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-top: 16px;
}

.pagination span {
    color: #475569;
    font-size: 0.875rem;
}

@media (max-width: 767px) {
    .time-pattern-week-card {
        display: none;
    }
}

.mobile-data-card__header > .btn {
    flex: 0 0 auto;
}

.time-pattern-day--placeholder > td,
.mobile-data-card.time-pattern-day--placeholder {
    background: #f8fafc;
}

.time-pattern-meta {
    margin-top: 4px;
    font-size: 0.86rem;
    color: #64748b;
}

.time-pattern-share-badge {
    margin-top: 6px;
}

.role-badge--small {
    font-size: 0.78rem;
}

.time-pattern-inline-form {
    display: inline-block;
    margin-top: 8px;
}

.time-pattern-action-wrap {
    margin-top: 8px;
}

.time-pattern-shift-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.time-pattern-shift-card {
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    padding: 14px;
    background: #ffffff;
}

.time-pattern-shift-card--empty {
    background: #f8fafc;
}

.time-pattern-shift-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.time-pattern-shift-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}

/* --- SCHEDULING: SESSIONS --- */
.agenda-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.agenda-controls-main,
.agenda-controls-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.session-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-slot-btn {
    width: 100%;
    border: 1px solid #dbe5ef;
    background: #ffffff;
    border-radius: 4px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.session-slot-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.session-slot-available {
    border-left: 4px solid #979797;
}

.session-slot-booked {
    border: 1px solid var(--session-label-color, #10b981);
    border-left-width: 4px;
}

.session-slot-booked:hover {
    border-color: var(--session-label-color, #10b981);
}

.session-slot-blocked {
    border: 1px solid #dbe5ef !important;
    border-left-width: 4px !important;
}

.session-slot-blocked:hover {
    border-color: #dbe5ef !important;
}

.session-slot-main {
    font-weight: 700;
    color: #0f172a;
}

.session-slot-prof {
    margin-left: auto;
    font-size: 0.76rem;
    color: #64748b;
}

.session-attendance-badge {
    font-size: 0.72rem;
    border: 1px solid transparent;
}

.session-attendance-badge.is-scheduled {
    background: #e0f2fe;
    color: #075985;
    border-color: #7dd3fc;
}

.session-attendance-badge.is-attended {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}

.session-attendance-badge.is-missed,
.session-attendance-badge.is-missed-charged,
.session-attendance-badge.is-left {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fca5a5;
}

.session-attendance-badge.is-cancelled {
    background: #f1f5f9;
    color: #334155;
    border-color: #cbd5e1;
}

.session-attendance-badge.is-holiday {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}

.session-attendance-badge.is-rescheduled {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #a5b4fc;
}

.agenda-week-table .session-slot-btn.compact {
    padding: 8px 10px;
}

.session-client-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 8px;
}

.session-client-item {
    border: 1px solid #10b981;
    background: #e6f6e4;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.session-client-item__identity {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.session-client-item__source {
    margin-left: auto;
    white-space: nowrap;
}

.session-client-item strong {
    color: #0ea5e9;
}

.session-client-item--create {
    border: 2px solid #0284c7;
    background: linear-gradient(180deg, #ecfeff 0%, #dbeafe 100%);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.14);
}

.session-client-item--create .page-subtitle {
    color: #10b981;
    font-weight: 600;
}

.session-client-item--create strong {
    background: #10b981;
    color: #ffffff;
    padding: 8px;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.session-client-item--create:hover {
    border-color: #0369a1;
    box-shadow: 0 8px 20px rgba(14, 116, 144, 0.24);
    transform: translateY(-1px);
}

.session-client-item--create:focus-visible {
    outline: 3px solid rgba(2, 132, 199, 0.35);
    outline-offset: 2px;
}

.session-client-search-empty {
    padding: 10px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    color: #334155;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.session-selected-client-indicator {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #dbe5ef;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.session-selected-client-indicator.is-empty {
    background: #f8fafc;
    color: #64748b;
}

.session-selected-client-indicator.is-selected {
    background: #ecfdf5;
    border-color: #34d399;
    color: #065f46;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
    font-weight: 700;
}

.agenda-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    box-sizing: border-box;
    /* Mesma folga em todas as bordas (mobile); safe-area só no topo (notch). */
    padding: max(12px, env(safe-area-inset-top)) 12px 12px;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.agenda-modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

#client-catalog-insurance-modal.active,
#client-catalog-package-modal.active {
    z-index: 1200;
}

#client-catalog-service-modal.active {
    z-index: 1300;
}

#expense-type-modal.active {
    z-index: 1200;
}

.agenda-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
}

.agenda-modal__panel {
    position: relative;
    margin: 0;
    box-sizing: border-box;
    width: min(100%, 760px);
    min-width: 0;
    max-width: 100%;
    background: #fff;
    border-radius: 12px;
    padding: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.agenda-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 4;
    background: #fff;
    padding: 12px 16px 10px;
    border-bottom: 1px solid #e2e8f0;
}

.agenda-modal__body {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    padding: 12px 16px 16px;
    overflow-wrap: anywhere;
}

.agenda-modal__body form,
.agenda-modal__body .form-group {
    min-width: 0;
    max-width: 100%;
}

.agenda-modal__body :where(input, select, textarea, .form-control) {
    max-width: 100%;
    min-width: 0;
}

.agenda-modal__header h2 {
    margin: 0;
    font-size: 1.05rem;
}

.session-comment-input {
    min-height: 68px;
    resize: vertical;
}

@media (min-width: 992px) {
    .agenda-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .agenda-modal {
        padding: 24px;
    }

    .agenda-modal__panel {
        max-width: 720px;
        margin: 0 auto;
        max-height: 100%;
    }

    .agenda-modal:has(.agenda-modal__panel--session-actions).active {
        align-items: stretch;
    }

    .agenda-modal__panel--session-actions {
        height: 100%;
        max-height: 100%;
    }
}

/* --- SCHEDULING: SESSIONS --- */
.agenda-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.agenda-controls-main,
.agenda-controls-secondary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: end;
}

.session-day-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-slot-btn {
    width: 100%;
    border: 1px solid #dbe5ef;
    background: #ffffff;
    border-radius: 4px;
    padding: 10px 12px;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.session-slot-btn:hover {
    border-color: #93c5fd;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.session-slot-available {
    border-left: 4px solid #979797;
}

.session-slot-booked {
    border: 1px solid var(--session-label-color, #10b981);
    border-left-width: 4px;
}

.session-slot-booked:hover {
    border-color: var(--session-label-color, #10b981);
}

.session-slot-blocked {
    border: 1px solid #dbe5ef !important;
    border-left-width: 4px !important;
}

.session-slot-blocked:hover {
    border-color: #dbe5ef !important;
}

.session-slot-main {
    font-weight: 700;
    color: #0f172a;
}

.session-slot-prof {
    margin-left: auto;
    font-size: 0.76rem;
    color: #64748b;
}

.week-slots-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-week-table .session-slot-btn.compact {
    padding: 8px 10px;
}

.session-client-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 8px;
}

.session-client-item {
    border: 1px solid #10b981;
    background: #fff;
    border-radius: 8px;
    padding: 8px 10px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.session-client-item strong {
    margin-left: auto;
    color: #ffffff;
    font-size: 16px;
}

.picker-sessions {
    display: flex;
    align-items: normal;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.picker-sum-bar {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.picker-sum-info {
    margin: 0;
    color: #0f172a;
    font-size: 0.92rem;
}

.picker-session-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid #dbe5ef;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    background: #ffffff;
}

.picker-session-item input[type="checkbox"] {
    margin-top: 2px;
    flex: 0 0 auto;
}

.picker-session-item span {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    color: #0f172a;
    font-size: 0.8rem;
    line-height: 1.35;
}

.picker-session-item--selected {
    border-color: #10b981;
    background: #ecfdf5;
}

.linked-session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #10b981;
    border-radius: 6px;
    background: #ecfdf5;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.linked-session-item span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-label {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #475569;
}

.agenda-controls-main {
    flex-direction: column;
    align-items: stretch;
}

.agenda-date-wrap {
    width: 100%;
    min-width: 0;
}

.agenda-date-wrap .form-control {
    width: 100%;
}

.agenda-nav-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

.agenda-nav-row .agenda-date-wrap {
    width: auto;
    flex: 1 1 10rem;
    min-width: 9.5rem;
    max-width: 18rem;
}

.agenda-week-picker-trigger {
    display: flex;
    align-items: center;
    width: 100%;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agenda-week-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agenda-week-picker__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: min(50vh, 22rem);
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.agenda-week-picker__option {
    appearance: none;
    border: 1px solid transparent;
    background: #ffffff;
    color: #0f172a;
    text-align: left;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 0.9375rem;
    line-height: 1.3;
}

.agenda-week-picker__option:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.agenda-week-picker__option.is-selected {
    border-color: #0f766e;
    background: #ecfdf5;
    color: #115e59;
    font-weight: 600;
}

.agenda-nav-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
    min-width: 2.75rem;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.agenda-org-week-groups {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.agenda-week-period {
    margin: 0 0 10px;
    padding: 10px 12px;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    font-weight: 600;
    font-size: 0.92rem;
}

/* A borda do primeiro chip coincide com a borda esquerda da toolbar, até rolar. */
.agenda-period-summary {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #475569;
    font-weight: 500;
    font-size: 0.85rem;
    line-height: 1.35;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    cursor: help;
}

.agenda-period-summary__item {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    white-space: nowrap;
}

.agenda-period-summary__icon {
    font-size: 1.05rem;
    line-height: 1;
    color: #64748b;
}

a.agenda-period-summary__charts {
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    border-color: #0f172a;
    background: #0f172a;
    color: #e2e8f0;
}

body[data-user-type="professional"] a.agenda-period-summary__charts {
    border-color: #5c2145;
    background: #5c2145;
    color: #f8eaf2;
}

body[data-user-type="organization"] a.agenda-period-summary__charts {
    border-color: #0f2a44;
    background: #0f2a44;
    color: #e6f1fb;
}

a.agenda-period-summary__charts .agenda-period-summary__icon,
a.agenda-period-summary__charts .agenda-period-summary__label {
    color: inherit;
}

a.agenda-period-summary__charts:hover {
    filter: brightness(1.15);
}

a.agenda-period-summary__charts:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.agenda-week-period:has(+ .agenda-period-summary),
.agenda-day-weekday:has(+ .agenda-period-summary) {
    margin-bottom: 6px;
}

.agenda-day-weekday + .agenda-period-summary {
    margin-bottom: 16px;
}

.agenda-week-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.agenda-week-day-card {
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
}

.agenda-week-day-card__header {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.agenda-week-day-card__header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #0f172a;
}

.agenda-week-day-card__slots {
    padding: 8px;
}

.agenda-week-day-card__shift {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-week-day-card__shift + .agenda-week-day-card__shift {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.agenda-week-day-card__shift-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #64748b;
}

.agenda-week-list .session-slot-btn.compact {
    padding: 8px 10px;
}

.agenda-org-day-group {
    border: 1px solid #dbe5ef;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    overflow: hidden;
}

.agenda-org-day-group__header {
    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.agenda-org-day-group__header h2 {
    margin: 0;
    font-size: 1rem;
    color: #0f172a;
}

.agenda-org-day-group__shifts {
    display: flex;
    flex-direction: column;
}

.agenda-org-shift-group {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
}

.agenda-org-day-group__shifts .agenda-org-shift-group:first-child {
    border-top: none;
}

.agenda-org-shift-group__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.agenda-org-shift-group__header h3 {
    margin: 0;
    font-size: 0.95rem;
    color: #1e293b;
}

.agenda-org-professional-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agenda-org-professional-card {
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    padding: 12px;
    background: #ffffff;
}

.agenda-org-professional-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.agenda-org-professional-card__header h4 {
    margin: 0;
    font-size: 0.9rem;
    color: #0f172a;
}

.agenda-org-professional-card__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.78rem;
    font-weight: 700;
}

.agenda-org-professional-card__slots {
    gap: 8px;
}

.agenda-org-shift-group__empty {
    margin: 0;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* --- Toolbar da agenda: navegação, filtros e ações --- */
.agenda-sync-all-hint {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 10px;
    margin: 0 0 16px;
    padding: 8px 10px;
    border-radius: 8px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-size: 0.8125rem;
    line-height: 1.35;
    max-width: 44rem;
}

.agenda-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 0;
    border: 1px solid #dbe5ef;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
}

.agenda-toolbar + .agenda-sync-all-hint {
    margin-top: 8px;
}

.agenda-toolbar:not(:has(+ .agenda-sync-all-hint)):not(:has(+ .agenda-day-weekday)) {
    margin-bottom: 16px;
}

.agenda-toolbar + .agenda-day-weekday {
    margin-top: 8px;
    margin-bottom: 16px;
}

.agenda-toolbar + .agenda-day-weekday:has(+ .agenda-period-summary) {
    margin-bottom: 6px;
}

.agenda-toolbar__nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 12px 10px;
    border-top: none;
    background: #ffffff;
}

.agenda-toolbar__view {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.agenda-toolbar__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
    padding: 8px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

/* Mobile: Ver dia/semana e Sessão extra na mesma linha */
@media (max-width: 991px) {
    .agenda-toolbar {
        display: grid;
        grid-template-columns: 1fr auto;
    }

    .agenda-toolbar__nav,
    .agenda-toolbar__prof {
        grid-column: 1 / -1;
    }

    .agenda-toolbar__nav {
        order: 1;
    }

    .agenda-toolbar__prof {
        order: 2;
    }

    .agenda-toolbar__view {
        order: 3;
        border-top: 1px solid #e2e8f0;
        padding-top: 8px;
        padding-bottom: 12px;
        align-self: center;
        justify-content: flex-start;
    }

    .agenda-toolbar__actions {
        order: 4;
        border-top: 1px solid #e2e8f0;
        padding-top: 8px;
        padding-bottom: 12px;
        justify-content: flex-end;
        align-self: center;
    }
}

.agenda-toolbar__prof {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 8px 12px 12px;
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
}

.agenda-sync-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
}

.agenda-sync-badge[hidden] {
    display: none !important;
}

.agenda-sync-all-hint__text {
    margin: 0;
    flex: 1 1 12rem;
}

.agenda-sync-all-hint [data-refresh-agenda] {
    flex: 0 0 auto;
    margin-left: auto;
}

.agenda-prof-select-label {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 0;
    min-width: 220px;
    margin: 0;
}

.agenda-prof-select-label .form-control {
    flex: 1 1 12rem;
    min-width: 0;
    width: 100%;
}

@media (min-width: 992px) {
    .agenda-toolbar {
        display: flex;
        flex-direction: row;
        align-items: stretch;
    }

    .agenda-toolbar__nav {
        flex: 0 1 auto;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-end;
        border-top: none;
        border-right: none;
        padding: 12px;
        order: 0;
    }

    .agenda-toolbar__nav .agenda-date-wrap {
        width: auto;
        flex: 0 0 auto;
    }

    .agenda-toolbar__nav .agenda-date-wrap .form-control {
        width: auto;
    }

    .agenda-toolbar__view {
        flex: 0 0 auto;
        align-items: center;
        align-self: center;
        border-top: none;
        border-left: 1px solid #e2e8f0;
        padding: 12px;
        order: 0;
    }

    .agenda-toolbar__actions {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        margin-left: auto;
        border-top: none;
        border-left: 1px solid #e2e8f0;
        padding: 12px;
        min-width: 0;
        order: 0;
    }

    .agenda-toolbar__prof {
        flex: 0 1 240px;
        align-items: flex-end;
        border-top: none;
        border-left: 1px solid #e2e8f0;
        padding: 12px;
        order: 0;
    }

    .agenda-toolbar__prof .agenda-prof-select-label {
        width: 100%;
    }

    .agenda-toolbar__prof .form-control {
        width: 100%;
    }
}

/* --- Grade semanal (org + 1 profissional e conta profissional): dias lado a lado no desktop --- */
@media (min-width: 768px) {
    .agenda-week-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
    }

    .agenda-week-list .agenda-week-day-card {
        flex: 1 1 0;
        min-width: 0;
    }
}

/* Grade mobile estilo Google — só conta profissional */
.agenda-week-mobile-grid {
    display: none;
}

@media (max-width: 767px) {
    .agenda-week-desktop-only {
        display: none;
    }

    .agenda-week-mobile-grid {
        display: block;
        width: calc(100% + 32px);
        max-width: none;
        margin: 0 -16px;
        padding: 0 8px 12px;
        box-sizing: border-box;
    }

    /* A grade sangra 8px para a esquerda; o resumo volta à borda da toolbar. */
    .agenda-week-mobile-grid > .agenda-period-summary {
        width: calc(100% - 16px);
        margin-left: 8px;
        margin-right: 8px;
    }
}

.agenda-week-mobile-grid__period {
    display: none;
}

.agenda-week-mobile-grid__empty {
    margin: 0;
    padding: 16px 12px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 0.85rem;
    text-align: center;
}

.agenda-week-mobile-grid__header {
    display: grid;
    grid-template-columns: 36px repeat(var(--agenda-week-day-count, 7), minmax(0, 1fr));
    gap: 0;
    flex: 0 0 auto;
    z-index: 2;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
}

.agenda-week-mobile-grid__corner {
    min-height: 1px;
}

.agenda-week-mobile-grid__day-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 2px 0;
}

.agenda-week-mobile-grid__weekday {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: lowercase;
}

.agenda-week-mobile-grid__daynum {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0f172a;
}

.agenda-week-mobile-grid__day-head.is-today .agenda-week-mobile-grid__weekday {
    color: #1d4ed8;
}

.agenda-week-mobile-grid__day-head.is-today .agenda-week-mobile-grid__daynum {
    background: #2563eb;
    color: #ffffff;
}

.agenda-week-mobile-grid__scroll {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    overflow: visible;
    border: none;
    border-radius: 0;
    background: #ffffff;
}

.agenda-week-mobile-grid__times {
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.agenda-week-mobile-grid__time {
    box-sizing: border-box;
    padding: 2px 2px 0;
    font-size: 0.62rem;
    font-weight: 600;
    color: #94a3b8;
    line-height: 1;
}

.agenda-week-mobile-grid__time:first-child {
    transform: none;
}

.agenda-week-mobile-grid__days {
    display: grid;
    grid-template-columns: repeat(var(--agenda-week-day-count, 7), minmax(0, 1fr));
    min-width: 0;
}

.agenda-week-mobile-grid__day-col {
    position: relative;
    border-right: 1px solid #f1f5f9;
    min-width: 0;
}

.agenda-week-mobile-grid__day-col:last-child {
    border-right: none;
}

.agenda-week-mobile-grid__day-col.is-today {
    background: rgba(37, 99, 235, 0.04);
}

.agenda-week-mobile-grid__hour-line {
    position: absolute;
    left: 0;
    right: 0;
    border-top: 1px solid #f1f5f9;
    pointer-events: none;
}

.agenda-week-mobile-grid__now {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 2px solid #ef4444;
    z-index: 3;
    pointer-events: none;
}

.agenda-week-mobile-grid__now-dot {
    position: absolute;
    left: -3px;
    top: -5px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
}

.agenda-week-mobile-grid__event {
    /* Sem `right:` aqui: left+right forçava largura total e anulava colunas lado a lado. */
    position: absolute;
    left: 2px;
    right: auto;
    width: calc(100% - 4px);
    z-index: 1;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    margin: 0;
    padding: 4px 4px 4px 6px !important;
    border-radius: 4px !important;
    border: 1px solid #dbe5ef !important;
    background: #ffffff;
    text-align: left;
    min-height: 28px !important;
    line-height: 1.2;
    box-shadow: none !important;
    flex-wrap: nowrap;
    color: #0f172a;
}

/* Ganha de `.session-slot-btn { width: 100% }` quando empacotado em colunas. */
.agenda-week-mobile-grid__event.is-packed {
    left: var(--event-left, 2px) !important;
    width: var(--event-width, calc(100% - 4px)) !important;
    right: auto !important;
}

.agenda-week-mobile-grid__event .agenda-week-mobile-grid__event-title {
    display: block;
    width: 100%;
    font-size: 0.7rem;
    font-weight: 700;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0f172a;
    max-height: 100%;
    min-width: 0;
}

.agenda-week-mobile-grid__attendance-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 4px;
    margin-top: 4px;
    margin-left: 0;
    border-radius: 50%;
    background: #94a3b8;
}

.agenda-week-mobile-grid__attendance-dot.is-scheduled {
    background: #0ea5e9;
}

.agenda-week-mobile-grid__attendance-dot.is-attended {
    background: #22c55e;
}

.agenda-week-mobile-grid__attendance-dot.is-missed,
.agenda-week-mobile-grid__attendance-dot.is-missed-charged,
.agenda-week-mobile-grid__attendance-dot.is-left {
    background: #ef4444;
}

.agenda-week-mobile-grid__attendance-dot.is-cancelled {
    background: #94a3b8;
}

.agenda-week-mobile-grid__attendance-dot.is-holiday {
    background: #f59e0b;
}

.agenda-week-mobile-grid__attendance-dot.is-rescheduled {
    background: #6366f1;
}

.agenda-week-mobile-grid__event.session-slot-available,
.agenda-week-mobile-grid__event.is-available {
    z-index: 1;
    border-left: 4px solid #979797 !important;
    background: #ffffff;
    color: #0f172a;
    opacity: 1;
}

.agenda-week-mobile-grid__event.session-slot-booked {
    z-index: 2;
    border: 1px solid var(--session-label-color, #10b981) !important;
    border-left-width: 4px !important;
    background: #ffffff;
    color: #0f172a;
}

.agenda-week-mobile-grid__event.session-slot-blocked {
    z-index: 2;
    border: 1px solid #dbe5ef !important;
    border-left-width: 4px !important;
    background: #ffffff;
    color: #0f172a;
}

.agenda-week-mobile-grid__event .badge,
.agenda-week-mobile-grid__event .session-slot-prof,
.agenda-week-mobile-grid__event .session-attendance-badge {
    display: none;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 8px;
}

.contact-actions--inline {
    flex-wrap: nowrap;
    align-items: stretch;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.contact-actions--inline .contact-button {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-actions--inline .contact-button--icon-only {
    flex: 0 0 auto;
    padding-left: 8px;
    padding-right: 8px;
}

.contact-actions--details {
    margin-top: 10px;
}

.contact-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 0;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid transparent;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.contact-button__icon {
    font-size: 0.95rem;
    line-height: 1;
    width: 0.95rem;
    height: 0.95rem;
    flex: 0 0 auto;
}

.contact-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
}

.contact-button--phone {
    background: #0f172a;
    color: #ffffff;
}

.contact-button--phone:hover {
    color: #ffffff;
}

.contact-button--whatsapp {
    background: #10b981;
    color: #ffffff;
}

.contact-button--whatsapp:hover {
    color: #ffffff;
}

.contact-button--video {
    background: #2563eb;
    color: #ffffff;
}

.contact-button--video:hover {
    color: #ffffff;
}

.contact-button--copy {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.session-label-color-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 14px;
    background: #ffffff;
}

.session-label-color-field .modal-helper-text {
    margin: 0;
    text-align: left;
}

.session-label-color-summary {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.session-label-color-summary__name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
}

.session-label-color-modal {
    text-align: left;
}

.session-label-color-modal .modal-helper-text {
    margin: 0 0 12px;
    text-align: left;
}

.session-label-color-picker {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden;
    text-align: left;
}

.session-label-color-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin: 0;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #0f172a;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}

.session-label-color-option:last-child {
    border-bottom: none;
}

.session-label-color-option:hover {
    background: #f8fafc;
}

.session-label-color-option:has(input:checked) {
    background: #eef2ff;
}

.session-label-color-option input {
    margin: 0;
    flex-shrink: 0;
}

.session-label-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, 0.15);
    flex-shrink: 0;
}

.session-label-color-name {
    text-align: left;
}

.session-label-color-only-this {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    text-align: left;
    cursor: pointer;
}

.session-label-color-only-this input {
    margin: 3px 0 0;
    flex-shrink: 0;
}

.session-label-color-only-this-help {
    margin: 6px 0 0;
    padding-left: 0;
    text-align: left;
}

.agenda-modal[data-agenda-color-modal].active {
    z-index: 1200;
}

.money-input {
    text-align: right;
}

@media (min-width: 768px) {
    .search-bar {
        flex-direction: row;
        align-items: center;
    }

    .search-btn {
        width: auto;
    }

    .table-responsive--desktop {
        display: block;
    }

    .mobile-card-list {
        display: none;
    }

    .finance-panel {
        padding: 18px;
    }

    .client-profile-card {
        padding: 18px;
    }

    .pagination {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .agenda-org-professional-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }
}

/* Faixa de recebimentos e despesas: linha no painel largo, pilha no estreito. */
.ledger {
    container-type: inline-size;
    container-name: ledger;
    min-width: 0;
}

.ledger-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ledger-head {
    display: none;
}

.ledger-card.mobile-data-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "who amount"
        "when when"
        "context context"
        "detail detail"
        "actions actions";
    gap: 3px 10px;
    align-items: start;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 10px 12px;
}

.ledger-zone {
    min-width: 0;
}

.ledger-zone--who { grid-area: who; min-width: 0; }
.ledger-zone--amount { grid-area: amount; text-align: right; }
.ledger-zone--when { grid-area: when; }
.ledger-zone--context { grid-area: context; }
.ledger-zone--detail { grid-area: detail; }
.ledger-zone--actions {
    grid-area: actions;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

.ledger-zone--when,
.ledger-zone--context,
.ledger-zone--detail {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    padding-top: 3px;
    border-top: 1px solid #f1f5f9;
}

.ledger-kicker,
.ledger-lab,
.ledger-head {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.ledger-kicker { display: block; overflow-wrap: anywhere; }

.ledger-title,
.ledger-zone--amount strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.ledger-sub,
.ledger-note {
    display: block;
    margin-top: 2px;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 400;
    overflow-wrap: anywhere;
}

.ledger-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.ledger-val {
    min-width: 0;
    color: #0f172a;
    font-size: 0.88rem;
    text-align: right;
    overflow-wrap: anywhere;
}

.ledger-zone--detail .receivement-sessions-count {
    display: block;
    font-weight: 600;
}

@container ledger (min-width: 860px) {
    .ledger-head,
    .ledger-card.mobile-data-card {
        display: grid;
        grid-template-columns: minmax(0, 10.5rem) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 0.95fr) max-content;
        grid-template-areas: none;
        column-gap: 12px;
        row-gap: 0;
        align-items: start;
    }

    .ledger-head {
        padding: 0 14px 4px;
    }

    .ledger-head span:last-child { text-align: right; }

    .ledger-zone--who,
    .ledger-zone--amount,
    .ledger-zone--when,
    .ledger-zone--context,
    .ledger-zone--detail,
    .ledger-zone--actions {
        grid-area: auto;
    }

    .ledger-zone--amount { text-align: left; }

    .ledger-lab { display: none; }

    .ledger-zone--when,
    .ledger-zone--context,
    .ledger-zone--detail {
        display: block;
        border-top: 0;
        padding-top: 0;
    }

    .ledger-val { text-align: left; }

    .ledger-zone--actions {
        margin-top: 0;
        flex-wrap: nowrap;
    }
}

/* Faixa das listas de administrador: colunas da própria tela no painel largo. */
.admin-strip {
    container-type: inline-size;
    container-name: admin-strip;
    min-width: 0;
}

.admin-strip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-strip-head {
    display: none;
}

.admin-strip-row.mobile-data-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "who lead" "facts facts" "actions actions";
    gap: 4px 10px;
    align-items: start;
    width: 100%;
    padding: 10px 12px;
}

.admin-strip-cell {
    min-width: 0;
}

.admin-strip-cell--who { grid-area: who; }
.admin-strip-cell--lead { grid-area: lead; text-align: right; }
.admin-strip-row:not(:has(.admin-strip-cell--lead)) .admin-strip-cell--who { grid-column: 1 / -1; }

.admin-strip-cell--fact,
.admin-strip-cell--actions {
    grid-column: 1 / -1;
}

.admin-strip-cell--fact {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    padding-top: 3px;
    border-top: 1px solid #f1f5f9;
}

.admin-strip-cell--actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 6px;
}

.admin-strip-cell--actions .table-actions {
    justify-content: flex-end;
}

.admin-strip-kicker,
.admin-strip-lab,
.admin-strip-head {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.admin-strip-kicker,
.admin-strip-lab { display: block; }

.admin-strip-title,
.admin-strip-cell--lead strong {
    display: block;
    color: #0f172a;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.admin-strip-extra,
.admin-strip-note,
.admin-strip-line {
    display: block;
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.admin-strip-extra,
.admin-strip-note {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 400;
}

.admin-strip-line {
    color: #0f172a;
    font-size: 0.88rem;
}

.admin-strip-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.admin-strip-val {
    min-width: 0;
    color: #0f172a;
    font-size: 0.88rem;
    text-align: right;
    overflow-wrap: anywhere;
}

@container admin-strip (min-width: 860px) {
    .admin-strip-head,
    .admin-strip-row.mobile-data-card {
        display: grid;
        grid-template-columns: var(--strip-grid);
        grid-template-areas: none;
        column-gap: 12px;
        row-gap: 0;
        align-items: start;
    }

    .admin-strip-head {
        padding: 0 14px 4px;
    }

    .admin-strip--has-actions .admin-strip-head span:last-child { text-align: right; }

    .admin-strip-cell--who,
    .admin-strip-row:not(:has(.admin-strip-cell--lead)) .admin-strip-cell--who,
    .admin-strip-cell--lead,
    .admin-strip-cell--fact,
    .admin-strip-cell--actions {
        grid-area: auto;
        grid-column: auto;
    }

    .admin-strip-cell--lead { text-align: left; }

    .admin-strip-lab { display: none; }

    .admin-strip-cell--fact {
        display: block;
        border-top: 0;
        padding-top: 0;
    }

    .admin-strip-val { text-align: left; }

    .admin-strip-cell--actions { margin-top: 0; }
}

/* --- Utilitários de layout (sem style inline nas views; compatível com CSP) --- */
.form-inline {
    display: inline;
}

.u-mt-0 { margin-top: 0; }
.u-mt-6 { margin-top: 6px; }
.u-mt-16 { margin-top: 16px; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-1 { margin-bottom: 1rem; }
.u-mb-12 { margin-bottom: 12px; }
.u-mb-14 { margin-bottom: 14px; }
.u-mb-16 { margin-bottom: 16px; }
.u-my-6 { margin-top: 6px; margin-bottom: 6px; }

.nav-logout-form {
    margin: 0;
}

.nav-logout-btn,
.nav-list button.nav-link {
    width: 100%;
    border: none;
    background: none;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--shell-nav-text, var(--nav-text));
}

.nav-logout-btn:hover,
.nav-list button.nav-link:hover {
    color: white;
}

.nav-list [data-pwa-install-entry][hidden] {
    display: none !important;
}

[data-block-slot-form] > .page-subtitle {
    margin: 0 0 8px;
}

.form-fieldset {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    margin: 0 0 16px;
    min-width: 0;
}

.form-fieldset legend {
    font-weight: 600;
    padding: 0 6px;
}

.fieldset-card {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.fieldset-legend {
    font-weight: 700;
    padding: 0 6px;
}

.detail-row--top {
    align-items: flex-start;
}

.detail-label--padded {
    padding-top: 4px;
}

.record-card {
    background: #f8fafc;
    padding: 10px 14px;
    margin: 8px 0;
}

.record-card--spaced {
    background: #f8fafc;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.record-line {
    margin: 0 0 4px;
    font-size: 14px;
}

.record-line--plain {
    margin: 0 0 4px;
}

.status-dot {
    color: #22c55e;
    font-size: 18px;
}

#receivements-filters-summary:empty,
#pending-sessions-filters-summary:empty {
    display: none;
}

#receivements-summary[hidden],
#room-grid-validation[hidden] {
    display: none;
}

#room-grid-validation:not([hidden]) {
    display: flex;
}

.password-requirements {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.password-requirements.is-collapsed {
    display: none;
}

.password-requirements__title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.password-requirements__list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 6px;
}

.password-requirement {
    position: relative;
    padding-left: 22px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

.password-requirement::before {
    content: '○';
    position: absolute;
    left: 0;
    top: 0;
    color: #94a3b8;
}

.password-requirement.is-met {
    color: #15803d;
}

.password-requirement.is-met::before {
    content: '●';
    color: #22c55e;
}

.nav-item--sub .nav-link--sub {
    padding-left: 2.75rem;
    font-size: 0.92rem;
}

.dashboard-section + .dashboard-section {
    margin-top: 1.25rem;
}

.dashboard-resumo-period-filter {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
}

.dashboard-resumo-period-filter label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.dashboard-resumo-month-picker {
    display: flex;
    gap: 8px;
}

.dashboard-resumo-month-picker .form-control {
    flex: 1 1 auto;
    min-width: 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.kpi-grid--finance {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.kpi-grid--finance .kpi-card {
    min-width: 0;
    overflow-wrap: break-word;
}

.kpi-grid--finance .kpi-card__label,
.kpi-grid--finance .kpi-card__hint {
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

.kpi-grid--finance .kpi-card__value,
.kpi-grid--finance .kpi-card__triple dd {
    white-space: nowrap;
}

.kpi-grid--finance .kpi-card__triple dt {
    white-space: normal;
    min-width: 0;
}

.kpi-grid--finance .kpi-card__triple div {
    flex-wrap: wrap;
    min-width: 0;
}

.kpi-grid--finance .kpi-rvg__item {
    min-width: 0;
}

.kpi-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.kpi-card--standalone {
    max-width: 320px;
}

.kpi-card__label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.kpi-card__value {
    font-size: 1.35rem;
    color: #0f172a;
}

.kpi-card__hint {
    font-size: 0.8rem;
    color: #64748b;
}

.kpi-card--tone-finance-highlight {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.kpi-card--tone-income {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.kpi-card--tone-income-muted {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.kpi-card--tone-expense {
    background: #fff1f2;
    border-color: #fecdd3;
}

.kpi-card--tone-expense-muted {
    background: #fff7ed;
    border-color: #fed7aa;
}

.kpi-card--tone-pending {
    background: #fffbeb;
    border-color: #fde68a;
}

.kpi-card--tone-neutral {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.kpi-card--tone-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.kpi-card--tone-warning {
    background: #fffbeb;
    border-color: #fde68a;
}

.kpi-card--tone-danger {
    background: #fff1f2;
    border-color: #fecdd3;
}

.kpi-card--tone-info {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.kpi-card--tone-attendance {
    background: #f0fdfa;
    border-color: #99f6e4;
}

.kpi-card--received-vs-generated {
    grid-column: 1 / -1;
}

.kpi-rvg__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.kpi-rvg__item {
    flex: 1 1 180px;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.75rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.kpi-rvg__item--generated {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.kpi-rvg__item--received {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.kpi-rvg__title {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.kpi-rvg__value {
    font-size: 1.25rem;
    color: #0f172a;
    font-weight: 700;
}

.kpi-rvg__hint {
    font-size: 0.78rem;
    color: #94a3b8;
    white-space: normal;
    line-height: 1.4;
}

.kpi-card--finance-triple .kpi-card__triple {
    display: grid;
    gap: 0.65rem;
    margin: 0.35rem 0 0;
}

.kpi-card__triple div {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.92rem;
}

.kpi-card__triple dt {
    color: #64748b;
    font-weight: 500;
}

.kpi-card__triple dd {
    margin: 0;
    font-weight: 600;
    color: #0f172a;
}

.dashboard-inline-link {
    margin-top: 0.75rem;
}

.section-card-header--actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bond-status-filter {
    max-width: 320px;
    margin-bottom: 1rem;
}

.prof-picker__form-group {
    margin-bottom: 0.5rem;
}

.prof-picker__input {
    width: 100%;
}

.prof-picker__status {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.prof-picker__results {
    max-height: 320px;
    overflow-y: auto;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
}

.prof-picker__empty {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    margin: 0;
}

.prof-picker__item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
}

.prof-picker__item:hover {
    background: #f9fafb;
}

.prof-picker__item--selected,
.prof-picker__item:has(input:checked) {
    background: #f0fdf4;
}

/* Sobrescreve `.form-group input { width: 100% }` — o picker vive dentro de form-group. */
.form-group .prof-picker__radio,
.prof-picker__radio {
    width: auto;
    min-width: 1.1rem;
    max-width: 1.1rem;
    min-height: auto;
    height: 1.1rem;
    margin: 0.2rem 0 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: #16a34a;
    cursor: pointer;
}

.prof-picker__item > span {
    flex: 1 1 auto;
    min-width: 0;
    line-height: 1.4;
}

.prof-picker__name {
    display: block;
    word-break: break-word;
}

.prof-picker__meta {
    display: block;
    color: #6b7280;
    word-break: break-word;
}

.agenda-shift-header {
    margin-top: 16px;
    margin-bottom: 8px;
}

.agenda-shared-slot-list {
    margin: 0 0 8px 18px;
}

.client-payment-info[hidden] {
    display: none !important;
}

.record-read-card {
    background: #f8fafc;
    padding: 12px 16px;
    margin-bottom: 16px;
}

.record-paragraph {
    margin: 0 0 6px;
}

.loading-inline {
    padding: 8px 0;
}

/* --- Loading global (anel B1) --- */
.app-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: none;
    place-items: center;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.app-loading-overlay.is-open {
    display: grid;
}

.app-loading-overlay__panel {
    display: grid;
    place-items: center;
    padding: 1.25rem;
}

.app-loading-ring {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(15, 23, 42, 0.12);
    border-top-color: var(--primary-navy);
    border-right-color: var(--accent-blue);
    animation: app-loading-spin 0.85s linear infinite;
}

@keyframes app-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-ring {
        animation-duration: 1.6s;
    }
}

body.app-loading-active {
    cursor: progress;
}

/* Rodapé legal do shell autenticado */
.app-legal-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    padding: 1.5rem 1rem 2rem;
    font-size: 0.8125rem;
}

.app-legal-footer a {
    color: #64748b;
    text-decoration: none;
}

.app-legal-footer a:hover {
    color: #334155;
    text-decoration: underline;
}

/* Aviso bloqueante de aceite dos documentos legais */
.legal-consent {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(3px);
    overflow-y: auto;
}

/* `display: flex` acima sobrescreve o [hidden] do UA; forçar ocultação. */
.legal-consent[hidden] {
    display: none !important;
}

.legal-consent__box {
    background: #ffffff;
    border-radius: 14px;
    max-width: 480px;
    width: 100%;
    padding: 1.75rem;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
    margin: auto;
}

.legal-consent__box h2 {
    margin: 0 0 0.85rem;
    font-size: 1.25rem;
    color: var(--primary-navy);
}

.legal-consent__box p {
    margin: 0 0 1rem;
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
}

.legal-consent__docs {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.legal-consent__docs a {
    display: block;
    padding: 0.7rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    background: #f8fafc;
    color: #0369a1;
    font-weight: 600;
    font-size: 0.925rem;
    text-decoration: none;
}

.legal-consent__docs a:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.legal-consent__note {
    font-size: 0.825rem !important;
    color: #64748b !important;
}

.legal-consent__error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c !important;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem !important;
}

.legal-consent__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
}

.legal-consent__decline {
    color: #64748b;
    font-size: 0.9rem;
    text-decoration: none;
}

.legal-consent__decline:hover {
    color: #334155;
    text-decoration: underline;
}

.legal-consent__accept {
    background: var(--form-submit-green);
    color: #ffffff;
    border: 0;
    border-radius: 9px;
    padding: 0.7rem 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.legal-consent__accept:hover:not(:disabled) {
    background: var(--form-submit-green-hover);
}

.legal-consent__accept:disabled {
    opacity: 0.65;
    cursor: progress;
}
