
:root {
    --brand-blue: #2563eb;
    --brand-cyan: #38bdf8;
    --brand-ink: #0b1220;
    --brand-logo-glow: 0 20px 50px rgba(37, 99, 235, 0.32);
}

:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --text: #1d2433;
    --muted: #667085;
    --primary: #1f6feb;
    --primary-dark: #1958bb;
    --accent: #b54708;
    --border: #d9e2ef;
    --danger: #b42318;
    --success: #047857;
    --shadow: 0 20px 60px rgba(30, 41, 59, 0.12);
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text);
    background:
        linear-gradient(135deg, rgba(31, 111, 235, 0.08), rgba(4, 120, 87, 0.08)),
        var(--bg);
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

body.splash-open {
    overflow: hidden;
}

body.splash-open .app {
    visibility: hidden;
}

.startup-splash {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: grid;
    place-items: center;
    padding: 32px;
    background:
        radial-gradient(circle at 50% 34%, rgba(56, 189, 248, 0.22), transparent 32%),
        radial-gradient(circle at 70% 72%, rgba(37, 99, 235, 0.18), transparent 30%),
        linear-gradient(145deg, #050b16 0%, #0b1220 54%, #101827 100%);
    transition: opacity 420ms ease, visibility 420ms ease;
}

.startup-splash.is-hiding {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.startup-splash-content {
    display: grid;
    justify-items: center;
    gap: 28px;
    width: min(100%, 360px);
    transform: translateY(-8px);
}

.startup-splash-logo {
    width: clamp(104px, 12vw, 148px);
    height: clamp(104px, 12vw, 148px);
    object-fit: contain;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 30px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.28), rgba(37, 99, 235, 0.14));
    box-shadow: var(--brand-logo-glow), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    filter: drop-shadow(0 18px 36px rgba(37, 99, 235, 0.30));
    animation: startupLogoFloat 2.6s ease-in-out infinite;
}

.startup-splash-brand {
    margin-top: -14px;
    color: #f8fafc;
    font-size: clamp(1.6rem, 4vw, 2.35rem);
    font-weight: 900;
    letter-spacing: 0.02em;
    text-shadow: 0 10px 30px rgba(37, 99, 235, 0.40);
}

.startup-splash-progress {
    width: min(280px, 64vw);
    height: 10px;
    overflow: hidden;
    border: 1px solid rgba(147, 197, 253, 0.34);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.92);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 16px 36px rgba(15, 23, 42, 0.36);
}

.startup-splash-progress span {
    display: block;
    width: 42%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, #60a5fa 22%, #ffffff 52%, #2563eb 82%, transparent);
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.72);
    animation: startupProgressMove 1.18s ease-in-out infinite alternate;
}

@keyframes startupLogoFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
    }
}

@keyframes startupProgressMove {
    from {
        transform: translateX(-95%);
    }

    to {
        transform: translateX(235%);
    }
}

.privacy-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(5px);
}

.privacy-modal.is-hidden {
    display: none;
}

.privacy-card {
    width: min(100%, 520px);
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.privacy-icon {
    display: block;
    width: 92px;
    height: 92px;
    object-fit: contain;
    margin: 0 auto 18px;
}

.privacy-card .privacy-eyebrow {
    text-align: center;
    font-size: 30px;
}

.privacy-card h2 {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.2;
}

.privacy-card p:not(.eyebrow) {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
}

.privacy-card button {
    width: 100%;
    margin-top: 22px;
}

.app {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.app,
.view,
.form-panel,
.auth-panel,
.privacy-card,
.payment-card,
.document-card,
.admin-user-item,
.field,
.user-menu,
.admin-user-meta {
    min-width: 0;
}

.view.is-hidden {
    display: none;
}

.document-card.is-hidden {
    display: none;
}

.auth-view {
    min-height: calc(100vh - 96px);
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
    align-items: center;
    gap: 42px;
}

.auth-copy {
    max-width: 640px;
}

.auth-panel,
.form-panel {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
}

.login-form {
    display: grid;
    gap: 18px;
}

.admin-inline-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.admin-inline-action-three {
    grid-template-columns: minmax(92px, 1fr) auto auto;
}

.admin-inline-action .secondary-button {
    min-height: 48px;
    white-space: nowrap;
}

.danger-button {
    border-color: rgba(180, 35, 24, 0.28);
    color: #991b1b;
    background: #fff1f2;
}

.admin-quota-summary {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(238, 244, 255, 0.55);
}

.admin-quota-summary p {
    margin: 0;
    color: var(--muted);
}

.admin-quota-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text);
}

.admin-quota-summary-header span {
    color: var(--muted);
    font-size: 0.86rem;
}

.admin-quota-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.admin-quota-summary-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 44px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: #ffffff;
    font: inherit;
    font-weight: 700;
    text-align: left;
}

.admin-quota-summary-item span {
    overflow: hidden;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-quota-summary-item strong {
    min-width: 34px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #065f46;
    background: #d1fae5;
    font-size: 0.86rem;
    text-align: center;
}

.admin-quota-summary-item.is-empty strong {
    color: #991b1b;
    background: #fee2e2;
}

.admin-history-list {
    display: grid;
    gap: 10px;
}

.admin-history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
}

.admin-history-item strong {
    display: block;
    color: var(--text);
}

.admin-history-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.admin-history-item time {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .admin-inline-action {
        grid-template-columns: 1fr;
    }

    .admin-quota-summary-header,
    .admin-history-item {
        display: grid;
    }

    .admin-history-item time {
        white-space: normal;
    }
}

.topbar,
.generator-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.topbar h1 {
    max-width: 760px;
}

.user-menu {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.user-menu span,
.admin-user-meta span,
.admin-user-item strong,
.message,
.access-status {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.document-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.access-status {
    margin: -10px 0 22px;
    padding: 14px 16px;
    border: 1px solid rgba(4, 120, 87, 0.18);
    border-radius: 8px;
    color: var(--success);
    background: rgba(4, 120, 87, 0.09);
    font-weight: 700;
    line-height: 1.5;
}

.access-status:empty {
    display: none;
}

.access-status.error {
    border-color: rgba(180, 35, 24, 0.18);
    color: var(--danger);
    background: rgba(180, 35, 24, 0.09);
}

.plan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: -8px 0 22px;
}

.plan-actions.is-hidden {
    display: none;
}

.payment-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(5px);
}

.payment-modal.is-hidden,
.payment-confirm-box.is-hidden,
.payment-qr-box.is-hidden {
    display: none;
}

.payment-card {
    position: relative;
    width: min(100%, 560px);
    max-height: calc(100vh - 48px);
    overflow: auto;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.payment-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 38px;
    min-height: 38px;
    padding: 0;
    border: 1px solid var(--border);
    color: var(--text);
    background: #ffffff;
    font-size: 1.5rem;
    line-height: 1;
}

.payment-card h2 {
    margin: 0;
    font-size: 1.7rem;
}

.payment-description,
.payment-help,
.payment-plan-summary {
    color: var(--muted);
    line-height: 1.5;
}

.payment-plan-options {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.payment-plan-option {
    width: 100%;
    border: 1px solid var(--border);
    color: var(--text);
    background: #ffffff;
    text-align: left;
}

.payment-plan-option:hover {
    color: var(--primary);
    background: var(--surface-soft);
}

.payment-confirm-box,
.payment-qr-box {
    margin-top: 18px;
}

.payment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.payment-qr-placeholder {
    width: 100%;
    max-width: 240px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    padding: 12px;
}

.payment-qr-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.payment-api-placeholder {
    display: grid;
    justify-items: center;
    gap: 10px;
    margin: 20px auto;
    padding: 24px;
    border: 1px dashed rgba(37, 99, 235, 0.34);
    border-radius: 14px;
    color: var(--text);
    background: rgba(37, 99, 235, 0.08);
    text-align: center;
}

.payment-api-placeholder i {
    width: 42px;
    height: 42px;
    color: var(--primary);
}

.payment-api-placeholder strong {
    font-size: 1.05rem;
}

.payment-api-placeholder span {
    max-width: 440px;
    color: var(--muted);
    line-height: 1.5;
}

.payment-api-actions {
    align-items: center;
    justify-content: center;
}

.payment-mercadopago-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 18px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--primary);
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.22);
}

.payment-mercadopago-link:hover {
    background: var(--primary-dark);
}

.payment-mercadopago-link.is-hidden,
.payment-proof-form.is-hidden,
.field.is-hidden {
    display: none !important;
}

.document-card {
    min-height: 180px;
    display: grid;
    align-content: start;
    gap: 12px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow);
    text-align: left;
}

.document-card:hover {
    border-color: rgba(31, 111, 235, 0.45);
    background: #ffffff;
}

.document-card strong {
    font-size: 1.35rem;
    line-height: 1.2;
}

.document-card span:last-child {
    color: var(--muted);
    font-size: 0.98rem;
    font-weight: 400;
    line-height: 1.5;
}

.document-status {
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: var(--success);
    background: rgba(4, 120, 87, 0.1);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.document-card-disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.document-card-disabled .document-status {
    color: var(--accent);
    background: rgba(181, 71, 8, 0.11);
}

.document-card-disabled:hover {
    border-color: var(--border);
    transform: none;
}

.admin-card .document-status {
    color: var(--primary);
    background: rgba(31, 111, 235, 0.1);
}

.pdf-local-card {
    border-color: rgba(31, 111, 235, 0.35);
    background: #f8fbff;
}

.pdf-local-card .document-status {
    color: #ffffff;
    background: #0057d9;
}

.pdf-local-card.document-card-disabled .document-status {
    color: var(--accent);
    background: rgba(181, 71, 8, 0.11);
}

.pdf-local-panel,
.pdf-local-form {
    display: grid;
    gap: 18px;
}

.pdf-local-lock.is-hidden,
#pdfLocalWorkspace.is-hidden,
#pdfLocalPagesField.is-hidden,
#pdfLocalRotationField.is-hidden,
#pdfLocalCompressionField.is-hidden,
#pdfLocalOcrLanguageField.is-hidden {
    display: none;
}

.pdf-local-lock {
    padding: 20px;
    border: 1px solid rgba(181, 71, 8, 0.24);
    border-radius: 8px;
    background: #fffaf5;
}

.pdf-local-lock h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.25;
}

.pdf-local-lock p:not(.eyebrow) {
    margin: 12px 0 18px;
    color: var(--muted);
    line-height: 1.5;
}

.pdf-local-note {
    display: grid;
    gap: 5px;
    padding: 13px 15px;
    border-left: 3px solid var(--success);
    color: var(--muted);
    background: rgba(4, 120, 87, 0.07);
    font-size: 0.92rem;
    line-height: 1.45;
}

.pdf-local-note strong {
    color: var(--success);
}

.pdf-local-tool-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.pdf-local-tool {
    min-height: 116px;
    display: grid;
    align-content: start;
    gap: 7px;
    padding: 15px;
    border: 1px solid var(--border);
    color: var(--text);
    background: #ffffff;
    text-align: left;
}

.pdf-local-tool:hover,
.pdf-local-tool.is-active {
    border-color: var(--primary);
    color: var(--text);
    background: var(--surface-soft);
}

.pdf-local-tool:disabled,
.pdf-local-tool.pdf-local-tool-blocked {
    cursor: not-allowed;
    opacity: 0.58;
}

.pdf-tool-quota-badge {
    border-color: rgba(37, 99, 235, 0.24);
    color: #1d4ed8;
    background: rgba(219, 234, 254, 0.88);
}

.pdf-tool-quota-badge.is-empty {
    border-color: rgba(185, 28, 28, 0.18);
    color: #991b1b;
    background: rgba(254, 226, 226, 0.9);
}

.pdf-local-tool span,
.pdf-local-form small {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 400;
    line-height: 1.45;
}

.pdf-local-form {
    margin-top: 20px;
}

.pdf-local-preview {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.pdf-local-preview.is-hidden {
    display: none;
}

.pdf-local-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.pdf-local-preview-header div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.pdf-local-preview-header span {
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.4;
}

.pdf-local-preview .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 42px;
    padding: 0 16px;
    text-decoration: none;
}

.pdf-local-preview iframe {
    width: 100%;
    height: min(68vh, 720px);
    min-height: 420px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
}

body.pdf-tools-open {
    background: #0f172a;
}

body.pdf-tools-open .app {
    width: min(1240px, calc(100% - 32px));
    padding: 28px 0 56px;
}

.pdf-local-view {
    color: #f8fafc;
}

.pdf-local-view .generator-bar {
    align-items: center;
    margin-bottom: 22px;
}

.pdf-local-view .generator-bar .secondary-button {
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.84);
}

.pdf-local-view .user-menu {
    color: #94a3b8;
}

.pdf-local-view .intro {
    margin-bottom: 20px;
}

.pdf-local-view .intro h1 {
    color: #f8fafc;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.pdf-local-view .descricao {
    margin-top: 12px;
    color: #aebdd0;
    font-size: 0.98rem;
}

.pdf-local-view .pdf-local-panel {
    padding: 18px;
    border-color: rgba(148, 163, 184, 0.18);
    background: #1e293b;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.28);
}

.pdf-local-workspace-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    align-items: start;
    gap: 18px;
    margin-top: 18px;
}

.pdf-local-tools-panel,
.pdf-local-editor-panel {
    min-width: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.42);
}

.pdf-local-tools-panel .document-home-kicker,
.pdf-local-editor-panel .document-home-kicker {
    margin: 0 0 12px;
}

.pdf-local-tools-panel .pdf-local-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
}

.pdf-local-view .pdf-local-tool {
    border-color: rgba(148, 163, 184, 0.22);
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.88);
}

.pdf-local-view .pdf-local-tool:hover,
.pdf-local-view .pdf-local-tool.is-active {
    border-color: #60a5fa;
    color: #f8fafc;
    background: rgba(30, 64, 175, 0.3);
}

.pdf-local-view .pdf-local-tool span,
.pdf-local-view .pdf-local-form small {
    color: #aebdd0;
}

.pdf-local-view .pdf-local-form {
    margin-top: 0;
}

.pdf-local-view .field span {
    color: #e2e8f0;
}

.pdf-local-view input,
.pdf-local-view select {
    border-color: rgba(148, 163, 184, 0.24);
    color: #f8fafc;
    background: rgba(15, 23, 42, 0.72);
}

.pdf-local-view .pdf-local-preview {
    border-color: rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.72);
}

.pdf-local-view .pdf-local-preview-header span {
    color: #aebdd0;
}

@media (max-width: 640px) {
    .pdf-local-preview-header {
        align-items: stretch;
        flex-direction: column;
    }

    .pdf-local-preview .secondary-button {
        width: 100%;
    }

    .pdf-local-preview iframe {
        height: 62vh;
        min-height: 340px;
    }
}

/* ===== AJUSTES DE EXCLUSIVIDADE, ADMIN E MOBILE ===== */

.popular-document.is-hidden {
    display: none;
}

.dashboard-stat-card {
    display: grid;
    justify-items: center;
    text-align: center;
}

.dashboard-document-favorite-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 7px;
    min-width: 0;
}

.dashboard-document-favorite-remove {
    display: grid;
    width: 42px;
    min-height: 42px;
    place-items: center;
    align-self: stretch;
    padding: 0;
    border: 1px solid rgba(250, 204, 21, 0.3);
    color: #facc15;
    background: rgba(133, 77, 14, 0.28);
}

.dashboard-document-favorite-remove:hover {
    color: #fef08a;
    background: rgba(133, 77, 14, 0.48);
}

.dashboard-document-favorite-remove svg {
    width: 17px;
    height: 17px;
}

body.admin-access-open {
    background: #0f172a;
}

body.admin-access-open .app {
    width: min(1180px, calc(100% - 32px));
    padding: 28px 0 56px;
}

.admin-view {
    color: #f8fafc;
}

.admin-view .generator-bar {
    align-items: center;
    margin-bottom: 22px;
}

.admin-view .secondary-button {
    border-color: rgba(148, 163, 184, 0.26);
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.84);
}

.admin-view .user-menu,
.admin-view .descricao,
.admin-view .admin-users-header p,
.admin-view .admin-user-meta {
    color: #aebdd0;
}

.admin-view .intro {
    margin-bottom: 20px;
}

.admin-view .intro h1 {
    color: #f8fafc;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.admin-view .form-panel {
    border-color: rgba(148, 163, 184, 0.18);
    background: #1e293b;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.28);
}

.admin-view .section-title,
.admin-view .admin-users-header h2,
.admin-view .admin-user-item strong {
    color: #f8fafc;
}

.admin-view .field > span {
    color: #cbd5e1;
}

.admin-document-access {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.32);
}

.admin-document-access legend {
    padding: 0 6px;
    color: #f8fafc;
    font-size: 0.98rem;
    font-weight: 800;
}

.admin-document-access p {
    margin: 0;
    color: #94a3b8;
    line-height: 1.45;
}

.admin-document-access-all,
.admin-document-access-option {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    color: #e2e8f0;
    font-size: 0.88rem;
    font-weight: 700;
}

.admin-document-access-all input,
.admin-document-access-option input {
    width: 18px;
    min-height: 18px;
    flex: 0 0 auto;
    margin: 0;
    accent-color: #2563eb;
}

.admin-document-access-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.admin-document-access-option {
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 7px;
    background: rgba(17, 24, 39, 0.72);
}

.admin-document-access-option:has(input:disabled) {
    opacity: 0.65;
}

.admin-view input,
.admin-view select,
.admin-view textarea {
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    background: #111827;
}

.admin-view input::placeholder,
.admin-view textarea::placeholder {
    color: #64748b;
}

.admin-view input:focus,
.admin-view select:focus,
.admin-view textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

.admin-view .actions {
    border-top-color: rgba(148, 163, 184, 0.16);
}

.admin-view .admin-user-item {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.52);
}

.admin-view .admin-user-avatar {
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.2);
}

.admin-view .empty-state {
    border-color: rgba(148, 163, 184, 0.25);
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.42);
}

@media (max-width: 700px) {
    body.admin-access-open .app {
        width: min(100% - 20px, 620px);
        padding: 20px 0 34px;
    }

    .document-home-header {
        align-items: stretch;
    }

    .document-greeting {
        align-items: flex-start;
    }

    .document-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .document-view .plan-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .document-view .plan-actions button {
        width: 100%;
    }

    .admin-view .generator-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-view .user-menu {
        align-items: stretch;
        justify-content: flex-start;
    }

    .admin-view .admin-user-item {
        grid-template-columns: 1fr;
    }

    .admin-view .admin-user-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .admin-document-access-list {
        grid-template-columns: 1fr;
    }

    .admin-view .admin-user-actions button {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .support-chat-button {
        width: auto;
    }

    .support-chat-heading .icon-button,
    .payment-close {
        width: 42px;
    }
}

/* ===== COBRANÇA E ATENDIMENTO ===== */

.payment-actions-stacked {
    display: grid;
    grid-template-columns: 1fr;
}

.payment-proof-form {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.support-chat-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 15px;
    border: 1px solid rgba(147, 197, 253, 0.35);
    color: #ffffff;
    background: #2563eb;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.3);
}

body.document-home-open .support-chat-button {
    bottom: 88px;
}

.support-chat-button svg {
    width: 18px;
    height: 18px;
}

.support-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(6px);
}

.support-chat-modal.is-hidden,
.support-guest-fields.is-hidden {
    display: none;
}

.support-chat-card {
    width: min(100%, 620px);
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: auto auto minmax(120px, 1fr) auto;
    overflow: hidden;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    color: #f8fafc;
    background: #1e293b;
    box-shadow: 0 24px 50px rgba(2, 6, 23, 0.44);
}

.support-chat-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.support-chat-heading h2 {
    margin: 0;
    font-size: 1.25rem;
}

.support-chat-description {
    margin: 8px 0 14px;
    color: #94a3b8;
    font-size: 0.84rem;
    line-height: 1.45;
}

.support-chat-messages {
    min-height: 120px;
    max-height: 270px;
    display: grid;
    align-content: start;
    gap: 8px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.45);
}

.support-chat-empty {
    margin: 0;
    color: #94a3b8;
    font-size: 0.84rem;
    line-height: 1.5;
}

.support-chat-bubble {
    width: min(88%, 430px);
    padding: 9px 10px;
    border-radius: 7px;
    color: #e2e8f0;
    background: #334155;
}

.support-chat-bubble.is-customer {
    justify-self: end;
    background: #1d4ed8;
}

.support-chat-bubble strong,
.support-chat-bubble time,
.support-attachment-label {
    display: block;
}

.support-chat-bubble strong {
    font-size: 0.75rem;
}

.support-chat-bubble p {
    margin: 5px 0;
    font-size: 0.86rem;
    line-height: 1.45;
}

.support-chat-bubble time {
    margin-top: 5px;
    color: #cbd5e1;
    font-size: 0.68rem;
}

.support-attachment-label {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow-wrap: anywhere;
    color: #dbeafe;
    font-size: 0.75rem;
}

.support-attachment-label svg {
    width: 14px;
    height: 14px;
}

.support-chat-form {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.support-guest-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.support-chat-form .field > span {
    color: #cbd5e1;
    font-size: 0.78rem;
}

.support-chat-form input,
.support-chat-form textarea {
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    background: #111827;
}

.admin-support-list {
    display: grid;
    gap: 10px;
}

.admin-support-conversation {
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.48);
}

.admin-support-conversation summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    cursor: pointer;
    list-style: none;
}

.admin-support-conversation summary::-webkit-details-marker {
    display: none;
}

.admin-support-conversation summary strong,
.admin-support-conversation summary small {
    display: block;
    overflow-wrap: anywhere;
}

.admin-support-conversation summary strong {
    color: #f8fafc;
}

.admin-support-conversation summary small {
    margin-top: 3px;
    color: #94a3b8;
}

.admin-support-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 7px;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.2);
}

.admin-support-avatar svg {
    width: 17px;
    height: 17px;
}

.admin-support-count,
.support-category-pill {
    width: fit-content;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
}

.admin-support-count {
    color: #dbeafe;
    background: rgba(37, 99, 235, 0.28);
}

.support-category-pill {
    display: block;
    margin-top: 7px;
    color: #fef3c7;
    background: rgba(180, 83, 9, 0.28);
}

.admin-support-thread {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
}

.admin-support-message {
    padding: 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 7px;
    background: rgba(30, 41, 59, 0.78);
}

.admin-support-message.is-admin {
    border-color: rgba(96, 165, 250, 0.24);
    background: rgba(30, 64, 175, 0.18);
}

.admin-support-message-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-support-message-heading time {
    color: #94a3b8;
    font-size: 0.7rem;
}

.admin-support-message p {
    margin: 7px 0 0;
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.45;
}

.support-download-button,
.admin-support-reply {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 8px;
}

.support-download-button svg,
.admin-support-reply svg {
    width: 15px;
    height: 15px;
}

@media (max-width: 640px) {
    .support-chat-button {
        right: 10px;
        bottom: 10px;
    }

    body.document-home-open .support-chat-button {
        right: 10px;
        bottom: 76px;
    }

    .support-chat-modal {
        align-items: start;
        padding: 8px;
        overflow-y: auto;
    }

    .support-chat-card {
        max-height: none;
        padding: 14px;
    }

    .support-guest-fields {
        grid-template-columns: 1fr;
    }

    .support-chat-messages {
        max-height: 230px;
    }

    .support-chat-form button,
    .payment-proof-form button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .document-home-header h1,
    .admin-view .intro h1 {
        overflow-wrap: anywhere;
    }

    .document-greeting {
        gap: 10px;
    }

    .document-greeting-icon {
        width: 54px;
        height: 54px;
    }

    .document-user-email {
        max-width: calc(100vw - 88px);
    }

    .plan-summary-main {
        align-items: flex-start;
    }

    .version-highlights {
        display: grid;
    }

    .dashboard-document-item {
        min-width: 0;
    }

    .profile-card {
        padding: 15px;
    }

    .admin-view .form-panel {
        padding: 16px;
    }

    .admin-view .admin-user-identity {
        align-items: flex-start;
    }

    .admin-view .admin-users-header .secondary-button {
        width: 100%;
    }
}

/* ===== EXPERIÊNCIA PREMIUM DO PRODUTO ===== */

body.auth-open {
    background:
        radial-gradient(circle at 50% 2%, rgba(56, 189, 248, 0.16), transparent 34%),
        radial-gradient(circle at 14% 78%, rgba(37, 99, 235, 0.16), transparent 28%),
        #0b1220;
}

body.auth-open .app {
    width: min(460px, calc(100% - 28px));
    padding: 34px 0;
}

.auth-view {
    grid-template-columns: 1fr;
    gap: 22px;
}

.auth-copy {
    max-width: none;
    color: #f8fafc;
    text-align: center;
}

.auth-logo-mark {
    display: grid;
    width: 66px;
    height: 66px;
    place-items: center;
    margin: 0 auto 15px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 8px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.22);
    box-shadow: 0 12px 30px rgba(2, 6, 23, 0.24);
}

.auth-logo-mark svg {
    width: 34px;
    height: 34px;
}

.auth-brand-logo {
    display: block;
    width: min(292px, 74vw);
    max-height: 108px;
    object-fit: contain;
    margin: 0 auto 10px;
    padding: 10px 14px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.34), rgba(37, 99, 235, 0.10));
    box-shadow: var(--brand-logo-glow), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    filter: drop-shadow(0 16px 34px rgba(37, 99, 235, 0.20));
}

.auth-copy h1 {
    margin: 0;
    color: #f8fafc;
    font-size: 2rem;
}

.auth-copy .descricao {
    max-width: 420px;
    margin: 10px auto 0;
    color: #94a3b8;
    line-height: 1.55;
}

.auth-panel-heading {
    margin-bottom: 18px;
}

.auth-panel-heading h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.15rem;
}

.auth-panel-heading p {
    margin: 6px 0 0;
    color: #94a3b8;
    font-size: 0.88rem;
}

body.auth-open .auth-panel {
    border-color: rgba(148, 163, 184, 0.2);
    background: #1e293b;
    box-shadow: 0 22px 46px rgba(2, 6, 23, 0.34);
}

body.auth-open .login-form .field > span {
    color: #cbd5e1;
}

body.auth-open .login-form input {
    border-color: rgba(148, 163, 184, 0.24);
    color: #f8fafc;
    background: #111827;
}

.icon-button {
    display: grid;
    width: 42px;
    height: 42px;
    min-height: 42px;
    flex: 0 0 auto;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 7px;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.9);
}

.icon-button svg {
    width: 19px;
    height: 19px;
}

.document-header-actions,
.pdf-local-tool-heading,
.admin-user-identity {
    display: flex;
    align-items: center;
}

.document-header-actions {
    gap: 9px;
}

.notification-menu {
    position: relative;
}

.notification-button {
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    display: grid;
    min-width: 19px;
    height: 19px;
    place-items: center;
    padding: 0 4px;
    border: 2px solid #0f172a;
    border-radius: 999px;
    color: #ffffff;
    background: #ef4444;
    font-size: 0.64rem;
    font-weight: 800;
}

.notification-badge.is-hidden {
    display: none;
}

.notification-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 35;
    width: min(330px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    background: #1e293b;
    box-shadow: 0 20px 36px rgba(2, 6, 23, 0.38);
}

.notification-popover.is-hidden {
    display: none;
}

.notification-popover-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.notification-popover-heading span {
    color: #93c5fd;
    font-size: 0.75rem;
    font-weight: 800;
}

.notification-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #cbd5e1;
    font-size: 0.84rem;
}

.notification-item + .notification-item {
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.notification-item svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: #60a5fa;
}

.global-document-search {
    display: block;
    width: 100%;
    margin-bottom: 22px;
}

.global-document-search input {
    min-height: 48px;
}

.dashboard-home-section.is-hidden,
.dashboard-page-section.is-hidden,
.document-catalog.is-hidden {
    display: none;
}

.dashboard-statistics,
.recent-documents,
.version-card,
.dashboard-page-section {
    margin-top: 28px;
}

.dashboard-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: #1e293b;
}

.dashboard-stat-icon,
.dashboard-document-item-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 7px;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.18);
}

.dashboard-stat-icon {
    width: 40px;
    height: 40px;
}

.dashboard-stat-icon svg,
.dashboard-document-item-icon svg {
    width: 19px;
    height: 19px;
}

.dashboard-stat-card strong,
.dashboard-stat-card span {
    display: block;
}

.dashboard-stat-card strong {
    color: #f8fafc;
    font-size: 1.4rem;
}

.dashboard-stat-card div > span {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 0.78rem;
}

.dashboard-document-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.dashboard-document-list-large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-document-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 8px 11px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
    background: #1e293b;
    text-align: left;
}

.dashboard-document-item:hover {
    border-color: rgba(96, 165, 250, 0.64);
    background: #25344b;
}

.dashboard-document-item-icon {
    width: 34px;
    height: 34px;
}

.dashboard-document-item > span:nth-child(2) {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.3;
}

.dashboard-document-item > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    color: #94a3b8;
}

.dashboard-document-empty {
    grid-column: 1 / -1;
    margin: 0;
    padding: 15px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    color: #94a3b8;
    background: rgba(30, 41, 59, 0.5);
    font-size: 0.86rem;
    line-height: 1.45;
}

.version-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 17px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 8px;
    background: #1e293b;
}

.version-card-icon {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 8px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.2);
}

.version-card-icon svg {
    width: 22px;
    height: 22px;
}

.version-card h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.05rem;
}

.version-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    margin-top: 8px;
}

.version-highlights span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #cbd5e1;
    font-size: 0.78rem;
}

.version-highlights svg {
    width: 14px;
    height: 14px;
    color: #86efac;
}

.version-card time {
    display: block;
    margin-top: 9px;
    color: #94a3b8;
    font-size: 0.74rem;
}

.version-card .secondary-button {
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.4);
}

.document-card-wrapper {
    position: relative;
    min-width: 0;
}

.document-card-wrapper.contains-hidden-card,
.document-card-wrapper.is-filtered-out {
    display: none;
}

.document-card-wrapper .document-card {
    width: 100%;
    height: 100%;
}

.document-view .document-card-wrapper.has-favorite-action .document-card {
    padding-right: 48px;
}

.document-favorite-button {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    display: grid;
    width: 30px;
    height: 30px;
    min-height: 30px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 6px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.7);
}

.document-favorite-button:hover,
.document-favorite-button.is-favorite {
    border-color: rgba(250, 204, 21, 0.5);
    color: #facc15;
    background: rgba(133, 77, 14, 0.34);
}

.document-favorite-button svg {
    width: 16px;
    height: 16px;
}

.updates-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(6px);
}

.updates-modal.is-hidden {
    display: none;
}

.updates-modal-card {
    width: min(100%, 680px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    color: #f8fafc;
    background: #1e293b;
    box-shadow: 0 24px 50px rgba(2, 6, 23, 0.42);
}

.updates-modal-heading,
.release-note-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.updates-modal-heading h2 {
    margin: 0;
    font-size: 1.35rem;
}

.release-note {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid rgba(148, 163, 184, 0.17);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.34);
}

.release-note-heading time,
.release-note li {
    color: #cbd5e1;
    font-size: 0.84rem;
    line-height: 1.55;
}

.release-note h3 {
    margin: 14px 0 5px;
    color: #93c5fd;
    font-size: 0.86rem;
}

.release-note ul {
    margin: 0;
    padding-left: 18px;
}

.profile-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 15px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    background: #1e293b;
}

.profile-avatar {
    display: grid;
    width: 54px;
    height: 54px;
    min-height: 54px;
    overflow: hidden;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 8px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.22);
    cursor: pointer;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar img.is-hidden,
.profile-avatar #profileAvatarFallback.is-hidden,
.profile-avatar-preview img.is-hidden,
.profile-avatar-preview #profileAvatarPreviewFallback.is-hidden,
.profile-avatar-modal-actions .is-hidden {
    display: none;
}

.profile-avatar:hover {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(37, 99, 235, 0.36);
}

.profile-avatar-modal {
    position: fixed;
    inset: 0;
    z-index: 1250;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.82);
    backdrop-filter: blur(7px);
}

.profile-avatar-modal.is-hidden {
    display: none;
}

.profile-avatar-modal-card {
    width: min(100%, 410px);
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 9px;
    color: #f8fafc;
    background: #1e293b;
    box-shadow: 0 24px 50px rgba(2, 6, 23, 0.48);
}

.profile-avatar-modal-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.profile-avatar-modal-heading h2 {
    margin: 0;
    font-size: 1.28rem;
}

.profile-avatar-preview {
    display: grid;
    width: min(100%, 260px);
    aspect-ratio: 1;
    overflow: hidden;
    place-items: center;
    margin: 20px auto;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 14px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.2);
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-preview svg {
    width: 76px;
    height: 76px;
}

.profile-avatar-modal-actions {
    display: grid;
    gap: 9px;
}

.profile-avatar-modal-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.profile-avatar-modal-actions svg {
    width: 17px;
    height: 17px;
}

.profile-avatar-message {
    margin: 12px 0 0;
    font-size: 0.82rem;
}

.profile-heading h2 {
    margin: 0;
    color: #f8fafc;
}

.profile-heading p:last-child {
    margin: 6px 0 0;
    color: #94a3b8;
    overflow-wrap: anywhere;
}

.profile-details {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 4px 0 0;
}

.profile-details div {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.34);
}

