/* Leadbox Admin — minimal responsive styles */

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

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --primary: #0f766e;
  --primary-hover: #0d615a;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);

  /* Status colours */
  --s-new:       #3b82f6;   /* blue */
  --s-calling:   #f59e0b;   /* amber */
  --s-confirmed: #0f766e;   /* teal */
  --s-delivery:  #8b5cf6;   /* purple */
  --s-closed:    #22c55e;   /* green */
  --s-rejected:  #ef4444;   /* red */
}

body { font-family: system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }

/* ── Navbar ─────────────────────────────────────────────────────────────── */
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 52px; background: var(--primary); color: #fff; }
.navbar__brand { font-weight: 700; font-size: 16px; letter-spacing: .02em; }
.navbar__links { display: flex; align-items: center; gap: 16px; }
.navbar__link { color: rgba(255,255,255,.85); text-decoration: none; }
.navbar__link:hover { color: #fff; }

/* ── Main container ─────────────────────────────────────────────────────── */
.main { max-width: 1200px; margin: 0 auto; padding: 24px 16px; }

/* ── Login page ─────────────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 36px 32px; width: 100%; max-width: 360px; box-shadow: var(--shadow); }
.login-card__title { font-size: 22px; font-weight: 700; margin-bottom: 24px; text-align: center; color: var(--primary); }
.login-form { display: flex; flex-direction: column; gap: 16px; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 14px; border-radius: var(--radius); font-size: 13px; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: background .15s; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn--ghost:hover { background: var(--bg); }
.btn--full { width: 100%; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text); }
.form-input { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--surface); color: var(--text); width: 100%; }
.form-input:focus { outline: none; border-color: var(--primary); }
.form-textarea { resize: vertical; font-family: inherit; }
.inline-form { display: inline; }

/* ── Alert ──────────────────────────────────────────────────────────────── */
.alert { padding: 10px 14px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; }
.alert--error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* ── Page header ────────────────────────────────────────────────────────── */
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 18px; font-weight: 600; }
.badge { background: var(--border); color: var(--text-muted); border-radius: 20px; padding: 1px 8px; font-size: 12px; }

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filter-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; background: var(--surface); color: var(--text); }
.filter-search { display: flex; gap: 6px; align-items: center; flex: 1; min-width: 200px; }
.filter-input { flex: 1; }

/* ── Table ──────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin-bottom: 20px; }
.table { width: 100%; border-collapse: collapse; }
.table th { background: var(--bg); padding: 10px 12px; text-align: left; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border); }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table__row { cursor: pointer; transition: background .1s; }
.table__row:hover { background: var(--bg); }
.table__empty { text-align: center; color: var(--text-muted); padding: 32px; }
.td-nowrap { white-space: nowrap; }
.table--items { font-size: 13px; }

/* ── Status pill ────────────────────────────────────────────────────────── */
.status-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap; }
.status-pill--new       { background: var(--s-new); }
.status-pill--calling   { background: var(--s-calling); color: #78350f; }
.status-pill--confirmed { background: var(--s-confirmed); }
.status-pill--delivery  { background: var(--s-delivery); }
.status-pill--closed    { background: var(--s-closed); color: #14532d; }
.status-pill--rejected  { background: var(--s-rejected); }

/* Status select in table row */
.status-select { border: none; font-size: 12px; font-weight: 600; border-radius: 20px; padding: 3px 8px; cursor: pointer; color: #fff; }
.status-select.status-pill--calling,
.status-select.status-pill--closed  { color: #333; }

/* ── Link ───────────────────────────────────────────────────────────────── */
.link { color: var(--primary); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ── Pagination ─────────────────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 16px; }
.pagination__info { font-size: 13px; color: var(--text-muted); }

/* ── Detail page ────────────────────────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-card, .detail-side > .detail-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 16px;
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; margin-top: 20px; }
.card-title:first-child { margin-top: 0; }

.dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin-bottom: 16px; }
.dl dt { font-weight: 500; color: var(--text-muted); font-size: 13px; }
.dl dd { font-size: 13px; color: var(--text); word-break: break-word; }

/* ── Notes ──────────────────────────────────────────────────────────────── */
.note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.notes-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.note-item { padding: 10px 12px; background: var(--bg); border-radius: var(--radius); border-left: 3px solid var(--primary); }
.note-body { font-size: 13px; color: var(--text); white-space: pre-wrap; }
.note-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.text-muted { color: var(--text-muted); font-size: 13px; }

/* ── Alert variants ─────────────────────────────────────────────────────── */
.alert--success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.alert--info    { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Site settings page ─────────────────────────────────────────────────── */
.site-card { margin-bottom: 20px; }

.site-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 12px;
}
@media (max-width: 600px) { .site-form__grid { grid-template-columns: 1fr; } }

.site-form__actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }

.api-key-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.api-key {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 8px;
  color: var(--text);
  word-break: break-all;
}

.btn--sm { padding: 4px 10px; font-size: 12px; }
