/* CSS Document */

@charset "utf-8";

/* Inter: carregar via <link> no HTML (não @import — evita FOUC/cascade block). */

:root {
    --brand-destaque: #eef1ee;
    --brand-accent: #025aa4;
    --cor-destaque: var(--brand-destaque);
    --cor-accent: var(--brand-accent);
    --cinza-titulos: #333;
    --btn-radius: 10px;
    --navdrawer-border: #eeeeee;
}

/* Raio padrão de todos os botões (sobrepõe estilos inline antigos) */
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
    border-radius: var(--btn-radius) !important;
}

/*
 * Botões pill (Usuários, modais, toolbar). Centralizado aqui para garantir carga e remover o aspeto nativo do SO.
 */
.autodocs-btn-pill-primary {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    padding: 14px 22px;
    border-radius: var(--btn-radius);
    border: 0;
    cursor: pointer;
    background-color: var(--brand-accent, var(--cor-accent, #025aa4));
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.autodocs-btn-pill-primary:hover {
    filter: brightness(0.95);
}

.autodocs-btn-pill-secondary {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    padding: 14px 22px;
    border-radius: var(--btn-radius);
    border: 1px solid #e8e8e8;
    cursor: pointer;
    background: #fff;
    color: var(--cor-accent, #025aa4);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.autodocs-btn-pill-secondary:hover {
    background: var(--cor-destaque, #eef1ee);
    border-color: #ddd;
}

.autodocs-btn-pill-danger {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    padding: 14px 22px;
    border-radius: var(--btn-radius);
    border: 1px solid #ffcdd2;
    cursor: pointer;
    background: #fff;
    color: #c62828;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.autodocs-btn-pill-danger:hover {
    background: #ffebee;
    border-color: #ef9a9a;
}

html {
    overflow: hidden;
}

body {
    margin: 0;
    height: 100%;
    width: 100%;
    display: grid;
    grid-template-columns: 301px auto;
    align-items: stretch;
    font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
    transition: grid-template-columns 0.22s ease;
}

html.navdrawer-collapsed body {
    grid-template-columns: 76px auto;
}

/* Menu | formulário | preview ao vivo (somente páginas que possuem #documento) */
body:has(#documento) {
    grid-template-columns: 301px minmax(360px, 420px) minmax(0, 1fr);
    transition: grid-template-columns 0.22s ease;
}

html.navdrawer-collapsed body:has(#documento) {
    grid-template-columns: 76px minmax(360px, 420px) minmax(0, 1fr);
}

body:has(#documento) > #conteudo {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

body:has(#documento) > #documento {
    min-width: 0;
    min-height: 0;
    overflow: auto;
    background-color: #ececec;
    padding: 20px;
    box-sizing: border-box;
    align-items: center;
    justify-content: flex-start;
}

body:has(#documento) .formularios {
    width: 100%;
    max-width: 420px;
    margin-left: 16px;
    margin-right: 16px;
}

body:has(#documento) .area-boxes {
    grid-template-columns: 100%;
    justify-content: stretch;
}

header#navdrawer {
    height: 100vh;
    width: 301px;
    display: flex;
    flex-direction: column;
    transition: width 0.22s ease;
}

html.navdrawer-collapsed header#navdrawer {
    width: 76px;
}

.sistema-logo {
    height: 64px;
    padding: 12px 0px 12px 12px;
    box-sizing: border-box;
    background-color: var(--cor-destaque);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.sistema-logo-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    margin-right: 8px;
}

.logo--compact {
    display: none;
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex-shrink: 0;
}

html.navdrawer-collapsed .logo--full {
    display: none;
}

html.navdrawer-collapsed .logo--compact {
    display: block;
}

html.navdrawer-collapsed .sistema-logo {
    padding: 10px 6px 8px;
    justify-content: center;
    flex-wrap: nowrap;
    flex-direction: column;
    height: auto;
    min-height: 64px;
    gap: 4px;
}

html.navdrawer-collapsed .logo-div {
    display: none;
}

html.navdrawer-collapsed .sistema-logo-actions {
    margin: 0;
    width: 100%;
    justify-content: center;
}

html.navdrawer-collapsed #navdrawer-collapse {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid color-mix(in srgb, var(--cor-accent) 18%, transparent);
}

html.navdrawer-collapsed #navdrawer-collapse:hover {
    background: #fff;
}

#navdrawer-collapse {
    display: inline-flex;
    height: 36px;
    width: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--cor-accent);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

#navdrawer-collapse .material-symbols-rounded {
    font-size: 22px;
}

