/* ── Assinaturas Premium CSS ── */

/* Page Header */
.sig-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px
}

.btn-new-doc {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 24px var(--primary-glow);
  white-space: nowrap
}

.btn-new-doc:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--primary-glow);
  filter: brightness(1.1)
}

/* Stats */
.sig-stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px
}

.sig-stat-card {
  flex: 1;
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all .3s
}

.sig-stat-card:hover {
  border-color: rgba(99, 102, 241, .25);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .2)
}

.sig-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.pending-icon {
  background: rgba(251, 191, 36, .12);
  color: #fbbf24
}

.signed-icon {
  background: rgba(16, 185, 129, .12);
  color: #10b981
}

.total-icon {
  background: rgba(99, 102, 241, .12);
  color: #818cf8
}

.sig-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  display: block;
  line-height: 1
}

.sig-stat-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em
}

/* Filter Chips */
.sig-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px
}

.sig-section-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text)
}

.sig-filter-chips {
  display: flex;
  gap: 6px
}

.sig-filter {
  padding: 7px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s
}

.sig-filter:hover {
  border-color: rgba(255, 255, 255, .15);
  color: var(--text-light)
}

.sig-filter.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff
}

/* Documents Grid */
.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px
}

.doc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  transition: all .3s cubic-bezier(.4, 0, .2, 1);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: fadeSlideIn .4s ease both
}

.doc-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: opacity .3s
}

.doc-card:hover {
  border-color: rgba(99, 102, 241, .3);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .3)
}

.doc-card:hover::before {
  opacity: 1
}

.doc-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px
}

.doc-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(99, 102, 241, .1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #818cf8;
  flex-shrink: 0
}

.doc-card-title {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px
}

.doc-card-date {
  font-size: .7rem;
  color: var(--text-muted)
}

.doc-card-signers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0
}

.doc-signer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  color: var(--text-light)
}

.doc-signer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0
}

.doc-signer-status {
  margin-left: auto;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px
}

.doc-signer-status.pending {
  background: rgba(251, 191, 36, .12);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, .2)
}

.doc-signer-status.signed {
  background: rgba(16, 185, 129, .12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, .2)
}

/* Signer name — truncate if long */
.doc-signer-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--text-light)
}

/* ── Premium Copy-Link Button ── */
.btn-copy-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, .35);
  background: rgba(99, 102, 241, .08);
  color: #818cf8;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .2s, border-color .2s, color .2s, transform .15s, box-shadow .2s;
  letter-spacing: .01em
}

.btn-copy-link:hover {
  background: rgba(99, 102, 241, .18);
  border-color: rgba(99, 102, 241, .6);
  color: #a5b4fc;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(99, 102, 241, .25)
}

.btn-copy-link:active {
  transform: translateY(0);
  box-shadow: none
}

/* Copied state — green pulse */
.btn-copy-link.copied {
  background: rgba(16, 185, 129, .12);
  border-color: rgba(16, 185, 129, .45);
  color: #34d399;
  animation: copyPulse .4s ease
}

@keyframes copyPulse {
  0%   { transform: scale(1) }
  40%  { transform: scale(1.08) }
  100% { transform: scale(1) }
}

/* Signed inline badge (replaces copy button) */
.doc-signer-signed-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(16, 185, 129, .1);
  border: 1px solid rgba(16, 185, 129, .25);
  color: #34d399;
  font-size: .7rem;
  font-weight: 700;
  flex-shrink: 0
}

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, .05)
}

.doc-card-badge {
  font-size: .68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 7px;
  text-transform: uppercase;
  letter-spacing: .05em
}

.doc-card-badge.pendente {
  background: rgba(251, 191, 36, .1);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, .2)
}

.doc-card-badge.assinado {
  background: rgba(16, 185, 129, .1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, .2)
}

.doc-card-badge.expirado {
  background: rgba(244, 63, 94, .1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, .2)
}

.doc-card-actions {
  display: flex;
  gap: 6px
}

.doc-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.doc-action-btn:hover {
  background: rgba(99, 102, 241, .1);
  border-color: rgba(99, 102, 241, .3);
  color: #818cf8
}

/* Empty State */
.sig-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted)
}

.sig-empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: rgba(99, 102, 241, .08);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted)
}

.sig-empty-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 6px
}

.sig-empty-desc {
  font-size: .85rem;
  color: var(--text-muted);
  max-width: 360px;
  margin: 0 auto
}

.sig-empty-state-small {
  color: var(--text-muted);
  font-size: .82rem;
  text-align: center;
  padding: 24px 12px;
  border: 2px dashed rgba(255, 255, 255, .06);
  border-radius: 10px
}

/* Steps Indicator */
.sig-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 20px 0
}

.sig-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 10px;
  transition: all .3s
}

.sig-step.active .sig-step-num {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow)
}

