/* --- REGRA DE SEGURANÇA CRÍTICA --- */
/* Garante que elementos ocultos fiquem ocultos mesmo se o Tailwind falhar */
.hidden {
    display: none !important;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body { font-family: 'Figtree', system-ui, sans-serif; }

/* ========== Design system (padrão visual da aplicação) ========== */
:root {
    --brand-brown: #3f2a1f;
    --brand-olive: #6d7c4e;
    --brand-lime: #c6e03a;
    --brand-lime-deep: #9fbc1f;
    --ui-ink: #1f2937;
    --ui-muted: #6b7280;
    --ui-line: #e5e7eb;
    --ui-surface: #ffffff;
    --ui-bg: #f3f4f6;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --shadow-card: 0 10px 28px rgba(31, 41, 55, 0.08);
}

.page-title {
    margin: 0;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: clamp(1.5rem, 2.4vw, 1.9rem);
    font-weight: 800;
    color: var(--ui-ink);
    line-height: 1.15;
}
.req-star {
    color: #dc2626;
    font-weight: 800;
    margin-left: 0.15rem;
}
.field-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22) !important;
    background: #fef2f2 !important;
}
.field-group-invalid {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22);
    background: #fef2f2;
    border-radius: 0.65rem;
}
.client-field-error {
    border-color: #dc2626 !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.22) !important;
    background: #fef2f2 !important;
}

.page-subtitle {
    margin: 0;
    color: var(--ui-muted);
    font-size: 0.95rem;
}

