/* ─────────────────────────────────────────────────────────────
   Simpp Sign — preparador de envelope (visualizador + marcação)
   Fase 1: UI-first. Backend de envio/assinatura entra depois.
   ───────────────────────────────────────────────────────────── */

.asse-overlay {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: none;
  flex-direction: column;
  background: var(--bg);
}
.asse-overlay.on { display: flex; }

/* ── Cabeçalho do preparador ─────────────────────────────── */
.asse-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.asse-top .asse-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.asse-top .asse-title strong {
  font-size: 15px;
  color: var(--text);
  line-height: 1.2;
}
.asse-top .asse-title span {
  font-size: 12px;
  color: var(--text3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asse-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}
.asse-steps .step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text3);
}
.asse-steps .step .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}
.asse-steps .step.active { color: var(--accent); }
.asse-steps .step.active .num {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.asse-steps .step.done { color: var(--green); }
.asse-steps .step.done .num {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.asse-steps .sep {
  width: 26px;
  height: 1.5px;
  background: var(--border2);
}
.asse-top .asse-close {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.asse-top .asse-close:hover { background: var(--surface3); color: var(--text); }

/* ── Corpo ───────────────────────────────────────────────── */
.asse-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.asse-pane {
  width: 340px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  padding: 22px 22px 40px;
}
.asse-stage {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  background: var(--surface2);
  padding: 28px 0 80px;
}

.asse-pane h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin: 0 0 12px;
}
.asse-pane h3:not(:first-child) { margin-top: 26px; }

.asse-field { margin-bottom: 14px; }
.asse-field label {
  display: block;
  font-size: 12px;
  color: var(--text2);
  margin-bottom: 5px;
}
.asse-field input[type="text"],
.asse-field input[type="email"],
.asse-field input[type="number"] {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.asse-field input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ── Documento ───────────────────────────────────────────── */
.asse-doc-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border2);
  border-radius: 10px;
  cursor: pointer;
  margin-bottom: 8px;
}
.asse-doc-opt.sel {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.asse-doc-opt input { margin-top: 2px; }
.asse-doc-opt > span { display: block; }
.asse-doc-opt .d-t { display: block; font-size: 13px; color: var(--text); font-weight: 500; }
.asse-doc-opt .d-s { display: block; font-size: 11.5px; color: var(--text3); margin-top: 2px; }

/* ── Signatários ─────────────────────────────────────────── */
.asse-signer {
  border: 1px solid var(--border2);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
}
.asse-signer .s-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.asse-signer .s-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.asse-signer .s-idx {
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
}
.asse-signer .s-del {
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text3);
  cursor: pointer;
  padding: 2px;
  font-size: 15px;
}
.asse-signer .s-del:hover { color: var(--red); }
.asse-add-signer {
  width: 100%;
  padding: 9px;
  border: 1.5px dashed var(--border2);
  border-radius: 9px;
  background: none;
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.asse-add-signer:hover { border-color: var(--accent); color: var(--accent); }

/* ── Paleta de campos (passo 2) ──────────────────────────── */
.asse-signer-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.asse-signer-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border2);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
}
.asse-signer-tab .s-dot { width: 9px; height: 9px; border-radius: 50%; }
.asse-signer-tab.active { border-color: currentColor; }

.asse-palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border2);
  border-radius: 9px;
  background: var(--surface);
  cursor: grab;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text);
  user-select: none;
}
.asse-palette-item:active { cursor: grabbing; }
.asse-palette-item i { font-size: 17px; color: var(--text3); }
.asse-palette-item .p-hint {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text3);
}

.asse-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text3);
  background: var(--surface2);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
}

