:root {
  --bg: #f5f7f4;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-strong: #eef4ef;
  --ink: #13211b;
  --muted: #607068;
  --line: rgba(19, 33, 27, 0.1);
  --brand: #1f6f5f;
  --brand-deep: #143f36;
  --accent: #cb7c46;
  --danger: #b6493a;
  --success: #1f6f5f;
  --warning: #9f7c1f;
  --shadow: 0 22px 56px rgba(20, 38, 31, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --sans: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Georgia, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(31, 111, 95, 0.12), transparent 26%),
    radial-gradient(circle at top right, rgba(203, 124, 70, 0.09), transparent 18%),
    linear-gradient(180deg, #f8fbf8 0%, #f2f6f3 48%, #eef1ed 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.34;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell,
.auth-layout {
  width: min(1200px, calc(100% - 32px));
  margin: 20px auto 40px;
  position: relative;
  z-index: 1;
}

.site-header,
.hero,
.controls-card,
.insight-card,
.panel-card,
.manage-card,
.error-card,
.auth-card,
.auth-copy,
.domain-group {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.78);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  margin-top: 2px;
}

.brand-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, #2b8a77, var(--brand-deep));
  color: white;
  font-weight: 800;
  font-size: 1.2rem;
}

.header-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(19, 33, 27, 0.05);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.header-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(31, 111, 95, 0.12);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.site-nav a,
.nav-button {
  padding: 11px 16px;
  border-radius: 999px;
  background: rgba(31, 28, 26, 0.05);
  color: var(--ink);
  border: none;
  font-weight: 700;
}

.hero {
  margin-top: 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 24px;
  padding: 34px;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at top right, rgba(31, 111, 95, 0.12), transparent 24%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(238, 244, 239, 0.82));
}

.hero-admin {
  align-items: start;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--accent);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--serif);
}

h1 {
  font-size: clamp(2.8rem, 5vw, 4.8rem);
  line-height: 0.95;
  max-width: 10ch;
}

.hero-text,
.auth-copy p,
.manage-card p,
.problem-card p,
.error-card p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-actions {
  margin-top: 24px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

.hero-link {
  display: inline-flex;
  align-items: center;
}

.hero-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 16px;
  border-radius: 999px;
  background: rgba(31, 111, 95, 0.08);
  color: var(--brand-deep);
  font-size: 0.95rem;
}

.hero-note span {
  color: var(--muted);
}

.stat-grid {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.stat-card,
.hero-panel,
.controls-card,
.insight-card,
.panel-card,
.manage-card,
.auth-card,
.auth-copy,
.error-card,
.problem-card {
  background: var(--surface);
  border-radius: var(--radius-xl);
}

.stat-card {
  padding: 18px;
  border: 1px solid var(--line);
}

.stat-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.stat-card strong {
  font-size: 1.2rem;
}

.hero-panel {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.hero-panel-block {
  padding: 18px;
  border-radius: 22px;
  background: rgba(19, 33, 27, 0.04);
  border: 1px solid rgba(19, 33, 27, 0.06);
}

.spotlight-panel {
  background: linear-gradient(180deg, rgba(31, 111, 95, 0.08), rgba(255, 255, 255, 0.58));
}

.spotlight-list {
  display: grid;
  gap: 14px;
}

.spotlight-list strong,
.spotlight-list span {
  display: block;
}

.spotlight-list span {
  color: var(--muted);
}

.steps-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  display: grid;
  gap: 12px;
}

.insight-strip {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.insight-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 24px;
}

.insight-card strong,
.insight-card span {
  display: block;
}

.insight-label {
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--brand);
}

.insight-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.controls-card,
.panel-card,
.error-card {
  margin-top: 22px;
  padding: 24px;
}

.controls-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.controls-copy {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.toolbar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) 220px;
  gap: 12px;
}

.search-field,
.select-field {
  display: grid;
  gap: 8px;
}

.search-label {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.chip-row {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip,
.pill,
.primary-button,
.secondary-button,
.danger-button,
.icon-button {
  border: none;
  border-radius: 999px;
}

.filter-chip,
.pill {
  padding: 10px 14px;
  background: rgba(19, 33, 27, 0.06);
  font-weight: 700;
}

.filter-chip.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff9f2;
}

.pill-success {
  background: rgba(29, 107, 87, 0.12);
  color: var(--success);
}

.pill-danger {
  background: rgba(179, 60, 48, 0.12);
  color: var(--danger);
}

.pill-muted {
  background: rgba(31, 28, 26, 0.08);
  color: var(--muted);
}

.problem-groups,
.manage-section {
  margin-top: 22px;
  display: grid;
  gap: 24px;
}

.domain-group {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.72);
}

