:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #667381;
  --paper: #f6f1e8;
  --accent: #0f7b6c;
  --accent-dark: #0a5148;
  --line: #d8d1c6;
  --white: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

.site-home {
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(15, 123, 108, 0.18), rgba(208, 95, 68, 0.12)),
    var(--paper);
}

.coming-soon {
  width: min(760px, 100%);
  text-align: center;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 0.83rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

.coming-soon h1 {
  margin-bottom: 18px;
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 0.95;
}

.lead {
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.7;
}

.admin-auth {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel,
.panel {
  width: min(440px, 100%);
  padding: 28px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(23, 33, 43, 0.08);
}

.auth-panel h1,
.admin-dashboard h1 {
  margin-bottom: 20px;
  font-size: 2rem;
  line-height: 1.1;
}

form {
  display: grid;
  gap: 12px;
}

label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

select,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 13px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

button {
  min-height: 46px;
  padding: 11px 16px;
  color: var(--white);
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: var(--accent-dark);
}

.secondary {
  color: var(--accent-dark);
  background: transparent;
  border: 1px solid var(--line);
}

.secondary:hover,
.secondary:focus-visible {
  color: var(--white);
  background: var(--accent-dark);
}

.notice,
.error {
  padding: 12px 14px;
  border-radius: 6px;
  line-height: 1.5;
}

.notice {
  color: #134e44;
  background: #dff5ef;
}

.error {
  color: #7a1d16;
  background: #f8dfdc;
}

.admin-dashboard {
  padding: 28px;
}

.admin-dashboard header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 960px;
  margin: 0 auto 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-dashboard main {
  display: grid;
  gap: 18px;
  max-width: 960px;
  margin: 0 auto;
}

.panel {
  width: 100%;
}

.panel p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-links {
  display: grid;
  gap: 12px;
}

.tool-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  color: var(--ink);
  text-decoration: none;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tool-link:hover,
.tool-link:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.tool-link strong,
.tool-link small {
  display: block;
}

.tool-link small {
  margin-top: 4px;
  color: var(--muted);
}

.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: 6px;
  font-weight: 800;
  text-decoration: none;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.6rem;
}

.filters {
  grid-template-columns: minmax(220px, 1.5fr) minmax(150px, 1fr) minmax(130px, 0.8fr) auto;
  align-items: end;
}

.table-panel {
  padding: 0;
  overflow: hidden;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 12px;
}

.section-heading h2,
.section-heading p {
  margin: 0;
}

.section-heading p {
  color: var(--muted);
}

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

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

th,
td {
  padding: 13px 16px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
}

th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

td a {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: none;
}

td small {
  display: block;
  max-width: 280px;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: #134e44;
  background: #dff5ef;
  border: 1px solid #b8e3d8;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-contacted,
.status-follow_up {
  color: #5c4314;
  background: #fff1cc;
  border-color: #edd487;
}

.status-appointment,
.status-client {
  color: #173f64;
  background: #dfeeff;
  border-color: #b9d7f4;
}

.status-not_interested,
.status-bad_number {
  color: #7a1d16;
  background: #f8dfdc;
  border-color: #edb8b0;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
}

.disabled {
  pointer-events: none;
  opacity: 0.45;
}

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

.detail-layout {
  grid-template-columns: minmax(0, 1fr);
}

.contact-facts {
  display: grid;
  gap: 14px;
  margin: 0;
}

.contact-facts div {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.contact-facts dt {
  color: var(--muted);
  font-weight: 800;
}

.contact-facts dd {
  margin: 0;
  line-height: 1.6;
}

.form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.notes-list {
  display: grid;
  gap: 12px;
}

.note-card {
  padding: 14px;
  background: #fbfaf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.note-card p {
  margin-bottom: 8px;
  color: var(--ink);
}

.note-card small {
  color: var(--muted);
}

@media (max-width: 560px) {
  .admin-dashboard header {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions,
  .filters,
  .form-grid,
  .contact-facts div {
    display: grid;
    grid-template-columns: 1fr;
  }
}