/* ── Palco / páginas do PDF ──────────────────────────────── */
.asse-page-wrap {
  position: relative;
  margin: 0 auto 20px;
  box-shadow: var(--shadow);
  background: #fff;
  line-height: 0;
}
.asse-page-wrap canvas { display: block; }
.asse-page-layer {
  position: absolute;
  inset: 0;
  line-height: normal;
}
.asse-page-wrap.drop-ready .asse-page-layer {
  background: rgba(79,110,247,0.06);
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.asse-page-num {
  position: absolute;
  top: 6px;
  left: -46px;
  font-size: 11px;
  color: var(--text3);
  font-variant-numeric: tabular-nums;
}

/* ── Caixa de campo colocada ─────────────────────────────── */
.asse-fbox {
  position: absolute;
  border: 1.5px solid;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  cursor: move;
  box-sizing: border-box;
  overflow: hidden;
  min-width: 44px;
  min-height: 22px;
}
.asse-fbox .fb-label {
  pointer-events: none;
  padding: 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.asse-fbox .fb-del {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: 2px solid var(--surface2);
  font-size: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.asse-fbox:hover .fb-del { display: flex; }
.asse-fbox .fb-resize {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #fff;
  border: 1.5px solid currentColor;
  cursor: nwse-resize;
  display: none;
}
.asse-fbox:hover .fb-resize { display: block; }
.asse-fbox.readonly { cursor: default; }
.asse-fbox.readonly .fb-del,
.asse-fbox.readonly .fb-resize { display: none !important; }

/* ── Rodapé com ações ────────────────────────────────────── */
.asse-foot {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.asse-foot .spacer { flex: 1; }
.asse-foot .asse-err {
  font-size: 12px;
  color: var(--red);
  margin-right: 8px;
}
.asse-btn {
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.asse-btn:hover { background: var(--surface2); }
.asse-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.asse-btn.primary:hover { background: var(--accent-d); }
.asse-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Passo 3: revisão ────────────────────────────────────── */
.asse-review {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 24px;
}
.asse-review h2 {
  font-family: inherit;
  font-size: 19px;
  color: var(--text);
  margin: 0 0 4px;
}
.asse-review .r-dek {
  font-size: 13px;
  color: var(--text3);
  margin: 0 0 22px;
}
.asse-rcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.asse-rcard .rc-t {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text3);
  margin-bottom: 10px;
}
.asse-rrow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 13px;
}
.asse-rrow .k { color: var(--text3); }
.asse-rrow .v { color: var(--text); text-align: right; word-break: break-word; }
.asse-rrow .v.mono {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11.5px;
}
.asse-payload {
  background: #10182c;
  color: #d7deee;
  border-radius: 10px;
  padding: 14px 16px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 11.5px;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre;
  margin-top: 6px;
}

/* ── Loading ─────────────────────────────────────────────── */
.asse-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--text3);
  font-size: 13px;
}
.asse-spin {
  width: 26px;
  height: 26px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: asse-spin 0.7s linear infinite;
}
@keyframes asse-spin { to { transform: rotate(360deg); } }

@media (max-width: 860px) {
  .asse-body { flex-direction: column; }
  .asse-pane {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40%;
  }
  .asse-steps .step span:not(.num) { display: none; }
}

/* ─────────────────────────────────────────────────────────────
   Central "Assinatura eletrônica" (menu próprio)
   ───────────────────────────────────────────────────────────── */
.asc-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 20px;
}
.asc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.asc-chip {
  border: 1px solid var(--border2);
  background: var(--surface);
  color: var(--text2);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 20px;
  cursor: pointer;
}
.asc-chip:hover { border-color: var(--accent); }
.asc-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.asc-chip span {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 0 6px;
  margin-left: 4px;
  font-size: 11px;
}
.asc-chip:not(.on) span { background: var(--surface3); color: var(--text3); }
.asc-busca {
  flex: 1;
  min-width: 200px;
  padding: 9px 13px;
  border: 1px solid var(--border2);
  border-radius: 9px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
}
.asc-busca:focus { outline: none; border-color: var(--accent); }

.asc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.asc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 17px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.asc-card:hover { border-color: var(--border2); box-shadow: var(--shadow-sm); }
.asc-card-top { display: flex; justify-content: space-between; align-items: center; }
.asc-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.asc-date { font-size: 12px; color: var(--text3); }
.asc-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.asc-card-sub { font-size: 12.5px; color: var(--text3); }
.asc-progress {
  height: 5px;
  border-radius: 3px;
  background: var(--surface3);
  overflow: hidden;
  margin-top: 2px;
}
.asc-progress-bar { height: 100%; background: var(--green); border-radius: 3px; transition: width .3s; }
.asc-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text2);
}
.asc-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
}
.asc-tag.amber { background: var(--amber-bg); color: var(--amber); }

.asc-vazio {
  text-align: center;
  padding: 60px 20px;
  color: var(--text3);
}
.asc-vazio i { font-size: 34px; opacity: .5; }
.asc-vazio p { margin: 12px 0 4px; font-size: 15px; color: var(--text2); font-weight: 600; }
.asc-vazio span { font-size: 13px; }

/* ── drawer de detalhe ─────────────────────────────────── */
.asc-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 3800;
  background: rgba(20, 30, 50, 0.4);
  display: none;
  justify-content: flex-end;
}
.asc-drawer-overlay.on { display: flex; }
.asc-drawer {
  width: 460px;
  max-width: 92vw;
  height: 100%;
  background: var(--bg);
  overflow-y: auto;
  padding: 22px 24px 60px;
  box-shadow: -8px 0 30px rgba(0, 0, 0, .12);
}
.asc-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.asc-drawer-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 7px; line-height: 1.3; }
.asc-drawer-cli { font-size: 13px; color: var(--text2); margin-bottom: 18px; }
.asc-drawer-cli b { color: var(--text); }
.asc-drawer-sec { margin-top: 20px; }
.asc-drawer-sec h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text3);
  margin: 0 0 12px;
}
.asc-sig-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.asc-sig-row:first-of-type { border-top: none; }
.asc-sig-nome { font-size: 13.5px; font-weight: 600; color: var(--text); }
.asc-sig-mail { font-size: 12px; color: var(--text3); }
.asc-sig-st {
  font-size: 12.5px;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.asc-sig-st span { display: block; font-size: 11px; font-weight: 400; color: var(--text3); }
.asc-drawer-acoes { margin-top: 18px; display: flex; flex-direction: column; gap: 9px; }
.asc-drawer-acoes .asse-btn { width: 100%; }

.asc-tl { display: flex; flex-direction: column; }
.asc-tl-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  position: relative;
  padding-bottom: 16px;
}
.asc-tl-item::before {
  content: '';
  position: absolute;
  left: 13.5px;
  top: 26px;
  bottom: 0;
  width: 1.5px;
  background: var(--border);
}
.asc-tl-item:last-child { padding-bottom: 0; }
.asc-tl-item:last-child::before { display: none; }
.asc-tl-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1.5px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  font-size: 14px;
  z-index: 1;
}
.asc-tl-txt { font-size: 13px; color: var(--text); }
.asc-tl-meta { font-size: 11.5px; color: var(--text3); margin-top: 2px; }

@media (max-width: 620px) {
  .asc-grid { grid-template-columns: 1fr; }
}