.surface-card {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

/* Resumo Geral por Edição */
.edition-summary {
    background: var(--ui-surface);
    border: 1px solid var(--ui-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}
.edition-summary__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #f7f8f4;
    border-bottom: 1px solid var(--ui-line);
    border-left: 5px solid var(--brand-olive);
}
.edition-summary__title {
    margin: 0;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: clamp(1.05rem, 2.4vw, 1.25rem);
    font-weight: 800;
    color: var(--ui-ink);
    line-height: 1.2;
}
.edition-summary__body {
    padding: 0.9rem 1rem 1rem;
}
.edition-summary__group + .edition-summary__group {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
    border-top: 1px dashed var(--ui-line);
}
.edition-summary__group-title {
    margin: 0 0 0.5rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ui-muted);
}
.edition-summary__kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}
@media (min-width: 768px) {
    .edition-summary__kpis--area { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .edition-summary__kpis--money { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.edition-summary__kpi {
    min-height: 4.35rem;
    padding: 0.6rem 0.7rem;
    border-radius: 0.7rem;
    border: 1px solid var(--ui-line);
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
}
.edition-summary__kpi-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ui-muted);
}
.edition-summary__kpi-value {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--ui-ink);
    overflow-wrap: anywhere;
}
.edition-summary__kpi--total { border-left: 4px solid #374151; }
.edition-summary__kpi--available { border-left: 4px solid #dc2626; }
.edition-summary__kpi--available .edition-summary__kpi-value { color: #b91c1c; }
.edition-summary__kpi--sold { border-left: 4px solid #4f46e5; }
.edition-summary__kpi--sold .edition-summary__kpi-value { color: #4338ca; }
.edition-summary__kpi--contracted { border-left: 4px solid #15803d; }
.edition-summary__kpi--contracted .edition-summary__kpi-value { color: #166534; }
.edition-summary__kpi--received { border-left: 4px solid #1d4ed8; }
.edition-summary__kpi--received .edition-summary__kpi-value { color: #1e40af; }
.edition-summary__kpi--interest { border-left: 4px solid #7e22ce; }
.edition-summary__kpi--interest .edition-summary__kpi-value { color: #6b21a8; }
.edition-summary__kpi--pending { border-left: 4px solid #b45309; }
.edition-summary__kpi--pending .edition-summary__kpi-value { color: #92400e; }
.edition-summary__bar-wrap { margin-top: 0.6rem; }
.edition-summary__bar {
    height: 0.45rem;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}
.edition-summary__bar > span {
    display: block;
    height: 100%;
    max-width: 100%;
    background: var(--brand-olive);
    border-radius: inherit;
}
.edition-summary__bar-caption {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: var(--ui-muted);
}
.edition-summary__hidden {
    margin: 0;
    font-size: 0.9rem;
    color: var(--ui-muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: var(--radius-md);
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.1;
    padding: 0.7rem 1.1rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    min-height: 44px;
    touch-action: manipulation;
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: wait; }

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.82rem; min-height: 38px; }
.btn-block { width: 100%; }

/* Padrões por função:
 * primary  = ação principal (Salvar / Novo / Confirmar)
 * invite   = convite / enviar link / gerar acesso
 * success  = confirmar financeiro / reativar / ok positivo
 * warn     = voltar / fechar / cancelar e fechar / alerta
 * print    = credencial / imprimir / gerar termo
 * danger   = excluir / estornar / sair destrutivo
 * secondary= ações neutras destacadas
 */
.btn-primary {
    color: var(--brand-brown);
    background: linear-gradient(180deg, #d6ef55 0%, var(--brand-lime) 55%, var(--brand-lime-deep) 100%);
    box-shadow: 0 8px 18px rgba(120, 140, 30, 0.25);
}
.btn-secondary {
    color: #fff;
    background: linear-gradient(180deg, #7f8f5d 0%, var(--brand-olive) 55%, #556239 100%);
    box-shadow: 0 8px 16px rgba(109, 124, 78, 0.28);
}
.btn-secondary:hover { filter: brightness(1.05); }
.btn-invite {
    color: #fff;
    background: linear-gradient(180deg, #4f8cff 0%, #2563eb 55%, #1d4ed8 100%);
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.28);
}
.btn-success {
    color: #fff;
    background: linear-gradient(180deg, #34d399 0%, #16a34a 55%, #15803d 100%);
    box-shadow: 0 8px 16px rgba(22, 163, 74, 0.28);
}
.btn-warn {
    color: #fff;
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 55%, #b45309 100%);
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.28);
}
.btn-print {
    color: #fff;
    background: linear-gradient(180deg, #2dd4bf 0%, #0d9488 55%, #0f766e 100%);
    box-shadow: 0 8px 16px rgba(13, 148, 136, 0.28);
}
.btn-danger {
    color: #fff;
    background: linear-gradient(180deg, #f87171 0%, #dc2626 55%, #b91c1c 100%);
    box-shadow: 0 8px 16px rgba(220, 38, 38, 0.22);
}
.btn-neutral {
    color: #1f2937;
    background: #e5e7eb;
    box-shadow: 0 4px 10px rgba(31, 41, 55, 0.08);
}
.btn-neutral:hover { background: #d1d5db; }
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid rgba(180, 83, 9, 0.35);
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 55%, #b45309 100%);
    color: #fff;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-weight: 700;
    font-size: 0.88rem;
    min-height: 42px;
    box-shadow: 0 8px 16px rgba(217, 119, 6, 0.28);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, filter 0.15s ease;
}
.btn-back:hover {
    filter: brightness(1.05);
    border-color: rgba(180, 83, 9, 0.6);
    transform: translateX(-2px);
}

.ui-input {
    border: 1px solid #d1d5db;
    border-radius: var(--radius-md);
    padding: 0.7rem 0.85rem;
    font-size: 0.95rem;
    min-height: 44px;
    background: #fff;
    outline: none;
}
.ui-input:focus {
    border-color: var(--brand-lime-deep);
    box-shadow: 0 0 0 3px rgba(198, 224, 58, 0.28);
}

.file-actions {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(109, 124, 78, 0.25);
    background: #eef4df;
    color: #3f2a1f;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-icon:hover {
    background: #dfe8c8;
    color: #1d4ed8;
    border-color: #93c5fd;
}
.btn-icon:disabled {
    opacity: 0.55;
    cursor: wait;
}
.btn-icon-print { background: #ccfbf1; color: #0f766e; border-color: #99f6e4; }
.btn-icon-print:hover { background: #99f6e4; color: #115e59; border-color: #5eead4; }
.btn-icon-email { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }
.btn-icon-email:hover { background: #c7d2fe; color: #312e81; border-color: #a5b4fc; }
.btn-icon-whatsapp { background: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.btn-icon-whatsapp:hover { color: #166534; background: #bbf7d0; border-color: #86efac; }
.btn-icon-save { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.btn-icon-save:hover { background: #fde68a; color: #92400e; border-color: #fcd34d; }
.btn-icon-danger { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.btn-icon-danger:hover { color: #991b1b; background: #fecaca; border-color: #fca5a5; }
.btn-icon-edit { background: #dbeafe; color: #1d4ed8; border-color: #bfdbfe; }
.btn-icon-edit:hover { background: #bfdbfe; color: #1e40af; }
.btn-icon-replace { background: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.btn-icon-replace:hover { background: #ddd6fe; color: #5b21b6; border-color: #c4b5fd; }

.credential-name-item .credential-name-check {
    width: 1.05rem;
    height: 1.05rem;
    flex-shrink: 0;
    accent-color: var(--brand-olive, #5c6b3a);
}
.credential-name-input[readonly] {
    background: #f9fafb;
    color: #111827;
}
#credentialSelectAll {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--brand-olive, #5c6b3a);
}

/* Sidebar alinhada ao padrão */
.sidebar-btn {
    border-radius: var(--radius-md) !important;
    transition: background 0.15s ease, transform 0.15s ease !important;
}
.sidebar-btn:hover { transform: translateX(2px); }

/* ========== Portal do cliente (hub) ========== */
.client-portal-shell {
    animation: portalRise 0.45s ease both;
}
.portal-hub-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.9rem;
}
@media (min-width: 720px) {
    .portal-hub-grid { grid-template-columns: 1fr; max-width: 42rem; }
}
.portal-hub-grid--admin {
    max-width: 64rem;
}
@media (min-width: 720px) {
    .portal-hub-grid--admin { grid-template-columns: 1fr 1fr; max-width: 64rem; }
    .portal-hub-grid--admin .sistema-hub-imports,
    .portal-hub-grid--admin .sistema-hub-finance {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.9rem;
        align-items: start;
    }
    .portal-hub-grid--admin .sistema-hub-finance-side {
        display: grid;
        gap: 0.9rem;
    }
}
.portal-hub-copy {
    min-width: 0;
}
.portal-hub-card {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    text-align: left;
    border: 1px solid var(--ui-line);
    background: var(--ui-surface);
    border-radius: 1.15rem;
    padding: 1.15rem 1.2rem;
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.portal-hub-card:hover {
    transform: translateY(-2px);
    border-color: rgba(109, 124, 78, 0.45);
    box-shadow: 0 16px 34px rgba(31, 41, 55, 0.12);
}
.portal-hub-card:active { transform: translateY(0); }
.portal-hub-icon {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 0.95rem;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}
.portal-hub-card--cadastro .portal-hub-icon { background: linear-gradient(160deg, #3f2a1f, #5a4030); color: var(--brand-lime); }
.portal-hub-card--qr .portal-hub-icon { background: linear-gradient(160deg, #4f6b2f, #6d7c4e); }
.portal-hub-card--docs .portal-hub-icon { background: linear-gradient(160deg, #8a6a28, #b0892e); }
.portal-hub-card--creds .portal-hub-icon { background: linear-gradient(160deg, #0f766e, #14b8a6); }
.portal-hub-card--finance .portal-hub-icon { background: linear-gradient(160deg, #1d4ed8, #3b82f6); }
.portal-hub-label {
    display: block;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--ui-ink);
    line-height: 1.2;
}
.portal-hub-desc {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.88rem;
    color: var(--ui-muted);
}
.portal-hub-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-olive);
    white-space: nowrap;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(109, 124, 78, 0.1);
}
.portal-hub-card:hover .portal-hub-cta {
    background: rgba(198, 224, 58, 0.28);
    color: var(--brand-brown);
}

#loginScreen, #registrationScreen {
    padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* ========== Portal de abertura ========== */
.portal-screen {
    --portal-brown: #3f2a1f;
    --portal-brown-soft: rgba(63, 42, 31, 0.78);
    --portal-olive: #6d7c4e;
    --portal-lime: #c6e03a;
    --portal-lime-deep: #9fbc1f;
    --portal-glass: rgba(255, 252, 246, 0.78);
    --portal-glass-border: rgba(255, 255, 255, 0.55);
    --portal-text: #2c2118;
    --portal-muted: #5c5348;
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.portal-bg {
    position: absolute;
    inset: 0;
    background:
        url('assets/portal-bg.png?v=20260911e') center center / cover no-repeat;
    transform: none;
}

.portal-veil {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(40, 28, 18, 0.28) 0%, rgba(70, 85, 45, 0.18) 42%, rgba(255, 255, 255, 0.08) 100%),
        radial-gradient(ellipse at 18% 12%, rgba(198, 224, 58, 0.12), transparent 42%);
    pointer-events: none;
}

.portal-grain {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.07;
    background-image: radial-gradient(rgba(255,255,255,0.55) 0.6px, transparent 0.6px);
    background-size: 3px 3px;
    mix-blend-mode: soft-light;
}

.portal-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
    padding: 1.25rem 1rem 2rem;
}

.portal-shell--single {
    width: min(980px, 100%);
    min-height: 100%;
    justify-content: center;
    align-items: stretch;
    gap: 1.75rem;
}

.portal-hero {
    max-width: 40rem;
    animation: portalRise 0.7s ease both;
}

.portal-shell--single .portal-hero {
    max-width: none;
    text-align: left;
}

.portal-logo {
    display: block;
    width: clamp(5.5rem, 16vw, 7.5rem);
    height: auto;
    margin: 0 0 0.85rem;
    border-radius: 50%;
    box-shadow: 0 10px 28px rgba(20, 12, 6, 0.35);
    background: transparent;
}

.portal-brand {
    margin: 0 0 0.85rem;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2.35rem, 5.4vw, 3.75rem);
    font-weight: 800;
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: #fff;
    text-shadow:
        0 2px 0 rgba(63, 42, 31, 0.18),
        0 12px 36px rgba(20, 12, 6, 0.45);
}

/* Fechar câmera / painel de leitura QR — alto contraste */
.btn-qr-close {
    color: #fff !important;
    background: linear-gradient(180deg, #f87171 0%, #dc2626 55%, #b91c1c 100%) !important;
    box-shadow: 0 8px 16px rgba(220, 38, 38, 0.28) !important;
    font-weight: 800;
    min-height: 42px;
    padding: 0.55rem 1.1rem;
}
.btn-qr-close:hover { filter: brightness(1.05); }

.portal-title {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.45rem, 2.8vw, 2rem);
    font-weight: 700;
    line-height: 1.15;
    color: rgba(255, 252, 245, 0.96);
    text-shadow: 0 2px 16px rgba(30, 20, 12, 0.35);
}

.portal-audiences {
    margin: 0.55rem 0 0;
    color: rgba(255, 250, 242, 0.9);
    font-size: clamp(0.98rem, 1.6vw, 1.12rem);
    font-weight: 500;
    max-width: 34rem;
    text-shadow: 0 1px 10px rgba(30, 20, 12, 0.28);
}

.portal-role-rail {
    list-style: none;
    margin: 1.15rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.portal-role-rail li {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 252, 246, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.portal-role-rail i {
    color: var(--portal-lime);
    font-size: 0.78rem;
}
.portal-event-note {
    margin: 0.85rem 0 0;
    max-width: 36rem;
    color: #fff8e7;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    text-shadow: 0 1px 10px rgba(30, 20, 12, 0.28);
}
.portal-event-note--detail {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.45;
    color: rgba(255, 248, 231, 0.92);
}

.portal-login-stage {
    width: min(26.5rem, 100%);
    animation: portalRise 0.85s ease both;
    animation-delay: 0.08s;
}

.portal-login-panel {
    position: relative;
    border-radius: 1.35rem;
    padding: 1.35rem 1.3rem 1.2rem;
    background: linear-gradient(165deg, rgba(255, 252, 246, 0.9), rgba(255, 255, 255, 0.78));
    border: 1px solid rgba(255, 255, 255, 0.62);
    box-shadow:
        0 22px 50px rgba(40, 28, 18, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
}

.portal-login-panel::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--portal-brown), var(--portal-lime), var(--portal-olive));
}

.portal-panel-head {
    margin-bottom: 0.85rem;
}

.portal-panel-head h2 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--portal-text);
}

.portal-panel-head p {
    margin: 0.25rem 0 0;
    font-size: 0.86rem;
    color: var(--portal-muted);
}

.portal-login-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.portal-label {
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--portal-brown);
}

.portal-label input {
    width: 100%;
    border: 1px solid rgba(63, 42, 31, 0.16);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 0.75rem;
    padding: 0.78rem 0.9rem;
    font-size: 0.98rem;
    color: var(--portal-text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.portal-label input:focus {
    border-color: var(--portal-lime-deep);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(198, 224, 58, 0.28);
}

.portal-password-wrap {
    position: relative;
    display: block;
}

.portal-password-wrap input {
    padding-right: 3.1rem;
}

/* Windows/Edge/Chrome: esconde o olho nativo — o app já tem o botão próprio */
.portal-password-wrap input::-ms-reveal,
.portal-password-wrap input::-ms-clear {
    display: none;
}
.portal-password-wrap input::-webkit-credentials-auto-fill-button,
.portal-password-wrap input::-webkit-strong-password-auto-fill-button {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    margin: 0;
    width: 0;
    height: 0;
}

.portal-pass-toggle {
    position: absolute;
    right: 0.2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 0.6rem;
    background: rgba(255, 255, 255, 0.75);
    color: var(--portal-olive);
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 5;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.portal-pass-toggle:hover,
.portal-pass-toggle:active {
    background: rgba(109, 124, 78, 0.16);
    color: var(--portal-brown);
}

#registrationForm .portal-pass-toggle {
    color: #4b5563;
    background: transparent;
}

#registrationForm .portal-pass-toggle:hover,
#registrationForm .portal-pass-toggle:active {
    background: rgba(75, 85, 99, 0.12);
    color: #111827;
}

/* Lista de clientes: 1ª coluna cresce com o maior nome; linhas sem quebra (mais por página) */
.clients-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.clients-table {
    display: table;
    width: max-content;
    min-width: 100%;
    border-collapse: collapse;
}
.clients-table-row {
    display: table-row;
}
.clients-table-row > div {
    display: table-cell;
    vertical-align: middle;
    border-bottom: 1px solid #e5e7eb;
}
.clients-table-head > div {
    background: #f9fafb;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #4b5563;
    border-bottom: 1px solid #e5e7eb;
}
.clients-col-check {
    padding: 0.75rem 0.85rem;
    text-align: center;
    width: 3rem;
    min-width: 3rem;
    border-right: 2px solid #d1d5db;
}
.clients-col-check input[type="checkbox"] {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0;
    cursor: pointer;
    accent-color: var(--brand-olive, #6d7c4e);
    vertical-align: middle;
}
.clients-bulk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
}
.clients-bulk-bar-copy {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 12rem;
    flex: 1;
}
.clients-bulk-bar .btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}
.clients-col-name {
    padding: 0.85rem 1rem;
    border-right: 2px solid #d1d5db;
    white-space: normal;
    min-width: 12rem;
}
.clients-col-name .font-medium {
    white-space: nowrap;
}
.clients-col-name .text-sm {
    white-space: nowrap;
}
.registry-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
    white-space: normal;
    max-width: 36rem;
}
.registry-tag {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    white-space: normal;
}
.registry-tag-pending {
    background: #fef3c7;
    color: #92400e;
}
.registry-tag-invite {
    background: #e0f2fe;
    color: #075985;
}
.registry-tag-doc {
    background: #ffe4e6;
    color: #9f1239;
}
.registry-tag-ok {
    background: #dcfce7;
    color: #166534;
}
.registry-tag-dup {
    background: #ffedd5;
    color: #9a3412;
}
.registry-tag-alert {
    background: #fecaca;
    color: #991b1b;
}
.clients-col-action {
    padding: 0.65rem 0.85rem;
    text-align: center;
    border-right: 2px solid #d1d5db;
    white-space: nowrap;
    width: 1%;
}
.clients-col-action:last-child {
    border-right: 0;
}
.clients-table-head .clients-col-docs {
    white-space: normal;
    max-width: 12.5rem;
    line-height: 1.25;
    text-align: center;
    vertical-align: middle;
}
.view-portal-docs-btn {
    white-space: normal;
    line-height: 1.2;
    max-width: 12.5rem;
}
.clients-table-row:hover > div {
    background: #f9fafb;
}

.portal-submit {
    margin-top: 0.2rem;
    width: 100%;
    border: 0;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--portal-brown);
    background: linear-gradient(180deg, #d6ef55 0%, var(--portal-lime) 55%, var(--portal-lime-deep) 100%);
    box-shadow: 0 12px 26px rgba(120, 140, 30, 0.3);
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.portal-submit:hover:not(:disabled) {
    filter: brightness(1.03);
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(120, 140, 30, 0.36);
}

.portal-submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

.portal-precadastro-wrap {
    margin-top: 1rem;
    padding-top: 0.95rem;
    border-top: 1px dashed rgba(63, 42, 31, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}
.portal-precadastro-or {
    margin: 0;
    text-align: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #5b4636;
}
.portal-precadastro-btn {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 0.9rem;
    padding: 0.85rem 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    color: #3f2a1f;
    background: linear-gradient(180deg, #fde047 0%, #facc15 45%, #eab308 100%);
    box-shadow: 0 12px 24px rgba(202, 138, 4, 0.38);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}
.portal-precadastro-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.portal-precadastro-btn i {
    color: #3f2a1f;
    font-size: 1.1rem;
}
.btn-cancel-close {
    white-space: nowrap;
    flex-shrink: 0;
}
.form-actions-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* Cabeçalho estático em páginas e modais com lista/conteúdo rolável */
.page-sticky-head {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.65rem 0;
    background: #f3f4f6;
    box-shadow: 0 8px 14px -10px rgba(20, 12, 6, 0.28);
}
.page-sticky-head--card {
    background: #fff;
    margin: -0.25rem -0.25rem 0.85rem;
    padding: 0.65rem 0.25rem;
}
.modal-sticky-head {
    position: sticky;
    top: 0;
    z-index: 6;
    flex-shrink: 0;
    background: #fff;
    padding-top: 0.15rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.25rem;
    box-shadow: 0 10px 16px -12px rgba(20, 12, 6, 0.35);
}
.secret-mask,
input.secret-mask {
    -webkit-text-security: disc;
}
.boleto-open-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    min-width: 0;
    background: transparent;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.boleto-tag {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border-radius: 999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.boleto-tag--pago {
    background: #dcfce7;
    color: #166534;
}
.boleto-tag--pendente {
    background: #fef3c7;
    color: #92400e;
}
.boleto-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.precadastro-overlay {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
    background: rgba(20, 12, 6, 0.62);
    overflow-y: auto;
}
.precadastro-overlay.hidden { display: none !important; }
.precadastro-sheet {
    width: min(48rem, 100%);
    margin: 0.5rem auto;
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 22px 48px rgba(20, 12, 6, 0.32);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 1.5rem);
}
.precadastro-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1.1rem 1.15rem 0.85rem;
    border-bottom: 1px solid #e5e7eb;
}
.precadastro-head h2 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    color: #1f2937;
}
.precadastro-head p {
    margin: 0.35rem 0 0;
    font-size: 0.86rem;
    color: #6b7280;
}
.precadastro-body {
    padding: 1rem 1.15rem 1.25rem;
    overflow-y: auto;
}

.portal-forgot {
    border: 0;
    background: transparent;
    color: var(--portal-olive);
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 0.25rem;
    align-self: center;
}

.portal-forgot:hover {
    color: var(--portal-brown);
}

.portal-forgot:disabled {
    opacity: 0.65;
    cursor: wait;
}

.portal-install-bar {
    position: sticky;
    bottom: 0;
    z-index: 5;
    margin-top: auto;
    padding: 0.65rem 0 calc(0.35rem + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(30, 22, 14, 0) 0%, rgba(30, 22, 14, 0.45) 35%, rgba(30, 22, 14, 0.55) 100%);
}
.portal-install-btn {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 0.85rem;
    padding: 0.85rem 1rem;
    min-height: 48px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    color: #facc15;
    background: linear-gradient(180deg, #7f8f5d 0%, var(--portal-olive) 55%, #556239 100%);
    box-shadow: 0 10px 22px rgba(63, 42, 31, 0.28);
    cursor: pointer;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    transition: transform 0.15s ease, filter 0.15s ease;
    visibility: visible !important;
    opacity: 1 !important;
}
.portal-install-btn.hidden {
    /* Nunca esconder no mobile por engano — só some em standalone via JS + display */
}
.portal-install-btn.is-standalone-hidden,
.portal-install-bar.is-standalone-hidden {
    display: none !important;
}
.portal-install-btn:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.portal-install-btn i {
    color: #fde047;
}
@media (max-width: 899px) {
    .portal-shell--single {
        justify-content: flex-start;
        gap: 1rem;
        padding-bottom: 0.5rem;
        min-height: 100%;
    }
    .portal-hero {
        margin-top: 0.25rem;
    }
    .portal-role-rail {
        margin-top: 0.75rem;
    }
    .portal-install-bar {
        position: sticky;
        bottom: 0;
        margin-top: 0.75rem;
    }
}

.pwa-help-overlay {
    position: fixed;
    inset: 0;
    z-index: 140;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(20, 12, 6, 0.55);
}
.pwa-help-overlay.hidden { display: none !important; }
.pwa-help-card {
    width: min(28rem, 100%);
    background: #fff;
    border-radius: 1rem;
    padding: 1.1rem 1.15rem 1rem;
    box-shadow: 0 18px 40px rgba(20, 12, 6, 0.28);
}
.pwa-help-card h3 {
    margin: 0 0 0.65rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    color: #3f2a1f;
}
.pwa-help-body {
    color: #374151;
    font-size: 0.92rem;
    line-height: 1.45;
    margin-bottom: 0.9rem;
}
.pwa-help-body ol {
    margin: 0.5rem 0 0.75rem 1.1rem;
    padding: 0;
}
.pwa-help-body li { margin: 0.25rem 0; }
.pwa-help-note {
    margin: 0.5rem 0 0;
    font-size: 0.82rem;
    color: #6b7280;
}

.portal-error {
    font-size: 0.95rem;
    font-weight: 800;
    text-align: center;
    color: #b91c1c;
    background: rgba(254, 226, 226, 0.98);
    border: 1px solid rgba(185, 28, 28, 0.35);
    border-radius: 0.7rem;
    padding: 0.7rem 0.85rem;
}
.portal-error.hidden {
    display: none !important;
}

.portal-trust-line {
    margin: 0.85rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    color: rgba(255, 250, 242, 0.88);
    font-size: 0.78rem;
    font-weight: 600;
    text-shadow: 0 1px 8px rgba(20, 12, 6, 0.35);
}

.portal-trust-line i {
    color: var(--portal-lime);
}

@keyframes portalRise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Visualização / impressão embutida (mobile & tablet) */
body.file-preview-open {
    overflow: hidden;
}
.file-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
    background: rgba(30, 22, 14, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.file-preview-overlay.hidden {
    display: none !important;
}
.file-preview-sheet {
    width: min(1100px, 100%);
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 20px 50px rgba(20, 12, 6, 0.28);
}
.file-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(180deg, #f7f8f2 0%, #ffffff 100%);
    flex-shrink: 0;
}
.file-preview-title {
    margin: 0;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 0.98rem;
    font-weight: 800;
    color: #3f2a1f;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-preview-actions {
    display: flex;
    gap: 0.45rem;
    flex-shrink: 0;
}
.file-preview-body {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #f3f4f6;
}
.file-preview-html {
    padding: 1rem;
    background: #fff;
    min-height: 100%;
    color: #1f2937;
    font-size: 12px;
    line-height: 1.35;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}
.file-preview-html .report-header { margin: 0 0 10px; padding: 0 0 8px; border-bottom: 2px solid #111827; }
.file-preview-html .report-kicker { margin: 0 0 2px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; }
.file-preview-html .report-title { margin: 0 0 4px; font-size: 1.15rem; line-height: 1.2; font-weight: 800; color: #111827; }
.file-preview-html .report-subtitle { margin: 0 0 6px; font-size: 0.9rem; color: #374151; }
.file-preview-html .report-meta { width: 100%; border-collapse: collapse; margin: 0 0 8px; }
.file-preview-html .report-meta th { width: 1%; white-space: nowrap; text-align: left; font-weight: 600; color: #4b5563; padding: 1px 10px 1px 0; border: 0; background: transparent; }
.file-preview-html .report-meta td { padding: 1px 0; border: 0; }
.file-preview-html .report-edition-title {
    font-size: 1.05rem; font-weight: 800; margin: 0 0 8px; padding: 0 0 4px;
    border-bottom: 2px solid #111827;
}
.file-preview-html .report-block { margin: 0 0 10px; padding: 8px 10px 10px; border: 1px solid #d1d5db; border-radius: 3px; }
.file-preview-html .report-block-title {
    margin: -8px -10px 8px; padding: 6px 10px; font-size: 0.78rem; font-weight: 800;
    letter-spacing: 0.04em; text-transform: uppercase;
}
.file-preview-html .report-block--summary { background: #f8fafc; border-color: #cbd5e1; }
.file-preview-html .report-block--summary .report-block-title { background: #1f2937; color: #fff; }
.file-preview-html .report-block--overdue { background: #fff7f7; border-color: #f3c4c4; border-left: 5px solid #b91c1c; }
.file-preview-html .report-block--overdue .report-block-title { background: #b91c1c; color: #fff; }
.file-preview-html .report-block--upcoming,
.file-preview-html .report-block--list { background: #f7f8f4; border-color: #c5cdb0; border-left: 5px solid #6d7c4e; }
.file-preview-html .report-block--upcoming .report-block-title,
.file-preview-html .report-block--list .report-block-title { background: #6d7c4e; color: #fff; }
.file-preview-html .report-block--cards { background: #f5f8ff; border-color: #c7d2fe; border-left: 5px solid #1d4ed8; }
.file-preview-html .report-block--cards .report-block-title { background: #1d4ed8; color: #fff; }
.file-preview-html .status-paid { color: #15803d; font-weight: 700; }
.file-preview-html .status-pending { color: #b45309; font-weight: 700; }
.file-preview-html .status-cancelled { color: #dc2626; font-weight: 700; }
.file-preview-html .status-frozen { color: #b45309; font-weight: 700; }
.file-preview-html .report-client { margin: 0 0 8px; padding: 6px 8px 8px; background: #fff; border: 1px solid #e5e7eb; }
.file-preview-html .report-block--overdue .report-client { border-left: 3px solid #dc2626; }
.file-preview-html .report-block--upcoming .report-client { border-left: 3px solid #6d7c4e; }
.file-preview-html .report-client-k { margin: 0; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #6b7280; }
.file-preview-html .report-client-title { margin: 0 0 4px; font-size: 0.95rem; font-weight: 800; color: #111827; }
.file-preview-html .report-client-sub { margin: 0 0 4px; font-size: 0.85rem; color: #4b5563; }
.file-preview-doc-title {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    font-weight: 800;
    color: #1f2937;
}
.file-preview-html table {
    border-collapse: collapse;
    width: 100%;
    font-size: 11px;
    background: #fff;
}
.file-preview-html td,
.file-preview-html th {
    border: 1px solid #e5e7eb;
    padding: 4px 6px;
    vertical-align: top;
}
.file-preview-html th {
    background: #f3f4f6;
}
.file-preview-html .report-meta th,
.file-preview-html .report-meta td {
    border: 0;
    background: transparent;
}
.file-preview-pdf {
    width: 100%;
    height: 100%;
    border: 0;
    background: #525659;
}
.file-preview-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1rem auto;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

@media print {
    body.file-preview-open .file-preview-header,
    body.file-preview-open .file-preview-overlay {
        background: #fff !important;
        backdrop-filter: none !important;
    }
    body.file-preview-open .file-preview-header { display: none !important; }
    body.file-preview-open .file-preview-overlay {
        position: static;
        padding: 0;
    }
    body.file-preview-open .file-preview-sheet { box-shadow: none; width: 100%; height: auto; }
}

@media (min-width: 900px) {
    .portal-shell--single {
        display: grid;
        grid-template-columns: 1.15fr 0.85fr;
        align-items: center;
        gap: 2.5rem;
        padding: 2rem 1.5rem;
    }
    .portal-login-stage {
        width: 100%;
        justify-self: end;
    }
}

@media (max-width: 899px) {
    .portal-shell--single {
        justify-content: flex-start;
        padding-top: max(1.25rem, env(safe-area-inset-top));
    }
    .portal-login-stage {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portal-bg,
    .portal-hero,
    .portal-login-stage {
        animation: none !important;
    }
}

body.mobile-nav-lock {
    overflow: hidden;
}

/* Barras de rolagem personalizadas */
.sidebar-scroll::-webkit-scrollbar, .main-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb, .main-scroll::-webkit-scrollbar-thumb { background: #4a5568; border-radius: 10px; }
.sidebar-scroll::-webkit-scrollbar-track, .main-scroll::-webkit-scrollbar-track { background: #2d3748; }

/* Sidebar base (desktop) */
.app-sidebar {
    width: 20rem; /* w-80 */
    flex-shrink: 0;
}

/* Topbar mobile — oculta no desktop */
.mobile-topbar {
    display: none;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
    background: #1f2937;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 40;
    border-bottom: 1px solid #374151;
}
.mobile-topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
}
.mobile-menu-btn {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    background: #374151;
    color: #fff;
    font-size: 1.15rem;
}
.mobile-menu-btn:active {
    background: #4b5563;
}

.sidebar-overlay {
    display: none;
}

/* Cores base para os botões da barra lateral */
.sidebar-btn {
    transition: background-color 0.3s, transform 0.2s;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}
.sidebar-btn:hover {
    transform: scale(1.02);
}

#editionsBtn { background-color: #2dd4bf; } /* Teal */
#clientsBtn { background-color: #60a5fa; } /* Blue */
#attendeesBtn { background-color: #f97316; } /* Orange — destaque Lojistas/Visitantes */
#billingBtn { background-color: #f472b6; } /* Pink */
#reportsBtn { background-color: #a78bfa; } /* Purple */
#sistemaBtn { background-color: #facc15; } /* Yellow */
#eventAccessBtn { background-color: #34d399; color: #064e3b; } /* Emerald — acessos evento */

#editionsBtn:hover { background-color: #14b8a6; }
#clientsBtn:hover { background-color: #3b82f6; }
#attendeesBtn:hover { background-color: #ea580c; }
#billingBtn:hover { background-color: #ec4899; }
#reportsBtn:hover { background-color: #8b5cf6; }
#sistemaBtn:hover { background-color: #eab308; }
#eventAccessBtn:hover { background-color: #10b981; color: #fff; }

/* Estilo do botão ativo - mais escuro e com borda */
.sidebar-btn-active {
    background-color: #0d9488 !important;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.2);
}
#clientsBtn.sidebar-btn-active { background-color: #2563eb !important; }
#attendeesBtn.sidebar-btn-active { background-color: #c2410c !important; }
#billingBtn.sidebar-btn-active { background-color: #db2777 !important; }
#reportsBtn.sidebar-btn-active { background-color: #7c3aed !important; }
#sistemaBtn.sidebar-btn-active { background-color: #ca8a04 !important; }
#eventAccessBtn.sidebar-btn-active { background-color: #059669 !important; color: #fff !important; }

/* Busca padronizada (ícone + padding para não sobrepor o placeholder) */
.ui-search-wrap {
    position: relative;
}
.ui-search-wrap > .ui-search-icon {
    position: absolute;
    left: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
    font-size: 0.95rem;
}
.ui-search-wrap > .ui-input,
.ui-search-wrap > input[type="text"],
.ui-search-wrap > input[type="search"] {
    padding-left: 2.75rem !important;
}

/* Portais (cliente/lojista/visitante): sem menu lateral — esconde hamburger */
#app.portal-mode .mobile-topbar {
    display: none !important;
}

/* --- Layout celular / tablet --- */
@media (max-width: 1023px) {
    #app {
        position: relative;
    }

    .mobile-topbar {
        display: flex;
    }

    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(20rem, 88vw);
        z-index: 70;
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 4px 0 24px rgba(0,0,0,0.35);
    }

    #app.sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 65;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-sidebar-title {
        padding-top: calc(0.5rem + env(safe-area-inset-top, 0px));
    }

    #mainContent {
        width: 100%;
        max-width: 100vw;
    }

    #pageContent {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .portal-hub-card {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }
    .portal-hub-cta {
        grid-column: 2;
        justify-self: start;
        margin-top: 0.35rem;
        white-space: normal;
    }
    .portal-hub-label,
    .portal-hub-desc {
        overflow-wrap: anywhere;
    }
    .sistema-hub-imports,
    .sistema-hub-finance,
    .sistema-hub-finance-side {
        display: grid;
        gap: 0.9rem;
    }

    /* Formulários e edição: a tela inteira rola, o conteúdo não fica cortado */
    #clientModal,
    #lojistaModal,
    #visitanteModal,
    #editionFormModal,
    #editionListModal,
    #contractModal,
    #paymentModal,
    #editInstallmentModal,
    #inviteClientModal,
    #inviteAttendeeModal {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem 0.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    #clientModal > div,
    #contractModal > div,
    #extraDatesModal > div,
    #editionFormModal > div,
    #editionListModal > div,
    #paymentModal > div,
    #editInstallmentModal > div,
    #inviteClientModal > div,
    #inviteAttendeeModal > div,
    #adminPermissionsModal > div,
    #shareLinkModal > div,
    #genericModal > div,
    #lojistaModal > div,
    #visitanteModal > div {
        width: calc(100% - 0.25rem) !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0.25rem auto 1.25rem !important;
    }
    #clientModal > div > .modal-sticky-head,
    #lojistaModal > div > .modal-sticky-head,
    #visitanteModal > div > .modal-sticky-head,
    #editionFormModal > div > .modal-sticky-head,
    #editionListModal > div > .modal-sticky-head,
    #contractModal > div > .modal-sticky-head,
    #extraDatesModal > div > .modal-sticky-head,
    #installmentsPreviewModal > div > .modal-sticky-head,
    #adminPermissionsModal > div > .modal-sticky-head,
    #shareLinkModal > div > .modal-sticky-head {
        position: sticky !important;
        top: 0 !important;
        z-index: 8;
        background: #fff;
    }
    #clientModal > div > .overflow-y-auto,
    #lojistaModal > div > .overflow-y-auto,
    #visitanteModal > div > .overflow-y-auto,
    #contractModal > div > .overflow-y-auto {
        overflow: visible !important;
        max-height: none !important;
    }
    #clientModal > div > .flex,
    #lojistaModal > div > .flex,
    #visitanteModal > div > .flex,
    #editionFormModal > div > .flex {
        flex-wrap: wrap;
    }
    .form-actions-bar {
        width: 100%;
        justify-content: flex-start;
    }

    #lojistasTableContainer > div,
    #visitantesTableContainer > div {
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    #toastContainer {
        left: 1rem !important;
        right: 1rem !important;
        bottom: calc(1rem + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* Tablet deitado: os mesmos formulários precisam rolar a tela inteira */
@media (min-width: 1024px) and (max-width: 1400px) {
    #clientModal,
    #lojistaModal,
    #visitanteModal,
    #editionFormModal,
    #editionListModal,
    #contractModal,
    #paymentModal,
    #editInstallmentModal,
    #inviteClientModal,
    #inviteAttendeeModal {
        align-items: flex-start !important;
        justify-content: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0.75rem 0.5rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    #clientModal > div,
    #lojistaModal > div,
    #visitanteModal > div,
    #editionFormModal > div,
    #editionListModal > div,
    #contractModal > div {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }
    #clientModal > div > .overflow-y-auto,
    #lojistaModal > div > .overflow-y-auto,
    #visitanteModal > div > .overflow-y-auto {
        overflow: visible !important;
        max-height: none !important;
    }
}

/* Toasts (Notificações) */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: white;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease-out;
    max-width: min(24rem, calc(100vw - 2rem));
    pointer-events: auto;
}
.toast.show {
    opacity: 1;
    transform: translateY(0);
}
.toast-success { background-color: #10B981; }
.toast-error { background-color: #EF4444; }

/* QR reader video fills container on mobile */
#qrReader video,
#qrReader canvas {
    max-width: 100% !important;
    border-radius: 0.5rem;
}

/* Estilos de Impressão */
@media print {
    body * {
        visibility: hidden;
    }
    #print-area, #print-area * {
        visibility: visible;
    }
    #print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }
    .mobile-topbar, .app-sidebar, .sidebar-overlay {
        display: none !important;
    }
}

/* ========== PWA install banner ========== */
.pwa-install-banner {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 120;
    width: min(26rem, calc(100% - 1.5rem));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    background: rgba(255, 252, 246, 0.96);
    border: 1px solid rgba(63, 42, 31, 0.14);
    box-shadow: 0 16px 40px rgba(30, 20, 12, 0.28);
    animation: portalRise 0.35s ease both;
}
.pwa-install-copy {
    flex: 1 1 12rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.pwa-install-copy strong {
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 0.95rem;
    color: #3f2a1f;
}
.pwa-install-copy span {
    font-size: 0.8rem;
    color: #5c5348;
    line-height: 1.35;
}
.pwa-install-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}
.pwa-install-btn {
    border: 0;
    border-radius: 0.7rem;
    padding: 0.55rem 0.9rem;
    font-weight: 800;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 0.85rem;
    color: #3f2a1f;
    background: linear-gradient(180deg, #d6ef55 0%, #c6e03a 55%, #9fbc1f 100%);
    cursor: pointer;
}
.pwa-install-dismiss {
    border: 0;
    background: transparent;
    color: #6d7c4e;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
}
@media (display-mode: standalone) {
    .pwa-install-banner { display: none !important; }

    /* Evita tarja clara / metade da tela (body cinza + 100vh errado no PWA) */
    html, body {
        height: 100%;
        min-height: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        background: #3f2a1f !important;
    }
    .portal-screen {
        height: 100%;
        height: 100dvh;
        height: -webkit-fill-available;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
    .portal-bg,
    .portal-veil,
    .portal-grain {
        top: calc(-1 * env(safe-area-inset-top, 0px));
        right: calc(-1 * env(safe-area-inset-right, 0px));
        bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
        left: calc(-1 * env(safe-area-inset-left, 0px));
    }
    #app.h-screen,
    #app {
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        height: 100dvh;
        height: -webkit-fill-available;
        background: #f3f4f6;
    }
    .mobile-topbar {
        padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
    }
}
html.is-pwa-standalone,
html.is-pwa-standalone body {
    height: 100%;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    background: #3f2a1f !important;
}
html.is-pwa-standalone .portal-screen {
    height: 100dvh;
    height: -webkit-fill-available;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
}
html.is-pwa-standalone .portal-bg,
html.is-pwa-standalone .portal-veil,
html.is-pwa-standalone .portal-grain {
    top: calc(-1 * env(safe-area-inset-top, 0px));
    right: calc(-1 * env(safe-area-inset-right, 0px));
    bottom: calc(-1 * env(safe-area-inset-bottom, 0px));
    left: calc(-1 * env(safe-area-inset-left, 0px));
}
html.is-pwa-standalone #app {
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    height: 100dvh;
    height: -webkit-fill-available;
    background: #f3f4f6;
}

.audit-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.75rem;
}
.audit-stat {
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow-card);
}
.audit-stat strong {
    display: block;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 1.7rem;
    line-height: 1.1;
    color: var(--ui-ink);
}
.audit-stat span {
    display: block;
    margin-top: 0.25rem;
    color: var(--ui-muted);
    font-size: 0.85rem;
}
.audit-stat--safe { border-left: 4px solid #d97706; }
.audit-stat--review { border-left: 4px solid #dc2626; }
.audit-stat--ok { border-left: 4px solid #16a34a; }
.audit-info-card {
    background: #f8faf5;
    border: 1px solid rgba(109, 124, 78, 0.35);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
}
.audit-info-card h3 {
    margin: 0 0 0.5rem;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 1.05rem;
    color: var(--brand-brown);
}
.audit-info-card ul {
    margin: 0;
    padding-left: 1.1rem;
    color: #374151;
    font-size: 0.92rem;
    line-height: 1.45;
}
.audit-scan-meta {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--ui-muted);
}
.audit-section-title {
    margin: 0 0 0.25rem;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 1.15rem;
    color: var(--ui-ink);
}
.audit-section-lead {
    margin: 0 0 0.85rem;
    color: var(--ui-muted);
    font-size: 0.92rem;
}
.audit-empty {
    background: #ecfdf3;
    color: #166534;
    font-weight: 600;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
}
.audit-block {
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: var(--radius-lg);
    padding: 1rem 1.1rem 0.85rem;
    margin-bottom: 0.85rem;
    box-shadow: var(--shadow-card);
}
.audit-block--safe { border-left: 4px solid #d97706; }
.audit-block--review { border-left: 4px solid #dc2626; }
.audit-block-head h3 {
    margin: 0 0 0.35rem;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-size: 1.02rem;
    color: var(--ui-ink);
}
.audit-block-head p {
    margin: 0;
    color: var(--ui-muted);
    font-size: 0.88rem;
    line-height: 1.4;
}
.audit-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.6rem;
    padding: 0.1rem 0.45rem;
    margin-left: 0.35rem;
    border-radius: 999px;
    background: #f3f4f6;
    font-size: 0.8rem;
    font-weight: 800;
    color: #374151;
}
.audit-note {
    margin: 0.45rem 0 0 !important;
    color: #b45309 !important;
    font-weight: 600;
}
.audit-block-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin: 0.75rem 0 0.6rem;
}
.audit-select-all-wrap {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #374151;
    margin-right: auto;
}
.audit-item-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.audit-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.7rem 0.8rem;
    border: 1px solid var(--ui-line);
    border-radius: 0.7rem;
    cursor: pointer;
}
.audit-item:hover { background: #fafafa; }
.audit-item-title {
    display: block;
    font-weight: 700;
    color: var(--ui-ink);
    font-size: 0.92rem;
}
.audit-item-meta {
    display: block;
    margin-top: 0.15rem;
    color: var(--ui-muted);
    font-size: 0.8rem;
    line-height: 1.35;
}

.perm-intro {
    margin: 0 0 0.85rem;
    font-size: 0.88rem;
    color: var(--ui-muted);
    line-height: 1.4;
}
.perm-preset-label {
    margin: 0 0 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ui-muted);
}
.perm-preset-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}
.perm-preset-btn {
    border: 1px solid rgba(109, 124, 78, 0.4);
    background: #f4f7ec;
    color: var(--brand-brown);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}
.perm-preset-btn:hover { background: #e7eed8; }
.perm-fields { display: flex; flex-direction: column; gap: 0.7rem; }
.perm-group {
    margin: 0;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--ui-line);
    border-radius: 0.75rem;
}
.perm-group legend {
    padding: 0 0.35rem;
    font-family: 'Outfit', 'Figtree', sans-serif;
    font-weight: 800;
    font-size: 0.88rem;
    color: var(--ui-ink);
}
.perm-hint {
    margin: 0 0 0.5rem;
    font-size: 0.78rem;
    color: var(--ui-muted);
    line-height: 1.35;
}
.perm-keys { display: flex; flex-direction: column; gap: 0.35rem; }
.perm-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #374151;
    cursor: pointer;
}
.admin-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}
.admin-chip {
    display: inline-flex;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: #eef4df;
    color: #3f2a1f;
    font-size: 0.7rem;
    font-weight: 700;
}
.admin-chip--master { background: #d6ef55; }
.admin-chip--empty { background: #f3f4f6; color: #6b7280; }
.admins-row-master {
    background: linear-gradient(90deg, #f4f9d6 0%, #ffffff 58%);
    box-shadow: inset 4px 0 0 #7a9e12;
}
.field-password-wrap {
    position: relative;
    display: block;
}
.field-password-wrap input {
    display: block;
    width: 100%;
    padding-right: 2.75rem;
    box-sizing: border-box;
}
.field-password-wrap input::-ms-reveal,
.field-password-wrap input::-ms-clear {
    display: none;
}
.field-pass-toggle {
    position: absolute;
    right: 0.15rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 0.4rem;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    display: grid;
    place-items: center;
    z-index: 2;
    padding: 0;
    touch-action: manipulation;
}
.field-pass-toggle:hover,
.field-pass-toggle:active {
    background: rgba(75, 85, 99, 0.12);
    color: #111827;
}

.master-admin-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}
.master-admin-actions .btn {
    min-height: 44px;
}
.admin-master-flag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.08rem 0.4rem;
    border-radius: 999px;
    background: #3f2a1f;
    color: #d6ef55;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    vertical-align: middle;
}
.admin-pending {
    display: inline-block;
    margin-left: 0.4rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.68rem;
    font-weight: 800;
    vertical-align: middle;
}

.portal-login-email-hint {
    display: inline;
    color: #dc2626;
    font-weight: 700;
    font-size: 0.7rem;
    margin-left: 0.35rem;
    line-height: 1.35;
}

/* Z-Indexes dos Modais — advertências sempre acima de qualquer caixa */
#genericModal {
    z-index: 10000 !important;
    padding: 1.25rem;
    overflow-y: auto;
    align-items: center;
    justify-content: center;
}
#genericModal > .generic-modal-card,
#genericModal > div {
    position: relative;
    z-index: 1;
    max-height: min(88dvh, 88vh);
    overflow-y: auto;
    width: min(32rem, calc(100% - 1.5rem));
}
#extraDatesModal {
    z-index: 80;
}
#clientModal, #contractModal, #editionListModal, #editionFormModal, #termEditorModal, #contractTemplateModal, #installmentsPreviewModal, #editionSelectionModal, #paymentModal, #editInstallmentModal, #viewContractModal, #viewTermModal, #inviteClientModal, #inviteAttendeeModal, #addAdminModal, #inviteAdminModal, #adminPermissionsModal, #shareLinkModal, #deleteOptionsModal {
    z-index: 50;
}

/* Overlay global de processamento — acima de todos os modais */
.app-busy-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(20, 12, 6, 0.48);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.app-busy-overlay.hidden {
    display: none !important;
}
.app-busy-card {
    width: min(22rem, 100%);
    background: #fff;
    border-radius: 1rem;
    padding: 1.35rem 1.4rem 1.2rem;
    text-align: center;
    box-shadow: 0 18px 40px rgba(20, 12, 6, 0.28);
    border: 1px solid rgba(63, 42, 31, 0.08);
}
.app-busy-icon {
    font-size: 1.85rem;
    color: #3f2a1f;
    margin-bottom: 0.7rem;
}
.app-busy-title {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #3f2a1f;
}
.app-busy-text {
    margin: 0.35rem 0 0;
    color: #4b5563;
    font-size: 0.92rem;
    line-height: 1.4;
}
body.app-busy {
    overflow: hidden;
}
#toastContainer {
    z-index: 220;
}

#clientModal,
#lojistaModal,
#visitanteModal,
#contractModal {
    align-items: flex-start;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    overflow-y: auto;
}

.report-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.report-field label,
.report-step > label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.35rem;
}
.report-step {
    position: relative;
    z-index: 1;
}
.report-step.is-open {
    z-index: 2;
}
.report-step-panel {
    margin-top: 0.55rem;
    padding: 0.85rem;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    position: relative;
    z-index: 1;
}
.report-mode-option,
.report-field-option {
    display: flex;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    cursor: pointer;
    background: #fff;
}
.report-field-option {
    cursor: default;
    align-items: center;
}
.report-field-option-main {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}
.report-field-reorder {
    display: inline-flex;
    flex-direction: column;
    flex-shrink: 0;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f9fafb;
}
.report-field-move {
    width: 2.75rem;
    min-height: 1.75rem;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #374151;
    cursor: pointer;
    touch-action: manipulation;
}
.report-field-move + .report-field-move {
    border-top: 1px solid #d1d5db;
}
.report-field-move:disabled {
    opacity: 0.35;
    cursor: default;
}
.report-field-move:focus-visible {
    outline: 2px solid #0d9488;
    outline-offset: -2px;
}
.report-mode-option:hover,
.report-field-option:hover {
    border-color: #99f6e4;
    background: #f0fdfa;
}
.report-mode-option:has(input:checked),
.report-field-option:has(input:checked) {
    border-color: #0d9488;
    background: #ccfbf1;
    box-shadow: inset 0 0 0 1px #0d9488;
}
.report-field-option input,
.report-mode-option input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.boleto-scale {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 0.75rem;
    background: rgba(20, 12, 6, 0.48);
}
.boleto-scale.hidden { display: none !important; }
.boleto-scale__sheet {
    display: flex;
    flex-direction: column;
    width: min(52rem, 100%);
    max-height: 100%;
    margin: auto;
    background: #fff;
    border-radius: 1rem;
    overflow: hidden;
}
.boleto-scale__head,
.boleto-scale__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: #fff;
    flex-shrink: 0;
}
.boleto-scale__head { border-bottom: 1px solid #e5e7eb; position: relative; z-index: 2; }
.boleto-scale__head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.boleto-scale__foot {
    justify-content: flex-end;
    position: sticky;
    bottom: 0;
    z-index: 3;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -10px 18px rgba(20, 12, 6, 0.12);
}
.boleto-scale__list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 1rem 1rem;
}
.boleto-scale__client {
    margin-top: 0.9rem;
    padding: 0.85rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.85rem;
    background: #fafafa;
}
.boleto-scale__client-head,
.boleto-scale__parcel {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.boleto-scale__client-head { margin-bottom: 0.65rem; }
.boleto-scale__parcel {
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.45rem;
    padding: 0.55rem 0.65rem;
    border-radius: 0.65rem;
    background: #fff;
}
.boleto-scale__client-head input,
.boleto-scale__parcel input {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.15rem;
    flex-shrink: 0;
}
.boleto-scale__tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
}
.boleto-scale__tag--open { background: #fef3c7; color: #92400e; }
.boleto-scale__tag--late { background: #fee2e2; color: #991b1b; }
.boleto-scale__tag--issued { background: #dcfce7; color: #166534; }