.profile-details dt {
    color: #94a3b8;
    font-size: 0.72rem;
}

.profile-details dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    color: #f8fafc;
    font-size: 0.9rem;
    font-weight: 800;
}

.profile-theme-panel {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 4px;
    padding: 14px;
    border: 1px solid rgba(147, 197, 253, 0.22);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.46);
}

.profile-theme-panel.is-hidden {
    display: none;
}

.profile-theme-panel strong {
    display: block;
    margin-top: 3px;
    color: #f8fafc;
    font-size: 1rem;
}

.profile-theme-panel p {
    margin: 5px 0 0;
    color: #aebdd0;
    font-size: 0.84rem;
    line-height: 1.45;
}

.profile-theme-kicker {
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-theme-panel .secondary-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
}

.profile-theme-panel .secondary-button[aria-pressed="true"] {
    border-color: rgba(125, 211, 252, 0.58);
    color: #e0f2fe;
    background: rgba(14, 165, 233, 0.22);
}

body.liquid-glass-theme.document-home-open {
    background:
        radial-gradient(circle at 18% 10%, rgba(226, 232, 240, 0.24), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(148, 163, 184, 0.22), transparent 30%),
        linear-gradient(135deg, #d7dde5 0%, #7f8da0 42%, #111827 100%);
}

body.liquid-glass-theme .document-view .plan-summary-card,
body.liquid-glass-theme .document-view .version-card,
body.liquid-glass-theme .document-view .profile-card,
body.liquid-glass-theme .document-view .popular-document,
body.liquid-glass-theme .document-view .dashboard-stat-card,
body.liquid-glass-theme .document-view .dashboard-document-item,
body.liquid-glass-theme .document-view .document-card,
body.liquid-glass-theme .profile-theme-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(240, 249, 255, 0.54);
    border-radius: 10px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(148, 163, 184, 0.14) 48%, rgba(15, 23, 42, 0.2)),
        rgba(226, 232, 240, 0.08);
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.76),
        inset -1px -1px 2px rgba(15, 23, 42, 0.34),
        inset 0 -10px 18px rgba(255, 255, 255, 0.09),
        0 16px 30px rgba(2, 6, 23, 0.34),
        0 2px 5px rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(28px) saturate(160%);
}

body.liquid-glass-theme .document-view .document-card::before,
body.liquid-glass-theme .document-view .plan-summary-card::before,
body.liquid-glass-theme .document-view .profile-card::before,
body.liquid-glass-theme .document-view .popular-document::before,
body.liquid-glass-theme .document-view .dashboard-stat-card::before,
body.liquid-glass-theme .bottom-navigation::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.42), transparent 24%, rgba(255, 255, 255, 0.08) 52%, transparent 75%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.54), transparent 36%);
    opacity: 0.68;
}

body.liquid-glass-theme .document-view .document-card::after,
body.liquid-glass-theme .document-view .plan-summary-card::after,
body.liquid-glass-theme .document-view .profile-card::after,
body.liquid-glass-theme .bottom-navigation::after {
    content: "";
    position: absolute;
    right: 12%;
    bottom: 6px;
    left: 12%;
    z-index: 0;
    height: 12px;
    pointer-events: none;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.2) 42%, transparent 72%);
    filter: blur(2px);
    opacity: 0.62;
}

body.liquid-glass-theme .document-view .document-card > *,
body.liquid-glass-theme .document-view .plan-summary-card > *,
body.liquid-glass-theme .document-view .profile-card > *,
body.liquid-glass-theme .document-view .popular-document > *,
body.liquid-glass-theme .document-view .dashboard-stat-card > *,
body.liquid-glass-theme .bottom-navigation > * {
    position: relative;
    z-index: 1;
}

body.liquid-glass-theme .document-view .document-card:hover,
body.liquid-glass-theme .document-view .popular-document:hover,
body.liquid-glass-theme .document-view .dashboard-document-item:hover {
    border-color: rgba(255, 255, 255, 0.82);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(148, 163, 184, 0.18) 48%, rgba(15, 23, 42, 0.16)),
        rgba(226, 232, 240, 0.12);
    transform: translateY(-2px);
}

body.liquid-glass-theme .document-card-icon,
body.liquid-glass-theme .dashboard-document-item-icon,
body.liquid-glass-theme .plan-summary-icon,
body.liquid-glass-theme .dashboard-stat-icon,
body.liquid-glass-theme .version-card-icon {
    border: 1px solid rgba(255, 255, 255, 0.52);
    color: #f8fafc;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(71, 85, 105, 0.16));
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.7),
        inset -1px -1px 2px rgba(15, 23, 42, 0.26),
        0 8px 16px rgba(2, 6, 23, 0.2);
    backdrop-filter: blur(18px) saturate(150%);
}

body.liquid-glass-theme .document-view .document-status,
body.liquid-glass-theme .status-pill,
body.liquid-glass-theme .plan-pill {
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
    backdrop-filter: blur(14px);
}

body.liquid-glass-theme .bottom-navigation {
    position: fixed;
    right: 50%;
    bottom: 18px;
    z-index: 20;
    overflow: hidden;
    border: 1px solid rgba(240, 249, 255, 0.58);
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(51, 65, 85, 0.18));
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.74),
        inset -1px -1px 2px rgba(15, 23, 42, 0.34),
        0 18px 34px rgba(2, 6, 23, 0.38);
    transform: translateX(50%);
    backdrop-filter: blur(26px) saturate(160%);
}

body.liquid-glass-theme .bottom-navigation-item {
    border-radius: 9px;
    color: #dbeafe;
}

body.liquid-glass-theme .bottom-navigation-item.is-active {
    border: 1px solid rgba(255, 255, 255, 0.62);
    color: #0f172a;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(203, 213, 225, 0.4)),
        rgba(255, 255, 255, 0.24);
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.9),
        inset -1px -1px 2px rgba(15, 23, 42, 0.14),
        0 6px 16px rgba(2, 6, 23, 0.2);
}

body.liquid-glass-theme .document-search,
body.liquid-glass-theme .document-view .document-filter {
    border-color: rgba(255, 255, 255, 0.46);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(71, 85, 105, 0.14));
    box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.48);
    backdrop-filter: blur(20px) saturate(150%);
}

.pdf-local-tool-heading {
    gap: 7px;
    color: var(--text);
}

.pdf-local-tool-heading svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    color: var(--primary);
}

.pdf-tool-badge {
    margin-left: auto;
    padding: 3px 5px;
    border-radius: 999px;
    color: #1e40af;
    background: #dbeafe;
    font-size: 0.58rem;
    font-style: normal;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pdf-tool-badge-hot {
    color: #9a3412;
    background: #ffedd5;
}

.pdf-tool-badge-new {
    color: #166534;
    background: #dcfce7;
}

.admin-user-identity {
    gap: 11px;
    min-width: 0;
}

.admin-user-avatar {
    display: grid;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 7px;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.admin-user-avatar svg,
.admin-user-actions svg {
    width: 16px;
    height: 16px;
}

.admin-user-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 840px) {
    .dashboard-document-list-large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .dashboard-stat-grid,
    .dashboard-document-list,
    .dashboard-document-list-large,
    .profile-details {
        grid-template-columns: 1fr;
    }

    .version-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .version-card .secondary-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .document-header-actions {
        align-self: flex-start;
    }
}

@media (max-width: 520px) {
    .updates-modal {
        align-items: start;
        padding: 10px;
        overflow-y: auto;
    }

    .updates-modal-card {
        max-height: none;
        padding: 15px;
    }

    .notification-popover {
        right: auto;
        left: 0;
    }
}

/* ===== PAINEL INICIAL DE DOCUMENTOS ===== */

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

body.document-home-open {
    background: #0f172a;
}

body.document-home-open .app {
    width: min(1240px, calc(100% - 32px));
    padding: 30px 0 112px;
}

.document-view {
    color: #f8fafc;
}

.document-home-header,
.document-greeting,
.plan-summary-card,
.plan-summary-main,
.plan-progress-heading,
.document-section-heading,
.popular-document,
.document-card-footer,
.document-status,
.document-open,
.home-logout-button,
.plan-actions button,
.bottom-navigation-item {
    display: flex;
    align-items: center;
}

.document-home-header {
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.document-header-left {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
}

.document-brand-logo {
    width: clamp(116px, 16vw, 178px);
    max-height: 56px;
    object-fit: contain;
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.30), rgba(37, 99, 235, 0.08));
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.document-greeting {
    gap: 14px;
}

.document-greeting-icon,
.plan-summary-icon,
.document-card-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 8px;
}

.document-greeting-icon {
    width: 54px;
    height: 54px;
    overflow: hidden;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.26);
}

.document-greeting-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.document-greeting-icon img.is-hidden,
.document-greeting-icon #documentGreetingAvatarFallback.is-hidden {
    display: none;
}

.document-greeting-icon svg,
.plan-summary-icon svg {
    width: 24px;
    height: 24px;
}

.document-home-kicker,
.plan-summary-label {
    margin: 0 0 4px;
    color: #94a3b8;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.document-home-header h1 {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    line-height: 1.1;
}

.document-user-email {
    display: block;
    margin-top: 5px;
    color: #94a3b8;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.document-view .home-logout-button {
    gap: 8px;
    border-color: rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.82);
}

.home-logout-button svg,
.plan-actions svg,
.document-status svg,
.document-open svg {
    width: 16px;
    height: 16px;
}

.plan-summary-card {
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(240px, 1.1fr) auto;
    gap: 24px;
    padding: 18px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    border-radius: 8px;
    background: #1e293b;
    box-shadow: 0 14px 30px rgba(2, 6, 23, 0.2);
}

.plan-summary-main {
    gap: 12px;
}

.plan-summary-icon {
    width: 44px;
    height: 44px;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.22);
}

.plan-summary-card h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.18rem;
    line-height: 1.2;
}

.plan-summary-remaining {
    margin: 5px 0 0;
    color: #bbf7d0;
    font-size: 0.94rem;
    font-weight: 700;
}

.plan-summary-progress {
    align-self: center;
}

.plan-progress-heading {
    justify-content: space-between;
    gap: 12px;
    color: #cbd5e1;
    font-size: 0.82rem;
}

.plan-progress-heading strong {
    color: #f8fafc;
}

.plan-progress-track {
    height: 8px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
}

.plan-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #22c55e;
    transition: width 0.3s ease;
}

.plan-summary-progress p {
    margin: 7px 0 0;
    color: #94a3b8;
    font-size: 0.78rem;
}

.document-view .plan-actions {
    align-self: center;
    margin: 0;
}

.document-view .plan-actions button {
    min-height: 38px;
    gap: 7px;
    padding: 0 13px;
    border-radius: 6px;
    font-size: 0.84rem;
}

.document-view .plan-actions .secondary-button {
    border-color: rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.38);
}

.document-view .access-status {
    margin: 14px 0 0;
}

.document-view .access-status:not(.error) {
    display: none;
}

.popular-documents,
.document-catalog {
    margin-top: 30px;
}

.document-section-heading {
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 13px;
}

.document-section-heading h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.24rem;
    line-height: 1.2;
}

.popular-document-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.popular-document {
    justify-content: flex-start;
    gap: 10px;
    min-height: 58px;
    padding: 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #e2e8f0;
    background: #1e293b;
    text-align: left;
}

.popular-document:hover {
    border-color: rgba(96, 165, 250, 0.65);
    color: #ffffff;
    background: #25344b;
}

.popular-document svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    color: #60a5fa;
}

.popular-document span {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
}

.popular-document svg:last-child {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

.document-catalog-heading {
    align-items: end;
}

.document-search {
    position: relative;
    width: min(100%, 360px);
}

.document-search svg {
    position: absolute;
    top: 50%;
    left: 13px;
    width: 18px;
    height: 18px;
    color: #94a3b8;
    transform: translateY(-50%);
    pointer-events: none;
}

.document-search input {
    min-height: 42px;
    padding: 9px 14px 9px 41px;
    border-color: rgba(148, 163, 184, 0.28);
    color: #f8fafc;
    background: #1e293b;
    font-size: 0.9rem;
}

.document-search input::placeholder {
    color: #94a3b8;
}

.document-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.document-filter {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    color: #cbd5e1;
    background: transparent;
    font-size: 0.8rem;
}

.document-filter:hover,
.document-filter.is-active {
    border-color: #2563eb;
    color: #ffffff;
    background: #2563eb;
}

.document-view .document-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.document-view .document-card {
    min-height: 158px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    align-content: start;
    gap: 11px 12px;
    padding: 15px;
    border-color: rgba(148, 163, 184, 0.18);
    color: #f8fafc;
    background: #1e293b;
    box-shadow: 0 10px 22px rgba(2, 6, 23, 0.14);
}

.document-view .document-card:hover {
    border-color: rgba(96, 165, 250, 0.68);
    background: #25344b;
}

.document-card.is-filtered-out {
    display: none;
}

.document-card-icon {
    width: 40px;
    height: 40px;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.18);
}

.document-card-icon svg {
    width: 21px;
    height: 21px;
}

.document-card-copy {
    min-width: 0;
}

.document-view .document-card-copy strong {
    display: block;
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.25;
}

.document-view .document-card-copy span {
    display: block;
    margin-top: 5px;
    color: #aebdd0;
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.4;
}

.document-card-footer {
    grid-column: 1 / -1;
    align-self: end;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.document-view .document-status {
    gap: 4px;
    padding: 3px 7px;
    color: #86efac;
    background: rgba(34, 197, 94, 0.11);
    font-size: 0.67rem;
}

.document-open {
    gap: 4px;
    color: #93c5fd;
    font-size: 0.76rem;
    font-weight: 800;
}

.document-view .pdf-local-card {
    border-color: rgba(96, 165, 250, 0.45);
    background: #1b3154;
}

.document-view .admin-card .document-card-icon {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.16);
}

.document-view .admin-card .document-status {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.14);
}

.document-view .document-card-disabled {
    opacity: 0.72;
}

.document-view .document-card-disabled .document-status {
    color: #fdba74;
    background: rgba(249, 115, 22, 0.14);
}

.document-empty-state {
    margin: 0;
    padding: 18px;
    border: 1px dashed rgba(148, 163, 184, 0.32);
    border-radius: 8px;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.56);
    text-align: center;
}

.document-empty-state.is-hidden {
    display: none;
}

.bottom-navigation {
    position: fixed;
    right: 50%;
    bottom: 18px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    width: min(520px, calc(100% - 24px));
    padding: 6px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.96);
    box-shadow: 0 18px 36px rgba(2, 6, 23, 0.38);
    transform: translateX(50%);
    backdrop-filter: blur(14px);
}

.bottom-navigation-item {
    min-height: 52px;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 4px 7px;
    border-radius: 6px;
    color: #94a3b8;
    background: transparent;
    font-size: 0.68rem;
}

.bottom-navigation-item svg {
    width: 19px;
    height: 19px;
}

.bottom-navigation-item:hover,
.bottom-navigation-item.is-active {
    color: #ffffff;
    background: rgba(37, 99, 235, 0.84);
}

@media (max-width: 1040px) {
    .document-view .document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-summary-card {
        grid-template-columns: minmax(210px, 1fr) minmax(220px, 1fr);
    }

    .document-view .plan-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    body.document-home-open .app {
        width: min(100% - 20px, 620px);
        padding: 20px 0 102px;
    }

    .document-home-header,
    .document-catalog-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .home-logout-button {
        align-self: flex-start;
    }

    .plan-summary-card {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 15px;
    }

    .document-view .plan-actions {
        grid-column: auto;
    }

    .popular-document-grid,
    .document-view .document-grid {
        grid-template-columns: 1fr;
    }

    .popular-document {
        min-height: 52px;
    }

    .document-search {
        width: 100%;
    }

    .document-view .document-card {
        min-height: 138px;
    }
}

@media (max-width: 420px) {
    .document-greeting-icon {
        width: 54px;
        height: 54px;
    }

    .document-home-header h1 {
        font-size: 1.42rem;
    }

    .bottom-navigation {
        bottom: 10px;
        width: calc(100% - 16px);
    }

    .bottom-navigation-item {
        min-height: 48px;
        padding: 4px 3px;
        font-size: 0.62rem;
    }
}

/* ===== FORMULÁRIOS EM ETAPAS ===== */

body.document-generator-open {
    background: #0f172a;
}

body.document-generator-open .app {
    width: min(1180px, calc(100% - 32px));
    padding: 28px 0 56px;
}

.generator-view {
    color: #f8fafc;
}

.generator-view .generator-bar {
    align-items: center;
    margin-bottom: 22px;
}

.generator-view .generator-bar .secondary-button {
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.84);
}

.generator-view .user-menu {
    color: #94a3b8;
}

.generator-view .intro {
    margin-bottom: 20px;
}

.generator-view .intro h1 {
    color: #f8fafc;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.generator-view .descricao {
    margin-top: 12px;
    color: #aebdd0;
    font-size: 0.98rem;
}

.generator-view .form-panel {
    padding: 0;
    border-color: rgba(148, 163, 184, 0.18);
    background: #1e293b;
    box-shadow: 0 20px 48px rgba(2, 6, 23, 0.28);
}

.generator-view form {
    min-width: 0;
}

.document-wizard {
    padding: 18px 18px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    background: rgba(15, 23, 42, 0.34);
}

.wizard-heading,
.wizard-navigation,
.live-preview-heading,
.section-title,
.field > span {
    display: flex;
    align-items: center;
}

.wizard-heading {
    justify-content: space-between;
    gap: 14px;
}

.wizard-eyebrow {
    margin: 0 0 4px;
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wizard-heading h2 {
    margin: 0;
    color: #f8fafc;
    font-size: 1.08rem;
    line-height: 1.25;
}

.wizard-percent {
    flex: 0 0 auto;
    color: #bbf7d0;
    font-size: 0.82rem;
}

.wizard-progress-track {
    height: 8px;
    margin-top: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

.wizard-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #22c55e;
    transition: width 0.25s ease;
}

.wizard-step-list {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-bottom: 3px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.wizard-step-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.28);
    font-size: 0.78rem;
}

.wizard-step-button span {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 50%;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.18);
    font-size: 0.68rem;
}

.wizard-step-button:hover,
.wizard-step-button.is-active {
    border-color: #2563eb;
    color: #ffffff;
    background: #2563eb;
}

.wizard-step-button.is-complete span {
    color: #052e16;
    background: #86efac;
}

.generator-view .grid {
    padding: 20px;
    gap: 15px 16px;
}

.wizard-step-hidden {
    display: none !important;
}

.generator-view .section-title {
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    color: #f8fafc;
    font-size: 1.05rem;
}

.generator-view .section-title svg {
    width: 20px;
    height: 20px;
    color: #60a5fa;
}

.section-description {
    grid-column: 1 / -1;
    margin: -8px 0 4px;
    color: #94a3b8;
    font-size: 0.84rem;
    line-height: 1.45;
}

.generator-view .field {
    gap: 7px;
}

.generator-view .field > span {
    gap: 6px;
    color: #cbd5e1;
    font-size: 0.82rem;
}

.generator-view .field > span svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    color: #60a5fa;
}

.generator-view input,
.generator-view select,
.generator-view textarea {
    min-height: 46px;
    border-color: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    background: #111827;
}

.generator-view input::placeholder,
.generator-view textarea::placeholder {
    color: #64748b;
}

.generator-view input:focus,
.generator-view select:focus,
.generator-view textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.22);
}

.generator-view input:disabled,
.generator-view select:disabled,
.generator-view textarea:disabled {
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.6);
}

.generator-view .choice-field,
.generator-view .conditional-fields,
.generator-view .repeatable-entry {
    border-color: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.38);
}

.generator-view .choice-field legend,
.generator-view .conditional-fields h3,
.generator-view .repeatable-entry h3 {
    color: #e2e8f0;
}

.generator-view .choice-field label {
    color: #e2e8f0;
}

.generator-view .repeatable-actions {
    border-left-color: #2563eb;
    color: #cbd5e1;
    background: rgba(37, 99, 235, 0.1);
}

.generator-view .checkbox-field {
    border-color: rgba(148, 163, 184, 0.18);
    background: #111827;
}

.date-field-row {
    display: grid;
    grid-template-columns: minmax(72px, 0.7fr) minmax(140px, 1.3fr) minmax(90px, 0.85fr);
    gap: 12px;
}

.live-document-preview {
    margin: 0 20px 16px;
    padding: 16px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.54);
}

.live-preview-heading {
    gap: 10px;
}

.live-preview-heading > span {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 7px;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.18);
}

.live-preview-heading svg {
    width: 20px;
    height: 20px;
}

.live-preview-heading p {
    margin: 0 0 3px;
    color: #60a5fa;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.live-preview-heading h3 {
    margin: 0;
    color: #f8fafc;
    font-size: 1rem;
}

.live-preview-note {
    margin: 12px 0;
    color: #94a3b8;
    font-size: 0.78rem;
    line-height: 1.45;
}

.live-document-preview dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.live-document-preview dl div {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 6px;
    background: rgba(30, 41, 59, 0.72);
}

.live-document-preview dt {
    color: #94a3b8;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.live-document-preview dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: #f8fafc;
    font-size: 0.84rem;
    line-height: 1.4;
}

.live-preview-empty,
.live-preview-more {
    grid-column: 1 / -1;
    margin: 0;
    color: #94a3b8;
    font-size: 0.8rem;
    line-height: 1.45;
}

.wizard-navigation {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    padding: 0 20px 18px;
}

.wizard-navigation button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.86rem;
}

.wizard-navigation svg {
    width: 16px;
    height: 16px;
}

.wizard-navigation-position {
    align-self: center;
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 800;
}

.wizard-inline-message {
    align-self: center;
    margin: 0;
    color: #fca5a5;
    font-size: 0.78rem;
    line-height: 1.35;
}

.wizard-navigation [data-wizard-next].is-hidden {
    display: none;
}

.generator-view .actions {
    position: sticky;
    bottom: 10px;
    z-index: 5;
    margin: 0 20px 18px;
    padding: 12px;
    border: 1px solid rgba(96, 165, 250, 0.25);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 16px 30px rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(12px);
}

.generator-view .actions.wizard-actions-hidden {
    display: none;
}

.generator-view .actions button[type="submit"] {
    min-width: 210px;
    min-height: 50px;
    background: #2563eb;
}

@media (max-width: 700px) {
    body.document-generator-open .app {
        width: min(100% - 20px, 620px);
        padding: 20px 0 34px;
    }

    .generator-view .grid {
        padding: 16px;
    }

    .document-wizard {
        padding: 15px 15px 12px;
    }

    .wizard-heading {
        align-items: start;
        flex-direction: column;
        gap: 6px;
    }

    .wizard-step-list {
        margin-top: 12px;
    }

    .date-field-row {
        grid-template-columns: minmax(58px, 0.7fr) minmax(118px, 1.35fr) minmax(74px, 0.8fr);
        gap: 8px;
    }

    .live-document-preview {
        margin: 0 16px 14px;
        padding: 13px;
    }

    .live-document-preview dl {
        grid-template-columns: 1fr;
    }

    .wizard-navigation {
        grid-template-columns: auto auto 1fr;
        padding: 0 16px 16px;
    }

    .wizard-inline-message {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .generator-view .actions {
        align-items: stretch;
        margin: 0 16px 14px;
    }

    .generator-view .actions button[type="submit"] {
        width: 100%;
    }
}

.admin-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.admin-users-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.admin-users-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.admin-users-header p {
    margin: 6px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.admin-users-list {
    display: grid;
    gap: 12px;
}

.admin-user-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #ffffff;
}

.admin-user-item strong {
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 980px) {
    .pdf-local-workspace-layout {
        grid-template-columns: 1fr;
    }
}

.verified-name-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
}

.verified-name-line strong {
    margin-bottom: 0;
}

.verified-badge {
    position: relative;
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    color: #f4b400;
    filter: drop-shadow(0 2px 5px rgba(180, 117, 0, 0.48));
    flex: 0 0 auto;
    margin-left: 10px;
    vertical-align: middle;
    animation: verified-badge-glow 2.2s ease-in-out infinite;
}

.verified-name-line .verified-badge {
    margin-left: 0;
}

.verified-badge svg {
    width: 100%;
    height: 100%;
}

.verified-badge-medallion {
    fill: currentColor;
    stroke: #fff0a8;
    stroke-width: 0.7;
}

.verified-badge-check {
    fill: none;
    stroke: #ffffff;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
}

.verified-badge::after {
    position: absolute;
    top: -45%;
    left: -95%;
    width: 56%;
    height: 190%;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255, 221, 84, 0.48), rgba(255, 255, 255, 0.98), rgba(255, 211, 51, 0.58), transparent);
    transform: rotate(20deg);
    animation: verified-badge-shine 2.2s ease-in-out infinite;
}

@keyframes verified-badge-shine {
    0%,
    36% {
        transform: translateX(0) rotate(20deg);
    }

    76%,
    100% {
        transform: translateX(470%) rotate(20deg);
    }
}

@keyframes verified-badge-glow {
    0%,
    36%,
    100% {
        filter: drop-shadow(0 2px 5px rgba(180, 117, 0, 0.48));
    }

    62% {
        filter: drop-shadow(0 2px 8px rgba(255, 193, 7, 0.92));
    }
}

@media (prefers-reduced-motion: reduce) {
    .verified-badge,
    .verified-badge::after {
        animation: none;
    }
}

.admin-user-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.plan-pill {
    position: relative;
    overflow: hidden;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    color: var(--primary);
    background: rgba(31, 111, 235, 0.1);
    font-weight: 700;
}

.plan-theme-test3min,
.plan-theme-test5min {
    color: #475467;
    background: #f2f4f7;
}

.plan-theme-trial7 {
    color: #8a4b18;
    background: linear-gradient(135deg, #f7dfc8, #c98842);
}


.plan-theme-test10c {
    color: #065f46;
    background: linear-gradient(135deg, #ecfdf5, #a7f3d0);
}

.plan-theme-basic30 {
    color: #475467;
    background: linear-gradient(135deg, #f8fafc, #b8c2cc);
}

.plan-theme-plus90 {
    color: #354052;
    background: linear-gradient(135deg, #eef4ff, #d9d6ff, #f5f7ff);
}

.plan-theme-pro180 {
    color: #6b4300;
    background: linear-gradient(135deg, #fff4bf, #d99a16);
}

.plan-theme-proMax365 {
    position: relative;
    overflow: hidden;
    color: #ffffff;
    background: linear-gradient(135deg, #0047ff, #0077ff, #001f8f);
    box-shadow: 0 0 0 1px rgba(0, 71, 255, 0.22), 0 0 18px rgba(0, 119, 255, 0.34);
}

.plan-theme-proMax365::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-130%) skewX(-18deg);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.62), transparent);
    animation: plan-shine 2.4s infinite;
}

@keyframes plan-shine {
    0% {
        transform: translateX(-130%) skewX(-18deg);
    }

    55%,
    100% {
        transform: translateX(130%) skewX(-18deg);
    }
}

.admin-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-user-actions button {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
}

.status-pill {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pill-active {
    color: var(--success);
    background: rgba(4, 120, 87, 0.1);
}

.status-pill-blocked,
.status-pill-expired {
    color: var(--danger);
    background: rgba(180, 35, 24, 0.1);
}

.empty-state {
    padding: 20px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--muted);
    background: #ffffff;
    text-align: center;
}

.secondary-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--border);
    color: var(--text);
    background: #ffffff;
    font-size: 0.92rem;
}

.control-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.control-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.control-actions .secondary-button {
    min-height: 48px;
}

.secondary-button:hover {
    border-color: rgba(31, 111, 235, 0.45);
    color: var(--primary);
    background: var(--surface-soft);
}

.intro {
    max-width: 760px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.05;
}

.descricao {
    margin: 18px 0 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 20px;
}

.section-title {
    grid-column: 1 / -1;
    margin: 6px 0 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: #111827;
    font-size: 1rem;
    line-height: 1.3;
}

.field {
    display: grid;
    gap: 8px;
}

.choice-field {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px 18px;
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface-soft);
}

.choice-field legend {
    width: 100%;
    color: #344054;
    font-size: 0.92rem;
    font-weight: 700;
}

.choice-field label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-weight: 700;
}

.choice-field input {
    width: 18px;
    min-height: 18px;
    margin: 0;
    box-shadow: none;
}

.spouse-section {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 20px;
}

.spouse-section.is-hidden {
    display: none;
}

/* PDF Preview Modal Styles */
.pdf-preview-card {
    display: flex;
    flex-direction: column;
    width: min(100%, 700px);
    max-height: calc(100vh - 48px);
    gap: 16px;
}

.pdf-preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    background: #f5f5f5;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: auto;
    position: relative;
}

.pdf-canvas {
    display: block;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
}

.pdf-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 24px;
    background: #f5f5f5;
}

.pdf-preview-loading.is-hidden,
.pdf-preview-progress.is-hidden {
    display: none;
}

.pdf-preview-progress {
    width: min(100%, 420px);
}

.pdf-preview-progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe4f0;
}

.pdf-preview-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    transition: width 180ms ease;
}

.pdf-preview-progress-text {
    margin: 9px 0 0;
    color: #475467;
    font-size: 0.9rem;
    text-align: center;
}

.pdf-preview-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.pdf-preview-actions button {
    padding: 10px 16px;
    font-size: 0.95rem;
}

.pdf-preview-security {
    margin: 0;
    padding: 10px 12px;
    border-left: 3px solid var(--success);
    color: #475467;
    background: rgba(4, 120, 87, 0.08);
    font-size: 0.88rem;
    line-height: 1.45;
}

.actions-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
}

.conditional-fields {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 20px;
    padding: 16px;
    border-left: 3px solid var(--primary);
    background: rgba(31, 111, 235, 0.05);
}

.conditional-fields.is-hidden {
    display: none;
}

.conditional-fields h3 {
    grid-column: 1 / -1;
    margin: 0;
    color: #344054;
    font-size: 0.95rem;
    line-height: 1.35;
}

.repeatable-group {
    grid-column: 1 / -1;
    display: grid;
    gap: 14px;
}

.repeatable-entry {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px 20px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.72);
}

.repeatable-entry.is-hidden,
.repeatable-actions.is-hidden {
    display: none;
}

.repeatable-entry h3 {
    grid-column: 1 / -1;
    margin: 0;
    color: #344054;
    font-size: 0.95rem;
    line-height: 1.35;
}

.repeatable-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 14px;
    border-left: 3px solid var(--primary);
    color: var(--muted);
    background: rgba(31, 111, 235, 0.05);
    font-size: 0.92rem;
    font-weight: 700;
}

.repeatable-actions button {
    min-height: 42px;
}

.field-wide {
    grid-column: span 2;
}

.field span {
    color: #344054;
    font-size: 0.92rem;
    font-weight: 700;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    align-self: end;
    gap: 10px;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
}

.checkbox-field:hover {
    border-color: var(--primary);
    background: var(--surface-soft);
}

.checkbox-field input {
    width: 20px;
    min-height: 20px;
    margin: 0;
    accent-color: var(--primary);
    box-shadow: none;
    cursor: pointer;
}

input,
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    outline: none;
    color: var(--text);
    background: #ffffff;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input:disabled,
select:disabled,
textarea:disabled {
    color: var(--muted);
    background: #f8fafc;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(31, 111, 235, 0.14);
}

input.is-invalid,
select.is-invalid,
textarea.is-invalid {
    border-color: var(--danger);
    background: #fff8f7;
}

.actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.message {
    min-height: 24px;
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.message.error {
    color: var(--danger);
}

.message.success {
    color: var(--success);
}

button {
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    background: var(--primary);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

button,
.secondary-button,
.document-card,
.payment-plan-option,
.control-link {
    max-width: 100%;
}

@media (max-width: 860px) {
    .auth-view {
        min-height: auto;
        grid-template-columns: 1fr;
    }

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

    .admin-user-item {
        grid-template-columns: 1fr;
    }

    .admin-user-actions {
        justify-content: flex-start;
    }

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

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

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

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

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

@media (max-width: 640px) {
    .app {
        width: min(1120px, calc(100% - 24px));
        padding: 28px 0;
    }

    .form-panel {
        padding: 20px;
    }

    .privacy-icon {
        width: 76px;
        height: 76px;
        margin-bottom: 14px;
    }

    .topbar,
    .generator-bar,
    .admin-users-header {
        align-items: stretch;
        flex-direction: column;
    }

    .user-menu {
        align-items: stretch;
        justify-content: flex-start;
    }

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

    .conditional-fields {
        grid-template-columns: 1fr;
    }

    .repeatable-entry {
        grid-template-columns: 1fr;
    }

    .repeatable-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .spouse-section {
        grid-template-columns: 1fr;
    }

    .field-wide {
        grid-column: auto;
    }

    .actions {
        align-items: stretch;
        flex-direction: column;
    }

    button,
    .secondary-button,
    .control-actions {
        width: 100%;
    }

    .admin-user-actions button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .app {
        width: calc(100% - 20px);
        padding: 20px 0;
    }

    .privacy-modal,
    .payment-modal {
        align-items: start;
        padding: 10px;
        overflow-y: auto;
    }

    .privacy-card,
    .payment-card,
    .auth-panel,
    .form-panel {
        width: 100%;
        padding: 16px;
        border-radius: 8px;
    }

    .auth-view {
        gap: 22px;
    }

    .topbar,
    .generator-bar {
        gap: 14px;
        margin-bottom: 20px;
    }

    .topbar h1,
    .generator-bar h1,
    h1 {
        font-size: clamp(1.75rem, 9vw, 2.35rem);
        line-height: 1.08;
        overflow-wrap: anywhere;
    }

    .descricao {
        margin-top: 12px;
        font-size: 1rem;
    }

    .document-grid {
        gap: 12px;
    }

    .document-card {
        min-height: auto;
        gap: 10px;
        padding: 16px;
    }

    .document-card strong {
        font-size: 1.12rem;
    }

    .access-status {
        margin: -4px 0 16px;
        padding: 12px;
        font-size: 0.92rem;
    }

    .plan-actions,
    .payment-actions,
    .admin-user-actions,
    .control-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .payment-card h2 {
        padding-right: 44px;
        font-size: 1.35rem;
    }

    .payment-close {
        top: 10px;
        right: 10px;
    }

    .payment-qr-placeholder {
        max-width: min(240px, 80vw);
    }

    .choice-field {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
    }

    .choice-field label {
        min-height: 40px;
        padding: 8px 10px;
        border: 1px solid rgba(31, 111, 235, 0.12);
        border-radius: 6px;
        background: #ffffff;
    }

    .section-title {
        font-size: 0.98rem;
    }

    .admin-users-header {
        gap: 12px;
    }

    .admin-user-item {
        gap: 12px;
        padding: 14px;
    }

    .admin-user-meta {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .plan-pill,
    .status-pill,
    .document-status {
        max-width: 100%;
        white-space: normal;
    }

    .privacy-card .privacy-eyebrow {
        font-size: 22px;
    }

    .pdf-local-tool-grid {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 14px;
    }

    .pdf-local-tool {
        min-height: auto;
        padding: 13px;
    }
}

@media (max-width: 380px) {
    .app {
        width: calc(100% - 14px);
        padding: 14px 0;
    }

    .privacy-card,
    .payment-card,
    .auth-panel,
    .form-panel {
        padding: 14px;
    }

    h1 {
        font-size: 1.65rem;
    }

    button,
    .secondary-button,
    input,
    select,
    textarea {
        min-height: 46px;
    }
}

@media (max-width: 640px) {
    .document-view .home-logout-button,
    .document-view .plan-actions,
    .document-view .plan-actions button,
    .document-view .document-filter {
        width: auto;
    }

    .document-view .plan-actions {
        display: flex;
    }

    .generator-view .wizard-step-button,
    .generator-view .wizard-navigation button,
    .generator-view .repeatable-actions button {
        width: auto;
    }
}

/* ===== PRIORIDADES FINAIS DE RESPONSIVIDADE ===== */

.dashboard-stat-card {
    display: grid;
    justify-items: center;
    text-align: center;
}

.popular-document.is-hidden {
    display: none;
}

.admin-view .generator-bar h1 {
    margin: 4px 0 0;
    color: #f8fafc;
    font-size: clamp(1.55rem, 4vw, 2.2rem);
}

@media (max-width: 700px) {
    .document-view .plan-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .document-view .plan-actions button {
        width: 100%;
    }

    .admin-view .generator-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-view .admin-user-item {
        grid-template-columns: 1fr;
    }

    .admin-view .admin-user-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .admin-view .admin-user-actions button {
        width: 100%;
    }
}

/* Deve permanecer no fim: neutraliza a largura global de botões no mobile. */
@media (max-width: 640px) {
    .support-chat-button {
        width: auto;
    }

    .support-chat-heading .icon-button,
    .payment-close {
        width: 42px;
    }
}

/* Estados dinâmicos do catálogo e navegação de perfil. */
.document-view .document-quota-blocked {
    cursor: not-allowed;
    opacity: 0.66;
}

.document-view .document-quota-blocked .document-status {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
}

.document-view.is-profile-page .document-home-header,
.document-view.is-profile-page .global-document-search {
    display: none;
}

/* ===== CURSOR E LIQUID GLASS GLOBAL ===== */
:root {
    --cursor-glass-default: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='7' y1='5' x2='40' y2='45' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23ffffff'/%3E%3Cstop offset='.34' stop-color='%23f8fafc'/%3E%3Cstop offset='.58' stop-color='%23cbd5e1'/%3E%3Cstop offset='.78' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23475569'/%3E%3C/linearGradient%3E%3Cfilter id='s' x='-20%25' y='-20%25' width='160%25' height='160%25'%3E%3CfeDropShadow dx='2' dy='3' stdDeviation='2.5' flood-color='%23000' flood-opacity='.55'/%3E%3C/filter%3E%3C/defs%3E%3Cpath filter='url(%23s)' d='M7 4 40 25.5 25.3 29.4 33.3 44.2 25.9 48 18 33.1 8.9 41.4Z' fill='url(%23g)' stroke='%230f172a' stroke-width='3.2' stroke-linejoin='round'/%3E%3Cpath d='M10.7 9.2 33.5 23.6 21.3 26.9 26.7 36.8' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' opacity='.88'/%3E%3Cpath d='M25.3 29.4 33.3 44.2' fill='none' stroke='%23020317' stroke-width='1.3' stroke-linecap='round' opacity='.36'/%3E%3C/svg%3E") 7 5;
    --cursor-glass-pointer: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='52' height='52' viewBox='0 0 52 52'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='14' y1='4' x2='39' y2='47' gradientUnits='userSpaceOnUse'%3E%3Cstop stop-color='%23ffffff'/%3E%3Cstop offset='.32' stop-color='%23f8fafc'/%3E%3Cstop offset='.6' stop-color='%23cbd5e1'/%3E%3Cstop offset='.82' stop-color='%23ffffff'/%3E%3Cstop offset='1' stop-color='%23475569'/%3E%3C/linearGradient%3E%3Cfilter id='s' x='-20%25' y='-20%25' width='160%25' height='160%25'%3E%3CfeDropShadow dx='2' dy='3' stdDeviation='2.5' flood-color='%23000' flood-opacity='.55'/%3E%3C/filter%3E%3C/defs%3E%3Cpath filter='url(%23s)' d='M22.3 4.2c2.4 0 4.2 1.8 4.2 4.2v15.9l1.8-2.3c1.3-1.6 3.8-1.7 5.2-.2.6.6.9 1.3 1 2.1l.6-.7c1.4-1.7 4.1-1.6 5.4.1.5.7.8 1.4.8 2.3 1.6-.5 3.4.3 4.2 1.9.5.9.5 2 .2 3L41 42.1c-1.7 4.1-5.7 6.7-10.1 6.7H23c-3.3 0-6.4-1.5-8.5-4.1l-8.2-10c-1.4-1.8-1.1-4.4.7-5.8 1.5-1.2 3.7-1.1 5.2.2l4 3.6V8.4c0-2.4 1.8-4.2 4.2-4.2Z' fill='url(%23g)' stroke='%230f172a' stroke-width='2.8' stroke-linejoin='round'/%3E%3Cpath d='M20.7 7.8v27.9M26.5 24.3v10.9M34.5 25.5v9.8M41.2 28.3v7.7' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' opacity='.82'/%3E%3Cpath d='M14.1 37.6c3.1 2.7 5 4 9.3 4h10.7' fill='none' stroke='%23020317' stroke-width='1.2' stroke-linecap='round' opacity='.32'/%3E%3C/svg%3E") 22 6;
}

html,
body,
body * {
    cursor: var(--cursor-glass-default), auto;
}

button,
a,
summary,
label,
select,
input[type="button"],
input[type="submit"],
input[type="file"],
input[type="checkbox"],
input[type="radio"],
[role="button"],
[tabindex]:not([tabindex="-1"]),
.document-card,
.popular-document,
.dashboard-document-item,
.payment-plan-option,
.pdf-local-tool,
.bottom-navigation-item,
.control-link {
    cursor: var(--cursor-glass-pointer), pointer;
}

input,
textarea,
[contenteditable="true"] {
    cursor: var(--cursor-glass-default), text;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled,
.document-view .document-quota-blocked,
.document-card-disabled {
    cursor: var(--cursor-glass-default), not-allowed;
}

body.liquid-glass-theme,
body.liquid-glass-theme.auth-open,
body.liquid-glass-theme.document-home-open,
body.liquid-glass-theme.document-generator-open,
body.liquid-glass-theme.pdf-tools-open,
body.liquid-glass-theme.admin-access-open {
    color: #f8fafc;
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.32), transparent 22%),
        radial-gradient(circle at 78% 18%, rgba(203, 213, 225, 0.28), transparent 28%),
        radial-gradient(circle at 50% 100%, rgba(15, 23, 42, 0.44), transparent 46%),
        linear-gradient(135deg, #dfe6ee 0%, #94a3b8 34%, #475569 58%, #0f172a 100%) !important;
}

body.liquid-glass-theme .auth-panel,
body.liquid-glass-theme .form-panel,
body.liquid-glass-theme .privacy-card,
body.liquid-glass-theme .payment-card,
body.liquid-glass-theme .support-chat-card,
body.liquid-glass-theme .updates-modal-card,
body.liquid-glass-theme .profile-avatar-modal-card,
body.liquid-glass-theme .document-view .plan-summary-card,
body.liquid-glass-theme .document-view .version-card,
body.liquid-glass-theme .document-view .profile-card,
body.liquid-glass-theme .document-view .popular-document,
body.liquid-glass-theme .document-view .dashboard-stat-card,
body.liquid-glass-theme .document-view .dashboard-document-item,
body.liquid-glass-theme .document-view .document-card,
body.liquid-glass-theme .profile-theme-panel,
body.liquid-glass-theme .pdf-local-tools-panel,
body.liquid-glass-theme .pdf-local-editor-panel,
body.liquid-glass-theme .pdf-local-preview,
body.liquid-glass-theme .pdf-local-tool,
body.liquid-glass-theme .admin-user-item,
body.liquid-glass-theme .admin-document-access,
body.liquid-glass-theme .admin-document-access-option,
body.liquid-glass-theme .document-wizard,
body.liquid-glass-theme .live-document-preview,
body.liquid-glass-theme .generator-view .actions,
body.liquid-glass-theme .choice-field,
body.liquid-glass-theme .conditional-fields,
body.liquid-glass-theme .repeatable-entry,
body.liquid-glass-theme .repeatable-actions,
body.liquid-glass-theme .checkbox-field,
body.liquid-glass-theme .payment-confirm-box,
body.liquid-glass-theme .payment-qr-box,
body.liquid-glass-theme .payment-plan-option,
body.liquid-glass-theme .payment-proof-form,
body.liquid-glass-theme .support-chat-bubble,
body.liquid-glass-theme .profile-details div,
body.liquid-glass-theme .document-search,
body.liquid-glass-theme .document-view .document-filter,
body.liquid-glass-theme .wizard-step-button,
body.liquid-glass-theme .pdf-preview-container,
body.liquid-glass-theme .pdf-preview-loading,
body.liquid-glass-theme .pdf-preview-security {
    position: relative;
    overflow: hidden;
    border-color: rgba(248, 250, 252, 0.58) !important;
    border-radius: 12px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.38), rgba(226, 232, 240, 0.16) 38%, rgba(30, 41, 59, 0.2) 72%),
        rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.8),
        inset -1px -1px 2px rgba(15, 23, 42, 0.36),
        inset 0 -12px 24px rgba(255, 255, 255, 0.1),
        0 18px 36px rgba(2, 6, 23, 0.34),
        0 2px 5px rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(30px) saturate(165%);
}

body.liquid-glass-theme .auth-panel::before,
body.liquid-glass-theme .form-panel::before,
body.liquid-glass-theme .privacy-card::before,
body.liquid-glass-theme .payment-card::before,
body.liquid-glass-theme .support-chat-card::before,
body.liquid-glass-theme .updates-modal-card::before,
body.liquid-glass-theme .profile-avatar-modal-card::before,
body.liquid-glass-theme .document-view .plan-summary-card::before,
body.liquid-glass-theme .document-view .version-card::before,
body.liquid-glass-theme .document-view .profile-card::before,
body.liquid-glass-theme .document-view .popular-document::before,
body.liquid-glass-theme .document-view .dashboard-stat-card::before,
body.liquid-glass-theme .document-view .dashboard-document-item::before,
body.liquid-glass-theme .document-view .document-card::before,
body.liquid-glass-theme .profile-theme-panel::before,
body.liquid-glass-theme .pdf-local-tools-panel::before,
body.liquid-glass-theme .pdf-local-editor-panel::before,
body.liquid-glass-theme .pdf-local-preview::before,
body.liquid-glass-theme .admin-user-item::before,
body.liquid-glass-theme .document-wizard::before,
body.liquid-glass-theme .live-document-preview::before,
body.liquid-glass-theme .generator-view .actions::before,
body.liquid-glass-theme .choice-field::before,
body.liquid-glass-theme .conditional-fields::before,
body.liquid-glass-theme .repeatable-entry::before,
body.liquid-glass-theme .checkbox-field::before,
body.liquid-glass-theme .bottom-navigation::before {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.6), transparent 26%, rgba(255, 255, 255, 0.12) 56%, transparent 78%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.7), transparent 34%);
    opacity: 0.74;
}

body.liquid-glass-theme .auth-panel::after,
body.liquid-glass-theme .form-panel::after,
body.liquid-glass-theme .payment-card::after,
body.liquid-glass-theme .support-chat-card::after,
body.liquid-glass-theme .document-view .document-card::after,
body.liquid-glass-theme .document-view .plan-summary-card::after,
body.liquid-glass-theme .document-view .profile-card::after,
body.liquid-glass-theme .document-wizard::after,
body.liquid-glass-theme .live-document-preview::after,
body.liquid-glass-theme .bottom-navigation::after {
    content: "";
    position: absolute;
    right: 12%;
    bottom: 6px;
    left: 12%;
    z-index: 0;
    height: 13px;
    pointer-events: none;
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.2) 44%, transparent 72%);
    filter: blur(2px);
    opacity: 0.7;
}

body.liquid-glass-theme .auth-panel > *,
body.liquid-glass-theme .form-panel > *,
body.liquid-glass-theme .privacy-card > *,
body.liquid-glass-theme .payment-card > *,
body.liquid-glass-theme .support-chat-card > *,
body.liquid-glass-theme .updates-modal-card > *,
body.liquid-glass-theme .profile-avatar-modal-card > *,
body.liquid-glass-theme .document-view .document-card > *,
body.liquid-glass-theme .document-view .plan-summary-card > *,
body.liquid-glass-theme .document-view .profile-card > *,
body.liquid-glass-theme .document-view .popular-document > *,
body.liquid-glass-theme .document-view .dashboard-stat-card > *,
body.liquid-glass-theme .document-view .dashboard-document-item > *,
body.liquid-glass-theme .profile-theme-panel > *,
body.liquid-glass-theme .document-wizard > *,
body.liquid-glass-theme .live-document-preview > *,
body.liquid-glass-theme .generator-view .actions > *,
body.liquid-glass-theme .choice-field > *,
body.liquid-glass-theme .conditional-fields > *,
body.liquid-glass-theme .repeatable-entry > *,
body.liquid-glass-theme .checkbox-field > *,
body.liquid-glass-theme .bottom-navigation > * {
    position: relative;
    z-index: 1;
}

body.liquid-glass-theme button,
body.liquid-glass-theme .secondary-button,
body.liquid-glass-theme .control-link,
body.liquid-glass-theme .payment-plan-option,
body.liquid-glass-theme .wizard-navigation button {
    border: 1px solid rgba(255, 255, 255, 0.54) !important;
    color: #f8fafc;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(37, 99, 235, 0.3) 54%, rgba(15, 23, 42, 0.18)),
        rgba(37, 99, 235, 0.24) !important;
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.74),
        inset -1px -1px 2px rgba(15, 23, 42, 0.32),
        0 12px 24px rgba(2, 6, 23, 0.26);
    backdrop-filter: blur(22px) saturate(160%);
}

body.liquid-glass-theme button:hover,
body.liquid-glass-theme .secondary-button:hover,
body.liquid-glass-theme .control-link:hover,
body.liquid-glass-theme .payment-plan-option:hover {
    border-color: rgba(255, 255, 255, 0.84) !important;
    color: #ffffff;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(59, 130, 246, 0.36) 54%, rgba(15, 23, 42, 0.12)),
        rgba(96, 165, 250, 0.26) !important;
}

body.liquid-glass-theme input,
body.liquid-glass-theme select,
body.liquid-glass-theme textarea {
    border-color: rgba(255, 255, 255, 0.42) !important;
    color: #f8fafc !important;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(15, 23, 42, 0.28)),
        rgba(15, 23, 42, 0.2) !important;
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.36),
        inset -1px -1px 2px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(18px) saturate(150%);
}

body.liquid-glass-theme input::placeholder,
body.liquid-glass-theme textarea::placeholder {
    color: rgba(226, 232, 240, 0.7);
}

body.liquid-glass-theme input:focus,
body.liquid-glass-theme select:focus,
body.liquid-glass-theme textarea:focus {
    border-color: rgba(255, 255, 255, 0.86) !important;
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.44),
        0 0 0 4px rgba(125, 211, 252, 0.22),
        0 10px 24px rgba(2, 6, 23, 0.24);
}

body.liquid-glass-theme select option {
    color: #0f172a;
    background: #e2e8f0;
}

body.liquid-glass-theme .field > span,
body.liquid-glass-theme .section-title,
body.liquid-glass-theme .choice-field legend,
body.liquid-glass-theme .choice-field label,
body.liquid-glass-theme .conditional-fields h3,
body.liquid-glass-theme .repeatable-entry h3,
body.liquid-glass-theme .document-home-kicker,
body.liquid-glass-theme .wizard-eyebrow,
body.liquid-glass-theme .profile-theme-kicker,
body.liquid-glass-theme .document-home-header h1,
body.liquid-glass-theme .intro h1,
body.liquid-glass-theme h1,
body.liquid-glass-theme h2,
body.liquid-glass-theme h3 {
    color: #f8fafc !important;
    text-shadow: 0 1px 1px rgba(15, 23, 42, 0.22);
}

body.liquid-glass-theme .descricao,
body.liquid-glass-theme .section-description,
body.liquid-glass-theme .live-preview-note,
body.liquid-glass-theme .message,
body.liquid-glass-theme .profile-theme-panel p,
body.liquid-glass-theme .document-user-email,
body.liquid-glass-theme .admin-user-meta,
body.liquid-glass-theme .admin-users-header p,
body.liquid-glass-theme .support-chat-empty,
body.liquid-glass-theme .pdf-local-form small {
    color: rgba(241, 245, 249, 0.82) !important;
}

body.liquid-glass-theme .document-card-icon,
body.liquid-glass-theme .dashboard-document-item-icon,
body.liquid-glass-theme .plan-summary-icon,
body.liquid-glass-theme .dashboard-stat-icon,
body.liquid-glass-theme .version-card-icon,
body.liquid-glass-theme .auth-logo-mark,
body.liquid-glass-theme .admin-user-avatar,
body.liquid-glass-theme .live-preview-heading > span {
    border: 1px solid rgba(255, 255, 255, 0.58);
    color: #f8fafc;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.36), rgba(71, 85, 105, 0.18)) !important;
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.72),
        inset -1px -1px 2px rgba(15, 23, 42, 0.26),
        0 8px 18px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(18px) saturate(150%);
}

body.liquid-glass-theme .document-view .document-status,
body.liquid-glass-theme .status-pill,
body.liquid-glass-theme .plan-pill,
body.liquid-glass-theme .pdf-tool-badge {
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #f8fafc;
    background: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38);
    backdrop-filter: blur(14px);
}

body.liquid-glass-theme .privacy-modal,
body.liquid-glass-theme .payment-modal,
body.liquid-glass-theme .support-chat-modal,
body.liquid-glass-theme .updates-modal,
body.liquid-glass-theme .profile-avatar-modal {
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(18px) saturate(140%);
}

body.liquid-glass-theme .wizard-progress-track,
body.liquid-glass-theme .plan-summary-progress,
body.liquid-glass-theme .pdf-preview-progress-track {
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(15, 23, 42, 0.22);
    box-shadow: inset 1px 1px 1px rgba(255, 255, 255, 0.22);
}

body.liquid-glass-theme .bottom-navigation {
    position: fixed;
    right: auto !important;
    bottom: 18px;
    left: 50% !important;
    z-index: 20;
    overflow: hidden;
    border: 1px solid rgba(248, 250, 252, 0.62);
    border-radius: 14px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.34), rgba(51, 65, 85, 0.18)),
        rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.8),
        inset -1px -1px 2px rgba(15, 23, 42, 0.34),
        0 18px 34px rgba(2, 6, 23, 0.38);
    transform: translateX(-50%) !important;
    backdrop-filter: blur(28px) saturate(165%);
}

body.liquid-glass-theme .bottom-navigation-item {
    border: 1px solid transparent;
    border-radius: 10px;
    color: #e2e8f0;
}

body.liquid-glass-theme .bottom-navigation-item.is-active {
    border-color: rgba(255, 255, 255, 0.7);
    color: #0f172a;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(203, 213, 225, 0.46)),
        rgba(255, 255, 255, 0.28) !important;
    box-shadow:
        inset 1px 1px 1px rgba(255, 255, 255, 0.9),
        inset -1px -1px 2px rgba(15, 23, 42, 0.14),
        0 8px 18px rgba(2, 6, 23, 0.22);
}

body.liquid-glass-theme .document-view .document-card:hover,
body.liquid-glass-theme .document-view .popular-document:hover,
body.liquid-glass-theme .document-view .dashboard-document-item:hover,
body.liquid-glass-theme .pdf-local-tool:hover,
body.liquid-glass-theme .admin-user-item:hover {
    border-color: rgba(255, 255, 255, 0.9) !important;
    transform: translateY(-2px);
}

@media (max-width: 420px) {
    body.liquid-glass-theme .bottom-navigation {
        bottom: 10px;
        width: calc(100% - 16px);
    }
}

/* ===== LIQUID GLASS iOS 26 REFINADO ===== */
:root {
    --liquid-pointer-x: 50%;
    --liquid-pointer-y: 18%;
    --liquid-glass-radius: 24px;
    --liquid-glass-border: rgba(255, 255, 255, 0.42);
    --liquid-glass-border-strong: rgba(255, 255, 255, 0.72);
    --liquid-glass-text: #f8fbff;
    --liquid-glass-muted: rgba(235, 245, 255, 0.78);
    --liquid-glass-blue: #00a3ff;
}

body.liquid-glass-theme,
body.liquid-glass-theme.auth-open,
body.liquid-glass-theme.document-home-open,
body.liquid-glass-theme.document-generator-open,
body.liquid-glass-theme.pdf-tools-open,
body.liquid-glass-theme.admin-access-open {
    position: relative;
    color: var(--liquid-glass-text);
    background:
        radial-gradient(circle at var(--liquid-pointer-x) var(--liquid-pointer-y), rgba(125, 211, 252, 0.42), transparent 25%),
        radial-gradient(circle at 12% 78%, rgba(34, 197, 94, 0.26), transparent 28%),
        radial-gradient(circle at 78% 16%, rgba(59, 130, 246, 0.52), transparent 32%),
        radial-gradient(circle at 86% 86%, rgba(249, 115, 22, 0.34), transparent 26%),
        linear-gradient(135deg, #020617 0%, #0a1f46 38%, #064e6d 70%, #111827 100%) !important;
    background-attachment: fixed;
}

body.liquid-glass-theme::before,
body.liquid-glass-theme::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

body.liquid-glass-theme::before {
    background:
        linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, 0.12) 19%, transparent 20% 54%, rgba(255, 255, 255, 0.08) 55%, transparent 56%),
        radial-gradient(ellipse at 52% 10%, rgba(255, 255, 255, 0.18), transparent 42%);
    filter: blur(0.5px);
    opacity: 0.72;
}

body.liquid-glass-theme::after {
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 12px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 12px);
    mix-blend-mode: overlay;
    opacity: 0.38;
}

body.liquid-glass-theme .auth-panel,
body.liquid-glass-theme .form-panel,
body.liquid-glass-theme .privacy-card,
body.liquid-glass-theme .payment-card,
body.liquid-glass-theme .support-chat-card,
body.liquid-glass-theme .updates-modal-card,
body.liquid-glass-theme .profile-avatar-modal-card,
body.liquid-glass-theme .document-view .plan-summary-card,
body.liquid-glass-theme .document-view .version-card,
body.liquid-glass-theme .document-view .profile-card,
body.liquid-glass-theme .document-view .popular-document,
body.liquid-glass-theme .document-view .dashboard-stat-card,
body.liquid-glass-theme .document-view .dashboard-document-item,
body.liquid-glass-theme .document-view .document-card,
body.liquid-glass-theme .profile-theme-panel,
body.liquid-glass-theme .pdf-local-tools-panel,
body.liquid-glass-theme .pdf-local-editor-panel,
body.liquid-glass-theme .pdf-local-preview,
body.liquid-glass-theme .pdf-local-tool,
body.liquid-glass-theme .admin-user-item,
body.liquid-glass-theme .admin-document-access,
body.liquid-glass-theme .admin-document-access-option,
body.liquid-glass-theme .document-wizard,
body.liquid-glass-theme .live-document-preview,
body.liquid-glass-theme .generator-view .actions,
body.liquid-glass-theme .choice-field,
body.liquid-glass-theme .conditional-fields,
body.liquid-glass-theme .repeatable-entry,
body.liquid-glass-theme .repeatable-actions,
body.liquid-glass-theme .checkbox-field,
body.liquid-glass-theme .payment-confirm-box,
body.liquid-glass-theme .payment-qr-box,
body.liquid-glass-theme .payment-plan-option,
body.liquid-glass-theme .payment-proof-form,
body.liquid-glass-theme .support-chat-bubble,
body.liquid-glass-theme .profile-details div,
body.liquid-glass-theme .document-search,
body.liquid-glass-theme .document-view .document-filter,
body.liquid-glass-theme .wizard-step-button,
body.liquid-glass-theme .pdf-preview-container,
body.liquid-glass-theme .pdf-preview-loading,
body.liquid-glass-theme .pdf-preview-security {
    border: 1px solid var(--liquid-glass-border) !important;
    border-top-color: rgba(255, 255, 255, 0.74) !important;
    border-radius: var(--liquid-glass-radius) !important;
    background:
        radial-gradient(circle at var(--liquid-pointer-x) var(--liquid-pointer-y), rgba(255, 255, 255, 0.28), transparent 24%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06) 34%, rgba(2, 6, 23, 0.16) 76%),
        rgba(255, 255, 255, 0.1) !important;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.88),
        inset 0 -24px 42px rgba(255, 255, 255, 0.08),
        inset -1px -1px 2px rgba(2, 6, 23, 0.32),
        0 28px 70px rgba(0, 0, 0, 0.34),
        0 1px 0 rgba(255, 255, 255, 0.16) !important;
    -webkit-backdrop-filter: blur(42px) saturate(190%) contrast(108%);
    backdrop-filter: blur(42px) saturate(190%) contrast(108%);
}

body.liquid-glass-theme .auth-panel::before,
body.liquid-glass-theme .form-panel::before,
body.liquid-glass-theme .privacy-card::before,
body.liquid-glass-theme .payment-card::before,
body.liquid-glass-theme .support-chat-card::before,
body.liquid-glass-theme .updates-modal-card::before,
body.liquid-glass-theme .profile-avatar-modal-card::before,
body.liquid-glass-theme .document-view .plan-summary-card::before,
body.liquid-glass-theme .document-view .version-card::before,
body.liquid-glass-theme .document-view .profile-card::before,
body.liquid-glass-theme .document-view .popular-document::before,
body.liquid-glass-theme .document-view .dashboard-stat-card::before,
body.liquid-glass-theme .document-view .dashboard-document-item::before,
body.liquid-glass-theme .document-view .document-card::before,
body.liquid-glass-theme .profile-theme-panel::before,
body.liquid-glass-theme .pdf-local-tools-panel::before,
body.liquid-glass-theme .pdf-local-editor-panel::before,
body.liquid-glass-theme .pdf-local-preview::before,
body.liquid-glass-theme .admin-user-item::before,
body.liquid-glass-theme .document-wizard::before,
body.liquid-glass-theme .live-document-preview::before,
body.liquid-glass-theme .generator-view .actions::before,
body.liquid-glass-theme .choice-field::before,
body.liquid-glass-theme .conditional-fields::before,
body.liquid-glass-theme .repeatable-entry::before,
body.liquid-glass-theme .checkbox-field::before,
body.liquid-glass-theme .bottom-navigation::before {
    background:
        linear-gradient(120deg, rgba(255, 255, 255, 0.78), transparent 19%, rgba(255, 255, 255, 0.18) 44%, transparent 68%),
        radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.46), transparent 46%),
        radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.42), transparent 34%);
    opacity: 0.86;
}

body.liquid-glass-theme .auth-panel::after,
body.liquid-glass-theme .form-panel::after,
body.liquid-glass-theme .payment-card::after,
body.liquid-glass-theme .support-chat-card::after,
body.liquid-glass-theme .document-view .document-card::after,
body.liquid-glass-theme .document-view .plan-summary-card::after,
body.liquid-glass-theme .document-view .profile-card::after,
body.liquid-glass-theme .document-wizard::after,
body.liquid-glass-theme .live-document-preview::after,
body.liquid-glass-theme .bottom-navigation::after {
    right: 10%;
    bottom: 5px;
    left: 10%;
    height: 18px;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.24) 42%, transparent 72%);
    filter: blur(3px);
    opacity: 0.72;
}

body.liquid-glass-theme .document-view .document-card,
body.liquid-glass-theme .document-view .dashboard-stat-card,
body.liquid-glass-theme .document-view .popular-document,
body.liquid-glass-theme .admin-user-item,
body.liquid-glass-theme .pdf-local-tool {
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

body.liquid-glass-theme .document-view .document-card:hover,
body.liquid-glass-theme .document-view .popular-document:hover,
body.liquid-glass-theme .document-view .dashboard-document-item:hover,
body.liquid-glass-theme .pdf-local-tool:hover,
body.liquid-glass-theme .admin-user-item:hover {
    border-color: var(--liquid-glass-border-strong) !important;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.94),
        inset 0 -26px 46px rgba(255, 255, 255, 0.12),
        0 34px 82px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.12) !important;
    transform: translateY(-3px) scale(1.006);
}

body.liquid-glass-theme .bottom-navigation {
    grid-template-columns: repeat(4, minmax(74px, 1fr));
    width: min(520px, calc(100% - 24px));
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.36) !important;
    border-radius: 999px !important;
    background:
        radial-gradient(circle at var(--liquid-pointer-x) var(--liquid-pointer-y), rgba(255, 255, 255, 0.24), transparent 32%),
        linear-gradient(145deg, rgba(3, 7, 18, 0.76), rgba(15, 23, 42, 0.4)),
        rgba(255, 255, 255, 0.08) !important;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.58),
        inset 0 -16px 32px rgba(255, 255, 255, 0.08),
        0 28px 64px rgba(0, 0, 0, 0.44) !important;
    -webkit-backdrop-filter: blur(48px) saturate(210%);
    backdrop-filter: blur(48px) saturate(210%);
}

body.liquid-glass-theme .bottom-navigation-item {
    min-height: 58px;
    border-radius: 999px;
    color: rgba(248, 250, 252, 0.76);
    background: transparent !important;
    transition: color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

body.liquid-glass-theme .bottom-navigation-item svg {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.14));
}

body.liquid-glass-theme .bottom-navigation-item.is-active {
    border: 1px solid rgba(255, 255, 255, 0.44);
    color: #38bdf8;
    background:
        radial-gradient(circle at 42% 18%, rgba(255, 255, 255, 0.52), transparent 34%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(56, 189, 248, 0.18) 42%, rgba(15, 23, 42, 0.22)),
        rgba(255, 255, 255, 0.12) !important;
    box-shadow:
        inset 0 1px 1px rgba(255, 255, 255, 0.86),
        inset 0 -18px 32px rgba(255, 255, 255, 0.12),
        0 10px 30px rgba(2, 6, 23, 0.34),
        0 0 24px rgba(14, 165, 233, 0.18);
    transform: translateY(-1px);
}

body.liquid-glass-theme input,
body.liquid-glass-theme select,
body.liquid-glass-theme textarea,
body.liquid-glass-theme .document-search {
    border-radius: 999px !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1)),
        rgba(255, 255, 255, 0.12) !important;
    -webkit-backdrop-filter: blur(34px) saturate(180%);
    backdrop-filter: blur(34px) saturate(180%);
}

body.liquid-glass-theme textarea {
    border-radius: 20px !important;
}

body.liquid-glass-theme button,
body.liquid-glass-theme .secondary-button,
body.liquid-glass-theme .control-link,
body.liquid-glass-theme .payment-plan-option,
body.liquid-glass-theme .wizard-navigation button {
    border-radius: 999px !important;
    border-color: rgba(255, 255, 255, 0.38) !important;
    background:
        radial-gradient(circle at 28% 16%, rgba(255, 255, 255, 0.46), transparent 30%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(37, 99, 235, 0.44) 58%, rgba(14, 165, 233, 0.22)),
        rgba(37, 99, 235, 0.24) !important;
    -webkit-backdrop-filter: blur(30px) saturate(190%);
    backdrop-filter: blur(30px) saturate(190%);
}

