:root {
  --bg: #0f1a2b;
  --surface: #1a2332;
  --surface-2: #243044;
  --text: #e8edf4;
  --muted: #94a3b8;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #22c55e;
  --danger: #ef4444;
  --border: #334155;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 720px; margin: 0 auto; padding: 0 1.25rem; }

.site-header {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.site-header--admin { padding: 2rem 0 1.5rem; }

.eyebrow {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.eyebrow a { color: var(--accent); text-decoration: none; }

h1 { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.5rem; }

h2 { font-size: 1.15rem; margin-bottom: 0.75rem; }

h3 { font-size: 1rem; margin-bottom: 0.5rem; }

.lead { color: var(--muted); font-size: 1.05rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.card--highlight { border-color: var(--accent); }

.checklist { list-style: none; padding: 0; }

.checklist li {
  padding: 0.4rem 0 0.4rem 1.5rem;
  position: relative;
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
}

.consent-form { display: flex; flex-direction: column; gap: 1rem; }
.consent-notice {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted, #64748b);
  line-height: 1.55;
}

.checkbox-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.95rem;
  cursor: pointer;
}

.checkbox-label input { margin-top: 0.25rem; flex-shrink: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

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

label { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.9rem; color: var(--muted); }

input[type="text"], input[type="email"], textarea, .copy-field {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.75rem;
  color: var(--text);
  font-size: 1rem;
  width: 100%;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

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

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }

.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

.call-panel { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

.call-status { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }

.indicator {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted);
}

.indicator--active { background: var(--success); animation: pulse 1.5s infinite; }
.indicator--idle { background: var(--muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hint { color: var(--muted); font-size: 0.9rem; }

.call-complete { margin-top: 1.5rem; padding: 1.25rem; background: var(--surface-2); border-radius: var(--radius); }

.call-complete h3 { color: var(--success); }

.site-footer {
  padding: 2rem 0;
  margin-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
}

a { color: var(--accent); }

/* Admin */
.admin .container { max-width: 960px; }

.admin-grid { display: grid; gap: 1.25rem; }

.card--full { grid-column: 1 / -1; }

.data-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }

.data-table th, .data-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th { background: var(--surface-2); font-size: 0.85rem; color: var(--muted); }

.data-table code { font-size: 0.85rem; }

.action-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }

.action-row form { display: inline; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge--pending_review { background: #854d0e; color: #fef08a; }
.badge--approved { background: #14532d; color: #bbf7d0; }
.badge--rejected { background: #7f1d1d; color: #fecaca; }
.badge--generating { background: #1e3a5f; color: #bfdbfe; }
.badge--call_received { background: #374151; color: #e5e7eb; }

.data-table tr.row--failed { background: rgba(127, 29, 29, 0.15); }

.error-cell { max-width: 320px; }

.error-preview {
  display: block;
  color: #fecaca;
  font-size: 0.8rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transcript {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  max-height: 480px;
  overflow-y: auto;
}

.empty-state { color: var(--muted); padding: 2rem; text-align: center; }

.error-box {
    margin-top: 14pt;
    padding: 10pt 12pt;
    background: #fef2f2;
    border: 0.5pt solid #fecaca;
    border-radius: 4pt;
}

.error-box h3 {
    margin: 0 0 6pt 0;
    color: #b91c1c;
    font-size: 10pt;
}
