:root {
  --bg: #edf3f8;
  --paper: rgba(255, 255, 255, 0.9);
  --paper-strong: #ffffff;
  --ink: #1d2939;
  --muted: #667085;
  --line: #d6e1ee;
  --accent: #0f5f84;
  --accent-strong: #0a4a67;
  --accent-soft: #deeff7;
  --accent-wash: rgba(15, 95, 132, 0.08);
  --success: #e8f7ef;
  --success-ink: #166534;
  --warning: #fff3df;
  --warning-ink: #a15c00;
  --danger: #fde7e8;
  --danger-ink: #b42318;
  --shadow: 0 20px 50px rgba(16, 24, 40, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Noto Sans Ethiopic", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 95, 132, 0.18), transparent 24rem),
    radial-gradient(circle at 100% 0%, rgba(180, 214, 230, 0.45), transparent 22rem),
    linear-gradient(180deg, #eff5f9 0%, #e8eff5 100%);
}

a {
  color: inherit;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 56px;
}

.brand-bar {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.1);
  background: rgba(255, 255, 255, 0.92);
  padding: 5px;
}

.brand-text {
  color: var(--accent-strong);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
  max-width: 32rem;
}

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

.hero {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-login {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  align-items: start;
}

.hero-dashboard {
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  align-items: end;
}

.hero-centered {
  display: block;
  max-width: 920px;
  margin: 0 auto 24px;
  text-align: left;
}

.hero-dashboard-top {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 20px;
  max-width: 1140px;
  margin: 0 auto 18px;
}

.hero-dashboard-copy {
  min-width: 0;
}

.hero-dashboard-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.hero-dashboard-actions .button {
  width: auto;
  flex: 0 0 auto;
}

.logout-link {
  width: auto;
  min-width: 132px;
  padding: 9px 12px;
  gap: 8px;
  border-radius: 12px;
  white-space: nowrap;
  justify-content: center;
  text-align: center;
}

.logout-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.hero-login-main {
  display: grid;
  gap: 0;
}

.hero-copy {
  padding: 2px 0 10px;
}

.hero-login-points {
  margin-top: 24px;
}

.hero-side {
  display: flex;
  align-items: stretch;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3.3vw, 3rem);
  line-height: 1.03;
  letter-spacing: -0.025em;
  max-width: none;
  white-space: nowrap;
}

h2 {
  font-size: 1.3rem;
}

h3 {
  font-size: 1rem;
}

.lede {
  max-width: 56rem;
  color: #8a2f2d;
  font-size: 1.05rem;
  line-height: 1.65;
  font-weight: 500;
}

.hero-centered .eyebrow,
.hero-centered h1,
.hero-centered .lede {
  max-width: none;
}

.hero-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.hero-point,
.summary-item,
.family-card {
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(8px);
}

.hero-point strong,
.hero-point span {
  display: block;
}

.hero-point strong {
  margin-bottom: 6px;
}

.hero-point span {
  color: var(--muted);
  line-height: 1.5;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.compact-panel {
  display: grid;
  gap: 14px;
  width: 100%;
}

.hero-stat {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.auth-panel {
  display: grid;
  gap: 20px;
  align-self: start;
}

.auth-panel-head h2,
.panel-header h2 {
  margin: 0;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.dashboard-layout {
  align-items: stretch;
  grid-template-columns: minmax(340px, 0.88fr) minmax(420px, 1fr);
}

.panel-note {
  max-width: 1140px;
  margin: 0 auto 18px;
  padding: 16px 18px;
}

.note-text,
.note-closed {
  margin: 0;
}

.note-closed {
  margin-top: 8px;
  color: var(--accent);
  font-weight: 700;
}

.flash {
  max-width: 1140px;
  margin: 0 auto 18px;
  padding: 14px 16px;
  border: 1px solid #b7dfc4;
  border-radius: 16px;
  background: var(--success);
  color: var(--success-ink);
  font-weight: 600;
}

.flash-neutral {
  border-color: #cfe0ee;
  background: #f2f8fc;
  color: var(--accent-strong);
}

.welcome-card {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header-stack {
  align-items: start;
}

.filled-members-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.filled-members-panel {
  display: grid;
  gap: 16px;
}

.filled-members-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.filled-members-search input,
.filled-members-sort select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper-strong);
  color: var(--ink);
}

.filled-members-search input {
  min-width: min(32rem, 78vw);
  padding: 0 14px;
}

.filled-members-sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 600;
}

.filled-members-sort select {
  padding: 0 12px;
}

.filled-members-scroll {
  max-height: 68vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.7);
}

.filled-members-table {
  min-width: 1710px;
  width: max-content;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.filled-members-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #eef5fa;
  white-space: nowrap;
}

.filled-members-table th,
.filled-members-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.filled-members-table tbody tr:nth-child(odd) td {
  background: rgba(244, 248, 252, 0.92);
}

.filled-members-table tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.98);
}

