:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #18152d;
  background: #f5f6fb;
  font-synthesis: none;
  --purple: #1d1934;
  --purple-2: #2a2448;
  --yellow: #ffc629;
  --border: #dde2ee;
  --muted: #6b7280;
  --danger: #dc2626;
  --success: #15803d;
  --surface: #ffffff;
  --shadow: 0 12px 32px rgba(29, 25, 52, 0.08);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-loading, .setup-error { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #e5e7eb; border-top-color: var(--yellow); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; background: var(--purple); }
.login-hero { padding: 72px; color: white; display: flex; flex-direction: column; justify-content: center; background: radial-gradient(circle at 20% 20%, #403765, var(--purple) 55%); }
.brand-mark { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--yellow); color: var(--purple); font-size: 28px; box-shadow: 0 16px 30px rgba(255,198,41,.2); }
.login-hero h1 { font-size: clamp(38px, 6vw, 72px); margin: 24px 0 12px; letter-spacing: -.04em; }
.login-hero p { color: #d7d2ea; max-width: 560px; font-size: 18px; line-height: 1.6; }
.login-panel { background: #f8f9fd; display: grid; place-items: center; padding: 32px; }
.login-card { width: min(430px, 100%); background: white; border-radius: 24px; padding: 36px; box-shadow: var(--shadow); }
.login-card h2 { margin: 0 0 8px; font-size: 28px; }
.login-card p { margin: 0 0 28px; color: var(--muted); }
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 700; color: #34304b; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--border); border-radius: 11px; padding: 12px 13px; background: white; color: #18152d; outline: none; transition: .2s; }
.input:focus, .select:focus, .textarea:focus { border-color: #9f8eed; box-shadow: 0 0 0 4px rgba(117,91,220,.1); }
.input.invalid { border-color: #ef4444; }
.error-text { color: var(--danger); font-size: 12px; }
.btn { border: 0; border-radius: 11px; min-height: 42px; padding: 0 16px; font-weight: 750; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--yellow); color: #17132a; box-shadow: 0 8px 20px rgba(255,198,41,.25); }
.btn-primary:hover { filter: brightness(.98); transform: translateY(-1px); }
.btn-secondary { background: white; color: var(--purple); border: 1px solid var(--border); }
.btn-danger { background: #fee2e2; color: #991b1b; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.text-button { border: 0; background: transparent; color: #6552c5; padding: 6px; font-weight: 700; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar { background: var(--purple); color: white; padding: 18px 14px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 10px 8px 26px; }
.sidebar-brand .brand-mark { width: 42px; height: 42px; border-radius: 12px; font-size: 20px; }
.sidebar-brand strong { display: block; }
.sidebar-brand small { color: #aaa3c1; }
.nav-title { color: #8e87a7; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 12px 10px 8px; }
.nav-item { border: 0; color: #d5d1e1; background: transparent; width: 100%; display: flex; align-items: center; gap: 11px; padding: 12px; border-radius: 10px; text-align: left; margin: 2px 0; }
.nav-item.active { background: rgba(255,198,41,.14); color: white; box-shadow: inset 3px 0 var(--yellow); }
.sidebar-footer { margin-top: auto; border-radius: 12px; background: #2a2544; padding: 12px; color: #c8c3d8; font-size: 12px; }
.main { min-width: 0; }
.topbar { height: 72px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; position: sticky; top: 0; z-index: 10; }
.topbar-title h1 { margin: 0; font-size: 24px; }
.topbar-title p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.user-menu { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: #fff4c2; color: var(--purple); display: grid; place-items: center; font-weight: 800; }
.content { padding: 24px; }
.page-actions { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 16px; flex-wrap: wrap; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-bottom: 14px; }
.filters { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 16px; display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; box-shadow: var(--shadow); }
.table-card { background: white; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.table-meta { padding: 15px 16px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1250px; }
th { background: #f8f9fc; text-align: left; color: #3e3854; font-size: 11px; text-transform: uppercase; letter-spacing: .035em; padding: 12px 14px; border-bottom: 1px solid var(--border); }
td { padding: 13px 14px; border-bottom: 1px solid #eef1f6; font-size: 13px; vertical-align: middle; }
tr:hover td { background: #fcfcfe; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge.saved, .badge.generated { background: #e0f2fe; color: #075985; }
.badge.awaiting_review, .badge.awaiting_signature { background: #fff7d6; color: #854d0e; }
.badge.signed { background: #dcfce7; color: #166534; }
.badge.error, .badge.refused { background: #fee2e2; color: #991b1b; }
.badge.draft, .badge.pending_data { background: #f1f5f9; color: #475569; }
.actions { display: flex; gap: 7px; }
.icon-btn { border: 1px solid var(--border); background: white; min-width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; }
.pagination { padding: 14px 16px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.empty { padding: 70px 20px; text-align: center; color: var(--muted); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 12, 28, .55); z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal { width: min(1050px, 100%); max-height: 94vh; overflow: auto; background: white; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: white; z-index: 2; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; }
.modal-body { padding: 24px; }
.form-section { border: 1px solid var(--border); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.form-section h3 { margin: 0 0 15px; font-size: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.col-2 { grid-column: span 2; }
.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.lookup-note { min-height: 28px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.review-card { background: #fafafe; border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.review-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.review-item small { color: var(--muted); display: block; margin-bottom: 4px; }
.modal-footer { padding: 18px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; position: sticky; bottom: 0; background: white; }
.toast-container { position: fixed; top: 86px; right: 20px; z-index: 200; display: grid; gap: 10px; }
.toast { min-width: 300px; max-width: 430px; padding: 13px 15px; border-radius: 12px; background: #1d1934; color: white; box-shadow: var(--shadow); }
.toast.error { background: #991b1b; }
.toast.success { background: #166534; }
.setup-card { max-width: 700px; background: white; border-radius: 20px; padding: 28px; box-shadow: var(--shadow); }
.setup-card code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; }
@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar-brand div, .nav-item span, .nav-title, .sidebar-footer { display: none; }
  .sidebar { align-items: center; }
  .nav-item { justify-content: center; }
  .filters { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .col-3, .col-4 { grid-column: span 2; }
}
@media (max-width: 640px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { padding: 0 14px; }
  .content { padding: 14px; }
  .filters, .form-grid, .review-grid { grid-template-columns: 1fr; }
  .col-2, .col-3, .col-4 { grid-column: span 1; }
  .modal-backdrop { padding: 0; align-items: end; }
  .modal { border-radius: 18px 18px 0 0; max-height: 96vh; }
  .user-menu .user-details { display: none; }
}

/* Etapa 2 — revisão e versionamento documental */
.btn-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.btn-success:hover { background: #bbf7d0; }
.muted-note { color: var(--muted); margin: 16px 0 0; line-height: 1.55; }
.warning-box, .success-box { border-radius: 12px; padding: 13px 15px; margin-bottom: 16px; line-height: 1.5; }
.warning-box { background: #fff7d6; border: 1px solid #fde68a; color: #854d0e; }
.success-box { background: #dcfce7; border: 1px solid #bbf7d0; color: #166534; }
.badge.review_approved, .badge.ready_to_send { background: #dcfce7; color: #166534; }
.badge.review_rejected { background: #fee2e2; color: #991b1b; }
.badge.superseded, .badge.outdated { background: #f1f5f9; color: #475569; }
.badge.generating { background: #ede9fe; color: #5b21b6; }
.spinner.small { width: 18px; height: 18px; border-width: 2px; }
.details-modal { width: min(1180px, 100%); }
.details-body { display: grid; gap: 18px; background: #f8f9fd; }
.details-hero { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.details-hero h3 { margin: 12px 0 4px; }
.details-hero p { margin: 0; color: var(--muted); }
.details-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.detail-section { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 18px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 16px; }
.section-heading h3 { margin: 0; font-size: 17px; }
.section-heading span { color: var(--muted); font-size: 12px; }
.empty-section { text-align: center; color: var(--muted); padding: 28px; }
.empty-section h3 { color: var(--purple); }
.review-panel { border-color: #facc15; box-shadow: 0 0 0 3px rgba(250,204,21,.09); }
.review-status.approved { border-color: #86efac; }
.review-status.rejected { border-color: #fca5a5; }
.review-observation { background: #f8fafc; border-left: 3px solid var(--purple); padding: 10px 12px; border-radius: 6px; }
.hash-line { color: var(--muted); font-size: 12px; }
.hash-line code, .version-meta code { background: #f1f5f9; padding: 2px 6px; border-radius: 5px; }
.review-controls { display: grid; gap: 15px; }
.declaration { display: flex; align-items: flex-start; gap: 10px; background: #fffdf0; border: 1px solid #fde68a; border-radius: 12px; padding: 14px; font-weight: 650; line-height: 1.45; }
.declaration input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--purple); }
.review-buttons { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.version-list { display: grid; gap: 10px; }
.version-item { display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 14px; border: 1px solid var(--border); border-radius: 13px; padding: 13px; background: #fcfcfe; }
.version-item.current { border-color: #d8b400; background: #fffdf3; }
.version-number { width: 48px; height: 48px; border-radius: 12px; background: var(--purple); color: white; display: grid; place-items: center; font-weight: 850; }
.version-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.version-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 7px; }
.version-review { margin-top: 8px; font-size: 12px; color: #166534; }
.version-review.invalidated { color: #991b1b; }
.version-actions { display: flex; gap: 8px; }
.timeline { position: relative; display: grid; gap: 0; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: #e5e7eb; }
.timeline-item { position: relative; display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 8px 0; }
.timeline-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); border: 4px solid #fff7d6; z-index: 1; margin-top: 2px; }
.timeline-item strong { font-size: 13px; }
.timeline-item p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

@media (max-width: 760px) {
  .details-hero, .section-heading { align-items: flex-start; flex-direction: column; }
  .details-actions, .review-buttons { width: 100%; }
  .details-actions .btn, .review-buttons .btn { flex: 1; }
  .version-item { grid-template-columns: 48px minmax(0,1fr); }
  .version-actions { grid-column: 1 / -1; }
  .version-actions .btn { width: 100%; }
}

/* Etapa 3: PDF, visualização e conversão */
.pdf-status-card { border-left: 4px solid #cbd5e1; }
.pdf-status-card.ready { border-left-color: #16a34a; background: #f7fff9; }
.pdf-status-card.processing { border-left-color: #f59e0b; background: #fffdf5; }
.pdf-status-card.warning { border-left-color: #d97706; background: #fffaf0; }
.pdf-status-card.error { border-left-color: #dc2626; background: #fff7f7; }
.pdf-status-row, .pdf-progress { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.pdf-status-row p, .pdf-progress p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.pdf-progress { justify-content: flex-start; }
.pdf-progress .spinner { width: 28px; height: 28px; flex: 0 0 auto; }
.pdf-progress .btn { margin-left: auto; }
.pdf-actions, .review-file-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pdf-mini-status { display: inline-flex; align-items: center; min-height: 22px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: #eef2f7; color: #475569; }
.pdf-mini-status.ready { background: #dcfce7; color: #166534; }
.pdf-mini-status.processing { background: #fef3c7; color: #92400e; }
.pdf-mini-status.error { background: #fee2e2; color: #991b1b; }
.version-actions { flex-wrap: wrap; justify-content: flex-end; }
.version-actions .btn { white-space: nowrap; }

.pdf-preview-backdrop { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 18px; background: rgba(13, 11, 34, .78); }
.pdf-preview-modal { width: min(1180px, 98vw); height: min(900px, 94vh); display: grid; grid-template-rows: auto 1fr; overflow: hidden; border-radius: 16px; background: #fff; box-shadow: 0 28px 80px rgba(0, 0, 0, .34); }
.pdf-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.pdf-preview-header > div:first-child { display: grid; gap: 3px; }
.pdf-preview-header small { color: var(--muted); }
.pdf-preview-actions { display: flex; align-items: center; gap: 8px; }
.pdf-preview-modal iframe { width: 100%; height: 100%; border: 0; background: #e5e7eb; }

@media (max-width: 760px) {
  .pdf-status-row, .pdf-progress, .pdf-preview-header { align-items: stretch; flex-direction: column; }
  .pdf-progress .btn { margin-left: 0; }
  .pdf-actions .btn, .review-file-actions .btn { flex: 1 1 100%; }
  .pdf-preview-backdrop { padding: 0; }
  .pdf-preview-modal { width: 100vw; height: 100vh; border-radius: 0; }
  .pdf-preview-actions { justify-content: space-between; }
}

/* Etapa 4 — assinatura eletrônica e notificações */
.nav-item { position: relative; }
.nav-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #ffc629; color: #1d1934; font-size: 11px; font-style: normal; font-weight: 800; }
.nav-badge[hidden] { display: none; }
.signature-panel { border: 1px solid #ddd9ed; background: linear-gradient(180deg,#fff 0%,#fbfaff 100%); }
.signature-rule-box { padding: 14px 16px; margin: 14px 0; border-left: 4px solid #ffc629; background: #fff9df; border-radius: 10px; }
.signature-rule-box p { margin: 4px 0 0; color: #57526d; }
.mandatory-signer { display: grid; gap: 4px; padding: 16px; border: 1px solid #dcd8eb; border-radius: 12px; background: #fff; }
.mandatory-signer small { color: #866600; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.mandatory-signer span,.mandatory-signer em { color: #625d76; font-style: normal; }
.optional-signer { margin-top: 12px; border: 1px solid #e1dfee; border-radius: 12px; overflow: hidden; background: #fff; }
.optional-toggle { display: flex; gap: 10px; align-items: center; padding: 14px 16px; font-weight: 700; cursor: pointer; }
.witness-fields { padding: 0 16px 16px; border-top: 1px solid #eeeaf6; }
.witness-fields[hidden] { display: none; }
.witness-fields > small { display: block; color: #6b667c; margin-top: 4px; }
.signature-options { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.witness-fields .signature-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
.signature-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.signature-summary { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 14px 0; }
.signature-summary > div { padding: 12px; border-radius: 10px; background: #f6f4fb; }
.signature-summary small,.signature-summary strong { display: block; }
.signature-summary small { color: #777189; margin-bottom: 4px; }
.signature-signer-list { display: grid; gap: 10px; }
.signature-signer-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e2dfec; border-radius: 10px; background: #fff; }
.signature-signer-row div { display: grid; gap: 2px; }
.signature-signer-row small,.signature-signer-row span { color: #6d687d; }
.error-box { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: #fff0f0; border: 1px solid #f4bcbc; color: #8b1919; }
.notification-list { display: grid; gap: 10px; }
.notification-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid #e3e0ed; background: #fff; }
.notification-item.unread { border-left: 5px solid #ffc629; box-shadow: 0 8px 22px rgba(29,25,52,.06); }
.notification-item.read { opacity: .72; }
.notification-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: #f4f1fb; color: #1d1934; font-weight: 900; }
.notification-item p { margin: 4px 0; color: #5f5a70; }
.notification-item small { color: #878195; }
.notification-actions { display: flex; gap: 8px; align-items: center; }
.badge.pending,.badge.viewed,.badge.awaiting_signature { background: #fff5c9; color: #775a00; }
.badge.partially_signed { background: #e7f0ff; color: #1c4f93; }
.badge.signed { background: #ddf7e8; color: #146c3b; }
.badge.refused,.badge.error { background: #ffe3e3; color: #9a2525; }
.badge.cancelled,.badge.expired { background: #eceaf1; color: #5b5668; }
@media (max-width: 900px) {
  .signature-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .signature-options,.witness-fields .signature-options { grid-template-columns: 1fr; }
  .signature-signer-row { grid-template-columns: 1fr; }
  .notification-item { grid-template-columns: 40px 1fr; }
  .notification-actions { grid-column: 1 / -1; }
}

/* Administração */
.admin-status-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; margin-bottom:18px; }
.admin-status-grid article { display:grid; gap:5px; padding:18px; background:#fff; border:1px solid var(--border); border-radius:14px; }
.admin-status-grid small { color:var(--muted); text-transform:uppercase; font-weight:800; letter-spacing:.04em; }
.admin-status-grid span { color:var(--muted); font-size:13px; }
.status-ok { color:#146c3b; }
.status-warning { color:#9a5f00; }
.admin-user-modal { width:min(680px,95vw); }
@media (max-width:760px) { .admin-status-grid { grid-template-columns:1fr; } }

.signature-link-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; }
.signature-link-actions .btn { min-height: 36px; }

/* Assinatura pública sem serviço externo */
.public-signature-page { min-height:100vh; display:grid; place-items:center; padding:24px; background:#f3f4fa; }
.public-signature-card { width:min(560px,94vw); padding:34px; text-align:center; border-radius:20px; background:#fff; box-shadow:0 18px 55px rgba(29,25,52,.12); }
.public-signature-card.loading { display:grid; justify-items:center; gap:14px; }
.public-state h1 { margin:18px 0 8px; color:#1d1934; }
.public-state p { color:#5f5a70; }
.public-signature-shell { min-height:100vh; background:#eef0f7; color:#1d1934; }
.public-signature-header { min-height:74px; display:flex; align-items:center; justify-content:space-between; gap:20px; padding:12px 24px; border-bottom:1px solid #dedfea; background:#fff; }
.public-signature-header > div:last-child { display:grid; text-align:right; gap:2px; }
.public-signature-header small { color:#746f83; }
.public-signature-content { display:grid; grid-template-columns:minmax(0,1fr) 390px; gap:18px; max-width:1500px; margin:0 auto; padding:18px; }
.public-document-panel,.public-signature-form { background:#fff; border:1px solid #dedfea; border-radius:16px; box-shadow:0 10px 28px rgba(29,25,52,.06); }
.public-document-panel { min-height:calc(100vh - 110px); display:grid; grid-template-rows:auto 1fr; overflow:hidden; }
.public-document-title { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:16px 18px; border-bottom:1px solid #e5e4ed; }
.public-document-title h1 { margin:0 0 4px; font-size:18px; }
.public-document-title p { margin:0; color:#777184; font-size:12px; }
.public-document-panel iframe { width:100%; min-height:720px; height:100%; border:0; background:#dfe2ea; }
.public-signature-form { align-self:start; position:sticky; top:18px; padding:20px; }
.public-signature-form h2 { margin:0 0 15px; }
.public-identity { display:grid; gap:4px; padding:14px; border-radius:12px; background:#f6f4fb; }
.public-identity small,.public-identity span,.public-deadline { color:#6b667a; }
.public-deadline { font-size:13px; }
.signature-mode-tabs { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin:18px 0 12px; padding:4px; border-radius:10px; background:#eeedf5; }
.signature-mode-tabs button { border:0; padding:9px; border-radius:8px; background:transparent; cursor:pointer; font-weight:700; color:#5c576d; }
.signature-mode-tabs button.active { background:#fff; color:#1d1934; box-shadow:0 2px 8px rgba(29,25,52,.1); }
.typed-signature-field { margin-bottom:10px; }
.typed-signature-field label { display:block; margin-bottom:5px; font-size:12px; font-weight:700; }
.signature-canvas-wrap { position:relative; }
#signature-canvas { width:100%; height:180px; display:block; border:1px dashed #aaa5ba; border-radius:12px; background:#fff; touch-action:none; cursor:crosshair; }
.signature-canvas-wrap .text-button { margin-top:5px; }
.public-consent { margin:16px 0; }
.public-signature-actions { display:grid; grid-template-columns:1fr 1.5fr; gap:10px; }
.public-legal-note { margin:14px 0 0; color:#777184; font-size:11px; line-height:1.45; }
@media (max-width:1000px) {
  .public-signature-content { grid-template-columns:1fr; }
  .public-signature-form { position:static; }
  .public-document-panel { min-height:650px; }
}
@media (max-width:620px) {
  .public-signature-header,.public-document-title { align-items:stretch; flex-direction:column; }
  .public-signature-header > div:last-child { text-align:left; }
  .public-signature-content { padding:8px; }
  .public-document-panel iframe { min-height:520px; }
  .public-signature-actions { grid-template-columns:1fr; }
}

.spinner-centered{margin:auto}

/* V2.2 - anexos e gestão de vagas */
.section-heading > div:first-child { display:grid; gap:3px; }
.section-heading small { color:var(--muted); font-weight:600; }
.section-heading-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; flex-wrap:wrap; }
.section-subheading { display:flex; align-items:center; justify-content:space-between; gap:14px; margin:18px 0 10px; padding-top:16px; border-top:1px solid var(--border); }
.section-subheading > div { display:grid; gap:3px; }
.section-subheading small { color:var(--muted); }
.attachment-highlight { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:16px; border:1px solid #cde8d6; border-radius:13px; background:#f0fbf4; }
.attachment-highlight > div:first-child { display:grid; gap:5px; }
.attachment-highlight p { margin:0; color:#4f6558; }
.attachment-actions { display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.attachment-list { display:grid; gap:9px; }
.attachment-item { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:13px 14px; border:1px solid var(--border); border-radius:11px; background:#fff; }
.attachment-item > div:first-child { display:grid; gap:4px; min-width:0; }
.attachment-item span { color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.empty-section.compact { min-height:0; padding:18px; border:1px dashed #ddd9e8; border-radius:11px; background:#fbfaff; }
.empty-section.compact p { margin:0; }
.compatibility-info { margin-bottom:12px; padding:11px 13px; border-left:4px solid #ffc629; border-radius:8px; background:#fff9df; color:#615829; font-size:13px; }
.vacancy-table { overflow:auto; border:1px solid var(--border); border-radius:12px; }
.vacancy-table table { min-width:760px; }
.vacancy-table th { background:#f7f6fb; }
.vacancy-table td,.vacancy-table th { padding:11px 12px; }
.compatibility-check { min-height:42px; display:flex; align-items:center; padding:9px 11px; border-radius:9px; font-size:13px; line-height:1.35; }
.compatibility-check.neutral { background:#f3f2f7; color:#615c6f; }
.compatibility-check.compatible { background:#e5f8ec; border:1px solid #bce8cd; color:#146c3b; }
.compatibility-check.incompatible { background:#fff0f0; border:1px solid #f0c1c1; color:#922525; }
.nested-modal { z-index:1500; background:rgba(13,11,34,.68); }
.modal-card { width:min(720px,94vw); max-height:92vh; overflow:auto; border-radius:17px; background:#fff; box-shadow:0 25px 70px rgba(0,0,0,.28); }
.compact-modal { width:min(620px,94vw); }
.vacancy-modal { width:min(760px,94vw); }
.modal-card .modal-header { position:sticky; top:0; z-index:2; background:#fff; }
.modal-card form { padding:18px; }
.modal-actions { display:flex; justify-content:flex-end; gap:10px; padding-top:8px; }
@media (max-width:760px) {
  .attachment-highlight,.attachment-item,.section-subheading { align-items:stretch; flex-direction:column; }
  .attachment-actions,.section-heading-actions { justify-content:flex-start; }
  .attachment-actions .btn,.section-subheading .btn { flex:1 1 auto; }
}


/* V2.4 - cadastro inicial de vagas e comprovante oficial da Receita Federal */
.form-section-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin:22px 0 12px; padding-top:18px; border-top:1px solid var(--border); }
.form-section-heading > div { display:grid; gap:4px; }
.form-section-heading h3 { margin:0; }
.form-section-heading p { margin:0; color:var(--muted); font-size:13px; }
.official-cnpj-box { display:grid; gap:12px; padding:16px; border:1px solid #d9d5e6; border-radius:14px; background:#faf9fd; }
.official-cnpj-box.invalid { border-color:#d65a5a; background:#fff7f7; }
.official-cnpj-actions { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.official-cnpj-status { margin:0; color:#4d4860; font-size:13px; overflow-wrap:anywhere; }
.official-cnpj-status.invalid { color:#9a2525; font-weight:700; }
.official-cnpj-status.valid { color:#14723d; font-weight:700; }
.official-cnpj-status.validating { color:#6a5812; font-weight:700; }
.file-button { position:relative; overflow:hidden; cursor:pointer; }
.file-button input[type="file"] { position:absolute; inline-size:1px; block-size:1px; opacity:0; pointer-events:none; }
.registration-vacancy-summary { display:grid; gap:10px; }
.registration-vacancy-table { overflow:auto; border:1px solid var(--border); border-radius:12px; background:#fff; }
.registration-vacancy-table table { min-width:720px; }
.registration-vacancy-table th { background:#f7f6fb; }
.registration-vacancy-table th,.registration-vacancy-table td { padding:10px 12px; vertical-align:middle; }
.registration-vacancy-table td:last-child { white-space:nowrap; }
.review-official-card { display:grid; gap:6px; border-left:4px solid #ffc629; }
.review-official-card small { color:var(--muted); font-weight:800; text-transform:uppercase; }
.official-receipt-highlight { border-color:#b9dfc7; background:#f3fbf6; }
.review-vacancy-table { margin-top:12px; }
@media (max-width:760px) {
  .form-section-heading { align-items:stretch; flex-direction:column; }
  .official-cnpj-actions { align-items:stretch; flex-direction:column; }
  .official-cnpj-actions .btn,.official-cnpj-actions .file-button { width:100%; justify-content:center; }
}

/* V2.6 — validação exata por CNAE, exclusão e fluxos documentais aprimorados */
.danger-icon { color:#b42318; border-color:#f1b8b3; background:#fff7f6; }
.danger-icon:hover { background:#fee4e2; border-color:#e58d85; }
.section-eyebrow { color:#6d5bb9; font-size:10px; font-weight:900; letter-spacing:.12em; text-transform:uppercase; }
.form-section-heading.no-divider { margin:0 0 16px; padding:0; border:0; }
.document-registration-section { padding:20px; background:linear-gradient(180deg,#fff 0%,#fbfaff 100%); }
.document-state { border-radius:999px; padding:6px 10px; font-size:11px; font-weight:850; white-space:nowrap; }
.document-state.ok { color:#166534; background:#dcfce7; }
.document-state.pending { color:#854d0e; background:#fef3c7; }
.official-cnpj-workflow { display:grid; gap:10px; }
.workflow-step { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:12px; padding:13px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.workflow-step > span,.upload-instructions article > span { width:30px; height:30px; display:grid; place-items:center; border-radius:50%; color:#fff; background:var(--purple); font-weight:900; }
.workflow-step > div,.upload-instructions article > div { display:grid; gap:3px; }
.workflow-step small,.upload-instructions small { color:var(--muted); line-height:1.4; }
.workflow-step.upload-step { grid-template-columns:34px minmax(160px,.8fr) minmax(280px,1.2fr); }
.document-dropzone { min-height:96px; display:grid; place-items:center; align-content:center; gap:5px; padding:16px; border:2px dashed #c8c3d8; border-radius:13px; background:#faf9fd; text-align:center; cursor:pointer; transition:.2s ease; }
.document-dropzone:hover,.document-dropzone.dragging { border-color:#725cc5; background:#f3f0ff; transform:translateY(-1px); }
.document-dropzone small { color:var(--muted); }
.document-dropzone.valid { border-color:#4da56e; background:#f0fbf4; }
.document-dropzone.invalid { border-color:#dc5a54; background:#fff5f4; }
.document-dropzone.validating { border-color:#d7a514; background:#fff9df; }
.official-cnpj-status,.upload-file-status { display:flex; align-items:center; gap:9px; margin-top:11px; padding:10px 12px; border-radius:10px; background:#f4f3f8; color:#575166; font-size:13px; }
.official-cnpj-status .status-dot,.upload-file-status .status-dot { width:9px; height:9px; flex:0 0 auto; border-radius:50%; background:#938da4; }
.official-cnpj-status.valid,.upload-file-status.valid { color:#166534; background:#ecf9f0; }
.official-cnpj-status.valid .status-dot,.upload-file-status.valid .status-dot { background:#22a45d; }
.official-cnpj-status.invalid,.upload-file-status.invalid { color:#991b1b; background:#fff0ef; }
.official-cnpj-status.invalid .status-dot,.upload-file-status.invalid .status-dot { background:#dc2626; }
.official-cnpj-status.validating { color:#7a5b00; background:#fff8dc; }
.official-cnpj-status.validating .status-dot { background:#eab308; animation:pulse-dot 1s infinite alternate; }
@keyframes pulse-dot { to { opacity:.35; } }
.registration-vacancy-summary { grid-template-columns:auto 1fr; align-items:baseline; width:max-content; margin:0 0 12px; padding:8px 11px; border-radius:10px; background:#f4f1ff; }
.registration-vacancy-summary strong { font-size:22px; color:#4d399d; }
.registration-vacancy-summary span { color:var(--muted); font-size:12px; }
.redesigned-vacancy-modal { width:min(820px,95vw); }
.vacancy-editor-layout { display:grid; gap:16px; }
.catalog-lock-card { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; padding:13px; border-radius:13px; background:#1d1934; color:#fff; }
.catalog-lock-card > div { display:grid; gap:4px; min-width:0; }
.catalog-lock-card small { color:#bbb5d1; font-size:10px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
.catalog-lock-card strong { overflow-wrap:anywhere; }
.vacancy-fields-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.vacancy-fields-grid .field { margin:0; }
.vacancy-fields-grid .span-2 { grid-column:span 2; }
.vacancy-fields-grid small { color:var(--muted); line-height:1.4; }
.readonly-field { min-height:44px; display:flex; align-items:center; padding:11px 13px; border:1px solid #e5e2ec; border-radius:11px; background:#f7f6fa; color:#4b4659; font-weight:700; }
.vacancy-modal-actions { margin-top:2px; padding-top:16px; border-top:1px solid var(--border); }
.document-upload-modal { width:min(720px,95vw); }
.document-upload-modal .modal-header { align-items:flex-start; }
.document-upload-modal .modal-header p { max-width:580px; margin:6px 0 0; color:var(--muted); line-height:1.45; }
.stacked-form { display:grid; gap:16px; padding:20px; }
.stacked-form .field { margin:0; }
.document-identity-card { display:grid; grid-template-columns:1.4fr .8fr; gap:12px; padding:14px; border:1px solid #dcd7ec; border-radius:13px; background:#f8f6ff; }
.document-identity-card.single { grid-template-columns:1fr; }
.document-identity-card > div { display:grid; gap:3px; min-width:0; }
.document-identity-card small { color:#6c657d; font-size:10px; font-weight:850; text-transform:uppercase; }
.document-identity-card strong,.document-identity-card span { overflow-wrap:anywhere; }
.upload-instructions { display:grid; gap:9px; }
.upload-instructions article { display:grid; grid-template-columns:34px minmax(0,1fr) auto; align-items:center; gap:11px; padding:12px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.modal-dropzone { min-height:132px; }
.danger-summary { display:grid; gap:5px; padding:15px; border:1px solid #f2aaa5; border-radius:13px; background:#fff4f3; }
.danger-summary strong { color:#8f201a; font-size:17px; }
.danger-summary span { color:#9e4b46; }
.danger-summary p { margin:6px 0 0; color:#6f3b37; line-height:1.5; }
.delete-agreement-modal { width:min(620px,94vw); }
.signature-link-actions.simplified { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:end; width:100%; padding:11px; border:1px solid #e2deef; border-radius:11px; background:#faf9fd; }
.signature-contact { display:grid; gap:5px; min-width:0; }
.signature-contact small { color:var(--muted); }
.signature-url { color:#5943ac; font-size:12px; font-weight:700; overflow-wrap:anywhere; word-break:break-word; }
.signature-contact a { color:#5943ac; }

@media (max-width:760px) {
  .workflow-step,.workflow-step.upload-step,.upload-instructions article { grid-template-columns:34px minmax(0,1fr); }
  .workflow-step > .btn,.upload-instructions article > .btn,.workflow-step .document-dropzone { grid-column:1 / -1; width:100%; }
  .catalog-lock-card,.document-identity-card,.vacancy-fields-grid { grid-template-columns:1fr; }
  .vacancy-fields-grid .span-2 { grid-column:span 1; }
  .signature-link-actions.simplified { grid-template-columns:1fr; align-items:stretch; }
  .signature-link-actions.simplified .btn { width:100%; }
}

.catalog-scope-note { margin: 14px 0 4px; border: 1px solid var(--border); background: #f7f7fb; border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.catalog-scope-note.exclusive { border-color: #d7c76d; background: #fffbea; }
.catalog-scope-note strong { font-size: .9rem; }
.catalog-scope-note small { color: var(--muted); }
