/* La Provence Guesthouse — booking system */
:root {
  --cream: #faf7f2;
  --ivory: #fffef9;
  --lavender: #6b5b7a;
  --lavender-dark: #4a3f56;
  --olive: #5c6b4a;
  --olive-light: #7a8f62;
  --terracotta: #b85c38;
  --terracotta-hover: #9a4a2c;
  --gold: #c9a962;
  --border: #e5ddd0;
  --text: #2c2825;
  --text-muted: #6b6560;
  --shadow: 0 4px 24px rgba(44, 40, 37, 0.08);
  --shadow-lg: 0 12px 40px rgba(44, 40, 37, 0.12);
  --radius: 10px;
  --font-main: "Varela Round", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  color: var(--text);
  background: linear-gradient(165deg, var(--cream) 0%, #bcc3cf 50%, #d8dfe8 100%);
  line-height: 1.5;
}

/* Header */
.site-header {
  background: #607e86;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
}

.brand-text h1 {
  margin: 0;
  font-family: var(--font-main);
  font-size: 1.75rem;
  font-weight: 600;
  color: white;
  letter-spacing: 0.02em;
}

.brand-text p {
  margin: 0;
  font-size: 0.8rem;
  color: white;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 0.5rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: white;
  transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
  background: var(--cream);
  color: var(--lavender-dark);
}

.nav-link.active {
  background: white;
  color: var(--lavender-dark);
}

button.nav-link {
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
}

/* Main content */
.main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}

.page-title {
  font-family: var(--font-main);
  font-size: 1.5rem;
  color: var(--lavender-dark);
  margin: 0 0 1rem;
}

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--ivory);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar label,
.toolbar-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

#dateRangeLabel,
#monthRangeLabel {
  margin-left: auto;
  color: var(--lavender-dark);
}

.toolbar select,
.toolbar input[type="date"],
.toolbar input[type="search"],
.toolbar input[type="text"] {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 180px;
  color: var(--text);
  background: var(--ivory);
}

.toolbar select:focus,
.toolbar input:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--terracotta);
  color: white;
}

.btn-primary:hover {
  background: var(--terracotta-hover);
}

.btn-secondary {
  background: var(--olive);
  color: white;
}

.btn-secondary:hover {
  background: var(--olive-light);
}

.btn-outline {
  background: transparent;
  color: var(--lavender);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--cream);
  border-color: var(--lavender);
}

.btn-danger {
  background: #a33;
  color: white;
}

.btn-danger:hover {
  background: #822;
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}