body.liquid-glass-theme .document-card-icon,
body.liquid-glass-theme .dashboard-document-item-icon,
body.liquid-glass-theme .plan-summary-icon,
body.liquid-glass-theme .dashboard-stat-icon,
body.liquid-glass-theme .version-card-icon,
body.liquid-glass-theme .auth-logo-mark,
body.liquid-glass-theme .admin-user-avatar,
body.liquid-glass-theme .live-preview-heading > span,
body.liquid-glass-theme .icon-button {
    border-radius: 50% !important;
    border-color: rgba(255, 255, 255, 0.44) !important;
    background:
        radial-gradient(circle at 32% 22%, rgba(255, 255, 255, 0.55), transparent 36%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.22), rgba(15, 23, 42, 0.18)),
        rgba(255, 255, 255, 0.1) !important;
}

body.liquid-glass-theme .document-view .document-status,
body.liquid-glass-theme .status-pill,
body.liquid-glass-theme .plan-pill,
body.liquid-glass-theme .pdf-tool-badge,
body.liquid-glass-theme .wizard-step-button {
    border-radius: 999px !important;
}

body.liquid-glass-theme .document-view .document-status,
body.liquid-glass-theme .status-pill-active {
    color: #bbf7d0 !important;
}

body.liquid-glass-theme .message.error,
body.liquid-glass-theme .status-pill-blocked,
body.liquid-glass-theme .status-pill-expired {
    color: #fecaca !important;
}

body.liquid-glass-theme .payment-close,
body.liquid-glass-theme .support-chat-heading .icon-button,
body.liquid-glass-theme .profile-avatar-modal-heading .icon-button,
body.liquid-glass-theme .updates-modal-heading .icon-button {
    background:
        radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.64), transparent 32%),
        rgba(255, 255, 255, 0.18) !important;
}

@media (max-width: 520px) {
    body.liquid-glass-theme .auth-panel,
    body.liquid-glass-theme .form-panel,
    body.liquid-glass-theme .payment-card,
    body.liquid-glass-theme .support-chat-card,
    body.liquid-glass-theme .document-view .document-card,
    body.liquid-glass-theme .document-view .plan-summary-card,
    body.liquid-glass-theme .document-view .profile-card {
        border-radius: 20px !important;
    }

    body.liquid-glass-theme .bottom-navigation {
        width: calc(100% - 14px);
        padding: 5px;
    }

    body.liquid-glass-theme .bottom-navigation-item {
        min-height: 50px;
    }
}

/* ===== LIQUID GLASS OTIMIZADO ===== */
body.liquid-glass-theme {
    --liquid-pointer-x: 54%;
    --liquid-pointer-y: 18%;
    --liquid-glass-radius: 22px;
    --liquid-glass-border: rgba(255, 255, 255, 0.46);
    --liquid-glass-border-strong: rgba(255, 255, 255, 0.72);
    --liquid-glass-text: #ffffff;
    --liquid-glass-muted: rgba(244, 249, 255, 0.84);
    --liquid-glass-panel: rgba(255, 255, 255, 0.13);
    --liquid-glass-panel-strong: rgba(255, 255, 255, 0.19);
}

body.liquid-glass-theme,
body.liquid-glass-theme.auth-open,
body.liquid-glass-theme.document-home-open,
body.liquid-glass-theme.document-generator-open,
body.liquid-glass-theme.pdf-tools-open,
body.liquid-glass-theme.admin-access-open {
    color: var(--liquid-glass-text);
    background:
        radial-gradient(circle at 18% 8%, rgba(255, 255, 255, 0.28), transparent 24%),
        radial-gradient(circle at 78% 12%, rgba(125, 211, 252, 0.34), transparent 28%),
        radial-gradient(circle at 8% 78%, rgba(45, 212, 191, 0.28), transparent 32%),
        linear-gradient(135deg, #164e9b 0%, #0f75bd 36%, #13a9c7 68%, #7dd3fc 100%) !important;
    background-attachment: scroll !important;
    text-rendering: optimizeLegibility;
}

body.liquid-glass-theme::before,
body.liquid-glass-theme::after {
    display: none !important;
}

body.liquid-glass-theme .auth-panel,
body.liquid-glass-theme .form-panel,
body.liquid-glass-theme .privacy-card,
body.liquid-glass-theme .payment-card,
body.liquid-glass-theme .support-chat-card,
body.liquid-glass-theme .updates-modal-card,
body.liquid-glass-theme .profile-avatar-modal-card,
body.liquid-glass-theme .document-view .plan-summary-card,
body.liquid-glass-theme .document-view .version-card,
body.liquid-glass-theme .document-view .profile-card,
body.liquid-glass-theme .document-view .popular-document,
body.liquid-glass-theme .document-view .dashboard-stat-card,
body.liquid-glass-theme .document-view .dashboard-document-item,
body.liquid-glass-theme .document-view .document-card,
body.liquid-glass-theme .profile-theme-panel,
body.liquid-glass-theme .pdf-local-tools-panel,
body.liquid-glass-theme .pdf-local-editor-panel,
body.liquid-glass-theme .pdf-local-preview,
body.liquid-glass-theme .pdf-local-tool,
body.liquid-glass-theme .admin-user-item,
body.liquid-glass-theme .admin-document-access,
body.liquid-glass-theme .admin-document-access-option,
body.liquid-glass-theme .document-wizard,
body.liquid-glass-theme .live-document-preview,
body.liquid-glass-theme .generator-view .actions,
body.liquid-glass-theme .choice-field,
body.liquid-glass-theme .conditional-fields,
body.liquid-glass-theme .repeatable-entry,
body.liquid-glass-theme .repeatable-actions,
body.liquid-glass-theme .checkbox-field,
body.liquid-glass-theme .payment-confirm-box,
body.liquid-glass-theme .payment-qr-box,
body.liquid-glass-theme .payment-plan-option,
body.liquid-glass-theme .payment-proof-form,
body.liquid-glass-theme .support-chat-bubble,
body.liquid-glass-theme .profile-details div,
body.liquid-glass-theme .document-search,
body.liquid-glass-theme .document-view .document-filter,
body.liquid-glass-theme .wizard-step-button,
body.liquid-glass-theme .pdf-preview-container,
body.liquid-glass-theme .pdf-preview-loading,
body.liquid-glass-theme .pdf-preview-security {
    border: 1px solid var(--liquid-glass-border) !important;
    border-top-color: rgba(255, 255, 255, 0.78) !important;
    border-radius: var(--liquid-glass-radius) !important;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08) 48%, rgba(255, 255, 255, 0.16)),
        var(--liquid-glass-panel) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.72),
        inset 0 -14px 28px rgba(255, 255, 255, 0.08),
        0 16px 38px rgba(14, 56, 109, 0.22) !important;
    -webkit-backdrop-filter: blur(14px) saturate(132%);
    backdrop-filter: blur(14px) saturate(132%);
    contain: paint;
}

body.liquid-glass-theme .auth-panel::before,
body.liquid-glass-theme .form-panel::before,
body.liquid-glass-theme .privacy-card::before,
body.liquid-glass-theme .payment-card::before,
body.liquid-glass-theme .support-chat-card::before,
body.liquid-glass-theme .updates-modal-card::before,
body.liquid-glass-theme .profile-avatar-modal-card::before,
body.liquid-glass-theme .document-view .plan-summary-card::before,
body.liquid-glass-theme .document-view .version-card::before,
body.liquid-glass-theme .document-view .profile-card::before,
body.liquid-glass-theme .document-view .popular-document::before,
body.liquid-glass-theme .document-view .dashboard-stat-card::before,
body.liquid-glass-theme .document-view .dashboard-document-item::before,
body.liquid-glass-theme .document-view .document-card::before,
body.liquid-glass-theme .profile-theme-panel::before,
body.liquid-glass-theme .pdf-local-tools-panel::before,
body.liquid-glass-theme .pdf-local-editor-panel::before,
body.liquid-glass-theme .pdf-local-preview::before,
body.liquid-glass-theme .admin-user-item::before,
body.liquid-glass-theme .document-wizard::before,
body.liquid-glass-theme .live-document-preview::before,
body.liquid-glass-theme .generator-view .actions::before,
body.liquid-glass-theme .choice-field::before,
body.liquid-glass-theme .conditional-fields::before,
body.liquid-glass-theme .repeatable-entry::before,
body.liquid-glass-theme .checkbox-field::before,
body.liquid-glass-theme .bottom-navigation::before,
body.liquid-glass-theme .auth-panel::after,
body.liquid-glass-theme .form-panel::after,
body.liquid-glass-theme .payment-card::after,
body.liquid-glass-theme .support-chat-card::after,
body.liquid-glass-theme .document-view .document-card::after,
body.liquid-glass-theme .document-view .plan-summary-card::after,
body.liquid-glass-theme .document-view .profile-card::after,
body.liquid-glass-theme .document-wizard::after,
body.liquid-glass-theme .live-document-preview::after,
body.liquid-glass-theme .bottom-navigation::after {
    display: none !important;
}

body.liquid-glass-theme h1,
body.liquid-glass-theme h2,
body.liquid-glass-theme h3,
body.liquid-glass-theme strong,
body.liquid-glass-theme label,
body.liquid-glass-theme .field > span,
body.liquid-glass-theme .section-title,
body.liquid-glass-theme .choice-field legend,
body.liquid-glass-theme .choice-field label,
body.liquid-glass-theme .conditional-fields h3,
body.liquid-glass-theme .repeatable-entry h3,
body.liquid-glass-theme .document-home-kicker,
body.liquid-glass-theme .wizard-eyebrow,
body.liquid-glass-theme .profile-theme-kicker,
body.liquid-glass-theme .document-card-title,
body.liquid-glass-theme .document-home-header h1,
body.liquid-glass-theme .intro h1 {
    color: #ffffff !important;
    text-shadow: 0 1px 10px rgba(8, 32, 69, 0.48);
}

body.liquid-glass-theme p,
body.liquid-glass-theme small,
body.liquid-glass-theme .descricao,
body.liquid-glass-theme .section-description,
body.liquid-glass-theme .live-preview-note,
body.liquid-glass-theme .message,
body.liquid-glass-theme .profile-theme-panel p,
body.liquid-glass-theme .document-user-email,
body.liquid-glass-theme .admin-user-meta,
body.liquid-glass-theme .admin-users-header p,
body.liquid-glass-theme .support-chat-empty,
body.liquid-glass-theme .pdf-local-form small,
body.liquid-glass-theme .document-card-description {
    color: var(--liquid-glass-muted) !important;
    text-shadow: 0 1px 8px rgba(8, 32, 69, 0.34);
}

body.liquid-glass-theme input,
body.liquid-glass-theme select,
body.liquid-glass-theme textarea,
body.liquid-glass-theme .document-search {
    border-color: rgba(255, 255, 255, 0.48) !important;
    color: #ffffff !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.1)),
        rgba(255, 255, 255, 0.14) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.52),
        0 10px 28px rgba(14, 56, 109, 0.14) !important;
    -webkit-backdrop-filter: blur(10px) saturate(125%);
    backdrop-filter: blur(10px) saturate(125%);
}

body.liquid-glass-theme input::placeholder,
body.liquid-glass-theme textarea::placeholder {
    color: rgba(255, 255, 255, 0.68);
}

body.liquid-glass-theme select option {
    color: #0f172a;
    background: #eaf7ff;
}

body.liquid-glass-theme button,
body.liquid-glass-theme .secondary-button,
body.liquid-glass-theme .control-link,
body.liquid-glass-theme .payment-plan-option,
body.liquid-glass-theme .wizard-navigation button {
    color: #ffffff !important;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(37, 99, 235, 0.36) 58%, rgba(56, 189, 248, 0.28)),
        rgba(37, 99, 235, 0.22) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.58),
        0 12px 28px rgba(14, 56, 109, 0.2) !important;
    -webkit-backdrop-filter: blur(10px) saturate(128%);
    backdrop-filter: blur(10px) saturate(128%);
}

body.liquid-glass-theme .bottom-navigation {
    left: 50% !important;
    right: auto !important;
    width: min(520px, calc(100% - 24px));
    border-color: rgba(255, 255, 255, 0.5) !important;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.08)),
        rgba(255, 255, 255, 0.13) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.62),
        0 16px 38px rgba(14, 56, 109, 0.26) !important;
    transform: translateX(-50%) !important;
    -webkit-backdrop-filter: blur(14px) saturate(132%);
    backdrop-filter: blur(14px) saturate(132%);
}

body.liquid-glass-theme .bottom-navigation-item {
    color: rgba(255, 255, 255, 0.78);
    transition: color 0.16s ease, background 0.16s ease;
}

body.liquid-glass-theme .bottom-navigation-item.is-active {
    color: #075985 !important;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62)),
        rgba(255, 255, 255, 0.62) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.84),
        0 8px 18px rgba(14, 56, 109, 0.14) !important;
    transform: none;
}

body.liquid-glass-theme .document-card-icon,
body.liquid-glass-theme .dashboard-document-item-icon,
body.liquid-glass-theme .plan-summary-icon,
body.liquid-glass-theme .dashboard-stat-icon,
body.liquid-glass-theme .version-card-icon,
body.liquid-glass-theme .auth-logo-mark,
body.liquid-glass-theme .admin-user-avatar,
body.liquid-glass-theme .live-preview-heading > span,
body.liquid-glass-theme .icon-button,
body.liquid-glass-theme .document-view .document-status,
body.liquid-glass-theme .status-pill,
body.liquid-glass-theme .plan-pill,
body.liquid-glass-theme .pdf-tool-badge {
    border-color: rgba(255, 255, 255, 0.48) !important;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08)),
        rgba(255, 255, 255, 0.14) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.54),
        0 8px 18px rgba(14, 56, 109, 0.14) !important;
    -webkit-backdrop-filter: blur(8px) saturate(122%);
    backdrop-filter: blur(8px) saturate(122%);
}

body.liquid-glass-theme .document-view .document-status,
body.liquid-glass-theme .status-pill-active {
    color: #dcfce7 !important;
}

body.liquid-glass-theme .privacy-modal,
body.liquid-glass-theme .payment-modal,
body.liquid-glass-theme .support-chat-modal,
body.liquid-glass-theme .updates-modal,
body.liquid-glass-theme .profile-avatar-modal {
    background: rgba(13, 116, 189, 0.24) !important;
    -webkit-backdrop-filter: blur(8px) saturate(120%);
    backdrop-filter: blur(8px) saturate(120%);
}

body.liquid-glass-theme .document-view .document-card,
body.liquid-glass-theme .document-view .dashboard-stat-card,
body.liquid-glass-theme .document-view .popular-document,
body.liquid-glass-theme .admin-user-item,
body.liquid-glass-theme .pdf-local-tool {
    transition: transform 0.16s ease, border-color 0.16s ease;
}

body.liquid-glass-theme .document-view .document-card:hover,
body.liquid-glass-theme .document-view .popular-document:hover,
body.liquid-glass-theme .document-view .dashboard-document-item:hover,
body.liquid-glass-theme .pdf-local-tool:hover,
body.liquid-glass-theme .admin-user-item:hover {
    border-color: var(--liquid-glass-border-strong) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 18px 42px rgba(14, 56, 109, 0.24) !important;
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    body.liquid-glass-theme *,
    body.liquid-glass-theme *::before,
    body.liquid-glass-theme *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.pdf-local-batch-panel {
    display: grid;
    gap: 12px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.36);
}

.pdf-local-batch-panel.is-hidden {
    display: none;
}

.pdf-local-batch-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #f8fafc;
}

.pdf-local-batch-header span {
    color: #bfdbfe;
    font-size: 13px;
    font-weight: 700;
}

.pdf-local-batch-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow: auto;
    padding-right: 4px;
}

.pdf-local-batch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.52);
}

.pdf-local-batch-item span {
    min-width: 0;
    overflow: hidden;
    color: #e5edff;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-local-batch-item small {
    flex: 0 0 auto;
    color: #bfdbfe;
    font-weight: 800;
}

.pdf-local-batch-item[data-status="processando"] small {
    color: #facc15;
}

.pdf-local-batch-item[data-status="pronto"] small {
    color: #86efac;
}

@media (max-width: 640px) {
    .pdf-local-batch-header,
    .pdf-local-batch-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .pdf-local-batch-item span {
        white-space: normal;
    }
}

/* ===== NOVA ÁREA DE FERRAMENTAS PDF - INSPIRAÇÃO LIMPA, SEM CÓPIA ===== */
body.pdf-tools-open {
    background:
        radial-gradient(circle at 8% 0%, rgba(31, 111, 235, 0.09), transparent 28%),
        radial-gradient(circle at 95% 12%, rgba(239, 68, 68, 0.08), transparent 24%),
        #f7f7fb;
}

body.pdf-tools-open .app {
    width: min(1400px, calc(100% - 44px));
    padding: 22px 0 58px;
}

.pdf-local-view {
    color: #252631;
}

.pdf-local-view .generator-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    margin: 0 -10px 24px;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(14px);
}

.pdf-local-view .generator-bar .secondary-button,
.pdf-local-back-button {
    border-color: rgba(31, 41, 55, 0.14);
    color: #1f2937;
    background: #ffffff;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.pdf-local-view .user-menu {
    color: #475569;
}

.pdf-local-view .intro {
    max-width: 880px;
    margin: 0 auto 26px;
    text-align: center;
}

.pdf-local-view .intro h1 {
    color: #292933;
    font-size: clamp(2.35rem, 5.2vw, 4rem);
    letter-spacing: -0.055em;
}

.pdf-local-view .descricao {
    max-width: 760px;
    margin: 12px auto 0;
    color: #5f6270;
    font-size: clamp(1rem, 1.5vw, 1.18rem);
    line-height: 1.6;
}

.pdf-local-view .eyebrow {
    color: #1f6feb;
}

.pdf-local-view .pdf-local-panel {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

#pdfLocalToolsHome.is-hidden,
#pdfLocalOperationPanel.is-hidden {
    display: none;
}

.pdf-local-note {
    max-width: 980px;
    margin: 0 auto 24px;
    border: 1px solid rgba(4, 120, 87, 0.12);
    border-left: 5px solid #0f9f6e;
    border-radius: 16px;
    background: #ecfdf5;
    color: #375245;
}

.pdf-local-note strong {
    color: #047857;
}

.pdf-local-tools-home {
    display: grid;
    gap: 24px;
}

.pdf-local-hero-card {
    max-width: 920px;
    margin: 0 auto;
    text-align: center;
}

.pdf-local-hero-card h2 {
    margin: 0;
    color: #292933;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    letter-spacing: -0.04em;
}

.pdf-local-hero-card p:not(.eyebrow) {
    margin: 12px auto 0;
    max-width: 720px;
    color: #656979;
    font-size: 1.04rem;
    line-height: 1.55;
}

.pdf-local-category-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 4px;
}

.pdf-local-category-tabs span {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 20px;
    border: 1px solid #d8dbe5;
    border-radius: 999px;
    color: #424553;
    background: rgba(255, 255, 255, 0.92);
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.pdf-local-category-tabs span.is-active {
    border-color: #242631;
    color: #ffffff;
    background: #242631;
}

.pdf-local-home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: 0;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool {
    position: relative;
    min-height: 188px;
    gap: 13px;
    padding: 26px 24px;
    border: 1px solid #d9dce7;
    border-radius: 18px;
    color: #2d2f3a;
    background: #ffffff;
    box-shadow: 0 18px 38px rgba(20, 24, 38, 0.05);
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover,
.pdf-local-view .pdf-local-home-grid .pdf-local-tool.is-active:hover {
    border-color: rgba(31, 111, 235, 0.45);
    background: #ffffff;
    box-shadow: 0 24px 54px rgba(20, 24, 38, 0.10);
    transform: translateY(-4px);
}

.pdf-local-tool-icon,
.pdf-upload-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #ef4444, #f97316);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.18);
}

.pdf-local-tool-icon svg,
.pdf-upload-icon svg {
    width: 23px;
    height: 23px;
}

.pdf-local-home-grid .pdf-local-tool:nth-child(2n) .pdf-local-tool-icon,
.pdf-local-operation-tab:nth-child(2n).is-active {
    background: linear-gradient(135deg, #2563eb, #60a5fa);
}

.pdf-local-home-grid .pdf-local-tool:nth-child(3n) .pdf-local-tool-icon,
.pdf-local-operation-tab:nth-child(3n).is-active {
    background: linear-gradient(135deg, #16a34a, #86efac);
}

.pdf-local-view .pdf-local-tool-heading {
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pdf-local-home-grid .pdf-local-tool-heading strong {
    color: #2b2d39;
    font-size: 1.15rem;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child {
    max-width: 260px;
    color: #777b8d;
    font-size: 0.96rem;
    line-height: 1.5;
}

.pdf-tool-badge,
.pdf-tool-quota-badge {
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pdf-local-operation-panel {
    display: grid;
    gap: 18px;
    max-width: 1040px;
    margin: 0 auto;
}

.pdf-local-operation-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    padding: 18px;
    border: 1px solid #e2e5ee;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 40px rgba(20, 24, 38, 0.07);
}

.pdf-local-operation-header h2 {
    margin: 2px 0 5px;
    color: #242631;
    font-size: clamp(1.6rem, 3vw, 2.35rem);
    letter-spacing: -0.045em;
}

.pdf-local-operation-header p:not(.eyebrow) {
    margin: 0;
    color: #666b7b;
    line-height: 1.5;
}

.pdf-local-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    min-height: 46px;
    white-space: nowrap;
}

.pdf-local-operation-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding: 6px;
    border-radius: 18px 18px 0 0;
    background: transparent;
}

.pdf-local-operation-tab {
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid #e1e4ec;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    color: #333744;
    background: #eceef4;
    font: inherit;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
}

.pdf-local-operation-tab:hover,
.pdf-local-operation-tab.is-active {
    color: #ef4b2d;
    background: #ffffff;
}

.pdf-local-operation-tab .pdf-tool-quota-badge {
    display: none;
}

.pdf-local-view .pdf-local-editor-panel {
    padding: 0;
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(20, 24, 38, 0.10);
}

.pdf-upload-stage {
    display: grid;
    gap: 20px;
    min-height: 420px;
    padding: clamp(22px, 3vw, 38px);
    border: 1px solid #e0e3ec;
    border-radius: 22px;
    background: #ffffff;
}

.pdf-upload-stage-heading {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
}

.pdf-upload-stage-heading strong {
    display: block;
    color: #252631;
    font-size: 1.28rem;
}

.pdf-upload-stage-heading span:not(.pdf-upload-icon) {
    display: block;
    margin-top: 4px;
    color: #6c7183;
    line-height: 1.45;
}

.pdf-local-view .pdf-upload-dropzone {
    display: grid;
    place-items: center;
    gap: 12px;
    min-height: 210px;
    padding: 34px;
    border: 2px dashed #cfd4e2;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(31, 111, 235, 0.035), transparent),
        #fbfcff;
    text-align: center;
}

.pdf-local-view .pdf-upload-dropzone > span {
    color: #242631;
    font-size: 1.08rem;
    font-weight: 900;
}

.pdf-local-view .pdf-upload-dropzone input[type="file"] {
    width: min(100%, 520px);
    padding: 12px;
    border: 1px solid #d5d9e5;
    border-radius: 12px;
    color: #252631;
    background: #ffffff;
}

.pdf-local-view .pdf-upload-dropzone small,
.pdf-local-view .pdf-local-form small {
    color: #707689;
    font-size: 0.92rem;
}

.pdf-local-view .field span,
.pdf-local-view .field small {
    color: #2d3340;
}

.pdf-local-view input,
.pdf-local-view select {
    border-color: #d8dde9;
    color: #242631;
    background: #ffffff;
}

.pdf-local-view .pdf-local-preview {
    border-color: #e0e4ee;
    border-radius: 18px;
    background: #ffffff;
}

.pdf-local-view .pdf-local-preview-header span {
    color: #687084;
}

.pdf-local-actions {
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 8px;
    padding-top: 18px;
    border-top: 1px solid #e3e6ef;
}

.pdf-local-actions .message {
    flex: 1 1 auto;
    min-width: 220px;
    text-align: left;
}

.pdf-local-actions button[type="submit"] {
    min-width: 220px;
    border-radius: 12px;
    background: #2d7bf0;
    box-shadow: 0 14px 28px rgba(45, 123, 240, 0.24);
}

body.liquid-glass-theme.pdf-tools-open {
    background:
        radial-gradient(circle at 10% 0%, rgba(96, 165, 250, 0.18), transparent 30%),
        radial-gradient(circle at 92% 10%, rgba(244, 114, 182, 0.12), transparent 26%),
        #f7f7fb;
}

body.liquid-glass-theme .pdf-local-view .pdf-local-panel,
body.liquid-glass-theme .pdf-local-tools-home,
body.liquid-glass-theme .pdf-local-operation-panel,
body.liquid-glass-theme .pdf-local-editor-panel,
body.liquid-glass-theme .pdf-local-preview,
body.liquid-glass-theme .pdf-local-tool {
    backdrop-filter: none;
}

@media (max-width: 1100px) {
    .pdf-local-home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    body.pdf-tools-open .app {
        width: min(100% - 22px, 1400px);
        padding-top: 12px;
    }

    .pdf-local-view .generator-bar,
    .pdf-local-operation-header,
    .pdf-upload-stage-heading {
        grid-template-columns: 1fr;
    }

    .pdf-local-view .generator-bar {
        position: static;
    }

    .pdf-local-home-grid {
        grid-template-columns: 1fr;
    }

    .pdf-local-operation-tabs {
        margin-inline: -6px;
    }

    .pdf-local-view .pdf-upload-dropzone {
        padding: 22px 14px;
    }

    .pdf-local-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .pdf-local-actions button[type="submit"] {
        width: 100%;
    }
}

/* ===== TEMA GLOBAL DO SISTEMA: AZUL ESCURO PADRÃO / BRANCO OPCIONAL ===== */
.theme-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    white-space: nowrap;
}

.theme-toggle-button svg {
    width: 17px;
    height: 17px;
}

.profile-system-theme-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.system-theme-select-label {
    min-width: 180px;
}

.system-theme-select-label select {
    width: 100%;
    min-height: 44px;
    padding: 0 38px 0 14px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 10px;
    color: #f8fafc;
    background: #111827;
    font: inherit;
    font-weight: 800;
}

body.system-dark-theme,
body.system-dark-theme.auth-open,
body.system-dark-theme.document-home-open,
body.system-dark-theme.document-generator-open,
body.system-dark-theme.admin-access-open,
body.system-dark-theme.pdf-tools-open {
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-soft: #111827;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.22);
    --shadow: 0 20px 60px rgba(2, 6, 23, 0.34);
    color: #f8fafc;
    background:
        radial-gradient(circle at 8% 0%, rgba(37, 99, 235, 0.20), transparent 30%),
        radial-gradient(circle at 92% 12%, rgba(14, 165, 233, 0.10), transparent 26%),
        #0f172a;
}

body.system-dark-theme .app {
    color: #f8fafc;
}

body.system-dark-theme .auth-copy,
body.system-dark-theme .auth-copy h1,
body.system-dark-theme .document-home-header h1,
body.system-dark-theme .intro h1,
body.system-dark-theme .section-title,
body.system-dark-theme .document-section-heading h2,
body.system-dark-theme .profile-heading h2,
body.system-dark-theme .profile-card strong,
body.system-dark-theme .document-card-copy strong,
body.system-dark-theme .dashboard-stat-card strong,
body.system-dark-theme .dashboard-document-item strong,
body.system-dark-theme .popular-document strong,
body.system-dark-theme .admin-user-identity strong,
body.system-dark-theme .pdf-local-hero-card h2,
body.system-dark-theme .pdf-local-operation-header h2,
body.system-dark-theme .pdf-upload-stage-heading strong,
body.system-dark-theme .pdf-local-home-grid .pdf-local-tool-heading strong {
    color: #f8fafc;
}

body.system-dark-theme .descricao,
body.system-dark-theme .auth-copy .descricao,
body.system-dark-theme .document-user-email,
body.system-dark-theme .document-card-copy span,
body.system-dark-theme .profile-card p,
body.system-dark-theme .profile-details dt,
body.system-dark-theme .profile-details dd,
body.system-dark-theme .section-description,
body.system-dark-theme .dashboard-document-item span,
body.system-dark-theme .popular-document span,
body.system-dark-theme .admin-user-meta,
body.system-dark-theme .pdf-local-hero-card p:not(.eyebrow),
body.system-dark-theme .pdf-local-operation-header p:not(.eyebrow),
body.system-dark-theme .pdf-upload-stage-heading span:not(.pdf-upload-icon),
body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child,
body.system-dark-theme .pdf-local-view .pdf-upload-dropzone small,
body.system-dark-theme .pdf-local-view .pdf-local-form small,
body.system-dark-theme .message {
    color: #aebdd0;
}

body.system-dark-theme .auth-panel,
body.system-dark-theme .form-panel,
body.system-dark-theme .document-home-header,
body.system-dark-theme .plan-summary-card,
body.system-dark-theme .version-card,
body.system-dark-theme .profile-card,
body.system-dark-theme .profile-theme-panel,
body.system-dark-theme .dashboard-stat-card,
body.system-dark-theme .dashboard-document-item,
body.system-dark-theme .popular-document,
body.system-dark-theme .admin-user-item,
body.system-dark-theme .payment-card,
body.system-dark-theme .updates-card,
body.system-dark-theme .support-chat-card,
body.system-dark-theme .bottom-navigation,
body.system-dark-theme .pdf-local-view .generator-bar,
body.system-dark-theme .pdf-local-operation-header,
body.system-dark-theme .pdf-local-view .pdf-local-editor-panel,
body.system-dark-theme .pdf-upload-stage {
    border-color: rgba(148, 163, 184, 0.20);
    background: rgba(30, 41, 59, 0.92);
    box-shadow: 0 22px 46px rgba(2, 6, 23, 0.28);
}

body.system-dark-theme .document-card,
body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool,
body.system-dark-theme .payment-plan-option,
body.system-dark-theme .document-search,
body.system-dark-theme .notification-popover,
body.system-dark-theme .admin-quota-summary,
body.system-dark-theme .admin-quota-summary-item {
    border-color: rgba(148, 163, 184, 0.22);
    color: #f8fafc;
    background: rgba(30, 41, 59, 0.90);
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.22);
}

body.system-dark-theme .document-card:hover,
body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover,
body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool.is-active:hover,
body.system-dark-theme .dashboard-document-item:hover,
body.system-dark-theme .popular-document:hover {
    border-color: rgba(96, 165, 250, 0.54);
    background: rgba(30, 64, 175, 0.28);
    box-shadow: 0 24px 54px rgba(2, 6, 23, 0.32);
}

body.system-dark-theme input,
body.system-dark-theme select,
body.system-dark-theme textarea,
body.system-dark-theme .document-search input,
body.system-dark-theme .pdf-local-view .pdf-upload-dropzone input[type="file"] {
    border-color: rgba(148, 163, 184, 0.25);
    color: #f8fafc;
    background: #111827;
}

body.system-dark-theme input::placeholder,
body.system-dark-theme textarea::placeholder {
    color: rgba(203, 213, 225, 0.66);
}

body.system-dark-theme select option {
    color: #0f172a;
    background: #ffffff;
}

body.system-dark-theme button,
body.system-dark-theme .secondary-button,
body.system-dark-theme .icon-button,
body.system-dark-theme .control-link,
body.system-dark-theme .wizard-navigation button {
    border-color: rgba(148, 163, 184, 0.24);
}

body.system-dark-theme .secondary-button,
body.system-dark-theme .icon-button,
body.system-dark-theme .theme-toggle-button,
body.system-dark-theme .pdf-local-view .generator-bar .secondary-button,
body.system-dark-theme .pdf-local-back-button {
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.82);
}

body.system-dark-theme .pdf-local-note {
    border-color: rgba(16, 185, 129, 0.22);
    border-left-color: #10b981;
    background: rgba(6, 78, 59, 0.38);
    color: #d1fae5;
}

body.system-dark-theme .pdf-local-note strong {
    color: #86efac;
}

body.system-dark-theme .pdf-local-category-tabs span {
    border-color: rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.76);
}

body.system-dark-theme .pdf-local-category-tabs span.is-active {
    border-color: #bfdbfe;
    color: #0f172a;
    background: #bfdbfe;
}

body.system-dark-theme .pdf-local-operation-tab {
    border-color: rgba(148, 163, 184, 0.22);
    color: #dbeafe;
    background: rgba(30, 41, 59, 0.86);
}

body.system-dark-theme .pdf-local-operation-tab:hover,
body.system-dark-theme .pdf-local-operation-tab.is-active {
    color: #ffffff;
    background: #2563eb;
}

body.system-dark-theme .pdf-local-view .pdf-upload-dropzone {
    border-color: rgba(96, 165, 250, 0.36);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.12), transparent),
        rgba(15, 23, 42, 0.78);
}

body.system-dark-theme .pdf-local-view .pdf-upload-dropzone > span,
body.system-dark-theme .pdf-local-view .field span,
body.system-dark-theme .pdf-local-view .field small {
    color: #e2e8f0;
}

body.system-dark-theme .pdf-local-view .pdf-local-preview {
    border-color: rgba(148, 163, 184, 0.24);
    background: #111827;
}

