:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1d2430;
  --muted: #7a8597;
  --line: #e7eaef;
  --brand: #b5835a;
  --brand-dark: #8a6038;
  --shadow: 0 1px 3px rgba(20, 30, 50, .08), 0 8px 24px rgba(20, 30, 50, .05);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}

/* kill the lingering blue/grey tap box and sticky focus border on mobile */
a, button, input, .btn, .card, .bcard { -webkit-tap-highlight-color: transparent; }
a:focus, button:focus, .btn:focus, .card:focus, .bcard:focus, input:focus { outline: none; }
a:focus-visible, button:focus-visible, .btn:focus-visible, .card:focus-visible, .bcard:focus-visible {
  outline: 2px solid var(--brand); outline-offset: 2px;
}

/* ---- navbar (stays on one row, both links level) ---- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 700; font-size: 17px; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.nav-links { display: flex; flex: 0 0 auto; align-items: center; }
.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  margin-left: 6px;
  white-space: nowrap;
  line-height: 1;
}
.nav-links a:hover { background: var(--bg); color: var(--ink); }
.nav-links a.active { background: var(--brand); color: #fff; }

/* ---- layout ---- */
.container { max-width: 980px; margin: 0 auto; padding: 20px 16px 64px; }
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 15px; margin: 22px 0 10px; }
.muted { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); padding: 30px 0; }

/* ---- date filter (touch friendly) ---- */
.month-filter {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
}
.month-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  font-size: 16px;            /* >=16px avoids iOS zoom-on-focus */
  font-weight: 600;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  text-align: center;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line);
  text-decoration: none; color: var(--ink); font-size: 20px;
  cursor: pointer;
}
.btn:hover { background: var(--bg); }
.btn:active { background: #eef0f3; }

/* ---- stats ---- */
.stats { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; font-size: 13px; color: var(--muted);
}
.stat .num { font-size: 18px; font-weight: 700; color: var(--ink); margin-right: 5px; }

/* ---- bookings as cards (like the users page) ---- */
.day-head { text-transform: capitalize; color: var(--brand-dark); }
.blist { display: flex; flex-direction: column; gap: 10px; }
.bcard {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .08s ease, box-shadow .08s ease;
}
.bcard:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(20,30,50,.12); }
.btime {
  flex: 0 0 auto; min-width: 54px;
  font-size: 18px; font-weight: 700; color: var(--brand-dark);
}
.bbody { flex: 1; min-width: 0; }
.bname { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bsub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bright { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.bprice { font-weight: 600; font-size: 14px; white-space: nowrap; }

/* ---- status badges ---- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.badge-booked    { background: #e6f4ea; color: #1e7e45; }
.badge-completed { background: #e7eefc; color: #2a5bd7; }
.badge-cancelled { background: #fdeaea; color: #c0392b; }
.badge-no_show   { background: #f3eafc; color: #7a3fb0; }

/* ---- user cards ---- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .08s ease, box-shadow .08s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(20,30,50,.12); }
.avatar {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.avatar-lg { width: 64px; height: 64px; font-size: 22px; }
.card-body { flex: 1; min-width: 0; }
.card-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: 13px; }
.card-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.chevron { color: var(--muted); font-size: 22px; }

/* ---- user detail ---- */
.back { display: inline-block; margin-bottom: 16px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--ink); }
.profile { display: flex; align-items: center; gap: 18px; margin-bottom: 12px; }
.profile h1 { margin: 0 0 2px; }
.notes { background: #fff8ee; border: 1px solid #f0e2c8; border-radius: 10px; padding: 12px 14px; margin: 8px 0 4px; font-size: 14px; }
.errbox { background: #fff; border: 1px solid var(--line); padding: 12px; border-radius: 8px; overflow: auto; font-size: 12px; }

/* keep the user-detail table readable on phones (horizontal scroll) */
.table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 11px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.table tr:last-child td { border-bottom: 0; }
.nowrap { white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 520px) {
  .brand { font-size: 15px; }
  .nav-links a { padding: 8px 10px; }
}