/* Calendar grid */
.calendar-wrap {
  overflow-x: auto;
  background: var(--ivory);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.calendar-grid {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: fixed;
}

.calendar-grid th,
.calendar-grid td {
  border: 1px solid var(--border);
  padding: 0;
  vertical-align: middle;
}

.calendar-grid thead th {
  background: linear-gradient(180deg, var(--lavender) 0%, var(--lavender-dark) 100%);
  color: var(--ivory);
  font-weight: 600;
  font-size: 0.7rem;
  padding: 0.4rem 0.25rem;
  text-align: center;
}

.calendar-grid thead th.corner {
  background: var(--lavender-dark);
  width: 72px;
  min-width: 72px;
}

.calendar-grid thead th.today-col {
  background: var(--terracotta);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.calendar-grid tbody th.room-label {
  background: var(--cream);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.35rem 0.5rem;
  text-align: left;
  color: var(--lavender-dark);
  width: 72px;
  min-width: 72px;
}

.calendar-cell {
  min-height: 50px;
  height: 50px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.calendar-cell:hover {
  background: rgba(201, 169, 98, 0.15);
}

.calendar-cell.today-col {
  background: rgba(184, 92, 56, 0.06);
}

/* Unconfirmed booking */
.calendar-cell.occupied {
  background: linear-gradient(135deg, rgba(240, 225, 8, 0.2) 0%, rgba(217, 205, 32, 0.35) 100%);
}

.calendar-cell.occupied:hover {
  background: linear-gradient(135deg, rgba(92, 107, 74, 0.3) 0%, rgba(92, 107, 74, 0.45) 100%);
}

/* Confirmed booking */
.calendar-cell.occupied.confirmed {
  background: linear-gradient(135deg, rgba(121, 163, 88, 0.25) 0%, rgba(82, 116, 60, 0.45) 100%);
}

.calendar-cell.occupied.confirmed:hover {
  background: linear-gradient(135deg, rgba(58, 107, 125, 0.35) 0%, rgba(58, 107, 125, 0.55) 100%);
}

.calendar-cell.occupied.confirmed .cell-guest-name {
  color: black;
}

/* Room under maintenance */
.calendar-cell.occupied.maintenance {
  background: linear-gradient(135deg, #8cb4dc 0%, #a8c4d3 100%);
}

.calendar-cell.occupied.maintenance:hover {
  background: linear-gradient(135deg, #fbd0d0 0%, #f5bcbc 100%);
}

.calendar-cell.occupied.maintenance .cell-guest-name {
  color: #8b3a3a;
  font-weight: 700;
}

.calendar-cell.canceled {
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 4px,
    rgba(170, 51, 51, 0.08) 4px,
    rgba(170, 51, 51, 0.08) 8px
  );
}

.calendar-grid tbody tr.events-row th.events-label {
  background: var(--gold-light, #f5ecd8);
  color: var(--terracotta);
}

.calendar-events-cell {
  min-height: 50px;
  height: auto;
  padding: 0.2rem 0.25rem;
  cursor: pointer;
  background: rgba(201, 169, 98, 0.1);
  vertical-align: top;
  transition: background 0.15s;
}

.calendar-events-cell:hover {
  background: rgba(201, 169, 98, 0.22);
}

.calendar-events-cell.today-col {
  background: rgba(184, 92, 56, 0.12);
}

.calendar-event-item {
  font-size: 0.68rem;
  line-height: 1.3;
  color: var(--lavender-dark);
  padding: 0.2rem 0;
  word-break: break-word;
}

.calendar-event-item + .calendar-event-item {
  border-top: 1px solid rgba(96, 126, 134, 0.15);
  margin-top: 0.15rem;
  padding-top: 0.35rem;
}

.cell-booking {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.2rem 0.25rem;
  min-width: 0;
}

.cell-guest-name {
  display: block;
  font-size: 0.70rem;
  font-weight: 600;
  color: black;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-customer {
  display: block;
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-room-type {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--lavender-dark);
  line-height: 1.1;
}

.cell-meta {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  min-width: 0;
  overflow: hidden;
  line-height: 1.1;
}

.cell-meta .cell-room-type,
.cell-meta .cell-people {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.cell-meta-sep {
  flex-shrink: 0;
  font-size: 0.58rem;
  color: var(--text-muted);
}

.cell-people {
  display: block;
  font-size: 0.58rem;
  font-weight: 600;
  color: var(--olive);
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-state p {
  margin: 0.5rem 0 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 40, 37, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  z-index: 200;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.nested-modal {
  z-index: 250;
}

.field-with-action {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.field-with-action select {
  flex: 1;
  min-width: 0;
}

.field-with-action .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* Centered confirmation dialog */
.confirm-overlay {
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 400;
}

.confirm-modal {
  max-width: 420px;
  text-align: center;
  animation: confirmIn 0.2s ease-out;
}

@keyframes confirmIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.confirm-body {
  padding: 1.75rem 1.5rem 1.25rem;
}

.confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: rgba(170, 51, 51, 0.1);
  color: #a33;
}

.confirm-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-main);
  font-size: 1.25rem;
  color: var(--lavender-dark);
}

.confirm-message {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.confirm-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--cream);
  border-radius: 0 0 var(--radius) var(--radius);
}

.confirm-footer .btn {
  min-width: 110px;
}

.alert-overlay {
  z-index: 450;
}

.about-overlay {
  z-index: 460;
}

.about-modal {
  max-width: 520px;
  text-align: left;
  animation: confirmIn 0.2s ease-out;
}

.about-header {
  border-bottom: 1px solid var(--border);
}

.about-body {
  padding: 1.25rem 1.5rem 1rem;
}

.about-body p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.about-body p:last-of-type {
  margin-bottom: 0;
}

.about-attribution {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.about-credit {
  margin: 0 0 0.75rem !important;
  font-size: 0.9rem !important;
  color: var(--text) !important;
}

.about-website {
  margin: 0 0 0.75rem !important;
  font-size: 0.9rem !important;
}

.about-website a {
  color: var(--terracotta);
  font-weight: 600;
  text-decoration: none;
}

.about-website a:hover {
  color: var(--terracotta-hover);
  text-decoration: underline;
}

.about-logo-link {
  display: inline-block;
}

.about-logo {
  display: block;
  max-width: 160px;
  height: auto;
  margin: 0 auto;
}

.about-footer {
  display: flex;
  justify-content: center;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  background: var(--cream);
  border-radius: 0 0 var(--radius) var(--radius);
}

.about-footer .btn {
  min-width: 110px;
}

.alert-modal .alert-icon {
  background: rgba(184, 92, 56, 0.12);
  color: var(--terracotta);
}

.modal {
  background: var(--ivory);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 720px;
  margin: auto;
  border: 1px solid var(--border);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
  border-radius: var(--radius) var(--radius) 0 0;
}

.modal-header h2 {
  margin: 0;
  font-family: var(--font-main);
  font-size: 1.35rem;
  color: var(--lavender-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.25rem;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--cream);
  border-radius: 0 0 var(--radius) var(--radius);
}

/* Booking form */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1rem;
}

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

.form-field-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
}

.form-group textarea {
  min-height: 64px;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  border-color: var(--gold);
}

.form-section-title {
  grid-column: 1 / -1;
  font-family: var(--font-main);
  font-size: 1.1rem;
  color: var(--olive);
  margin: 0.5rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

.form-meal-label {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

.form-meal-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem 1rem;
}

.form-inline-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.85rem 1rem;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  grid-column: 1 / -1;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-label input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--olive);
}

/* Data tables (employees, etc.) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--lavender-dark);
  background: var(--cream);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.data-table tbody tr:hover {
  background: rgba(201, 169, 98, 0.08);
}

/* Daily report check-ins — match calendar booking colours */
.data-table tbody tr.report-row-unconfirmed {
  background: linear-gradient(135deg, rgba(240, 225, 8, 0.2) 0%, rgba(217, 205, 32, 0.35) 100%);
}

.data-table tbody tr.report-row-unconfirmed:hover {
  background: linear-gradient(135deg, rgba(240, 225, 8, 0.35) 0%, rgba(217, 205, 32, 0.5) 100%);
}

.data-table tbody tr.report-row-confirmed {
  background: linear-gradient(135deg, rgba(121, 163, 88, 0.25) 0%, rgba(82, 116, 60, 0.45) 100%);
}

.data-table tbody tr.report-row-confirmed:hover {
  background: linear-gradient(135deg, rgba(121, 163, 88, 0.35) 0%, rgba(82, 116, 60, 0.55) 100%);
}

.data-table tbody tr.inactive-row {
  opacity: 0.65;
}

.table-actions {
  text-align: right;
  white-space: nowrap;
}

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

.data-table .num-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.report-section {
  margin-bottom: 1.25rem;
}

.report-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}

.report-heading-row .report-heading {
  border-bottom: none;
  margin-bottom: 0;
  flex: 1;
}

.report-heading-row .btn {
  margin-bottom: 0.5rem;
}

.report-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 800px) {
  .report-row {
    grid-template-columns: 1fr;
  }
}

.report-heading {
  margin: 0 0 0.75rem;
  font-family: var(--font-main);
  font-size: 1.05rem;
  color: var(--lavender-dark);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.report-total-value {
  color: #c0392b;
  font-weight: 700;
}

.meals-day-table th:not(:first-child):not(:last-child):not(:nth-last-child(2)),
.meals-day-table td:not(:first-child):not(:last-child):not(:nth-last-child(2)) {
  text-align: center;
  white-space: nowrap;
}

.report-total-row td {
  border-top: 2px solid var(--border);
  background: var(--cream);
}

/* Occupancy dashboard */
.occupancy-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.3rem 0;
}

.occupancy-label {
  width: 170px;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.occupancy-track {
  flex: 1;
  height: 18px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: block;
}

.occupancy-fill {
  display: block;
  height: 100%;
  background: #607e86;
  border-radius: 3px 0 0 3px;
  transition: width 0.3s ease;
}

.occupancy-pct {
  width: 64px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--lavender-dark);
}

.occupancy-detail {
  width: 70px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.occupancy-muted {
  opacity: 0.45;
}

.text-muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.status-badge {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-badge.active {
  background: rgba(92, 107, 74, 0.2);
  color: var(--olive);
}

.status-badge.inactive {
  background: rgba(107, 101, 96, 0.15);
  color: var(--text-muted);
}

.status-badge.status-pending {
  background: rgba(201, 169, 98, 0.25);
  color: #7a6528;
}

.status-badge.status-approved {
  background: rgba(92, 107, 74, 0.2);
  color: var(--olive);
}

.status-badge.status-rejected {
  background: rgba(170, 51, 51, 0.15);
  color: #a33;
}

.status-badge.status-cancelled {
  background: rgba(107, 101, 96, 0.15);
  color: var(--text-muted);
}

.allocations-filters {
  margin-top: 0;
}

.allocations-hint {
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.allocations-hint code {
  font-size: 0.82rem;
  color: var(--lavender-dark);
}

.encashment-hint {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--olive);
  background: rgba(92, 107, 74, 0.1);
  border-radius: 6px;
  border: 1px solid rgba(92, 107, 74, 0.2);
}

.allocations-empty {
  padding: 1.5rem;
  text-align: left;
  max-width: 560px;
  margin: 0 auto;
}

.allocations-empty h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-main);
  color: var(--lavender-dark);
}

.allocations-empty p,
.allocations-empty ol {
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.allocations-empty ol {
  padding-left: 1.25rem;
}

.allocations-empty li {
  margin-bottom: 0.35rem;
}

.allocations-error {
  border: 1px solid rgba(170, 51, 51, 0.25);
  border-radius: var(--radius);
  background: #fdf6f6;
}

/* Rooms admin */
.admin-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.panel {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.panel h3 {
  margin: 0 0 1rem;
  font-family: var(--font-main);
  font-size: 1.2rem;
  color: var(--lavender-dark);
}

.panel form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.room-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.location-block {
  margin-bottom: 1.25rem;
}

.location-block h4 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--olive);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.location-block-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.room-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.room-list li:nth-child(odd) {
  background: var(--cream);
}

/* Toast / status */
.status-bar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  transform: translateY(120%);
  transition: transform 0.3s;
}

.status-bar.show {
  transform: translateY(0);
}

.status-bar.success {
  background: var(--olive);
  color: white;
}

.status-bar.error {
  background: #a33;
  color: white;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(250, 247, 242, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

.loading-overlay.show {
  opacity: 1;
  visibility: visible;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Admin dashboard tiles */
.admin-page {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.admin-hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.admin-hero .page-title {
  margin-bottom: 0.5rem;
}

.admin-hero p {
  margin: 0;
  color: var(--text-muted);
  font-size: 1rem;
}

.admin-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.admin-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 1.5rem 1.35rem;
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.admin-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(96, 126, 134, 0.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
}

.admin-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #607e86;
}

.admin-tile:hover::before {
  opacity: 1;
}

.admin-tile:active {
  transform: translateY(-2px);
}

.admin-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(135deg, #607e86 0%, #4a656c 100%);
  color: white;
  margin-bottom: 0.25rem;
}

.admin-tile-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--lavender-dark);
}

.admin-tile-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
}

.admin-tile-action {
  font-size: 0.8rem;
  font-weight: 600;
  color: #607e86;
  margin-top: 0.35rem;
}

.admin-tile:hover .admin-tile-action {
  color: var(--terracotta);
}

/* Employee calendar */
.emp-cal-month-block {
  margin-bottom: 1.5rem;
}

.emp-cal-month-block:last-child {
  margin-bottom: 0;
}

.emp-cal-month-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lavender-dark);
}