.domain-heading,
.problem-top,
.summary-row,
.section-heading,
.panel-card-heading,
.availability-copy,
.action-row,
.summary-row-spread {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.domain-heading,
.panel-card-heading,
.section-heading {
  align-items: end;
}

.problem-grid,
.manage-grid,
.dashboard-grid {
  display: grid;
  gap: 18px;
}

.problem-grid,
.manage-grid {
  margin-top: 18px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dashboard-grid {
  margin-top: 22px;
  grid-template-columns: 0.9fr 1.1fr;
}

.panel-card-wide {
  min-height: 100%;
}

.problem-card,
.manage-card {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.problem-card.full {
  opacity: 0.8;
}

.problem-card::after,
.manage-card::after {
  content: "";
  position: absolute;
  inset: auto -24px -32px auto;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(31, 111, 95, 0.08);
}

.problem-card h3,
.manage-card h3 {
  margin-top: 14px;
  font-size: 1.45rem;
  max-width: 18ch;
}

.availability-block {
  margin: 20px 0;
}

.availability-copy {
  align-items: center;
  margin-bottom: 10px;
}

.availability-copy span {
  color: var(--muted);
  font-size: 0.92rem;
}

.domain-count {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(19, 33, 27, 0.05);
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(19, 33, 27, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #2b8a77, var(--accent));
  border-radius: inherit;
}

.primary-button,
.secondary-button,
.danger-button {
  padding: 13px 18px;
  font-weight: 800;
}

.primary-button {
  background: linear-gradient(135deg, #2b8a77, var(--brand-deep));
  color: #fff8f2;
  box-shadow: 0 14px 30px rgba(20, 63, 54, 0.16);
}

.secondary-button {
  background: rgba(19, 33, 27, 0.08);
  color: var(--ink);
}

.danger-button {
  background: rgba(179, 60, 48, 0.12);
  color: var(--danger);
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(72, 52, 35, 0.14);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(29, 107, 87, 0.5);
  box-shadow: 0 0 0 4px rgba(29, 107, 87, 0.14);
}

.stack-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
}

.flash {
  margin-top: 18px;
  padding: 15px 18px;
  border-radius: 18px;
  border: 1px solid transparent;
}

.flash-success {
  background: rgba(29, 107, 87, 0.12);
  border-color: rgba(29, 107, 87, 0.2);
  color: var(--success);
}

.flash-error {
  background: rgba(179, 60, 48, 0.12);
  border-color: rgba(179, 60, 48, 0.2);
  color: var(--danger);
}

.summary-list {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.selections-panel {
  overflow: hidden;
}

.selection-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.selection-toolbar {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 220px;
  gap: 12px;
}

.selection-search,
.selection-filter {
  margin: 0;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.selection-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

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

.selection-table th {
  background: rgba(19, 33, 27, 0.05);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.selection-table tbody tr:hover {
  background: rgba(31, 111, 95, 0.04);
}

.selection-table tbody tr:last-child td {
  border-bottom: none;
}

.table-delete-button {
  padding: 10px 14px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.selection-empty {
  margin-top: 14px;
}

.summary-row {
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(31, 28, 26, 0.04);
}

.summary-row strong,
.summary-row small,
.summary-row span {
  display: block;
}

.summary-row span,
.summary-row small,
.muted-copy {
  color: var(--muted);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.checkbox-row input {
  width: auto;
}

.edit-panel {
  margin: 18px 0;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(31, 28, 26, 0.04);
}

.edit-panel summary {
  cursor: pointer;
  font-weight: 800;
  margin-bottom: 14px;
}

.manage-section {
  padding-bottom: 24px;
}

.empty-state {
  margin: 18px 0 0;
  text-align: center;
  color: var(--muted);
}

.modal {
  width: min(520px, calc(100% - 24px));
  border: none;
  padding: 0;
  background: transparent;
}

.modal::backdrop {
  background: rgba(20, 17, 15, 0.54);
  backdrop-filter: blur(4px);
}

.modal-card {
  padding: 24px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(236, 244, 239, 0.96));
  box-shadow: 0 24px 50px rgba(19, 33, 27, 0.18);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.modal-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.icon-button {
  width: 42px;
  height: 42px;
  background: rgba(31, 28, 26, 0.08);
  color: var(--ink);
  font-size: 1.45rem;
}

.site-footer {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  color: var(--muted);
  padding-bottom: 10px;
}

.auth-body {
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.auth-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: stretch;
}

.auth-copy,
.auth-card {
  padding: 32px;
}

.auth-copy h1 {
  max-width: 11ch;
}

.auth-feature-list {
  margin-top: 26px;
  display: grid;
  gap: 16px;
}

.auth-feature-list article {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(72, 52, 35, 0.08);
}

.auth-feature-list strong,
.auth-feature-list span {
  display: block;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--muted);
}

.error-card {
  max-width: 620px;
}

@media (max-width: 980px) {
  .hero,
  .auth-layout,
  .dashboard-grid,
  .insight-strip {
    grid-template-columns: 1fr;
  }

  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  .toolbar,
  .controls-head,
  .selection-toolbar,
  .site-footer,
  .domain-heading,
  .panel-card-heading,
  .section-heading,
  .availability-copy,
  .summary-row,
  .summary-row-spread,
  .site-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: start;
  }
}

@media (max-width: 640px) {
  .app-shell,
  .auth-layout {
    width: min(100% - 18px, 100%);
    margin: 12px auto 24px;
  }

  .site-header,
  .hero,
  .controls-card,
  .panel-card,
  .manage-card,
  .auth-card,
  .auth-copy,
  .domain-group,
  .modal-card {
    padding: 18px;
    border-radius: 22px;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 100%;
    font-size: 2.6rem;
  }

  .toolbar {
    grid-template-columns: 1fr;
  }

  .selection-toolbar {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .header-status {
    width: 100%;
  }
}
