:root {
  --navy: #32151d;
  --blue: #f0445e;
}

.sidebar {
  background: #32151d;
}

.brand-mark {
  background: #f0445e;
  color: #fff;
}

.hotel-label,
.user-card,
.sidebar-bottom .user-card {
  border-color: #54303a;
}

.nav-link:hover,
.nav-link.active {
  background: #4a222d;
}

.nav-link.active {
  box-shadow: inset 3px 0 #f0445e;
}

.nav-icon {
  color: #d29aa5;
}

.demo-note {
  background: #49232d;
}

.button-primary {
  background: #f0445e;
  box-shadow: 0 3px 8px #f0445e2b;
}

.button-primary:hover {
  background: #d9344e;
}

.metric-icon,
.room-icon {
  background: #fff0f2;
  color: #df3b55;
}

.chart-bar {
  background: #f0445e;
}

.chart-bar.secondary {
  background: #f9d9de;
}

.legend i {
  background: #f0445e;
}

.legend .legend-secondary {
  background: #f9d9de;
}

.donut {
  background: conic-gradient(#f0445e var(--occupancy), #f5e8eb 0);
}

.occupancy-item i {
  background: #f0445e;
}

.occupancy-item .free-dot {
  background: #f5e8eb;
}

.report-bar-fill {
  background: #f0445e;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #f18a99;
  box-shadow: 0 0 0 3px #f0445e1c;
}

.small-action:hover {
  border-color: #f1a0aa;
  color: #d9344e;
}

.availability-summary {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid #e8edf3;
  border-radius: 8px;
  background: #f8fafc;
  color: #52647a;
  font-size: 10px;
}

.availability-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.availability-heading strong {
  color: #30465f;
  font-size: 11px;
}

.availability-heading span,
.availability-summary small {
  color: #8492a2;
  font-size: 9px;
}

.availability-counts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 7px;
}

.availability-counts div {
  padding: 7px 8px;
  border-radius: 6px;
  background: #fff;
  text-align: center;
}

.availability-counts strong,
.availability-counts span {
  display: block;
}

.availability-counts strong {
  color: #30465f;
  font: 700 16px "DM Sans", "Noto Sans Thai", sans-serif;
}

.availability-counts div:first-child strong {
  color: #218567;
}

.availability-counts span {
  color: #8492a2;
  font-size: 9px;
}

.availability-summary p {
  margin: 7px 0 0;
  color: #a84237;
  font-size: 9px;
}

.availability-warning {
  border-color: #f1c6c1;
  background: #fff7f5;
}

.availability-warning .availability-heading strong,
.availability-warning > strong {
  color: #a84237;
}

#reservation-submit:disabled {
  background: #c4cbd4;
  box-shadow: none;
  cursor: not-allowed;
}

.booking-calendar {
  margin-bottom: 18px;
}

.calendar-panel-head {
  margin-bottom: 13px;
}

.calendar-panel-head > div:first-child {
  display: grid;
  gap: 3px;
}

