/* Master Dispatch admin styles. Palette mirrors public booking pages so the
   admin tooling feels like the same product. */

* { box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  margin: 0;
  background: #fbfbfb;
  color: #16252B;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
}
a { color: #006BFF; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- App shell (sidebar + main) ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: #fff;
  border-right: 1px solid #e5e7eb;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand-link {
  display: block;
  padding: 4px 8px 12px;
  border-bottom: 1px solid #f3f4f6;
  text-decoration: none;
}
.sidebar .brand-link:hover { text-decoration: none; }
.sidebar .brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: #16252B;
}

.create-wrap { position: relative; }
.create-btn {
  width: 100%;
  background: #16252B;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
}
.create-btn:hover { background: #2a3940; }
.create-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(26,38,55,0.12);
  padding: 6px;
  z-index: 50;
}
.create-menu.open { display: block; }
.create-menu a {
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  color: #16252B;
  text-decoration: none;
  border-radius: 6px;
}
.create-menu a:hover { background: #f3f4f6; text-decoration: none; }

.sidenav { display: flex; flex-direction: column; gap: 2px; }
.sidenav .section-title {
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 10px 8px 4px;
}
.sidenav a {
  display: block;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  border-radius: 6px;
}
.sidenav a:hover { background: #f3f4f6; color: #16252B; text-decoration: none; }
.sidenav a.current {
  background: #eff6ff;
  color: #006BFF;
  font-weight: 600;
}

.sidebar .who-block {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #6b7280;
}
.sidebar .who-block .email { color: #16252B; font-weight: 500; word-break: break-all; }
.sidebar .who-block .role { font-size: 11px; color: #6b7280; }
.sidebar .who-block button {
  background: none;
  border: 1px solid #e5e7eb;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: #16252B;
  font-family: inherit;
}
.sidebar .who-block button:hover { background: #f3f4f6; }

.main {
  flex: 1;
  min-width: 0;
  padding: 24px 28px;
}
@media (max-width: 860px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    position: static;
    flex-direction: row;
    overflow-x: auto;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
  }
  .sidebar .brand-link { padding: 0; border: none; }
  .sidenav { flex-direction: row; flex-wrap: wrap; }
  .sidenav .section-title { display: none; }
  .sidebar .who-block { margin-top: 0; border-top: none; padding: 0; flex-direction: row; align-items: center; gap: 8px; }
  .main { padding: 16px 18px; }
}

/* ---------- Legacy shell (kept for transition; pages using <div class="shell"> still center) ---------- */
.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #e5e7eb;
  gap: 24px;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 28px;
  min-width: 0;
}
.brand-link { text-decoration: none; }
.brand-link:hover { text-decoration: none; }
.topbar .brand {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: #16252B;
}
.topbar .brand-sub {
  color: #6b7280;
  font-weight: 500;
  margin-left: 8px;
}
.topnav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.topnav a {
  color: #6b7280;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.topnav a:hover { color: #16252B; text-decoration: none; }
.topnav a.current {
  color: #16252B;
  border-bottom-color: #16252B;
}
.topbar .who {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #6b7280;
  flex-shrink: 0;
}
.topbar .who button {
  background: none;
  border: 1px solid #e5e7eb;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #16252B;
}
.topbar .who button:hover { background: #f3f4f6; }

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .topbar-left { flex-direction: column; align-items: flex-start; gap: 8px; }
  .topnav { gap: 14px; }
}

.page-title {
  margin: 24px 0 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(26,38,55,0.06), 0 4px 24px rgba(26,38,55,0.08);
  padding: 24px;
  margin-bottom: 24px;
}
.card h2 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
}

/* ---------- Tables ---------- */
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th,
table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}
table.data th {
  color: #6b7280;
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #fafafa;
}
table.data tbody tr:hover { background: #fafbff; cursor: pointer; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .muted { color: #6b7280; }
.empty {
  padding: 40px 24px;
  text-align: center;
  color: #6b7280;
}

/* ---------- Status pills ---------- */
.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f3f4f6;
  color: #16252B;
}
.pill.confirmed { background: #E5F0FB; color: #006BFF; }
.pill.pending { background: #fff7e6; color: #b45309; }
.pill.cancelled { background: #fee2e2; color: #b91c1c; }
.pill.completed { background: #ecfdf5; color: #047857; }
.pill.no_show { background: #fef3c7; color: #92400e; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #16252B;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.btn:hover { background: #2a3940; }
.btn.secondary { background: #fff; color: #16252B; border: 1px solid #e5e7eb; }
.btn.secondary:hover { background: #f3f4f6; }
.btn.danger { background: #b91c1c; }
.btn.danger:hover { background: #991b1b; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ---------- Filters bar ---------- */
.filters {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 16px;
}
.filters label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
  font-weight: 500;
}
.filters select,
.filters input {
  font-family: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #fff;
  color: #16252B;
}
.filters select:focus,
.filters input:focus {
  outline: none;
  border-color: #006BFF;
}

/* ---------- Login gate (auth.js renders into body) ---------- */
.gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbfbfb;
}
.gate-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 0 1px rgba(26,38,55,0.06), 0 4px 24px rgba(26,38,55,0.08);
  padding: 36px 40px;
  max-width: 400px;
  text-align: center;
}
.gate-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}
.gate-card p { color: #6b7280; margin: 0 0 24px; }
.gate-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #dadce0;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #3c4043;
}
.gate-btn:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(60,64,67,0.16); }
.gate-hint {
  margin-top: 20px !important;
  font-size: 12px !important;
}
.gate-hint code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ---------- Primary action button (e.g. "+ New booking") ---------- */
.new-btn {
  background: #2563eb;
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  height: 36px;
}
.new-btn:hover { background: #1d4ed8; text-decoration: none; color: #fff; }

/* ---------- Page actions row (title + button on same line) ---------- */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-actions .actions-left,
.page-actions .actions-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Coming-soon stubs ---------- */
.coming-soon {
  text-align: center;
  padding: 64px 24px;
}
.coming-soon h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.coming-soon p {
  color: #6b7280;
  margin: 0 0 24px;
  font-size: 14px;
}
.coming-soon ul {
  display: inline-block;
  text-align: left;
  margin: 0 auto 24px;
  padding-left: 18px;
  color: #16252B;
  font-size: 13px;
}
.coming-soon ul li { margin-bottom: 4px; }
.coming-soon .stub-tag {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
}

/* ---------- Loading + error ---------- */
.loading {
  padding: 40px 24px;
  text-align: center;
  color: #6b7280;
}
.error-banner {
  background: #fee2e2;
  color: #b91c1c;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
}