body.system-dark-theme .pdf-local-actions {
    border-top-color: rgba(148, 163, 184, 0.20);
}

body.system-light-theme,
body.system-light-theme.auth-open,
body.system-light-theme.document-home-open,
body.system-light-theme.document-generator-open,
body.system-light-theme.admin-access-open,
body.system-light-theme.pdf-tools-open {
    --bg: #f7f7fb;
    --surface: #ffffff;
    --surface-soft: #eef4ff;
    --text: #1d2433;
    --muted: #667085;
    --border: #d9e2ef;
    --shadow: 0 20px 60px rgba(30, 41, 59, 0.12);
    color: #1d2433;
    background:
        radial-gradient(circle at 8% 0%, rgba(31, 111, 235, 0.09), transparent 28%),
        radial-gradient(circle at 95% 12%, rgba(239, 68, 68, 0.08), transparent 24%),
        #f7f7fb;
}

body.system-light-theme .app,
body.system-light-theme .auth-copy,
body.system-light-theme .auth-copy h1,
body.system-light-theme .document-home-header h1,
body.system-light-theme .intro h1,
body.system-light-theme .section-title,
body.system-light-theme .document-section-heading h2,
body.system-light-theme .profile-heading h2,
body.system-light-theme .profile-card strong,
body.system-light-theme .document-card-copy strong,
body.system-light-theme .dashboard-stat-card strong,
body.system-light-theme .dashboard-document-item strong,
body.system-light-theme .popular-document strong,
body.system-light-theme .admin-user-identity strong {
    color: #1d2433;
}

body.system-light-theme .descricao,
body.system-light-theme .auth-copy .descricao,
body.system-light-theme .document-user-email,
body.system-light-theme .document-card-copy span,
body.system-light-theme .profile-card p,
body.system-light-theme .profile-details dt,
body.system-light-theme .profile-details dd,
body.system-light-theme .section-description,
body.system-light-theme .dashboard-document-item span,
body.system-light-theme .popular-document span,
body.system-light-theme .admin-user-meta,
body.system-light-theme .message {
    color: #667085;
}

body.system-light-theme .auth-panel,
body.system-light-theme .form-panel,
body.system-light-theme .document-home-header,
body.system-light-theme .plan-summary-card,
body.system-light-theme .version-card,
body.system-light-theme .profile-card,
body.system-light-theme .profile-theme-panel,
body.system-light-theme .dashboard-stat-card,
body.system-light-theme .dashboard-document-item,
body.system-light-theme .popular-document,
body.system-light-theme .admin-user-item,
body.system-light-theme .payment-card,
body.system-light-theme .updates-card,
body.system-light-theme .support-chat-card,
body.system-light-theme .bottom-navigation {
    border-color: #d9e2ef;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 45px rgba(30, 41, 59, 0.09);
}

body.system-light-theme .document-card,
body.system-light-theme .payment-plan-option,
body.system-light-theme .document-search,
body.system-light-theme .notification-popover,
body.system-light-theme .admin-quota-summary,
body.system-light-theme .admin-quota-summary-item {
    border-color: #d9e2ef;
    color: #1d2433;
    background: #ffffff;
    box-shadow: 0 16px 34px rgba(30, 41, 59, 0.07);
}

body.system-light-theme input,
body.system-light-theme select,
body.system-light-theme textarea,
body.system-light-theme .document-search input {
    border-color: #d8dde9;
    color: #1d2433;
    background: #ffffff;
}

body.system-light-theme input::placeholder,
body.system-light-theme textarea::placeholder {
    color: rgba(102, 112, 133, 0.70);
}

body.system-light-theme select option {
    color: #1d2433;
    background: #ffffff;
}

body.system-light-theme .secondary-button,
body.system-light-theme .icon-button,
body.system-light-theme .theme-toggle-button {
    border-color: rgba(31, 41, 55, 0.14);
    color: #1f2937;
    background: #ffffff;
}

body.system-light-theme .system-theme-select-label select {
    color: #1d2433;
    background: #ffffff;
}

