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

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --primary:        #DF2626;
  --primary-dark:   #9c1a1a;
  --primary-xdark:  #7a1515;
  --primary-light:  rgba(223,38,38,0.10);
  --primary-border: rgba(223,38,38,0.28);
  --success:        #276749;
  --success-bg:     #f0fff4;
  --success-bd:     #9ae6b4;
  --danger:         #c53030;
  --danger-bg:      #fff5f5;
  --danger-bd:      #feb2b2;
  --warn-bg:        #fffbeb;
  --warn-bd:        #f6ad55;
  --info-bg:        #fff8f8;
  --info-bd:        var(--primary-border);
  --info-text:      var(--primary-dark);
  --text:           #333333;
  --text-muted:     #777777;
  --bg:             #f7f5fa;
  --card:           #ffffff;
  --border:         #e4e0e8;
  --radius:         10px;
  --radius-sm:      6px;
  --shadow:         0 1px 3px rgba(0,0,0,.09), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:      0 4px 8px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.05);
  --shadow-lg:      0 10px 25px rgba(0,0,0,.10), 0 4px 10px rgba(0,0,0,.05);
  --transition:     0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Ubuntu', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: 'Teko', 'Segoe UI', sans-serif;
  letter-spacing: .4px;
}

/* ─── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--primary);
  color: #fff;
  padding: 0 2rem;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 10px rgba(223,38,38,0.35);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-family: 'Teko', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  color: #fff;
  text-transform: uppercase;
}

.navbar-brand svg { flex-shrink: 0; }
.navbar-brand img { flex-shrink: 0; filter: brightness(0) invert(1); }
.navbar-links { display: flex; gap: 1rem; }

.navbar-links a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 500;
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.navbar-links a:hover { background: rgba(255,255,255,.15); color: #fff; }

/* ─── Layout ────────────────────────────────────────────────────────────────── */
.page-wrapper      { max-width: 700px;  margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }
.page-wrapper-wide { max-width: 1020px; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

/* ─── Card ──────────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.card-title {
  font-family: 'Teko', sans-serif;
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--primary-dark);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  text-transform: uppercase;
}

/* ─── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .65rem 1.4rem;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'Ubuntu', sans-serif;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #1c4532; }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #9b2c2c; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary); color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover:not(:disabled) { background: var(--bg); color: var(--text); }

.btn-sm  { padding: .4rem 1rem;  font-size: .8125rem; }
.btn-lg  { padding: .85rem 2rem; font-size: 1.0625rem; }
.btn-full { width: 100%; }

/* ─── Form Controls ─────────────────────────────────────────────────────────── */
.form-group  { margin-bottom: 1.2rem; }

.form-label {
  display: block;
  font-size: .875rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: .4rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.form-input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Ubuntu', sans-serif;
  font-size: .9375rem;
  color: var(--text);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-hint { font-size: .8125rem; color: var(--text-muted); margin-top: .3rem; }

/* ─── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  border-left: 4px solid;
  margin-bottom: 1rem;
}
.alert-error   { background: var(--danger-bg); border-color: var(--danger);  color: var(--danger); }
.alert-success { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.alert-info    { background: var(--info-bg); border-color: var(--primary-border); color: var(--primary-dark); }
.alert-warn    { background: var(--warn-bg); border-color: var(--warn-bd);  color: #7b4f00; }

/* ─── Step Wizard ───────────────────────────────────────────────────────────── */
.steps {
  display: flex;
  align-items: center;
  margin-bottom: 2.5rem;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
}

.step-item + .step-item::before {
  content: '';
  position: absolute;
  top: 17px;
  right: 50%;
  left: -50%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step-item.done + .step-item::before { background: var(--primary); }

.step-bubble {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: .875rem;
  position: relative;
  z-index: 1;
  transition: all .3s;
}

.step-item.active .step-bubble { background: var(--primary);       color: #fff; box-shadow: 0 0 0 4px var(--primary-light); }
.step-item.done   .step-bubble { background: var(--primary-dark);  color: #fff; }

.step-label {
  font-size: .7rem;
  color: var(--text-muted);
  margin-top: .35rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.step-item.active .step-label { color: var(--primary); }
.step-item.done   .step-label { color: var(--primary-dark); }

/* ─── OTP Input ─────────────────────────────────────────────────────────────── */
.otp-row {
  display: flex;
  gap: .6rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.otp-digit {
  width: 52px;
  height: 60px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 700;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--primary-dark);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  caret-color: transparent;
  font-family: monospace;
}

.otp-digit:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.otp-digit.filled { border-color: var(--primary-dark); }

/* ─── Contract Display ──────────────────────────────────────────────────────── */
.contract-doc {
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem 2.2rem;
  max-height: 450px;
  overflow-y: auto;
  font-size: .9rem;
  line-height: 1.8;
  color: var(--text);
  scroll-behavior: smooth;
}

.contract-doc::-webkit-scrollbar { width: 6px; }
.contract-doc::-webkit-scrollbar-track { background: var(--bg); }
.contract-doc::-webkit-scrollbar-thumb { background: var(--primary-border); border-radius: 3px; }

.contract-title {
  text-align: center;
  font-family: 'Teko', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--primary);
}

.contract-section { margin-bottom: 1.4rem; }
.contract-section-heading { font-weight: 700; color: var(--primary-dark); margin-bottom: .35rem; }
.contract-section-text    { color: var(--text); white-space: pre-line; }

/* ─── Signature Canvas ──────────────────────────────────────────────────────── */
.sig-canvas-wrap {
  border: 2px dashed var(--primary-border);
  border-radius: var(--radius-sm);
  background: #fff;
  position: relative;
  overflow: hidden;
  cursor: crosshair;
}

.sig-canvas-wrap canvas { display: block; width: 100%; touch-action: none; }

.sig-canvas-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: .875rem;
  pointer-events: none;
  transition: opacity .2s;
}

.sig-tab-bar {
  display: flex;
  margin-bottom: .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.sig-tab {
  flex: 1;
  padding: .55rem;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-family: 'Ubuntu', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition);
}
.sig-tab.active { background: var(--primary); color: #fff; }
.sig-tab:not(:last-child) { border-right: 1.5px solid var(--border); }

.typed-sig-preview {
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 2rem;
  color: var(--primary-dark);
  text-align: center;
  padding: 1.2rem;
  border: 2px dashed var(--primary-border);
  border-radius: var(--radius-sm);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Confirmation / Hero ────────────────────────────────────────────────────── */
.success-hero { text-align: center; padding: 2rem 1rem; }

.success-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success-bg);
  border: 3px solid var(--success-bd);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  animation: pop .4s cubic-bezier(.175,.885,.32,1.275);
}

@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.success-title    { font-family: 'Teko', sans-serif; font-size: 1.8rem; font-weight: 700; color: var(--success); margin-bottom: .5rem; }
.success-subtitle { color: var(--text-muted); font-size: .9375rem; }

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: .55rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--text-muted); font-weight: 600; }
.detail-value { color: var(--text); font-weight: 500; text-align: right; }

/* ─── Admin Dashboard ────────────────────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 1.2rem 1.5rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.stat-card.green  { border-color: var(--success); }
.stat-card.orange { border-color: #e5a000; }

.stat-value { font-family: 'Teko', sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--primary-dark); line-height: 1; }
.stat-card.green  .stat-value { color: var(--success); }
.stat-label { font-size: .8125rem; color: var(--text-muted); margin-top: .25rem; font-weight: 600; }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }

th {
  text-align: left;
  padding: .65rem .9rem;
  background: var(--bg);
  color: var(--text-muted);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1.5px solid var(--border);
}

td { padding: .75rem .9rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tr:hover td { background: #fdf6f6; }
tr:last-child td { border-bottom: none; }

.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1.4;
}
.badge-green  { background: var(--success-bg); color: var(--success); border: 1px solid var(--success-bd); }
.badge-red    { background: var(--info-bg); color: var(--primary-dark); border: 1px solid var(--primary-border); }
.badge-yellow { background: var(--warn-bg); color: #7b4f00; border: 1px solid var(--warn-bd); }
.badge-gray   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ─── Access Link Result Box ─────────────────────────────────────────────────── */
.link-result {
  background: var(--info-bg);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  margin-top: 1rem;
  display: none;
}
.link-result.visible { display: block; }
.link-result-title { font-weight: 700; color: var(--primary-dark); margin-bottom: .75rem; font-size: .875rem; }

.link-copy-row { display: flex; gap: .5rem; align-items: center; margin-bottom: .5rem; }

.link-copy-input {
  flex: 1;
  padding: .5rem .75rem;
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  color: var(--primary-dark);
  background: #fff;
  outline: none;
}

.otp-display {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--primary-dark);
  background: #fff;
  padding: .4rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--primary-border);
  font-family: monospace;
}

