/* Material Design 3-inspired application theme, based on the supplied CSS palette. */
:root {
  color-scheme: light;
  --primary: #0b57d0;
  --on-primary: #ffffff;
  --primary-container: #d3e3fd;
  --on-primary-container: #041e49;
  --secondary-container: #e8f0fe;
  --on-secondary-container: #0b3068;
  --surface: #f8fafd;
  --surface-container: #ffffff;
  --surface-container-low: #f3f6fc;
  --surface-container-high: #e9eef6;
  --on-surface: #1f1f1f;
  --on-surface-variant: #444746;
  --outline: #747775;
  --outline-variant: #c4c7c5;
  --error: #b3261e;
  --success: #087443;
  --shadow: rgba(32, 33, 36, .18);
  --radius-small: 12px;
  --radius-medium: 16px;
  --radius-large: 28px;
}

:root[data-theme="Dark"] {
  color-scheme: dark;
  --primary: #a8c7fa;
  --on-primary: #062e6f;
  --primary-container: #0842a0;
  --on-primary-container: #d3e3fd;
  --secondary-container: #2b3f62;
  --on-secondary-container: #d8e2ff;
  --surface: #131314;
  --surface-container: #1e1f20;
  --surface-container-low: #1a1b1c;
  --surface-container-high: #292a2d;
  --on-surface: #e3e3e3;
  --on-surface-variant: #c4c7c5;
  --outline: #8e918f;
  --outline-variant: #444746;
  --error: #f2b8b5;
  --success: #77d99a;
  --shadow: rgba(0, 0, 0, .42);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--surface);
  color: var(--on-surface);
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.sr-only { clip: rect(0, 0, 0, 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; }

/* Sign in: the elevated card keeps the interaction focused on small screens. */
.login-page { align-items: center; background: radial-gradient(circle at 8% 0%, var(--primary-container) 0, transparent 30rem), var(--surface); display: grid; min-height: 100svh; padding: calc(28px + env(safe-area-inset-top)) 20px 32px; place-items: center; position: relative; }
/* Keep the dark-mode blue accent, but at half intensity. */
:root[data-theme="Dark"] .login-page { background: radial-gradient(circle at 8% 0%, color-mix(in srgb, var(--primary-container) 50%, transparent) 0, transparent 30rem), var(--surface); }
.theme-toggle { align-items: center; background: var(--surface-container); border: 0; border-radius: 999px; box-shadow: 0 1px 3px var(--shadow); color: var(--on-surface-variant); cursor: pointer; display: flex; font-size: .875rem; font-weight: 600; gap: 8px; min-height: 40px; padding: 0 14px; position: absolute; right: 20px; top: calc(20px + env(safe-area-inset-top)); }
.theme-toggle:hover { background: var(--surface-container-high); }
.theme-toggle svg { fill: none; height: 20px; stroke: currentColor; stroke-width: 1.8; width: 20px; }
.login-card { align-items: center; background: var(--surface-container); border-radius: var(--radius-large); box-shadow: 0 2px 5px rgba(32, 33, 36, .12), 0 12px 28px var(--shadow); display: flex; flex-direction: column; margin: auto; max-width: 440px; padding: clamp(32px, 8vw, 48px); width: 100%; }
.login-logo img { max-width: 240px; }
.header-logo img { max-height: 50px; padding-top: 5px; }
.manager-label { color: var(--on-surface-variant); font-size: .6875rem; font-weight: 700; letter-spacing: .45em; margin: 10px 0 32px .45em; }
.login-form { align-items: center; display: flex; flex-direction: column; width: 100%; }
.field { align-items: center; background: var(--surface-container); border: 1px solid var(--outline); border-radius: var(--radius-small); display: flex; height: 56px; margin-top: 14px; padding: 0 15px; transition: border .18s, box-shadow .18s; width: 100%; }
.field:hover { border-color: var(--on-surface); }
.field:focus-within { border: 2px solid var(--primary); box-shadow: 0 0 0 1px var(--primary); padding: 0 14px; }
.field svg { fill: none; flex: 0 0 auto; height: 21px; margin-right: 13px; stroke: var(--on-surface-variant); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 21px; }
.field:focus-within svg { stroke: var(--primary); }
.field input, .field select { background: transparent; border: 0; color: var(--on-surface); font-size: 1rem; height: 100%; min-width: 0; outline: 0; padding: 0; width: 100%; }
.field input::placeholder { color: var(--on-surface-variant); opacity: 1; }
.field select { cursor: pointer; }
.form-message { color: var(--error); display: none; font-size: .875rem; line-height: 1.35; margin: 14px 0 -4px; text-align: center; }
.form-message.visible { display: block; }
.form-message.success { color: var(--success); }
.login-button { background: var(--primary); border: 0; border-radius: 999px; box-shadow: 0 1px 2px rgba(0, 0, 0, .24); color: var(--on-primary); cursor: pointer; font-size: .9375rem; font-weight: 700; height: 44px; letter-spacing: .015em; margin-top: 24px; transition: box-shadow .18s, background .18s; width: 100%; }
.login-button:hover { box-shadow: 0 2px 6px rgba(0, 0, 0, .3); filter: brightness(1.04); }
.login-button:disabled { cursor: wait; opacity: .7; }
.remember { align-items: center; color: var(--on-surface-variant); cursor: pointer; display: flex; font-size: .875rem; margin-top: 17px; }
.remember input { accent-color: var(--primary); height: 18px; margin: 0 10px 0 0; width: 18px; }
.create-account { align-items: center; color: var(--primary); display: flex; font-size: .875rem; font-weight: 600; gap: 6px; margin-top: 28px; text-align: center; text-decoration: none; }
.create-account:hover { text-decoration: underline; }
.create-account svg { fill: none; height: 15px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 15px; }
.install-help { border-top: 1px solid var(--outline-variant); margin-top: 24px; padding-top: 16px; width: 100%; }
.install-help summary { color: var(--primary); cursor: pointer; font-size: .875rem; font-weight: 700; list-style-position: inside; text-align: center; }
.install-help summary:hover { text-decoration: underline; }
.install-button { background: var(--primary); border: 0; border-radius: 999px; color: var(--on-primary); cursor: pointer; display: block; font-size: .8125rem; font-weight: 700; margin: 14px auto 0; padding: 9px 18px; }
.install-button:hover { filter: brightness(1.04); }
.install-button:disabled { cursor: wait; opacity: .7; }
.install-help-content { color: var(--on-surface-variant); font-size: .8125rem; line-height: 1.45; padding-top: 16px; text-align: left; }
.install-help-content section + section { border-top: 1px solid var(--outline-variant); margin-top: 14px; padding-top: 12px; }
.install-help-content h2 { color: var(--on-surface); font-size: .875rem; margin: 0 0 5px; }
.install-help-content ol { margin: 0; padding-left: 20px; }
.install-help-content li { margin: 3px 0; }

/* App shell shared by bookings, today and about views. */
.bookings-page { background: var(--surface); min-height: 100svh; padding: env(safe-area-inset-top) 20px 36px; }
.bookings-page[hidden], .login-page[hidden] { display: none; }
.app-header { align-items: center; display: flex; height: 72px; justify-content: space-between; margin: 0 auto 28px; max-width: 960px; position: relative; }
.header-wordmark { align-items: baseline; color: var(--on-surface); display: flex; font-family: Georgia, "Times New Roman", serif; font-size: 2rem; font-style: italic; font-weight: bold; letter-spacing: -.08em; }
.header-logo { display: inline-flex; line-height: 0; }
.header-logo img { display: block; height: 48px; max-width: min(44vw, 220px); object-fit: contain; width: auto; }
.header-wordmark > span { color: #d93025; font-size: 1.28em; letter-spacing: -.18em; margin-right: .01em; }
.header-wordmark small { align-self: flex-end; color: var(--on-surface-variant); font-family: Roboto, Arial, sans-serif; font-size: .36rem; font-style: normal; font-weight: 700; letter-spacing: .18em; margin: 0 0 .55em .55em; }
.menu-toggle, .refresh-button { align-items: center; background: transparent; border: 0; border-radius: 999px; color: var(--on-surface); cursor: pointer; display: flex; font-weight: 600; justify-content: center; min-height: 44px; }
.menu-toggle { gap: 8px; padding: 0 12px 0 16px; }
.menu-toggle:hover, .refresh-button:hover { background: var(--surface-container-high); }
.menu-toggle svg, .bookings-heading svg, .refresh-button svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.menu-toggle svg { height: 24px; width: 24px; }
.app-menu { background: var(--surface-container); border-radius: var(--radius-medium); box-shadow: 0 5px 15px var(--shadow); display: flex; flex-direction: column; min-height: 246px; overflow: hidden; padding: 8px 0; position: absolute; right: 0; top: 64px; width: min(290px, calc(100vw - 40px)); z-index: 2; }
.app-menu[hidden] { display: none; }
.app-menu button { align-items: center; background: transparent; border: 0; color: var(--on-surface); cursor: pointer; display: flex; font-size: .9375rem; gap: 14px; min-height: 48px; padding: 0 20px; text-align: left; }
.app-menu button:not(:disabled):hover { background: var(--secondary-container); }
.app-menu button:disabled { cursor: default; opacity: .55; }
.app-menu .logout-button { border-top: 1px solid var(--outline-variant); color: var(--primary); justify-content: flex-end; margin: auto 12px 0; padding-top: 8px; }
.bookings-content, .today-content { margin: 0 auto; max-width: 960px; }
.bookings-heading { align-items: center; display: flex; gap: 12px; margin: 0 0 20px; }
.bookings-heading > svg { color: var(--primary); height: 28px; width: 28px; }
.bookings-heading h1 { font-size: 1.375rem; letter-spacing: -.01em; margin: 0; }
.refresh-button { color: var(--primary); margin-left: auto; padding: 0; width: 44px; }
.refresh-button svg { height: 22px; width: 22px; }
.refresh-button.loading svg { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bookings-message { color: var(--on-surface-variant); margin: 56px auto; max-width: 430px; text-align: center; }
.bookings-message.error { color: var(--error); }
.bookings-message.success { color: var(--success); }
.booking-list { display: grid; gap: 12px; }
.booking-card { background: var(--surface-container); border: 1px solid var(--outline-variant); border-radius: var(--radius-medium); box-shadow: 0 1px 2px rgba(0, 0, 0, .07); color: var(--on-surface); cursor: pointer; display: flex; justify-content: space-between; min-height: 120px; padding: 17px 18px; text-align: left; transition: background .18s, box-shadow .18s, transform .18s; width: 100%; }
.booking-card:hover { background: var(--surface-container-low); box-shadow: 0 4px 12px var(--shadow); transform: translateY(-1px); }
.booking-main, .booking-meta { display: grid; align-content: start; gap: 7px; }
.booking-meta { color: var(--on-surface-variant); justify-items: end; text-align: right; }
.booking-status { font-size: .875rem; font-weight: 700; }
.booking-date, .booking-meta span { font-size: .875rem; }
.booking-guest { font-size: 1rem; font-weight: 700; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-confirmed { color: #00856f; }
.status-waiting_list { color: #ae6700; }
.status-request { color: #b3261e; }
.status-other { color: #7356a1; }
.status-accommodated { color: #1769aa; }
.status-cancelled, .status-cancel, .status-no_show { color: #687078; }
.status-finished { color: #536b80; }
:root[data-theme="Dark"] .status-confirmed { color: #7ce0c6; } :root[data-theme="Dark"] .status-waiting_list { color: #ffb95c; } :root[data-theme="Dark"] .status-request { color: #ffb4ab; } :root[data-theme="Dark"] .status-other { color: #dac0ff; } :root[data-theme="Dark"] .status-accommodated { color: #a8c7fa; }

/* Today and about */
.day-switch { background: var(--surface-container-high); border-radius: 999px; display: flex; gap: 0; margin: 6px 0 30px; padding: 4px; width: fit-content; }
.day-switch button { background: transparent; border: 0; border-radius: 999px; color: var(--on-surface-variant); cursor: pointer; font-size: .875rem; font-weight: 700; min-height: 40px; min-width: 108px; padding: 0 18px; }
.day-switch button:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.day-switch button.active { background: var(--primary-container); color: var(--on-primary-container); }
.today-sections { display: grid; gap: 30px; }
.today-section { display: grid; gap: 11px; }
.today-section-heading { align-items: center; color: var(--on-surface); display: flex; gap: 10px; font-size: 1rem; font-weight: 700; margin: 0; }
.today-section-heading .section-symbol { align-items: center; background: var(--secondary-container); border-radius: 50%; color: var(--on-secondary-container); display: flex; font-size: 1.1rem; height: 34px; justify-content: center; width: 34px; }
.today-section-heading.checkin .section-symbol { background: #fff0d9; color: #9a5b00; }
.today-section-heading.checkout .section-symbol { background: #fce8e6; color: #b3261e; }
.today-section-heading.stay .section-symbol { background: var(--primary-container); color: var(--on-primary-container); }
.empty-section { background: var(--surface-container-low); border-radius: var(--radius-small); color: var(--on-surface-variant); font-size: .9375rem; margin: 0; padding: 16px; }
.about-content { align-items: center; background: var(--surface-container); border-radius: var(--radius-large); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); display: flex; flex-direction: column; justify-content: center; margin: min(16vh, 130px) auto 0; max-width: 540px; padding: 40px 28px; text-align: center; }
.about-content > svg { background: var(--primary-container); border-radius: 50%; color: var(--on-primary-container); fill: none; height: 58px; margin-bottom: 16px; padding: 12px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; width: 58px; }
.about-content h1 { font-size: 1.5rem; letter-spacing: -.015em; margin: 0 0 20px; }
.about-content p { color: var(--on-surface-variant); font-size: .9375rem; margin: 5px 0; }
.about-content p span { color: var(--on-surface); font-weight: 700; }

/* Booking detail */
.detail-back { align-items: center; background: transparent; border: 0; border-radius: 999px; color: var(--primary); cursor: pointer; display: flex; font-size: .9375rem; font-weight: 700; gap: 4px; min-height: 44px; padding: 0 12px; }
.detail-back:hover { background: var(--secondary-container); }
.detail-back svg { fill: none; height: 21px; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; width: 21px; }
.detail-content { margin: 0 auto; max-width: 760px; }
.detail-body { display: grid; gap: 20px; }
.detail-card { background: var(--surface-container); border: 1px solid var(--outline-variant); border-radius: var(--radius-medium); box-shadow: 0 1px 2px rgba(0, 0, 0, .07); overflow: hidden; }
.detail-list { display: grid; margin: 0; }
.detail-row { align-items: start; border-bottom: 1px solid var(--outline-variant); display: grid; gap: 8px 24px; grid-template-columns: minmax(132px, .8fr) minmax(0, 1.2fr); padding: 15px 20px; }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { color: var(--on-surface-variant); font-size: .875rem; }
.detail-row dd { font-size: .9375rem; font-weight: 700; margin: 0; overflow-wrap: anywhere; }
.detail-status { border-top: 1px solid var(--outline-variant); padding: 20px; }
.detail-status label { color: var(--on-surface-variant); display: block; font-size: .875rem; margin-bottom: 8px; }
.detail-status select { appearance: auto; background: var(--surface-container); border: 1px solid var(--outline); border-radius: var(--radius-small); color: var(--on-surface); cursor: pointer; font-weight: 600; height: 52px; padding: 0 14px; width: 100%; }
.detail-status select:focus { border: 2px solid var(--primary); outline: 0; padding: 0 13px; }
.detail-account { padding: 20px; }
.detail-account h2 { font-size: 1rem; margin: 0 0 14px; }
.detail-account-item { align-items: baseline; border-top: 1px solid var(--outline-variant); display: flex; gap: 16px; justify-content: space-between; padding: 12px 0; }
.detail-account-item strong { font-size: .9375rem; }
.detail-account-item span { color: var(--on-surface-variant); font-size: .875rem; text-align: right; }
.detail-actions { display: flex; gap: 12px; justify-content: flex-end; }
.detail-actions button { border-radius: 999px; cursor: pointer; font-size: .9375rem; font-weight: 700; min-height: 44px; padding: 0 22px; }
.detail-cancel { background: transparent; border: 1px solid var(--outline); color: var(--primary); }
.detail-cancel:hover { background: var(--secondary-container); }
.detail-save { background: var(--primary); border: 1px solid var(--primary); box-shadow: 0 1px 2px rgba(0, 0, 0, .22); color: var(--on-primary); }
.detail-save:hover { filter: brightness(1.04); }
.detail-save:disabled { cursor: wait; opacity: .65; }
.detail-notice { background: var(--secondary-container); border-radius: var(--radius-small); color: var(--on-secondary-container); font-size: .875rem; margin: 0; padding: 14px 16px; }

/* The detail actions become full-width touch targets on phones. */
@media (max-width: 520px) {
  .detail-back { font-size: 0; padding: 0; width: 44px; }
  .detail-row { gap: 3px; grid-template-columns: 1fr; padding: 14px 16px; }
  .detail-status, .detail-account { padding: 16px; }
  .detail-actions { flex-direction: column-reverse; }
  .detail-actions button { width: 100%; }
}

@media (max-width: 520px) {
  html, body { font-size: 18px; }
  .login-page { align-items: start; padding: calc(88px + env(safe-area-inset-top)) 16px 24px; }
  .login-card { border-radius: 24px; box-shadow: 0 2px 10px var(--shadow); padding: 32px 24px; }
  .theme-toggle { right: 16px; top: calc(16px + env(safe-area-inset-top)); }
  .bookings-page { padding-left: 16px; padding-right: 16px; }
  .app-header { margin-bottom: 20px; }
  .header-wordmark { font-size: 1.72rem; }
  .menu-toggle { font-size: 0; gap: 0; padding: 0; width: 44px; }
  .booking-card { min-height: 116px; padding: 15px; }
  .booking-status, .booking-date, .booking-meta span { font-size: .9375rem; }
  .booking-guest { font-size: 1.0625rem; }
  .booking-guest { max-width: min(50vw, 220px); }
  .day-switch button, .app-menu button { font-size: 1rem; }
  .day-switch { width: 100%; }
  .day-switch button { flex: 1; }
  .about-content { margin-top: 56px; }
}