@media (max-width: 720px) {
    .profile-system-theme-panel,
    .document-header-actions,
    .user-menu {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .system-theme-select-label,
    .theme-toggle-button {
        width: 100%;
    }
}


/* ===== AJUSTES FINAIS - TEMA, PDF E UPLOAD ===== */
/* Remove a faixa/retângulo do cabeçalho da home em todos os temas. */
.document-home-header,
body.system-dark-theme .document-home-header,
body.system-light-theme .document-home-header,
body.liquid-glass-theme .document-home-header,
body.document-home-open .document-home-header {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.document-header-actions {
    margin-left: auto;
}

/* Tema branco com textos mais fortes e legíveis. */
body.system-light-theme,
body.system-light-theme .app,
body.system-light-theme .document-view,
body.system-light-theme .document-home-header,
body.system-light-theme .document-section-heading h2,
body.system-light-theme .document-card-copy strong,
body.system-light-theme .popular-document span,
body.system-light-theme .dashboard-document-item span,
body.system-light-theme .plan-summary-card h2,
body.system-light-theme .version-card h2,
body.system-light-theme .profile-card strong,
body.system-light-theme .pdf-local-view,
body.system-light-theme .pdf-local-operation-header h2,
body.system-light-theme .pdf-upload-stage-heading strong {
    color: #111827 !important;
    opacity: 1 !important;
}

body.system-light-theme .document-user-email,
body.system-light-theme .descricao,
body.system-light-theme .document-card-copy span,
body.system-light-theme .plan-summary-label,
body.system-light-theme .plan-summary-remaining,
body.system-light-theme .plan-progress-heading span,
body.system-light-theme #documentPlanExpiration,
body.system-light-theme .version-highlights span,
body.system-light-theme .version-card-copy time,
body.system-light-theme .dashboard-document-item span,
body.system-light-theme .popular-document span,
body.system-light-theme .profile-card p,
body.system-light-theme .pdf-local-view .descricao,
body.system-light-theme .pdf-local-operation-header p:not(.eyebrow),
body.system-light-theme .pdf-upload-stage-heading span:not(.pdf-upload-icon),
body.system-light-theme .pdf-local-view .pdf-local-form small,
body.system-light-theme .pdf-local-view .pdf-upload-dropzone small {
    color: #475569 !important;
    opacity: 1 !important;
}

body.system-light-theme .document-home-kicker,
body.system-light-theme .eyebrow,
body.system-light-theme .pdf-local-view .eyebrow,
body.system-light-theme .pdf-upload-stage .document-home-kicker {
    color: #2563eb !important;
    opacity: 1 !important;
}

body.system-light-theme .plan-summary-card,
body.system-light-theme .version-card,
body.system-light-theme .dashboard-document-item,
body.system-light-theme .popular-document,
body.system-light-theme .document-card,
body.system-light-theme .profile-card,
body.system-light-theme .bottom-navigation {
    border-color: #d6deeb !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 18px 42px rgba(30, 41, 59, 0.08) !important;
}

/* No tema branco, o hover não volta para o azul escuro antigo. */
body.system-light-theme .document-view .document-card:hover,
body.system-light-theme .document-card:hover,
body.system-light-theme .popular-document:hover,
body.system-light-theme .dashboard-document-item:hover {
    border-color: rgba(37, 99, 235, 0.38) !important;
    color: #111827 !important;
    background: #ffffff !important;
    box-shadow: 0 22px 46px rgba(30, 41, 59, 0.12) !important;
    transform: translateY(-2px);
}

body.system-light-theme .document-view .document-card:hover .document-card-copy strong,
body.system-light-theme .document-view .document-card:hover .document-card-copy span,
body.system-light-theme .popular-document:hover span,
body.system-light-theme .dashboard-document-item:hover span {
    color: inherit !important;
    opacity: 1 !important;
}

/* A barra superior das ferramentas PDF não fica mais por cima do conteúdo. */
.pdf-local-view .generator-bar,
body.system-dark-theme .pdf-local-view .generator-bar,
body.system-light-theme .pdf-local-view .generator-bar {
    position: static !important;
}

.pdf-local-note {
    display: grid !important;
    gap: 6px !important;
    padding: 14px 18px !important;
    line-height: 1.45 !important;
    overflow: visible !important;
}

.pdf-local-note strong,
.pdf-local-note span {
    display: block !important;
    line-height: 1.45 !important;
}

.pdf-local-operation-panel {
    scroll-margin-top: 120px;
}

/* Remove a lista de abas Juntar/Dividir/Comprimir dentro da tela selecionada. */
.pdf-local-operation-tabs {
    display: none !important;
}

/* Área de upload estilizada e com suporte visual para arrastar/soltar. */
.pdf-local-view .pdf-upload-dropzone {
    position: relative;
    cursor: pointer;
    transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.pdf-local-view .pdf-upload-dropzone::before {
    content: "Arraste e solte o arquivo aqui";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-bottom: 2px;
    padding: 0 18px;
    border-radius: 999px;
    color: #2563eb;
    background: rgba(37, 99, 235, 0.10);
    font-weight: 900;
}

.pdf-local-view .pdf-upload-dropzone.is-dragover {
    border-color: #2563eb !important;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.04)),
        #f8fbff !important;
    box-shadow: 0 22px 48px rgba(37, 99, 235, 0.16) !important;
    transform: translateY(-2px);
}

.pdf-local-view .pdf-upload-dropzone.is-dragover::before {
    content: "Solte para adicionar o arquivo";
    color: #ffffff;
    background: #2563eb;
}

.pdf-local-view .pdf-upload-dropzone input[type="file"] {
    max-width: 560px;
    padding: 10px 12px !important;
    border: 1px solid #cfd8ea !important;
    border-radius: 999px !important;
    color: #334155 !important;
    background: #ffffff !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
    cursor: pointer;
}

.pdf-local-view .pdf-upload-dropzone input[type="file"]::file-selector-button {
    min-height: 38px;
    margin-right: 12px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #60a5fa);
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.pdf-local-view .pdf-upload-dropzone input[type="file"]::file-selector-button:hover {
    filter: brightness(1.04);
}

body.system-dark-theme .pdf-local-view .pdf-upload-dropzone::before {
    color: #bfdbfe;
    background: rgba(96, 165, 250, 0.16);
}

body.system-dark-theme .pdf-local-view .pdf-upload-dropzone.is-dragover::before {
    color: #0f172a;
    background: #bfdbfe;
}

body.system-dark-theme .pdf-local-view .pdf-upload-dropzone input[type="file"] {
    border-color: rgba(148, 163, 184, 0.32) !important;
    color: #e2e8f0 !important;
    background: #111827 !important;
}

body.system-dark-theme .pdf-local-view .pdf-upload-dropzone input[type="file"]::file-selector-button {
    color: #0f172a;
    background: linear-gradient(135deg, #bfdbfe, #60a5fa);
}
/* Ajustes de espaço da central PDF */
body.pdf-tools-open .app {
    width: min(1680px, calc(100% - 56px));
}

.pdf-local-view .pdf-local-panel {
    width: min(100%, 1380px);
    margin: 0 auto;
    padding: clamp(22px, 2.6vw, 36px);
}

.pdf-local-note {
    max-width: 1120px;
}

.pdf-local-hero-card {
    max-width: 1040px;
}

.pdf-local-tools-home {
    gap: 30px;
}

.pdf-local-category-tabs {
    gap: 12px;
    margin: 8px 0 24px;
}

.pdf-local-category-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 22px;
    border: 1px solid #d8dbe5;
    border-radius: 999px;
    color: #424553;
    background: rgba(255, 255, 255, 0.92);
    font: inherit;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
    cursor: pointer;
}

.pdf-local-category-tab:hover {
    border-color: rgba(31, 111, 235, 0.35);
    color: #1f6feb;
}

.pdf-local-category-tab.is-active {
    border-color: #242631;
    color: #ffffff;
    background: #242631;
}

.pdf-local-home-grid {
    gap: 24px;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool {
    min-height: 204px;
    padding: 30px 28px;
}

.pdf-local-operation-panel {
    max-width: 1220px;
}

body.system-dark-theme .pdf-local-category-tab {
    border-color: rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.76);
}

body.system-dark-theme .pdf-local-category-tab:hover {
    color: #bfdbfe;
}

body.system-dark-theme .pdf-local-category-tab.is-active {
    border-color: #bfdbfe;
    color: #0f172a;
    background: #bfdbfe;
}

@media (max-width: 900px) {
    body.pdf-tools-open .app {
        width: min(100% - 24px, 1680px);
    }

    .pdf-local-view .pdf-local-panel {
        padding: 18px;
    }

    .pdf-local-home-grid {
        gap: 16px;
    }
}

@media (max-width: 720px) {
    .document-header-left {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .document-brand-logo {
        width: min(180px, 58vw);
        max-height: 58px;
    }

    .auth-brand-logo {
        width: min(260px, 78vw);
    }
}

/* ===== Login DocSpace em painel lateral ===== */
body.auth-open .app {
    width: min(1120px, calc(100% - 40px));
    padding: clamp(28px, 5vh, 56px) 0;
}

body.auth-open .auth-view {
    position: relative;
    isolation: isolate;
    min-height: min(720px, calc(100vh - 112px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
    align-items: stretch;
    gap: 0;
    padding: clamp(18px, 2.6vw, 30px);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 26px;
    background:
        radial-gradient(circle at 18% 22%, rgba(37, 99, 235, 0.20), transparent 30%),
        radial-gradient(circle at 82% 18%, rgba(56, 189, 248, 0.12), transparent 28%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.72));
    box-shadow:
        0 28px 72px rgba(2, 6, 23, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.auth-open .auth-view::before,
body.auth-open .auth-view::after {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    border-radius: 999px;
    filter: blur(4px);
}

body.auth-open .auth-view::before {
    width: 360px;
    height: 360px;
    left: -130px;
    bottom: -140px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 68%);
}

body.auth-open .auth-view::after {
    width: 280px;
    height: 280px;
    right: -110px;
    top: -110px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.18), transparent 66%);
}

body.auth-open .auth-copy {
    position: relative;
    display: flex;
    min-height: 540px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(28px, 5vw, 58px);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    text-align: center;
}

body.auth-open .auth-copy::before {
    content: "";
    display: block;
    width: clamp(150px, 19vw, 220px);
    height: clamp(150px, 19vw, 220px);
    margin: 0 auto 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 42px;
    background:
        linear-gradient(145deg, rgba(37, 99, 235, 0.16), rgba(56, 189, 248, 0.08)),
        url("assets/LOGO1.png") center / 76% no-repeat;
    box-shadow:
        0 26px 60px rgba(37, 99, 235, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

body.auth-open .auth-brand-logo {
    width: min(360px, 88%);
    max-height: 116px;
    margin: 0 auto 18px;
    padding: 12px 18px;
    border-radius: 22px;
    background: rgba(15, 23, 42, 0.30);
}

body.auth-open .auth-copy .eyebrow {
    margin-top: 0;
    color: #60a5fa;
}

body.auth-open .auth-copy h1 {
    font-size: clamp(2rem, 4vw, 3.1rem);
}

body.auth-open .auth-copy .descricao {
    max-width: 430px;
    font-size: 1.03rem;
}

body.auth-open .auth-panel {
    align-self: center;
    width: 100%;
    margin: 0;
    padding: clamp(26px, 3vw, 34px);
    border-color: rgba(148, 163, 184, 0.26);
    border-radius: 22px;
    background: rgba(30, 41, 59, 0.86);
    box-shadow:
        0 24px 56px rgba(2, 6, 23, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(12px);
}

body.auth-open .auth-panel-heading h2 {
    font-size: 1.3rem;
}

@media (max-width: 900px) {
    body.auth-open .app {
        width: min(560px, calc(100% - 28px));
    }

    body.auth-open .auth-view {
        min-height: auto;
        grid-template-columns: 1fr;
        padding: 18px;
    }

    body.auth-open .auth-copy {
        min-height: auto;
        padding: 22px 18px 28px;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    }

    body.auth-open .auth-copy::before {
        width: 118px;
        height: 118px;
        margin-bottom: 16px;
        border-radius: 28px;
    }

    body.auth-open .auth-brand-logo {
        width: min(300px, 88%);
        max-height: 94px;
    }

    body.auth-open .auth-panel {
        margin-top: 18px;
    }
}

/* Ajuste fino do login DocSpace: marca limpa e formulario afastado */
body.auth-open .auth-view {
    grid-template-columns: minmax(0, 1.05fr) minmax(390px, 520px);
    column-gap: clamp(44px, 5.5vw, 88px);
    padding: clamp(24px, 3vw, 38px) clamp(28px, 4vw, 56px);
}

body.auth-open .auth-copy {
    padding-right: clamp(32px, 4vw, 72px);
}

body.auth-open .auth-copy::before {
    display: none;
}

body.auth-open .auth-brand-logo {
    width: min(420px, 92%);
    max-height: 130px;
    margin-bottom: 28px;
}

body.auth-open .auth-panel {
    max-width: 520px;
    justify-self: end;
}

@media (max-width: 900px) {
    body.auth-open .auth-view {
        grid-template-columns: 1fr;
        column-gap: 0;
        padding: 18px;
    }

    body.auth-open .auth-copy {
        padding-right: 18px;
    }

    body.auth-open .auth-brand-logo {
        width: min(320px, 88%);
        max-height: 104px;
        margin-bottom: 16px;
    }

    body.auth-open .auth-panel {
        max-width: none;
        justify-self: stretch;
    }
}


/* Pagamento integrado Mercado Pago */
body.system-dark-theme .payment-api-placeholder {
    border-color: rgba(96, 165, 250, 0.32);
    background: rgba(37, 99, 235, 0.12);
}

body.system-light-theme .payment-api-placeholder {
    border-color: rgba(37, 99, 235, 0.22);
    background: rgba(37, 99, 235, 0.06);
}


/* Mercado Pago Payment Brick dentro do DocSpace */
.payment-brick-container {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.payment-brick-container.is-hidden,
.payment-brick-status.is-hidden {
    display: none;
}

.payment-brick-status {
    margin: 14px 0 0;
    padding: 12px 14px;
    border: 1px solid rgba(37, 99, 235, 0.20);
    border-radius: 14px;
    color: #1e3a8a;
    background: rgba(219, 234, 254, 0.74);
    font-weight: 700;
}

body.theme-light .payment-brick-container,
body.light-theme .payment-brick-container,
body[data-theme="light"] .payment-brick-container {
    color: #111827;
    background: #ffffff;
}

body.liquid-glass-theme .payment-brick-container {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(18px) saturate(1.25);
}

/* Pix direto dentro do DocSpace */
.payment-pix-code-field {
    margin-top: 16px;
}

.payment-pix-code-field textarea {
    min-height: 104px;
    resize: vertical;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.88rem;
    line-height: 1.45;
}

.payment-pix-code-field.is-hidden {
    display: none;
}

.payment-api-placeholder img {
    width: min(100%, 260px);
    max-width: 260px;
    height: auto;
    padding: 10px;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.16);
}

.payment-api-placeholder:has(img) {
    gap: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.86));
}

body.system-dark-theme .payment-api-placeholder:has(img) {
    color: #e5edff;
    background: rgba(15, 23, 42, 0.68);
}

body.system-dark-theme .payment-api-placeholder:has(img) span {
    color: #b8c7e6;
}

/* ===== HOME OTIMIZADA 4.2.0 - LAYOUT WEB + MOBILE ===== */
body.document-home-open .app {
    width: min(1340px, calc(100% - 40px));
    padding-top: 24px;
}

body.document-home-open .document-view {
    --home-card: rgba(15, 31, 61, 0.78);
    --home-card-strong: rgba(24, 43, 82, 0.88);
    --home-border: rgba(148, 163, 184, 0.20);
    --home-blue: #2563eb;
    --home-blue-soft: rgba(37, 99, 235, 0.18);
    --home-cyan: #38bdf8;
    --home-green: #22c55e;
    --home-purple: #8b5cf6;
    --home-text: #f8fafc;
    --home-muted: #aebdd0;
}

body.document-home-open .document-home-header.app-shell-header,
body.system-dark-theme.document-home-open .document-home-header.app-shell-header,
body.system-light-theme.document-home-open .document-home-header.app-shell-header,
body.liquid-glass-theme.document-home-open .document-home-header.app-shell-header {
    position: sticky;
    top: 14px;
    z-index: 35;
    display: grid !important;
    grid-template-columns: auto minmax(280px, 560px) auto;
    align-items: center;
    gap: 18px;
    margin: 0 0 20px !important;
    padding: 14px 18px !important;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 24px !important;
    background: rgba(6, 15, 34, 0.76) !important;
    box-shadow: 0 24px 70px rgba(2, 6, 23, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(18px) saturate(145%);
}

.app-shell-brand,
.app-shell-actions,
.profile-mini-button,
.home-status-pill,
.section-link-button,
.home-action-card,
.home-action-copy,
.home-summary-card,
.home-category-card,
.home-category-card > span:not(.home-category-icon),
.dashboard-document-item-meta,
.dashboard-document-item-type {
    display: flex;
    align-items: center;
}

.app-shell-brand {
    gap: 10px;
    min-width: 0;
    color: var(--home-text);
    font-size: 1.12rem;
    font-weight: 900;
    letter-spacing: -0.03em;
}

.app-shell-logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.app-shell-search.global-document-search,
.document-search.app-shell-search {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 560px;
    margin: 0;
}

.app-shell-search input {
    min-height: 48px;
    padding-right: 82px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.66);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-shell-search kbd {
    position: absolute;
    top: 50%;
    right: 12px;
    padding: 3px 7px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 7px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.72);
    font-size: 0.70rem;
    font-family: inherit;
    transform: translateY(-50%);
    pointer-events: none;
}

.app-shell-actions {
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.app-shell-actions .icon-button,
.profile-mini-button,
.app-shell-actions .theme-toggle-button,
.app-shell-actions .home-logout-button {
    min-height: 42px;
    border-radius: 13px;
}

.updates-shortcut-button {
    color: #bfdbfe;
}

.profile-mini-button {
    gap: 7px;
    min-height: 44px;
    padding: 4px 8px 4px 4px;
    border: 1px solid rgba(148, 163, 184, 0.20);
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.68);
}

.profile-mini-button .document-greeting-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
}

.profile-mini-button > svg {
    width: 15px;
    height: 15px;
    color: #94a3b8;
}

.optimized-home {
    display: grid;
    gap: 24px;
}

.optimized-home .home-hero-card,
body.system-dark-theme .optimized-home .home-hero-card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(280px, 1.08fr) minmax(260px, 0.92fr) auto;
    gap: 28px;
    overflow: hidden;
    min-height: 186px;
    padding: clamp(22px, 3vw, 36px);
    border: 1px solid rgba(96, 165, 250, 0.26);
    border-radius: 28px;
    background:
        radial-gradient(circle at 12% 15%, rgba(59, 130, 246, 0.36), transparent 28%),
        radial-gradient(circle at 88% 15%, rgba(37, 99, 235, 0.34), transparent 35%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(30, 64, 175, 0.72));
    box-shadow: 0 30px 80px rgba(2, 6, 23, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.optimized-home .home-hero-card::before {
    content: "";
    position: absolute;
    inset: auto -12% -70% 42%;
    height: 240px;
    border-radius: 999px;
    background: rgba(96, 165, 250, 0.12);
    filter: blur(4px);
    transform: rotate(-14deg);
}

.home-hero-copy,
.home-hero-plan,
.home-hero-actions {
    position: relative;
    z-index: 1;
}

.home-hero-copy h1 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 4.2vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.055em;
}

.home-hero-subtitle {
    margin: 9px 0 0;
    color: #dbeafe;
    font-size: 1rem;
}

.home-hero-copy .document-user-email {
    margin-top: 5px;
    color: #93c5fd;
}

.home-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 20px;
}

.home-status-pill {
    gap: 7px;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    color: #dcfce7;
    background: rgba(16, 185, 129, 0.18);
    font-size: 0.84rem;
    font-weight: 850;
}

.home-status-pill svg {
    width: 15px;
    height: 15px;
}

.home-status-pill-muted {
    color: #dbeafe;
    background: rgba(148, 163, 184, 0.18);
}

.home-hero-plan {
    align-self: center;
    padding-left: 30px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.home-hero-plan .plan-progress-heading {
    margin-bottom: 12px;
    font-size: 0.92rem;
    font-weight: 900;
}

.home-hero-plan .plan-progress-heading span,
.home-hero-plan .plan-progress-heading strong {
    color: #ffffff;
}

.home-hero-plan .plan-progress-track {
    height: 9px;
    background: rgba(191, 219, 254, 0.18);
}

.home-hero-plan p {
    color: #bfdbfe;
    font-size: 0.84rem;
}

.document-view .home-hero-actions {
    align-self: center;
    display: grid;
    gap: 9px;
}

.document-view .home-hero-actions button {
    justify-content: center;
    min-width: 126px;
    border-radius: 13px;
}

.compact-section-heading {
    margin-bottom: 12px;
}

.compact-section-heading h2 {
    font-size: 1.35rem;
    letter-spacing: -0.035em;
}

.section-link-button {
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 4px;
    border: 0;
    color: #93c5fd;
    background: transparent;
    font-size: 0.86rem;
    font-weight: 850;
}

.section-link-button svg {
    width: 16px;
    height: 16px;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.home-action-card,
.home-summary-card,
.home-category-card,
.optimized-home .dashboard-document-item {
    position: relative;
    min-width: 0;
    border: 1px solid var(--home-border);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.84), rgba(15, 23, 42, 0.72));
    box-shadow: 0 18px 44px rgba(2, 6, 23, 0.22), inset 0 1px 0 rgba(255,255,255,0.05);
    backdrop-filter: blur(14px);
}

.home-action-card {
    justify-content: flex-start;
    gap: 16px;
    min-height: 112px;
    padding: 20px;
    border-radius: 20px;
    color: var(--home-text);
    text-align: left;
}

.home-action-card:hover,
.home-summary-card:hover,
.home-category-card:hover,
.optimized-home .dashboard-document-item:hover {
    border-color: rgba(96, 165, 250, 0.54);
    background: linear-gradient(145deg, rgba(37, 99, 235, 0.26), rgba(15, 23, 42, 0.82));
    box-shadow: 0 24px 58px rgba(2, 6, 23, 0.30);
    transform: translateY(-2px);
}

.home-action-icon,
.home-summary-icon,
.home-category-icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.26);
}

.home-action-icon {
    width: 58px;
    height: 58px;
}

.home-action-pdf .home-action-icon,
.home-summary-card-pdf .home-summary-icon {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.home-action-pix .home-action-icon {
    background: linear-gradient(135deg, #0d9488, #5eead4);
}

.home-action-icon svg {
    width: 28px;
    height: 28px;
}

.home-action-copy {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
}

.home-action-copy strong,
.home-category-card strong {
    color: #f8fafc;
    font-size: 1rem;
    line-height: 1.2;
}

.home-action-copy span,
.home-category-card small {
    color: var(--home-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.home-action-card > svg,
.home-category-card > svg:last-child {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: #93c5fd;
}

.home-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.home-summary-card {
    gap: 15px;
    min-height: 112px;
    padding: 18px;
    border-radius: 18px;
}

.home-summary-icon {
    width: 54px;
    height: 54px;
    border-radius: 15px;
}

.home-summary-card-favorite .home-summary-icon {
    background: linear-gradient(135deg, #a16207, #facc15);
}

.home-summary-card-recent .home-summary-icon {
    background: linear-gradient(135deg, #047857, #22c55e);
}

.home-summary-icon svg {
    width: 25px;
    height: 25px;
}

.home-summary-card div {
    min-width: 0;
}

.home-summary-card span,
.home-summary-card small {
    display: block;
    color: var(--home-muted);
    font-size: 0.78rem;
    line-height: 1.25;
}

.home-summary-card strong {
    display: block;
    margin: 3px 0;
    color: #ffffff;
    font-size: 1.7rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.home-recent-grid.dashboard-document-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.optimized-home .dashboard-document-item {
    min-height: 82px;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
}

.optimized-home .dashboard-document-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.24);
}

.optimized-home .dashboard-document-item > span:nth-child(2) {
    display: grid;
    gap: 4px;
    font-size: 0.92rem;
}

.dashboard-document-item-title {
    color: #f8fafc;
    font-weight: 900;
    line-height: 1.2;
}

.dashboard-document-item-meta {
    gap: 8px;
    color: #94a3b8;
    font-size: 0.77rem;
    font-weight: 650;
}

.dashboard-document-item-type {
    justify-content: center;
    min-width: 42px;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    color: #c7d2fe;
    background: rgba(99, 102, 241, 0.18);
    font-size: 0.68rem;
    font-weight: 900;
}

.home-category-grid.popular-document-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.home-category-card.popular-document {
    min-height: 86px;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
}

.home-category-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.home-category-card:nth-child(2) .home-category-icon {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.home-category-card:nth-child(3) .home-category-icon {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
}

.home-category-card:nth-child(4) .home-category-icon {
    background: linear-gradient(135deg, #f97316, #fb923c);
}

.home-category-icon svg {
    width: 21px;
    height: 21px;
}

.home-category-card > span:not(.home-category-icon) {
    flex: 1;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

/* Esconde a biblioteca completa da página inicial: ela abre somente na aba Documentos. */
#documentCatalogSection[data-home-section="documents"].is-hidden {
    display: none;
}

body.system-light-theme.document-home-open .document-view {
    --home-card: rgba(255, 255, 255, 0.92);
    --home-card-strong: rgba(255, 255, 255, 0.98);
    --home-border: #d9e2ef;
    --home-text: #111827;
    --home-muted: #64748b;
}

body.system-light-theme.document-home-open .document-home-header.app-shell-header {
    background: rgba(255, 255, 255, 0.84) !important;
    box-shadow: 0 24px 70px rgba(30, 41, 59, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.90) !important;
}

body.system-light-theme .app-shell-brand,
body.system-light-theme .home-summary-card strong,
body.system-light-theme .home-action-copy strong,
body.system-light-theme .home-category-card strong,
body.system-light-theme .dashboard-document-item-title {
    color: #111827 !important;
}

body.system-light-theme .home-hero-copy h1,
body.system-light-theme .home-hero-plan .plan-progress-heading span,
body.system-light-theme .home-hero-plan .plan-progress-heading strong {
    color: #ffffff !important;
}

body.system-light-theme .home-action-card,
body.system-light-theme .home-summary-card,
body.system-light-theme .home-category-card,
body.system-light-theme .optimized-home .dashboard-document-item {
    color: #111827 !important;
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 18px 44px rgba(30, 41, 59, 0.09) !important;
}

body.system-light-theme .home-action-card:hover,
body.system-light-theme .home-summary-card:hover,
body.system-light-theme .home-category-card:hover,
body.system-light-theme .optimized-home .dashboard-document-item:hover {
    background: #ffffff !important;
    box-shadow: 0 24px 58px rgba(30, 41, 59, 0.13) !important;
}

body.liquid-glass-theme.document-home-open .home-action-card,
body.liquid-glass-theme.document-home-open .home-summary-card,
body.liquid-glass-theme.document-home-open .home-category-card,
body.liquid-glass-theme.document-home-open .optimized-home .dashboard-document-item,
body.liquid-glass-theme.document-home-open .document-home-header.app-shell-header {
    backdrop-filter: blur(26px) saturate(160%);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.055)) !important;
}

body.liquid-glass-theme.document-home-open .home-hero-card {
    backdrop-filter: blur(24px) saturate(160%);
}

@media (max-width: 1100px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: auto 1fr;
    }

    .app-shell-search {
        grid-column: 1 / -1;
        grid-row: 2;
        max-width: none !important;
    }

    .app-shell-actions {
        justify-self: end;
    }

    .optimized-home .home-hero-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .home-hero-plan {
        padding-left: 0;
        border-left: 0;
    }

    .document-view .home-hero-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .home-summary-grid,
    .home-category-grid.popular-document-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    body.document-home-open .app {
        width: min(100% - 22px, 620px);
        padding-top: 12px;
    }

    body.document-home-open .document-home-header.app-shell-header {
        top: 8px;
        gap: 12px;
        padding: 12px !important;
        border-radius: 22px !important;
    }

    .app-shell-brand strong {
        font-size: 1rem;
    }

    .app-shell-logo {
        width: 38px;
        height: 38px;
    }

    .app-shell-actions {
        gap: 6px;
    }

    .updates-shortcut-button,
    .app-shell-actions .home-logout-button {
        display: none !important;
    }

    .app-shell-actions .theme-toggle-button span,
    .profile-mini-button > svg {
        display: none;
    }

    .app-shell-actions .theme-toggle-button,
    .app-shell-actions .icon-button {
        width: 42px;
        padding-inline: 0;
    }

    .app-shell-search kbd {
        display: none;
    }

    .app-shell-search input {
        padding-right: 14px;
    }

    .optimized-home {
        gap: 22px;
    }

    .optimized-home .home-hero-card {
        min-height: 0;
        padding: 24px 20px;
        border-radius: 26px;
    }

    .home-hero-copy h1 {
        font-size: 2rem;
    }

    .home-hero-badges {
        margin-top: 16px;
    }

    .home-action-grid,
    .home-recent-grid.dashboard-document-list,
    .home-category-grid.popular-document-grid {
        grid-template-columns: 1fr;
    }

    .home-action-card {
        min-height: 92px;
        padding: 16px;
    }

    .home-action-icon {
        width: 50px;
        height: 50px;
    }

    .home-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .home-summary-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        min-height: 128px;
        padding: 15px;
    }

    .home-summary-icon {
        width: 44px;
        height: 44px;
    }

    .home-summary-card strong {
        font-size: 1.55rem;
    }

    .compact-section-heading {
        align-items: flex-start;
    }

    .section-link-button {
        display: none;
    }

    .bottom-navigation {
        border-radius: 22px;
    }
}

@media (max-width: 420px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .app-shell-brand {
        gap: 8px;
    }

    .app-shell-actions .theme-toggle-button {
        display: none !important;
    }

    .home-status-pill {
        width: 100%;
        justify-content: center;
    }

    .home-summary-grid {
        gap: 9px;
    }
}

/* Ajuste de prioridade para os ícones dos cards de categoria da home. */
.home-category-card .home-category-icon {
    flex: 0 0 auto;
}

.home-category-card .home-category-icon svg {
    width: 21px;
    height: 21px;
    color: #ffffff;
}




/* ===== AJUSTE SEGURO - ÁREA FERRAMENTAS PDF ===== */

.pdf-local-view .generator-bar {
    align-items: center;
    gap: 14px;
    padding: 14px 16px !important;
    border-radius: 22px !important;
}

.pdf-local-view .intro {
    max-width: 940px;
    margin: 0 auto 28px;
    text-align: center;
}

.pdf-local-view .intro h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    letter-spacing: -0.06em;
}

.pdf-local-view .descricao {
    max-width: 760px;
    margin: 12px auto 0;
    font-size: clamp(1rem, 1.5vw, 1.16rem);
    line-height: 1.65;
}

.pdf-local-view .pdf-local-panel {
    width: min(100%, 1380px);
    margin: 0 auto;
    padding: clamp(18px, 2.5vw, 34px);
    border-radius: 28px;
}

.pdf-local-note {
    display: grid !important;
    gap: 6px !important;
    max-width: 1120px;
    margin: 0 auto 26px !important;
    padding: 16px 20px !important;
    border-radius: 18px !important;
    line-height: 1.5;
}

.pdf-local-note strong {
    font-size: 1rem;
}

.pdf-local-tools-home {
    gap: 28px !important;
}

.pdf-local-hero-card {
    max-width: 1040px;
    margin: 0 auto;
    padding: 28px;
    border-radius: 28px;
    text-align: center;
}

.pdf-local-hero-card h2 {
    font-size: clamp(1.7rem, 3vw, 2.5rem);
    letter-spacing: -0.045em;
}

.pdf-local-hero-card p:not(.eyebrow) {
    max-width: 720px;
    margin: 12px auto 0;
    line-height: 1.6;
}

.pdf-local-category-tabs {
    justify-content: center;
    gap: 12px !important;
    margin: 6px 0 22px !important;
}

.pdf-local-category-tab {
    min-height: 42px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 900;
}

.pdf-local-view .pdf-local-home-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    max-width: 1180px;
    margin: 0 auto;
    gap: 22px;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool {
    min-height: 205px;
    padding: 26px 22px;
    border-radius: 22px;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover {
    transform: translateY(-4px);
}

.pdf-local-tool-icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
}

.pdf-local-tool-heading {
    gap: 8px;
    flex-wrap: wrap;
}

.pdf-local-home-grid .pdf-local-tool-heading strong {
    font-size: 1.08rem;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child {
    max-width: none;
    line-height: 1.5;
}

/* Tema escuro */
body.system-dark-theme .pdf-local-view .pdf-local-panel,
body.system-dark-theme .pdf-local-hero-card {
    border-color: rgba(148, 163, 184, 0.16) !important;
    background: rgba(15, 23, 42, 0.70) !important;
    box-shadow: 0 24px 60px rgba(2, 6, 23, 0.28) !important;
}

body.system-dark-theme .pdf-local-note {
    border-color: rgba(16, 185, 129, 0.28) !important;
    background: linear-gradient(90deg, rgba(4, 120, 87, 0.28), rgba(6, 95, 70, 0.18)) !important;
    color: #d1fae5 !important;
}

body.system-dark-theme .pdf-local-note strong {
    color: #a7f3d0 !important;
}

body.system-dark-theme .pdf-local-hero-card h2,
body.system-dark-theme .pdf-local-home-grid .pdf-local-tool-heading strong {
    color: #f8fafc !important;
}

body.system-dark-theme .pdf-local-hero-card p:not(.eyebrow),
body.system-dark-theme .pdf-local-home-grid .pdf-local-tool > span:last-child {
    color: #94a3b8 !important;
}

body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool {
    border-color: rgba(148, 163, 184, 0.18) !important;
    background: rgba(15, 23, 42, 0.82) !important;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.24) !important;
}

body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover {
    border-color: rgba(96, 165, 250, 0.48) !important;
    box-shadow: 0 26px 56px rgba(2, 6, 23, 0.34) !important;
}

/* Tema claro */
body.system-light-theme .pdf-local-view,
body.system-light-theme .pdf-local-view .intro h1,
body.system-light-theme .pdf-local-hero-card h2,
body.system-light-theme .pdf-local-home-grid .pdf-local-tool-heading strong {
    color: #0f172a !important;
}

body.system-light-theme .pdf-local-view .descricao,
body.system-light-theme .pdf-local-hero-card p:not(.eyebrow),
body.system-light-theme .pdf-local-home-grid .pdf-local-tool > span:last-child {
    color: #64748b !important;
}

body.system-light-theme .pdf-local-view .pdf-local-panel,
body.system-light-theme .pdf-local-hero-card {
    border-color: rgba(148, 163, 184, 0.22) !important;
    background: rgba(255, 255, 255, 0.96) !important;
    box-shadow: 0 24px 56px rgba(15, 23, 42, 0.08) !important;
}

body.system-light-theme .pdf-local-note {
    border-color: rgba(16, 185, 129, 0.22) !important;
    background: #ecfdf5 !important;
    color: #065f46 !important;
}

body.system-light-theme .pdf-local-note strong {
    color: #047857 !important;
}

body.system-light-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool {
    border-color: rgba(148, 163, 184, 0.22) !important;
    background: #ffffff !important;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.07) !important;
}

body.system-light-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover {
    border-color: rgba(37, 99, 235, 0.34) !important;
    box-shadow: 0 24px 50px rgba(37, 99, 235, 0.10) !important;
}

body.system-light-theme .pdf-local-category-tab {
    color: #334155 !important;
    border-color: rgba(148, 163, 184, 0.25) !important;
    background: #ffffff !important;
}

body.system-light-theme .pdf-local-category-tab.is-active {
    color: #ffffff !important;
    border-color: #2563eb !important;
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
}

/* Responsivo */
@media (max-width: 1200px) {
    .pdf-local-view .pdf-local-home-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pdf-local-view .pdf-local-home-grid {
        grid-template-columns: 1fr;
    }

    .pdf-local-view .generator-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .pdf-local-hero-card {
        padding: 22px 16px;
    }
}

/* ===== PDF TOOLS - DESIGNER SHELL ===== */
body.pdf-tools-open {
    background:
        radial-gradient(circle at 14% 10%, rgba(37, 99, 235, 0.24), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(56, 189, 248, 0.14), transparent 24%),
        linear-gradient(145deg, #061229 0%, #071936 46%, #031026 100%) !important;
}

body.pdf-tools-open .app {
    width: min(1380px, calc(100% - 64px)) !important;
    padding: 26px 0 34px !important;
}

body.pdf-tools-open .pdf-local-view {
    position: relative;
    isolation: isolate;
    min-height: calc(100vh - 60px);
    padding: 22px clamp(18px, 3vw, 34px) 10px;
    overflow: hidden;
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 28px;
    color: #f8fbff !important;
    background:
        radial-gradient(circle at 10% 18%, rgba(37, 99, 235, 0.16), transparent 22%),
        radial-gradient(circle at 80% 8%, rgba(56, 189, 248, 0.10), transparent 24%),
        linear-gradient(145deg, rgba(6, 18, 41, 0.94), rgba(4, 14, 33, 0.92));
    box-shadow:
        0 34px 90px rgba(2, 6, 23, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.pdf-tools-open .pdf-local-view::before {
    content: "";
    position: absolute;
    left: clamp(24px, 7vw, 150px);
    top: 118px;
    z-index: -1;
    width: 170px;
    height: 190px;
    opacity: 0.8;
    background:
        radial-gradient(circle at 50% 20%, rgba(96, 165, 250, 0.34), transparent 20%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.34), rgba(29, 78, 216, 0.08));
    clip-path: polygon(20% 0, 76% 0, 100% 24%, 100% 100%, 20% 100%);
    filter: drop-shadow(0 22px 35px rgba(37, 99, 235, 0.18));
    transform: rotate(-10deg);
}

body.pdf-tools-open .pdf-local-view::after {
    content: "";
    position: absolute;
    left: clamp(20px, 6vw, 126px);
    top: 160px;
    z-index: -1;
    width: 230px;
    height: 190px;
    opacity: 0.34;
    background:
        linear-gradient(90deg, transparent 0 18%, rgba(96, 165, 250, 0.64) 18% 19%, transparent 19% 100%),
        linear-gradient(145deg, transparent 0 44%, rgba(96, 165, 250, 0.58) 44% 45%, transparent 45% 100%);
}

.pdf-local-view .generator-bar,
body.system-dark-theme .pdf-local-view .generator-bar,
body.system-light-theme .pdf-local-view .generator-bar {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 56px;
    margin: -4px 0 8px !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.pdf-local-view .generator-bar::before {
    content: "DocSpace";
    position: absolute;
    left: 50%;
    top: 50%;
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding-left: 34px;
    color: #f8fbff;
    font-size: 1.24rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    background: url("assets/LOGO1.png") left center / 26px 26px no-repeat;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.pdf-local-view .generator-bar .secondary-button,
.pdf-local-view .theme-toggle-button,
body.system-dark-theme .pdf-local-view .generator-bar .secondary-button,
body.system-light-theme .pdf-local-view .generator-bar .secondary-button {
    min-height: 40px;
    padding: 0 16px;
    border: 1px solid rgba(148, 163, 184, 0.18) !important;
    border-radius: 8px !important;
    color: #e5eefc !important;
    background: rgba(8, 20, 45, 0.62) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.pdf-local-view .theme-toggle-button span {
    font-size: 0;
}

.pdf-local-view .theme-toggle-button span::after {
    content: "Tema";
    font-size: 0.86rem;
}

.pdf-local-view .user-menu {
    gap: 12px;
}

.pdf-local-view .user-menu > span {
    max-width: 270px;
    overflow: hidden;
    color: #aebdd0 !important;
    font-size: 0.84rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-local-view .intro {
    position: relative;
    max-width: 760px !important;
    margin: 18px auto 22px !important;
    text-align: center;
}

.pdf-local-view .intro::before {
    content: "Inicio  >  Ferramentas PDF";
    display: block;
    margin-bottom: 28px;
    color: #91a3bd;
    font-size: 0.82rem;
}

.pdf-local-view .intro .eyebrow,
body.system-light-theme .pdf-local-view .intro .eyebrow {
    margin: 0 0 10px;
    color: #5d7cff !important;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.pdf-local-view .intro h1,
body.system-light-theme .pdf-local-view .intro h1 {
    margin: 0;
    color: #ffffff !important;
    font-size: clamp(2.1rem, 4vw, 3.25rem) !important;
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.pdf-local-view .descricao,
body.system-light-theme .pdf-local-view .descricao {
    max-width: 620px !important;
    margin: 12px auto 0 !important;
    color: #d3dded !important;
    font-size: clamp(0.94rem, 1.2vw, 1.03rem) !important;
    line-height: 1.55 !important;
}

.pdf-local-view .pdf-local-panel,
body.system-dark-theme .pdf-local-view .pdf-local-panel,
body.system-light-theme .pdf-local-view .pdf-local-panel {
    width: min(100%, 1140px) !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#pdfLocalWorkspace {
    display: grid;
    gap: 18px;
}

.pdf-local-tools-home {
    display: grid !important;
    gap: 18px !important;
}

.pdf-local-hero-card.pdf-local-home-dropzone,
body.system-dark-theme .pdf-local-hero-card.pdf-local-home-dropzone,
body.system-light-theme .pdf-local-hero-card.pdf-local-home-dropzone {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 22px;
    width: min(100%, 760px);
    min-height: 128px;
    margin: 0 auto !important;
    padding: 24px 30px !important;
    border: 1px solid rgba(96, 165, 250, 0.28) !important;
    border-radius: 18px !important;
    color: #ffffff !important;
    background:
        linear-gradient(rgba(96, 165, 250, 0.42), rgba(96, 165, 250, 0.42)) padding-box,
        linear-gradient(135deg, rgba(96, 165, 250, 0.36), rgba(80, 70, 230, 0.15)) border-box !important;
    background-color: rgba(23, 38, 82, 0.62) !important;
    box-shadow:
        0 22px 55px rgba(2, 6, 23, 0.22),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    font: inherit;
    text-align: left;
    cursor: pointer;
    outline: 1px dashed rgba(96, 165, 250, 0.62);
    outline-offset: -12px;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.pdf-local-hero-card.pdf-local-home-dropzone:hover,
.pdf-local-hero-card.pdf-local-home-dropzone:focus-visible {
    border-color: rgba(147, 197, 253, 0.62) !important;
    box-shadow: 0 28px 68px rgba(37, 99, 235, 0.22) !important;
    transform: translateY(-2px);
}

.pdf-local-home-upload-icon {
    display: inline-grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 999px;
    color: #ffffff;
    background: linear-gradient(145deg, rgba(86, 111, 255, 0.68), rgba(23, 48, 118, 0.90));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 16px 32px rgba(37, 99, 235, 0.22);
}

.pdf-local-home-upload-icon svg {
    width: 34px;
    height: 34px;
}

.pdf-local-home-upload-copy {
    display: grid;
    gap: 8px;
}

.pdf-local-home-upload-copy strong {
    color: #ffffff;
    font-size: 1.08rem;
    line-height: 1.25;
}

.pdf-local-home-upload-copy small {
    color: #b9c7dc;
    font-size: 0.88rem;
    line-height: 1.45;
}

.pdf-local-note,
body.system-dark-theme .pdf-local-note,
body.system-light-theme .pdf-local-note {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px !important;
    width: min(100%, 1040px);
    max-width: 1040px !important;
    margin: 4px auto 0 !important;
    padding: 16px 22px !important;
    border: 1px solid rgba(34, 197, 94, 0.28) !important;
    border-left: 1px solid rgba(34, 197, 94, 0.28) !important;
    border-radius: 16px !important;
    color: #dcfce7 !important;
    background: linear-gradient(90deg, rgba(16, 130, 83, 0.34), rgba(3, 82, 68, 0.30)) !important;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.16) !important;
}

.pdf-local-note .pdf-local-note-icon {
    display: inline-grid !important;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    color: #8bff73;
    background: rgba(7, 88, 60, 0.70);
}

.pdf-local-note strong,
body.system-dark-theme .pdf-local-note strong,
body.system-light-theme .pdf-local-note strong {
    color: #ffffff !important;
    font-size: 0.95rem !important;
}

.pdf-local-note small {
    display: block;
    margin-top: 4px;
    color: #bfe8d0;
    font-size: 0.82rem;
    line-height: 1.42;
}

.pdf-local-note em {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #8bff73;
    font-style: normal;
    font-size: 0.86rem;
    font-weight: 900;
    white-space: nowrap;
}

.pdf-local-note em svg {
    width: 16px;
    height: 16px;
}

.pdf-local-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    width: min(100%, 1040px);
    margin: 0 auto;
}

.pdf-local-summary-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    min-height: 88px;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(17, 35, 70, 0.72);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 34px rgba(2, 6, 23, 0.16);
}

.pdf-local-summary-card > span {
    grid-row: span 2;
    display: inline-grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border-radius: 14px;
    color: #ffffff;
}

.pdf-summary-tools > span { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.pdf-summary-local > span { background: linear-gradient(145deg, #54f35c, #047857); }
.pdf-summary-format > span { background: linear-gradient(145deg, #9c6dff, #5636d5); }
.pdf-summary-recent > span { background: linear-gradient(145deg, #f59e0b, #8a3d08); }

.pdf-local-summary-card svg {
    width: 24px;
    height: 24px;
}

.pdf-local-summary-card strong {
    min-width: 0;
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.15;
}

.pdf-local-summary-card:first-child strong {
    font-size: 1.45rem;
}

.pdf-local-summary-card small {
    min-width: 0;
    color: #b7c5da;
    font-size: 0.82rem;
    line-height: 1.35;
}

.pdf-local-category-tabs {
    display: flex !important;
    justify-content: center !important;
    gap: 10px !important;
    width: min(100%, 760px);
    margin: 4px auto 0 !important;
    padding: 0 !important;
    overflow-x: auto;
}

.pdf-local-category-tab,
body.system-dark-theme .pdf-local-category-tab,
body.system-light-theme .pdf-local-category-tab {
    min-height: 34px !important;
    padding: 0 22px !important;
    border: 1px solid rgba(148, 163, 184, 0.24) !important;
    border-radius: 999px !important;
    color: #dce8ff !important;
    background: rgba(4, 15, 35, 0.54) !important;
    box-shadow: none !important;
    font-size: 0.84rem;
    font-weight: 900;
}

.pdf-local-category-tab:hover,
.pdf-local-category-tab.is-active,
body.system-dark-theme .pdf-local-category-tab.is-active,
body.system-light-theme .pdf-local-category-tab.is-active {
    border-color: rgba(123, 148, 255, 0.86) !important;
    color: #ffffff !important;
    background: linear-gradient(135deg, #6675ff, #4d5df3) !important;
}

.pdf-local-view .pdf-local-home-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 18px !important;
    width: min(100%, 1120px);
    max-width: 1120px !important;
    margin: 0 auto !important;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool,
body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool,
body.system-light-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool {
    position: relative;
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 174px !important;
    padding: 20px 20px 18px !important;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.17) !important;
    border-radius: 8px !important;
    color: #f8fbff !important;
    background:
        linear-gradient(160deg, rgba(21, 43, 84, 0.92), rgba(10, 27, 58, 0.84)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 16px 36px rgba(2, 6, 23, 0.20) !important;
    text-align: left;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool::after {
    content: ">";
    position: absolute;
    right: 18px;
    bottom: 14px;
    color: #bcd0eb;
    font-size: 1.28rem;
    line-height: 1;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover,
body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover,
body.system-light-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool:hover {
    border-color: rgba(96, 165, 250, 0.50) !important;
    background: linear-gradient(160deg, rgba(32, 61, 116, 0.96), rgba(12, 32, 68, 0.90)) !important;
    box-shadow: 0 24px 48px rgba(2, 6, 23, 0.30) !important;
    transform: translateY(-3px);
}

.pdf-local-tool-icon {
    width: 46px !important;
    height: 46px !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    box-shadow: 0 12px 24px rgba(2, 6, 23, 0.18);
}

.pdf-local-tool-icon svg {
    width: 22px;
    height: 22px;
}

.pdf-local-home-grid .pdf-local-tool:nth-child(1) .pdf-local-tool-icon,
.pdf-local-home-grid .pdf-local-tool:nth-child(5) .pdf-local-tool-icon { background: linear-gradient(145deg, #ff654c, #f04438); }
.pdf-local-home-grid .pdf-local-tool:nth-child(2) .pdf-local-tool-icon,
.pdf-local-home-grid .pdf-local-tool:nth-child(4) .pdf-local-tool-icon { background: linear-gradient(145deg, #60a5fa, #2563eb); }
.pdf-local-home-grid .pdf-local-tool:nth-child(3) .pdf-local-tool-icon,
.pdf-local-home-grid .pdf-local-tool:nth-child(6) .pdf-local-tool-icon,
.pdf-local-home-grid .pdf-local-tool:nth-child(9) .pdf-local-tool-icon { background: linear-gradient(145deg, #73e35a, #22a645); }
.pdf-local-home-grid .pdf-local-tool:nth-child(7) .pdf-local-tool-icon { background: linear-gradient(145deg, #ff7a2f, #ea580c); }
.pdf-local-home-grid .pdf-local-tool:nth-child(8) .pdf-local-tool-icon { background: linear-gradient(145deg, #45a2ff, #1d4ed8); }
.pdf-local-home-grid .pdf-local-tool:nth-child(10) .pdf-local-tool-icon { background: linear-gradient(145deg, #c05bff, #7c3aed); }

.pdf-local-tool-heading {
    display: flex !important;
    align-items: center;
    gap: 7px !important;
    min-width: 0;
}

.pdf-local-home-grid .pdf-local-tool-heading strong,
body.system-dark-theme .pdf-local-home-grid .pdf-local-tool-heading strong,
body.system-light-theme .pdf-local-home-grid .pdf-local-tool-heading strong {
    color: #ffffff !important;
    font-size: 0.98rem !important;
    line-height: 1.2;
}

.pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child,
body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child,
body.system-light-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child {
    padding-right: 14px;
    color: #aebdd0 !important;
    font-size: 0.84rem;
    line-height: 1.42 !important;
}

.pdf-tool-badge {
    min-height: 16px;
    padding: 1px 6px;
    border: 1px solid rgba(191, 219, 254, 0.55);
    border-radius: 999px;
    color: #f8fbff;
    background: rgba(79, 70, 229, 0.34);
    font-size: 0.58rem;
    font-style: normal;
    font-weight: 900;
    line-height: 1.25;
    text-transform: uppercase;
    white-space: nowrap;
}

.pdf-tool-badge-hot {
    background: rgba(255, 122, 47, 0.34);
}

.pdf-tool-badge-new {
    background: rgba(34, 197, 94, 0.28);
}

.pdf-tool-quota-badge {
    background: rgba(37, 99, 235, 0.30);
}

.pdf-local-operation-panel {
    width: min(100%, 960px) !important;
    max-width: 960px !important;
}

.pdf-local-operation-header,
.pdf-local-view .pdf-local-editor-panel,
.pdf-upload-stage,
body.system-dark-theme .pdf-local-operation-header,
body.system-dark-theme .pdf-local-view .pdf-local-editor-panel,
body.system-dark-theme .pdf-upload-stage,
body.system-light-theme .pdf-local-operation-header,
body.system-light-theme .pdf-local-view .pdf-local-editor-panel,
body.system-light-theme .pdf-upload-stage {
    border-color: rgba(148, 163, 184, 0.18) !important;
    color: #f8fbff !important;
    background: rgba(13, 29, 60, 0.84) !important;
    box-shadow: 0 24px 56px rgba(2, 6, 23, 0.24) !important;
}

.pdf-local-operation-header h2,
.pdf-upload-stage-heading strong,
body.system-light-theme .pdf-local-operation-header h2,
body.system-light-theme .pdf-upload-stage-heading strong {
    color: #ffffff !important;
}

.pdf-local-operation-header p:not(.eyebrow),
.pdf-upload-stage-heading span:not(.pdf-upload-icon),
.pdf-local-view .pdf-upload-dropzone small,
.pdf-local-view .pdf-local-form small,
body.system-light-theme .pdf-local-operation-header p:not(.eyebrow),
body.system-light-theme .pdf-upload-stage-heading span:not(.pdf-upload-icon),
body.system-light-theme .pdf-local-view .pdf-upload-dropzone small,
body.system-light-theme .pdf-local-view .pdf-local-form small {
    color: #aebdd0 !important;
}

.pdf-local-view .pdf-upload-dropzone,
body.system-dark-theme .pdf-local-view .pdf-upload-dropzone,
body.system-light-theme .pdf-local-view .pdf-upload-dropzone {
    border-color: rgba(96, 165, 250, 0.38) !important;
    background: rgba(13, 34, 76, 0.74) !important;
}

@media (max-width: 1180px) {
    body.pdf-tools-open .app {
        width: min(100% - 28px, 1380px) !important;
    }

    .pdf-local-view .pdf-local-home-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

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

@media (max-width: 760px) {
    body.pdf-tools-open .app {
        width: 100% !important;
        padding: 0 !important;
    }

    body.pdf-tools-open .pdf-local-view {
        min-height: 100vh;
        padding: 16px 14px 92px;
        border: 0;
        border-radius: 0;
    }

    body.pdf-tools-open .pdf-local-view::before,
    body.pdf-tools-open .pdf-local-view::after {
        display: none;
    }

    .pdf-local-view .generator-bar,
    body.system-dark-theme .pdf-local-view .generator-bar,
    body.system-light-theme .pdf-local-view .generator-bar {
        display: grid !important;
        grid-template-columns: auto 1fr auto !important;
        gap: 10px !important;
        min-height: 48px;
    }

    .pdf-local-view .generator-bar::before {
        position: static;
        order: 2;
        justify-self: center;
        transform: none;
        font-size: 1.05rem;
        background-size: 24px 24px;
    }

    .pdf-local-view .generator-bar > .secondary-button:first-child {
        order: 1;
        justify-self: start;
    }

    .pdf-local-view .user-menu {
        order: 3;
        justify-self: end;
    }

    .pdf-local-view .user-menu > span,
    .pdf-local-view .user-menu [data-logout-button] {
        display: none;
    }

    .pdf-local-view .generator-bar .secondary-button,
    .pdf-local-view .theme-toggle-button {
        min-width: 42px;
        padding: 0 11px !important;
    }

    .pdf-local-view .theme-toggle-button span::after {
        content: "";
    }

    .pdf-local-view .intro {
        margin-top: 22px !important;
    }

    .pdf-local-view .intro::before {
        display: none;
    }

    .pdf-local-view .intro h1,
    body.system-light-theme .pdf-local-view .intro h1 {
        font-size: clamp(1.55rem, 8vw, 2.25rem) !important;
    }

    .pdf-local-hero-card.pdf-local-home-dropzone,
    body.system-dark-theme .pdf-local-hero-card.pdf-local-home-dropzone,
    body.system-light-theme .pdf-local-hero-card.pdf-local-home-dropzone {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 14px;
        min-height: 108px;
        padding: 20px 16px !important;
        outline-offset: -8px;
    }

    .pdf-local-home-upload-icon {
        width: 58px;
        height: 58px;
    }

    .pdf-local-home-upload-icon svg {
        width: 28px;
        height: 28px;
    }

    .pdf-local-home-upload-copy strong {
        font-size: 0.95rem;
    }

    .pdf-local-note,
    body.system-dark-theme .pdf-local-note,
    body.system-light-theme .pdf-local-note {
        grid-template-columns: auto minmax(0, 1fr);
        padding: 14px 16px !important;
    }

    .pdf-local-note em {
        grid-column: 2;
        justify-self: start;
        font-size: 0.78rem;
    }

    .pdf-local-summary-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .pdf-local-summary-card {
        min-height: 68px;
        padding: 12px 14px;
    }

    .pdf-local-summary-card > span {
        width: 42px;
        height: 42px;
    }

    .pdf-local-category-tabs {
        justify-content: flex-start !important;
        width: 100%;
        padding-bottom: 4px !important;
    }

    .pdf-local-category-tab,
    body.system-dark-theme .pdf-local-category-tab,
    body.system-light-theme .pdf-local-category-tab {
        min-height: 30px !important;
        padding: 0 16px !important;
        font-size: 0.75rem;
    }

    .pdf-local-view .pdf-local-home-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .pdf-local-view .pdf-local-home-grid .pdf-local-tool,
    body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool,
    body.system-light-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        min-height: 74px !important;
        padding: 12px 42px 12px 14px !important;
    }

    .pdf-local-tool-icon {
        grid-row: span 2;
        width: 42px !important;
        height: 42px !important;
    }

    .pdf-local-home-grid .pdf-local-tool-heading strong,
    body.system-dark-theme .pdf-local-home-grid .pdf-local-tool-heading strong,
    body.system-light-theme .pdf-local-home-grid .pdf-local-tool-heading strong {
        font-size: 0.92rem !important;
    }

    .pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child,
    body.system-dark-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child,
    body.system-light-theme .pdf-local-view .pdf-local-home-grid .pdf-local-tool > span:last-child {
        font-size: 0.74rem;
    }

    .pdf-tool-badge {
        font-size: 0.52rem;
    }

    .pdf-local-operation-header,
    .pdf-upload-stage-heading {
        grid-template-columns: 1fr !important;
    }

    .pdf-local-view .pdf-upload-dropzone input[type="file"] {
        width: 100%;
    }
}

/* ===== ADMIN APK RELEASE ===== */
.admin-app-release-panel {
    display: grid;
    gap: 18px;
}

.admin-apk-upload-form {
    display: grid;
    gap: 16px;
}

.admin-apk-current {
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    background: rgba(37, 99, 235, 0.06);
}

.admin-apk-current p {
    margin: 0;
    color: var(--muted);
    line-height: 1.45;
}

.admin-apk-release-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
}

.admin-apk-release-icon {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.22);
}

.admin-apk-release-card strong,
.admin-apk-release-card small {
    display: block;
    min-width: 0;
}

.admin-apk-release-card strong {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-apk-release-card small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.35;
}

.admin-apk-release-card p {
    margin: 8px 0 0;
    color: var(--muted);
}

body.system-dark-theme .admin-apk-current {
    border-color: rgba(148, 163, 184, 0.20);
    background: rgba(15, 23, 42, 0.62);
}

body.system-dark-theme .admin-apk-release-card strong {
    color: #f8fafc;
}

/* ===== APP UPDATE PAGE ===== */
.app-update-section {
    display: grid;
    gap: 18px;
}

.app-update-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: clamp(22px, 3vw, 30px);
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 18px;
    background:
        radial-gradient(circle at 92% 0%, rgba(37, 99, 235, 0.15), transparent 34%),
        rgba(255, 255, 255, 0.96);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.10);
}

.app-update-icon {
    display: inline-grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 18px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 18px 34px rgba(37, 99, 235, 0.26);
}

.app-update-icon svg {
    width: 34px;
    height: 34px;
}

.app-update-copy {
    min-width: 0;
}

.app-update-copy h3 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.1;
    letter-spacing: 0;
}

.app-update-copy p:not(.eyebrow) {
    max-width: 680px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.app-update-meta {
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.app-update-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.app-update-download:hover {
    filter: brightness(1.04);
    transform: translateY(-1px);
}

.app-version-panel {
    display: grid;
    gap: 14px;
    padding: clamp(18px, 2.4vw, 24px);
    border: 1px solid rgba(148, 163, 184, 0.20);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.app-version-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.app-version-panel-heading h3 {
    margin: 2px 0 0;
    color: var(--text);
    font-size: clamp(1.08rem, 2vw, 1.35rem);
    line-height: 1.2;
    letter-spacing: 0;
}

.app-version-count,
.app-version-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.10);
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.app-version-list {
    display: grid;
    gap: 10px;
}

.app-version-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    min-height: 74px;
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: rgba(248, 250, 252, 0.86);
}

.app-version-status-icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.18);
}

.app-version-item.is-loading .app-version-status-icon,
.app-version-item.is-empty .app-version-status-icon {
    background: linear-gradient(135deg, #2563eb, #38bdf8);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
}

.app-version-item.is-error .app-version-status-icon {
    background: linear-gradient(135deg, #f97316, #ef4444);
    box-shadow: 0 12px 24px rgba(239, 68, 68, 0.18);
}

.app-version-copy {
    min-width: 0;
}

.app-version-copy strong,
.app-version-copy small {
    display: block;
}

.app-version-copy strong {
    color: var(--text);
    font-size: 0.98rem;
    line-height: 1.25;
}

.app-version-copy small {
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.4;
}

.app-version-mini-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    color: #ffffff;
    background: #2563eb;
    font-size: 0.86rem;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.app-version-mini-download:hover {
    background: #1d4ed8;
}

body.system-dark-theme .app-update-card {
    border-color: rgba(148, 163, 184, 0.20);
    background:
        radial-gradient(circle at 92% 0%, rgba(37, 99, 235, 0.20), transparent 34%),
        rgba(15, 23, 42, 0.82);
    box-shadow: 0 22px 54px rgba(2, 6, 23, 0.28);
}

body.system-dark-theme .app-update-copy h3 {
    color: #f8fafc;
}

body.system-dark-theme .app-version-panel {
    border-color: rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.22);
}

body.system-dark-theme .app-version-panel-heading h3,
body.system-dark-theme .app-version-copy strong {
    color: #f8fafc;
}

body.system-dark-theme .app-version-item {
    border-color: rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.72);
}

body.system-dark-theme .app-version-count,
body.system-dark-theme .app-version-pill {
    border-color: rgba(96, 165, 250, 0.26);
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.16);
}

@media (max-width: 720px) {
    .app-update-card {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .app-update-download {
        width: 100%;
    }

    .app-version-panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-version-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .app-version-pill,
    .app-version-mini-download {
        grid-column: 1 / -1;
        justify-self: stretch;
    }
}
/* Correção dos botões Word/PDF do gerador de documentos */
.generator-view .actions #generateButton,
.generator-view .actions #simpleDocumentButton {
    min-width: 210px;
    min-height: 50px;
    color: #ffffff;
    background: #2563eb;
    border-color: #2563eb;
}

.generator-view .actions #generateButton:hover,
.generator-view .actions #simpleDocumentButton:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.generator-view .actions .pdf-action-button,
.generator-view .actions #printPdfButton.pdf-action-button,
.generator-view .actions #simplePrintPdfButton.pdf-action-button {
    min-width: 210px;
    min-height: 50px;
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.48);
    background: rgba(127, 29, 29, 0.18);
    font-weight: 800;
}

.generator-view .actions .pdf-action-button:hover,
.generator-view .actions #printPdfButton.pdf-action-button:hover,
.generator-view .actions #simplePrintPdfButton.pdf-action-button:hover {
    color: #ffffff;
    border-color: rgba(248, 113, 113, 0.78);
    background: rgba(185, 28, 28, 0.34);
}
/* === DOCSPACE DASHBOARD PREMIUM REDESIGN === */
body.document-home-open .app {
    width: 100%;
    max-width: none;
    padding: 0;
}

body.document-home-open {
    background:
        radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.13), transparent 31%),
        linear-gradient(135deg, #f7faff 0%, #eef4fb 46%, #f8fbff 100%);
}

body.document-home-open.system-dark-theme {
    background:
        radial-gradient(circle at 18% 0%, rgba(59, 130, 246, 0.18), transparent 31%),
        linear-gradient(135deg, #09111f 0%, #101827 45%, #0b1220 100%);
}

.document-view {
    --dash-bg: #f6f9fe;
    --dash-surface: rgba(255, 255, 255, 0.88);
    --dash-surface-strong: #ffffff;
    --dash-text: #111827;
    --dash-muted: #64748b;
    --dash-border: rgba(148, 163, 184, 0.26);
    --dash-blue: #2563eb;
    --dash-blue-2: #0ea5e9;
    --dash-shadow: 0 24px 70px rgba(15, 23, 42, 0.11);
    --dash-sidebar-width: 280px;
    min-height: 100vh;
    padding: 22px 28px 40px calc(var(--dash-sidebar-width) + 28px);
    color: var(--dash-text);
    background: transparent;
}

body.system-dark-theme .document-view {
    --dash-bg: #0b1220;
    --dash-surface: rgba(15, 23, 42, 0.74);
    --dash-surface-strong: #121c2e;
    --dash-text: #f8fafc;
    --dash-muted: #a7b4c8;
    --dash-border: rgba(148, 163, 184, 0.20);
    --dash-shadow: 0 24px 70px rgba(0, 0, 0, 0.30);
}

.dashboard-sidebar {
    position: fixed;
    inset: 18px auto 18px 18px;
    z-index: 80;
    display: flex;
    width: 254px;
    padding: 16px;
    flex-direction: column;
    gap: 18px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.90));
    box-shadow: var(--dash-shadow);
    color: #eaf2ff;
    backdrop-filter: blur(18px);
    transition: width 180ms ease, padding 180ms ease;
}

.dashboard-sidebar-head,
.dashboard-sidebar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.dashboard-sidebar-logo,
.dashboard-sidebar-toggle,
.dashboard-sidebar-item {
    border: 0;
    font: inherit;
    color: inherit;
    background: transparent;
}

.dashboard-sidebar-logo {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 10px;
    padding: 0;
    cursor: pointer;
    font-weight: 900;
    font-size: 1.02rem;
}

.dashboard-sidebar-logo img {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.38);
}

.dashboard-sidebar-toggle {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 12px;
    cursor: pointer;
    color: #bfdbfe;
    background: rgba(255, 255, 255, 0.07);
}

.dashboard-sidebar-nav {
    display: grid;
    gap: 6px;
}

.dashboard-sidebar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 14px;
    cursor: pointer;
    color: #b8c7dd;
    text-align: left;
    transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.dashboard-sidebar-item:hover {
    transform: translateX(3px);
    color: #ffffff;
    background: rgba(96, 165, 250, 0.15);
}

.dashboard-sidebar-item.is-active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(14, 165, 233, 0.78));
    box-shadow: 0 16px 34px rgba(37, 99, 235, 0.30);
}

.dashboard-sidebar-item svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.dashboard-sidebar-footer {
    margin-top: auto;
    justify-content: flex-start;
    padding: 12px;
    border-radius: 14px;
    color: #c7d2fe;
    background: rgba(255, 255, 255, 0.07);
    font-size: 0.82rem;
}

.sidebar-plan-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
}

.document-view.dashboard-sidebar-collapsed {
    --dash-sidebar-width: 98px;
}

.document-view.dashboard-sidebar-collapsed .dashboard-sidebar {
    width: 74px;
    padding: 14px 10px;
}

.document-view.dashboard-sidebar-collapsed .dashboard-sidebar span:not(.sidebar-plan-dot),
.document-view.dashboard-sidebar-collapsed .dashboard-sidebar-logo span,
.document-view.dashboard-sidebar-collapsed .dashboard-sidebar-footer {
    display: none;
}

.document-view.dashboard-sidebar-collapsed .dashboard-sidebar-item,
.document-view.dashboard-sidebar-collapsed .dashboard-sidebar-logo {
    justify-content: center;
}

.document-home-header.app-shell-header {
    position: sticky;
    top: 14px;
    z-index: 70;
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin: 0 auto 22px;
    padding: 12px 14px;
    max-width: 1500px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: var(--dash-surface);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(18px);
}

.global-document-search {
    position: relative;
    min-height: 48px;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.10);
}

.global-document-search input {
    font-weight: 700;
}

.dashboard-search-suggestions {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    z-index: 120;
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: var(--dash-surface-strong);
    box-shadow: var(--dash-shadow);
}

.dashboard-search-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: 0;
    border-radius: 12px;
    color: var(--dash-text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.dashboard-search-suggestion:hover {
    background: rgba(37, 99, 235, 0.10);
}

.dashboard-search-suggestion svg {
    width: 20px;
    color: var(--dash-blue);
}

.dashboard-search-suggestion span {
    display: grid;
    gap: 2px;
}

.dashboard-search-suggestion small {
    color: var(--dash-muted);
}

.premium-dashboard,
.dashboard-page-section,
.document-catalog {
    max-width: 1500px;
    margin: 0 auto;
}

.premium-dashboard-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
    gap: 22px;
    align-items: start;
}

.premium-dashboard-main,
.premium-dashboard-side {
    display: grid;
    gap: 20px;
}

.premium-hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.7fr) auto;
    gap: 18px;
    align-items: center;
    min-height: 142px;
    padding: 22px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.05)),
        var(--dash-surface);
    box-shadow: var(--dash-shadow);
}

.premium-hero-copy h1 {
    margin: 6px 0 4px;
    color: var(--dash-text);
    font-size: clamp(1.65rem, 2.4vw, 2.45rem);
    line-height: 1.04;
    letter-spacing: 0;
}

.premium-hero-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.premium-hero-details span {
    display: grid;
    gap: 5px;
    min-height: 76px;
    padding: 14px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.52);
}

body.system-dark-theme .premium-hero-details span {
    background: rgba(15, 23, 42, 0.42);
}

.premium-hero-details small,
.premium-metric-card span,
.premium-action-card small,
.premium-card-main small {
    color: var(--dash-muted);
}

.premium-hero-details strong {
    color: var(--dash-text);
    font-size: 1.05rem;
}

.premium-plan-progress {
    min-width: 190px;
}

.premium-hero-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.primary-dashboard-button,
.premium-action-card,
.premium-card-main,
.section-link-button,
.changelog-open-button {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.primary-dashboard-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 14px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--dash-blue), var(--dash-blue-2));
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.28);
    font-weight: 900;
    cursor: pointer;
}

.primary-dashboard-button:hover,
.premium-action-card:hover,
.premium-category-card:hover,
.section-link-button:hover {
    transform: translateY(-2px);
}

.primary-dashboard-button:active,
.premium-action-card:active,
.premium-card-main:active {
    transform: translateY(0) scale(0.99);
}

.is-visually-secondary {
    display: none !important;
}

.premium-section,
.dashboard-side-panel,
.dashboard-page-section {
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: var(--dash-surface);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(16px);
}

.premium-section,
.dashboard-page-section {
    padding: 20px;
}

.premium-category-grid,
.premium-action-grid,
.premium-metrics-grid {
    display: grid;
    gap: 14px;
}

.premium-category-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.premium-action-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.premium-metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.premium-category-card {
    position: relative;
    display: grid;
    min-height: 132px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: var(--dash-surface-strong);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.premium-category-card:hover {
    border-color: rgba(37, 99, 235, 0.36);
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.12);
}

.premium-card-main {
    display: grid;
    gap: 12px;
    width: 100%;
    height: 100%;
    padding: 18px 44px 18px 16px;
    border: 0;
    color: var(--dash-text);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.premium-card-main strong,
.premium-action-card strong {
    color: var(--dash-text);
    font-size: 1rem;
    line-height: 1.2;
}

.premium-card-main small,
.premium-action-card small {
    line-height: 1.35;
}

.premium-card-icon,
.premium-action-icon,
.premium-metric-icon,
.dashboard-activity-icon {
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--dash-blue);
    background: rgba(37, 99, 235, 0.11);
}

.premium-card-icon,
.premium-action-icon {
    width: 42px;
    height: 42px;
}

.category-favorite-button {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid var(--dash-border);
    border-radius: 12px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

body.system-dark-theme .category-favorite-button {
    background: rgba(15, 23, 42, 0.78);
}

.category-favorite-button.is-favorite {
    color: #f59e0b;
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.12);
}

.premium-action-card {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 148px;
    padding: 18px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    color: var(--dash-text);
    background: var(--dash-surface-strong);
    text-align: left;
    cursor: pointer;
}

.premium-action-card:hover {
    border-color: rgba(37, 99, 235, 0.34);
    box-shadow: 0 20px 44px rgba(37, 99, 235, 0.13);
}

.premium-metric-card {
    display: flex;
    gap: 14px;
    align-items: center;
    min-height: 116px;
    padding: 18px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: var(--dash-surface-strong);
}

.premium-metric-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
}

.premium-metric-card div {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.premium-metric-card strong {
    color: var(--dash-text);
    font-size: clamp(1.55rem, 2.2vw, 2.15rem);
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.premium-metric-card-wide strong {
    font-size: 1.1rem;
}

.dashboard-hidden-counter {
    display: none;
}

.dashboard-side-panel {
    padding: 18px;
}

.side-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.side-panel-heading h2 {
    margin: 4px 0 0;
    color: var(--dash-text);
    font-size: 1.15rem;
}

.side-panel-heading > svg {
    color: var(--dash-blue);
}

.dashboard-activity-list {
    display: grid;
    gap: 12px;
    max-height: 430px;
    overflow: auto;
    padding-right: 4px;
}

.dashboard-activity-item {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: rgba(148, 163, 184, 0.08);
}

.dashboard-activity-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.dashboard-activity-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.dashboard-activity-copy strong,
.dashboard-activity-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-activity-copy small,
.dashboard-activity-item time {
    color: var(--dash-muted);
    font-size: 0.8rem;
}

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

.dashboard-changelog-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--dash-muted);
}

.dashboard-changelog-list svg {
    width: 18px;
    color: #22c55e;
}

.changelog-open-button {
    width: 100%;
    justify-content: center;
}

.dashboard-category-favorites {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-category-empty {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 16px;
    border: 1px dashed var(--dash-border);
    border-radius: 16px;
    color: var(--dash-muted);
}

.bottom-navigation {
    display: none;
}

@media (max-width: 1260px) {
    .premium-dashboard-layout {
        grid-template-columns: 1fr;
    }

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

    .premium-category-grid,
    .premium-action-grid,
    .premium-metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .premium-hero-card {
        grid-template-columns: 1fr;
    }

    .premium-hero-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .document-view,
    .document-view.dashboard-sidebar-collapsed {
        padding: 14px 14px 104px;
    }

    .dashboard-sidebar {
        inset: auto 10px 10px;
        width: auto;
        height: 74px;
        padding: 10px;
        border-radius: 18px;
    }

    .dashboard-sidebar-head,
    .dashboard-sidebar-footer,
    .dashboard-sidebar-toggle {
        display: none;
    }

    .dashboard-sidebar-nav {
        display: grid;
        grid-template-columns: repeat(7, minmax(0, 1fr));
        gap: 4px;
        height: 100%;
    }

    .dashboard-sidebar-item {
        justify-content: center;
        min-height: 54px;
        padding: 0;
        gap: 4px;
        font-size: 0.68rem;
        flex-direction: column;
        text-align: center;
    }

    .dashboard-sidebar-item:hover {
        transform: translateY(-1px);
    }

    .dashboard-sidebar-item span {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .document-home-header.app-shell-header {
        position: relative;
        top: auto;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .app-shell-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .premium-dashboard-side,
    .premium-category-grid,
    .premium-action-grid,
    .premium-metrics-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .document-view,
    .document-view.dashboard-sidebar-collapsed {
        padding-inline: 10px;
    }

    .premium-section,
    .dashboard-page-section,
    .dashboard-side-panel,
    .premium-hero-card {
        border-radius: 14px;
        padding: 16px;
    }

    .premium-hero-details,
    .dashboard-activity-item {
        grid-template-columns: 1fr;
    }

    .premium-hero-actions,
    .primary-dashboard-button {
        width: 100%;
    }

    .dashboard-sidebar-item span {
        display: none;
    }
}
/* === DOCSPACE DASHBOARD ICON ALIGNMENT FIXES === */
.dashboard-sidebar-toggle svg,
.category-favorite-button svg {
    position: static !important;
    inset: auto !important;
    width: 20px;
    height: 20px;
    transform: none !important;
    pointer-events: none;
}

.document-search .dashboard-search-suggestion,
.global-document-search .dashboard-search-suggestion {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 10px 12px;
}

.document-search .dashboard-search-suggestion svg,
.global-document-search .dashboard-search-suggestion svg,
.document-search .dashboard-search-suggestion i,
.global-document-search .dashboard-search-suggestion i {
    position: static !important;
    inset: auto !important;
    display: block;
    width: 22px;
    height: 22px;
    margin: 0;
    color: var(--dash-blue);
    transform: none !important;
    pointer-events: none;
}

.dashboard-search-suggestion span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.dashboard-search-suggestion strong,
.dashboard-search-suggestion small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.premium-card-main span:not(.premium-card-icon) {
    display: grid;
    min-width: 0;
    gap: 6px;
    padding-right: 2px;
}

.premium-card-main strong,
.premium-card-main small {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.category-favorite-button {
    z-index: 3;
}
/* === DOCSPACE DASHBOARD SEARCH CLOSE + CENTERED TOGGLE FIXES === */
.dashboard-sidebar-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    text-align: center;
    line-height: 1;
}

.dashboard-sidebar-toggle i,
.dashboard-sidebar-toggle svg {
    display: block !important;
    flex: 0 0 auto;
    margin: auto !important;
    width: 20px !important;
    height: 20px !important;
}

.dashboard-search-suggestions.is-hidden {
    display: none !important;
}
/* === DOCSPACE DASHBOARD PLAN ACTIONS FIX === */
.secondary-dashboard-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 14px;
    color: var(--dash-text);
    background: rgba(255, 255, 255, 0.10);
    font-weight: 900;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.secondary-dashboard-button:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.46);
    background: rgba(37, 99, 235, 0.12);
}

.secondary-dashboard-button:active {
    transform: translateY(0) scale(0.99);
}
/* === DOCSPACE DASHBOARD HERO REORGANIZATION === */
.premium-hero-card {
    grid-template-columns: minmax(300px, 0.9fr) minmax(440px, 1.1fr) !important;
    grid-template-areas:
        "hero-copy hero-details"
        "hero-actions hero-progress";
    gap: 18px 24px !important;
    align-items: stretch !important;
    min-height: 236px !important;
    padding: 28px 32px !important;
}

.premium-hero-copy {
    grid-area: hero-copy;
    align-self: end;
    display: grid;
    align-content: end;
    min-width: 0;
}

.premium-hero-copy h1 {
    margin-top: 8px !important;
    font-size: clamp(2rem, 3vw, 2.8rem) !important;
}

.premium-hero-details {
    grid-area: hero-details;
    align-self: end;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.premium-hero-details span,
.premium-plan-progress {
    border-color: rgba(147, 197, 253, 0.22) !important;
    background: rgba(15, 23, 42, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

body.system-light-theme .premium-hero-details span,
body.system-light-theme .premium-plan-progress {
    background: rgba(255, 255, 255, 0.26) !important;
}

.premium-plan-progress {
    grid-area: hero-progress;
    display: grid;
    align-content: center;
    min-width: 0 !important;
    min-height: 78px;
    padding: 16px 18px;
    border: 1px solid rgba(147, 197, 253, 0.22);
    border-radius: 16px;
}

.premium-hero-actions {
    grid-area: hero-actions;
    align-self: start;
    justify-content: flex-start !important;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px !important;
    margin-top: 0;
}

.premium-hero-actions .primary-dashboard-button,
.premium-hero-actions .secondary-dashboard-button {
    min-width: 166px;
}

.premium-category-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important;
}

.premium-category-card {
    min-height: 150px;
}

.premium-card-main {
    align-content: start;
    gap: 14px !important;
    padding-right: 58px !important;
}

.premium-card-main strong,
.premium-card-main small {
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: auto;
}

@media (max-width: 1260px) {
    .premium-hero-card {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "hero-copy"
            "hero-details"
            "hero-progress"
            "hero-actions";
        min-height: 0 !important;
    }
}

@media (max-width: 620px) {
    .premium-hero-card {
        padding: 20px !important;
    }

    .premium-hero-details {
        grid-template-columns: 1fr !important;
    }

    .premium-hero-actions .primary-dashboard-button,
    .premium-hero-actions .secondary-dashboard-button {
        width: 100%;
        min-width: 0;
    }
}
/* === DOCSPACE DASHBOARD ADMIN SIDEBAR FIX === */
.dashboard-sidebar-item.is-hidden {
    display: none !important;
}

.dashboard-sidebar-admin {
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.10);
}

.dashboard-sidebar-admin:hover {
    color: #ffffff;
    background: rgba(245, 158, 11, 0.18);
}

.dashboard-sidebar-admin svg {
    color: #fbbf24;
}

.document-card-wrapper:has(#adminAccessCard),
#adminAccessCard {
    display: none !important;
}

/* === DOCSPACE ADMIN DASHBOARD REDESIGN === */
body.admin-access-open {
    background: #07111f;
}

body.admin-access-open .app {
    width: min(100% - 32px, 1540px);
    max-width: none;
    padding: 24px 0 48px;
}

.admin-dashboard-view {
    --admin-bg: #07111f;
    --admin-panel: #101b2e;
    --admin-panel-soft: #152238;
    --admin-border: rgba(148, 163, 184, 0.18);
    --admin-border-strong: rgba(96, 165, 250, 0.34);
    --admin-text: #f8fafc;
    --admin-muted: #9aa8bd;
    --admin-primary: #2f7cf6;
    --admin-primary-strong: #0ea5e9;
    --admin-success: #22c55e;
    --admin-warning: #fbbf24;
    --admin-danger: #ef4444;
    color: var(--admin-text);
}

.admin-dashboard-view .generator-bar {
    position: sticky;
    top: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: rgba(9, 17, 31, 0.94);
    box-shadow: 0 18px 46px rgba(2, 6, 23, 0.28);
    backdrop-filter: blur(16px);
}

.admin-dashboard-view .generator-bar > .secondary-button:first-child {
    min-height: 42px;
    border-radius: 12px;
}

.admin-dashboard-view .user-menu {
    justify-content: flex-end;
    min-width: 0;
}

.admin-dashboard-view .user-menu [data-user-email] {
    overflow: hidden;
    color: var(--admin-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-dashboard-view .intro {
    max-width: 920px;
    margin: 0 auto 18px;
    padding: 4px 4px 0;
}

.admin-dashboard-view .intro h1 {
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.admin-dashboard-view .descricao {
    max-width: 720px;
    margin-top: 12px;
    color: var(--admin-muted);
}

.admin-section-nav {
    position: sticky;
    top: 88px;
    z-index: 15;
    display: flex;
    max-width: 1120px;
    margin: 0 auto 18px;
    padding: 8px;
    gap: 8px;
    overflow-x: auto;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: rgba(10, 20, 35, 0.9);
    box-shadow: 0 14px 38px rgba(2, 6, 23, 0.22);
    backdrop-filter: blur(14px);
}

.admin-section-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    gap: 8px;
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 12px;
    color: var(--admin-muted);
    background: transparent;
    font-size: 0.92rem;
}

.admin-section-nav button:hover,
.admin-section-nav button.is-active {
    border-color: rgba(96, 165, 250, 0.34);
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    transform: none;
}

.admin-section-nav svg,
.admin-primary-button svg,
.admin-search-input svg,
.admin-document-search svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.admin-dashboard-view .admin-layout {
    max-width: 1120px;
    margin: 0 auto;
    gap: 18px;
}

.admin-section-panel {
    min-width: 0;
}

.admin-section-panel.is-hidden {
    display: none !important;
}

.admin-dashboard-view .form-panel,
.admin-dashboard-view .admin-document-access,
.admin-users-toolbar,
.admin-apk-preview,
.admin-support-chat-item,
.admin-support-chat,
.admin-support-sidebar,
.admin-user-row,
.admin-form-step {
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: var(--admin-panel);
    box-shadow: 0 16px 38px rgba(2, 6, 23, 0.22);
}

.admin-dashboard-view .form-panel {
    padding: 22px;
}

.admin-dashboard-view .admin-users-header {
    align-items: center;
    margin-bottom: 16px;
}

.admin-dashboard-view .admin-users-header h2 {
    color: var(--admin-text);
    font-size: 1.35rem;
}

.admin-dashboard-view .admin-users-header p,
.admin-dashboard-view .field small,
.admin-form-step-heading p,
.admin-dependent-note {
    color: var(--admin-muted);
}

.admin-primary-button,
.admin-dashboard-view button[type="submit"],
.admin-primary-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--admin-primary), var(--admin-primary-strong));
    box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.admin-primary-button:hover,
.admin-dashboard-view button[type="submit"]:hover,
.admin-primary-inline:hover {
    background: linear-gradient(135deg, #2563eb, #0284c7);
}

.admin-dashboard-view .secondary-button {
    border-color: var(--admin-border);
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.54);
}

.admin-dashboard-view .secondary-button:hover {
    border-color: var(--admin-border-strong);
    color: #ffffff;
    background: rgba(37, 99, 235, 0.16);
}

.admin-dashboard-view .danger-button {
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
}

.admin-users-toolbar {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
    padding: 16px;
    background: var(--admin-panel-soft);
}

.admin-users-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.admin-users-stat-grid article {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    background: rgba(8, 15, 28, 0.48);
}

.admin-users-stat-grid span {
    display: block;
    color: var(--admin-muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.admin-users-stat-grid strong {
    display: block;
    margin-top: 6px;
    color: var(--admin-text);
    font-size: 1.8rem;
}

.admin-users-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(150px, 0.7fr)) auto;
    gap: 12px;
    align-items: end;
}

.admin-users-filters label,
.admin-support-composer .field {
    display: grid;
    gap: 6px;
}

.admin-users-filters label > span,
.admin-support-composer .field > span {
    color: #cbd5e1;
    font-size: 0.78rem;
    font-weight: 800;
}

.admin-search-input,
.admin-document-search {
    position: relative;
}

.admin-search-input svg,
.admin-document-search svg {
    position: absolute;
    left: 12px;
    top: 50%;
    color: var(--admin-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.admin-search-input input,
.admin-document-search input {
    padding-left: 40px;
}

.admin-dashboard-view input,
.admin-dashboard-view select,
.admin-dashboard-view textarea {
    border-color: var(--admin-border);
    border-radius: 12px;
    color: var(--admin-text);
    background: #0b1424;
}

.admin-dashboard-view input:focus,
.admin-dashboard-view select:focus,
.admin-dashboard-view textarea:focus {
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 4px rgba(47, 124, 246, 0.18);
}

.admin-users-table {
    display: grid;
    gap: 10px;
}

.admin-users-table-head,
.admin-user-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.35fr) minmax(130px, 0.7fr) minmax(120px, 0.65fr) minmax(130px, 0.75fr) minmax(220px, 1.2fr) minmax(130px, auto);
    gap: 14px;
    align-items: center;
}

.admin-users-table-head {
    padding: 0 14px;
    color: var(--admin-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.admin-users-table-body {
    display: grid;
    gap: 10px;
}

.admin-user-row {
    padding: 14px;
    background: var(--admin-panel-soft);
}

.admin-user-cell {
    min-width: 0;
    color: #dbe4f0;
}

.admin-user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-user-identity small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--admin-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-avatar,
.admin-support-avatar {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    color: #93c5fd;
    background: rgba(37, 99, 235, 0.18);
}

.admin-user-avatar svg,
.admin-support-avatar svg {
    width: 20px;
    height: 20px;
}

.admin-user-permissions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.admin-user-permissions span,
.admin-role-chip {
    display: inline-flex;
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.1);
    font-size: 0.74rem;
    font-weight: 800;
}

.admin-role-chip {
    margin-top: 6px;
    color: #fde68a;
    background: rgba(245, 158, 11, 0.16);
}

.admin-user-actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.admin-user-actions .secondary-button {
    min-height: 38px;
    padding: 0 11px;
}

.admin-row-menu {
    position: relative;
}

.admin-row-menu summary {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    color: #dbeafe;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
    list-style: none;
}

.admin-row-menu summary::-webkit-details-marker {
    display: none;
}

.admin-row-menu-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 10;
    display: grid;
    min-width: 190px;
    padding: 8px;
    gap: 6px;
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    background: #0b1424;
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.36);
}

.admin-row-menu-list .secondary-button {
    justify-content: flex-start;
    width: 100%;
}

.admin-user-details {
    grid-column: 1 / -1;
    border-top: 1px solid var(--admin-border);
    padding-top: 10px;
}

.admin-user-details summary {
    width: fit-content;
    color: #93c5fd;
    font-size: 0.84rem;
    font-weight: 800;
    cursor: pointer;
}

.admin-user-details-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.admin-user-detail {
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--admin-border);
    border-radius: 10px;
    background: rgba(8, 15, 28, 0.42);
}

.admin-user-detail span {
    display: block;
    color: var(--admin-muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.admin-user-detail strong {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
    color: var(--admin-text);
    font-size: 0.9rem;
}

.admin-form-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-form-heading h2 {
    margin: 0;
    color: var(--admin-text);
}

.admin-form-heading p {
    margin: 6px 0 0;
    color: var(--admin-muted);
}

.admin-dashboard-view .admin-form .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.admin-form-step {
    display: grid;
    gap: 14px;
    padding: 16px;
    background: var(--admin-panel-soft);
}

.admin-form-step-heading h3 {
    margin: 0;
    color: var(--admin-text);
    font-size: 1rem;
}

.admin-form-step-heading p {
    margin: 5px 0 0;
    font-size: 0.9rem;
    line-height: 1.45;
}

.admin-form-step-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.admin-form-step-grid .field-wide,
.admin-step-document-access .admin-form-step-grid,
.admin-step-notes .admin-form-step-grid {
    grid-column: 1 / -1;
}

.admin-dashboard-view .admin-inline-action-three {
    display: grid;
    grid-template-columns: minmax(92px, 1fr) auto auto;
    gap: 8px;
}

.admin-dependent-note {
    margin: -4px 0 0;
    padding: 10px 12px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    font-size: 0.86rem;
}

.admin-form.is-editing-user .admin-dependent-note {
    display: none;
}

.admin-document-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto auto;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}

.admin-document-selected-count {
    color: var(--admin-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.admin-dashboard-view .admin-document-access {
    padding: 16px;
    background: rgba(8, 15, 28, 0.42);
}

.admin-dashboard-view .admin-document-access-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.admin-dashboard-view .admin-document-access-option,
.admin-dashboard-view .admin-document-access-all {
    border-color: var(--admin-border);
    border-radius: 10px;
    color: #dbe4f0;
    background: rgba(15, 23, 42, 0.72);
}

.admin-dashboard-view .admin-document-access-option input,
.admin-dashboard-view .admin-document-access-all input {
    width: 20px;
    min-height: 20px;
    accent-color: var(--admin-primary);
}

.admin-document-access-option.is-filtered-out,
.admin-support-chat-item.is-hidden {
    display: none !important;
}

.admin-dashboard-view .actions {
    position: sticky;
    bottom: 12px;
    z-index: 8;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: rgba(9, 17, 31, 0.94);
    box-shadow: 0 18px 42px rgba(2, 6, 23, 0.32);
    backdrop-filter: blur(14px);
}

.admin-apk-preview {
    padding: 14px;
    margin-bottom: 14px;
    background: rgba(37, 99, 235, 0.08);
}

.admin-apk-preview-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.admin-apk-preview p {
    margin: 0 0 8px;
    color: #dbe4f0;
    line-height: 1.5;
}

.admin-apk-preview small {
    color: var(--admin-muted);
    overflow-wrap: anywhere;
}

.admin-support-dashboard {
    display: grid;
    grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.4fr);
    gap: 14px;
}

.admin-support-sidebar,
.admin-support-chat {
    min-width: 0;
    padding: 14px;
    background: var(--admin-panel-soft);
}

.admin-support-chat-list {
    display: grid;
    gap: 8px;
    margin-top: 12px;
    max-height: 620px;
    overflow: auto;
}

.admin-support-chat-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 72px;
    padding: 10px;
    text-align: left;
    color: var(--admin-text);
    background: rgba(8, 15, 28, 0.34);
    box-shadow: none;
}

.admin-support-chat-item:hover,
.admin-support-chat-item.is-active {
    border-color: var(--admin-border-strong);
    background: rgba(37, 99, 235, 0.16);
    transform: none;
}

.admin-support-chat-copy,
.admin-support-chat-meta {
    display: grid;
    min-width: 0;
}

.admin-support-chat-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-support-chat-copy small,
.admin-support-chat-copy em,
.admin-support-chat-meta time {
    overflow: hidden;
    color: var(--admin-muted);
    font-size: 0.78rem;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-support-chat-meta {
    justify-items: end;
    gap: 6px;
}

.admin-support-chat-meta b {
    display: grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    color: #052e16;
    background: #86efac;
    font-size: 0.72rem;
}

.admin-support-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--admin-border);
}

.admin-support-chat-header div {
    min-width: 0;
    flex: 1;
}

.admin-support-chat-header strong,
.admin-support-chat-header small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-support-chat-header small {
    color: var(--admin-muted);
}

.admin-support-count {
    display: inline-flex;
    width: fit-content;
    padding: 5px 9px;
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(37, 99, 235, 0.18);
    font-size: 0.75rem;
    font-weight: 900;
}

.admin-support-thread {
    display: grid;
    gap: 10px;
    max-height: 520px;
    overflow: auto;
    padding: 14px 4px 14px 0;
}

.admin-dashboard-view .admin-support-message {
    max-width: 82%;
    border: 1px solid var(--admin-border);
    border-radius: 14px;
    background: rgba(8, 15, 28, 0.48);
}

.admin-dashboard-view .admin-support-message.is-admin {
    justify-self: end;
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(37, 99, 235, 0.14);
}

.admin-support-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--admin-border);
}

body.system-light-theme.admin-access-open {
    background: #f4f7fb;
}

body.system-light-theme .admin-dashboard-view {
    --admin-bg: #f4f7fb;
    --admin-panel: #ffffff;
    --admin-panel-soft: #f8fafc;
    --admin-border: rgba(15, 23, 42, 0.12);
    --admin-border-strong: rgba(37, 99, 235, 0.32);
    --admin-text: #111827;
    --admin-muted: #64748b;
}

body.system-light-theme .admin-dashboard-view .generator-bar,
body.system-light-theme .admin-section-nav,
body.system-light-theme .admin-dashboard-view .actions {
    background: rgba(255, 255, 255, 0.94);
}

body.system-light-theme .admin-section-nav button {
    color: #475569;
}

body.system-light-theme .admin-dashboard-view input,
body.system-light-theme .admin-dashboard-view select,
body.system-light-theme .admin-dashboard-view textarea,
body.system-light-theme .admin-row-menu-list {
    color: #111827;
    background: #ffffff;
}

body.system-light-theme .admin-dashboard-view .secondary-button {
    color: #1e293b;
    background: #ffffff;
}

body.system-light-theme .admin-user-row,
body.system-light-theme .admin-form-step,
body.system-light-theme .admin-support-sidebar,
body.system-light-theme .admin-support-chat,
body.system-light-theme .admin-users-toolbar {
    background: #ffffff;
}

body.system-light-theme .admin-user-detail,
body.system-light-theme .admin-users-stat-grid article,
body.system-light-theme .admin-support-chat-item {
    background: #f8fafc;
}

body.system-light-theme .admin-support-chat-copy small,
body.system-light-theme .admin-support-chat-copy em,
body.system-light-theme .admin-support-chat-meta time,
body.system-light-theme .admin-users-filters label > span,
body.system-light-theme .admin-support-composer .field > span,
body.system-light-theme .admin-user-cell {
    color: #475569;
}

body.system-light-theme .admin-apk-preview p,
body.system-light-theme .admin-document-access-option,
body.system-light-theme .admin-document-access-all {
    color: #1e293b;
}

@media (max-width: 1100px) {
    .admin-users-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-users-filters .admin-primary-button {
        grid-column: 1 / -1;
    }

    .admin-users-table-head {
        display: none;
    }

    .admin-user-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .admin-user-cell::before {
        display: block;
        margin-bottom: 4px;
        color: var(--admin-muted);
        content: attr(data-label);
        font-size: 0.72rem;
        font-weight: 900;
        letter-spacing: 0.06em;
        text-transform: uppercase;
    }

    .admin-user-identity::before {
        display: none;
    }

    .admin-user-actions {
        justify-content: flex-start;
    }

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

    .admin-support-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body.admin-access-open .app {
        width: min(100% - 20px, 1540px);
        padding: 14px 0 34px;
    }

    .admin-dashboard-view .generator-bar {
        position: static;
        grid-template-columns: 1fr;
    }

    .admin-dashboard-view .user-menu {
        justify-content: flex-start;
    }

    .admin-section-nav {
        position: sticky;
        top: 8px;
        margin-bottom: 14px;
    }

    .admin-section-nav button span {
        display: none;
    }

    .admin-dashboard-view .form-panel {
        padding: 16px;
    }

    .admin-users-stat-grid,
    .admin-users-filters,
    .admin-form-step-grid,
    .admin-dashboard-view .admin-document-access-list,
    .admin-document-toolbar,
    .admin-user-row,
    .admin-user-details-grid,
    .admin-support-composer {
        grid-template-columns: 1fr;
    }

    .admin-form-heading,
    .admin-dashboard-view .admin-users-header {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-dashboard-view .admin-inline-action-three {
        grid-template-columns: 1fr;
    }

    .admin-dashboard-view .actions {
        position: static;
        align-items: stretch;
        flex-direction: column;
    }

    .admin-dashboard-view .actions button,
    .admin-document-toolbar .secondary-button,
    .admin-primary-button {
        width: 100%;
    }

    .admin-row-menu-list {
        left: 0;
        right: auto;
    }

    .admin-dashboard-view .admin-support-message {
        max-width: 100%;
    }

    .admin-support-chat-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .admin-support-chat-meta {
        grid-column: 2;
        justify-items: start;
    }
}

/* === DOCSPACE RESPONSIVE IA + DASHBOARD FIXES === */
body.document-home-open .support-chat-button {
    right: 22px;
    bottom: 22px;
    z-index: 82;
    border-radius: 14px;
}

body.document-home-open .document-home-header.app-shell-header {
    grid-template-columns: minmax(170px, auto) minmax(260px, 1fr) minmax(0, auto) !important;
    width: 100%;
    max-width: 1500px;
    overflow: visible;
}

.app-shell-actions {
    flex-wrap: nowrap;
    min-width: 0;
}

.app-shell-actions > * {
    flex: 0 0 auto;
}

.optimized-home .home-hero-card,
.premium-hero-card {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr) !important;
    grid-template-areas:
        "copy details"
        "actions progress";
    align-items: center;
}

.premium-hero-copy {
    grid-area: copy;
}

.premium-hero-details {
    grid-area: details;
}

.premium-plan-progress {
    grid-area: progress;
    width: 100%;
    min-width: 0;
}

.premium-hero-actions,
.document-view .home-hero-actions {
    grid-area: actions;
    justify-content: flex-start;
    align-self: end;
}

.premium-category-card {
    min-width: 0;
}

.premium-card-main {
    min-width: 0;
    padding-right: 58px;
}

.category-favorite-button {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 13px;
}

.category-favorite-button svg {
    width: 20px !important;
    height: 20px !important;
}

@media (max-width: 1500px) {
    .app-shell-actions .theme-toggle-button span,
    .app-shell-actions .home-logout-button span {
        display: none;
    }

    .app-shell-actions .theme-toggle-button,
    .app-shell-actions .home-logout-button {
        width: 46px;
        padding-inline: 0;
        justify-content: center;
    }

    .app-shell-search.global-document-search,
    .document-search.app-shell-search {
        max-width: none;
    }
}

@media (max-width: 1260px) {
    .optimized-home .home-hero-card,
    .premium-hero-card {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "copy"
            "details"
            "progress"
            "actions";
    }

    .premium-dashboard-layout {
        grid-template-columns: 1fr;
    }

    .premium-dashboard-side {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: minmax(0, 1fr) auto !important;
    }
}

@media (max-width: 900px) {
    body.document-home-open .support-chat-button {
        right: 14px;
        bottom: 92px;
    }

    .support-chat-button span {
        display: none;
    }

    body.document-home-open .support-chat-button {
        width: 52px;
        padding: 0;
        justify-content: center;
        border-radius: 16px;
    }

    .dashboard-sidebar-nav {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .premium-hero-details,
    .home-summary-grid,
    .premium-category-grid,
    .premium-action-grid,
    .premium-metrics-grid {
        grid-template-columns: 1fr !important;
    }

    .premium-hero-actions,
    .document-view .home-hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .premium-hero-actions button,
    .document-view .home-hero-actions button {
        width: 100%;
    }
}

/* === DOCSPACE CLEAN SAAS DASHBOARD LAYOUT === */
body.document-home-open {
    background:
        radial-gradient(circle at 24% -10%, rgba(37, 99, 235, 0.24), transparent 30%),
        radial-gradient(circle at 78% 6%, rgba(14, 165, 233, 0.11), transparent 28%),
        linear-gradient(135deg, #050b15 0%, #081224 45%, #05101f 100%);
}

body.system-light-theme.document-home-open {
    background:
        radial-gradient(circle at 24% -10%, rgba(37, 99, 235, 0.15), transparent 30%),
        radial-gradient(circle at 78% 6%, rgba(245, 158, 11, 0.08), transparent 28%),
        linear-gradient(135deg, #f5f8ff 0%, #edf4ff 48%, #f8fbff 100%);
}

.document-view {
    --dash-sidebar-width: 270px;
    --dash-card-radius: 26px;
    --dash-panel: rgba(8, 18, 35, 0.76);
    --dash-panel-strong: rgba(13, 29, 57, 0.86);
    --dash-border: rgba(96, 165, 250, 0.16);
    --dash-muted: #aebbd0;
    --dash-text: #f8fbff;
    padding: 20px 20px 34px calc(var(--dash-sidebar-width) + 18px);
}

body.system-light-theme .document-view {
    --dash-panel: rgba(255, 255, 255, 0.82);
    --dash-panel-strong: rgba(248, 251, 255, 0.92);
    --dash-border: rgba(30, 64, 175, 0.14);
    --dash-muted: #5f6f87;
    --dash-text: #0f172a;
}

.dashboard-sidebar {
    inset: 20px auto 20px 18px;
    width: 252px;
    padding: 22px 18px;
    border-radius: 18px;
    border-color: rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(circle at 24% 0%, rgba(37, 99, 235, 0.19), transparent 36%),
        rgba(5, 13, 27, 0.78);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.dashboard-sidebar-head {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.11);
}

.dashboard-sidebar-nav {
    gap: 12px;
}

.dashboard-sidebar-item {
    min-height: 54px;
    border-radius: 14px;
    color: #c7d4e8;
}

.dashboard-sidebar-item.is-active {
    border-left: 3px solid #3b82f6;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.34), rgba(37, 99, 235, 0.04));
    box-shadow: none;
}

.dashboard-sidebar-admin.is-active,
.dashboard-sidebar-admin {
    color: #facc15;
}

body.document-home-open .document-home-header.app-shell-header {
    display: grid;
    grid-template-columns: minmax(150px, auto) minmax(0, auto) minmax(320px, 1fr) minmax(0, auto) !important;
    gap: 18px;
    align-items: center;
    width: 100%;
    max-width: none;
    min-height: 104px;
    margin: 0 0 26px;
    padding: 22px 24px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(12, 26, 50, 0.86), rgba(8, 18, 35, 0.72)),
        rgba(8, 18, 35, 0.72);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.20);
}

body.system-light-theme.document-home-open .document-home-header.app-shell-header {
    border-color: rgba(30, 64, 175, 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(246, 249, 255, 0.86)),
        rgba(255, 255, 255, 0.84);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.08);
}

.app-shell-tabs {
    display: flex;
    gap: 12px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.app-shell-tabs::-webkit-scrollbar {
    display: none;
}

.app-shell-tab,
.dashboard-command-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 56px;
    padding: 0 18px;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 12px;
    color: #d8e6fb;
    background: rgba(15, 23, 42, 0.48);
    font: inherit;
    font-weight: 900;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.app-shell-tab:hover,
.dashboard-command-button:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.38);
    background: rgba(37, 99, 235, 0.16);
}

.app-shell-tab.is-active {
    color: #93c5fd;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.36), rgba(37, 99, 235, 0.12));
}

.app-shell-tab-documents {
    color: #ff6b6b;
    border-color: rgba(239, 68, 68, 0.22);
}

.app-shell-tab-categories {
    color: #facc15;
    border-color: rgba(245, 158, 11, 0.26);
}

.app-shell-tab svg,
.dashboard-command-button svg {
    width: 22px;
    height: 22px;
}

body.system-light-theme .app-shell-tab,
body.system-light-theme .dashboard-command-button {
    color: #1f3a5f;
    background: rgba(255, 255, 255, 0.82);
}

body.system-light-theme .app-shell-tab.is-active {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.10);
}

.app-shell-search.global-document-search,
.document-search.app-shell-search {
    min-height: 56px;
    border-radius: 12px;
    background: rgba(8, 18, 35, 0.70);
}

body.system-light-theme .app-shell-search.global-document-search,
body.system-light-theme .document-search.app-shell-search {
    background: rgba(255, 255, 255, 0.82);
}

.dashboard-command-row {
    display: flex;
    gap: 12px;
    max-width: 1500px;
    margin: 0 auto 28px;
}

.dashboard-command-button.is-primary {
    min-width: 190px;
    color: #ffffff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.82), rgba(14, 165, 233, 0.68));
    box-shadow: 0 18px 44px rgba(37, 99, 235, 0.22);
}

.premium-dashboard,
.dashboard-page-section,
.document-catalog {
    max-width: 1500px;
}

.premium-dashboard-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
}

.premium-dashboard-main {
    gap: 0;
}

.optimized-home .home-hero-card,
.premium-hero-card {
    grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr) !important;
    grid-template-areas:
        "copy activity"
        "details activity"
        "actions activity"
        "progress activity" !important;
    gap: 18px 72px !important;
    min-height: 382px !important;
    padding: clamp(30px, 4vw, 54px) clamp(34px, 5vw, 64px) !important;
    border-radius: var(--dash-card-radius) var(--dash-card-radius) 0 0 !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
    background:
        radial-gradient(circle at 18% 18%, rgba(37, 99, 235, 0.28), transparent 34%),
        radial-gradient(circle at 78% 70%, rgba(37, 99, 235, 0.22), transparent 38%),
        linear-gradient(145deg, rgba(19, 47, 100, 0.94), rgba(7, 17, 34, 0.92)) !important;
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.36) !important;
}

