:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #211829;
  background: #f7f5f9;
  --muted: #62586c;
  --line: #e8e0eb;
  --purple: #7517a1;
  --dark: #22132d;
  --panel: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; display: grid; grid-template-columns: 242px minmax(0, 1fr); min-height: 100vh; }
a { color: var(--purple); text-underline-offset: 4px; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid #a736d9; outline-offset: 4px; }
.skip { position: fixed; top: 12px; left: 12px; z-index: 2; background: #fff; padding: 12px; transform: translateY(-200%); }
.skip:focus { transform: none; }

.sidebar {
  background: var(--dark);
  color: #eee4f5;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 30px 20px 24px;
  border-right: 1px solid #352140;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; color: #fff; text-decoration: none; }
.brand img { flex: none; border-radius: 12px; border: 1px solid #62416d; }
.brand strong { display: block; letter-spacing: -.05em; font-size: 1.5rem; line-height: 1; }
.brand small { display: block; color: #dbcae5; font-size: .78rem; margin-top: 4px; }
nav { display: grid; gap: 6px; margin-top: 44px; }
nav a { border-radius: 10px; padding: 12px 14px; color: #e7d7f0; text-decoration: none; font-size: .92rem; font-weight: 650; }
nav a:hover, nav a[aria-current] { background: #4a285b; color: #fff; }
.sidebar-label { margin: auto 8px 0; padding: 16px 0 0; border-top: 1px solid #543861; font-size: .82rem; display: flex; align-items: center; gap: 9px; }
.dot { background: #d6a1f5; width: 8px; height: 8px; border-radius: 50%; }

main { width: 100%; max-width: 1480px; margin: 0 auto; padding: 38px clamp(20px, 4vw, 54px) 22px; min-width: 0; }
.page-header, .panel-header { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.page-header { margin-bottom: 25px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 3.6vw, 2.86rem); letter-spacing: -.052em; line-height: 1.13; }
.page-header p, .panel-header p { color: var(--muted); margin-top: 7px; }
.primary-button, .secondary-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  text-decoration: none;
  white-space: nowrap;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
}
.primary-button { color: #fff; background: var(--purple); }
.primary-button:hover { background: #5f0c89; }
.secondary-button { border-color: #d7c6df; color: #50216a; background: #fff; }
.secondary-button:hover { border-color: #9960b1; background: #faf5fd; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 2px 8px #29143707; }
.metric { padding: 17px 18px 18px; }
.metric h2 { color: #55465e; font-size: .82rem; font-weight: 720; }
.metric p { margin-top: 8px; color: #271337; font-size: clamp(1.35rem, 2.5vw, 2rem); font-weight: 790; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.metric span { margin-top: 7px; display: block; color: var(--muted); font-size: .76rem; line-height: 1.4; }

.latest { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #e4d2ed; border-radius: 13px; padding: 17px 20px; background: #f3e8f9; }
.latest h2 { color: #48245a; font-size: .94rem; }
.latest p { color: #5f4c69; font-size: .85rem; overflow-wrap: anywhere; margin-top: 5px; }
.latest span { padding-inline: 3px; }
.latest-action { display: flex; align-items: center; flex: none; gap: 16px; }
.latest-action strong { color: #46215b; font-variant-numeric: tabular-nums; }
.latest-action a { font-size: .88rem; font-weight: 700; }

.panel { margin-top: 20px; }
.panel-header { padding: 18px 20px; }
.panel-header h2 { font-size: 1.34rem; letter-spacing: -.028em; overflow-wrap: anywhere; }
.panel-header p { font-size: .82rem; line-height: 1.4; margin-top: 4px; }
.filters { display: flex; align-items: end; gap: 10px; }
.filters label { min-width: 0; }
.filters label span { display: block; margin-bottom: 5px; color: #5d4d63; font-weight: 680; font-size: .76rem; }
.filters input, .filters select { background: #fff; min-height: 42px; border: 1px solid #d8cadd; border-radius: 9px; padding: 9px 10px; color: #291a30; font-size: .83rem; max-width: 100%; }
.filters input { width: 214px; }

.table-scroll { overflow-x: auto; border-radius: 0 0 15px 15px; }
table { width: 100%; min-width: 770px; border-collapse: collapse; font-size: .86rem; text-align: left; }
th, td { padding: 13px 15px; border-top: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
thead th { background: #f7f2fa; color: #554360; font-size: .76rem; font-weight: 740; }
tbody th { width: 32%; font-weight: 690; overflow-wrap: anywhere; }
tbody td { white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: #fcf9fe; }
tbody small { display: block; margin-top: 4px; color: var(--muted); font-size: .73rem; line-height: 1.36; overflow-wrap: anywhere; }
.badge { display: inline-block; padding: 5px 8px; border-radius: 20px; font-size: .72rem; line-height: 1.15; font-weight: 750; color: #52435c; background: #f1ebf4; white-space: nowrap; }
.badge.good { color: #135747; background: #e3f4eb; }
.badge.cancelled { color: #8b234e; background: #fbe8f1; }
.badge.waiting { color: #6c4610; background: #f9efd9; }
.empty, .error { padding: 18px 20px; color: var(--muted); line-height: 1.4; }
.error { border: 1px solid #ebc9db; border-radius: 12px; background: #fff0f5; color: #7d2250; margin-bottom: 12px; }

.booking-detail { border-color: #dfc9e9; }
.booking-detail h2 { margin-top: 7px; }
.money-grid { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px 16px; padding: 17px 20px; border-block: 1px solid var(--line); }
.references { margin: 0; display: flex; flex-wrap: wrap; gap: 12px 25px; padding: 15px 20px; }
dt { color: var(--muted); font-size: .76rem; line-height: 1.35; }
dd { margin: 4px 0 0; color: #30213a; font-size: .9rem; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.references dd { font-size: .78rem; }
footer { color: #665a6d; font-size: .76rem; line-height: 1.5; padding: 16px 0 4px; }
.operator-actions { display: grid; gap: 8px; margin: 18px 8px; }
.operator-actions .secondary-button { width: 100%; }
.operator-actions #passkey-feedback { font-size: .78rem; line-height: 1.4; }
.sign-in { display: grid; grid-template-columns: 1fr; place-items: center; }
.sign-in-main { max-width: 560px; padding: 25px; }
.sign-in-panel { margin: 0; padding: 30px; }
.sign-in-panel img { border-radius: 14px; }
.sign-in-panel h1 { font-size: 1.95rem; margin-top: 16px; }
.sign-in-panel p { color: var(--muted); margin-top: 9px; }
.sign-in-panel .primary-button { margin-top: 18px; }
.sign-in-panel label { display: block; margin-top: 18px; font-weight: 680; }
.sign-in-panel input { width: 100%; min-height: 42px; margin-top: 6px; border: 1px solid #d8cadd; border-radius: 9px; padding: 8px 12px; }
.primary-button:disabled, .secondary-button:disabled { opacity: .64; cursor: wait; }

@media (max-width: 1180px) {
  body { grid-template-columns: 188px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  .filters input { width: 174px; }
  .panel-header { align-items: start; }
}

@media (max-width: 920px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 16px; padding: 16px 17px; }
  nav { display: flex; flex-wrap: wrap; margin: 0; gap: 4px; }
  nav a { padding: 9px 10px; font-size: .8rem; }
  .sidebar-label { border: 0; margin: 0 0 0 auto; padding: 0; }
  main { padding-top: 24px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 630px) {
  main { padding-inline: 15px; }
  .page-header, .panel-header { flex-wrap: wrap; }
  .page-header p { font-size: .88rem; }
  .metric { padding-inline: 13px; }
  .latest { align-items: flex-start; flex-wrap: wrap; }
  .filters { flex-wrap: wrap; width: 100%; }
  .filters label { flex: 1 1 145px; }
  .filters input, .filters select { width: 100%; }
  .money-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
