:root {
  color-scheme: light dark;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #2b2928;
  background: #f5f2ea;
  --navy: #242021;
  --blue: #c9a23b;
  --gold: #d7b44a;
  --gold-dark: #9b7620;
  --cream: #f5f2ea;
  --surface: #fffdf8;
  --line: #e4ddcd;
  --muted: #756f66;
}
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(180deg, #f2eee4 0, #f8f6f0 320px, #f5f2ea 100%); }
header { position: relative; overflow: hidden; background: var(--navy); color: white; padding: 19px max(28px, calc((100vw - 1380px) / 2)); display: flex; justify-content: space-between; align-items: center; gap: 24px; border-bottom: 4px solid var(--gold); }
header::after { content: ""; position: absolute; right: max(22px, calc((100vw - 1380px) / 2)); top: -72px; width: 245px; height: 245px; background: url("/acasarella-mark.svg") center/contain no-repeat; opacity: .045; pointer-events: none; }
header > * { position: relative; z-index: 1; }
.brand-lockup { display: flex; align-items: center; gap: 15px; }
.page-nav { display: flex; gap: 4px; padding: 4px; border: 1px solid #4e4644; border-radius: 10px; background: #1b1819; }
.page-nav a { border-radius: 7px; color: #c9c0b5; padding: 8px 13px; font-size: 13px; font-weight: 700; text-decoration: none; }
.page-nav a:hover { color: #f0d678; background: rgba(215,180,74,.09); }
.page-nav a.active { color: #29231a; background: var(--gold); }
.brand-mark { width: 55px; height: 55px; }
.brand-name { margin: 0 0 1px; color: #f4efe4; font-size: 22px; font-weight: 400; letter-spacing: .045em; line-height: 1; }
.brand-name span { color: var(--gold); }
.brand-name small { color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: .13em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; color: #bdb5a8; font-size: 13px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
h2 { margin-bottom: 12px; font-size: 18px; }
.eyebrow { margin-bottom: 4px; font-weight: 750; font-size: 10px; letter-spacing: .15em; color: var(--gold-dark); }
main { max-width: 1380px; margin: 0 auto; padding: 24px 28px 50px; }
.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 2px 0 18px; }
.page-intro h2 { margin-bottom: 0; font-size: 24px; }
.page-intro > p { max-width: 620px; margin: 0; color: var(--muted); font-size: 14px; text-align: right; }
.page-status { margin-top: 16px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(57,45,20,.045); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button, button { border: 1px solid transparent; border-radius: 8px; background: var(--gold); color: #29231a; padding: 10px 14px; font-weight: 700; cursor: pointer; font: inherit; text-decoration: none; transition: background .15s ease, transform .15s ease, border-color .15s ease; }
.button:hover, button:hover { background: #e0bf59; }
.button:active, button:active { transform: translateY(1px); }
.button.secondary, button.secondary { border-color: #e0c979; background: #fff8df; color: #765817; }
.button.secondary:hover, button.secondary:hover { background: #f8ecc1; }
header .button.secondary { border-color: #8d783d; background: transparent; color: #f0d678; }
header .button.secondary:hover { background: rgba(215,180,74,.12); }
header .button:not(.secondary) { background: var(--gold); }
.button.danger, button.danger { background: #bb3540; }
.button:disabled, button:disabled { cursor: not-allowed; opacity: .45; }
input[type=file] { display: none; }
.sync-card, .booking-contact-card, .email-card, .mobile-cloud-card { margin-bottom: 16px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.booking-sync-card { margin-bottom: 16px; padding: 20px; }
.booking-sync-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.booking-sync-heading h2 { margin-bottom: 0; }
.sync-stages { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.workflow-stage { display: flex; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fafbfc; }
.stage-number { flex: 0 0 30px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--gold); color: #29231a; font-weight: 800; }
.stage-content { min-width: 0; flex: 1; }
.stage-content h3 { margin: 3px 0 7px; }
.sync-card h2, .sync-card p { margin-bottom: 5px; }
.sync-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.booking-contact-card h2, .booking-contact-card p { margin-bottom: 5px; }
.booking-contact-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.email-card h2, .email-card p { margin-bottom: 5px; }
.security-note { color: var(--muted); font-size: 12px; }
.email-connect { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.email-connect input { min-width: 240px; }
.backup-card { margin-bottom: 16px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.backup-card h2, .backup-card p { margin-bottom: 5px; }
.backup-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.backup-directory { max-width: 760px; margin: 0; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.mobile-cloud-form { display: grid; grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr); gap: 8px; min-width: min(620px, 52vw); }
.mobile-cloud-form input { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; color: inherit; background: #fffefa; outline: none; }
.mobile-cloud-form #supabaseTable { grid-column: span 2; }
.date-nav { min-height: 62px; padding: 10px 14px; display: flex; align-items: center; gap: 8px; }
.date-nav button { border-color: #e4dcc8; color: #5f5648; background: #f5f0e5; padding: 9px 13px; }
.view-switch { display: flex; padding: 3px; margin-right: 8px; background: #f1ebdf; border-radius: 9px; }
.date-nav .view-button { background: transparent; padding: 7px 12px; }
.date-nav .view-button.active { background: var(--surface); color: #795c19; box-shadow: 0 2px 7px rgba(64,48,18,.10); }
input[type=date], input[type=url], input[type=email], input[type=password] { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; color: inherit; background: #fffefa; outline: none; }
input:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(215,180,74,.16); }
#status { margin-left: auto; color: var(--muted); font-size: 14px; }
.day-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 16px 0; }
.day-card { min-height: 190px; padding: 18px; border-top: 4px solid #c8bea9; }
.day-card.arrivals { border-top-color: #4e8d86; }
.day-card.staying { border-top-color: var(--gold); }
.day-card.departures { border-top-color: #c2744e; }
.guest-chip { padding: 10px 0; border-bottom: 1px solid #edf0f6; }
.guest-chip strong { display: block; }
.guest-chip span, .empty { color: var(--muted); font-size: 13px; }
.guest-chip .sent-marker { display: inline-block; margin-top: 5px; color: #167346; font-weight: 700; }
.calendar-card { margin: 16px 0; padding: 20px; }
.calendar-heading h2 { margin-bottom: 16px; font-size: 21px; }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.week-day { min-height: 280px; padding: 13px; border-right: 1px solid var(--line); background: #fffefa; }
.week-day:last-child { border-right: 0; }
.week-day.today, .month-day.today { background: #fff8df; }
.week-date { margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.week-date strong { display: block; color: #332f2b; font-size: 17px; }
.schedule-group { margin-top: 12px; }
.schedule-label { display: block; margin-bottom: 5px; color: var(--muted); font-weight: 700; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.schedule-item { margin-bottom: 5px; padding: 5px 7px; border-left: 3px solid #bac3d8; border-radius: 4px; background: #f7f8fb; font-size: 11px; line-height: 1.25; }
.schedule-item.arrival { border-left-color: #4e8d86; }
.schedule-item.stay { border-left-color: var(--gold); }
.schedule-item.departure { border-left-color: #c2744e; }
.month-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); }
.month-weekdays { min-width: 840px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.month-weekdays span { padding: 8px; }
#monthView { overflow-x: auto; }
.month-grid { min-width: 840px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.month-day { min-height: 130px; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; }
.month-day:hover { background: #fffaeb; }
.month-day.outside { background: #f6f2e9; color: #aaa296; }
.month-number { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.occupancy { color: var(--muted); font-size: 10px; font-weight: 500; }
.month-event { overflow: hidden; margin: 3px 0; padding: 3px 5px; border-radius: 4px; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.month-event.arrival { background: #e5f2ef; color: #326b65; }
.month-event.departure { background: #f9e9df; color: #914c2b; }
.month-event.stay { background: #fff3c8; color: #765817; }
.reservations-card, .detail-card { padding: 20px; margin-top: 16px; }
.section-title { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.table-controls { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.reservation-search { position: relative; }
.reservation-search::before { content: ""; position: absolute; left: 12px; top: 50%; width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; transform: translateY(-58%); pointer-events: none; }
.reservation-search::after { content: ""; position: absolute; left: 25px; top: calc(50% + 5px); width: 6px; height: 2px; border-radius: 2px; background: var(--muted); transform: rotate(45deg); pointer-events: none; }
.reservation-search input { width: min(360px, 36vw); min-width: 260px; border: 1px solid var(--line); border-radius: 8px; padding: 9px 12px 9px 38px; font: inherit; color: inherit; background: #fffefa; outline: none; }
.filter-button { padding: 8px 11px; font-size: 13px; white-space: nowrap; }
.filter-button[aria-pressed="true"] { border-color: var(--gold-dark); background: #f0d986; color: #4e3d16; }
.filter-toggle { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 14px; cursor: pointer; }
.filter-toggle input { width: 17px; height: 17px; accent-color: var(--gold-dark); }
.count { background: #fff3c8; color: #765817; border-radius: 999px; padding: 6px 11px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 12px 10px; border-bottom: 1px solid #edf0f6; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #fff9e8; }
.empty-table-row { cursor: default; }
.empty-table-row:hover { background: transparent; }
.empty-table-row td { padding: 28px 10px; color: var(--muted); text-align: center; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #eef1f7; font-size: 12px; }
.pill.ok { background: #e7f7ee; color: #167346; }
.pill.sent { background: #e2f6ea; color: #12683f; font-weight: 700; }
.pill.missing { background: #fff1e6; color: #a75518; }
.pill.cancelled { background: #fdeaea; color: #9d3232; }
.hidden { display: none; }
.icon-button { background: transparent; color: #4b5670; font-size: 24px; padding: 0 6px; }
.message-history { display: flex; align-items: center; gap: 14px; margin: 14px 0; padding: 12px 14px; border: 1px solid #dfe6f0; border-radius: 10px; background: #f8fafc; }
.message-history strong { color: #216c49; }
.message-history span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.workflow-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.workflow-step { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fafbfc; font-size: 12px; font-weight: 700; }
.workflow-step.complete { border-color: #bce4ce; color: #167346; background: #eefaf3; }
.workflow-step.current { border-color: #e0c86e; color: #795c19; background: #fff8df; }
.mobile-shell { max-width: 760px; padding-top: 12px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
.mobile-auth { max-width: 420px; margin: 8vh auto 0; padding: 22px; }
.mobile-auth h2 { font-size: 22px; }
.mobile-auth form { display: grid; gap: 8px; }
.mobile-auth label { margin-top: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.mobile-auth button { margin-top: 8px; min-height: 44px; }
.mobile-toolbar { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: minmax(132px, 1fr) 44px minmax(0, 1fr) 44px 70px 86px 58px; gap: 6px; padding: 8px; }
.mobile-toolbar button, .mobile-toolbar input { min-height: 44px; }
.mobile-view-switch { display: flex; min-width: 132px; padding: 3px; border-radius: 9px; background: #f1ebdf; }
.mobile-view-button { flex: 1; padding: 7px 10px; background: transparent; color: #5f5648; }
.mobile-view-button.active { background: var(--surface); color: #795c19; box-shadow: 0 2px 7px rgba(64,48,18,.10); }
.week-mode .mobile-summary, .week-mode .mobile-search, .week-mode .mobile-day-list, .week-mode .mobile-results-card, .week-mode .page-status { display: none; }
.week-mode .mobile-week-card { margin-top: 10px; }
.mobile-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.mobile-metric { min-height: 86px; padding: 14px; border-top: 4px solid #c8bea9; }
.mobile-metric.arrival { border-top-color: #4e8d86; }
.mobile-metric.stay { border-top-color: var(--gold); }
.mobile-metric.departure { border-top-color: #c2744e; }
.mobile-metric span { display: block; font-size: 30px; font-weight: 800; line-height: 1; }
.mobile-metric strong { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; text-transform: uppercase; }
.mobile-search { display: flex; align-items: center; gap: 10px; padding: 12px; }
.mobile-search input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; font: inherit; color: inherit; background: #fffefa; outline: none; }
.mobile-day-list { display: grid; gap: 12px; margin: 14px 0; }
.mobile-list-card, .mobile-results-card, .mobile-week-card { padding: 16px; }
.mobile-list-card h2 { margin-bottom: 10px; }
.mobile-reservation { display: grid; gap: 5px; margin: 8px 0; padding: 12px; border-left: 4px solid #c8bea9; border-radius: 8px; background: #fafbfc; }
.mobile-reservation.arrival { border-left-color: #4e8d86; }
.mobile-reservation.stay { border-left-color: var(--gold); }
.mobile-reservation.departure { border-left-color: #c2744e; }
.mobile-reservation.search { border-left-color: #9a8b66; }
.mobile-reservation div { display: flex; justify-content: space-between; gap: 10px; }
.mobile-reservation strong, .mobile-reservation span, .mobile-reservation p { min-width: 0; overflow-wrap: anywhere; }
.mobile-reservation span { overflow: hidden; color: var(--muted); text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.mobile-reservation p { margin: 0; color: var(--muted); font-size: 13px; }
.mobile-results { margin-top: 10px; }
.mobile-week-card { overflow: hidden; }
.mobile-week-card .section-title { align-items: end; }
.mobile-week-card h2 { margin-bottom: 0; }
.mobile-week-legend { display: flex; flex-wrap: wrap; gap: 10px; margin: 9px 0 12px; color: var(--muted); font-size: 10px; font-weight: 700; }
.mobile-week-legend span { display: inline-flex; align-items: center; gap: 4px; }
.mobile-week-legend i { width: 8px; height: 8px; border-radius: 2px; background: #c8bea9; }
.mobile-week-legend .arrival i { background: #4e8d86; }
.mobile-week-legend .stay i { background: var(--gold); }
.mobile-week-legend .departure i { background: #c2744e; }
.mobile-week-list { display: grid; grid-template-columns: minmax(52px, .95fr) repeat(7, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.mobile-week-corner, .mobile-week-column-head, .mobile-week-room, .mobile-week-cell { min-width: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mobile-week-corner, .mobile-week-column-head { min-height: 36px; background: #f4f0e7; }
.mobile-week-corner { display: flex; align-items: center; padding: 5px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.mobile-week-column-head { display: grid; place-content: center; gap: 1px; color: var(--muted); font-size: 9px; text-align: center; }
.mobile-week-column-head strong { color: #332f2b; font-size: 11px; text-transform: uppercase; }
.mobile-week-column-head.today, .mobile-week-cell.today { background: #fff8df; }
.mobile-week-room { display: flex; align-items: center; min-height: 46px; padding: 5px; overflow: hidden; color: #332f2b; font-size: 10px; font-weight: 800; text-overflow: ellipsis; }
.mobile-week-cell { display: flex; min-height: 46px; padding: 2px; flex-direction: column; justify-content: center; gap: 2px; background: #fffefa; }
.mobile-week-entry { display: grid; min-width: 0; min-height: 17px; place-items: center; overflow: hidden; border-radius: 3px; padding: 2px 1px; color: #fff; font-size: 8px; font-weight: 850; line-height: 1; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.mobile-week-entry.arrival { background: #4e8d86; }
.mobile-week-entry.stay { background: #b28a26; }
.mobile-week-entry.departure { background: #c2744e; }
.mobile-week-list > :nth-child(8n) { border-right: 0; }
.mobile-week-list > :nth-last-child(-n + 8) { border-bottom: 0; }
.chekin-phase { display: grid; gap: 12px; margin: 14px 0 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc; }
.chekin-phase.start, .chekin-phase.preparing, .chekin-phase.saving { border-color: #d7c879; background: #fffbea; }
.chekin-phase.review { border-color: #dcb96a; background: #fff6df; }
.chekin-phase.retrieving { border-color: #9ec5df; background: #f0f8fd; }
.chekin-phase.ready { border-color: #bce4ce; background: #eefaf3; }
.chekin-phase.failed { border-color: #e2a6a6; background: #fff1f1; }
.chekin-progress { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chekin-progress::before { content: ""; position: absolute; z-index: 0; top: 13px; left: 13px; right: 13px; height: 2px; background: #d9dee7; }
.chekin-phase.review .chekin-progress::before,
.chekin-phase.saving .chekin-progress::before { background: linear-gradient(to right, #8dceb0 0 50%, #d9dee7 50% 100%); }
.chekin-phase.retrieving .chekin-progress::before,
.chekin-phase.ready .chekin-progress::before { background: #8dceb0; }
.chekin-progress-step { position: relative; z-index: 1; display: flex; min-width: 0; align-items: center; flex-direction: column; gap: 5px; color: var(--muted); font-size: 12px; font-weight: 700; text-align: center; }
.chekin-progress-step:first-child { align-items: flex-start; text-align: left; }
.chekin-progress-step:last-child { align-items: flex-end; text-align: right; }
.chekin-progress-step b { position: relative; z-index: 1; display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 27px; border: 2px solid #c8ced8; border-radius: 50%; color: #7a8391; background: #fff; }
.chekin-progress-step.complete { color: #167346; }
.chekin-progress-step.complete b { border-color: #55a97b; color: #fff; background: #3d9869; }
.chekin-progress-step.current { color: #765a16; }
.chekin-progress-step.current b { border-color: #c59a2d; color: #765a16; background: #fff3c8; }
.chekin-phase.retrieving .chekin-progress-step.current { color: #28698e; }
.chekin-phase.retrieving .chekin-progress-step.current b { border-color: #4e96bd; color: #28698e; background: #dff2fd; }
.chekin-phase.failed .chekin-progress-step.current { color: #9b3030; }
.chekin-phase.failed .chekin-progress-step.current b { border-color: #c45b5b; color: #9b3030; background: #ffe0e0; }
.chekin-phase.preparing .chekin-progress-step.current b,
.chekin-phase.saving .chekin-progress-step.current b,
.chekin-phase.retrieving .chekin-progress-step.current b { animation: chekin-pulse 1.4s ease-in-out infinite; }
.chekin-phase-copy { display: flex; align-items: baseline; gap: 10px; }
.chekin-phase-copy strong { white-space: nowrap; }
.chekin-phase-copy span { color: var(--muted); font-size: 13px; }
@keyframes chekin-pulse { 50% { box-shadow: 0 0 0 5px rgba(197,154,45,.18); } }
.chekin-entry { display: flex; gap: 8px; margin: 16px 0 10px; }
.chekin-entry input { flex: 1; }
.preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
textarea { width: 100%; min-height: 310px; border: 1px solid var(--line); border-radius: 10px; padding: 14px; resize: vertical; color: #332f2b; background: #fffefa; font: 14px/1.5 "Segoe UI", sans-serif; outline: none; }

@media (prefers-color-scheme: dark) {
  :root {
    color: #eee9df;
    background: #191718;
    --navy: #121011;
    --blue: #d7b44a;
    --gold: #d7b44a;
    --gold-dark: #e0c267;
    --cream: #191718;
    --surface: #242122;
    --line: #484142;
    --muted: #b8afa5;
  }

  body { background: linear-gradient(180deg, #151314 0, #1d1a1b 320px, #191718 100%); }
  header { background: #100e0f; }
  header::after { opacity: .07; }
  .brand-name { color: #f5f0e7; }
  h1 { color: #bdb4a8; }
  .card { box-shadow: 0 8px 26px rgba(0,0,0,.22); }

  .button, button { color: #29231a; }
  .button.secondary, button.secondary {
    border-color: #766733;
    background: #302b20;
    color: #ecd884;
  }
  .button.secondary:hover, button.secondary:hover { background: #403821; }
  header .button.secondary { background: transparent; }

  .date-nav button { border-color: #50494a; color: #ded7cd; background: #302c2d; }
  .view-switch { background: #1b1819; }
  .date-nav .view-button.active { background: #3a3430; color: #f1d575; box-shadow: 0 2px 8px rgba(0,0,0,.32); }
  input[type=date], input[type=url], input[type=email], input[type=password], input[type=text], input[type=search], textarea {
    border-color: var(--line);
    color: #eee9df;
    background: #1d1a1b;
  }
  input::placeholder, textarea::placeholder { color: #8f8780; }
  input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(.82); }

  .guest-chip { border-bottom-color: #3d3839; }
  .guest-chip .sent-marker { color: #70c99b; }
  .week-day { background: #211e1f; }
  .week-day.today, .month-day.today { background: #37301d; }
  .week-date strong { color: #f0ebe2; }
  .schedule-item { border-left-color: #777078; background: #2b2728; }
  .month-day:hover { background: #312b20; }
  .month-day.outside { background: #1d1a1b; color: #756e69; }
  .month-event.arrival { background: #203c38; color: #8bc8bd; }
  .month-event.departure { background: #482d25; color: #e6a183; }
  .month-event.stay { background: #463b1d; color: #ecd272; }

  .count { background: #463b1d; color: #ecd272; }
  th, td { border-bottom-color: #3d3839; }
  tbody tr:hover { background: #312b20; }
  .pill { background: #363234; color: #ddd6ce; }
  .pill.ok, .pill.sent { background: #1e4432; color: #87d5a8; }
  .pill.missing { background: #49321f; color: #edb274; }
  .pill.cancelled { background: #4a2729; color: #ef9a9e; }
  .icon-button { color: #d4cbc2; }
  .message-history { border-color: #484142; background: #1d1b1c; }
  .message-history strong { color: #83cfa7; }
  .workflow-step { background: #211f20; }
  .workflow-step.complete { border-color: #376f51; color: #80d0a3; background: #1c382a; }
  .workflow-step.current { border-color: #79692e; color: #efd474; background: #3c341d; }
  .mobile-search input { border-color: var(--line); color: #eee9df; background: #1d1a1b; }
  .mobile-auth input { border-color: var(--line); color: #eee9df; background: #1d1a1b; }
  .mobile-view-switch { background: #1b1819; }
  .mobile-view-button { color: #ded7cd; }
  .mobile-view-button.active { background: #3a3430; color: #f1d575; box-shadow: 0 2px 8px rgba(0,0,0,.32); }
  .mobile-reservation { background: #211f20; }
  .mobile-week-corner, .mobile-week-column-head { background: #302c2d; }
  .mobile-week-column-head strong, .mobile-week-room { color: #f0ebe2; }
  .mobile-week-cell { background: #211e1f; }
  .mobile-week-column-head.today, .mobile-week-cell.today { background: #37301d; }
  .chekin-phase { background: #211f20; }
  .chekin-phase.start, .chekin-phase.preparing, .chekin-phase.review { border-color: #79692e; background: #3c341d; }
  .chekin-phase.retrieving { border-color: #386b87; background: #203542; }
  .chekin-phase.ready { border-color: #376f51; background: #1c382a; }
  .chekin-progress::before { background: #555052; }
  .chekin-phase.review .chekin-progress::before { background: linear-gradient(to right, #376f51 0 50%, #555052 50% 100%); }
  .chekin-phase.retrieving .chekin-progress::before,
  .chekin-phase.ready .chekin-progress::before { background: #376f51; }
  .chekin-progress-step b { border-color: #625c5e; color: #c3bbb3; background: #292526; }
  .chekin-progress-step.complete { color: #80d0a3; }
  .chekin-progress-step.complete b { border-color: #4b9e70; background: #28734d; }
  .chekin-progress-step.current { color: #efd474; }
  .chekin-progress-step.current b { border-color: #a78c2e; color: #efd474; background: #55471f; }
  .chekin-phase.retrieving .chekin-progress-step.current { color: #8fc9e8; }
  .chekin-phase.retrieving .chekin-progress-step.current b { border-color: #5798bb; color: #b9e0f5; background: #244b60; }
  .workflow-stage { background: #211f20; }
}

@media (max-width: 850px) {
  header { align-items: flex-start; flex-direction: column; }
  .page-nav { width: 100%; }
  .page-nav a { flex: 1; text-align: center; }
  header .actions { width: 100%; }
  header .actions .button { flex: 1 1 230px; text-align: center; }
  .sync-card, .booking-contact-card, .email-card, .mobile-cloud-card { align-items: stretch; flex-direction: column; }
  .sync-stages { grid-template-columns: 1fr; }
  .booking-sync-heading { align-items: flex-start; flex-direction: column; }
  .sync-actions, .booking-contact-actions { justify-content: flex-start; }
  .email-connect { justify-content: flex-start; }
  .email-connect input { flex: 1 1 260px; min-width: 0; }
  .mobile-cloud-form { grid-template-columns: 1fr; min-width: 0; width: 100%; }
  .mobile-cloud-form #supabaseTable { grid-column: auto; }
  .backup-card { align-items: stretch; flex-direction: column; }
  .backup-actions { justify-content: flex-start; }
  .day-grid { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: repeat(2, 1fr); }
  .chekin-phase-copy { align-items: flex-start; flex-direction: column; gap: 3px; }
  #status { width: 100%; margin-left: 0; }
  .date-nav { flex-wrap: wrap; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; }
  .chekin-entry { flex-wrap: wrap; }
  .chekin-entry input { flex-basis: 100%; }
  .reservations-card .section-title { align-items: stretch; flex-direction: column; }
  .table-controls { justify-content: flex-start; }
  .reservation-search { flex: 1 1 100%; }
  .reservation-search input { width: 100%; min-width: 0; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 8px; }
  .page-intro > p { text-align: left; }
  .mobile-shell { padding-left: 12px; padding-right: 12px; }
  .mobile-toolbar { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .mobile-view-switch { grid-column: 1 / 3; grid-row: 1; }
  .mobile-toolbar #mobileLogout { grid-column: 3; grid-row: 1; padding-left: 6px; padding-right: 6px; }
  .mobile-toolbar #mobilePrevious { grid-column: 1; grid-row: 2; }
  .mobile-toolbar #mobileDate { grid-column: 2; grid-row: 2; width: 100%; min-width: 0; }
  .mobile-toolbar #mobileNext { grid-column: 3; grid-row: 2; }
  .mobile-toolbar #mobileToday { grid-column: 1; grid-row: 3; }
  .mobile-toolbar #mobileRefresh { grid-column: 2 / 4; grid-row: 3; }
  .mobile-summary { gap: 8px; }
  .mobile-metric { padding: 12px 10px; }
  .mobile-metric span { font-size: 26px; }
  .mobile-search { align-items: stretch; flex-direction: column; }
  .mobile-search .pill { align-self: flex-start; }
  .mobile-search .pill { max-width: 100%; overflow-wrap: anywhere; white-space: normal; }
  .mobile-reservation div { align-items: flex-start; flex-direction: column; gap: 3px; }
  .mobile-reservation span { text-align: left; white-space: normal; }
  .mobile-week-card { padding: 12px 10px; }
  .mobile-week-list { grid-template-columns: 50px repeat(7, minmax(0, 1fr)); }
  .mobile-week-entry { font-size: 7px; }
}

@media (max-width: 360px) {
  .mobile-shell { padding-left: 8px; padding-right: 8px; }
  .mobile-week-card { padding: 10px 6px; }
  .mobile-week-list { grid-template-columns: 46px repeat(7, minmax(0, 1fr)); }
  .mobile-week-room { padding: 3px; font-size: 8px; }
  .mobile-week-entry { font-size: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .chekin-progress-step.current b { animation: none !important; }
}