#navdrawer-collapse:hover {
    background: rgba(255, 255, 255, 0.45);
}

.logo {
    height: 40px;
}

#logo {
    height: 100%;
}

#navdrawer-toggle {
    display: none;
    height: 40px;
    width: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--cor-accent);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

#navdrawer-toggle .material-symbols-rounded {
    font-size: 24px;
}

#navdrawer-backdrop {
    display: none;
}

.logo-div{
    height: 100%;
    width: 1px;
    background-color: var(--brand-accent, var(--cor-accent));
}

.sistema-navdrawer {
    width: 100%;
    height: 100%;
    background-color: white;
    box-sizing: border-box;
    padding: 24px 12px 12px 12px;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--navdrawer-border);

    /* Para rolagem */
    overflow-y: auto;
    max-height: calc(100vh - 64px); /* ajusta esse valor conforme altura do header e margens */
}

.up-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.down-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
    padding-top: 4px;
}

.navdrawer-div {
    margin-top: 1px;
    margin-bottom: 1px;
    height: 1px;
    width: 100%;
    background-color: #EEEEEE;
}

.navdrawer-option {
    width: 100%;
    height: 48px;
    padding: 12px;
    box-sizing: border-box;
    gap: 16px;
    display: flex;
    flex-direction: row;
    align-items: center;
    align-content: flex-start;

    color: #666;
    background-color: white;

    border-radius: 16px;

    font-family: 'Inter';
    font-size: 16px;
    font-weight: 500;

    cursor: pointer;

    text-decoration: none;

    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: padding 0.22s ease, justify-content 0.22s ease;
}

.navdrawer-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.18s ease, max-width 0.22s ease;
    max-width: 220px;
}

html.navdrawer-collapsed .navdrawer-label {
    opacity: 0;
    max-width: 0;
    pointer-events: none;
}

html.navdrawer-collapsed .navdrawer-option {
    justify-content: center;
    padding: 12px 8px;
    gap: 0;
}

html.navdrawer-collapsed .sistema-navdrawer {
    padding-left: 8px;
    padding-right: 8px;
    max-height: none;
}

html.navdrawer-collapsed .navdrawer-option .material-symbols-rounded {
    margin: 0;
}

