:root {
  --bg: #f3eee4;
  --ink: #1b1914;
  --muted: #5d574c;
  --panel: #fffaf2;
  --line: #d9d0c1;
  --forest: #1e3d32;
  --gold: #b8893d;
  --error: #8b2e2e;
  --ok: #1e3d32;
  --sidebar-w: 18.5rem;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Outfit, system-ui, sans-serif;
  min-height: 100%;
}

body {
  background-image:
    radial-gradient(1200px 500px at 10% -10%, #e7d7b8 0%, transparent 55%),
    linear-gradient(180deg, #f7f1e6 0%, #efe6d6 100%);
}

a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--gold); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  background: var(--forest);
  color: #f6efe3;
  font-size: 0.75rem;
  border-radius: 0.4rem;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
}

.nav a {
  color: var(--ink);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.1rem;
}

.nav a:hover { border-bottom-color: var(--gold); }

.nav-user { color: var(--muted); }

.lang {
  display: inline-flex;
  gap: 0.35rem;
  margin-left: 0.5rem;
  padding-left: 0.9rem;
  border-left: 1px solid var(--line);
}

.lang a {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.lang a.is-active { color: var(--forest); font-weight: 600; }

.sidebar-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--panel);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.sidebar-toggle-bars,
.sidebar-toggle-bars::before,
.sidebar-toggle-bars::after {
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--ink);
  position: relative;
}

.sidebar-toggle-bars::before,
.sidebar-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.sidebar-toggle-bars::before { top: -5px; }
.sidebar-toggle-bars::after { top: 5px; }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - 4rem);
}

.shell-guest {
  grid-template-columns: 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(255, 250, 242, 0.72);
  padding: 1.25rem 0.85rem 2rem;
  position: sticky;
  top: 4rem;
  max-height: calc(100vh - 4rem);
  overflow: auto;
}

.sidebar-head {
  padding: 0 0.55rem 0.85rem;
}

.sidebar-title {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

.side-menu,
.side-menu-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}

.side-menu-sub {
  margin: 0.15rem 0 0.35rem 0.55rem;
  padding-left: 0.55rem;
  border-left: 1px solid var(--line);
}

.side-item { margin: 0.1rem 0; }

.side-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  list-style: none;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink);
}

.side-summary::-webkit-details-marker { display: none; }

.side-summary:hover { background: rgba(30, 61, 50, 0.06); }

.side-item.is-active > .side-branch > .side-summary,
.side-item.is-active > .side-link {
  color: var(--forest);
}

.side-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.side-branch[open] > .side-summary .side-chevron {
  transform: rotate(45deg);
}

.side-link {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 0.45rem;
  color: var(--ink);
  font-size: 0.9rem;
}

.side-link:hover { background: rgba(30, 61, 50, 0.06); color: var(--forest); }

.side-link.is-current {
  background: rgba(30, 61, 50, 0.1);
  color: var(--forest);
  font-weight: 600;
}

.side-menu-sub .side-summary {
  font-weight: 500;
  font-size: 0.88rem;
}

.shell-main {
  min-width: 0;
}

main { padding: 2rem 2rem 4rem; max-width: 1120px; }

.rentals-panel {
  max-width: none;
}

main:has(.rentals-panel) {
  max-width: none;
}

.hero h1, .panel h1 {
  font-family: Fraunces, Georgia, serif;
  font-weight: 650;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.15;
  margin: 0.4rem 0 1rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--gold);
  margin: 0;
}

.lead { color: var(--muted); max-width: 42rem; line-height: 1.55; }

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.hero-meta span {
  border: 1px solid var(--line);
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.85rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  padding: 2rem;
  box-shadow: 0 18px 40px rgba(40, 30, 12, 0.06);
}

.panel-narrow { max-width: 32rem; }

.form { display: grid; gap: 1rem; margin-top: 1.5rem; }

.form label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.opt { color: var(--muted); font-weight: 400; font-size: 0.8rem; }

.input, select.input {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 0.55rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  color: inherit;
}

.input:focus {
  outline: 2px solid #1e3d3255;
  border-color: var(--forest);
}

