/* PB Standard Blue: #00A0DD */

:root {
  --pb-blue: #00a0dd;
  --pb-blue-dark: #0088bc;
  --pb-blue-soft: rgba(0, 160, 221, 0.12);
  --text: #0f172a;
  --text-muted: #475569;
  --surface: #ffffff;
  --surface-elevated: #f8fafc;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --max-width: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--pb-blue-soft), transparent),
    linear-gradient(180deg, #f1f5f9 0%, #e8eef4 100%);
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  padding: 0.5rem 1rem;
  background: var(--pb-blue);
  color: #fff;
  z-index: 100;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 3px solid var(--pb-blue);
  box-shadow: var(--shadow);
}

.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-session {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.header-session[hidden] {
  display: none;
}

.header-session__user {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted, #475569);
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-session__sign-out {
  flex-shrink: 0;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.brand--link {
  color: inherit;
  text-decoration: none;
  border-radius: 10px;
  transition: opacity 0.15s ease;
}

.brand--link:hover {
  opacity: 0.82;
}

.brand--link:focus-visible {
  outline: 2px solid var(--pb-blue);
  outline-offset: 3px;
}

.brand__logo {
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(15, 23, 42, 0.12));
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand__name {
  font-weight: 700;
  font-size: 1.125rem;
}

.brand__tag {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.brand__event {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.brand__tag[hidden],
.brand__event[hidden],
#header-project-switch[hidden] {
  display: none;
}

#header-project-title {
  max-width: min(28rem, 55vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-picker {
  display: grid;
  gap: 0.85rem;
}

.project-picker__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  padding: 1rem 1.15rem;
  border: 1px solid color-mix(in srgb, var(--pb-blue) 18%, transparent);
  border-radius: 12px;
  background: var(--surface-elevated, #fff);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.project-picker__card:hover {
  border-color: var(--pb-blue);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.project-picker__card--selected {
  border-color: var(--pb-blue);
  box-shadow: inset 0 0 0 1px var(--pb-blue);
}

.project-picker__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.project-picker__subtitle {
  font-size: 0.9rem;
  color: var(--text-muted, #475569);
}

.project-picker__meta {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  letter-spacing: 0.02em;
}

.pill {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.pill--muted {
  background: var(--surface-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.page-wide {
  --max-width: min(1480px, calc(100vw - 4rem));
}

.hero {
  margin-bottom: 2rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pb-blue-dark);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero__lead {
  margin: 0;
  color: var(--text-muted);
  font-size: 1.0625rem;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.panel--subtle {
  background: var(--surface-elevated);
  box-shadow: none;
}

.panel__head {
  margin-bottom: 1.25rem;
}

.panel__head--row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.panel__head--row .panel__hint {
  margin-top: 0.25rem;
}

.panel__head--row .btn {
  margin-top: 0;
  flex-shrink: 0;
}

.panel-status {
  margin: 0 0 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.panel-status--error {
  color: #b91c1c;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th,
.data-table td {
  padding: 0.65rem 0.875rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  background: var(--surface-elevated);
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: var(--pb-blue-soft);
}

.data-table__add-col {
  width: 4.5rem;
  text-align: center;
  white-space: nowrap;
}

.data-table th.data-table__add-col,
.data-table td.data-table__add-col {
  text-align: center;
}

.btn-add-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--pb-blue-dark);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.btn-add-cart:hover:not(:disabled) {
  border-color: var(--pb-blue);
  background: var(--pb-blue-soft);
  color: var(--pb-blue);
  box-shadow: 0 0 0 3px var(--pb-blue-soft);
  transform: scale(1.05);
}

.btn-add-cart:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-add-cart--added {
  border-color: #86efac;
  background: #ecfdf5;
  color: #15803d;
}

.btn-add-cart--added:hover:not(:disabled) {
  border-color: #4ade80;
  background: #d1fae5;
  color: #166534;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
  transform: scale(1.05);
}

.btn-add-cart:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.btn-add-cart__icon {
  display: block;
}

.bookings-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pb-blue-dark);
  flex-shrink: 0;
}

.panel__head-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.panel__head-actions .btn {
  margin-top: 0;
}

.status-pill {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.status-pill--pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill--approved {
  background: #dcfce7;
  color: #166534;
}

.status-pill--rejected {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill--cancelled {
  background: #f1f5f9;
  color: #475569;
}

.panel__head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
}

.panel__hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.btn--primary {
  background: var(--pb-blue);
  color: #fff;
}

.btn--primary:hover:not(:disabled) {
  background: var(--pb-blue-dark);
}

.btn--secondary {
  background: var(--surface);
  color: var(--pb-blue-dark);
  border: 1px solid var(--border);
  margin-top: auto;
}

.btn--secondary:hover:not(:disabled) {
  border-color: var(--pb-blue);
  background: var(--pb-blue-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.empty-state p {
  margin: 0;
}

.site-footer {
  padding: 1.25rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
}

.site-footer p {
  margin: 0;
}

/* Sign in */

.page-sign-in {
  min-height: 100vh;
}

.sign-in {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: none;
  margin: 0;
}

.sign-in__card {
  width: 100%;
  max-width: 400px;
  margin: 0;
  padding: 2rem 1.75rem;
}

.sign-in__brand {
  margin-bottom: 1.75rem;
}

.brand--center {
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.brand__logo--large {
  width: 72px;
  height: 72px;
}

.brand__name--large {
  font-size: 1.375rem;
}

.brand__wordmark {
  display: inline-flex;
  align-items: baseline;
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.brand__wordmark-primary {
  color: var(--text);
}

.brand__wordmark-product {
  color: var(--pb-blue);
}

.brand__wordmark--header {
  font-size: 1.25rem;
}

.sign-in__form {
  display: flex;
  flex-direction: column;
  gap: 1.125rem;
}

.sign-in__heading {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  text-align: center;
}

.sign-in__intro {
  margin: 0.25rem 0 1.25rem;
  color: var(--text-muted);
  font-size: 0.9375rem;
  text-align: center;
}

.auth-choice {
  display: grid;
  gap: 0.875rem;
  animation: auth-panel-enter 0.28s ease-out both;
}

.auth-choice[hidden],
.sign-in__form[hidden],
.sign-in__links[hidden],
.sign-in__intro[hidden] {
  display: none;
}

.auth-choice__card {
  width: 100%;
  min-height: 92px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.875rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.auth-choice__card:hover,
.auth-choice__card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--pb-blue);
  background: var(--pb-blue-soft);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
  outline: none;
}

.auth-choice__card:active {
  transform: translateY(0);
}

.auth-choice__card--register {
  border-color: rgba(0, 160, 221, 0.45);
}

.auth-choice__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--pb-blue-dark);
  background: var(--pb-blue-soft);
}

.auth-choice__content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.auth-choice__content strong {
  font-size: 1rem;
  line-height: 1.3;
}

.auth-choice__content span {
  color: var(--text-muted);
  font-size: 0.8125rem;
  line-height: 1.4;
}

.auth-choice__arrow {
  color: var(--pb-blue-dark);
  font-size: 1.35rem;
  transition: transform 0.16s ease;
}

.auth-choice__card:hover .auth-choice__arrow,
.auth-choice__card:focus-visible .auth-choice__arrow {
  transform: translateX(3px);
}

.sign-in__links {
  margin: 0.75rem 0 0;
  text-align: center;
}

.sign-in__links--secondary {
  margin-top: 0.5rem;
}

.sign-in__link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--pb-blue, #00a0dd);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: underline;
}

a.sign-in__link {
  display: inline-block;
}

@keyframes auth-panel-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sign-in__form:not([hidden]) {
  animation: auth-panel-enter 0.28s ease-out both;
}

@media (prefers-reduced-motion: reduce) {
  .auth-choice,
  .sign-in__form:not([hidden]) {
    animation: none;
  }

  .auth-choice__card,
  .auth-choice__arrow {
    transition: none;
  }
}

/* Sign-in intro — wordmark reveal, then the options stagger in.
   Plays once per tab session (js/signInIntro.js sets `no-intro`). */

.brand__wordmark--intro {
  align-items: center;
}

/* Zero-width clipped column: the product word slides out from behind the
   right edge of "PBX" as the column opens, pushing "PBX" left of centre. */
.brand__wordmark-reveal {
  display: grid;
  grid-template-columns: 1fr;
}

.brand__wordmark-reveal > .brand__wordmark-product {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-align: left;
}

.brand__logo--intro {
  opacity: 0;
  animation: intro-logo-in 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.brand__wordmark--intro .brand__wordmark-primary {
  opacity: 0;
  animation: intro-pbx-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.25s forwards;
}

.brand__wordmark--intro .brand__wordmark-reveal {
  grid-template-columns: 0fr;
  animation: intro-reveal 0.8s cubic-bezier(0.77, 0, 0.18, 1) 0.95s forwards;
}

.intro-enter {
  opacity: 0;
  animation: intro-fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.intro-enter--d1 {
  animation-delay: 1.7s;
}

.intro-enter--d2 {
  animation-delay: 1.82s;
}

.intro-enter--d3 {
  animation-delay: 1.96s;
}

.intro-enter--d4 {
  animation-delay: 2.1s;
}

.intro-enter--d5 {
  animation-delay: 2.24s;
}

/* The cards stagger themselves on the first play. */
html:not(.no-intro) .auth-choice {
  animation: none;
}

@keyframes intro-logo-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes intro-pbx-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes intro-reveal {
  from {
    grid-template-columns: 0fr;
  }
  to {
    grid-template-columns: 1fr;
  }
}

@keyframes intro-fade-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.no-intro .brand__logo--intro,
.no-intro .brand__wordmark--intro .brand__wordmark-primary,
.no-intro .intro-enter {
  animation: none;
  opacity: 1;
}

.no-intro .brand__wordmark--intro .brand__wordmark-reveal {
  animation: none;
  grid-template-columns: 1fr;
}

@media (prefers-reduced-motion: reduce) {
  .brand__logo--intro,
  .brand__wordmark--intro .brand__wordmark-primary,
  .intro-enter {
    animation: none;
    opacity: 1;
  }

  .brand__wordmark--intro .brand__wordmark-reveal {
    animation: none;
    grid-template-columns: 1fr;
  }
}

/* Register */

.register-card {
  max-width: 560px;
}

.register-lead {
  margin: 0 0 1.25rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.register-form {
  gap: 1.25rem;
}

.register-section {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--border);
}

.register-section:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.register-section__title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
}

.register-section__lead {
  margin: -0.25rem 0 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.875rem;
}

@media (max-width: 520px) {
  .register-grid {
    grid-template-columns: 1fr;
  }
}

.register-role {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.register-role__option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-elevated);
  font-size: 0.875rem;
  cursor: pointer;
}

.register-role__option:has(input:checked) {
  border-color: var(--pb-blue);
  background: var(--pb-blue-soft);
}

.field__hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.field__optional {
  font-weight: 400;
  color: var(--text-muted);
}

.field__textarea {
  resize: vertical;
  min-height: 4.5rem;
}

.register-success {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.register-success[hidden] {
  display: none;
}

.register-success__note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
}

.register-success__reference {
  margin: 0;
  padding: 0.625rem 0.75rem;
  border-radius: 8px;
  background: var(--pb-blue-soft);
  color: var(--pb-blue-dark);
  font-size: 0.875rem;
  font-weight: 700;
  text-align: center;
}

.register-success .btn {
  text-align: center;
  text-decoration: none;
}

.sign-in__error {
  margin: 0;
  color: #c0392b;
  font-size: 0.875rem;
}

.sign-in__error--info {
  color: #1d6f42;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* `.field { display: flex }` would otherwise override the HTML `hidden` attribute */
.field[hidden] {
  display: none;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.field__input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input::placeholder {
  color: #94a3b8;
}

.field__input:focus {
  outline: none;
  border-color: var(--pb-blue);
  box-shadow: 0 0 0 3px var(--pb-blue-soft);
}

.btn--block {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nav-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.nav-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 8.5rem;
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-elevated);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.12s ease,
    color 0.15s ease;
}

.nav-tile:hover {
  border-color: var(--pb-blue);
  background: var(--pb-blue-soft);
  box-shadow: 0 0 0 1px var(--pb-blue-soft);
  transform: translateY(-2px);
}

.nav-tile:active {
  transform: translateY(0);
}

.nav-tile--static {
  cursor: default;
}

.nav-tile--static:hover {
  border-color: var(--border);
  background: var(--surface-elevated);
  box-shadow: none;
  transform: none;
}

.nav-tile__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: var(--surface);
  color: var(--pb-blue-dark);
  border: 1px solid var(--border);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-tile:hover .nav-tile__icon {
  background: var(--pb-blue);
  color: #fff;
  border-color: var(--pb-blue);
}

.nav-tile--static .nav-tile__icon {
  color: var(--text-muted);
}

.nav-tile--static:hover .nav-tile__icon {
  background: var(--surface);
  color: var(--text-muted);
  border-color: var(--border);
}

.nav-tile__label {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

@media (max-width: 720px) {
  .nav-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .main {
    padding-top: 1.5rem;
  }

  .panel {
    padding: 1.125rem;
  }
}

/* Cart (new booking) */

.cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--pb-blue-dark);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.cart-toggle:hover {
  border-color: var(--pb-blue);
  background: var(--pb-blue-soft);
  color: var(--pb-blue);
  box-shadow: 0 0 0 3px var(--pb-blue-soft);
}

.cart-toggle__icon {
  display: block;
}

.cart-toggle__badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--pb-blue);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cart-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 210;
  display: flex;
  flex-direction: column;
  width: min(24rem, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(15, 23, 42, 0.12);
  transform: translateX(100%);
  transition: transform 0.22s ease;
}

.cart-panel--open {
  transform: translateX(0);
}

.cart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.cart-panel__title {
  margin: 0;
  font-size: 1.125rem;
}

.cart-panel__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.cart-panel__close:hover {
  background: var(--surface-elevated);
  color: var(--text);
}

.cart-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.cart-panel__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.cart-panel__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-line:last-child {
  border-bottom: none;
}

.cart-line__main {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.cart-line__name {
  font-weight: 600;
  line-height: 1.35;
}

.cart-line__meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.cart-line__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.cart-line__qty {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--pb-blue-dark);
}

.cart-line__remove {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  text-decoration: underline;
  cursor: pointer;
}

.cart-line__remove:hover {
  color: #b91c1c;
}

.cart-panel__footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-elevated);
}

.cart-panel__message {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.cart-panel__message--error {
  color: #b91c1c;
}

.field__textarea {
  resize: vertical;
  min-height: 4.5rem;
  font-family: inherit;
}

body.cart-open {
  overflow: hidden;
}

/* Booking detail modal (dashboard) */

.data-table__row--clickable {
  cursor: pointer;
}

.data-table__row--clickable:focus-visible {
  outline: 2px solid var(--pb-blue);
  outline-offset: -2px;
}

.booking-detail-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(15, 23, 42, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.booking-detail-backdrop--open {
  opacity: 1;
  pointer-events: auto;
}

.booking-detail {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.booking-detail--open {
  opacity: 1;
  pointer-events: auto;
}

.booking-detail__panel {
  width: min(42rem, 100%);
  max-height: min(85vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 24px 48px rgba(15, 23, 42, 0.16);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.22s ease;
}

.booking-detail--open .booking-detail__panel {
  transform: translateY(0) scale(1);
}

.booking-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--border);
}

.booking-detail__title {
  margin: 0;
  font-size: 1.375rem;
}

.booking-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin: 0.5rem 0 0;
}

.booking-detail__meta-text {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.booking-detail__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.booking-detail__close:hover {
  background: var(--surface-elevated);
  color: var(--text);
}

.booking-detail__body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 1.25rem;
}

.booking-detail__section-title {
  margin: 0 0 0.625rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.booking-detail__notes {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.booking-detail__notes p {
  margin: 0;
  white-space: pre-wrap;
}

.booking-detail__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.booking-detail__table-wrap {
  margin-top: 0.25rem;
}

.booking-detail__table tbody tr:last-child td {
  border-bottom: none;
}

.booking-detail__qty {
  font-weight: 600;
  color: var(--pb-blue-dark);
  white-space: nowrap;
}

.booking-detail__footer {
  display: flex;
  justify-content: flex-end;
  padding: 0.875rem 1.5rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-elevated);
  border-radius: 0 0 var(--radius) var(--radius);
}

body.booking-detail-open {
  overflow: hidden;
}
