/* Noe WhatsApp Provider — sparse developer console. No marketing chrome. */

:root {
  --text: #1f2937;
  --muted: #4b5563;
  --line: #e5e7eb;
  --accent: #0b6bcb;
  --accent-hover: #2f83e0;
  --visited: #6b4fa0;
  --ok-bg: #e8f5ee;
  --ok-text: #14532d;
  --error-bg: #fdecea;
  --error-text: #8a1c11;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: #fff;
  text-wrap: pretty;
}

h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.55em; margin: 0 0 0.6em; }
h2 { font-size: 1.2em; margin: 1.6em 0 0.5em; }
p { margin: 0.5em 0; }
p.status-line { color: var(--muted); margin-top: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
main a:visited { color: var(--visited); }

code { font-size: 0.95em; background: #f3f4f6; padding: 0.1em 0.35em; border-radius: 4px; }

.site-header {
  display: flex;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: var(--text);
}
.brand img { display: block; }
.brand:hover { color: var(--text); }

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

.site-footer {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 20px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
.site-footer p { margin: 0.2em 0; }

/* Console navigation: text links + one logout action */
.console-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 4px;
}
.console-nav .logout-form { margin-left: auto; }

/* Forms */
.form { margin: 1em 0 1.6em; }
.form-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin: 0.7em 0;
}
.form-row label { text-align: right; padding-top: 5px; }
.form-row-narrow { grid-template-columns: minmax(0, 1fr); }
.form-row-narrow label { text-align: left; display: flex; gap: 8px; align-items: baseline; padding-top: 0; }
.form-actions { margin-left: 182px; }

input[type="text"], input[type="tel"], input[type="password"], textarea, select {
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid #9ca3af;
  border-radius: 6px;
  padding: 7px 9px;
}
textarea { width: 100%; max-width: 46ch; resize: vertical; }
select { padding: 6px 8px; }

fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 0 0 1.4em; padding: 8px 16px 16px; }
legend { padding: 0 6px; }

/* Buttons: actions only, natural width */
.btn {
  font: inherit;
  color: #fff;
  background: #24303f;
  border: 0;
  border-radius: 6px;
  padding: 9px 18px;
  cursor: pointer;
}
.btn:hover { background: #303f52; }
.btn-quiet { background: #fff; color: var(--accent); border: 1px solid var(--accent); padding: 6px 14px; }
.btn-quiet:hover { background: #f2f8ff; color: var(--accent-hover); }

/* Flash */
.flash { border-radius: 6px; padding: 10px 14px; margin: 0.8em 0; }
.flash-ok { background: var(--ok-bg); color: var(--ok-text); }
.flash-error { background: var(--error-bg); color: var(--error-text); }

/* Status chips: tags only */
.status {
  display: inline-block;
  font-size: 0.85em;
  border-radius: 999px;
  padding: 1px 10px;
  background: #eef1f4;
  color: var(--muted);
  white-space: nowrap;
}
.status-sent { background: var(--ok-bg); color: var(--ok-text); }
.status-delivered { background: var(--ok-bg); color: var(--ok-text); }
.status-read { background: var(--ok-bg); color: var(--ok-text); }
.status-failed { background: var(--error-bg); color: var(--error-text); }
.status-complete, .status-APPROVED { background: var(--ok-bg); color: var(--ok-text); }
.status-pending, .status-PENDING { background: #fdf3e0; color: #7a4a05; }
.status-REJECTED, .status-DISABLED, .status-deleted { background: var(--error-bg); color: var(--error-text); }

/* Tables */
.table-wrap { margin: 0.8em 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--line); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }

/* Property lists */
.property-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0.8em 0; }
.property-list dt { color: var(--muted); }
.property-list dd { margin: 0; }

ul.allowlist { margin: 0.3em 0; }

/* Narrow screens: forms stack, tables reflow to one block per row */
@media (max-width: 600px) {
  .form-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .form-row label { text-align: left; padding-top: 0; }
  .form-actions { margin-left: 0; }

  .page { padding: 18px 14px 40px; }

  .table-wrap { margin-left: -14px; margin-right: -14px; }
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  table { border-top: 1px solid var(--line); }
  tr { border-bottom: 1px solid var(--line); padding: 8px 14px; }
  td { border: 0; padding: 2px 0; }
  td::before { content: attr(data-label) ": "; font-weight: 600; }
  td[data-label="Content"]::before, td[data-label="Outcome"]::before { content: ""; }
}
