:root {
  --ink: #101210;
  --muted: #676d61;
  --line: #dcded6;
  --surface: #ffffff;
  --band: #f4f7eb;
  --accent: #77b82a;
  --accent-dark: #3f7f16;
  --warn: #a15c00;
  --danger: #9f2433;
  --shadow: 0 18px 45px rgba(36, 49, 42, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #fafaf5;
  font-family: Arial, Helvetica, sans-serif;
}

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

button {
  cursor: pointer;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 22px clamp(16px, 4vw, 32px);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.95), rgba(16, 18, 16, 0.9) 48%, rgba(119, 184, 42, 0.16)),
    #101210;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  max-width: 720px;
  margin: 6px 0 0;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 1.05;
  letter-spacing: 0;
  color: #fff;
}

.brand-line {
  max-width: 680px;
  margin: 10px 0 0;
  color: #dfead4;
  font-weight: 700;
}

.brand-lockup {
  display: flex;
  align-items: start;
  gap: 18px;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  color: #fff;
  font-size: 32px;
  font-weight: 900;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tabs {
  display: inline-flex;
  width: 100%;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
}

.tab-button {
  flex: 1;
  min-height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  color: #e8efe0;
  background: transparent;
  font-weight: 700;
}

.tab-button.active {
  color: #fff;
  background: var(--accent-dark);
}

main {
  padding: 18px clamp(12px, 4vw, 28px) 42px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.availability-band,
.admin-header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 18px;
}

.topbar .eyebrow {
  color: var(--accent);
}

.availability-band h2,
.admin-header h2,
.section-heading h2 {
  margin: 5px 0 0;
  font-size: 25px;
  line-height: 1.2;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.slot-card {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 30px rgba(36, 49, 42, 0.05);
}

.slot-card strong {
  display: block;
  margin-bottom: 8px;
}

.slot-card span {
  color: var(--muted);
  font-size: 14px;
}

.slot-card.full {
  border-color: #e8c6c9;
  background: #fff6f6;
}

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

.panel,
.receipt-panel {
  padding: clamp(16px, 4vw, 22px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.compact {
  box-shadow: none;
}

.section-heading {
  margin-bottom: 20px;
}

.field-grid {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.field-grid.two {
  grid-template-columns: 1fr;
}

label {
  display: grid;
  gap: 7px;
  color: #344039;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #cfd8d1;
  border-radius: 6px;
  color: var(--ink);
  background: #fff;
}

textarea {
  resize: vertical;
}

.contact-note {
  display: grid;
  gap: 16px;
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--band);
}

.order-items-box {
  display: grid;
  gap: 14px;
  margin: 18px 0;
  padding: clamp(12px, 4vw, 18px);
  border: 1px solid #cddbc3;
  border-radius: 8px;
  background: #f7faef;
}

.items-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.item-grid-head,
.order-item-row {
  display: grid;
  gap: 10px;
}

.item-grid-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.order-item-row {
  gap: 14px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #dce5d4;
  border-radius: 8px;
  background: #fff;
}

.order-item-row label {
  gap: 4px;
}

.animal-card-top,
.animal-card-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.animal-card-bottom {
  grid-template-columns: 1fr 1fr;
}

.animal-card-section {
  display: grid;
  gap: 8px;
}

.card-section-label,
.order-item-row .mobile-label {
  color: #344039;
  font-size: 14px;
  font-weight: 800;
}

.chip-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-chip {
  display: block;
  position: relative;
}

.check-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-chip span {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid #cfd8d1;
  border-radius: 6px;
  background: #f9fbf5;
  color: #26352d;
  font-weight: 900;
}

.check-chip input:checked + span {
  border-color: var(--accent-dark);
  background: #e6f3d8;
  color: var(--accent-dark);
}

.check-chip input:disabled + span {
  opacity: 0.45;
  background: #eef0ea;
}

.small-action,
.duplicate-item,
.remove-item {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #101210;
  color: #fff;
  font-weight: 800;
}

.item-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.duplicate-item {
  min-height: 44px;
}

.remove-item {
  min-height: 44px;
  padding: 0 12px;
  background: #e7eadf;
  color: #101210;
}

.service-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.service-option input {
  width: auto;
  min-height: 0;
}

.total-box {
  padding: 14px;
  border-radius: 6px;
  background: #101210;
  color: var(--accent);
  font-size: 24px;
  font-weight: 900;
}

.contact-note h3,
.panel h3,
.receipt-panel h2 {
  margin: 4px 0 0;
}

.notice {
  padding: 12px;
  border-left: 4px solid var(--accent);
  background: #fff;
  color: var(--muted);
  font-size: 14px;
}

.primary-action,
.secondary-action,
.admin-actions button,
.table-action {
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.secondary-action,
.admin-actions button,
.table-action {
  background: #26352d;
}

.submit-actions {
  display: grid;
  gap: 10px;
}

.table-action {
  min-height: 34px;
  margin: 0 4px 6px 0;
  font-size: 13px;
}

.message-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  background: rgba(16, 18, 16, 0.44);
}

.message-drawer.hidden {
  display: none;
}

.message-drawer-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  width: min(560px, 100%);
  height: 100%;
  padding: 18px;
  background: var(--paper);
  box-shadow: -12px 0 28px rgba(0, 0, 0, 0.18);
}

.message-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.message-drawer-header h2 {
  margin: 4px 0 0;
}

.message-drawer-header button,
.media-link {
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: #e7eadf;
  color: var(--ink);
  font-weight: 800;
}

.message-thread {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 14px 2px;
}

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

.message-bubble {
  width: min(88%, 420px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.message-bubble.outgoing {
  justify-self: end;
  background: #e6f3d8;
  border-color: #b8d8a0;
}

.message-bubble p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.message-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.message-reply-form {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.media-link {
  margin-top: 10px;
}

.primary-action:disabled {
  cursor: wait;
  opacity: 0.7;
}

.form-status {
  min-height: 22px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.form-status.success {
  color: var(--accent-dark);
}

.form-status.warning {
  color: var(--warn);
}

.form-status.error {
  color: var(--danger);
}

.receipt-panel {
  position: static;
}

.receipt-number {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  margin: 12px 0;
  padding: 0 14px;
  border-radius: 6px;
  background: #e6f3ef;
  color: var(--accent-dark);
  font-size: 22px;
  font-weight: 900;
}

.receipt-list {
  display: grid;
  gap: 9px;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.receipt-list strong {
  color: var(--ink);
}

.mail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}

.secondary-mail {
  margin-top: 8px;
  background: #e7eadf;
  color: var(--ink);
}

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

.admin-page {
  display: none;
}

.admin-page.active {
  display: block;
}

.active-admin-action {
  background: var(--accent-dark) !important;
}

.capacity-panel {
  max-width: 720px;
}

#capacity-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.capacity-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  align-items: center;
  gap: 10px;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.table-toolbar input {
  max-width: 320px;
}

.table-scroll {
  overflow: auto;
}

table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
}

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

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf3ee;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

.status-pill.pending {
  background: #fff3dd;
  color: var(--warn);
}

.status-pill.cash {
  background: #eef0f4;
  color: #384252;
}

.status-pill.cancelled {
  background: #f9e5e8;
  color: var(--danger);
}

.status-select {
  width: 100%;
  min-width: 190px;
  min-height: 36px;
  margin-top: 8px;
  padding: 6px 8px;
  font-size: 13px;
}

.lot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 6px;
  background: #101210;
  color: var(--accent);
  font-weight: 900;
}

.cut-cell {
  max-width: 170px;
  color: #344039;
  font-size: 13px;
  line-height: 1.35;
}

.hidden {
  display: none;
}

.admin-login-panel {
  max-width: 560px;
  margin: 0 auto;
}

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

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

.confirmation-page {
  min-height: 100vh;
  background: var(--band);
}

.confirmation-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(14px, 4vw, 28px);
}

.confirmation-card h1 {
  margin: 4px 0 0;
  font-size: clamp(30px, 8vw, 52px);
}

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

.confirmation-note {
  margin-top: 10px;
  color: var(--muted);
}

.confirmation-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.confirmation-list div,
.confirmation-item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.confirmation-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.confirmation-list dd {
  margin: 0;
  font-weight: 800;
}

.confirmation-section {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.confirmation-section h2 {
  margin: 0;
}

.confirmation-items {
  display: grid;
  gap: 10px;
}

.legal-page {
  background: var(--band);
}

.legal-shell {
  width: min(900px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 34px);
}

.legal-card h1 {
  margin: 4px 0 18px;
  font-size: clamp(34px, 8vw, 54px);
}

.legal-card h2 {
  margin: 26px 0 8px;
  font-size: 20px;
}

.legal-card p,
.legal-card li {
  color: #30382f;
  line-height: 1.65;
}

.legal-card a {
  color: var(--accent-dark);
  font-weight: 800;
}

.site-footer {
  padding: 22px;
  text-align: center;
}

.site-footer a {
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 760px) {
  .brand-lockup,
  .items-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .item-grid-head {
    display: none;
  }
}

@media (max-width: 640px) {
  .tabs,
  .admin-actions {
    width: 100%;
  }

  .tab-button,
  .admin-actions button {
    flex: 1;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 760px) {
  .topbar {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .tabs {
    width: auto;
  }

  .slot-grid {
    grid-template-columns: repeat(4, minmax(145px, 1fr));
  }

  .field-grid.two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .item-grid-head {
    display: none;
  }

  .order-item-row {
    grid-template-columns: 1fr;
  }

  .animal-card-top {
    grid-template-columns: 1fr;
  }

  .animal-card-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chip-group {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1000px) {
  .form-layout {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.6fr);
  }

  .receipt-panel {
    position: sticky;
    top: 20px;
  }

}
