﻿:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #647086;
  --line: #d9deea;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warn: #b45309;
  --ok-bg: #e6f3f1;
  --shadow: 0 16px 42px rgba(23, 32, 51, 0.10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}
body.login-page {
  display: grid;
  place-items: center;
  padding: 22px;
}
button, input, select { font: inherit; }
.app-shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0;
}
.login-shell {
  width: min(920px, 100%);
}
.login-header {
  align-items: center;
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}
.brand-head {
  align-items: center;
  display: flex;
  gap: 14px;
  min-width: 0;
}
.brand-logo {
  width: clamp(58px, 8vw, 86px);
  height: auto;
  flex: 0 0 auto;
}
.logo-trigger {
  display: inline-grid;
  place-items: center;
  min-height: auto;
  border: 0;
  background: transparent;
  padding: 0;
}
.logo-trigger:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
}
.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
.login-panel {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}
.login-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 0;
}
.login-dialog::backdrop {
  background: rgba(23, 32, 51, 0.38);
}
.login-dialog .login-panel {
  margin: 0;
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dialog-head h2 {
  margin-bottom: 0;
}
.form-status {
  min-height: 1.3em;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: 0; }
h2 { margin-bottom: 6px; font-size: 1.15rem; }
h3 { margin-bottom: 10px; font-size: 1rem; }
.booking-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.booking-number {
  border: 1px solid #b9dcd7;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--accent-strong);
  padding: 3px 8px;
  font-size: 0.9rem;
  font-weight: 700;
}
.actions, .guest-title, .guests-head, .button-row { display: flex; align-items: center; gap: 10px; }
.actions { flex-wrap: wrap; justify-content: flex-end; }
.tabbar {
  display: flex;
  gap: 8px;
  margin: 12px 0 14px;
  border-bottom: 1px solid var(--line);
}
.tab-button {
  min-height: 38px;
  border-color: var(--line);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: #ffffff;
  color: var(--muted);
}
.tab-button.active {
  border-color: #b9dcd7;
  border-bottom-color: #ffffff;
  background: #ffffff;
  color: var(--accent-strong);
}
button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}
button:disabled { cursor: not-allowed; opacity: 0.55; }
.primary { background: var(--accent); color: white; }
.primary:hover { background: var(--accent-strong); }
.secondary { background: var(--ok-bg); color: var(--accent-strong); border-color: #b9dcd7; }
.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
.danger { background: #fff1f2; color: #be123c; border-color: #fecdd3; }
.danger:hover { background: #ffe4e6; }
.icon-button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  background: #fff7ed;
  color: var(--warn);
  border-color: #fed7aa;
  font-size: 1.4rem;
  line-height: 1;
}
.workspace { display: block; }
.guest-workspace { display: grid; gap: 14px; }
.form-panel, .section-band, .guest-card, .storage-box { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.form-panel { display: grid; gap: 14px; padding: 14px; box-shadow: var(--shadow); }
.section-band { padding: 18px; }
.storage-band { background: #fbfcfe; }
.section-head, .guests-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head p { margin-bottom: 0; color: var(--muted); font-size: 0.92rem; }
.section-head .booking-person-header {
  margin-top: 6px;
  color: #344056;
  font-size: 0.94rem;
  font-weight: 800;
}
.section-head-tools {
  display: grid;
  gap: 8px;
  min-width: min(100%, 560px);
}
.property-tools label,
.booking-tools label {
  min-width: min(100%, 320px);
}
.property-tools .button-row,
.booking-tools .button-row {
  justify-content: flex-end;
}
.property-tools .button-row button,
.booking-tools .button-row button {
  flex: 0 1 auto;
}
.db-pill {
  align-self: flex-start;
  border: 1px solid #b9dcd7;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--accent-strong);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.storage-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.storage-box {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
}
.button-row {
  flex-wrap: wrap;
}
.button-row button {
  flex: 1 1 160px;
}
.compact-actions {
  justify-content: flex-end;
}
.compact-actions button {
  flex: 0 1 auto;
}
.settings-actions {
  margin-top: 12px;
}
.guest-actions-footer {
  justify-content: flex-end;
  margin-top: 14px;
}
.guest-actions-footer button {
  flex: 0 1 auto;
}
.settings-status {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}
.settings-subhead {
  margin-top: 18px;
}
.password-grid {
  margin-top: 18px;
}
.grid { display: grid; gap: 12px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.date-time-pair {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(115px, 145px);
  justify-content: start;
  gap: 12px;
}
label,
.form-field { display: grid; gap: 6px; color: #344056; font-size: 0.86rem; font-weight: 700; }
.field-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}
label:has([required]),
.form-field:has([required]) { position: relative; }
label:has([required])::before,
.form-field:has([required])::before {
  color: #b42318;
  content: "*";
  font-weight: 800;
  position: absolute;
  left: 0;
  top: 0;
}
label:has([required]),
.form-field:has([required]) { padding-left: 10px; }
label:has(> span:first-child):has([required]) {
  padding-left: 0;
}
label:has(> span:first-child):has([required])::before {
  content: "";
}
label:has(> span:first-child):has([required]) > span:first-child::before {
  color: #b42318;
  content: "* ";
  font-weight: 800;
}
.required-legend {
  margin: -6px 0 14px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}
.required-legend span:first-child {
  color: #b42318;
}
.language-control {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 220px;
}
.xml-type-control,
.print-type-control {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 300px;
  white-space: nowrap;
}
.xml-type-control:has([required]) {
  padding-left: 0;
}
.xml-type-control:has([required])::before {
  position: static;
}
.language-control select, .xml-type-control select, .print-type-control select {
  min-height: 40px;
}
input, select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 400;
}
.input-action {
  align-items: stretch;
  display: flex;
  gap: 8px;
  width: 100%;
}
.input-action button {
  flex: 0 0 auto;
  min-height: 42px;
  white-space: nowrap;
}
.input-action input {
  flex: 1 1 auto;
  min-width: 0;
}
.guest-code-field {
  min-width: 0;
}
.field-label-action {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: flex-start;
}
.field-label-action button {
  min-height: 28px;
  padding: 0 10px;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid rgba(15, 118, 110, 0.18); border-color: var(--accent); }
.wide { grid-column: 1 / -1; }
.guest-list { display: grid; gap: 12px; }
.guest-card { padding: 14px; background: #fbfcfe; }
.guest-title { justify-content: space-between; margin-bottom: 12px; }
.guest-title h3 { margin-bottom: 0; }
.guest-title-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.guest-title-actions .single-guest-select {
  min-height: 30px;
  min-width: min(100%, 220px);
  width: auto;
}
.guest-title-actions .save-single-guest,
.guest-title-actions .load-single-guest {
  min-height: 30px;
  padding: 0 10px;
}
.booking-person-toggle {
  display: none;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #d9e7e4;
  border-radius: 6px;
  background: #f3fbf9;
}
.guest-card:first-child .booking-person-toggle {
  display: grid;
}
.booking-person-toggle input {
  width: 18px;
  min-height: 18px;
}
.checkbox-line {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  color: #344056;
  font-size: 0.9rem;
  font-weight: 700;
}
.checkbox-line input {
  width: 18px;
  min-height: 18px;
}
.signature-field {
  gap: 8px;
}
.document-image-field {
  gap: 8px;
}
.document-image-input {
  padding: 9px 10px;
}
.document-image-preview {
  width: min(100%, 520px);
  max-height: 280px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  cursor: zoom-in;
  object-fit: contain;
}
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 18, 32, 0.82);
}
.image-lightbox img {
  max-width: min(100%, 1100px);
  max-height: 92vh;
  border-radius: 8px;
  background: #ffffff;
  object-fit: contain;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}
.image-lightbox-close {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-color: rgba(255, 255, 255, 0.5);
  background: #ffffff;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
}
.signature-pad {
  width: 100%;
  height: auto;
  aspect-ratio: 920 / 260;
  min-height: 180px;
  max-height: 300px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  display: block;
}
.clear-signature,
.clear-document-image,
.save-signature {
  justify-self: start;
}
.signature-preview {
  width: min(100%, 520px);
  min-height: 110px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  object-fit: contain;
}
.invalid { border-color: #dc2626; }
@media (max-width: 1260px) {
  .storage-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1120px) {
  .workspace { display: block; }
}
@media (max-width: 760px) {
  .app-shell { width: min(100vw - 20px, 1500px); padding: 14px 0; }
  .topbar, .guests-head, .section-head { align-items: stretch; flex-direction: column; }
  .brand-head, .login-header { align-items: flex-start; }
  .actions { justify-content: stretch; }
  .actions button, .guests-head button { width: 100%; }
  .xml-type-control, .print-type-control { width: 100%; min-width: 0; }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .date-time-pair { grid-template-columns: 1fr; }
  .login-grid { grid-template-columns: 1fr; }
}