.emp-cal-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.emp-cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.emp-cal-legend-hint {
  font-size: 0.78rem;
  font-style: italic;
}

.emp-cal-filter-group {
  align-items: flex-start;
}

.emp-cal-employee-filter {
  min-width: 11rem;
  max-width: 14rem;
}

.emp-cal-filter-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.emp-cal-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(96, 126, 134, 0.25);
}

.emp-cal-swatch-leave {
  background: linear-gradient(135deg, rgba(184, 92, 56, 0.35) 0%, rgba(184, 92, 56, 0.55) 100%);
}

.emp-cal-swatch-duty {
  background: linear-gradient(135deg, rgba(96, 126, 134, 0.35) 0%, rgba(96, 126, 134, 0.55) 100%);
}

.emp-cal-swatch-holiday {
  background: linear-gradient(180deg, #79a358 0%, #52743c 100%);
}

.employee-calendar-wrap {
  overflow-x: auto;
  background: var(--ivory);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.employee-calendar-grid {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  table-layout: fixed;
}

.employee-calendar-grid th,
.employee-calendar-grid td {
  border: 1px solid var(--border);
  padding: 0;
  vertical-align: middle;
}

.employee-calendar-grid thead th {
  background: linear-gradient(180deg, var(--lavender) 0%, var(--lavender-dark) 100%);
  color: var(--ivory);
  font-weight: 600;
  font-size: 0.62rem;
  padding: 0.25rem 0.1rem;
  text-align: center;
  line-height: 1.2;
  min-width: 28px;
}

.employee-calendar-grid thead th.corner {
  background: var(--lavender-dark);
  width: 120px;
  min-width: 120px;
  font-size: 0.72rem;
}

.employee-calendar-grid thead th.today-col {
  background: var(--terracotta);
  box-shadow: inset 0 -3px 0 var(--gold);
}

.employee-calendar-grid thead th.public-holiday-col {
  background: linear-gradient(180deg, #79a358 0%, #52743c 100%);
  box-shadow: inset 0 -3px 0 #3d5a2e;
}

.employee-calendar-grid thead th.weekend-col {
  background: linear-gradient(180deg, #7a6578 0%, #6a5568 100%);
}

.emp-cal-day-num {
  display: block;
  font-size: 0.75rem;
}

.emp-cal-weekday {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  opacity: 0.9;
}

.employee-calendar-grid tbody th.employee-label {
  background: var(--cream);
  font-weight: 600;
  font-size: 0.72rem;
  padding: 0.35rem 0.5rem;
  text-align: left;
  color: var(--lavender-dark);
  width: 120px;
  min-width: 120px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emp-cal-cell {
  min-height: 36px;
  min-width: 28px;
  height: 100%;
  padding: 0.15rem;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.1rem;
}

.emp-cal-cell:hover {
  background: rgba(201, 169, 98, 0.18);
}

.emp-cal-cell.weekend-col {
  background: rgba(96, 126, 134, 0.06);
}

.emp-cal-cell.public-holiday-col {
  background: rgba(121, 163, 88, 0.1);
}

.emp-cal-cell.today-col {
  background: rgba(184, 92, 56, 0.08);
}

.emp-cal-cell.has-leave {
  background: rgba(184, 92, 56, 0.12);
}

.emp-cal-cell.has-duty {
  background: rgba(96, 126, 134, 0.1);
}

.emp-cal-badge {
  font-size: 0.58rem;
  line-height: 1.2;
  padding: 0.12rem 0.15rem;
  border-radius: 3px;
  text-align: center;
  word-break: break-word;
  font-weight: 600;
}

.emp-cal-badge-clickable {
  cursor: pointer;
}

.emp-cal-badge-clickable:hover {
  filter: brightness(0.92);
}

.emp-cal-badge-leave {
  background: rgba(184, 92, 56, 0.25);
  color: #7a3a1e;
}

.emp-cal-badge-duty {
  color: var(--lavender-dark);
}

.emp-cal-duty-color-0 { background: rgba(165, 192, 219, 0.65); }
.emp-cal-duty-color-1 { background: rgba(193, 212, 176, 0.75); }
.emp-cal-duty-color-2 { background: rgba(240, 233, 160, 0.85); }
.emp-cal-duty-color-3 { background: rgba(216, 180, 220, 0.65); }
.emp-cal-duty-color-4 { background: rgba(255, 204, 153, 0.75); }
.emp-cal-duty-color-5 { background: rgba(176, 224, 230, 0.75); }
.emp-cal-duty-color-6 { background: rgba(255, 182, 193, 0.65); }
.emp-cal-duty-color-7 { background: rgba(211, 211, 211, 0.75); }

.form-static-value {
  margin: 0;
  padding: 0.5rem 0;
  font-weight: 600;
  color: var(--lavender-dark);
}

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

  .brand-text h1 {
    font-size: 1.35rem;
  }

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

  .admin-tiles {
    grid-template-columns: 1fr;
  }
}

/* Inspection checklist (mobile-first for PWA) */
.inspection-checklist-page {
  padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
}

.inspection-checklist-main {
  max-width: 720px;
}

.inspection-checklist-top {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.inspection-checklist-title {
  margin-bottom: 0.35rem;
}

.inspection-checklist-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.inspection-progress-card {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow);
}

.inspection-progress-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.inspection-progress-card strong {
  display: block;
  font-size: 1.1rem;
  color: var(--lavender-dark);
  margin-bottom: 0.55rem;
}

.inspection-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.inspection-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--olive-light), var(--olive));
  transition: width 0.2s ease;
}

.inspection-room-panel {
  margin-bottom: 1.25rem;
}

.inspection-room-panel-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  color: var(--lavender-dark);
}

