:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --ink: #10201f;
  --muted: #677573;
  --line: #dce3df;
  --accent: #0f766e;
  --accent-dark: #0b5c55;
  --gold: #b7791f;
  --rose: #b42318;
  --green: #16784f;
  --shadow: 0 16px 40px rgba(31, 45, 42, 0.08);
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  border: 0;
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

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

.login-panel {
  width: min(430px, 100%);
  padding: 32px;
}

.login-panel h1,
.sidebar h1,
.topbar h2,
.panel h3 {
  margin: 0;
}

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

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: none;
}

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

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

.login-panel label + label,
.login-panel button {
  margin-top: 16px;
}

.primary,
.secondary,
.ghost,
.text-button,
.nav-button,
.icon-button {
  border-radius: 7px;
  font-weight: 800;
  min-height: 40px;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.primary {
  background: var(--accent);
  color: #fff;
  padding: 0 16px;
}

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

.secondary {
  background: #e8f3f1;
  color: var(--accent-dark);
  padding: 0 14px;
}

.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0 14px;
}

.text-button {
  background: transparent;
  color: var(--accent);
  min-height: 32px;
}

.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  padding: 28px 22px;
  background: #10201f;
  color: #fff;
}

.sidebar .eyebrow,
.sidebar .ghost {
  color: #9bd3cb;
}

.sidebar h1 {
  font-size: 23px;
  line-height: 1.08;
}

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

.nav-button {
  width: 100%;
  background: transparent;
  color: #d9e7e5;
  text-align: left;
  padding: 0 12px;
}

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

.workspace {
  min-width: 0;
  padding: 28px;
}

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

.topbar h2 {
  font-size: 32px;
}

.actions,
.toolbar,
.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 18px;
}

.panel {
  padding: 18px;
}

.panel-head,
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

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

.row-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.row-card h4 {
  margin: 0 0 5px;
  font-size: 16px;
}

.stack-actions {
  display: grid;
  align-content: start;
  justify-items: end;
  gap: 8px;
}

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

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: #edf1ef;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.badge.confirmed,
.badge.imported,
.badge.paid {
  background: #e7f4ed;
  color: var(--green);
}

.badge.pending,
.badge.amended {
  background: #fff4df;
  color: var(--gold);
}

.badge.cancelled,
.badge.failed {
  background: #ffe8e5;
  color: var(--rose);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 12px;
}

.day {
  min-height: 340px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.day h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.booking-chip {
  width: 100%;
  display: block;
  margin: 8px 0;
  padding: 10px;
  border-radius: 7px;
  background: #f0faf8;
  color: var(--ink);
  text-align: left;
}

.booking-chip strong {
  display: block;
}

.toolbar {
  margin-bottom: 12px;
}

.toolbar input {
  max-width: 360px;
}

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

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

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

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

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

.empty {
  color: var(--muted);
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}

dialog {
  width: min(940px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 0;
}

dialog::backdrop {
  background: rgba(16, 32, 31, 0.48);
}

.booking-form {
  padding: 20px;
}

.icon-button {
  width: 38px;
  height: 38px;
  background: #edf1ef;
  color: var(--ink);
  font-size: 22px;
}

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

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

.addons-editor {
  margin-top: 16px;
}

.addon-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 44px;
  gap: 10px;
  margin-bottom: 10px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 15px;
  border-radius: 8px;
  background: #10201f;
  color: #fff;
  box-shadow: var(--shadow);
  z-index: 10;
}

.notice {
  min-height: 20px;
  color: var(--rose);
  font-size: 13px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

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

  .split,
  .stat-grid,
  .calendar-grid,
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }

  .day {
    min-height: 220px;
  }
}

@media (max-width: 720px) {
  .workspace,
  .sidebar {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav,
  .split,
  .stat-grid,
  .calendar-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

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

  .actions,
  .actions button,
  .form-actions,
  .form-actions button {
    width: 100%;
  }
}
