:root {
  --ink: #17221f;
  --muted: #60706a;
  --canvas: #f4f7f6;
  --surface: #ffffff;
  --line: #d7e0dc;
  --line-strong: #b9c8c2;
  --brand: #176b57;
  --brand-dark: #0e4f40;
  --brand-soft: #e3f2ed;
  --blue: #246b86;
  --blue-soft: #e4f1f6;
  --gold: #9b6b12;
  --gold-soft: #fff2d5;
  --danger: #a43f3f;
  --danger-dark: #7e2e2e;
  --danger-soft: #fae8e8;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
}

a {
  color: var(--brand-dark);
}

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

.site-header {
  min-height: 68px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  width: min(1240px, 94%);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.brand {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 620;
  text-transform: uppercase;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--brand);
  color: white;
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1.15rem;
}

nav a {
  flex: none;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
  text-decoration: none;
}

nav a:hover,
.text-link:hover,
.back-link:hover {
  color: var(--brand);
}

.account-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.account-actions form {
  margin: 0;
}

.text-link,
.back-link {
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.container {
  width: min(1180px, 92%);
  margin: 0 auto;
  padding: 2.75rem 0 5rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.65rem;
  font-weight: 500;
  line-height: 1.08;
}

h2 {
  margin-bottom: 0;
  font-size: 1.2rem;
}

.eyebrow {
  margin-bottom: 0.5rem;
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.page-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.page-heading {
  margin-bottom: 2rem;
}

.compact-heading {
  margin-bottom: 1.5rem;
}

.page-actions,
.form-actions,
.month-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.button {
  min-height: 42px;
  padding: 0.62rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand);
  border-radius: 5px;
  background: var(--brand);
  color: white;
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.button-quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button-quiet:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

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

.button-danger:hover {
  border-color: var(--danger-dark);
  background: var(--danger-dark);
}

.button-small {
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
}

.metrics {
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.metric {
  min-height: 136px;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.metric-accent {
  border-top-color: var(--blue);
}

.metric-warm {
  border-top-color: var(--gold);
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.metric strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.25rem;
  font-weight: 500;
}

.section-block {
  padding-top: 1.4rem;
  border-top: 2px solid var(--ink);
}

.section-heading {
  margin-bottom: 1rem;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

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

th {
  background: #edf2f0;
  color: #4b5a55;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

tbody tr:hover {
  background: #f8fbfa;
}

.record-link,
.table-action a {
  font-weight: 700;
  text-decoration: none;
}

.table-action {
  text-align: right;
}

.empty-cell,
.empty-state,
.empty-inline {
  color: var(--muted);
}

.empty-cell {
  padding: 2rem;
  text-align: center;
}

.empty-state {
  margin: 1.5rem 0;
}

.empty-inline {
  font-size: 0.86rem;
}

.status {
  display: inline-flex;
  min-height: 26px;
  padding: 0.2rem 0.6rem;
  align-items: center;
  border-radius: 999px;
  background: #e9eeec;
  color: #45534e;
  font-size: 0.76rem;
  font-weight: 750;
  white-space: nowrap;
}

.status-available,
.status-active,
.status-in_stay {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.status-future,
.status-option,
.status-confirmed {
  background: var(--blue-soft);
  color: #18536a;
}

.status-maintenance,
.status-blocked {
  background: var(--gold-soft);
  color: #76500d;
}

.status-cancelled {
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.filter-bar {
  max-width: 560px;
  margin-bottom: 1rem;
  display: flex;
  gap: 0.6rem;
}

.form-control {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
}

textarea.form-control {
  min-height: 116px;
  resize: vertical;
}

.form-control:focus {
  border-color: var(--brand);
  outline: 3px solid rgb(23 107 87 / 16%);
}

.entity-form {
  max-width: 820px;
  padding-top: 1.5rem;
  border-top: 2px solid var(--ink);
}

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

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

.form-field label,
.field label {
  display: block;
  margin-bottom: 0.38rem;
  font-size: 0.84rem;
  font-weight: 740;
}

.form-field small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.76rem;
}

.form-actions {
  margin-top: 1.5rem;
}

.error,
.errorlist,
.form-errors {
  color: var(--danger-dark);
  font-size: 0.84rem;
}

.errorlist {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.form-errors {
  margin-bottom: 1rem;
  padding: 0.75rem;
  border-left: 3px solid var(--danger);
  background: var(--danger-soft);
}

.detail-grid {
  margin: 0 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 2px solid var(--ink);
}

.detail-grid > div {
  min-height: 95px;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}

.detail-grid > div:nth-child(odd) {
  padding-right: 2rem;
}

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

.detail-grid dt {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 780;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.back-link {
  font-weight: 700;
  text-decoration: none;
}

.confirm-block {
  max-width: 620px;
  padding-top: 1.5rem;
  border-top: 3px solid var(--danger);
}

.confirm-block h1 {
  margin-bottom: 1rem;
}

.notices {
  margin-bottom: 1.25rem;
}

.notice {
  margin: 0 0 0.5rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.88rem;
}

.notice-error {
  border-left-color: var(--danger);
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.pagination {
  margin-top: 1rem;
  justify-content: flex-end;
}

.pagination span {
  color: var(--muted);
  font-size: 0.84rem;
}

.calendar-list {
  border-bottom: 1px solid var(--line);
}

.room-row {
  min-height: 92px;
  padding: 1rem 0;
  display: grid;
  grid-template-columns: minmax(140px, 0.24fr) 1fr;
  gap: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.room-row:last-child {
  border-bottom: 0;
}

.room-row header a,
.room-row header span {
  display: block;
}

.room-row header a {
  font-weight: 750;
  text-decoration: none;
}

.room-row header span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.stays {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.stay {
  min-width: 150px;
  padding: 0.58rem 0.7rem;
  display: inline-flex;
  flex-direction: column;
  border-left: 4px solid var(--brand);
  border-radius: 4px;
  background: var(--brand-soft);
  color: var(--ink);
  text-decoration: none;
}

.stay span {
  color: var(--muted);
  font-size: 0.74rem;
}

.stay-future,
.stay-option,
.stay-confirmed {
  border-left-color: var(--blue);
  background: var(--blue-soft);
}

.stay-blocked {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}

.login-card {
  width: min(460px, 100%);
  margin: 6vh auto 0;
  padding: 2rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.login-card h1 {
  margin-bottom: 1rem;
  font-size: 2.25rem;
}

.field {
  margin: 1rem 0;
}

.field input {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: white;
}

.visually-hidden {
  width: 1px;
  height: 1px;
  padding: 0;
  position: absolute;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .header-inner {
    padding: 0.8rem 0;
    flex-wrap: wrap;
    gap: 0.8rem 1.25rem;
  }

  .header-inner nav {
    width: 100%;
    order: 3;
    padding-bottom: 0.2rem;
    overflow-x: auto;
  }

  .account-actions {
    margin-left: auto;
  }
}

@media (max-width: 720px) {
  .container {
    width: min(94%, 1180px);
    padding-top: 2rem;
  }

  h1 {
    font-size: 2.05rem;
  }

  .page-heading,
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .detail-wide {
    grid-column: auto;
  }

  .detail-grid > div:nth-child(odd) {
    padding-right: 0;
  }

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

  .filter-bar {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .brand small,
  .account-actions .text-link {
    display: none;
  }

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

  .page-actions .button,
  .form-actions .button {
    flex: 1 1 auto;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }
}
