@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #f2f0eb;
  --card: #ffffff;
  --navy: #1c3557;
  --navy-light: #254870;
  --gold: #c9973a;
  --gold-light: #f0c97a;
  --border: #e0ddd6;
  --text: #1a1a1a;
  --text-mid: #4a4a4a;
  --text-light: #888880;
  --success: #2d6a4f;
  --danger: #c0392b;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow: 0 2px 12px rgba(0,0,0,0.09), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ─── NAV ─────────────────────────────────────── */
.topnav {
  background: var(--navy);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.topnav-brand {
  font-family: var(--font-display);
  font-size: 17px;
  color: #fff;
  letter-spacing: 0.01em;
}

.topnav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topnav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 6px;
  transition: all 0.15s;
}

.topnav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.topnav-link.active { color: #fff; background: rgba(255,255,255,0.15); }

.topnav-link.config-link {
  color: var(--gold-light);
  border: 1px solid rgba(201,151,58,0.4);
}
.topnav-link.config-link:hover {
  background: rgba(201,151,58,0.15);
  color: var(--gold-light);
}

/* ─── LAYOUT ──────────────────────────────────── */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

.page-wide {
  max-width: 1140px;
  margin: 0 auto;
  padding: 36px 24px 60px;
}

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
}

.page-header p {
  color: var(--text-light);
  font-size: 14px;
}

/* ─── CARDS ───────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 28px;
  margin-bottom: 18px;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.step-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-badge.done {
  background: var(--success);
}

.card-header h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--navy);
}

/* ─── INFO BANNER ─────────────────────────────── */
.info-banner {
  background: linear-gradient(135deg, #1c3557 0%, #254870 100%);
  color: white;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
}

.info-banner-text h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
}

.info-banner-text p {
  font-size: 13px;
  color: rgba(255,255,255,0.75);
}

.info-banner-icon {
  font-size: 28px;
  flex-shrink: 0;
}

/* ─── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--navy);
  color: white;
}
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(28,53,87,0.3); }

.btn-gold {
  background: var(--gold);
  color: white;
}
.btn-gold:hover { background: #b8862f; transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-mid);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }

.btn-ghost {
  background: transparent;
  color: var(--text-mid);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--bg); color: var(--navy); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.85; }

.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 14px 32px; font-size: 15px; width: 100%; justify-content: center; }

.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ─── WORKFLOW BUTTONS ────────────────────────── */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.workflow-card {
  padding: 20px 18px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  font-family: var(--font-body);
}

