:root {
  color-scheme: light;
  --bg: #f4f7f4;
  --surface: #ffffff;
  --surface-2: #ecf2ee;
  --line: #dbe5de;
  --text: #172421;
  --muted: #64736e;
  --primary: #25635b;
  --primary-strong: #174a43;
  --danger: #a64242;
  --warning: #936523;
  --success: #28734d;
  --shadow: 0 10px 30px rgba(23, 36, 33, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.print-only-shell {
  background: #e8efea;
  min-height: 100vh;
  padding: 18px;
}

.print-only-document {
  display: block;
  margin: 0 auto;
  max-width: 210mm;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.auth-card {
  width: min(460px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 18px 0 8px;
  font-size: 28px;
}

.auth-card p {
  color: var(--muted);
  line-height: 1.45;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  background: #f8fbf8;
  padding: 22px 18px;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.brand-logo {
  border-radius: 8px;
  flex: 0 0 auto;
  height: 54px;
  object-fit: cover;
  width: 54px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 12px;
  line-height: 1.2;
  max-width: 150px;
}

.brand small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
  margin-top: 4px;
}

.auth-brand {
  margin-bottom: 10px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.nav a {
  align-items: center;
  border-radius: 8px;
  color: var(--text);
  display: flex;
  font-weight: 700;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
}

.nav a:hover,
.nav a.active {
  background: var(--surface-2);
  color: var(--primary-strong);
}

.nav-alert {
  align-items: center;
  background: #c24b39;
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

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

.eyebrow {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.userbox {
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
}

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

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

.panel {
  margin-bottom: 18px;
  padding: 20px;
}

.panel.narrow {
  max-width: 680px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

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

.panel-head h2,
.panel-head p {
  margin: 0;
}

.panel-head p {
  color: var(--muted);
  margin-top: 4px;
}

.grid {
  display: grid;
  gap: 18px;
}

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

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

.stats-grid.compact {
  margin-top: 16px;
}

.stat {
  padding: 18px;
}

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

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

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.inline-form,
.actions,
.quick-actions,
.approval-actions,
.closing-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form label {
  min-width: 130px;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.check-row span {
  margin: 0;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font-weight: 800;
  padding: 10px 16px;
}

.button:hover {
  border-color: var(--primary);
}

.button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

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

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.button.full {
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
}

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

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

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

td.right,
th.right {
  text-align: right;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 9px;
}

.badge.success {
  background: #dff3e7;
  color: var(--success);
}

.badge.warning {
  background: #fff0d3;
  color: var(--warning);
}

.badge.danger {
  background: #f8dddd;
  color: var(--danger);
}

.badge.muted {
  background: var(--surface-2);
  color: var(--muted);
}

.alert {
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 12px 14px;
}

.alert ul {
  margin: 0;
  padding-left: 20px;
}

.alert.success {
  background: #dff3e7;
  color: var(--success);
}

.alert.danger {
  background: #f8dddd;
  color: var(--danger);
}

.empty {
  color: var(--muted);
  padding: 18px;
}

.block {
  display: block;
  color: var(--muted);
  margin-top: 6px;
}

.approval-item {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}

.approval-item:first-of-type {
  padding-top: 0;
}

.approval-item strong,
.approval-item span {
  display: block;
}

.approval-item span {
  color: var(--muted);
  margin-top: 4px;
}

.approval-actions input {
  width: min(240px, 100%);
}

.danger-zone {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}

.report-panel {
  page-break-inside: avoid;
}

.report-cleaner {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.report-cleaner summary {
  align-items: center;
  background: var(--surface-2);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
  list-style: none;
  padding: 14px 16px;
}

.report-cleaner summary::-webkit-details-marker {
  display: none;
}

.report-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 16px;
}

.report-detail-grid h3 {
  font-size: 16px;
  margin: 0 0 10px;
}

.report-filter {
  display: grid;
  gap: 14px;
  width: 100%;
}

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

.cleaner-picker {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 12px;
}

.cleaner-picker legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px 14px;
}

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

.report-document {
  display: grid;
  gap: 18px;
}

.report-page {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-height: 297mm;
  width: 210mm;
  padding: 18mm 16mm;
}

.report-page + .report-page {
  margin-top: 18px;
}

.report-header {
  border-bottom: 2px solid var(--primary);
  margin-bottom: 12mm;
  padding-bottom: 7mm;
  text-align: center;
}

.report-generated {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
  text-align: right;
}

.report-header h2 {
  font-size: 28px;
  letter-spacing: 0;
  margin: 0;
}

.report-header p {
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
  margin: 6px 0 0;
}

.report-meta {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 10mm;
}

.report-meta div {
  align-items: baseline;
  background: var(--surface-2);
  border-radius: 8px;
  display: flex;
  gap: 6px;
  padding: 12px;
}

.report-meta-line {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.report-meta span {
  color: var(--muted);
  display: inline;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-meta strong {
  display: inline;
  margin-top: 0;
}

.report-table table {
  min-width: 0;
}

.report-table th,
.report-table td {
  font-size: 14px;
  padding: 10px 12px;
}

.report-total {
  align-items: center;
  border-top: 2px solid var(--primary);
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 42px;
  padding-top: 16px;
}

.report-total span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.report-total strong {
  font-size: 28px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .nav {
    display: flex;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .nav a {
    white-space: nowrap;
  }

  .grid.two,
  .stats-grid,
  .report-detail-grid,
  .filter-row,
  .report-meta {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .userbox {
    justify-content: space-between;
  }
}

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

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

  .inline-form,
  .actions,
  .quick-actions,
  .approval-actions,
  .closing-actions,
  .filter-actions,
  .report-total {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form label,
  .button,
  .approval-actions input {
    width: 100%;
  }

  .report-page {
    min-height: 0;
    padding: 18px;
    width: auto;
  }

  .report-generated {
    text-align: left;
  }
}

@media print {
  @page {
    margin: 12mm;
    size: A4;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .no-print {
    display: none !important;
  }

  .app-shell {
    display: block;
  }

  .main {
    padding: 0;
  }

  .print-only-shell {
    background: #fff;
    padding: 0;
  }

  .print-only-document {
    display: block;
    max-width: none;
  }

  .report-document {
    display: block;
  }

  .report-page {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    break-after: page;
    min-height: 0;
    padding: 0;
    width: auto;
    page-break-after: always;
  }

  .print-only-document > .report-page {
    display: block;
  }

  .report-page + .report-page {
    break-before: page;
    margin-top: 0;
    page-break-before: always;
  }

  .report-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .report-header {
    margin-bottom: 14px;
  }

  .report-generated {
    color: #333;
  }

  .report-meta div {
    border: 1px solid #cfd8d2;
  }

  .report-total {
    flex-direction: row;
  }

  .panel,
  .stat,
  .empty {
    border-color: #cfd8d2;
    box-shadow: none;
  }

  .panel {
    break-inside: avoid;
    margin-bottom: 12px;
  }

  .report-cleaner {
    break-inside: avoid;
  }

  .report-cleaner details,
  .report-cleaner[open] {
    display: block;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }
}

.reservation-public-shell {
  background:
    linear-gradient(rgba(35, 24, 18, 0.58), rgba(35, 24, 18, 0.58)),
    url("logo.jpg") center/cover fixed;
}

.reservation-card {
  width: min(760px, 100%);
  background: rgba(255, 252, 245, 0.96);
  border: 1px solid #e2d6c5;
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(31, 20, 13, 0.24);
  padding: 26px;
}

.reservation-card.wide {
  width: min(980px, 100%);
}

.reservation-brand {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.reservation-brand img {
  border-radius: 8px;
  height: 64px;
  object-fit: cover;
  width: 64px;
}

.reservation-brand strong,
.reservation-brand span {
  display: block;
}

.reservation-brand strong {
  color: #3d271a;
  font-size: 15px;
  letter-spacing: 0;
}

.reservation-brand span,
.muted {
  color: var(--muted);
}

.reservation-card h1 {
  color: #3d271a;
  font-size: 30px;
  margin: 0 0 8px;
}

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

.span-2 {
  grid-column: 1 / -1;
}

.inline-form {
  align-items: end;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 1fr) auto;
  margin-bottom: 18px;
}

.panel-title-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.quote-box {
  background: #fff7e8;
  border: 1px solid #ead6b8;
  border-radius: 8px;
  margin-top: 18px;
  padding: 18px;
}

.quote-box dl {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.quote-box dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.quote-total {
  border-top: 1px solid #ead6b8;
  font-size: 18px;
  font-weight: 800;
  padding-top: 10px;
}

.color-dot {
  border-radius: 50%;
  display: inline-block;
  height: 12px;
  margin-right: 8px;
  vertical-align: -1px;
  width: 12px;
}

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

.check-line {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 42px;
}

.check-line input {
  min-height: 0;
  width: auto;
}

.feature-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.feature-grid div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  padding: 12px;
}

.login-link {
  display: inline-block;
  margin-top: 16px;
}

.public-calendar {
  margin: 16px 0 24px;
}

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

.calendar-nav strong {
  color: #3d271a;
  font-size: 20px;
  font-weight: 700;
}

.calendar-months {
  display: block;
}

.calendar-month {
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid #e7ddcf;
  border-radius: 8px;
  padding: 12px;
}

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

.calendar-weekdays span {
  color: #77685c;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  background: #fffaf2;
  border: 1px solid #eadfce;
  border-radius: 8px;
  min-height: 72px;
  padding: 7px;
}

.calendar-day.blank {
  background: transparent;
  border-color: transparent;
}

.calendar-day strong {
  color: #3d271a;
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.calendar-reservation-chip {
  border-radius: 4px;
  color: #fff;
  display: block;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 3px;
  overflow: hidden;
  padding: 4px 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-free-day {
  display: block;
  min-height: 18px;
}

.budget-button {
  display: flex;
  justify-content: center;
  margin-top: 16px;
  text-transform: uppercase;
}

.reservation-form-card {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .grid-form,
  .inline-form {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}