.filled-members-table tbody tr:hover td {
  background: #e9f3f9;
}

.filled-members-table .sticky-name-cell,
.filled-members-table thead th:first-child {
  position: sticky;
  left: 0;
}

.filled-members-table thead th:first-child {
  z-index: 4;
  background: #dde8f4;
}

.filled-members-table .sticky-name-cell {
  z-index: 2;
  font-weight: 600;
  box-shadow: 1px 0 0 rgba(166, 184, 205, 0.75);
}

.filled-members-table tbody tr:nth-child(odd) .sticky-name-cell {
  background: rgba(236, 243, 249, 0.98);
}

.filled-members-table tbody tr:nth-child(even) .sticky-name-cell {
  background: rgba(247, 250, 253, 1);
}

.filled-members-table tbody tr:hover .sticky-name-cell {
  background: #dcecf7;
}

.filled-members-table .col-name {
  width: 250px;
}

.filled-members-table .col-ref {
  width: 130px;
}

.filled-members-table .col-mobile {
  width: 140px;
}

.filled-members-table .col-email {
  width: 260px;
}

.filled-members-table .col-pref {
  width: 170px;
}

.filled-members-table .col-role {
  width: 180px;
}

.filled-members-table .col-serving {
  width: 110px;
}

.filled-members-table .col-comments {
  width: 260px;
}

.filled-members-table .col-submitted {
  width: 170px;
}