.sig-step.active span {
  color: var(--text);
  font-weight: 700
}

.sig-step.done .sig-step-num {
  background: rgba(16, 185, 129, .15);
  color: #10b981;
  border-color: rgba(16, 185, 129, .3)
}

.sig-step-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: all .3s
}

.sig-step span {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all .3s
}

.sig-step-line {
  width: 40px;
  height: 2px;
  background: var(--border);
  margin: 0 4px
}

/* Step Content */
.sig-step-content {
  display: none;
  animation: fadeSlideIn .3s ease both
}

.sig-step-content.active {
  display: block
}

/* Upload Card */
.sig-upload-card,
.sig-signers-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden
}

.sig-upload-card-title {
  font-size: .75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px
}

.sig-card-desc {
  font-size: .85rem;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.5
}

/* Drop Zone */
.sig-drop-zone {
  padding: 48px 24px;
  border: 2px dashed rgba(255, 255, 255, .1);
  border-radius: 14px;
  text-align: center;
  cursor: pointer;
  transition: all .3s;
  position: relative
}

.sig-drop-zone:hover,
.sig-drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, .04)
}

.sig-drop-zone.dragover {
  box-shadow: inset 0 0 30px rgba(99, 102, 241, .08)
}

.sig-drop-icon {
  margin-bottom: 16px;
  color: var(--text-muted);
  transition: all .3s
}

.sig-drop-zone:hover .sig-drop-icon {
  color: var(--primary);
  transform: translateY(-4px)
}

.sig-drop-text {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 6px
}

.sig-drop-link {
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer
}

.sig-drop-hint {
  font-size: .78rem;
  color: var(--text-muted)
}

/* File Info */
.sig-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(16, 185, 129, .06);
  border: 1px solid rgba(16, 185, 129, .2);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 16px
}

.sig-file-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(16, 185, 129, .12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0
}

.sig-file-details {
  flex: 1;
  min-width: 0
}

.sig-file-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.sig-file-size {
  font-size: .72rem;
  color: var(--text-muted)
}

.sig-file-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(244, 63, 94, .2);
  background: rgba(244, 63, 94, .06);
  color: #fb7185;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0
}

.sig-file-remove:hover {
  background: rgba(244, 63, 94, .15);
  border-color: rgba(244, 63, 94, .4)
}

/* Action Buttons */
.sig-upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px
}

.btn-sig-cancel {
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  color: var(--text-light);
  padding: 11px 22px;
  border-radius: 11px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px
}

.btn-sig-cancel:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .15)
}

.btn-sig-next {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 11px 24px;
  border-radius: 11px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px var(--primary-glow)
}

.btn-sig-next:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 8px 24px var(--primary-glow)
}

.btn-sig-next:disabled,
.btn-sig-finish:disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none
}

.btn-sig-finish {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 11px;
  font-family: inherit;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .3s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(16, 185, 129, .3);
  width: 100%
}

.btn-sig-finish:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 8px 24px rgba(16, 185, 129, .4)
}

/* Signer Form */
.sig-add-signer-form {
  background: rgba(0, 0, 0, .15);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px
}

.sig-form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px
}

.sig-form-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0
}

.sig-form-group label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .06em
}

.sig-form-group input,
.sig-form-group select {
  width: 100%;
  background: rgba(6, 12, 26, .5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: .84rem;
  font-weight: 500;
  transition: all .2s
}

.sig-form-group input:focus,
.sig-form-group select:focus {
  outline: none;
  border-color: rgba(99, 102, 241, .5);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .1)
}

.sig-form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px
}

.sig-form-group select option {
  background: #0f172a;
  color: var(--text)
}

.sig-form-check-group {
  justify-content: flex-end
}

.sig-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .82rem;
  color: var(--text-light);
  cursor: pointer;
  padding-top: 18px
}

.sig-checkbox-label input {
  display: none
}

.sig-checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0
}

.sig-checkbox-label input:checked+.sig-checkmark {
  background: var(--primary);
  border-color: var(--primary)
}

.sig-checkbox-label input:checked+.sig-checkmark::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  font-weight: bold
}

.btn-add-signer {
  background: rgba(99, 102, 241, .1);
  border: 1px solid rgba(99, 102, 241, .25);
  color: #818cf8;
  padding: 9px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  gap: 6px
}

.btn-add-signer:hover {
  background: rgba(99, 102, 241, .18);
  border-color: rgba(99, 102, 241, .4)
}

/* Signer Card */
.sig-signer-card {
  background: rgba(0, 0, 0, .2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all .2s;
  animation: fadeSlideIn .3s ease both
}

.sig-signer-card:hover {
  border-color: rgba(255, 255, 255, .12)
}

.sig-signer-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0
}

.sig-signer-info {
  flex: 1;
  min-width: 0
}