/* ─── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-box {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  padding: 2rem;
  position: relative;
  margin: auto;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--text-muted);
  transition: all var(--transition);
}
.modal-close:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary-border); }

.modal-title {
  font-family: 'Teko', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-dark);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 1.25rem;
  padding-right: 2.5rem;
}

/* Signed contract view inside modal */
.signed-contract-view {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  margin-bottom: 1.5rem;
  font-size: .875rem;
  line-height: 1.8;
  max-height: 400px;
  overflow-y: auto;
}
.signed-contract-view::-webkit-scrollbar { width: 5px; }
.signed-contract-view::-webkit-scrollbar-thumb { background: var(--primary-border); border-radius: 3px; }

.sig-block {
  border-top: 2px solid var(--border);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
}
.sig-block-row { display: flex; gap: 2rem; flex-wrap: wrap; }
.sig-block-field { flex: 1; min-width: 200px; }
.sig-block-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin-bottom: .25rem; }
.sig-block-value { font-size: .9375rem; color: var(--text); font-weight: 500; }

.drawn-signature {
  max-width: 280px;
  height: 80px;
  border: 1px solid var(--border);
  border-radius: 4px;
  object-fit: contain;
  background: #fff;
  display: block;
  margin-top: .4rem;
}

.typed-signature-display {
  font-family: 'Georgia', serif;
  font-style: italic;
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-top: .4rem;
  border-bottom: 1.5px solid var(--text);
  display: inline-block;
  padding-bottom: .1rem;
}

