/* ---------------------------------------------------------------
   Brand theming only. Layout/spacing/typography/components are
   stock Bootstrap 5 classes in the markup. What's here is:
   (1) wiring the palette from theme.css into components Bootstrap's
       own CSS-variable API doesn't reach,
   (2) hover/lift effects Bootstrap has no equivalent for,
   (3) the few pieces Bootstrap has no component for (donut, bar
       chart, number plate, mobile tab bar).
--------------------------------------------------------------- */

/* All colour values live in theme.css (loaded first). Everything
   below refers to them only through var(--tp-*) / var(--bs-*). */

body{ background:var(--tp-paper); color:var(--tp-ink); }

.card{ --bs-card-bg:var(--tp-card); --bs-card-border-color:var(--tp-line); }
.list-group{ --bs-list-group-bg:transparent; --bs-list-group-border-color:var(--tp-line); }
.table{ --bs-table-bg:transparent; --bs-table-border-color:var(--tp-line); }
.dropdown-menu{ --bs-dropdown-bg:var(--tp-card); --bs-dropdown-border-color:var(--tp-line); }
.dropdown-item.active, .dropdown-item:active{ background:var(--tp-orange); color:#fff; }
.text-muted{ color:var(--tp-muted) !important; }
.min-w-0{ min-width:0; }  /* lets text-truncate work inside flex rows */

/* Mobile tab bar surface follows the theme */
.app-bar{ background:var(--tp-card); border-color:var(--tp-line) !important; }

/* Topbar + logo strip are permanently dark (logo is designed for a dark
   ground). They carry data-bs-theme="dark" in the markup so everything
   inside - search, buttons, dropdowns - uses the dark tokens; only the
   surface colour is pinned here. */
.app-topbar, .sidebar-brand{ background:var(--tp-topbar) !important; border-color:var(--tp-sidebar-line) !important; }
.app-topbar{ z-index:1030; }
.app-topbar .form-control, .app-topbar .input-group-text{ background-color:rgba(255,255,255,.06); border-color:rgba(255,255,255,.12); }

/* Brand text: teal accent for links/icons in section heads; orange for icons */
.text-brand{ color:var(--tp-accent-text) !important; }
a.text-brand:hover{ color:var(--tp-accent-text-hover) !important; }
.text-orange{ color:var(--tp-icon-fg) !important; }

/* ---------- Sidebar: deep-teal background + orange active state ----------
   Usage is ~50% tablet, 30% phone, 20% desktop, so tablet is the
   primary layout:  phone <768 = top bar + bottom tabs + offcanvas;
   tablet 768-1199 = 88px icon rail;  desktop 1200+ = full 240px sidebar. */
:root{ --tp-topbar-h:64px; }
.sidebar{ width:240px; background:var(--tp-sidebar); }
/* Main sidebar sits under the full-width topbar and sticks below it */
.sidebar-main{ position:sticky; top:var(--tp-topbar-h); height:calc(100vh - var(--tp-topbar-h)); height:calc(100dvh - var(--tp-topbar-h)); }
/* On desktop the logo block matches the sidebar width so the two line up */
@media (min-width:1200px){ .topbar-brand{ width:calc(240px - 1rem); justify-content:center; } }
@media (max-width:767.98px){ .topbar-brand img{ height:36px; } }
.sidebar .label-short, .sidebar .rail-divider{ display:none; }
.sidebar-brand{ border-bottom:1px solid; }
.sidebar-heading{ color:rgba(255,255,255,.42); font-size:.68rem; letter-spacing:.08em; }
.sidebar-nav .nav-link{ color:rgba(255,255,255,.74); padding:.45rem .75rem; display:flex; align-items:center; gap:.6rem; font-size:.92rem; }
.sidebar-nav .nav-link:hover{ color:#fff; background:rgba(255,255,255,.07); }
.sidebar-nav.nav-pills .nav-link.active{ color:#fff; background:var(--tp-orange); }
.sidebar hr{ border-color:var(--tp-sidebar-line); opacity:1; }
.offcanvas.sidebar{ --bs-offcanvas-bg:var(--tp-sidebar); }
.sidebar-nav .nav-link{ min-height:44px; }        /* touch target */

@media (min-width:768px) and (max-width:1199.98px){
  .sidebar-main{ width:88px; }
  .sidebar-main .sidebar-heading, .sidebar-main .label-full{ display:none; }
  .sidebar-main .rail-divider{ display:block; }
  .sidebar-main .sidebar-nav .nav-link{
    flex-direction:column; justify-content:center; gap:.15rem;
    padding:.5rem .25rem; min-height:56px; text-align:center;
  }
  .sidebar-main .sidebar-nav .nav-link i{ font-size:1.2rem; line-height:1; }
  .sidebar-main .label-short{ display:block; font-size:.66rem; font-weight:600; line-height:1.1; }
  .sidebar-main .sidebar-site{ justify-content:center; padding:.75rem .5rem !important; }
}

/* ---------- Buttons: brand colours via Bootstrap's --bs-btn-* variables ---------- */
.btn-primary{
  --bs-btn-color:#fff;
  --bs-btn-bg:var(--tp-orange);
  --bs-btn-border-color:var(--tp-orange);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg:var(--tp-orange-hover);
  --bs-btn-hover-border-color:var(--tp-orange-hover);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg:var(--tp-orange-hover);
  --bs-btn-active-border-color:var(--tp-orange-hover);
  --bs-btn-disabled-color:#fff;
  --bs-btn-disabled-bg:var(--tp-orange);
  --bs-btn-disabled-border-color:var(--tp-orange);
  --bs-btn-focus-shadow-rgb:var(--tp-orange-rgb);
  font-weight:600;
}
/* Secondary action: orange border, white background, teal icon.
   (Toggles, filters and toolbars keep the neutral .btn-outline-secondary.) */
.btn-secondary{
  --bs-btn-color:var(--tp-ink);
  --bs-btn-bg:#fff;
  --bs-btn-border-color:var(--tp-orange);
  --bs-btn-hover-color:var(--tp-ink);
  --bs-btn-hover-bg:var(--tp-icon-tint);
  --bs-btn-hover-border-color:var(--tp-orange-hover);
  --bs-btn-active-color:var(--tp-ink);
  --bs-btn-active-bg:var(--tp-icon-tint);
  --bs-btn-active-border-color:var(--tp-orange-hover);
  --bs-btn-disabled-color:var(--tp-muted);
  --bs-btn-disabled-bg:#fff;
  --bs-btn-disabled-border-color:var(--tp-orange);
  --bs-btn-focus-shadow-rgb:var(--tp-orange-rgb);
  font-weight:600;
}
[data-bs-theme=dark] .btn-secondary{ --bs-btn-bg:var(--tp-card); --bs-btn-disabled-bg:var(--tp-card); }
.btn-secondary .bi{ color:var(--tp-accent-text); }
.btn-outline-primary{
  --bs-btn-color:var(--tp-icon-fg);
  --bs-btn-border-color:var(--tp-orange);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg:var(--tp-orange);
  --bs-btn-hover-border-color:var(--tp-orange);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg:var(--tp-orange);
  --bs-btn-active-border-color:var(--tp-orange);
  --bs-btn-focus-shadow-rgb:var(--tp-orange-rgb);
}
/* Teal = secondary brand action */
.btn-teal{
  --bs-btn-color:#fff;
  --bs-btn-bg:var(--tp-teal);
  --bs-btn-border-color:var(--tp-teal);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-bg:var(--tp-teal-hover);
  --bs-btn-hover-border-color:var(--tp-teal-hover);
  --bs-btn-active-color:#fff;
  --bs-btn-active-bg:var(--tp-teal-hover);
  --bs-btn-active-border-color:var(--tp-teal-hover);
  --bs-btn-focus-shadow-rgb:var(--tp-teal-rgb);
  font-weight:600;
}
.btn-outline-secondary{
  --bs-btn-color:var(--tp-ink);
  --bs-btn-border-color:var(--tp-line);
  --bs-btn-hover-color:var(--tp-ink);
  --bs-btn-hover-bg:var(--bs-tertiary-bg);
  --bs-btn-hover-border-color:var(--tp-line);
  --bs-btn-active-color:var(--tp-ink);
  --bs-btn-active-bg:var(--bs-tertiary-bg);
  --bs-btn-active-border-color:var(--tp-line);
}
/* Round icon buttons in the topbar */
.btn-icon{
  --bs-btn-color:var(--tp-ink);
  --bs-btn-bg:var(--bs-tertiary-bg);
  --bs-btn-border-color:transparent;
  --bs-btn-hover-color:var(--tp-ink);
  --bs-btn-hover-bg:var(--bs-secondary-bg);
  --bs-btn-hover-border-color:transparent;
  --bs-btn-active-bg:var(--bs-secondary-bg);
  --bs-btn-active-border-color:transparent;
  width:38px; height:38px; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
}

/* ---------- Form focus / checked (brand orange) ---------- */
.form-control:focus, .form-select:focus{
  border-color:var(--tp-orange);
  box-shadow:0 0 0 .2rem rgba(var(--tp-orange-rgb),.18);
}
.form-check-input:checked{ background-color:var(--tp-orange); border-color:var(--tp-orange); }
.form-check-input:focus{ border-color:var(--tp-orange); box-shadow:0 0 0 .2rem rgba(var(--tp-orange-rgb),.18); }
.form-control, .form-select{ background-color:var(--tp-card); }

/* ---------- Hover lift for clickable cards ---------- */
.card.hover-lift{ transition:box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.card.hover-lift:hover{
  box-shadow:0 10px 24px -14px rgba(0,0,0,.35);
  border-color:rgba(var(--tp-orange-rgb),.45);
  transform:translateY(-2px);
}
@media (prefers-reduced-motion: reduce){ .card.hover-lift:hover{ transform:none; } }
@media (hover: none){ .card.hover-lift:hover{ transform:none; box-shadow:none; } .card.hover-lift:active{ border-color:var(--tp-orange); } }

/* Dashboard quick-action cards: always carry an orange border */
.card.card-action{ --bs-card-border-color:var(--tp-orange); --bs-card-border-width:2px; }
.card.card-action.hover-lift:hover, .card.card-action.hover-lift:active{ border-color:var(--tp-orange-hover); }
/* Primary quick-action cards (dashboard): filled orange like .btn-primary, white text, a light icon circle */
.card.card-action-primary{ --bs-card-bg:var(--tp-orange); --bs-card-color:#fff; }
.card.card-action-primary.hover-lift:hover, .card.card-action-primary.hover-lift:active{ --bs-card-bg:var(--tp-orange-hover); border-color:var(--tp-orange-hover); }
.card.card-action-primary .text-body{ color:#fff !important; }
.card.card-action-primary .text-muted{ color:rgba(255,255,255,.88) !important; }
.card.card-action-primary .icon-circle{ background:rgba(255,255,255,.2); color:#fff; }
.card.card-action-primary:focus-visible{ outline:3px solid rgba(var(--tp-orange-rgb),.45); outline-offset:2px; }
/* Large quick actions (Reception): double height, bigger icons */
.quick-actions-lg .card{ min-height:320px; }
.quick-actions-lg .card-body{ justify-content:center; }
.quick-actions-lg .icon-circle{ width:76px; height:76px; font-size:2.1rem; }
@media (min-width:768px){ .quick-actions-lg .card{ min-height:240px; } }
@media (min-width:992px){ .quick-actions-lg .card{ min-height:164px; } }

/* ---------- Touch devices (tablet/phone): 44px minimum targets ---------- */
@media (pointer: coarse){
  .btn:not(.btn-sm), .form-control, .form-select, .input-group-text{ min-height:44px; }
  .btn-icon{ width:44px; height:44px; }
  .list-group-item-action{ padding-top:.75rem; padding-bottom:.75rem; }
  .dropdown-item{ padding-top:.6rem; padding-bottom:.6rem; }
}

/* ---------- Fixed-size tinted icon badges (teal on pale teal everywhere) ---------- */
.icon-circle{
  width:46px; height:46px; border-radius:50%;
  background:rgba(var(--tp-teal-rgb),.12); color:var(--tp-accent-text);
  display:inline-flex; align-items:center; justify-content:center;
  font-size:1.3rem; flex-shrink:0;
}
/* Settings index tiles: a long title hyphenates ("Work-stations") rather than splitting anywhere (.card's break-word) */
.settings-tile-title{ overflow-wrap:normal; hyphens:auto; }
.icon-circle-sm{ width:38px; height:38px; border-radius:.55rem; font-size:1.05rem; }

/* ---------- UK number plate ---------- */
.reg-plate{
  display:inline-block;
  background:var(--tp-plate-bg); color:var(--tp-plate-ink);
  border:1px solid rgba(0,0,0,.25); border-radius:.25rem;
  font-family:"Arial Narrow", Arial, sans-serif; font-weight:700;
  letter-spacing:.06em; font-size:.8rem; line-height:1;
  padding:.3rem .45rem; white-space:nowrap;
}

.reg-plate-sm{ font-size:.66rem; padding:.15rem .3rem; }

/* ---------- Horizontally scrollable pills/tabs (status filters on phone) ---------- */
.nav-scroll{ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
.nav-scroll::-webkit-scrollbar{ display:none; }
.nav-scroll .nav-link{ white-space:nowrap; }
.nav-pills{ --bs-nav-pills-link-active-bg:var(--tp-orange); --bs-nav-pills-link-active-color:#fff; }
.nav-pills:not(.sidebar-nav) .nav-link{ color:var(--tp-ink); }
.nav-pills:not(.sidebar-nav) .nav-link.active{ color:#fff; }
.nav-pills .nav-link .badge{ font-weight:600; }
.nav-pills .nav-link.active .badge{ background:rgba(255,255,255,.25) !important; color:#fff !important; }
.nav-tabs{ --bs-nav-tabs-link-active-bg:var(--tp-card); --bs-nav-tabs-link-active-border-color:var(--tp-line) var(--tp-line) var(--tp-card); --bs-nav-tabs-border-color:var(--tp-line); }
.nav-tabs .nav-link{ color:var(--tp-muted); }
.nav-tabs .nav-link.active{ color:var(--tp-ink); font-weight:600; box-shadow:inset 0 3px 0 var(--tp-orange); }

/* Segmented toggle (btn-check + btn-outline-secondary) checked state */
.btn-check:checked + .btn-outline-secondary{ background:var(--tp-teal); border-color:var(--tp-teal); color:#fff; }
/* The same for a link in a button group marking where you are (the Calendar's Today, Day / Week) */
.btn-outline-secondary.active[aria-current]{ background:var(--tp-teal); border-color:var(--tp-teal); color:#fff; }

/* Tables inside cards: flush headers, muted head row */
.table > thead th{ color:var(--tp-muted); font-weight:600; font-size:.78rem; text-transform:uppercase; letter-spacing:.03em; white-space:nowrap; }
.table-row-link{ cursor:pointer; }
tr.table-row-link{ position:relative; }  /* the containing block for a .stretched-link in the row, so the whole row is the link */
.table-responsive{ position:relative; }  /* keeps visually-hidden / absolute children inside the scroll box */

/* ---------- Jobs board (kanban) ---------- */
.board{ display:grid; grid-auto-flow:column; grid-auto-columns:minmax(188px, 1fr); gap:1rem; overflow-x:auto; padding-bottom:.5rem; }
.board-col{ background:var(--bs-tertiary-bg); border:1px solid var(--tp-line); border-radius:.75rem; padding:.75rem; min-height:200px; }
.board-card{ background:var(--tp-card); border:1px solid var(--tp-line); border-radius:.6rem; padding:.75rem; }
.board-card + .board-card{ margin-top:.6rem; }
/* A card that opens the job card: orange outline on hover and focus (prototype) */
a.board-card:hover, a.board-card:focus-visible{ border-color:var(--tp-orange); }

/* ---------- Workshop diary (bays x half-hours) ---------- */
.diary{
  display:grid;
  grid-template-columns:56px repeat(var(--bays, 4), minmax(150px, 1fr));
  grid-template-rows:44px repeat(20, 34px);            /* 08:00-18:00 in 30-min slots */
  background:var(--tp-card); position:relative; min-width:660px;
}
.diary-head{ grid-row:1; border-bottom:1px solid var(--tp-line); display:flex; flex-direction:column; justify-content:center; padding:0 .6rem; position:sticky; top:0; background:var(--tp-card); z-index:2; }
.diary-time{ grid-column:1; font-size:.7rem; color:var(--tp-muted); text-align:right; padding-right:.5rem; transform:translateY(-.5em); }
.diary-time.first{ transform:none; padding-top:2px; }
.diary-line{ grid-column:2 / -1; border-top:1px solid var(--tp-line); }
.diary-line.half{ border-top-style:dashed; opacity:.6; }
.diary-col{ grid-row:2 / -1; border-left:1px solid var(--tp-line); }
.diary-slot{
  margin:2px 4px; border-radius:.45rem; padding:.3rem .5rem; font-size:.75rem; line-height:1.25; overflow:hidden;
  background:rgba(var(--tp-teal-rgb),.12); border-left:4px solid var(--tp-teal); color:var(--tp-ink); z-index:1;
}
.diary-slot.is-mot{ background:rgba(var(--tp-orange-rgb),.12); border-left-color:var(--tp-orange); }
.diary-slot.is-waiting{ background:repeating-linear-gradient(135deg, rgba(var(--tp-teal-rgb),.10) 0 6px, rgba(var(--tp-teal-rgb),.04) 6px 12px); border-left-style:dashed; }
.diary-slot.is-break{ background:var(--bs-tertiary-bg); border-left-color:var(--tp-line); color:var(--tp-muted); }
a.diary-slot:hover, a.diary-slot:focus-visible{ box-shadow:0 0 0 2px var(--tp-orange); }
.diary-now{ grid-column:2 / -1; border-top:2px solid var(--tp-now); position:relative; z-index:3; pointer-events:none; }
.diary-now::before{ content:""; position:absolute; left:-5px; top:-6px; width:10px; height:10px; border-radius:50%; background:var(--tp-now); }
/* Calendar Week view (calendar/_week): bays by days; entries reuse .diary-slot's colours */
.week-diary{ min-width:980px; table-layout:fixed; }
.week-diary .week-diary-bay{ width:120px; background:var(--tp-card); font-size:.85rem; vertical-align:top; position:sticky; left:0; z-index:2; }
.week-diary-day{ text-align:center; font-weight:normal; }
.week-diary-day.is-today, .week-diary-cell.is-today{ background:rgba(var(--tp-teal-rgb),.06); }
.week-diary-cell{ vertical-align:top; padding:.35rem; }
.week-diary-cell.is-closed{ background:var(--bs-tertiary-bg); }
.week-diary-entry{ display:block; margin:0 0 .3rem; }
.hbar.hbar-sm{ height:5px; }
/* Calendar Month view (calendar/_month) */
.month-diary{ table-layout:fixed; }
.month-diary-day{ height:110px; vertical-align:top; padding:.4rem; }
@media (max-width:767.98px){ .month-diary-day{ height:76px; padding:.25rem; font-size:.8rem; } .month-diary .badge{ font-size:.65rem; padding:.2em .35em; } }
.month-diary-day > a:hover .month-diary-date, .month-diary-day > a:focus-visible .month-diary-date{ color:var(--tp-teal); }
.month-diary-day.is-today{ background:rgba(var(--tp-teal-rgb),.06); }
.month-diary-day.is-today .month-diary-date{ display:inline-flex; align-items:center; justify-content:center; width:1.8rem; height:1.8rem; border-radius:50%; background:var(--tp-teal); color:#fff; }
.month-diary-day.is-closed{ background:var(--bs-tertiary-bg); }
.month-diary-day.is-other-month{ opacity:.55; }
.month-diary-use{ font-size:.7rem; }

/* ---------- Single bay screen (kiosk tablet in the bay) ---------- */
.bay-day{
  display:grid; grid-template-columns:64px 1fr;
  grid-template-rows:12px repeat(20, var(--slot-h, 56px)) 12px;
  background:var(--tp-card); position:relative;
}
.bay-day .diary-line{ grid-column:2 / -1; }
.bay-day .diary-now{ grid-column:2 / -1; z-index:0; }  /* behind bookings; dot stays visible in the gutter */
.bay-day .diary-time{ font-size:.8rem; font-weight:600; }
.bay-day .diary-time.first{ transform:translateY(-.5em); padding-top:0; }
.bay-slot{ grid-column:2 / -1; margin:3px 8px; padding:.5rem .75rem; font-size:.9rem; border-left-width:6px; }
/* Side by side on a phone: cut short rather than break words */
.bay-slot{ overflow-wrap:normal; word-break:normal; }
.bay-slot.is-past{ opacity:.5; }
.bay-slot.is-now{ box-shadow:0 0 0 2px var(--tp-orange); }
.bay-slot.is-break{ display:flex; align-items:center; }
.bay-now{ border:2px solid var(--tp-orange) !important; }
.bay-now-pill{ background:var(--tp-orange); color:#fff; font-size:.8rem; letter-spacing:.05em; }
.bay-chip{ display:inline-flex; align-items:center; gap:.25rem; font-size:.78rem; font-weight:700; padding:.2rem .5rem; border-radius:999px;
  background:rgba(var(--tp-teal-rgb),.14); color:var(--tp-accent-text); white-space:nowrap; }
.reg-plate-lg{ font-size:1.5rem; padding:.45rem .8rem; border-radius:.35rem; }
@media (min-width:992px){ .bay-side{ position:sticky; top:calc(var(--tp-topbar-h) + 1rem); } }

/* Alpine (bundled with Livewire): hidden until it starts */
[x-cloak]{ display:none !important; }

/* ---------- Switch user: the PIN pad (components/staff/pin-pad) ---------- */
.pin-people{ display:grid; grid-template-columns:repeat(auto-fill, minmax(96px, 1fr)); gap:.5rem; }
.pin-person{ display:flex; flex-direction:column; align-items:center; gap:.25rem; padding:.6rem .25rem; min-height:44px;
  border:1px solid var(--tp-line); border-radius:.6rem; font-weight:600; font-size:.85rem; min-width:0; }
.pin-person-initials{ display:inline-flex; align-items:center; justify-content:center; width:2.5rem; height:2.5rem; border-radius:50%;
  background:rgba(var(--tp-teal-rgb),.14); color:var(--tp-accent-text); font-weight:700; }
.btn-check:checked + .pin-person{ border-color:var(--tp-teal); background:rgba(var(--tp-teal-rgb),.10); box-shadow:0 0 0 2px var(--tp-teal); }
.btn-check:checked + .pin-person .pin-person-initials{ background:var(--tp-teal); color:#fff; }
.btn-check:focus-visible + .pin-person{ outline:2px solid var(--tp-orange); outline-offset:2px; }
.pin-input{ max-width:10rem; margin:0 auto; font-size:1.75rem; letter-spacing:.6em; padding-left:1.2em; }
.pin-keys{ display:grid; grid-template-columns:repeat(3, 1fr); gap:.5rem; max-width:16rem; margin:0 auto; }
.pin-keys .btn{ min-height:52px; font-size:1.3rem; font-weight:600; }
/* Locked: the page behind doesn't show */
body.staff-is-locked .modal-backdrop.show{ opacity:1; background:#0B1C1F; }

/* ---------- Messages ---------- */
.convo-list .list-group-item.active{ background:rgba(var(--tp-orange-rgb),.10); border-color:var(--tp-line); color:var(--tp-ink); box-shadow:inset 3px 0 0 var(--tp-orange); }
.bubble{ max-width:80%; padding:.55rem .8rem; border-radius:1rem; font-size:.9rem; }
.bubble-in{ background:var(--bs-tertiary-bg); border-bottom-left-radius:.3rem; }
.bubble-out{ background:var(--tp-teal); color:#fff; border-bottom-right-radius:.3rem; margin-left:auto; }
.channel-dot{ width:22px; height:22px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:.7rem; color:#fff; flex-shrink:0; }
/* Contact buttons (job card): 44px touch target, channel colour */
.channel-btn{ width:44px; height:44px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:1.1rem; color:#fff; flex-shrink:0; text-decoration:none; transition:filter .15s ease; }
.channel-btn:hover, .channel-btn:focus-visible{ color:#fff; filter:brightness(1.12); }
.channel-btn.is-sms{ background:var(--tp-channel-sms); }
.channel-btn.is-whatsapp{ background:var(--tp-channel-whatsapp); }
.channel-btn.is-email{ background:var(--tp-channel-email); }
.channel-btn.is-print{ background:var(--tp-channel-print); }
.channel-btn[aria-expanded=true]{ box-shadow:0 0 0 3px var(--tp-card), 0 0 0 5px var(--tp-accent-text); }

/* Job card message composer: text box and email editor are both 10 lines deep */
.compose{ background:var(--tp-card); }
.compose-text, .compose-editor{ line-height:1.5; }
.compose-editor{ height:calc(10 * 1.5em + .75rem + 2px); overflow-y:auto; }
.compose-editor p{ margin-bottom:.5rem; }
.compose-editor ul, .compose-editor ol{ margin-bottom:.5rem; padding-left:1.25rem; }
.compose-text{ resize:vertical; }

/* Single-series horizontal bars (reports, payment methods) */
.hbar{ height:10px; background:var(--tp-track); border-radius:5px; overflow:hidden; }
.hbar > span{ display:block; height:100%; background:var(--tp-orange); border-radius:5px; }
.progress{ --bs-progress-bg:var(--tp-track); --bs-progress-bar-bg:var(--tp-orange); }

/* Avatar initials */
.avatar{ width:40px; height:40px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-weight:700; font-size:.85rem; color:#fff; background:var(--tp-teal); flex-shrink:0; }
.avatar-lg{ width:56px; height:56px; font-size:1.05rem; }

/* ---------- Date tile (upcoming bookings) ---------- */
.date-tile{ width:52px; background:var(--bs-tertiary-bg); border:1px solid var(--tp-line); }
.date-tile .d{ color:var(--tp-icon-fg); }

/* ---------- Donut (no Bootstrap chart component) ---------- */
@property --donut-turn { syntax:"<number>"; inherits:false; initial-value:0; }
.donut{
  --donut-turn:0;
  width:150px; height:150px; border-radius:50%;
  background:conic-gradient(var(--tp-orange) 0turn calc(var(--donut-turn) * 1turn), var(--tp-track) calc(var(--donut-turn) * 1turn) 1turn);
  display:flex; align-items:center; justify-content:center; position:relative;
  transition:--donut-turn 1.1s cubic-bezier(.22,.61,.36,1);
}
.donut::before{ content:""; position:absolute; width:106px; height:106px; background:var(--tp-card); border-radius:50%; }
.donut .donut-center{ position:relative; text-align:center; }
.legend-dot{ width:9px; height:9px; border-radius:50%; display:inline-block; flex-shrink:0; }
@media (prefers-reduced-motion: reduce){ .donut{ transition:none; } }

/* ---------- Bar chart (single series, CSS only) ---------- */
.bar-chart{ display:flex; align-items:flex-end; gap:2px; height:170px; border-bottom:1px solid var(--tp-line); position:relative; }
.bar-chart .gridline{ position:absolute; left:0; right:0; border-top:1px dashed var(--tp-line); pointer-events:none; }
.bar-chart .bar-col{ flex:1; height:100%; display:flex; align-items:flex-end; justify-content:center; position:relative; cursor:default; }
.bar-chart .bar{ width:min(34px, 70%); background:var(--tp-orange); border-radius:4px 4px 0 0; transition:opacity .15s ease; }
.bar-chart .bar.is-today{ background:var(--tp-teal); }
.bar-chart:hover .bar{ opacity:.45; }
.bar-chart .bar-col:hover .bar{ opacity:1; }
.bar-chart .bar-col .tip{
  position:absolute; bottom:calc(var(--h) + 6px); left:50%; transform:translateX(-50%);
  background:var(--tp-ink); color:var(--tp-card);
  font-size:.72rem; font-weight:600; padding:.2rem .45rem; border-radius:.3rem; white-space:nowrap;
  opacity:0; pointer-events:none; transition:opacity .12s ease; z-index:2;
}
.bar-chart .bar-col:hover .tip, .bar-chart .bar-col:focus .tip{ opacity:1; }
.bar-chart .bar-col:focus{ outline:none; }
.bar-chart:has(.bar-col:focus) .bar{ opacity:.45; }
.bar-chart .bar-col:focus .bar{ opacity:1; }
.bar-chart .bar-col:last-child .tip{ left:auto; right:0; transform:none; }
.bar-labels{ display:flex; gap:2px; }
.bar-labels span{ flex:1; text-align:center; font-size:.72rem; color:var(--tp-muted); padding-top:.35rem; }

/* ---------- Hero ---------- */
.hero{
  background:
    var(--tp-hero-gradient),
    repeating-conic-gradient(rgba(255,255,255,.06) 0 25%, transparent 0 50%) 0 0 / 28px 28px;
}
[data-bs-theme=dark] .hero{
  background:
    var(--tp-hero-gradient),
    repeating-conic-gradient(rgba(255,255,255,.05) 0 25%, transparent 0 50%) 0 0 / 28px 28px;
}
.hero .hero-stripe{ height:4px; background:var(--tp-orange); width:64px; border-radius:2px; }

/* ---------- Mobile bottom tab bar ---------- */
.tabbar .tab-item{ display:flex; flex-direction:column; align-items:center; gap:.1rem; color:var(--tp-muted); font-size:.72rem; }
.tabbar .tab-item.active{ color:var(--tp-icon-fg) !important; }
/* main.container-fluid, not main: the layout's .py-4 is !important too and a class outranks a bare element */
@media (max-width: 767.98px){ main.container-fluid{ padding-bottom:calc(5rem + env(safe-area-inset-bottom)) !important; } }

/* ---------- New Job flow (new-job-modal component) ---------- */
.nj-steps{ counter-reset:none; overflow-x:auto; }
.nj-step{ display:flex; align-items:center; gap:.35rem; padding:.2rem .6rem .2rem .25rem; border-radius:2rem; color:var(--tp-muted); white-space:nowrap; }
.nj-step-n{ width:24px; height:24px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:.75rem; font-weight:700; background:var(--bs-tertiary-bg); border:1px solid var(--tp-line); }
.nj-step.is-current{ color:var(--tp-ink); font-weight:600; background:rgba(var(--tp-teal-rgb),.10); }
.nj-step.is-current .nj-step-n{ background:var(--tp-teal); border-color:var(--tp-teal); color:#fff; }
.nj-step.is-done .nj-step-n{ background:rgba(var(--tp-teal-rgb),.15); border-color:transparent; color:var(--tp-accent-text); }
@media (max-width:575.98px){ .nj-step:not(.is-current) .nj-step-label{ display:none; } }
.nj-step.is-link{ padding:0; }
.nj-step-btn{ display:flex; align-items:center; justify-content:center; gap:.35rem; min-height:44px; min-width:44px; padding:.2rem .6rem .2rem .25rem; border:0; border-radius:2rem; background:none; color:inherit; font:inherit; cursor:pointer; }
.nj-step-btn:hover{ background:rgba(var(--tp-teal-rgb),.10); }
.nj-step-btn:hover .nj-step-label, .nj-step-btn:focus-visible .nj-step-label{ text-decoration:underline; }
.nj-step-btn:focus-visible{ outline:2px solid var(--tp-orange); outline-offset:1px; }

.nj-results .list-group-item{ min-height:44px; }
/* Results appear after 3 characters: orange outline like the dashboard action cards */
.nj-results:not(:empty){ border:2px solid var(--tp-orange); border-radius:var(--bs-border-radius); overflow:hidden; }
.nj-results .list-group-item{ border-left:0; border-right:0; border-radius:0; }
.nj-results .list-group-item:first-child{ border-top:0; }
.nj-results .list-group-item:last-child{ border-bottom:0; }

/* Item lines: one grid row per line on tablet/desktop; stacked with labels on phone */
.nj-line{ display:grid; gap:.5rem; align-items:start; padding:.5rem 0; grid-template-columns:repeat(3, 1fr); }
.nj-line + .nj-line{ border-top:1px solid var(--tp-line); }
.nj-line > :first-child{ grid-column:1 / -1; }
.nj-line .nj-total{ grid-column:span 2; align-self:center; }
.nj-line .nj-cell:last-child{ align-self:center; }
.nj-cell{ display:block; margin:0; min-width:0; }
.nj-cell-label{ display:block; font-size:.72rem; color:var(--tp-muted); margin-bottom:.15rem; }
.nj-line-type{ display:block; font-size:.72rem; color:var(--tp-muted); margin-top:.15rem; }
.nj-line-head{ padding-bottom:.25rem; border-bottom:1px solid var(--tp-line); }
@media (min-width:768px){
  .nj-line{ grid-template-columns:minmax(0, 1fr) 7rem 5.5rem 7rem 6.5rem 3rem; }
  .nj-line > :first-child, .nj-line .nj-total{ grid-column:auto; }
  .nj-line .nj-total{ padding-top:.35rem; align-self:start; }
  .nj-line .nj-cell:last-child{ align-self:start; }
  .nj-line .nj-cell-label{ display:none; }
  .nj-line-head.d-md-grid{ display:grid; }
}
.nj-line input[readonly]{ background-color:var(--bs-tertiary-bg); }
/* Just-added line: orange tint that fades out over 1s */
.nj-line.is-added{ animation:nj-added 1s ease-out; border-radius:.4rem; }
@keyframes nj-added{ 0%, 40%{ background:rgba(var(--tp-orange-rgb),.22); box-shadow:0 0 0 .4rem rgba(var(--tp-orange-rgb),.22); } 100%{ background:transparent; box-shadow:0 0 0 .4rem transparent; } }
/* A line just added in the line editor (public/js/line-editor.js): table rows have no box-shadow, so cells are tinted */
tr[data-line].is-added > td{ animation:line-added 1s ease-out; }
@keyframes line-added{ 0%, 40%{ background:rgba(var(--tp-orange-rgb),.22); } 100%{ background:transparent; } }
@media (prefers-reduced-motion: reduce){ .nj-line.is-added{ animation:none; background:rgba(var(--tp-orange-rgb),.18); } tr[data-line].is-added > td{ animation:none; background:rgba(var(--tp-orange-rgb),.18); } }
.nav-sm .nav-link{ padding:.3rem .75rem; font-size:.875rem; }
.nav-pills .nav-link.active{ background:var(--tp-teal); }
.nj-part-results{ position:absolute; left:0; right:0; top:100%; z-index:5; max-height:18rem; overflow-y:auto; }
.nj-quick-row{ cursor:pointer; min-height:44px; }
.nj-quick-row .form-check-input{ width:1.25rem; height:1.25rem; }

/* Booking slots */
.nj-slot-day{ display:grid; grid-template-columns:7rem 1fr; gap:.5rem; padding:.6rem 0; border-top:1px solid var(--tp-line); }
@media (max-width:575.98px){ .nj-slot-day{ grid-template-columns:1fr; } }
.nj-slot{ display:inline-flex; flex-direction:column; align-items:center; line-height:1.15; min-width:4.5rem; min-height:44px; justify-content:center;
  border:1px solid var(--tp-line); background:var(--tp-card); color:var(--tp-ink); }
.nj-slot:hover{ border-color:var(--tp-teal); color:var(--tp-ink); }
.nj-slot.active{ background:var(--tp-teal); border-color:var(--tp-teal); color:#fff; }
.nj-slot-bay{ font-size:.68rem; opacity:.8; }
.nj-dow{ min-width:2.25rem; }
.btn-outline-secondary.active[data-nj-slot-mode]{ background:var(--tp-teal); border-color:var(--tp-teal); color:#fff; }
/* The booking step's slots are radio buttons (jobs/bookings/_slots) */
.btn-check:checked + .nj-slot{ background:var(--tp-teal); border-color:var(--tp-teal); color:#fff; }
.btn-check:focus-visible + .nj-slot{ outline:2px solid var(--tp-teal); outline-offset:2px; }

/* Done */
.nj-done-icon{ width:72px; height:72px; border-radius:50%; margin:0 auto; display:flex; align-items:center; justify-content:center; font-size:2rem;
  background:rgba(var(--tp-teal-rgb),.12); color:var(--tp-accent-text); }
.nj-done-icon.is-provisional{ background:var(--bs-warning-bg-subtle); color:var(--bs-warning-text-emphasis); }
.nj-done-icon.is-declined{ background:var(--bs-danger-bg-subtle); color:var(--bs-danger-text-emphasis); }

/* In-modal confirm */
.nj-confirm{ position:absolute; inset:0; z-index:10; display:flex; align-items:center; justify-content:center; padding:1rem; background:rgba(0,0,0,.35); }
.nj-confirm.d-none{ display:none !important; }
.nj-confirm .card{ max-width:28rem; width:100%; }
.modal-body:has(.nj-confirm:not(.d-none)){ overflow:hidden; }

/* Customer picker (components/customers/customer-picker): a contact's / vehicle's Select button reads "Selected" once pressed */
[data-picker-select] .picker-select-on{ display:none; }
[data-picker-select][aria-pressed="true"] .picker-select-on{ display:inline; }
[data-picker-select][aria-pressed="true"] .picker-select-off{ display:none; }

/* Invoice form lines (invoicing/_form, _line): a table from tablet up. On a phone each line stacks into a card:
   name and description, then qty | unit price, VAT | nominal code, net | remove. Cells show their data-label heading. */
@media (min-width: 768px){
  .invoice-lines{ min-width:900px; }
}
@media (max-width: 767.98px){
  .invoice-lines thead{ display:none; }
  .invoice-lines, .invoice-lines tbody{ display:block; }
  .invoice-lines tr[data-line]{ display:grid; grid-template-columns:1fr 1fr; gap:.5rem .75rem; padding:.75rem 1rem; border-bottom:1px solid var(--bs-border-color); }
  .invoice-lines tr[data-line] > td{ display:block; padding:0 !important; border:0; min-width:0; }
  .invoice-lines td[data-label]::before{ content:attr(data-label); display:block; margin-bottom:.15rem; color:var(--bs-secondary-color); font-size:.75rem; font-weight:400; }
  .invoice-lines .invoice-line-name{ grid-column:1 / -1; }
  .invoice-lines .invoice-line-net{ text-align:left !important; align-self:center; font-size:1rem; }
  .invoice-lines .invoice-line-remove{ align-self:center; justify-self:end; }
}
