:root {
  --bg: #0a0a0a;
  --surface: #141414;
  --surface-2: #1c1a17;
  --border: #262626;
  --text: #f5f1ea;
  --muted: #8a857e;
  --accent: #c9b88a;
  --accent-dark: #8f7e58;
  --success: #8ac9a1;
  --danger: #e28c82;
  --warning: #d8bd73;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(201, 184, 138, 0.08), transparent 38%),
    radial-gradient(circle at 80% 0%, rgba(122, 64, 46, 0.18), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0;
}

.topbar,
.workspace {
  display: grid;
  gap: 20px;
}

.topbar {
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 116px;
  border-bottom: 1px solid var(--border);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.brand-logo {
  width: clamp(112px, 13vw, 168px);
  height: auto;
  object-fit: contain;
}

.eyebrow,
.mini-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  line-height: 0.88;
}

h2 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
  line-height: 1;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 12px;
  background: rgba(20, 20, 20, 0.72);
  color: var(--muted);
  white-space: nowrap;
}

.status-pill.accent {
  color: var(--text);
  border-color: rgba(201, 184, 138, 0.42);
}

.status-pill svg,
button svg,
.search-wrap svg {
  width: 18px;
  height: 18px;
  stroke-width: 1.8;
}

.workspace {
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  align-items: start;
  margin-top: 24px;
}

.booking-panel,
.booking-list-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(20, 20, 20, 0.92);
  box-shadow: var(--shadow);
}

.booking-panel {
  position: sticky;
  top: 20px;
  padding: 22px;
}

.booking-list-panel {
  min-width: 0;
  padding: 22px;
}

.panel-heading,
.list-toolbar,
.form-actions,
.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.icon-button,
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(201, 184, 138, 0.34);
  border-radius: 6px;
  color: var(--text);
  background: #1f1d19;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.icon-button:hover,
.primary-button:hover,
.secondary-button:hover {
  border-color: var(--accent);
  background: #28241c;
}

.icon-button:active,
.primary-button:active,
.secondary-button:active {
  transform: translateY(1px);
}

.icon-button.danger {
  border-color: rgba(226, 140, 130, 0.34);
}

.icon-button.danger:hover {
  border-color: var(--danger);
  background: rgba(226, 140, 130, 0.12);
}

.eligibility-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  min-height: 96px;
  margin: 22px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-2);
}

.eligibility-box strong,
.eligibility-box span {
  display: block;
}

.eligibility-box strong {
  margin-top: 6px;
  font-size: 1rem;
}

.eligibility-box span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.eligibility-box svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.eligibility-box.valid {
  border-color: rgba(138, 201, 161, 0.46);
}

.eligibility-box.valid svg,
.eligible {
  color: var(--success);
}

.eligibility-box.invalid {
  border-color: rgba(226, 140, 130, 0.52);
}

.eligibility-box.invalid svg,
.ineligible {
  color: var(--danger);
}

.booking-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}

.booking-type label {
  position: relative;
}

.booking-type input {
  position: absolute;
  inset: 0;
  opacity: 0;
}

.booking-type span {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f0f0f;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.booking-type input:checked + span {
  border-color: var(--accent);
  background: #28241c;
  color: var(--text);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

label.wide {
  grid-column: 1 / -1;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 13px;
  outline: none;
  background: #0f0f0f;
  color: var(--text);
  appearance: none;
}

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 184, 138, 0.12);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  margin-top: 18px;
}

.primary-button {
  grid-column: 1 / -1;
  min-height: 50px;
  width: 100%;
  min-width: 0;
  gap: 9px;
  padding: 0 18px;
  background: linear-gradient(180deg, #c9b88a, #a89564);
  border-color: #d5c494;
  color: #12100b;
  font-weight: 800;
  white-space: nowrap;
}

.primary-button:hover {
  background: linear-gradient(180deg, #ddcc9c, #b7a26b);
  color: #0a0a0a;
}

.primary-button[disabled] {
  cursor: not-allowed;
  border-color: var(--border);
  background: #1f1d19;
  color: var(--muted);
}

.primary-button strong {
  display: inline-grid;
  place-items: center;
  min-width: 58px;
  min-height: 26px;
  border-radius: 4px;
  padding: 0 7px;
  background: rgba(10, 10, 10, 0.18);
}

.secondary-button {
  width: 100%;
  min-height: 50px;
  gap: 8px;
  padding: 0 14px;
  font-weight: 800;
  white-space: nowrap;
}

.secondary-button[disabled] {
  cursor: progress;
  opacity: 0.68;
}

select[disabled],
input[readonly] {
  color: var(--muted);
  background-color: #111;
}

.form-message {
  grid-column: 1 / -1;
  min-height: 40px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
  text-align: left;
}

.search-wrap {
  position: relative;
  display: block;
  margin: 20px 0 14px;
}

.search-wrap svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-wrap input {
  padding-left: 43px;
}

.table-wrap {
  position: relative;
  overflow: auto;
  max-height: calc(100vh - 282px);
  min-height: 360px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-size: 0.92rem;
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.row-actions {
  text-align: right;
}

.row-delete {
  width: 34px;
  height: 34px;
}

.empty-state {
  position: absolute;
  inset: 64px 0 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state svg {
  width: 36px;
  height: 36px;
  color: var(--accent);
}

.empty-state strong {
  color: var(--text);
}

.scroll-area::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.scroll-area::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.scroll-area::-webkit-scrollbar-thumb:hover {
  background: #3a3a3a;
}

@media (max-width: 980px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .status-strip {
    justify-content: flex-start;
  }

  .booking-panel {
    position: static;
  }

  .table-wrap {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 20px, 1440px);
    padding: 14px 0;
  }

  .topbar {
    min-height: auto;
    padding-bottom: 16px;
  }

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

  .brand-logo {
    width: 92px;
  }

  .booking-panel,
  .booking-list-panel {
    padding: 16px;
  }

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

  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .form-message {
    text-align: left;
  }
}

.member-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.member-picker .mini-label {
  margin-bottom: 0.25rem;
}

.member-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  padding: 0.625rem 0.875rem;
  background: var(--surface-2, #1a1a1a);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 0.5rem;
  color: inherit;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.member-pick-btn:hover {
  border-color: var(--accent, #c9a84c);
  background: var(--surface-3, #222);
}

.member-pick-btn strong {
  font-size: 0.9rem;
}

.member-pick-btn span {
  font-size: 0.78rem;
  opacity: 0.65;
}