/* ─── Misc ───────────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: middle;
}
.spinner-dark { border-color: var(--primary-light); border-top-color: var(--primary); }

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }

.hidden { display: none !important; }

.check-agree {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  background: var(--warn-bg);
  border: 1.5px solid var(--warn-bd);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin: 1.25rem 0;
  cursor: pointer;
}
.check-agree input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; margin-top: .15rem; cursor: pointer; }
.check-agree-text { font-size: .875rem; line-height: 1.5; color: var(--text); }

.scroll-notice { display: flex; align-items: center; gap: .5rem; font-size: .8125rem; color: var(--text-muted); margin-top: .6rem; }

.read-indicator {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1rem;
  background: var(--success-bg);
  border: 1px solid var(--success-bd);
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  color: var(--success);
  font-weight: 600;
  margin-top: .75rem;
}

/* ─── Tab bar (admin) ────────────────────────────────────────────────────────── */
.tab-row { display: flex; margin-bottom: 1.25rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.tab-btn { flex:1; padding:.6rem; background:var(--bg); border:none; cursor:pointer; font-family:'Ubuntu',sans-serif; font-size:.875rem; font-weight:600; color:var(--text-muted); transition:all .2s; }
.tab-btn.active { background: var(--primary); color: #fff; }
.tab-btn:not(:last-child) { border-right: 1.5px solid var(--border); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Print ──────────────────────────────────────────────────────────────────── */
@media print {
  .navbar, .modal-close, .btn { display: none !important; }
  .modal-overlay { position: static; background: none; padding: 0; }
  .modal-box { box-shadow: none; padding: 0; }
  .signed-contract-view { max-height: none; overflow: visible; border: none; }
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .navbar         { padding: 0 1rem; }
  .card           { padding: 1.4rem; }
  .otp-digit      { width: 42px; height: 52px; font-size: 1.3rem; }
  .page-wrapper, .page-wrapper-wide { padding: 1.5rem .9rem 3rem; }
  .stats-row      { grid-template-columns: 1fr 1fr; }
  .send-form-grid { grid-template-columns: 1fr !important; }
  .sig-block-row  { flex-direction: column; gap: 1rem; }
}

/* ─── Dark Mode ─────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --primary:        #e53e3e;
  --primary-dark:   #fc8181;
  --primary-xdark:  #feb2b2;
  --primary-light:  rgba(229,62,62,0.18);
  --primary-border: rgba(229,62,62,0.40);
  --success:        #68d391;
  --success-bg:     #1c3329;
  --success-bd:     #2f6b4a;
  --danger:         #fc8181;
  --danger-bg:      #2d1a1a;
  --danger-bd:      #822727;
  --warn-bg:        #2d2200;
  --warn-bd:        #b7791f;
  --info-bg:        #1e1a2a;
  --info-bd:        rgba(229,62,62,0.35);
  --info-text:      #fc8181;
  --text:           #e2e8f0;
  --text-muted:     #a0aec0;
  --bg:             #111827;
  --card:           #1f2937;
  --border:         #374151;
  --shadow:         0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:      0 4px 8px rgba(0,0,0,.4), 0 2px 4px rgba(0,0,0,.3);
  --shadow-lg:      0 10px 25px rgba(0,0,0,.5), 0 4px 10px rgba(0,0,0,.3);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] textarea.form-input,
[data-theme="dark"] select.form-input,
[data-theme="dark"] .folder-select-inline {
  background: #374151;
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .form-input::placeholder { color: #6b7280; }

[data-theme="dark"] .otp-digit {
  background: #374151;
  color: var(--text);
  border-color: var(--border);
}

[data-theme="dark"] .contract-doc  { background: #374151; color: var(--text); }
[data-theme="dark"] .sig-canvas-wrap { background: #374151; border-color: var(--border); }
[data-theme="dark"] .typed-sig-preview { background: #374151; border-color: var(--border); color: var(--text-muted); }

[data-theme="dark"] table thead tr { background: #374151; }
[data-theme="dark"] table tbody tr:hover { background: #263141; }
[data-theme="dark"] table td, [data-theme="dark"] table th { border-color: var(--border); }

[data-theme="dark"] .folder-pill { background: #374151; color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .folder-pill.active { background: var(--primary); color: #fff; }

[data-theme="dark"] .modal-box { background: var(--card); }
[data-theme="dark"] .modal-overlay { background: rgba(0,0,0,.75); }
[data-theme="dark"] .modal-title { color: var(--primary-dark); }
[data-theme="dark"] .modal-close { color: var(--text-muted); }
[data-theme="dark"] .modal-close:hover { background: var(--border); color: var(--text); }

[data-theme="dark"] .sig-tab { background: var(--bg); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .sig-tab.active { background: var(--card); color: var(--primary-dark); }

[data-theme="dark"] .link-copy-input { background: #374151; color: var(--text); border-color: var(--border); }
[data-theme="dark"] .drop-zone { background: #1e1a2a; border-color: var(--primary-border); }
[data-theme="dark"] .drop-zone-selected { background: #374151; border-color: var(--border); }
[data-theme="dark"] .active-contract-banner { background: #1e1a2a; }
[data-theme="dark"] .builtin-banner { background: var(--bg); }

[data-theme="dark"] .alert-warn { color: #f6ad55; }
[data-theme="dark"] .alert-info { color: var(--info-text); }

/* Dark mode toggle button */
.dark-toggle {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: background var(--transition);
  flex-shrink: 0;
}
.dark-toggle:hover { background: rgba(255,255,255,.28); }
