:root {
  --primary:    #1a1a2e;
  --accent:     #f0a500;
  --success:    #28a745;
  --danger:     #dc3545;
  --info:       #3b82f6;
  --purple:     #8b5cf6;
  --bg:         #f9fafb;
  --card-bg:    #ffffff;
  --bank-bg:    #fef9e7;
  --border:     #e5e7eb;
  --text-dark:  #111827;
  --text-muted: #6b7280;
  --sidebar-width: 260px;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text-dark);
}

/* ── Buttons ── */
.btn-primary-gold {
  background: var(--accent);
  border: none;
  color: var(--primary);
  font-weight: 600;
}
.btn-primary-gold:hover { background: #d68f00; }

.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }

/* ── Sidebar ── */
.sidebar {
  background: var(--primary);
  color: #fff;
  width: var(--sidebar-width);
}

/* ── Bank Info Box ── */
.bank-info-box {
  background: var(--bank-bg);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 24px;
}

/* ── Status Badges ── */
.badge { font-weight: 500; padding: 5px 10px; border-radius: 20px; }

.status-pending          { background: #fff4d6; color: #8a6500; }
.status-approved         { background: #dbeafe; color: #1e40af; }
.status-awaiting_payment { background: #ede9fe; color: #5b21b6; }
.status-confirmed        { background: #1a1a2e; color: #fff; }
.status-completed        { background: #d1fae5; color: #065f46; }
.status-cancelled        { background: #fee2e2; color: #991b1b; }
.status-rejected         { background: #e5e7eb; color: #374151; }

/* ── Package expand/collapse toggle ──
   Shared by the student, instructor and admin booking lists. A fixed-size square so
   it never collapses against the text beside it. */
.pkg-toggle {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7dbe0;
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pkg-toggle:hover         { background: var(--bank-bg); border-color: var(--accent); color: #b47800; }
.pkg-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Expanded: filled gold so an open package is obvious at a glance */
.pkg-toggle:not(.collapsed) { background: var(--accent); border-color: var(--accent); color: var(--primary); }

.pkg-toggle .bi {
  font-size: 15px;
  line-height: 1;
  font-weight: 700;
  transition: transform .15s ease;
}
.pkg-toggle:not(.collapsed) .bi { transform: rotate(90deg); }

.pkg-session-row > td { background: #f8f9fa; }

/* ── Notification bell dropdown ──
   Each row is a message plus a clear (×) button; the whole list can be
   emptied from the "Clear all" control in the header. */
.notif-menu {
  min-width: 320px;
  max-width: 360px;
  padding: 0;
  overflow: hidden;
}

.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.notif-clear-all {
  border: 0;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--danger);
  cursor: pointer;
}
.notif-clear-all:hover:not(:disabled) { text-decoration: underline; }
.notif-clear-all:disabled            { opacity: .5; cursor: default; }

.notif-empty {
  padding: 18px 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  border-bottom: 1px solid #f1f2f4;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover      { background: var(--bg); }

/* The message itself — a link, so it keeps the mark-as-read click target. */
.notif-body {
  flex: 1 1 auto;
  min-width: 0;
  display: block;
  padding: 10px 4px 10px 14px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dark);
  text-decoration: none;
}
.notif-body:hover { color: var(--text-dark); }

.notif-msg  { display: block; white-space: normal; overflow-wrap: anywhere; }
.notif-time { display: block; margin-top: 2px; font-size: 11px; color: var(--text-muted); }

/* Unread rows are bold with a gold rail down the left edge. */
.notif-item.is-unread .notif-msg { font-weight: 600; }
.notif-item.is-unread            { box-shadow: inset 3px 0 0 var(--accent); }

.notif-clear {
  flex: 0 0 auto;
  align-self: stretch;
  width: 34px;
  padding: 0;
  border: 0;
  background: none;
  color: #b0b5bd;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.notif-clear:hover:not(:disabled) { color: var(--danger); background: #fdeaea; }
.notif-clear:focus-visible        { outline: 2px solid var(--accent); outline-offset: -2px; }
.notif-clear:disabled             { opacity: .4; cursor: default; }

.notif-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.payment-status-awaiting_payment { background: #ede9fe; color: #5b21b6; }
.payment-status-reported_paid    { background: #fef3c7; color: #92400e; }
.payment-status-verified         { background: #d1fae5; color: #065f46; }
.payment-status-failed           { background: #fee2e2; color: #991b1b; }
.payment-status-refunded         { background: #e5e7eb; color: #374151; }

/* ── Booking list cards ──
   Admin "All Bookings" and instructor "My Bookings". One card per booking (a package
   is one card that expands to its sessions), a status-coloured rail down the left. */
.bk-list-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-dark);
}

.bk-list { display: flex; flex-direction: column; gap: 14px; }

.bk-card {
  --bk-rail: #cbd5e1;
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .04);
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.bk-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--bk-rail);
}
.bk-card:hover {
  border-color: #d9dde3;
  box-shadow: 0 2px 4px rgba(16, 24, 40, .05), 0 12px 28px rgba(16, 24, 40, .08);
}
.bk-card--pending          { --bk-rail: #f0a500; }
.bk-card--approved         { --bk-rail: #3b82f6; }
.bk-card--awaiting_payment { --bk-rail: #8b5cf6; }
.bk-card--confirmed        { --bk-rail: #1a1a2e; }
.bk-card--completed        { --bk-rail: #10b981; }
.bk-card--cancelled        { --bk-rail: #ef4444; }
.bk-card--rejected         { --bk-rail: #9ca3af; }
/* Payment cards (All Payments, Awaiting Payments) colour by payment status */
.bk-card--pay-awaiting_payment { --bk-rail: #8b5cf6; }
.bk-card--pay-reported_paid    { --bk-rail: #f0a500; }
.bk-card--pay-verified         { --bk-rail: #10b981; }
.bk-card--pay-failed           { --bk-rail: #ef4444; }
.bk-card--pay-refunded         { --bk-rail: #9ca3af; }

/* Header: serial, booking id + ref, badges */
.bk-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 20px 14px 22px;
  background: linear-gradient(180deg, #fbfbfc 0%, #fff 100%);
  border-bottom: 1px solid #f0f1f3;
}
.bk-serial {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--primary);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.bk-ident { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.bk-id    { font-weight: 700; font-size: 15px; color: var(--primary); }
.bk-ref {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .02em;
}
.bk-badges { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.bk-badges .badge { font-size: 12px; }

/* Body: label-over-value cells */
.bk-card-body {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1.6fr) minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(110px, .8fr);
  gap: 20px;
  padding: 18px 20px 18px 22px;
}
.bk-card-body--4 {
  grid-template-columns: minmax(150px, 1fr) minmax(0, 1.8fr) minmax(0, 1.4fr) minmax(110px, .8fr);
}
.bk-cell  { min-width: 0; font-size: 13.5px; }
.bk-label {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9ca3af;
}
.bk-name { font-weight: 600; color: var(--text-dark); overflow-wrap: anywhere; }
.bk-sub  { margin-top: 2px; font-size: 12px; color: var(--text-muted); }

.bk-date { display: flex; align-items: center; gap: 10px; }
.bk-day  { font-size: 28px; font-weight: 700; line-height: 1; color: var(--primary); }
.bk-mon  { display: flex; flex-direction: column; font-weight: 600; line-height: 1.2; }
.bk-mon small { font-weight: 400; font-size: 12px; color: var(--text-muted); }
.bk-time { margin-top: 8px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #374151; }
.bk-time .bi { color: var(--accent); }

.bk-person { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bk-avatar {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bank-bg);
  border: 1px solid #f6dc9a;
  color: #8a6500;
  font-size: 13px;
  font-weight: 700;
}
.bk-avatar--dark { background: var(--primary); border-color: var(--primary); color: #fff; }

.bk-contact {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.bk-contact .bi { flex: 0 0 auto; margin-top: 1px; color: #9ca3af; }
.bk-contact a   { color: #2563eb; text-decoration: none; }
.bk-contact a:hover { text-decoration: underline; }

.bk-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  font-size: 12px;
  font-weight: 500;
}
.bk-note {
  display: flex;
  gap: 7px;
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #78350f;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bk-note .bi { flex: 0 0 auto; }

.bk-amount { text-align: right; }
.bk-price  { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.1; font-variant-numeric: tabular-nums; }

/* Footer: workflow actions left, status override + delete right */
.bk-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 20px 12px 22px;
  background: #fafafb;
  border-top: 1px solid #f0f1f3;
}
.bk-actions       { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bk-actions--end  { margin-left: auto; }
.bk-actions .btn  { border-radius: 8px; font-size: 12.5px; font-weight: 500; }
.bk-status-form   { display: flex; align-items: center; gap: 6px; }
.bk-status-form .form-select { width: auto; min-width: 150px; font-size: 12.5px; border-radius: 8px; }

.bk-sessions-toggle .bi { display: inline-block; transition: transform .15s ease; }
.bk-sessions-toggle:not(.collapsed) .bi { transform: rotate(90deg); }
.bk-sessions-toggle:not(.collapsed) { background: var(--accent); border-color: var(--accent); color: var(--primary); }

/* Expanded package sessions */
.bk-sessions { padding: 14px 20px 16px 22px; background: #f8f9fa; border-top: 1px dashed #e5e7eb; }
.bk-sessions-title { margin-bottom: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.bk-session {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #eef0f2;
  font-size: 13px;
}
.bk-session + .bk-session { margin-top: 6px; }
.bk-session-no {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef0f2;
  font-size: 11.5px;
  font-weight: 700;
  color: #4b5563;
}

.bk-empty {
  padding: 48px 16px;
  text-align: center;
  background: var(--card-bg);
  border: 1px dashed #d7dbe0;
  border-radius: 14px;
}
.bk-empty .bi { display: block; margin-bottom: 8px; font-size: 32px; color: #c4c9d0; }

/* Pagination */
.bk-pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 24px 0 8px;
}
.bk-pager-num,
.bk-pager-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.bk-pager-num:hover,
.bk-pager-btn:hover          { border-color: var(--accent); background: var(--bank-bg); color: var(--primary); }
.bk-pager-num.active         { background: var(--primary); border-color: var(--primary); color: var(--accent); }
.bk-pager-btn.disabled       { opacity: .45; pointer-events: none; }
.bk-pager-num:focus-visible,
.bk-pager-btn:focus-visible  { outline: 2px solid var(--accent); outline-offset: 2px; }
.bk-pager-gap                { padding: 0 4px; color: var(--text-muted); }

@media (max-width: 1199.98px) {
  .bk-card-body,
  .bk-card-body--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-amount { text-align: left; }
}
.bk-head-amount { display: none; }

/* Phones: a compact "ticket" — amount in the header, a dark lesson strip, people
   as tidy rows with icon tiles, and full-width thumb-sized actions. */
@media (max-width: 575.98px) {
  .bk-list { gap: 16px; }
  .bk-list-head { font-size: 12.5px; margin-bottom: 10px; }

  /* Instructor status tabs: one swipeable row of pills instead of wrapping */
  .bk-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    margin: 0 -12px 1.25rem !important;
    padding: 2px 12px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .bk-tabs::-webkit-scrollbar { display: none; }
  .bk-tabs .btn {
    flex: 0 0 auto;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
  }
  .bk-tabs .btn-outline-secondary { background: #fff; border-color: #e5e7eb; color: #4b5563; }
  .bk-tabs .btn-dark { background: var(--primary); border-color: var(--primary); color: var(--accent); }

  .bk-card {
    border-radius: 18px;
    border-color: #eceef1;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 24px -8px rgba(16, 24, 40, .12);
  }
  .bk-card::before { width: 100%; height: 4px; inset: 0 0 auto 0; }  /* rail becomes a top bar */
  .bk-card:hover   { box-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 24px -8px rgba(16, 24, 40, .12); }

  /* Header: [serial] Booking #id / ref ............ £amount */
  .bk-card-head {
    padding: 18px 16px 14px;
    gap: 12px;
    background: #fff;
    border-bottom: 0;
  }
  .bk-serial { min-width: 36px; height: 36px; border-radius: 11px; font-size: 14px; }
  .bk-ident  { flex-direction: column; align-items: flex-start; gap: 3px; flex: 1; }
  .bk-id     { font-size: 15.5px; line-height: 1.2; }
  .bk-ref    { font-size: 11px; padding: 1px 7px; }
  .bk-head-amount {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: auto;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
  }
  .bk-head-amount small { margin-top: 3px; font-size: 11.5px; font-weight: 500; color: var(--text-muted); }
  .bk-badges { order: 3; width: 100%; margin-left: 0; gap: 6px; }
  .bk-badges .badge { font-size: 11.5px; padding: 5px 10px; }

  /* Body */
  .bk-card-body,
  .bk-card-body--4 {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 16px 4px;
  }
  .bk-amount { display: none; }
  .bk-label  { font-size: 10.5px; margin-bottom: 8px; }

  /* Lesson: dark strip with the date tile on the left and a time pill on the right */
  .bk-when {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: linear-gradient(135deg, #1a1a2e 0%, #2b2b4a 100%);
    color: #fff;
  }
  .bk-when .bk-label { display: none; }
  .bk-when .bk-date  { gap: 10px; }
  .bk-when .bk-day {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: var(--accent);
    color: var(--primary);
    font-size: 21px;
  }
  .bk-when .bk-mon       { color: #fff; font-size: 14px; }
  .bk-when .bk-mon small { color: rgba(255, 255, 255, .6); }
  .bk-when .bk-time {
    margin-top: 0;
    padding: 6px 11px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
  }
  .bk-when .bk-sub { width: 100%; margin-top: 0; color: rgba(255, 255, 255, .6); }

  /* People and service: rows separated by hairlines */
  .bk-cell--person,
  .bk-cell--service,
  .bk-cell--meta { padding: 14px 0; }
  .bk-cell--person + .bk-cell,
  .bk-cell--service,
  .bk-cell--meta { border-top: 1px solid #f0f1f3; }

  .bk-person { margin-bottom: 8px; gap: 12px; }
  .bk-avatar { flex-basis: 38px; width: 38px; height: 38px; font-size: 14px; border-radius: 12px; }
  .bk-name   { font-size: 14.5px; }

  /* Contact lines line up under the name, each with a small icon tile */
  .bk-cell--person .bk-contact,
  .bk-cell--person > .text-muted.small { margin-left: 50px; }
  .bk-contact { align-items: center; gap: 9px; margin-top: 6px; font-size: 13px; }
  .bk-contact .bi {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f4f5f7;
    color: #6b7280;
    font-size: 12.5px;
  }
  .bk-contact a { color: #1d4ed8; font-weight: 500; }

  /* Service: label and value on one line */
  .bk-cell--service { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .bk-cell--service .bk-label { margin: 0; flex: 0 0 auto; }
  .bk-cell--service .bk-name  { margin-left: auto; text-align: right; }
  .bk-cell--service .bk-chip  { margin-top: 0 !important; }
  .bk-cell--service .bk-note  { width: 100%; margin-top: 4px; }

  /* Footer: full-width, thumb-sized controls */
  .bk-card-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px 16px;
    background: #fafbfc;
  }
  .bk-actions       { width: 100%; }
  .bk-actions:not(:has(*)) { display: none; }  /* no actions for this status — drop the empty row */
  .bk-actions > .btn,
  .bk-actions > form:not(.bk-status-form) { flex: 1 1 auto; }
  .bk-actions > form:not(.bk-status-form) .btn { width: 100%; }
  .bk-actions .btn  { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border-radius: 10px; font-size: 13px; }
  .bk-actions--end  { margin-left: 0; flex-wrap: nowrap; }
  .bk-actions--end > form:last-child:not(.bk-status-form) { flex: 0 0 auto; }
  .bk-actions--end > form:last-child:not(.bk-status-form) .btn { width: 40px; padding: 0; }
  .bk-status-form   { flex: 1 1 auto; min-width: 0; }
  .bk-status-form .form-select { flex: 1; min-width: 0; height: 40px; border-radius: 10px; font-size: 13px; }
  .bk-status-form .btn { flex: 0 0 auto; width: auto; padding: 0 16px; }

  .bk-sessions { padding: 14px 16px 16px; }
  .bk-session  { gap: 6px 12px; }

  .bk-pager { gap: 5px; }
  .bk-pager-num, .bk-pager-btn { min-width: 40px; height: 40px; padding: 0 10px; }
}