.navdrawer-option.ativo {
    color: var(--cor-accent);
    background-color: var(--cor-destaque);

    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.navdrawer-option:hover:not(.ativo) {
    color: #666;
    background-color: #F5F5F5;
}

/* Garante que itens com [hidden] não fiquem visíveis: o estilo acima força display:flex. */
.navdrawer-option[hidden] {
    display: none !important;
}

/* Fail-closed: itens admin ficam ocultos até html.autodocs-role-admin (após auth). */
.navdrawer-admin-only {
    display: none !important;
}
html.autodocs-role-admin .navdrawer-admin-only:not([hidden]) {
    display: flex !important;
}

.navdrawer-footer-card {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e6e6e6;
    border-radius: 10px;
    background: #fff;
    color: #333;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.navdrawer-theme-switch {
    min-height: 64px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.navdrawer-theme-label {
    font-size: 13px;
    font-weight: 500;
    color: #8a8f98;
    line-height: 1;
}

.navdrawer-switch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.navdrawer-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.navdrawer-switch-track {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #d5d8de;
    transition: background 0.2s ease;
}

.navdrawer-switch-track::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}

.navdrawer-switch input:checked + .navdrawer-switch-track {
    background: color-mix(in srgb, var(--brand-accent, var(--cor-accent, #2563eb)) 28%, #1a2332);
}

.navdrawer-switch input:checked + .navdrawer-switch-track::after {
    transform: translateX(20px);
    background: var(--brand-accent, var(--cor-accent, #2563eb));
}

.navdrawer-profile-card {
    min-height: 58px;
    padding: 10px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-align: left;
}

.navdrawer-profile-card:hover,
.navdrawer-profile-card.is-active {
    border-color: color-mix(in srgb, var(--cor-accent, #2563eb) 35%, #e6e6e6);
    background: var(--cor-destaque, #f4f7fb);
}

.navdrawer-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--cor-accent, #2563eb) 22%, #1e293b);
    color: color-mix(in srgb, var(--cor-accent, #60a5fa) 70%, #fff);
}

.navdrawer-profile-initial {
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.navdrawer-profile-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.navdrawer-profile-name {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navdrawer-profile-role {
    font-size: 12px;
    font-weight: 500;
    color: #9aa3ad;
}

.navdrawer-logout {
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.navdrawer-lock {
    min-height: 44px;
    padding: 10px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.navdrawer-lock:hover {
    background: #f5f5f5;
}

.navdrawer-lock .material-symbols-rounded {
    font-size: 20px;
}

.navdrawer-lock[hidden],
.navdrawer-lock-div[hidden] {
    display: none !important;
}

.navdrawer-logout:hover {
    background: #f5f5f5;
}

.navdrawer-logout .material-symbols-rounded {
    font-size: 20px;
}

html.navdrawer-collapsed .navdrawer-theme-switch {
    min-height: 44px;
    padding: 10px 8px;
}

html.navdrawer-collapsed .navdrawer-theme-label {
    display: none;
}

html.navdrawer-collapsed .navdrawer-profile-card {
    justify-content: center;
    padding: 10px 8px;
}

html.navdrawer-collapsed .navdrawer-profile-meta {
    display: none;
}

html.navdrawer-collapsed .navdrawer-logout .navdrawer-label {
    display: none;
}

html.navdrawer-collapsed .navdrawer-logout {
    gap: 0;
}

html.navdrawer-collapsed .navdrawer-lock .navdrawer-label {
    display: none;
}

html.navdrawer-collapsed .navdrawer-lock {
    gap: 0;
}

.autodocs-support-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 2147482000;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: var(--brand-accent, var(--cor-accent, #025aa4));
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.autodocs-support-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.autodocs-support-fab .material-symbols-rounded {
    font-size: 24px;
}

.autodocs-support-fab[hidden] {
    display: none !important;
}

html.theme-dark {
    color-scheme: dark;
    /* Barra/fundo de destaque adapta; ênfase (links/títulos) fica branca */
    --cor-destaque: #1c2024;
    --cor-accent: #ffffff;
    --navdrawer-border: #2a3036;
}

/* Preview do documento mantém branding (impressão/PDF) */
html.theme-dark #documento {
    --cor-destaque: var(--brand-destaque);
    --cor-accent: var(--brand-accent);
}

html.theme-dark body {
    background: #121416;
}

html.theme-dark .conteudo {
    background-color: #171a1d;
}

html.theme-dark #navdrawer,
html.theme-dark .sistema-navdrawer {
    background: #1c2024;
}

html.theme-dark .navdrawer-option {
    background: transparent;
    color: #b8c0c8;
}

html.theme-dark .navdrawer-option:hover:not(.ativo) {
    background: #262b31;
    color: #d5dbe1;
}

html.theme-dark .navdrawer-option.ativo {
    color: var(--cor-accent);
    background-color: rgba(255, 255, 255, 0.06);
}

html.theme-dark .navdrawer-div {
    background-color: #2a3036;
}

html.theme-dark .navdrawer-footer-card {
    background: #1a222d;
    border-color: #2a3442;
    color: #e8edf2;
}

html.theme-dark .navdrawer-theme-label {
    color: #9aa3ad;
}

html.theme-dark .navdrawer-profile-card:hover,
html.theme-dark .navdrawer-profile-card.is-active {
    background: #222b38;
    border-color: #334155;
}

html.theme-dark .navdrawer-profile-name {
    color: #f3f6f9;
}

html.theme-dark .navdrawer-profile-role {
    color: #8b949e;
}

html.theme-dark .navdrawer-logout {
    color: #e8edf2;
}

html.theme-dark .navdrawer-logout:hover {
    background: #222b38;
}

html.theme-dark .navdrawer-lock {
    color: #e8edf2;
}

html.theme-dark .navdrawer-lock:hover {
    background: #222b38;
}

html.theme-dark .navdrawer-switch-track {
    background: #2a3442;
}

html.theme-dark .navdrawer-switch input:checked + .navdrawer-switch-track {
    background: color-mix(in srgb, var(--brand-accent, #2563eb) 35%, #152033);
}

html.theme-dark .navdrawer-switch input:checked + .navdrawer-switch-track::after {
    background: var(--brand-accent, #2563eb);
}

html.theme-dark .sistema-pagina,
html.theme-dark .base-box,
html.theme-dark .formularios {
    color: #d5dbe1;
}

html.theme-dark .sistema-pagina h1,
html.theme-dark .base-box h2 {
    color: #f0f3f6;
}

html.theme-dark .campo-texto,
html.theme-dark .label-campo {
    color: #9aa3ad;
}

html.theme-dark .input,
html.theme-dark select,
html.theme-dark textarea,
html.theme-dark .designer-tag-select,
html.theme-dark .doc-hub-tag-multi-btn {
    background: #23282e;
    color: #e8edf2;
    border-color: #343b43;
}

html.theme-dark .doc-hub-tag-multi-panel {
    background: #23282e;
    border-color: #343b43;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.theme-dark .doc-hub-tag-multi-option {
    color: #d5dbe1;
}

html.theme-dark .doc-hub-tag-multi-option:hover {
    background: #2c3239;
}

html.theme-dark .doc-hub-card,
html.theme-dark .base-box {
    background: #1c2024;
    border-color: #2a3036;
}

html.theme-dark .doc-hub-card-title {
    color: #e8edf2;
}

html.theme-dark .doc-hub-card-blurb,
html.theme-dark .doc-hub-empty,
html.theme-dark .doc-hub-group-count {
    color: #8a949e;
}

html.theme-dark .doc-hub-group-title {
    color: #d5dbe1;
}

html.theme-dark .doc-hub-group-collapse {
    color: #8a949e;
}

html.theme-dark .doc-hub-group-collapse:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #e8edf2;
}

.conteudo {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: 100%;

    background-color: #F9F9F9;
    transition: opacity 0.12s ease;
}

body.autodocs-soft-nav .conteudo {
    opacity: 0.55;
    pointer-events: none;
}

/* Transição ao abrir documentação (overlay + spinner) */
html.autodocs-page-transition-pending body {
    overflow: hidden;
}

.autodocs-page-transition {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(249, 249, 249, 0.82);
    backdrop-filter: blur(3px);
    opacity: 1;
    transition: opacity 0.28s ease;
    pointer-events: all;
}

.autodocs-page-transition[hidden] {
    display: none !important;
}

.autodocs-page-transition.is-hiding {
    opacity: 0;
    pointer-events: none;
}

.autodocs-page-transition-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--cor-accent, #025aa4);
    border-radius: 50%;
    animation: autodocs-page-transition-spin 0.7s linear infinite;
}

@keyframes autodocs-page-transition-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

html.autodocs-page-transition-pending::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 2147482999;
    background: rgba(249, 249, 249, 0.92);
    pointer-events: all;
}

html.autodocs-page-transition-pending::after {
    content: '';
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 2147483000;
    width: 34px;
    height: 34px;
    margin: -17px 0 0 -17px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--cor-accent, #025aa4);
    border-radius: 50%;
    animation: autodocs-page-transition-spin 0.7s linear infinite;
    pointer-events: none;
}

header#pagina {
    background-color: var(--cor-destaque);
    width: 100%;
    height: 64px;

    display: flex;
    flex-direction: column;
    padding-left: 16px;

    justify-content: center;

    gap: 10px;

    color: var(--cor-accent);
    font-family: 'Inter';
    font-size: 11px;
    font-weight: 400;

    text-align: left;

    line-height: 8px;
}

.sistema-pagina {
    display: flex;
    width: 100%;
    min-width: 0;

    padding: 36px 0px 0px 0px;

    align-items: stretch;
    flex-direction: column;
    
    /* Para rolagem */
    overflow-y: auto;
    max-height: calc(100vh - 100px); /* ajusta esse valor conforme altura do header e margens */
}

h1 {
    color: var(--cor-accent);
    font-family: 'Inter';
    font-size: 24px;
    font-weight: 600;

    text-align: left;

    line-height: 17px;

    margin: 0px 16px 24px 16px;
}

.formularios {
    display: flex;
    flex-direction: column;

    margin-left: 16px;
    margin-right: 16px;

    padding-bottom: 24px;
}


.area-boxes {
    display: grid;
    grid-template-columns: 340px 340px;
    gap: 12px;
    justify-content: start;
}

.base-box {
    border: 1px solid #EEEEEE;
    background-color: white;

    padding: 22px;
    box-sizing: border-box;

    width: 100%;
    height: min-content;

    border-radius: 16px;
}

.h2-ativar {
    display: flex;
    flex-direction: row;

    align-items: center;
}

.h2-ativar.ativo {
    margin-bottom: 14px;
}

.h2-ativar h2 {
    margin: 0px;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #0F9D58;

    margin: 0px 0px 0px 8px;

    cursor: pointer;
}

h2 {
    color: var(--cinza-titulos);
    font-family: 'Inter';
    font-size: 16px;
    font-weight: 600;

    text-align: left;

    line-height: 12px;

    margin: 0px 0px 20px 0px;
}

.base-boxcampos {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.campo {
    display: flex;
    flex-direction: column;

    gap: 8px;
}

.campo.selo-opcao {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.label {
    display: flex;
    flex-direction: row;

    justify-content: space-between;

    height: 16px;

    align-items: center;    
}

.label span {
    cursor: pointer;

    color: #bdbdbd;

    font-size: 16px;

    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

label.label-campo {
    color: var(--cinza-titulos);
    font-family: 'Inter';
    font-size: 12px;
    font-weight: 600;

    text-align: left;

    line-height: 9px; 

    display: flex;
    align-items: center;
}

/* Botão de sorteio de valor (scripts/autodocs-aleatorio.js). A margem
   automática consome o espaço livre do .label para que o botão fique colado ao
   rótulo e o ícone de ajuda continue encostado à direita. */
.campo-aleatorio {
    margin: 0 auto 0 6px;
    padding: 0;

    width: 18px;
    height: 18px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border: none;
    background: transparent;

    color: #bdbdbd;
    cursor: pointer;

    transition: color .15s ease, background-color .15s ease;
}

.campo-aleatorio span {
    color: inherit;
    font-size: 15px;
}

.campo-aleatorio:hover {
    color: var(--cor-accent);
    background: rgba(2, 90, 164, .08);
}

.campo-aleatorio:focus-visible {
    outline: 2px solid var(--cor-accent);
    outline-offset: 1px;
}

input.input {
    color: #666;
    font-family: 'Inter';
    font-size: 12px;
    font-weight: 600;

    text-align: left;

    height: 36px;
    width: 100%;

    box-sizing: border-box;

    background-color: #F5F5F5;
    border: 0px;
    border-radius: 8px;
    padding: 0px 8px 0px 8px;

    overflow: hidden; /* esconde qualquer conteúdo que ultrapasse a largura */
    white-space: nowrap; /* faz com que o texto não quebre para a próxima linha */
    text-overflow: ellipsis; /* adiciona "..." para indicar que o texto foi truncado */
}

input.input:focus {
    outline: none;
}

input::placeholder {
  color: #bdbdbd;
  font-weight: 500;
}

.campo-texto {
    color: #666;
    font-family: 'Inter';
    font-size: 12px;
    font-weight: 400;
    line-height: 16px;

    text-align: justify;
}

#copiar {
    cursor: pointer;
}

.campo select {
    color: #666;
    font-family: 'Inter';
    font-size: 12px;
    font-weight: 600;

    text-align: left;

    height: 36px;
    width: 100%;

    box-sizing: border-box;

    background-color: #F5F5F5;
    border: 0px;
    border-radius: 8px;
    padding: 0px 8px 0px 8px;
}

.box-duplo {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 1020px) {
    .area-boxes {
        grid-template-columns: 100%;
    }
}

@media (max-width: 840px) {
    .area-boxes {
        grid-template-columns: 100%;
    }
}

@media (max-width: 1400px) {
    body:has(#documento) {
        grid-template-columns: 280px minmax(320px, 380px) minmax(0, 1fr);
    }

    html.navdrawer-collapsed body:has(#documento) {
        grid-template-columns: 76px minmax(320px, 380px) minmax(0, 1fr);
    }
}

@media (max-width: 1200px) {
    body:has(#documento) {
        grid-template-columns: 260px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    }

    html.navdrawer-collapsed body:has(#documento) {
        grid-template-columns: 76px minmax(0, 1fr);
    }

    body:has(#documento) > #navdrawer {
        grid-column: 1;
        grid-row: 1 / 3;
        width: 260px;
    }

    html.navdrawer-collapsed body:has(#documento) > #navdrawer {
        width: 76px;
    }

    body:has(#documento) > #conteudo {
        grid-column: 2;
        grid-row: 1;
    }

    body:has(#documento) > #documento {
        grid-column: 2;
        grid-row: 2;
        padding: 12px;
    }

    body:has(#documento) .formularios {
        max-width: 360px;
    }
}

@media (max-width: 900px) {
    body:has(#documento) {
        grid-template-columns: 1fr;
        grid-template-rows: 64px minmax(0, 1fr) minmax(0, 1fr);
        height: 100dvh;
    }

    body:has(#documento) > #navdrawer {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        height: 64px;
        position: relative;
        z-index: 20;
    }

    body:has(#documento) .sistema-logo {
        height: 64px;
        padding: 12px;
    }

    body:has(#documento) .logo-div {
        display: none;
    }

    body:has(#documento) #navdrawer-toggle {
        display: inline-flex;
    }

    body:has(#documento) #navdrawer-collapse {
        display: none;
    }

    body:has(#documento) .sistema-navdrawer {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: min(320px, 86vw);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        max-height: none;
        border-right: 1px solid var(--navdrawer-border);
        border-bottom: 0;
        padding: 16px 12px 12px 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        z-index: 30;
    }

    body:has(#documento) #navdrawer-backdrop {
        display: block;
        position: fixed;
        inset: 64px 0 0 0;
        background: rgba(0, 0, 0, 0.25);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        border: 0;
        padding: 0;
        z-index: 25;
    }

    body:has(#documento).navdrawer-open .sistema-navdrawer {
        transform: translateX(0);
    }

    body:has(#documento).navdrawer-open #navdrawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body:has(#documento) .navdrawer-option {
        height: 42px;
        font-size: 14px;
        gap: 10px;
    }

    body:has(#documento) > #conteudo {
        grid-column: 1;
        grid-row: 2;
        min-height: 0;
    }

    /* Move o header da página para a barra superior, entre logo e menu */
    body:has(#documento) #conteudo > header#pagina {
        position: fixed;
        top: 0;
        left: 72px;
        right: 72px;
        height: 64px;
        padding: 0;
        background: transparent;
        color: var(--cor-accent);
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
        gap: 2px;
        z-index: 26;
        pointer-events: none;
    }

    body:has(#documento) #conteudo > header#pagina span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    body:has(#documento) > #documento {
        grid-column: 1;
        grid-row: 3;
        padding: 10px;
        min-height: 0;
    }

    body:has(#documento) .formularios {
        max-width: none;
        margin-left: 10px;
        margin-right: 10px;
    }

    body:has(#documento) .sistema-pagina {
        padding-top: 20px;
        max-height: calc(100dvh - 64px);
    }
}

/* Páginas shell (sem #documento): mesma usabilidade mobile — barra superior só logo + menu; drawer deslizante */
@media (max-width: 900px) {
    body:not(:has(#documento)) {
        grid-template-columns: 1fr;
        grid-template-rows: 64px minmax(0, 1fr);
        height: 100dvh;
    }

    body:not(:has(#documento)) > #navdrawer {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        height: 64px;
        position: relative;
        z-index: 20;
    }

    body:not(:has(#documento)) .sistema-logo {
        height: 64px;
        padding: 12px;
    }

    body:not(:has(#documento)) .logo-div {
        display: none;
    }

    body:not(:has(#documento)) #navdrawer-toggle {
        display: inline-flex;
    }

    body:not(:has(#documento)) #navdrawer-collapse {
        display: none;
    }

    body:not(:has(#documento)) .sistema-navdrawer {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: min(320px, 86vw);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        max-height: none;
        border-right: 1px solid var(--navdrawer-border);
        border-bottom: 0;
        padding: 16px 12px 12px 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        z-index: 30;
    }

    body:not(:has(#documento)) #navdrawer-backdrop {
        display: block;
        position: fixed;
        inset: 64px 0 0 0;
        background: rgba(0, 0, 0, 0.25);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        border: 0;
        padding: 0;
        z-index: 25;
    }

    body:not(:has(#documento)).navdrawer-open .sistema-navdrawer {
        transform: translateX(0);
    }

    body:not(:has(#documento)).navdrawer-open #navdrawer-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    body:not(:has(#documento)) .navdrawer-option {
        height: 42px;
        font-size: 14px;
        gap: 10px;
    }

    body:not(:has(#documento)) > .conteudo {
        grid-column: 1;
        grid-row: 2;
        min-height: 0;
        overflow: auto;
        max-height: calc(100dvh - 64px);
    }
}

/* Largura estreita: oculta linha secundária do header (subtítulo / CNPJ) */
@media (max-width: 600px) {
    header#pagina #sistema-cnpj {
        display: none;
    }
}

@media print {
    html,
    body {
        height: auto !important;
        overflow: visible !important;
    }

    body {
        display: block !important;
    }

    #navdrawer,
    #conteudo,
    #autodocs-support-fab,
    .autodocs-support-fab {
        display: none !important;
    }

    #documento {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        background: white !important;
        overflow: visible !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
    }
}

/* Campo de palavra-passe com botão mostrar/ocultar */
.password-field-wrap {
    position: relative;
    width: 100%;
}

.password-field-wrap .input {
    width: 100%;
    padding-right: 44px;
    box-sizing: border-box;
}

.password-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: var(--btn-radius);
    background: transparent;
    color: var(--cor-accent, #025aa4);
    cursor: pointer;
}

.password-toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.password-toggle-btn .material-symbols-rounded {
    font-size: 22px;
}

/* —— Toasts (canto superior direito) —— */
.autodocs-toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.autodocs-toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    line-height: 1.45;
    color: #333;
    opacity: 0;
    transform: translateY(-8px) translateX(12px);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: auto;
}

.autodocs-toast.is-visible {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

.autodocs-toast.is-leaving {
    opacity: 0;
    transform: translateY(-6px) translateX(8px);
}

.autodocs-toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.autodocs-toast--ok .autodocs-toast-icon { color: #1b7f4a; }
.autodocs-toast--error .autodocs-toast-icon { color: #b3261e; }
.autodocs-toast--info .autodocs-toast-icon { color: var(--cor-accent, #025aa4); }

.autodocs-toast-text {
    flex: 1;
    min-width: 0;
    white-space: pre-wrap;
}

/* —— OpenCNPJ loading no input CNPJ —— */
.autodocs-cnpj-wrap {
    position: relative;
    width: 100%;
}

.autodocs-cnpj-wrap .input {
    width: 100%;
    box-sizing: border-box;
    padding-right: 38px;
}

.autodocs-cnpj-spinner {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border: 2px solid #e0e0e0;
    border-top-color: var(--cor-accent, #025aa4);
    border-radius: 50%;
    animation: autodocs-cnpj-spin 0.75s linear infinite;
    pointer-events: none;
}

.autodocs-cnpj-spinner[hidden] {
    display: none !important;
}

@keyframes autodocs-cnpj-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}