:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #61707d;
  --line: #d9e1e7;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(18, 38, 63, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 36%),
    linear-gradient(315deg, rgba(180, 35, 24, 0.08), transparent 34%),
    var(--bg);
  font-family: Arial, Helvetica, sans-serif;
}

body.modal-open {
  overflow: hidden;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.form-panel {
  padding: 28px;
}

.table-panel {
  min-width: 0;
  padding: 24px;
}

.panel-header {
  margin-bottom: 22px;
}

.panel-header.compact {
  margin-bottom: 16px;
}

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

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: 1.4rem;
}

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

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfd;
  font: inherit;
  font-weight: 500;
  outline: none;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

small {
  min-height: 16px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 700;
}

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

button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  color: #ffffff;
  background: var(--accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.status {
  min-height: 20px;
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

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

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

td {
  font-size: 0.92rem;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.pagination button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.86rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 13, 20, 0.56);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(360px, 100%);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 26px 24px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  background: #edf2f4;
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--line);
}

.qr-title,
.qr-code {
  margin: 0;
  font-weight: 800;
}

.qr-title {
  color: var(--accent-dark);
}

.qr-code {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.loading-panel {
  gap: 12px;
}

.loading-title,
.loading-message {
  margin: 0;
  text-align: center;
}

.loading-title {
  color: var(--accent-dark);
  font-size: 1.15rem;
  font-weight: 800;
}

.loading-message {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #d9e1e7;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#booking-qr {
  width: 220px;
  height: 220px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--line);
}

@media (max-width: 840px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 24px 0;
  }

  .form-panel,
  .table-panel {
    padding: 22px;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
  }

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