:root {
  --bg: #f5f6f2;
  --panel: #ffffff;
  --ink: #1a2a2a;
  --muted: #5a6868;
  --line: #d8dfdf;
  --accent: #0c7a5e;
  --accent-2: #e2f4ed;
  --danger: #b63a2e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at 0% 0%, #e9f8e9 0%, transparent 30%),
    radial-gradient(circle at 100% 100%, #f8efdf 0%, transparent 30%),
    var(--bg);
  color: var(--ink);
}

.container {
  width: min(1100px, 94vw);
  margin: 28px auto;
  display: grid;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

.hero {
  background: linear-gradient(130deg, #f7fff8, #fefaf3);
}

.hero-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

h1,
h2 {
  margin: 0 0 10px;
}

p {
  margin: 0;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}

textarea {
  margin-top: 12px;
  width: 100%;
  resize: vertical;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

button {
  border: none;
  border-radius: 9px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

button.secondary {
  background: #edf1f1;
  color: #223;
}

button.danger {
  background: var(--danger);
}

.hidden {
  display: none !important;
}

.error {
  min-height: 20px;
  color: var(--danger);
  margin: 8px 0 0;
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 8px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  font-size: 14px;
}

td .mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #344;
  word-break: break-all;
}

.qr-thumb {
  width: 72px;
  height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.channel-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-2);
  color: #0e5f4c;
  font-size: 12px;
}

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

/* --- Enhanced UI Styles --- */

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

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.card {
  background: #fff;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  text-align: center;
}

.card-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.card-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.filter-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-controls input,
.filter-controls select {
  padding: 8px;
  font-size: 14px;
}

#search-input {
  min-width: 200px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: capitalize;
  background: var(--accent-2);
  color: var(--accent);
}

.badge-active {
  background: #d4f4dd;
  color: #0c6832;
}

.badge-paused {
  background: #fff4e6;
  color: #c87000;
}

.badge-expired {
  background: #ffe6e6;
  color: #b63a2e;
}

.tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tag {
  background: #e8f0fe;
  color: #1967d2;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
}

.url-display {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
  background: #f9fafb;
  padding: 2px 6px;
  border-radius: 4px;
}

.notes {
  color: var(--muted);
  font-style: italic;
}

.actions-cell {
  white-space: nowrap;
}

.btn-icon {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  filter: grayscale(50%);
  transition: all 0.15s;
}

.btn-icon:hover {
  filter: grayscale(0%);
  transform: scale(1.15);
}

.btn-icon-inline {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  opacity: 0.6;
  transition: all 0.15s;
}

.btn-icon-inline:hover {
  opacity: 1;
  transform: scale(1.1);
}

.panel-details {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fafbfb;
}

.panel-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
}

.panel-details[open] summary {
  margin-bottom: 12px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  max-width: 800px;
  width: 90vw;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header button {
  font-size: 24px;
  background: transparent;
  color: var(--muted);
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.modal-header button:hover {
  background: var(--line);
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.stat {
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--line);
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.scans-table {
  margin-top: 12px;
  font-size: 13px;
}

.scans-table th {
  background: #f9fafb;
}

input[type="color"] {
  cursor: pointer;
  height: 40px;
}

input[type="date"] {
  cursor: pointer;
}

.info-text {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  background: #e8f5e9;
  border-left: 3px solid #4caf50;
  color: #2e7d32;
  font-size: 12px;
  border-radius: 4px;
  line-height: 1.4;
}

.logo-options {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.logo-preview {
  margin-top: 12px;
  padding: 12px;
  background: #f9fafb;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
}

.logo-preview img {
  max-width: 120px;
  max-height: 120px;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.logo-preview-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

input[type="file"] {
  padding: 8px;
  font-size: 14px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
  margin-right: 8px;
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent-2);
}

.files-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 13px;
}

.files-table th {
  background: #f9fafb;
  padding: 10px 8px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid var(--line);
}

.files-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.files-table tr:hover {
  background: #f9fafb;
}

.files-table img {
  display: block;
}

#modal-body {
  max-height: 600px;
  overflow-y: auto;
}

/* =============================================================================
   Phase 1 — New UI styles
   ============================================================================= */

/* Utility */
.hidden { display: none !important; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-32 { margin-bottom: 32px; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.truncate-cell { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.required { color: var(--danger); }
.field-hint { font-size: .75rem; color: var(--muted); }
.full-width { grid-column: 1 / -1; }

/* Top bar */
.topbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,.06);
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
}
.topbar-actions { display: flex; gap: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: none; border-radius: 8px; font-size: .85rem; font-weight: 500; cursor: pointer; transition: background .15s, transform .1s; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn-primary   { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #0a6b50; }
.btn-secondary { background: var(--accent-2); color: var(--accent); }
.btn-secondary:hover { background: #cbeedd; }
.btn-ghost     { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger    { background: #fdeaea; color: var(--danger); border: 1px solid #f5c0bb; }
.btn-danger:hover { background: #fad2cf; }
.btn-sm  { padding: 4px 10px; font-size: .8rem; }
.btn-xs  { padding: 3px 8px; font-size: .75rem; border-radius: 6px; }

/* Panel */
.panel-title { font-size: 1rem; font-weight: 700; margin: 0 0 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head .panel-title { margin: 0; }

/* Summary cards */
.summary-cards { display: flex; gap: 12px; flex-wrap: wrap; }
.summary-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 20px; display: flex; flex-direction: column; min-width: 110px; }
.summary-cards-sm .summary-card { padding: 10px 14px; min-width: 80px; }
.summary-card-xs { padding: 10px 14px !important; min-width: 80px !important; }
.card-value { font-size: 1.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.card-label { font-size: .72rem; color: var(--muted); margin-top: 3px; text-transform: uppercase; letter-spacing: .04em; }

/* Form */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .82rem; font-weight: 600; color: var(--ink); }
.form-group input, .form-group select, .form-group textarea {
  padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: .9rem; background: #fff; color: var(--ink);
  transition: border-color .15s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-actions { display: flex; gap: 10px; margin-top: 16px; align-items: center; }
.form-error { color: var(--danger); font-size: .83rem; margin-top: 8px; background: #fdeaea; padding: 8px 12px; border-radius: 6px; }

/* Color inputs */
.color-input-row { display: flex; gap: 8px; align-items: center; }
.color-input-row input[type=color] { width: 44px; height: 36px; padding: 2px; border-radius: 6px; border: 1.5px solid var(--line); cursor: pointer; }
.color-hex { flex: 1; }

/* Advanced section */
.advanced-toggle { margin-top: 10px; }
.advanced-section { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }

/* Filter controls */
.filter-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-controls input, .filter-controls select { padding: 6px 10px; border: 1.5px solid var(--line); border-radius: 8px; font-size: .83rem; background: #fff; color: var(--ink); }

/* Table */
.table-wrap { overflow-x: auto; border-radius: 8px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead { background: var(--bg); }
thead th { padding: 10px 14px; text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
tbody td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
tbody tr:hover { background: #f9faf8; }
.action-btns { display: flex; gap: 4px; flex-wrap: nowrap; }
.empty-state { text-align: center; color: var(--muted); padding: 24px; }

/* Placement performance panel */
.placement-perf-panel { margin: 12px 0 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.placement-perf-header { display: flex; align-items: baseline; gap: 10px; font-size: .85rem; font-weight: 600; margin-bottom: 10px; }
.placement-perf-header .field-hint { font-weight: 400; }
.pp-row { display: grid; grid-template-columns: 160px 1fr 80px; align-items: center; gap: 8px; margin-bottom: 7px; font-size: .82rem; }
.pp-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.pp-bar-wrap { background: var(--line); border-radius: 4px; height: 10px; overflow: hidden; }
.pp-bar { background: var(--accent); height: 100%; border-radius: 4px; transition: width .3s ease; min-width: 3px; }
.pp-count { text-align: right; font-weight: 600; color: var(--text); }
.pp-count small { font-weight: 400; color: var(--muted); display: block; font-size: .75rem; }

/* A/B Test section */
.ab-tests-section { margin: 16px 0 4px; }
.ab-tests-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ab-tests-header h4 { margin: 0; font-size: .95rem; }
.ab-test-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin-bottom: 10px; background: var(--surface); }
.ab-test-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ab-test-card-header > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.ab-test-card-header small { display: block; color: var(--muted); font-size: .78rem; margin-top: 2px; }
.ab-variants-bars { display: flex; flex-direction: column; gap: 6px; }
.ab-variant-row { display: grid; grid-template-columns: 200px 1fr 60px auto; align-items: center; gap: 8px; font-size: .82rem; }
.ab-variant-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-bar-0 { background: var(--accent); }
.ab-bar-1 { background: #f59e0b; }
.ab-bar-2 { background: #10b981; }
.ab-bar-3 { background: #8b5cf6; }

/* A/B modal variant picker */
.ab-variant-section { margin-top: 14px; }
.ab-variant-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.ab-variant-list { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow-y: auto; padding: 2px; }
.ab-variant-check-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: .85rem; }
.ab-variant-check-row:hover { background: #f9faf8; }
.ab-variant-check-row input[type=checkbox] { flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.ab-variant-check-row > span { flex: 1; }
.ab-variant-label-input { border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px; font-size: .82rem; }
.ab-variant-weight-input { border: 1px solid var(--line); border-radius: 4px; padding: 3px 7px; font-size: .82rem; text-align: center; }

/* Modal footer */
.modal-footer { padding: 12px 20px 16px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }

/* Client cell */
.client-cell { display: flex; align-items: center; gap: 10px; }
.campaign-cell { display: flex; align-items: center; gap: 10px; }
.contact-cell { font-size: .82rem; line-height: 1.5; }
.client-name-link { cursor: pointer; color: var(--accent); text-decoration: none; }
.client-name-link:hover { text-decoration: underline; }

/* Avatar */
.avatar-sm { width: 36px; height: 36px; border-radius: 8px; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--accent-2); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials { font-weight: 700; font-size: .85rem; color: var(--accent); }
.avatar-initials-lg { font-size: 1.4rem; }
.tags-cell { font-size: .72rem; color: var(--muted); display: block; margin-top: 2px; }
.count-badge { font-weight: 600; }
.count-badge .text-muted { font-weight: 400; font-size: .8em; }

/* Status badge */
.status-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.badge-active  { background: #d4f5e3; color: #0c7a3e; }
.badge-paused  { background: #fff3cd; color: #856404; }
.badge-expired { background: #fdeaea; color: #b63a2e; }

/* Channel badge */
.channel-badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 500; }
.channel-whatsapp { background: #e8faf0; color: #0c7a3e; }
.channel-website  { background: #e8f0fe; color: #1a5dc8; }
.channel-email    { background: #fff3cd; color: #856404; }
.channel-sms      { background: #f5e8fe; color: #7c1acb; }

/* QR thumb */
.qr-thumb-sm { width: 44px; height: 44px; border-radius: 6px; overflow: hidden; cursor: pointer; border: 1px solid var(--line); flex-shrink: 0; }
.qr-thumb-sm img { width: 100%; height: 100%; object-fit: contain; }

/* Breadcrumb */
.breadcrumb { display: flex; align-items: center; gap: 8px; padding: 12px 0 0; }
.breadcrumb-back { border: none; background: none; cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 600; display: flex; align-items: center; gap: 4px; padding: 0; }
.breadcrumb-back:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--muted); }
.breadcrumb-current { font-weight: 700; font-size: .9rem; color: var(--ink); }

/* Client profile card */
.client-profile-card { display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; }
.client-profile-left { display: flex; gap: 16px; align-items: flex-start; flex: 1; min-width: 200px; }
.client-profile-right { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }
.client-avatar { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--accent-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.client-name-display { font-size: 1.25rem; font-weight: 700; margin: 0 0 4px; }
.client-contacts { font-size: .85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.client-contacts a { color: var(--accent); text-decoration: none; }
.client-contacts a:hover { text-decoration: underline; }
.client-tags-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag-badge { background: var(--accent-2); color: var(--accent); font-size: .72rem; padding: 2px 8px; border-radius: 999px; }
.client-profile-actions { display: flex; gap: 8px; }
.client-export-actions { display: flex; gap: 8px; margin-top: 8px; }

/* =====================================================================
   Form Builder
   ===================================================================== */
.form-section-sep { border-top: 1px solid var(--line); margin: 16px 0 12px; padding-top: 14px; }
.form-section-toggle-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.form-section-toggle-label { flex: 1; }
.form-section-toggle-label strong { font-size: .9rem; display: block; margin-bottom: 3px; }
.form-section-toggle-hint { font-size: .8rem; color: var(--muted); line-height: 1.4; }

/* Toggle switch */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: #ccc; border-radius: 24px; cursor: pointer; transition: background .2s; }
.toggle-slider::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s; }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

.fb-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.fb-toolbar-label { font-weight: 600; font-size: .88rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.fb-toolbar-btns { display: flex; gap: 6px; flex-wrap: wrap; }

.fb-fields-list { display: flex; flex-direction: column; gap: 8px; }
.fb-field-row { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto auto 1fr auto auto; gap: 8px; align-items: center; }
.fb-field-row .fb-label   { font-size: .88rem; }
.fb-field-row .fb-type    { font-size: .82rem; min-width: 110px; }
.fb-field-row .fb-placeholder { font-size: .82rem; }
.fb-field-row .fb-options { font-size: .82rem; }
.fb-required-wrap { display: flex; align-items: center; gap: 5px; font-size: .82rem; white-space: nowrap; cursor: pointer; }
.fb-hint { font-size: .78rem; color: var(--muted); margin-top: 10px; font-style: italic; }

@media (max-width: 600px) {
  .fb-field-row { grid-template-columns: 1fr 1fr; }
  .fb-toolbar { flex-direction: column; align-items: flex-start; }
}

/* Logo preview */
.logo-preview { margin-top: 6px; }
.logo-preview img { max-width: 80px; max-height: 60px; border-radius: 6px; border: 1px solid var(--line); object-fit: contain; }

/* Slug link */
.slug-link { font-size: .8rem; color: var(--accent); text-decoration: none; font-family: monospace; }
.slug-link:hover { text-decoration: underline; }

/* Input with button */
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; }

/* Modals */
.modal { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.45); }
.modal-content { position: relative; background: var(--panel); border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.18); width: 90vw; max-width: 640px; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-wide   { max-width: 800px; }
.modal-narrow { max-width: 360px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.modal-header h3 { margin: 0; font-size: 1rem; }
.modal-close { border: none; background: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 0; }
.modal-body { padding: 16px 20px; overflow-y: auto; }

/* Analytics */
.analytics-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: var(--bg); border-radius: 10px; padding: 10px 16px; display: flex; flex-direction: column; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-top: 2px; }

/* File upload */
.upload-drop-zone { border: 2px dashed var(--line); border-radius: 10px; padding: 24px; text-align: center; }
.upload-drop-zone input[type=file] { display: none; }
.upload-drop-zone p { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }

/* URL display */
.url-display { font-family: monospace; font-size: .85rem; color: var(--muted); word-break: break-all; }

/* filename display */
.filename { font-family: monospace; font-size: .82rem; }

/* Form channel fields: hide non-active channel fields */
.form-group-channel { transition: none; }

/* ============================================================
   Lead Pipeline Summary Bar
   ============================================================ */
.lead-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 16px;
  margin-bottom: 12px;
  font-size: .85rem;
}
.ls-label { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.ls-sep { color: var(--line); }
.ls-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-weight: 600; font-size: .82rem; }
.ls-new       { background: #e8f4fd; color: #1a6fa8; }
.ls-contacted { background: #fff3cd; color: #856404; }
.ls-quoted    { background: #e2d9f3; color: #5a2d82; }
.ls-won       { background: #d1fae5; color: #065f46; }
.ls-lost      { background: #fde8e8; color: #991b1b; }

/* Lead status select in submissions table */
.lead-stage-select {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}
.lead-stage-new       { background: #e8f4fd; color: #1a6fa8; }
.lead-stage-contacted { background: #fff3cd; color: #856404; }
.lead-stage-quoted    { background: #e2d9f3; color: #5a2d82; }
.lead-stage-won       { background: #d1fae5; color: #065f46; }
.lead-stage-lost      { background: #fde8e8; color: #991b1b; }

/* Lead field inputs in submissions table */
.lead-field-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: .82rem;
  background: var(--bg);
  color: var(--text);
  width: 100%;
}
.lead-field-input:focus { outline: none; border-color: var(--accent); }

/* ============================================================
   Custom Domain Instructions (client form)
   ============================================================ */
.domain-input-row { display: flex; align-items: center; gap: 8px; }
.domain-input-row input { flex: 1; }
.domain-instructions {
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  font-size: .85rem;
  color: var(--text);
}
.domain-instructions p { margin: 0 0 8px; }
.domain-instructions p:last-child { margin-bottom: 0; }
.domain-instructions code {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 4px 10px;
  font-size: .82rem;
  margin-top: 4px;
  word-break: break-all;
}

/* ============================================================
   NFC Tag Support
   ============================================================ */
.nfc-badge {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  font-size: .72rem;
  font-weight: 700;
  padding: 1px 7px;
  vertical-align: middle;
  letter-spacing: .02em;
}
.nfc-instructions-row td { padding: 0 !important; }
.nfc-instructions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #f0f4ff;
  border-top: 1px solid #c7d2fe;
  border-bottom: 1px solid var(--line);
  padding: 8px 16px;
  font-size: .82rem;
  color: #3730a3;
}
.nfc-instructions strong { white-space: nowrap; }
.nfc-instructions code {
  background: #fff;
  border: 1px solid #c7d2fe;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: .8rem;
  word-break: break-all;
  color: #1e1b4b;
  flex: 1;
  min-width: 0;
}
