:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef2f3;
  --text: #171a1f;
  --muted: #69727d;
  --border: #d9dfdf;
  --primary: #0f766e;
  --primary-dark: #0b5e58;
  --danger: #b42318;
  --warning: #b54708;
  --success: #067647;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

button.secondary {
  background: var(--surface-2);
  color: var(--text);
}

button.danger {
  background: var(--danger);
}

button.warning {
  background: var(--warning);
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  min-height: 40px;
  padding: 9px 11px;
}

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

.loading,
.login {
  width: min(440px, calc(100vw - 32px));
  margin: 12vh auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 24px;
}

.login h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login p,
.muted {
  color: var(--muted);
}

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

.shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #111827;
  color: #f9fafb;
  padding: 24px 18px;
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
}

.brand strong {
  font-size: 20px;
}

.brand span {
  color: #a7b0bd;
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  background: transparent;
  color: #d1d5db;
  text-align: left;
  justify-content: start;
  border-radius: 8px;
}

.nav button.active,
.nav button:hover {
  background: rgba(255, 255, 255, 0.11);
  color: #fff;
}

.main {
  padding: 26px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.topbar,
.toolbar,
.card,
.tableWrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.topbar,
.toolbar {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toolbar {
  flex-wrap: wrap;
  box-shadow: none;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
}

.card {
  padding: 16px;
}

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

.metric {
  display: grid;
  gap: 6px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  font-size: 24px;
}

.tableWrap {
  overflow: auto;
}

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

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

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

tr:hover td {
  background: #fbfcfc;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: var(--surface-2);
  color: var(--muted);
}

.pill.approved,
.pill.active,
.pill.confirmed,
.pill.checked_in {
  background: #dcfae6;
  color: var(--success);
}

.pill.pending_review,
.pill.pending,
.pill.draft,
.pill.inactive {
  background: #fef0c7;
  color: var(--warning);
}

.pill.rejected,
.pill.suspended,
.pill.cancelled,
.pill.refunded {
  background: #fee4e2;
  color: var(--danger);
}

.drawer {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  display: grid;
  justify-items: end;
  z-index: 10;
}

.drawerPanel {
  width: min(620px, 100vw);
  height: 100vh;
  overflow: auto;
  background: var(--surface);
  padding: 22px;
  display: grid;
  gap: 16px;
}

.drawerPanel h2 {
  margin: 0;
}

.details {
  display: grid;
  gap: 10px;
}

.details div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.details dt {
  color: var(--muted);
}

.details dd {
  margin: 0;
  word-break: break-word;
}

.error {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
  }

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

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