/* Intake Router dashboard: additions on top of the shared styles.css tokens.
   Status and kind colours are the exact pairs from src/app/page.tsx. */

main { max-width: 1200px; }
.page-head h1 { font-size: 22px; letter-spacing: -0.01em; }
.deployed { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--muted); }
.test-mode { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: #9a3412; background: #fed7aa; border-radius: 999px; padding: 2px 8px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tabs a {
  padding: 8px 14px; margin-bottom: -1px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--ink-2); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }

/* ---------- stat cards ---------- */
.stat-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.stat { min-width: 140px; padding: 14px 18px; border-radius: var(--radius); }
.stat .n { font-size: 32px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 13px; margin-top: 2px; text-transform: capitalize; }
.stat.total { background: #e5e7eb; color: #111; }

/* ---------- pills: lead status / error kind ---------- */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-transform: capitalize; white-space: nowrap; }
.pill.neutral, .stat.neutral { background: #f3f4f6; color: #374151; }
.st-pending, .k-validation { background: #fef3c7; color: #92400e; }
.st-delivered { background: #d1fae5; color: #065f46; }
.st-failed, .k-json_parse, .k-delivery_failed { background: #fed7aa; color: #9a3412; }
.st-dead, .k-config, .k-db_insert, .k-delivery_dead { background: #fecaca; color: #991b1b; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; }
table.rows { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
table.rows th { text-align: left; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 9px 10px; border-bottom: 1px solid var(--border); }
table.rows td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.rows tbody tr:nth-child(even) { background: var(--surface-2); }
table.rows tbody tr.link { cursor: pointer; }
table.rows tbody tr.link:hover { background: var(--accent-soft); }
table.rows td.c { text-align: center; }
table.rows a.id { color: var(--accent); font-weight: 600; text-decoration: none; }
table.rows a.id:hover { text-decoration: underline; }
.cell-err { color: #991b1b; max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.cell-err.wide { max-width: 400px; }
.table-foot { font-size: 12px; color: var(--muted); padding: 10px 2px; }
.empty-row td { text-align: center; color: var(--muted); padding: 28px; }

/* ---------- logs ---------- */
.console { background: #1e1e1e; color: #d4d4d4; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; padding: 14px 16px; border-radius: var(--radius); white-space: pre-wrap; word-break: break-all; margin: 0; max-height: 70vh; overflow: auto; }

/* ---------- settings ---------- */
.settings-card { max-width: 640px; padding: 18px 20px; display: grid; gap: 14px; }
.settings-card h2 { font-size: 17px; }
.settings-card .blurb { font-size: 13px; color: var(--muted); }
.banner { padding: 9px 12px; border-radius: 8px; font-size: 13px; }
.banner.ok { background: #d1fae5; color: #065f46; }
.banner.err { background: #fecaca; color: #991b1b; }
.field-row { display: grid; gap: 4px; }
.field-row label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field-row select, .field-row input[type="text"] { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 6px 10px; height: 34px; color: var(--ink); max-width: 420px; }
.schedule { display: grid; grid-template-columns: 150px 1fr auto 1fr; gap: 8px 10px; align-items: center; max-width: 480px; }
.schedule .day { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.schedule input[type="time"] { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; padding: 4px 8px; height: 32px; color: var(--ink); font-variant-numeric: tabular-nums; width: 100%; }
.schedule .to { font-size: 12px; color: var(--muted); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: default; }
.readonly-note { font-size: 12.5px; color: var(--muted); }

/* ---------- detail pages ---------- */
.detail { display: grid; gap: 14px; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-head h1 { font-size: 22px; }
.back { font-size: 13px; color: var(--accent); text-decoration: none; }
.back:hover { text-decoration: underline; }
.detail-card { padding: 16px 18px; display: grid; gap: 12px; }
.detail-card h3 { font-size: 15px; }
.detail-card .caption { font-size: 12.5px; color: var(--muted); }
.detail-card .caption code { font-size: 12px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.fields .k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.fields .v { font-size: 14px; margin-top: 2px; word-break: break-word; }
.fields .full { grid-column: 1 / -1; }
pre.blob { background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: 12px; font-size: 12px; line-height: 1.45; white-space: pre-wrap; word-break: break-all; margin: 0; max-height: 50vh; overflow: auto; }
pre.blob.err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.loading, .inline-err { font-size: 13px; color: var(--muted); padding: 10px 2px; }
.inline-err { color: #991b1b; }

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