body.system-light-theme .optimized-home .home-hero-card,
body.system-light-theme .premium-hero-card {
    background:
        radial-gradient(circle at 18% 18%, rgba(37, 99, 235, 0.16), transparent 34%),
        radial-gradient(circle at 78% 70%, rgba(245, 158, 11, 0.08), transparent 38%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(239, 246, 255, 0.88)) !important;
    box-shadow: 0 30px 78px rgba(15, 23, 42, 0.10) !important;
}

.premium-hero-copy {
    align-self: center;
}

.premium-hero-copy h1 {
    font-size: clamp(2.55rem, 5vw, 4.35rem) !important;
    line-height: 0.98;
}

.document-user-email {
    max-width: 520px;
    color: var(--dash-muted);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.premium-hero-details {
    grid-area: details;
    max-width: 520px;
}

.premium-hero-details span,
.premium-plan-progress {
    background: rgba(6, 16, 32, 0.42) !important;
    border-color: rgba(147, 197, 253, 0.20) !important;
}

body.system-light-theme .premium-hero-details span,
body.system-light-theme .premium-plan-progress {
    background: rgba(255, 255, 255, 0.62) !important;
}

.premium-plan-progress {
    max-width: 520px;
}

.premium-hero-actions {
    align-self: start;
}

.premium-hero-activity {
    position: relative;
    grid-area: activity;
    display: grid;
    align-content: center;
    gap: 20px;
    min-width: 0;
    padding-left: clamp(28px, 4vw, 70px);
    border-left: 1px solid rgba(148, 163, 184, 0.20);
}

.premium-hero-activity .side-panel-heading {
    margin-bottom: 2px;
}

.premium-hero-activity .side-panel-heading h2 {
    font-size: 1rem;
}

.premium-hero-activity .dashboard-activity-list {
    max-height: 216px;
    gap: 14px;
    overflow: hidden;
}

.premium-hero-activity .dashboard-activity-item {
    grid-template-columns: 46px minmax(0, 1fr) auto;
    padding: 0;
    border: 0;
    background: transparent;
}

.premium-hero-activity .dashboard-activity-icon {
    width: 42px;
    height: 42px;
    border-radius: 13px;
}

.premium-hero-activity .dashboard-activity-copy strong {
    color: var(--dash-text);
    font-size: 0.98rem;
}

.premium-hero-activity .dashboard-activity-copy small,
.premium-hero-activity .dashboard-activity-item time {
    font-size: 0.84rem;
}

.hero-activity-link {
    justify-self: end;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 12px;
}

.popular-category-section {
    margin-top: -1px;
    padding: 28px clamp(34px, 5vw, 64px) 46px !important;
    border-top-color: rgba(148, 163, 184, 0.16);
    border-radius: 0 0 var(--dash-card-radius) var(--dash-card-radius) !important;
    background:
        linear-gradient(145deg, rgba(11, 25, 49, 0.92), rgba(7, 17, 34, 0.90)) !important;
    box-shadow: 0 30px 90px rgba(2, 6, 23, 0.24) !important;
}

body.system-light-theme .popular-category-section {
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(240, 246, 255, 0.88)) !important;
    box-shadow: 0 24px 62px rgba(15, 23, 42, 0.08) !important;
}

