:root {
  color-scheme: light;
  --ink: #1f211f;
  --muted: #6f726d;
  --line: #ded9cc;
  --panel: #ffffff;
  --page: #f5f2eb;
  --gold: #b98a34;
  --gold-strong: #8a6220;
  --green: #1f7a4d;
  --red: #a23b3b;
  --blue: #2f5d8c;
  --shadow: 0 14px 40px rgba(31, 33, 31, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(31, 33, 31, 0.6), rgba(31, 33, 31, 0.68)),
    url("https://images.unsplash.com/photo-1519167758481-83f550bb49b3?auto=format&fit=crop&w=1800&q=80")
      center/cover;
}

.auth-panel {
  width: min(100%, 440px);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

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

.auth-copy {
  margin: 12px 0 22px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-mount {
  min-height: 96px;
}

.auth-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.notice {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #fff8e8;
  color: #6b4b16;
}

.warning {
  border-color: #e4be74;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: #24231f;
  color: #f7f2e7;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.brand span {
  display: block;
  color: #c8c1b2;
  font-size: 13px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: #3a3329;
  color: #f2c879 !important;
  font-weight: 800;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  min-height: 42px;
  border: 0;
  padding: 0 12px;
  background: transparent;
  color: #d8d1c2;
  text-align: left;
}

.nav-item.active,
.nav-item:hover {
  background: #3a3329;
  color: #ffffff;
}

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

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

.topbar h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.05;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fffaf0;
  color: var(--gold-strong);
  font-size: 12px;
  font-weight: 700;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 0 rgba(31, 33, 31, 0.04);
}

.metric {
  padding: 16px;
}

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

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.content-grid {
  display: grid;
  gap: 16px;
}

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

.content-grid.split {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.55fr);
}

.panel {
  padding: 18px;
}

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

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

.item {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fcfaf5;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.filters,
.button-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filters > * {
  flex: 1 1 220px;
}

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

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

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  background: #fffdfa;
  color: var(--ink);
  padding: 9px 10px;
}

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

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid rgba(185, 138, 52, 0.4);
  outline-offset: 2px;
}

.primary-button,
.secondary-button,
.text-button {
  min-height: 40px;
  border: 1px solid transparent;
  padding: 0 14px;
  font-weight: 800;
}

.primary-button {
  background: var(--gold);
  color: #181611;
}

.secondary-button {
  background: #fffaf0;
  border-color: var(--line);
  color: var(--gold-strong);
}

.text-button {
  background: transparent;
  color: var(--gold-strong);
  padding: 0 4px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
  background: #fffdfa;
}

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

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

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 8px;
  background: #f3efe5;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.status.booked,
.status.confirmed,
.status.deposit-paid,
.status.balance-paid {
  background: #e8f3ec;
  color: var(--green);
}

.status.lost,
.status.cancelled,
.status.blocked {
  background: #f7e7e7;
  color: var(--red);
}

.status.tentative,
.status.tour-booked,
.status.proposal-sent {
  background: #e8eef7;
  color: var(--blue);
}

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

.day,
.weekday {
  min-height: 74px;
  border: 1px solid var(--line);
  background: #fffdfa;
  padding: 8px;
}

.weekday {
  min-height: 34px;
  background: #f0eadf;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.day {
  display: grid;
  align-content: space-between;
  text-align: left;
}

.day strong {
  font-size: 16px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #24231f;
  color: #fff;
  box-shadow: var(--shadow);
}

[hidden] {
  display: none !important;
}

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

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

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

  .nav-item {
    text-align: center;
  }

  .content-grid.two,
  .content-grid.split,
  .metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 16px;
  }

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

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

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

  .calendar-grid {
    gap: 4px;
  }

  .day,
  .weekday {
    min-height: 52px;
    padding: 6px;
  }
}