.inspection-room-fields {
  display: grid;
  gap: 0.85rem;
}

.inspection-room-fields select {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 1rem;
  background: #fff;
}

.inspection-room-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--lavender-dark);
}

.inspection-category-block {
  margin-bottom: 1.25rem;
}

.inspection-category-title {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.85rem;
  background: #607e86;
  color: #fff;
  border-radius: var(--radius);
  font-size: 1rem;
}

.inspection-item-card {
  background: var(--ivory);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.inspection-item-card.is-urgent {
  border-color: #c0392b;
  box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.15);
}

.inspection-item-card.is-yes {
  border-left: 4px solid var(--olive);
}

.inspection-item-card.is-no {
  border-left: 4px solid #c0392b;
}

.inspection-item-card.is-na {
  border-left: 4px solid var(--text-muted);
}

.inspection-item-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  line-height: 1.35;
  color: var(--text);
}

.inspection-choice-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.inspection-choice-btn {
  min-height: 48px;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.inspection-choice-btn.is-selected.inspection-choice-yes {
  background: rgba(122, 143, 98, 0.18);
  border-color: var(--olive);
  color: var(--olive);
}

.inspection-choice-btn.is-selected.inspection-choice-no {
  background: rgba(192, 57, 43, 0.12);
  border-color: #c0392b;
  color: #c0392b;
}

.inspection-choice-btn.is-selected.inspection-choice-na {
  background: rgba(107, 101, 96, 0.12);
  border-color: var(--text-muted);
  color: var(--text-muted);
}

.inspection-urgent-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #c0392b;
  cursor: pointer;
}

.inspection-urgent-label input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: #c0392b;
}

.inspection-comment-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.inspection-comment-label span {
  display: block;
  margin-bottom: 0.35rem;
}

.inspection-comment-input {
  width: 100%;
  margin-top: 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-main);
  font-size: 1rem;
  resize: vertical;
  min-height: 3rem;
}

.inspection-sticky-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 254, 249, 0.96);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(44, 40, 37, 0.08);
  backdrop-filter: blur(8px);
}

.btn-block {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
}

@media (min-width: 720px) {
  .inspection-checklist-top {
    grid-template-columns: 1.4fr 0.8fr;
    align-items: start;
  }

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