.popular-category-section .compact-section-heading {
    padding-top: 4px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
}

.premium-category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    max-width: 870px;
}

.premium-category-card {
    min-height: 196px;
    background:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.12), transparent 34%),
        rgba(11, 25, 49, 0.72);
}

body.system-light-theme .premium-category-card {
    background:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.10), transparent 34%),
        rgba(255, 255, 255, 0.86);
}

.premium-category-card:nth-child(2) {
    border-color: rgba(248, 113, 113, 0.24);
    background:
        radial-gradient(circle at 16% 0%, rgba(248, 113, 113, 0.14), transparent 34%),
        rgba(28, 18, 40, 0.54);
}

.premium-category-card:nth-child(3) {
    border-color: rgba(250, 204, 21, 0.22);
    background:
        radial-gradient(circle at 16% 0%, rgba(250, 204, 21, 0.12), transparent 34%),
        rgba(31, 29, 18, 0.50);
}

body.system-light-theme .premium-category-card:nth-child(2),
body.system-light-theme .premium-category-card:nth-child(3) {
    background: rgba(255, 255, 255, 0.86);
}

.premium-category-card:nth-child(n + 4) {
    min-height: 138px;
}

.premium-card-main {
    align-content: end;
    padding: 26px 58px 24px 24px !important;
}

.premium-card-icon {
    width: 48px;
    height: 48px;
}

.premium-category-card:nth-child(2) .premium-card-icon {
    color: #fb7185;
    background: rgba(244, 63, 94, 0.12);
}

.premium-category-card:nth-child(3) .premium-card-icon {
    color: #facc15;
    background: rgba(250, 204, 21, 0.12);
}

.home-quick-section,
.dashboard-metrics-section,
.home-recent-section,
.premium-dashboard-side {
    margin-top: 22px;
}

.premium-dashboard-side {
    grid-template-columns: minmax(0, 1fr);
}

.premium-dashboard-side .dashboard-side-panel {
    max-width: 760px;
}

@media (max-width: 1380px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: minmax(150px, auto) minmax(0, 1fr) minmax(0, auto) !important;
    }

    .app-shell-tabs {
        grid-column: 1 / -1;
        order: 4;
    }
}

@media (max-width: 1180px) {
    .optimized-home .home-hero-card,
    .premium-hero-card {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "copy"
            "details"
            "actions"
            "progress"
            "activity" !important;
        gap: 18px !important;
    }

    .premium-hero-activity {
        padding-top: 22px;
        padding-left: 0;
        border-top: 1px solid rgba(148, 163, 184, 0.18);
        border-left: 0;
    }

    .premium-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: none;
    }
}

@media (max-width: 900px) {
    .document-view,
    .document-view.dashboard-sidebar-collapsed {
        padding: 14px 14px 104px;
    }

    body.document-home-open .document-home-header.app-shell-header {
        min-height: 0;
        grid-template-columns: 1fr !important;
        padding: 16px;
    }

    .app-shell-brand,
    .app-shell-actions {
        justify-content: space-between;
    }

    .dashboard-command-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-bottom: 16px;
    }

    .dashboard-command-button {
        min-width: 0;
        min-height: 50px;
        padding-inline: 12px;
    }

    .optimized-home .home-hero-card,
    .premium-hero-card,
    .popular-category-section {
        padding: 22px !important;
        border-radius: 18px !important;
    }

    .popular-category-section {
        margin-top: 14px;
    }

    .premium-category-grid,
    .premium-action-grid,
    .premium-metrics-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 560px) {
    .app-shell-tab {
        min-height: 46px;
        padding-inline: 12px;
        font-size: 0.86rem;
    }

    .dashboard-command-row {
        grid-template-columns: 1fr;
    }

    .premium-hero-copy h1 {
        font-size: clamp(2.2rem, 14vw, 3.25rem) !important;
    }

    .premium-hero-details {
        grid-template-columns: 1fr !important;
    }

    .premium-hero-activity .dashboard-activity-item {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .premium-hero-activity .dashboard-activity-item time {
        grid-column: 2;
    }

    .hero-activity-link {
        justify-self: stretch;
    }
}

/* === DOCSPACE TOPBAR DENSITY FIX === */
body.document-home-open .document-home-header.app-shell-header {
    grid-template-columns: minmax(150px, auto) minmax(280px, 1fr) minmax(0, auto) !important;
    grid-template-areas:
        "brand search actions"
        "tabs tabs tabs";
    row-gap: 14px;
    min-height: 0;
    padding: 18px 20px;
    overflow: visible;
}

.app-shell-brand {
    grid-area: brand;
}

.app-shell-tabs {
    grid-area: tabs;
    justify-self: start;
    max-width: 100%;
}

.app-shell-search.global-document-search,
.document-search.app-shell-search {
    grid-area: search;
    width: min(100%, 620px);
    justify-self: center;
}

.app-shell-actions {
    grid-area: actions;
    justify-self: end;
    gap: 10px;
}

.app-shell-tab {
    min-height: 46px;
    padding: 0 16px;
    font-size: 0.94rem;
}

.app-shell-tab svg {
    width: 19px;
    height: 19px;
}

.dashboard-command-row {
    display: none !important;
}

.premium-dashboard {
    margin-top: 0;
}

.optimized-home .home-hero-card,
.premium-hero-card {
    margin-top: 0;
}

@media (max-width: 1680px) {
    .app-shell-actions .theme-toggle-button span,
    .app-shell-actions .home-logout-button span {
        display: none;
    }

    .app-shell-actions .theme-toggle-button,
    .app-shell-actions .home-logout-button {
        width: 46px;
        padding-inline: 0;
        justify-content: center;
    }
}

@media (min-width: 1381px) {
    .app-shell-tabs {
        order: 0;
        grid-column: auto;
    }
}

@media (max-width: 1180px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: minmax(0, 1fr) minmax(0, auto) !important;
        grid-template-areas:
            "brand actions"
            "search search"
            "tabs tabs";
    }

    .app-shell-search.global-document-search,
    .document-search.app-shell-search {
        width: 100%;
        justify-self: stretch;
    }
}

/* === DOCSPACE FULL TOP NAVIGATION === */
.document-view,
.document-view.dashboard-sidebar-collapsed {
    --dash-sidebar-width: 0px;
    padding: 20px 20px 34px !important;
}

.dashboard-sidebar {
    display: none !important;
}

body.document-home-open .document-home-header.app-shell-header {
    grid-template-columns: minmax(160px, auto) minmax(340px, 1fr) minmax(0, auto) !important;
    grid-template-areas:
        "brand search actions"
        "tabs tabs tabs";
    width: min(100%, 1720px);
    margin-inline: auto;
}

.premium-dashboard,
.dashboard-page-section,
.document-catalog {
    max-width: 1720px;
}

.app-shell-tabs {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.app-shell-tab {
    min-height: 44px;
    padding: 0 14px;
    flex: 0 1 auto;
    border-radius: 12px;
    font-size: 0.9rem;
}

.app-shell-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-shell-tab.docspace-ai-nav-button {
    color: #7dd3fc;
    border-color: rgba(56, 189, 248, 0.26);
}

.app-shell-tab.dashboard-sidebar-admin {
    color: #facc15;
    border-color: rgba(250, 204, 21, 0.28);
    background: rgba(250, 204, 21, 0.08);
}

.app-shell-tab.dashboard-sidebar-admin.is-hidden {
    display: none !important;
}

@media (max-width: 1440px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: minmax(150px, auto) minmax(260px, 1fr) minmax(0, auto) !important;
    }

    .app-shell-tab {
        min-height: 42px;
        padding-inline: 12px;
        font-size: 0.84rem;
    }
}

@media (max-width: 1180px) {
    .document-view,
    .document-view.dashboard-sidebar-collapsed {
        padding: 14px 14px 104px !important;
    }

    .app-shell-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 2px;
    }

    .app-shell-tab {
        flex: 0 0 auto;
    }
}

/* === DOCSPACE TOP NAV SPREAD FIX === */
body.document-home-open .document-home-header.app-shell-header {
    row-gap: 12px;
    padding-bottom: 14px;
}

.app-shell-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    width: 100%;
    overflow: visible;
}

.app-shell-tab {
    min-width: 0;
    min-height: 42px;
    padding: 0 10px;
    font-size: 0.82rem;
}

.app-shell-tab svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 1420px) {
    .app-shell-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 3px;
        scroll-snap-type: x proximity;
    }

    .app-shell-tab {
        flex: 0 0 138px;
        scroll-snap-align: start;
    }
}

@media (max-width: 760px) {
    .app-shell-tab {
        flex-basis: 124px;
        min-height: 40px;
        font-size: 0.78rem;
    }
}

/* === DOCSPACE TOP NAV FULL WIDTH FIX === */
body.document-home-open .document-home-header.app-shell-header {
    grid-template-columns: minmax(180px, auto) minmax(360px, 1fr) minmax(0, auto) !important;
    grid-template-areas:
        "brand search actions"
        "tabs tabs tabs";
    column-gap: 24px;
}

.app-shell-tabs {
    display: grid;
    grid-template-columns:
        minmax(150px, 1fr)
        minmax(160px, 1.05fr)
        minmax(155px, 1fr)
        minmax(145px, 0.92fr)
        minmax(145px, 0.92fr)
        minmax(150px, 0.96fr)
        minmax(165px, 1.05fr)
        minmax(130px, 0.8fr)
        minmax(175px, 1.1fr);
    gap: 12px;
}

.app-shell-tab {
    width: 100%;
    min-height: 46px;
    padding-inline: 14px;
    font-size: 0.94rem;
}

.app-shell-tab span {
    overflow: visible;
    text-overflow: clip;
}

.app-shell-search.global-document-search,
.document-search.app-shell-search {
    width: min(100%, 520px);
    justify-self: center;
}

@media (max-width: 1600px) {
    .app-shell-tabs {
        grid-template-columns: repeat(9, minmax(126px, 1fr));
        gap: 10px;
    }

    .app-shell-tab {
        padding-inline: 11px;
        font-size: 0.84rem;
    }
}

@media (max-width: 1300px) {
    .app-shell-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .app-shell-tab {
        flex: 0 0 148px;
    }
}

/* === DOCSPACE CLEAN TOPBAR + SUPPORT CHAT PANEL === */
body.document-home-open .document-home-header.app-shell-header {
    grid-template-columns: minmax(210px, auto) minmax(360px, 1fr) max-content !important;
    grid-template-areas:
        "brand search actions"
        "tabs tabs tabs";
    row-gap: 18px;
}

.app-shell-tabs {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    width: 100%;
    overflow: visible;
}

.app-shell-tab {
    flex: 1 1 170px;
    max-width: 260px;
    min-width: 150px;
    justify-content: center;
    padding-inline: 18px;
}

.app-shell-tab[data-home-nav="home"] span {
    font-size: 0;
}

.app-shell-tab[data-home-nav="home"] span::before {
    content: "Início";
    font-size: 0.94rem;
}

.app-shell-actions {
    gap: 10px;
}

.app-shell-actions .ai-assistant-header-button,
.app-shell-actions .theme-toggle-button {
    display: none !important;
}

.premium-dashboard-layout {
    grid-template-columns: minmax(0, 1fr) !important;
}

.premium-dashboard-main {
    min-width: 0;
}

.premium-dashboard-side {
    display: none !important;
}

.profile-download-panel .profile-download-button {
    justify-content: center;
    min-width: 170px;
}

.support-chat-modal {
    place-items: stretch end;
    padding: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.16), transparent 34%),
        rgba(3, 7, 18, 0.70);
    backdrop-filter: blur(16px);
}

.support-chat-card {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    width: min(100%, 900px);
    height: 100vh;
    max-height: none;
    padding: 0;
    border-width: 0 0 0 1px;
    border-radius: 0;
    color: #e5edf8;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.20), transparent 32%),
        linear-gradient(160deg, #0b1220 0%, #111c2f 56%, #08111f 100%);
    box-shadow: -34px 0 80px rgba(0, 0, 0, 0.42);
}

.support-chat-heading {
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.72);
}

.support-chat-heading > div {
    position: relative;
    display: grid;
    gap: 4px;
    padding-left: 62px;
}

.support-chat-heading > div::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(96, 165, 250, 0.32);
    border-radius: 15px;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='25' height='25' viewBox='0 0 24 24' fill='none' stroke='%2360a5fa' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a4 4 0 0 1-4 4H7l-4 4V7a4 4 0 0 1 4-4h7'/%3E%3Cpath d='m15 3 2 4 4 2-4 2-2 4-2-4-4-2 4-2z'/%3E%3C/svg%3E") center / 25px 25px no-repeat,
        linear-gradient(145deg, rgba(37, 99, 235, 0.26), rgba(14, 165, 233, 0.12));
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.22);
    transform: translateY(-50%);
}

.support-chat-heading .eyebrow {
    margin: 0;
    color: #60a5fa;
    letter-spacing: 0.16em;
}

.support-chat-heading h2 {
    color: #f8fafc;
    font-size: clamp(1.35rem, 2.2vw, 1.8rem);
}

.support-chat-heading .icon-button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.76);
}

.support-chat-description {
    margin: 0;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    color: #9fb0c8;
    background: rgba(7, 13, 26, 0.42);
    font-size: 0.95rem;
}

.support-chat-messages {
    min-height: 0;
    max-height: none;
    align-content: end;
    gap: 12px;
    overflow-y: auto;
    padding: 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.support-chat-empty {
    align-self: center;
    justify-self: center;
    width: min(100%, 440px);
    padding: 22px;
    border: 1px dashed rgba(148, 163, 184, 0.26);
    border-radius: 18px;
    color: #9fb0c8;
    text-align: center;
    background: rgba(15, 23, 42, 0.48);
}

.support-chat-bubble {
    width: fit-content;
    max-width: min(78%, 560px);
    padding: 13px 15px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px 18px 18px 6px;
    color: #e5edf8;
    background: rgba(30, 41, 59, 0.86);
    box-shadow: 0 18px 38px rgba(2, 6, 23, 0.18);
}

.support-chat-bubble.is-customer {
    border-color: rgba(96, 165, 250, 0.34);
    border-radius: 18px 18px 6px 18px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.support-chat-bubble strong {
    color: #f8fafc;
    font-size: 0.78rem;
}

.support-chat-bubble p {
    margin: 7px 0;
    font-size: 0.95rem;
}

.support-chat-bubble time {
    color: rgba(226, 232, 240, 0.74);
}

.support-chat-form {
    gap: 12px;
    margin: 0;
    padding: 16px 24px 22px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(7, 13, 26, 0.72);
}

.support-chat-form .field {
    margin: 0;
}

.support-chat-form .field > span {
    margin-bottom: 7px;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 800;
}

.support-chat-form textarea {
    min-height: 96px;
    resize: vertical;
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.78);
}

.support-chat-form input[type="file"] {
    padding: 13px;
    border-radius: 14px;
}

.support-chat-form button[type="submit"] {
    justify-content: center;
    min-height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    box-shadow: 0 18px 42px rgba(37, 99, 235, 0.30);
}

body.system-light-theme .support-chat-card {
    color: #1d2433;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 32%),
        linear-gradient(160deg, #f8fbff 0%, #eef4ff 56%, #ffffff 100%);
}

body.system-light-theme .support-chat-heading,
body.system-light-theme .support-chat-description,
body.system-light-theme .support-chat-form,
body.system-light-theme .support-chat-empty,
body.system-light-theme .support-chat-bubble {
    background: rgba(255, 255, 255, 0.84);
}

body.system-light-theme .support-chat-heading h2,
body.system-light-theme .support-chat-bubble strong {
    color: #101828;
}

body.system-light-theme .support-chat-description,
body.system-light-theme .support-chat-empty {
    color: #667085;
}

body.system-light-theme .support-chat-bubble {
    color: #1d2433;
}

body.system-light-theme .support-chat-bubble.is-customer {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

@media (max-width: 1100px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: 1fr !important;
        grid-template-areas:
            "brand"
            "search"
            "actions"
            "tabs";
    }

    .app-shell-search.global-document-search,
    .document-search.app-shell-search {
        justify-self: stretch;
        width: 100%;
    }

    .app-shell-actions {
        justify-content: flex-start;
        overflow-x: auto;
    }

    .app-shell-tab {
        flex: 1 1 150px;
        max-width: none;
    }
}

@media (max-width: 760px) {
    .support-chat-card {
        width: 100%;
    }

    .support-chat-heading,
    .support-chat-description,
    .support-chat-messages,
    .support-chat-form {
        padding-inline: 16px;
    }

    .support-chat-bubble {
        max-width: 92%;
    }

    .support-guest-fields {
        grid-template-columns: 1fr;
    }
}

/* === DOCSPACE TOP NAV SINGLE ROW FIX === */
@media (min-width: 1201px) {
    body.document-home-open .document-home-header.app-shell-header {
        grid-template-columns: minmax(220px, auto) minmax(420px, 1fr) max-content !important;
        grid-template-areas:
            "brand search actions"
            "tabs tabs tabs";
        max-width: none;
        width: 100%;
        row-gap: 20px;
    }

    .app-shell-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch;
        width: 100%;
        gap: 14px;
        overflow: visible;
    }

    .app-shell-tab {
        flex: 1 1 0 !important;
        max-width: none !important;
        min-width: 0 !important;
        min-height: 58px;
        padding-inline: 18px;
        justify-content: center;
        white-space: nowrap;
    }

    .app-shell-tab span {
        min-width: 0;
        overflow: visible;
        text-overflow: clip;
    }
}

@media (max-width: 1200px) {
    .app-shell-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .app-shell-tab {
        flex: 0 0 168px !important;
        max-width: none !important;
    }
}

/* === DOCSPACE TOP NAV STRETCH GRID FIX === */
@media (min-width: 1201px) {
    body.document-home-open .document-home-header.app-shell-header > .app-shell-tabs {
        grid-area: tabs !important;
        grid-column: 1 / -1 !important;
        justify-self: stretch !important;
        align-self: stretch !important;
        display: grid !important;
        grid-template-columns:
            minmax(150px, 1fr)
            minmax(180px, 1.08fr)
            minmax(170px, 1.03fr)
            minmax(160px, 1fr)
            minmax(160px, 1fr)
            minmax(190px, 1.12fr)
            minmax(150px, 0.95fr);
        width: 100% !important;
        min-width: 100% !important;
        max-width: none !important;
        gap: 14px;
        padding: 0;
        overflow: visible;
    }

    body.document-home-open .document-home-header.app-shell-header > .app-shell-tabs > .app-shell-tab {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 58px;
        padding-inline: 18px;
        justify-content: center;
        gap: 10px;
        overflow: hidden;
    }

    body.document-home-open .document-home-header.app-shell-header > .app-shell-tabs > .app-shell-tab span {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.document-home-open .document-home-header.app-shell-header > .app-shell-tabs > .app-shell-tab[data-home-nav="home"] span {
        font-size: 0;
    }

    body.document-home-open .document-home-header.app-shell-header > .app-shell-tabs > .app-shell-tab[data-home-nav="home"] span::before {
        content: "Início";
        font-size: 0.94rem;
    }
}

@media (max-width: 1500px) and (min-width: 1201px) {
    body.document-home-open .document-home-header.app-shell-header > .app-shell-tabs {
        grid-template-columns:
            minmax(128px, 1fr)
            minmax(150px, 1.08fr)
            minmax(145px, 1.03fr)
            minmax(138px, 1fr)
            minmax(138px, 1fr)
            minmax(165px, 1.12fr)
            minmax(128px, 0.95fr);
        gap: 10px;
    }

    body.document-home-open .document-home-header.app-shell-header > .app-shell-tabs > .app-shell-tab {
        padding-inline: 12px;
        font-size: 0.84rem;
    }
}