.calendar-subtitle {
  color: #8996a6;
  font-size: 10px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-controls strong {
  min-width: 108px;
  color: #354c65;
  text-align: center;
  font-size: 11px;
}

.calendar-nav,
.calendar-today-button {
  height: 29px;
  border: 1px solid #e6ebf1;
  border-radius: 6px;
  background: white;
  color: #52647a;
  cursor: pointer;
}

.calendar-nav {
  width: 29px;
  font-size: 19px;
  line-height: 1;
}

.calendar-today-button {
  padding: 0 9px;
  font: 10px "Noto Sans Thai", sans-serif;
}

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

.calendar-weekdays {
  padding: 5px 0;
  border-bottom: 1px solid #edf1f5;
  color: #8996a6;
  text-align: center;
  font-size: 9px;
}

.calendar-day {
  min-width: 0;
  min-height: 68px;
  margin: 3px 2px;
  padding: 6px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #fafbfd;
  color: #52647a;
  text-align: left;
  cursor: pointer;
}

.calendar-day:not(.calendar-day-empty):hover {
  border-color: #f1a0aa;
  background: #fff7f8;
}

.calendar-day-empty {
  background: transparent;
  cursor: default;
}

.calendar-day-number,
.calendar-day-count,
.calendar-day-meta {
  display: block;
}

.calendar-day-number {
  margin-bottom: 5px;
  color: #52647a;
  font: 600 11px "DM Sans", "Noto Sans Thai", sans-serif;
}

.calendar-day-count {
  color: #a42e43;
  font-size: 9px;
  font-weight: 600;
}

.calendar-day-meta {
  margin-top: 2px;
  color: #8996a6;
  font-size: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-no-bookings {
  color: #b0bac6;
  font-weight: 400;
}

.calendar-today .calendar-day-number {
  color: #d9344e;
}

.calendar-has-bookings {
  background: #fff3f5;
}

.calendar-selected {
  border-color: #f0445e !important;
  box-shadow: inset 0 0 0 1px #f0445e;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px 18px;
  padding-top: 9px;
  color: #8996a6;
  font-size: 9px;
}

.calendar-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 2px;
  background: #fff3f5;
  vertical-align: middle;
}

.calendar-legend .text-button {
  margin-left: auto;
}

.reservation-heading-actions {
  display: flex;
  gap: 8px;
}

.hk-controls {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.hk-staff-field {
  display: grid;
  gap: 4px;
  color: #68798e;
  font-size: 10px;
}

.hk-staff-field input {
  width: 190px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #e4eaf1;
  border-radius: 6px;
  color: #43556d;
  font: 11px "Noto Sans Thai", sans-serif;
}

.hk-staff-field input:focus {
  outline: 2px solid #f0445e38;
  border-color: #f18a99;
}

.hk-workflow-note {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 12px 15px;
  margin-bottom: 14px;
  border: 1px solid #f5d9de;
  border-radius: 8px;
  background: #fff8f9;
  color: #72515a;
  font-size: 10px;
}

.hk-workflow-note strong {
  color: #a42e43;
}

.hk-updated-time {
  color: #8a97a6;
  font-size: 9px;
}

.hk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.hk-action {
  font-size: 9px;
}

.hk-ready {
  background: #e9f7f1;
  border-color: #d4eee3;
  color: #218567;
}

.hk-repair {
  color: #b94f45;
}

.inventory-alert,
.channel-notice {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  margin-bottom: 15px;
  border: 1px solid #f5d9de;
  border-radius: 8px;
  background: #fff8f9;
  color: #72515a;
  font-size: 10px;
}

.inventory-alert strong,
.channel-notice strong {
  color: #a42e43;
  font-size: 11px;
}

.inventory-alert span,
.channel-notice span {
  color: #7d6a70;
  line-height: 1.6;
}

.stock-quantity {
  width: 70px;
  height: 30px;
  border: 1px solid #e4eaf1;
  border-radius: 5px;
  padding: 0 7px;
  color: #43556d;
}

.inventory-add-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.5fr) repeat(3, minmax(110px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid #edf1f5;
  border-radius: 9px;
  background: #fff;
}

.inventory-add-form .button {
  white-space: nowrap;
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.channel-card {
  padding: 16px;
  border: 1px solid #edf1f5;
  border-radius: 9px;
  background: #fff;
  box-shadow: var(--shadow);
}

.channel-card-head {
  display: flex;
  gap: 10px;
  align-items: center;
}

.channel-logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 9px;
  background: #fff0f2;
  color: #df3b55;
  font: 700 16px "DM Sans", sans-serif;
}

.channel-card h3 {
  margin: 0 0 5px;
  color: #30465f;
  font-size: 12px;
}

.channel-card p {
  margin: 14px 0 5px;
  color: #60738a;
  font-size: 10px;
}

.channel-card > small {
  color: #8996a6;
  font-size: 9px;
}

.channel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 13px;
}

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

.folio-toolbar .field {
  min-width: min(390px, 100%);
}

.folio-entry-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 220px) auto;
  align-items: end;
  gap: 12px;
  padding: 15px;
  margin-bottom: 16px;
  border: 1px solid #edf1f5;
  border-radius: 9px;
  background: white;
}

.folio-entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.folio-entry-actions .button {
  white-space: nowrap;
}

.room-photo {
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  overflow: hidden;
  place-items: center;
  border-radius: 7px;
  background: #f3f5f8;
  color: #8996a6;
  font-size: 10px;
}

.room-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.room-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.room-photo-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  cursor: pointer;
}

.room-photo-upload input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

#folio-print-bill {
  display: none;
}

.bill-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 2px solid #32151d;
}

.bill-header h1 {
  margin: 0 0 5px;
  color: #32151d;
  font-size: 24px;
}

.bill-header p,
.bill-reference strong,
.bill-guest-details strong {
  color: #667085;
}

.bill-reference {
  display: grid;
  grid-template-columns: auto auto;
  gap: 5px 16px;
  text-align: right;
}

.bill-reference span,
.bill-guest-details span {
  font-weight: 600;
}

.bill-guest-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 0;
}

.bill-guest-details div {
  display: grid;
  gap: 4px;
}

.bill-table {
  width: 100%;
  border-collapse: collapse;
}

.bill-table th,
.bill-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.bill-table th:last-child,
.bill-table td:last-child {
  text-align: right;
  white-space: nowrap;
}

.bill-entry-date {
  display: block;
  color: #667085;
  font-size: 11px;
}

.bill-totals {
  width: min(100%, 340px);
  margin: 18px 0 0 auto;
}

.bill-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
}

.bill-totals .bill-balance {
  margin-top: 5px;
  padding-top: 10px;
  border-top: 1px solid #98a2b3;
  color: #32151d;
  font-size: 18px;
}

.bill-disclaimer {
  margin-top: 32px;
  color: #667085;
  font-size: 11px;
  text-align: center;
}

@media print {
  @page {
    margin: 16mm;
  }

  body * {
    visibility: hidden !important;
  }

  .app-shell,
  .main-content,
  #page-folio {
    position: static !important;
    display: block !important;
    width: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  #folio-print-bill,
  #folio-print-bill * {
    visibility: visible !important;
  }

  #folio-print-bill {
    position: absolute !important;
    top: 0;
    left: 0;
    display: block !important;
    width: 100%;
    color: #1f2937;
    background: white;
    font: 12px/1.5 Arial, sans-serif;
  }
}

@media (max-width: 760px) {
  .calendar-panel-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .calendar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .calendar-day {
    min-height: 54px;
    margin: 2px 1px;
    padding: 4px;
  }

  .calendar-day-meta {
    display: none;
  }

  .calendar-legend .text-button {
    margin-left: 0;
  }

  .reservation-heading-actions {
    align-items: flex-end;
    flex-direction: column-reverse;
  }

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

  .availability-counts {
    gap: 5px;
  }

  .availability-counts div {
    padding: 7px 3px;
  }

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

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

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

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

  .inventory-add-form .button {
    grid-column: 1 / -1;
  }

  .hk-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .hk-staff-field input {
    width: 100%;
  }
}