.filled-members-empty {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.welcome-card-line {
  color: var(--success-ink);
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

.inline-delete-form {
  margin-top: 12px;
}

.meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.contact-line {
  display: block;
  margin-top: 10px;
  font-size: 1.02rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-block {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.95rem;
  font-weight: 600;
}

input,
select,
textarea,
.button {
  width: 100%;
  font: inherit;
}

input,
select,
textarea {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper-strong);
  color: var(--ink);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(15, 95, 132, 0.55);
  box-shadow: 0 0 0 4px rgba(15, 95, 132, 0.1);
}

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

input:disabled {
  background: #eef4fb;
  color: #5f6877;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.button:hover {
  background: var(--accent-strong);
  box-shadow: 0 14px 26px rgba(15, 95, 132, 0.18);
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.button-secondary {
  background: transparent;
  color: var(--accent);
  border-color: var(--line);
}

.button-secondary:hover {
  background: var(--accent-wash);
  color: var(--accent-strong);
}

.button-danger {
  background: #8f1d22;
}

.button-danger:hover {
  background: #72181c;
  box-shadow: 0 14px 26px rgba(143, 29, 34, 0.2);
}

.button-block {
  margin-top: 0;
}

.button-kicker {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.78rem;
  font-weight: 600;
}

.auth-button {
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 18px;
}

.auth-help h3 {
  margin-bottom: 10px;
}

.mock-search-hint {
  margin-top: 8px;
  font-size: 0.92rem;
}

.auth-help-compact {
  display: grid;
  gap: 8px;
}

.auth-help-compact .meta {
  font-size: 0.97rem;
}

.feature-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.feature-list li {
  margin: 10px 0;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--accent-strong);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-ready {
  background: var(--success);
  color: var(--success-ink);
}

.status-warning {
  background: var(--warning);
  color: var(--warning-ink);
}

.alert-card {
  padding: 16px;
  border: 1px solid transparent;
  border-radius: 16px;
  line-height: 1.55;
}

.alert-card-danger {
  border-color: #f0b9bd;
  background: var(--danger);
  color: var(--danger-ink);
}

.alert-card-warning {
  border-color: #f0d3a2;
  background: var(--warning);
  color: var(--warning-ink);
}

.alert-card-info {
  border-color: #b9d7e6;
  background: #eef7fb;
  color: var(--accent-strong);
}

.form-status-card {
  margin-bottom: 16px;
}

.form-toggle-button {
  margin-bottom: 16px;
}

.search-form,
.service-form {
  display: grid;
  gap: 24px;
}

.empty-state,
.selection-card {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: #f4f9ff;
  color: var(--muted);
}

.selection-card-compact {
  min-height: 138px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.selection-card-compact h3 {
  font-size: 1.1rem;
}

.selection-label,
.summary-label {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.selection-card h3 {
  margin-bottom: 6px;
  color: var(--ink);
}

.selection-card p:last-child {
  margin-bottom: 0;
}

.household-list,
.choice-stack,
.family-list {
  display: grid;
  gap: 14px;
}

.household-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-strong);
}

.household-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.household-head h3,
.household-head span {
  margin: 0;
}

.household-head span {
  color: var(--muted);
}

.member-list {
  margin: 0;
  padding-left: 18px;
}

.member-list li {
  margin: 10px 0;
}

.member-list li.match {
  color: var(--accent);
  font-weight: 700;
}

.member-list li span {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  vertical-align: middle;
}

.readonly-grid,
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.summary-item {
  background: #f6fbfe;
}

.summary-value {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.form-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.form-fieldset > * + * {
  margin-top: 22px;
}

.form-fieldset-locked {
  opacity: 0.82;
}

.form-fieldset-locked input:not([disabled]),
.form-fieldset-locked select,
.form-fieldset-locked textarea {
  pointer-events: none;
  background: #f5f8fc;
  color: #526175;
}

.family-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  background: #f8fbfd;
}

.family-card h3 {
  margin-bottom: 6px;
}

.family-card-current {
  border-color: rgba(15, 95, 132, 0.24);
  background: var(--accent-soft);
}

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

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

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #d9e4f1;
  text-align: left;
  vertical-align: top;
}

.form-actions,
.cancel-form {
  margin-top: 0;
}

th {
  color: var(--muted);
  font-size: 0.9rem;
}

.family-table-wrap {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fbfd;
}

.family-table thead th {
  background: #eef5fb;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.family-table th:first-child,
.family-table td:first-child {
  padding-left: 16px;
}

.family-table th:last-child,
.family-table td:last-child {
  padding-right: 16px;
}

.family-row-current {
  background: rgba(15, 95, 132, 0.08);
}

.family-table td .status-badge {
  font-size: 0.74rem;
}

@media (max-width: 920px) {
  .brand-bar {
    margin-bottom: 16px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
  }

  .brand-text {
    font-size: 0.84rem;
    max-width: 100%;
  }

  h1 {
    white-space: normal;
  }

  .hero-login,
  .hero-dashboard,
  .hero-dashboard-top,
  .layout,
  .readonly-grid,
  .field-grid,
  .hero-points {
    grid-template-columns: 1fr;
  }

  .hero-login {
    display: flex;
    flex-direction: column;
  }

  .hero-login-main {
    display: contents;
  }

  .hero-login-intro {
    order: 1;
  }

  .auth-panel {
    order: 2;
  }

  .hero-login-points {
    order: 3;
    margin-top: 24px;
  }

  .panel-header,
  .family-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-side {
    align-items: stretch;
  }

  .hero-centered {
    margin-bottom: 18px;
  }

  .hero-dashboard-actions {
    justify-content: flex-start;
  }

  .logout-link {
    align-self: flex-start;
  }
}