.workflow-card:hover {
  border-color: var(--navy);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.workflow-card.active {
  border-color: var(--navy);
  background: var(--navy);
  color: white;
}

.workflow-card-icon {
  font-size: 22px;
  margin-bottom: 8px;
  display: block;
}

.workflow-card-name {
  font-size: 14px;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.workflow-card-desc {
  font-size: 12px;
  color: var(--text-light);
}

.workflow-card.active .workflow-card-desc {
  color: rgba(255,255,255,0.65);
}

/* ─── FORM FIELDS ─────────────────────────────── */
.field-group {
  margin-bottom: 16px;
}

.field-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  background: #fefefe;
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(28,53,87,0.1);
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* ─── DOCUMENT CHECKBOXES ─────────────────────── */
.document-item {
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.document-item:has(.doc-checkbox:checked) {
  border-color: var(--navy);
  background: #fafcff;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.doc-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
  flex-shrink: 0;
  cursor: pointer;
}

.checkbox-row label {
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 0;
}

.extra-field {
  margin-top: 12px;
  padding-left: 28px;
}

.extra-field label {
  color: var(--text-light);
  font-size: 12px;
}

/* ─── RESULT BOX ──────────────────────────────── */
.result-box {
  background: #f0f4f9;
  border: 1.5px solid #c8d8ea;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.result-url-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.result-box input[type="text"] {
  flex: 1;
  background: white;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: var(--navy);
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── SIGNATURE PAGE ──────────────────────────── */
.sign-page {
  background: #1a1f2e;
  min-height: 100vh;
}

.sign-topnav {
  background: rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding: 0 32px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sign-topnav-brand {
  font-family: var(--font-display);
  color: rgba(255,255,255,0.9);
  font-size: 16px;
}

.sign-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

.sign-docs-list {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.sign-docs-list h3 {
  font-family: var(--font-display);
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.sign-docs-list ul {
  list-style: none;
}

.sign-docs-list li {
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  gap: 8px;
}

.sign-docs-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.sign-docs-list li:last-child { border-bottom: none; }

.sign-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.sign-field-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.sign-field-group input {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  color: white;
  border-radius: var(--radius-sm);
}

.sign-field-group input::placeholder { color: rgba(255,255,255,0.3); }
.sign-field-group input:focus {
  outline: none;
  border-color: var(--gold-light);
  box-shadow: 0 0 0 3px rgba(201,151,58,0.2);
  background: rgba(255,255,255,0.12);
}

/* ── Sign Page – PDF Preview ───────────────── */

.sign-preview-area {
  margin-bottom: 32px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  padding: 20px;
}

.sign-preview-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: white;
  margin-bottom: 4px;
}

.sign-preview-hint {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 14px;
}

.sign-preview-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.sign-preview-btn {
  color: rgba(255,255,255,0.6) !important;
  border-color: rgba(255,255,255,0.15) !important;
}

.sign-preview-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.sign-pdf-canvas-wrap {
  position: relative;
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  min-height: 200px;
}

.sign-pdf-canvas-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
}

.sign-pdf-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #888;
  background: #f4f4f4;
}

/* ── Sign Page – Signature Canvas ─────────── */

.sign-canvas-area {
  margin-bottom: 28px;
}

.sign-canvas-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.canvas-wrapper {
  background: white;
  border-radius: var(--radius);
  height: 220px;
  position: relative;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

.canvas-wrapper canvas {
  display: block;
  border-radius: var(--radius);
  width: 100%;
  height: 100%;
}

.canvas-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #c8c8c8;
  font-size: 13px;
  pointer-events: none;
  transition: opacity 0.2s;
}

.canvas-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-sign {
  background: linear-gradient(135deg, var(--gold), #b8862f);
  color: white;
  font-size: 15px;
  padding: 16px 32px;
  width: 100%;
  justify-content: center;
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(201,151,58,0.35);
  font-weight: 700;
  letter-spacing: 0.01em;
}

.btn-sign:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,151,58,0.45);
}

/* Success state */
.success-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
}

.success-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(45,106,79,0.2);
  border: 2px solid rgba(45,106,79,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 20px;
}

.success-card h2 {
  font-family: var(--font-display);
  font-size: 22px;
  color: white;
  margin-bottom: 8px;
}

.success-card p {
  color: rgba(255,255,255,0.6);
  font-size: 14px;
  margin-bottom: 28px;
}

.download-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.download-btn-main {
  background: var(--gold);
  color: white;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 600;
  font-size: 13.5px;
  text-align: center;
  display: block;
  transition: all 0.15s;
}

.download-btn-main:hover { background: #b8862f; transform: translateY(-1px); }

.download-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  text-align: center;
  display: block;
  transition: all 0.15s;
}

.download-btn-secondary:hover { background: rgba(255,255,255,0.14); }

.individual-downloads-title {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.individual-downloads-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

/* ─── CONFIG TOOL ─────────────────────────────── */
.config-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  align-items: start;
}

.config-sidebar {
  position: sticky;
  top: 76px;
}

.config-sidebar .card {
  padding: 20px;
}

.config-sidebar h2 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.workflow-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.workflow-nav-btn {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  color: var(--text-mid);
}

.workflow-nav-btn:hover { border-color: var(--navy); color: var(--navy); }
.workflow-nav-btn.active { border-color: var(--navy); background: var(--navy); color: white; }

.doc-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  max-height: 280px;
  overflow-y: auto;
}

.doc-nav-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-mid);
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
}

.doc-nav-item:hover { background: var(--bg); color: var(--navy); }
.doc-nav-item.active { background: #eef2f8; border-color: #c5d3e8; color: var(--navy); font-weight: 600; }

.doc-nav-item-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}

.doc-nav-item.active .doc-nav-item-dot { background: var(--navy); }
.doc-nav-item.has-pdf .doc-nav-item-dot { background: var(--success); }

.sidebar-save-btn {
  width: 100%;
  margin-top: 4px;
}

.config-main .card {
  padding: 24px;
}

.config-main h2 {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--navy);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.config-toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.config-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.mode-btn {
  padding: 5px 12px;
  font-size: 12.5px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.12s;
  color: var(--text-mid);
}

.mode-btn:hover { border-color: var(--navy); color: var(--navy); }

