:root {
  --ink: #14110b;
  --paper: #f4efe4;
  --rule: #d7cfc0;
  --navy: #002d88;
  --navy-deep: #001a52;
  --live: #1f6b45;
  --halt: #9b2c2c;
  --muted: #6b6458;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(0, 45, 136, 0.08), transparent),
    var(--paper);
  color: var(--ink);
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}

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

.mast h1 {
  margin: 0;
  font-family: Fraunces, Georgia, serif;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-optical-sizing: auto;
  letter-spacing: -0.03em;
}

.kicker {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lede {
  max-width: 38rem;
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel,
.add-form,
.table-wrap {
  margin-top: 28px;
  padding: 20px;
  border: 1px solid var(--rule);
  background: #fffdf8;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: #fff;
  font: inherit;
}

input:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

button {
  min-height: 48px;
  padding: 12px 18px;
  border: 0;
  background: var(--navy);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: var(--navy-deep);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ghost {
  margin-top: 24px;
  background: transparent;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.add-form {
  display: grid;
  grid-template-columns: 1.4fr 1fr auto;
  gap: 12px;
  align-items: end;
}

.stats {
  display: flex;
  gap: 18px;
  margin-top: 32px;
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 13px;
  color: var(--muted);
}

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

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

th,
td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}

th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.phone {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 15px;
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.live {
  color: var(--live);
  background: #e4f4ea;
}

.badge.halt {
  color: var(--halt);
  background: #f8e8e8;
}

.row-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.row-actions button {
  min-height: 44px;
  padding: 8px 12px;
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--rule);
}

.row-actions button.danger {
  color: var(--halt);
}

.error {
  margin: 12px 0 0;
  color: var(--halt);
}

.empty {
  color: var(--muted);
}

[hidden] {
  display: none !important;
}

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