.sig-signer-name {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.sig-signer-meta {
  font-size: .72rem;
  color: var(--text-muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap
}

.sig-signer-role {
  background: rgba(99, 102, 241, .1);
  color: #818cf8;
  padding: 1px 8px;
  border-radius: 5px;
  font-weight: 700;
  font-size: .65rem;
  text-transform: uppercase
}

.sig-signer-remove {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0
}

.sig-signer-remove:hover {
  background: rgba(244, 63, 94, .1);
  border-color: rgba(244, 63, 94, .3);
  color: #fb7185
}

.sig-signers-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px
}

/* Step 3: Position Layout */
.sig-position-layout {
  display: flex;
  gap: 20px;
  min-height: 500px
}

.sig-pdf-viewer-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden
}

.sig-pdf-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, .2)
}

.sig-pdf-nav {
  display: flex;
  align-items: center;
  gap: 8px
}

.btn-pdf-nav {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s
}

.btn-pdf-nav:hover {
  background: rgba(99, 102, 241, .1);
  border-color: rgba(99, 102, 241, .3);
  color: #818cf8
}

.sig-page-indicator {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  min-width: 50px;
  text-align: center
}

.sig-pdf-info {
  font-size: .75rem;
  color: var(--text-muted)
}

.sig-pdf-canvas-wrap {
  flex: 1;
  overflow: auto;
  padding: 20px;
  text-align: center;
  background: rgba(0, 0, 0, .15)
}

.sig-pdf-canvas-wrap::-webkit-scrollbar {
  width: 6px;
  height: 6px
}

.sig-pdf-canvas-wrap::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, .3);
  border-radius: 3px
}

/* Position Sidebar */
.sig-position-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px
}

.sig-sidebar-title {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--text-muted)
}

.sig-sidebar-hint {
  font-size: .78rem;
  color: var(--text-light);
  line-height: 1.4;
  margin-bottom: 4px
}

.sig-sidebar-signers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto
}

.sig-sidebar-signer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all .2s
}

.sig-sidebar-signer:hover {
  border-color: rgba(255, 255, 255, .12)
}

.sig-sidebar-signer-info {
  flex: 1;
  min-width: 0
}

.sig-sidebar-signer-name {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.sig-sidebar-signer-markers {
  font-size: .68rem;
  color: var(--text-muted)
}

.btn-add-marker {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid rgba(99, 102, 241, .25);
  background: rgba(99, 102, 241, .08);
  color: #818cf8;
  font-family: inherit;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap
}

.btn-add-marker:hover {
  background: rgba(99, 102, 241, .18);
  border-color: rgba(99, 102, 241, .4)
}

.sig-sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto
}

/* Signature Markers */
.signer-marker {
  position: absolute;
  border: 2px dashed;
  cursor: grab;
  border-radius: 6px;
  pointer-events: auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  user-select: none;
  transition: box-shadow .2s
}

.signer-marker:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3)
}

.signer-marker:active {
  cursor: grabbing
}

.signer-marker .resize-handle {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--primary);
  cursor: se-resize;
  border-radius: 50%
}

.signer-marker .remove-marker {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ef4444;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(0, 0, 0, .3);
  transition: transform .15s
}

.signer-marker .remove-marker:hover {
  transform: scale(1.15)
}

/* Toast */
.sig-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px
}

.sig-toast {
  padding: 14px 20px;
  border-radius: 12px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .4s ease both;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
  backdrop-filter: blur(12px);
  max-width: 360px
}

.sig-toast.success {
  background: rgba(16, 185, 129, .9);
  border: 1px solid rgba(16, 185, 129, .4)
}

.sig-toast.error {
  background: rgba(239, 68, 68, .9);
  border: 1px solid rgba(239, 68, 68, .4)
}

.sig-toast.info {
  background: rgba(99, 102, 241, .9);
  border: 1px solid rgba(99, 102, 241, .4)
}

.sig-toast.out {
  animation: toastOut .3s ease both
}

/* Animations */
@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateX(40px)
  }
}

/* Responsive */
@media(max-width:900px) {
  .sig-position-layout {
    flex-direction: column
  }

  .sig-position-sidebar {
    width: 100%
  }

  .sig-steps {
    flex-wrap: wrap;
    gap: 4px
  }

  .sig-step-line {
    width: 20px
  }
}

@media(max-width:640px) {
  .sig-form-row {
    flex-direction: column
  }

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

  .sig-stats {
    flex-direction: column
  }

  .sig-page-header {
    flex-direction: column
  }
}

/* ── Signer Actions Container ── */
.doc-signer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.btn-edit-signer {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-edit-signer:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.3);
  color: #818cf8;
}

/* ── Edit Modal ── */
.sig-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.sig-modal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.sig-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sig-modal-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sig-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.sig-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.sig-modal-body {
  padding: 24px;
}

.sig-modal-footer {
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}