:root {
  color-scheme: light;
  --ink: #101827;
  --muted: #617089;
  --line: #d7e0ee;
  --soft: #eef4ff;
  --paper: #ffffff;
  --brand: #1554b7;
  --brand-2: #cf2e2e;
  --gold: #b7791f;
  --danger: #b91c1c;
  --ok: #1554b7;
  --warn: #a15c00;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background: #f6f8fc;
}
button, input, select, textarea {
  font: inherit;
}
button {
  border: 0;
  cursor: pointer;
}
.app-shell {
  min-height: 100vh;
}
.hero {
  min-height: 92vh;
  display: grid;
  align-items: end;
  background:
    linear-gradient(180deg, rgba(7, 23, 56, 0.08), rgba(10, 30, 78, 0.72)),
    url("/assets/amerilanka-building.png") center/cover;
  color: white;
  padding: 28px;
}
.hero-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 32px;
  align-items: end;
}
.nav {
  position: fixed;
  z-index: 4;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  color: white;
  background: linear-gradient(180deg, rgba(0,0,0,.45), transparent);
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 800;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-weight: 900;
}
.nav button, .link-button {
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
  font-weight: 700;
}
.hero h1 {
  max-width: 760px;
  font-size: clamp(44px, 8vw, 96px);
  line-height: .94;
  margin: 0 0 18px;
  letter-spacing: 0;
}
.hero-copy {
  max-width: 650px;
  font-size: 19px;
  line-height: 1.55;
  color: rgba(255,255,255,.9);
}
.booking-panel, .panel, .modal-card {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(20, 34, 30, .16);
}
.booking-panel {
  padding: 18px;
}
.panel {
  padding: 18px;
}
.panel h2, .booking-panel h2 {
  margin: 0 0 14px;
  font-size: 22px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.booking-search-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
}
.booking-search-grid label:nth-child(3),
.booking-search-grid .search-button {
  grid-column: 1 / -1;
}
.search-button {
  width: 100%;
}
label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
}
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
  min-height: 42px;
}
textarea { resize: vertical; min-height: 76px; }
.full { grid-column: 1 / -1; }
.primary {
  background: var(--brand);
  color: white;
  border-radius: 8px;
  min-height: 44px;
  padding: 11px 16px;
  font-weight: 800;
}
.secondary {
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 40px;
  padding: 9px 12px;
  font-weight: 800;
}
.danger { color: white; background: var(--danger); }
.room-options {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.room-picker-details {
  display: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0;
}
.room-select-block {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
.selected-room-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fbff;
}
.selected-room-summary > div {
  display: grid;
  gap: 4px;
}
.room-picker-details summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 900;
}
.room-picker-details[open] {
  padding: 0 10px 10px;
}
.room-picker-details[open] summary {
  margin: 0 -10px 10px;
  border-bottom: 1px solid var(--line);
}
.room-option, .room-card, .reservation-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}
.room-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}
.price {
  color: var(--brand);
  font-weight: 900;
}
.message {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 8px;
  background: #eaf1ff;
  color: var(--ok);
  font-weight: 700;
}
.message.error {
  background: #ffe9e9;
  color: var(--danger);
}
.embedded-payment {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  background: #f8fbff;
}
.embedded-payment h3 {
  margin: 0;
}
.embedded-payment p {
  margin: 0;
}
.public-confirmation {
  margin-top: 14px;
  border: 2px solid var(--brand);
  border-radius: 8px;
  padding: 16px;
}
.confirmation-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.confirmation-head h2 {
  margin: 2px 0 0;
  font-size: 28px;
  color: var(--brand);
}
.eyebrow {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}
.stripe-element {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.compact-message {
  font-size: 12px;
  padding: 9px 10px;
}
.payment-action {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
  border: 2px solid var(--brand);
  border-radius: 8px;
  padding: 14px;
  background: #eaf1ff;
}
.payment-action h2 {
  margin: 0 0 4px;
  font-size: 18px;
}
.payment-action p {
  margin: 0 0 8px;
  color: var(--muted);
}
.payment-action .primary {
  background: var(--brand-2);
  min-width: 210px;
}
.square-action {
  border-color: var(--line);
  background: #fff8e8;
}
.square-action .primary {
  background: var(--brand);
}
.admin-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
.sidebar {
  background: #071b42;
  color: white;
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar nav {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}
.sidebar button {
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: rgba(255,255,255,.78);
  text-align: left;
}
.sidebar button.active {
  background: rgba(255,255,255,.12);
  color: white;
}
.language-picker {
  display: grid;
  gap: 6px;
  color: rgba(255,255,255,.72);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 900;
}
.language-picker select {
  min-height: 40px;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.1);
  color: white;
}
.language-picker select option {
  color: var(--ink);
}
.language-picker.compact {
  color: var(--muted);
  min-width: 128px;
}
.language-picker.compact select {
  background: white;
  color: var(--ink);
  border-color: var(--line);
}
.staff-badge {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: white;
}
.staff-badge strong {
  font-size: 13px;
}
.staff-badge span {
  color: rgba(255,255,255,.68);
  font-size: 12px;
}
.admin-main {
  padding: 24px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.topbar h1 {
  margin: 0;
  font-size: 30px;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.stat strong {
  display: block;
  font-size: 28px;
}
.income-panel {
  margin-bottom: 16px;
}
.income-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.income-stat {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #f8fbff;
}
.income-stat span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}
.income-stat strong {
  display: block;
  margin-top: 8px;
  font-size: 25px;
  line-height: 1.1;
}
.income-stat.received strong { color: var(--brand); }
.income-stat.booked strong { color: var(--brand); }
.income-stat.balance strong { color: var(--brand-2); }
.income-stat.expected strong { color: var(--warn); }
.income-split {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 12px;
  margin-top: 12px;
}
.income-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: white;
}
.income-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.income-line, .income-reservation {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}
.income-line:first-of-type {
  border-top: 0;
}
.income-line.pending strong {
  color: var(--warn);
}
.income-reservations {
  display: grid;
}
.income-reservation div {
  display: grid;
  gap: 3px;
}
.income-reservation div:last-child {
  text-align: right;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.room-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.room-card {
  display: grid;
  gap: 10px;
}
.rate-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.rate-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}
.rate-row > div {
  display: grid;
  gap: 3px;
}
.room-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  text-transform: capitalize;
}
.status.available { background: #e8f1ff; color: var(--brand); }
.status.occupied { background: #ffe9e9; color: var(--brand-2); }
.status.reserved { background: #fff4d6; color: var(--warn); }
.status.cleaning { background: #eef4ff; color: #275fae; }
.status.maintenance { background: #eceff5; color: #4c5568; }
.reservation-list {
  display: grid;
  gap: 10px;
}
.reservation-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr auto;
  gap: 12px;
  align-items: center;
}
.row-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(6,18,46,.55);
}
.modal-card {
  width: min(860px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 18px;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--soft);
}
.receipt {
  color: var(--ink);
  background: white;
  padding: 28px;
  border: 1px solid var(--line);
}
.receipt h1 { margin: 0; }
.receipt-lines {
  margin-top: 18px;
  display: grid;
  gap: 8px;
}
.receipt-lines div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 7px;
}
.calendar-list {
  display: grid;
  gap: 8px;
}
.calendar-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}
.legend-dot.open { background: var(--ok); }
.legend-dot.booked { background: var(--brand-2); }
.legend-dot.pending { background: var(--warn); }
.legend-dot.maintenance { background: #7c6f64; }
.booking-calendar {
  display: grid;
  grid-template-columns: 178px repeat(14, minmax(104px, 1fr));
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.calendar-head,
.calendar-room-label,
.calendar-cell {
  min-height: 74px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.calendar-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 10px;
  background: #f4f7fc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}
.calendar-head.room-label,
.calendar-room-label {
  position: sticky;
  left: 0;
  z-index: 3;
}
.calendar-head.room-label {
  background: #e8f0ff;
}
.calendar-head.is-today {
  color: var(--brand);
  background: #eaf1ff;
}
.calendar-room-label {
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 10px;
  background: #f8fbff;
}
.calendar-room-label strong {
  font-size: 14px;
}
.calendar-room-label span,
.calendar-room-label em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.calendar-cell {
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px;
  background: white;
  color: var(--ink);
  text-align: left;
  min-width: 104px;
}
.calendar-cell span,
.calendar-cell strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-cell.open {
  background: #edf4ff;
  color: var(--brand);
}
.calendar-cell.open:hover {
  outline: 2px solid rgba(21,84,183,.26);
  outline-offset: -2px;
}
.calendar-cell.booked {
  background: #ffecec;
  color: var(--brand-2);
}
.calendar-cell.pending {
  background: #fff7df;
  color: var(--warn);
}
.calendar-cell.checked_in {
  background: #ffe2e2;
  color: var(--brand-2);
}
.calendar-cell.maintenance {
  background: #eceff5;
  color: #4c5568;
  cursor: not-allowed;
}
.muted { color: var(--muted); }
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--soft);
  color: var(--ink);
  border: 1px solid var(--line);
}

@media (max-width: 980px) {
  .hero {
    min-height: auto;
    padding-top: 96px;
    align-items: start;
  }
  .hero-inner, .admin-layout { grid-template-columns: 1fr; }
  .hero-inner {
    gap: 20px;
    align-items: start;
  }
  .hero h1 {
    max-width: 620px;
    font-size: 52px;
    line-height: 1;
    margin-bottom: 12px;
  }
  .hero-copy {
    max-width: 620px;
    margin: 0;
    font-size: 17px;
  }
  .booking-panel {
    width: min(560px, 100%);
    justify-self: center;
  }
  .sidebar {
    position: static;
    height: auto;
  }
  .sidebar nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
  }
  .room-grid, .stats, .income-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .payment-action { grid-template-columns: 1fr; }
  .payment-action .primary { width: 100%; }
  .rate-row { grid-template-columns: 1fr auto; }
  .rate-row button { grid-column: 1 / -1; }
  .income-split { grid-template-columns: 1fr; }
  .reservation-row { grid-template-columns: 1fr; }
  .row-actions { justify-content: flex-start; }
}

@media (max-width: 620px) {
  body { background: white; }
  .nav {
    padding: 10px 12px;
    gap: 10px;
    background: rgba(7, 23, 56, .82);
    backdrop-filter: blur(10px);
  }
  .brand {
    min-width: 0;
    gap: 8px;
    font-size: 14px;
    line-height: 1.15;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
  }
  .nav button {
    min-height: 36px;
    padding: 8px 10px;
    font-size: 13px;
    white-space: nowrap;
  }
  .hero {
    min-height: auto;
    display: block;
    padding: 76px 12px 16px;
    background:
      linear-gradient(180deg, rgba(7, 23, 56, .22), rgba(10, 30, 78, .82)),
      url("/assets/amerilanka-building.png") center top/cover;
  }
  .hero-inner {
    display: grid;
    gap: 14px;
  }
  .hero h1 {
    font-size: 38px;
    line-height: 1.02;
    margin-bottom: 8px;
  }
  .hero-copy {
    font-size: 15px;
    line-height: 1.45;
  }
  .booking-panel {
    padding: 14px;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(7, 23, 56, .2);
  }
  .booking-panel h2 {
    font-size: 20px;
    margin-bottom: 12px;
  }
  .form-grid, .room-grid, .stats, .income-grid { grid-template-columns: 1fr; }
  .booking-search-grid {
    grid-template-columns: 1fr;
  }
  input, select, textarea {
    min-height: 46px;
    font-size: 16px;
  }
  .primary {
    min-height: 48px;
  }
  .room-select-block {
    margin: 12px 0;
  }
  .selected-room-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .selected-room-summary .price {
    justify-self: start;
    font-size: 18px;
  }
  .message,
  .embedded-payment,
  .public-confirmation {
    margin-top: 10px;
  }
  .embedded-payment {
    padding: 12px;
  }
  .confirmation-head {
    display: grid;
  }
  .confirmation-head .status {
    justify-self: start;
  }
  .receipt-lines div {
    display: grid;
    gap: 3px;
  }
  .row-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
  .row-actions button {
    width: 100%;
  }
  .income-reservation {
    display: grid;
  }
  .income-reservation div:last-child {
    text-align: left;
  }
  .sidebar nav { grid-template-columns: 1fr 1fr; }
  .admin-main { padding: 14px; }
  .topbar { align-items: flex-start; flex-direction: column; }
}

@media print {
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt {
    position: absolute;
    inset: 0;
    border: 0;
    box-shadow: none;
  }
  .no-print { display: none !important; }
}
