:root { --bg: #f5f7f6; --surface: #fff; --text: #17201d; --muted: #5f6c68; --border: #d9e0dd; --primary: #126149; --primary-dark: #0a4735; --accent: #d99025; --success: #17633a; --danger: #a61b1b; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--text); background: var(--bg); }
* { box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { min-width: 320px; margin: 0; background: var(--bg); line-height: 1.5; }
body.dialog-open { overflow: hidden; }
button, input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #111827; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; background: #fff; color: #111827; font-weight: 800; transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
.eyebrow { margin: 0; color: var(--primary-dark); font-size: .76rem; font-weight: 850; text-transform: uppercase; }
.auth-gate { width: min(480px, calc(100% - 28px)); margin: 12vh auto; padding: 28px; border-top: 5px solid var(--primary); background: var(--surface); box-shadow: 0 18px 50px rgba(25, 36, 32, .12); }
.auth-gate h1 { margin: 8px 0 12px; font-size: 3rem; line-height: 1; }
.guest-path { color: var(--muted); font-size: .9rem; }
.loading-state { width: min(520px, calc(100% - 32px)); min-height: 48vh; margin: 15vh auto; display: grid; place-items: center; align-content: center; gap: 16px; color: var(--muted); text-align: center; }
.loading-state span { width: 42px; height: 42px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.customer-page { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 64px; }
.customer-header { min-height: 118px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid var(--border); }
.customer-header h1 { margin: 4px 0; font-size: 3.2rem; line-height: 1; }
#customer-identity { margin: 8px 0 0; color: var(--muted); }
.header-actions, .booking-actions, .detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, .button-primary, .button-secondary, .detail-actions a { min-height: 46px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); cursor: pointer; font-weight: 800; text-decoration: none; }
.button-primary { border-color: var(--primary); background: var(--primary); color: #fff; }
button:disabled { cursor: not-allowed; opacity: .55; }
.icon-button { width: 46px; flex: 0 0 46px; padding: 0; font-size: 1.4rem; }
.page-status { margin: 20px 0; padding: 16px; border-left: 4px solid var(--danger); background: #fff1f1; color: var(--danger); }
.next-section, .recent-section, .calendar-section { padding: 36px 0; border-bottom: 1px solid var(--border); }
.section-heading, .calendar-heading { margin-bottom: 16px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.section-heading h2, .calendar-heading h2 { margin: 3px 0 0; font-size: 2rem; }
.today-summary { margin: 0; color: var(--primary-dark); font-weight: 800; }
.next-booking { padding: clamp(20px, 4vw, 32px); border: 1px solid var(--border); border-left: 5px solid var(--accent); border-radius: 6px; background: var(--surface); }
.next-booking p, .next-booking h3 { margin: 0; }
.next-booking h3 { margin-top: 6px; font-size: 1.8rem; }
.booking-business { color: var(--muted); font-weight: 750; }
.booking-time { padding: 10px 0 18px; font-size: 1.05rem; }
.booking-actions { justify-content: space-between; align-items: center; }
.status-badge { padding: 5px 9px; border: 1px solid currentColor; border-radius: 999px; background: #eef2ff; color: #313b61; font-size: .76rem; font-weight: 850; }
.status-confirmed, .status-completed { background: #eaf8f0; color: var(--success); }
.status-cancelled, .status-rejected, .status-no_show { background: #fff0f0; color: var(--danger); }
.recent-list { display: grid; gap: 1px; background: var(--border); }
.recent-service { min-width: 0; padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--surface); }
.recent-service h3, .recent-service p { margin: 0; }
.recent-service p, .recent-service small { color: var(--muted); }
.calendar-view-switch { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.calendar-view-switch button { min-height: 40px; border: 0; border-radius: 0; }
.calendar-view-switch button[aria-selected="true"] { background: var(--primary); color: #fff; }
.calendar-navigation { min-height: 48px; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; gap: 8px; }
.calendar-navigation h3 { margin: 0; text-align: center; text-transform: capitalize; }
.calendar-navigation button { width: 46px; padding: 0; }
.customer-calendar { margin-top: 10px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday { padding: 5px; color: var(--muted); font-size: .75rem; font-weight: 850; text-align: center; }
.calendar-day { position: relative; min-width: 0; min-height: 62px; padding: 7px; display: block; border-radius: 4px; font-weight: 700; }
.calendar-day strong { position: absolute; right: 6px; bottom: 5px; min-width: 20px; color: var(--primary); text-align: center; }
.calendar-day.outside { opacity: .4; }
.calendar-day.today { border-color: var(--accent); }
.calendar-day[aria-current="date"] { box-shadow: inset 0 0 0 2px var(--primary); }
.day-agenda { margin-top: 22px; }
.day-agenda > h3 { text-transform: capitalize; }
.day-booking { width: 100%; min-height: 60px; margin-bottom: 6px; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; text-align: left; }
.day-booking time { color: var(--primary-dark); font-weight: 850; }
.day-booking-copy { min-width: 0; overflow-wrap: anywhere; }
.day-booking-state { color: var(--muted); font-size: .8rem; }
.empty-state { padding: 24px; border: 1px dashed #aeb9b4; background: rgba(255,255,255,.55); color: var(--muted); }
.empty-state h3, .empty-state p { margin: 0 0 8px; }
.reserve-band { margin: 34px 0; padding: 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; background: #e7f0ec; border-left: 5px solid var(--primary); }
.reserve-band h2, .reserve-band p { margin: 0; }
.profile-section { padding: 20px 0; }
.profile-section summary { cursor: pointer; font-size: 1.05rem; font-weight: 850; }
.profile-section > p { color: var(--muted); }
.profile-grid { margin: 18px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
label { min-width: 0; display: grid; gap: 6px; font-weight: 800; }
label span { color: var(--muted); font-size: .8rem; }
input { width: 100%; min-width: 0; padding: 12px 13px; border: 1px solid #aeb9b4; border-radius: 4px; background: #fff; color: var(--text); font-size: 16px; }
input[readonly] { background: #eef1f0; color: var(--muted); }
.status-message { min-height: 1.4em; color: var(--muted); }
.status-message.error { color: var(--danger); }
.detail-dialog { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; padding: 20px; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(7, 14, 12, .74); }
.detail-panel { position: relative; width: min(620px, 100%); max-height: calc(100dvh - 40px); overflow: auto; padding: clamp(22px, 5vw, 32px); border-radius: 6px; background: var(--surface); }
.detail-panel > header { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.detail-panel h2 { margin: 4px 0 0; font-size: 2.2rem; }
#booking-detail-description { color: var(--muted); }
.detail-list { margin: 20px 0; }
.detail-list div { padding: 11px 0; display: grid; grid-template-columns: 130px 1fr; gap: 12px; border-top: 1px solid var(--border); }
.detail-list dt { color: var(--muted); font-size: .78rem; font-weight: 850; text-transform: uppercase; }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.management-note { margin: 18px 0; padding: 14px; border-left: 4px solid var(--accent); background: #fff8e9; }
.management-note strong { display: block; }
.customer-footer { width: min(960px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 calc(28px + env(safe-area-inset-bottom)); color: var(--muted); text-align: center; }
.customer-footer nav { display: flex; justify-content: center; gap: 20px; }
.customer-footer a { color: inherit; font-weight: 750; }

@media (max-width: 680px) {
  .auth-gate h1 { font-size: 2.2rem; }
  .customer-page { width: min(100% - 20px, 960px); padding-top: 16px; }
  .customer-header { min-height: 104px; align-items: flex-start; }
  .customer-header h1 { font-size: 2.4rem; }
  .section-heading h2, .calendar-heading h2 { font-size: 1.65rem; }
  #customer-identity { max-width: 220px; }
  .section-heading, .calendar-heading { align-items: flex-start; flex-direction: column; }
  .today-summary { align-self: stretch; }
  .calendar-view-switch { width: 100%; }
  .calendar-day { min-height: 48px; padding: 5px; }
  .recent-service, .reserve-band { align-items: stretch; flex-direction: column; }
  .recent-service .button-primary, .reserve-band .button-primary { width: 100%; }
  .profile-grid { grid-template-columns: 1fr; }
  .day-booking { grid-template-columns: 58px minmax(0, 1fr); }
  .day-booking-state { grid-column: 2; }
  .detail-dialog { padding: 0; align-items: end; }
  .detail-panel { width: 100%; max-height: 100dvh; border-radius: 6px 6px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .detail-list div { grid-template-columns: 1fr; gap: 2px; }
  .detail-actions { position: sticky; bottom: 0; padding: 8px 0; background: var(--surface); }
  .detail-actions a { flex: 1; }
}
@media (max-width: 390px) { .customer-header { display: grid; } .header-actions { width: 100%; } .calendar-day { min-height: 44px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
@media (forced-colors: active) { :focus-visible, button, .button-primary, .button-secondary, .status-badge { border: 2px solid currentColor; } }
@media print { .header-actions, .detail-dialog, .customer-footer, .calendar-view-switch, .calendar-navigation { display: none !important; } body { background: #fff; color: #000; } .customer-page { width: 100%; padding: 0; } }