.is-invalid { border-color: var(--error); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.btn {
  justify-self: start;
  background: var(--forest);
  color: #f6efe3;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn:hover { background: #163028; }

.form-foot { color: var(--muted); font-size: 0.9rem; }

.check-row {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  grid-template-columns: none !important;
}

.btn-quiet {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-quiet:hover,
.btn-quiet.is-active {
  border-color: var(--forest);
  color: var(--forest);
  background: rgba(30, 61, 50, 0.06);
}

.btn-quiet.danger { color: var(--error); }

.calendar-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.calendar-nav-views {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-content: flex-start;
}

.calendar-period {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.5rem 0 1.25rem;
}

.calendar-empty { color: var(--muted); }

.calendar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.calendar-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
}

.calendar-item .meta,
.calendar-item .desc {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.table-wrap { overflow-x: auto; margin-top: 1.25rem; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
}

.menu-perm {
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  max-height: 22rem;
  overflow: auto;
  background: #fff;
}

.menu-perm:disabled { opacity: 0.55; }

.section-title {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.25rem;
  margin: 1.75rem 0 0.75rem;
}

.rentals-filter { margin: 1rem 0 1.5rem; }

.timeline-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: #fff;
  margin-bottom: 1.5rem;
}

.timeline-table {
  border-collapse: collapse;
  min-width: 100%;
  font-size: 0.72rem;
}

.timeline-table th,
.timeline-table td {
  border: 1px solid var(--line);
  padding: 0;
  text-align: center;
}

.timeline-apt {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--panel);
  text-align: left !important;
  padding: 0.45rem 0.6rem !important;
  min-width: 8.5rem;
  max-width: 10rem;
}

.timeline-apt a { font-weight: 600; display: block; }
.timeline-apt small { color: var(--muted); display: block; margin-top: 0.15rem; }
.timeline-apt .apt-prices { font-size: 0.68rem; line-height: 1.35; }
.timeline-apt .apt-status { font-size: 0.68rem; font-weight: 600; margin-top: 0.2rem; }

.timeline-apt.is-bookable {
  background: #e7f3ea;
  border-left: 3px solid #1e3d32;
}
.timeline-apt.is-bookable a,
.timeline-apt.is-bookable .apt-status { color: #1e3d32; }

.timeline-apt.is-unbookable {
  background: #f8e6e4;
  border-left: 3px solid #c62828;
}
.timeline-apt.is-unbookable a,
.timeline-apt.is-unbookable .apt-status { color: #c62828; }

.timeline-day {
  min-width: 2rem;
  width: 2rem;
  padding: 0.25rem 0.1rem !important;
  background: #faf7f1;
}

.timeline-day span { display: block; font-weight: 600; }
.timeline-day small { color: var(--muted); }
.timeline-day.is-weekend { background: #f0e8da; }

.timeline-cell {
  width: 2rem;
  min-width: 2rem;
  height: 2rem;
  vertical-align: middle;
  padding: 0.2rem !important;
  background: #e8e2d6;
}

.timeline-cell .day-sq {
  display: block !important;
  width: 1.45rem !important;
  height: 1.45rem !important;
  min-width: 1.45rem !important;
  min-height: 1.45rem !important;
  margin: 0 auto;
  border: 1px solid #bdb3a0;
  border-radius: 2px;
  box-sizing: border-box;
}

.timeline-cell.is-free {
  background: #f3eee4;
}

.timeline-cell.is-free .day-sq {
  background: #ffffff !important;
  border-color: #9a9080 !important;
  box-shadow: inset 0 0 0 1px #fff;
}

.timeline-cell.is-booked {
  background: #f5d6d3;
}

.timeline-cell.is-booked .day-sq {
  background: #d32f2f !important;
  border-color: #8e1b1b !important;
}

.topup-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.topup-inline .input {
  width: auto;
  min-width: 6rem;
  padding: 0.35rem 0.5rem;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1.5rem;
}

.flash-wrap { padding: 1rem 1.5rem 0; }

.flash {
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
}

.flash-error { background: #f6e4e0; color: var(--error); }
.flash-success { background: #e4eee8; color: var(--ok); }

.acc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.acc-card {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(60, 45, 20, 0.12);
  border-radius: 0.75rem;
  background: linear-gradient(165deg, #fffdf8, #f7f0e4);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.acc-card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.acc-card-value {
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  font-weight: 650;
}

.acc-card small { color: var(--muted); font-size: 0.8rem; }

.acc-card-link {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.acc-card-link:hover {
  border-color: rgba(60, 45, 20, 0.35);
  transform: translateY(-1px);
}

.budget-alloc-block {
  margin: 1rem 0 1.75rem;
}

.budget-alloc-bar {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(60, 45, 20, 0.08);
  overflow: hidden;
}

.budget-alloc-bar-fill {
  display: block;
  height: 100%;
  background: #6b4f2a;
  border-radius: inherit;
}

.budget-alloc-bar-fill.is-over {
  background: #a33b2d;
}

.acc-card.is-over .acc-card-value {
  color: #a33b2d;
}

.budget-alloc-hint {
  margin: -0.35rem 0 0.85rem;
  font-size: 0.85rem;
}

.acc-account-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.acc-account-list a {
  display: flex;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(60, 45, 20, 0.12);
  border-radius: 0.65rem;
  text-decoration: none;
  color: inherit;
  background: #fffdf8;
}

.acc-account-list a:hover { border-color: rgba(60, 45, 20, 0.28); }

.acc-account-list strong { font-variant-numeric: tabular-nums; min-width: 3.2rem; }

tr.is-draft td { background: #fbf6e8; }
tr.is-posted td { background: transparent; }

.acc-edit summary {
  cursor: pointer;
  color: var(--accent, #6b4f2a);
  font-size: 0.9rem;
}

.btn-quiet.danger { color: var(--error); }

.pos-panel { max-width: 40rem; }

.pos-articles {
  display: grid;
  gap: 0.65rem;
  margin: 0.75rem 0 1.25rem;
}

.pos-article {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(60, 45, 20, 0.12);
  border-radius: 0.75rem;
  background: #fffdf8;
}

.pos-article-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.pos-article-info small { color: var(--muted); }

.pos-qty {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  min-width: 4.5rem;
}

.pos-qty-input {
  text-align: center;
  font-size: 1.1rem;
  padding: 0.55rem 0.4rem;
}

.pos-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(60, 45, 20, 0.12);
  border-bottom: 1px solid rgba(60, 45, 20, 0.12);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.pos-pay {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.pos-pay legend {
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.pos-submit {
  width: 100%;
  padding: 0.95rem 1rem;
  font-size: 1.05rem;
}

.site-footer {
  padding: 0 2rem 2.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 960px) {
  .sidebar-toggle { display: inline-flex; }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(var(--sidebar-w), 88vw);
    max-height: none;
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 30px rgba(40, 30, 12, 0.12);
    background: #fffaf2;
    padding-top: 4.5rem;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  main { padding: 1.5rem 1.25rem 3rem; }
  .site-footer { padding: 0 1.25rem 2rem; }
  .topbar { padding: 0.85rem 1rem; }
  .nav { gap: 0.85rem; font-size: 0.88rem; }
  .grid-2 { grid-template-columns: 1fr; }
}