.mode-btn.active[data-mode="signature"] { background: #1c3557; color: white; border-color: #1c3557; }
.mode-btn.active[data-mode="text"]      { background: #2d6a4f; color: white; border-color: #2d6a4f; }
.mode-btn.active[data-mode="date"]      { background: #92400e; color: white; border-color: #92400e; }
.mode-btn.active[data-mode="location"]  { background: #6b21a8; color: white; border-color: #6b21a8; }

.config-page-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-light);
}

.pdf-canvas-container {
  position: relative;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #9a9a9a;
  cursor: crosshair;
  min-height: 400px;
}

.pdf-canvas-container canvas {
  display: block;
  max-width: 100%;
}

.pdf-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 400px;
  color: #bbb;
  gap: 10px;
  font-size: 14px;
}

.pdf-placeholder-icon { font-size: 40px; }

#overlay-container {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}

.position-marker {
  position: absolute;
  border: 2px dashed;
  pointer-events: auto;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  transition: opacity 0.15s;
}
.position-marker:hover { opacity: 0.7; }

.position-marker.signature { border-color: #1c3557; background: rgba(28,53,87,0.25); }
.position-marker.text      { border-color: #2d6a4f; background: rgba(45,106,79,0.25); }
.position-marker.date      { border-color: #92400e; background: rgba(146,64,14,0.25); }
.position-marker.location  { border-color: #6b21a8; background: rgba(107,33,168,0.25); }

.positions-panel {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 14px;
}

.positions-panel h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  margin-bottom: 10px;
}

.positions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.position-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: white;
  border-radius: var(--radius-sm);
  font-size: 13px;
  border: 1px solid var(--border);
}

.position-item-type {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.position-item-type.signature { background: #1c3557; }
.position-item-type.text      { background: #2d6a4f; }
.position-item-type.date      { background: #92400e; }
.position-item-type.location  { background: #6b21a8; }

.position-item-label { flex: 1; color: var(--text-mid); }
.position-item-del {
  padding: 2px 6px;
  font-size: 11px;
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-light);
  font-family: var(--font-body);
}
.position-item-del:hover { border-color: var(--danger); color: var(--danger); }

.positions-empty {
  color: var(--text-light);
  font-size: 13px;
  text-align: center;
  padding: 12px;
}

.file-upload-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.file-upload-row select { flex: 1; }

.file-label-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--text-mid);
  transition: all 0.15s;
  background: white;
}

.file-label-btn:hover { border-color: var(--navy); color: var(--navy); }

/* ─── DROP ZONE ───────────────────────────────── */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fafaf8;
  position: relative;
}

.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--navy);
  background: #eef2f8;
}

.drop-zone.dragover {
  transform: scale(1.01);
  box-shadow: 0 0 0 3px rgba(28,53,87,0.12);
}

.drop-zone-icon {
  font-size: 28px;
  margin-bottom: 8px;
  line-height: 1;
}

.drop-zone-text {
  font-size: 14px;
  color: var(--text-mid);
  margin-bottom: 4px;
}

.drop-zone-link {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.drop-zone-sub {
  font-size: 12px;
  color: var(--text-light);
}

.drop-zone-filename {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  background: #e8f0fb;
  border-radius: 20px;
  padding: 4px 14px;
  display: inline-block;
}

.drop-zone.has-file {
  border-color: var(--success);
  background: #f0faf5;
}

.drop-zone.uploading {
  border-color: var(--gold);
  background: #fdf8ee;
  pointer-events: none;
}

.hidden-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
}

.config-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ─── SAVE TOAST ──────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transform: translateY(80px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1000;
}

.toast.success { background: var(--success); color: white; }
.toast.error   { background: var(--danger); color: white; }
.toast.show    { transform: translateY(0); opacity: 1; }

/* ─── SECTION HEADER BADGE ────────────────────── */
.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #eef2f8;
  border: 1px solid #c5d3e8;
  color: var(--navy);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* ─── MISC ────────────────────────────────────── */
.hidden { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.text-muted { color: var(--text-light); font-size: 13px; }

@media (max-width: 720px) {
  .config-layout { grid-template-columns: 1fr; }
  .config-sidebar { position: static; }
  .sign-fields-row { grid-template-columns: 1fr; }
  .download-grid { grid-template-columns: 1fr; }
  .topnav { padding: 0 16px; }
  .page, .page-wide { padding: 20px 16px 48px; }
}

/* ─── ARCHIVE PAGE ────────────────────────────── */

.archive-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-mid);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--navy);
  color: white;
  border-color: var(--navy);
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.archive-table thead th {
  padding: 10px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-light);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.archive-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}

.archive-table tbody tr:last-child { border-bottom: none; }
.archive-table tbody tr:hover { background: var(--bg-alt); }

.archive-table td {
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--text-dark);
}

.archive-date { color: var(--text-mid); font-size: 12px; white-space: nowrap; }
.archive-firm { font-weight: 600; }
.archive-user { color: var(--text-light); font-size: 12px; }

.archive-docs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}

.doc-chip {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(28,53,87,0.08);
  color: var(--navy);
  border-radius: 20px;
  font-size: 11px;
  white-space: nowrap;
}

.workflow-chip {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(201,151,58,0.12);
  color: var(--gold);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-signed {
  background: rgba(34,197,94,0.1);
  color: #16a34a;
}

.status-pending {
  background: rgba(234,179,8,0.1);
  color: #ca8a04;
}

.archive-dl-btns {
  display: flex;
  gap: 6px;
}

.btn-xs {
  padding: 4px 10px !important;
  font-size: 11px !important;
}

.archive-empty {
  padding: 64px 32px;
  text-align: center;
  color: var(--text-light);
  font-size: 14px;
}
