/* Exclusive Photography CRM
   Backdrop grey and true black (from the logo); actions are black, no colour accent.
   Bodoni for page titles only; Hanken Grotesk for everything a person works in. */

:root {
  --ink: #000;
  --text: #2e2a30;
  --muted: #6b6570;
  --paper: #f3f2f5;
  --surface: #fff;
  --line: #e2dfe6;
  --line-strong: #cfcad5;
  --accent: #000000;
  --accent-hover: #3a3a3a;
  --accent-soft: #ece8e1;
  --good: #1f6a4a;
  --good-soft: #e6f2ec;
  --warn: #8a5a00;
  --warn-soft: #fbf1dc;
  --bad: #a3242f;
  --bad-soft: #fbe9ea;
  --studio: #000000;               /* replaced per company in base.html */
  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
  --radius-lg: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 15px/1.5 var(--sans); font-feature-settings: "tnum" 1;
}
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { color: var(--ink); margin: 0; }
h1 { font: 500 34px/1.1 var(--display); letter-spacing: -0.01em; }
h2 { font: 600 17px/1.3 var(--sans); }
h3 { font: 600 15px/1.3 var(--sans); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.shell > div { min-width: 0; }  /* let wide tables scroll inside their box, not the page */
.sidebar {
  background: var(--surface); border-right: 1px solid var(--line);
  padding: 22px 16px; position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
}
.sidebar .logo img { width: 150px; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  color: var(--text); text-decoration: none; padding: 9px 12px; border-radius: var(--radius);
  font-weight: 500;
}
.nav a:hover { background: var(--paper); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.nav-count { display: inline-block; min-width: 1.5em; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--bad);
  color: #fff; font-size: 11px; font-weight: 600; line-height: 1.6; text-align: center; vertical-align: 1px; }
.nav-count[hidden] { display: none; }
.nav .group-label { color: var(--muted); font-size: 13px; padding: 16px 12px 4px; }
.sidebar .me { margin-top: auto; font-size: 13px; color: var(--muted); }
.sidebar .me strong { display: block; color: var(--text); font-weight: 600; }
.sidebar .me form { margin-top: 8px; }
.link-button { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.link-button:hover { color: var(--accent-hover); }

/* The studio bar: always says which company you are working in. */
.studio-bar {
  background: var(--surface); border-bottom: 1px solid var(--line);
  border-top: 6px solid var(--studio);
  padding: 14px 32px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
}
.studio-bar .studio-name { font: 500 26px/1 var(--display); color: var(--studio); }
.studio-bar .studio-role { color: var(--muted); font-size: 13px; }
.studio-bar form { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.studio-bar label { font-size: 13px; color: var(--muted); }

main { padding: 28px 32px 64px; max-width: 1180px; }
/* Working pages (diary, boards, reports) use the whole screen; forms stay a readable width. */
main.wide { max-width: none; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 6px; }

/* ---------- Flash & alerts ---------- */
.flash {
  background: var(--good-soft); color: var(--good); border-left: 3px solid var(--good);
  padding: 10px 14px; border-radius: var(--radius); margin-bottom: 18px;
}
.alert { padding: 12px 14px; border-radius: var(--radius); margin-bottom: 16px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-error { background: var(--bad-soft); color: var(--bad); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: 600 14px/1 var(--sans); padding: 10px 16px; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  text-decoration: none; cursor: pointer; min-height: 40px;
}
.btn:hover { border-color: var(--muted); color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); padding-inline: 8px; }
.btn-quiet:hover { background: var(--accent-soft); color: var(--accent-hover); }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); color: var(--bad); }

input:not([type]), input[type=text], input[type=email], input[type=password], input[type=search], input[type=tel],
input[type=number], select, textarea {
  font: 15px/1.4 var(--sans); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 9px 11px;
  width: 100%; min-height: 40px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.studio-bar select { width: auto; min-width: 170px; }

.form { max-width: 640px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* ---------- Panels, tables, lists ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.panel + .panel { margin-top: 18px; }
.grid-2 > .panel + .panel { margin-top: 0; }
.panel h2 { margin-bottom: 12px; }
.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line);
         border-radius: var(--radius-lg); background: var(--surface); margin-bottom: 22px; }
.stat { padding: 18px 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .value { font: 500 32px/1 var(--display); color: var(--ink); }
.stat .label { color: var(--muted); font-size: 13px; margin-top: 6px; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 10px 14px;
     border-bottom: 1px solid var(--line); background: #faf9fb; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tbody tr:hover { background: #fbfafc; }
td a.row-link { color: var(--ink); font-weight: 600; text-decoration: none; }
td a.row-link:hover { color: var(--accent); text-decoration: underline; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar form { display: flex; gap: 8px; flex: 1; min-width: 260px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: 14px; }
.tabs a:hover { color: var(--ink); background: var(--surface); }
.tabs a[aria-current="true"] { background: var(--ink); color: #fff; }

.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
       background: var(--paper); color: var(--muted); border: 1px solid var(--line); }
.tag-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag-red { background: #fde8e8; color: #b3261e; border-color: transparent; }
.tag-studio { color: #fff; border-color: transparent; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: baseline; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }

.note { padding: 12px 0; border-bottom: 1px solid var(--line); }
.note:last-child { border-bottom: 0; }
.note .meta { color: var(--muted); font-size: 13px; margin-bottom: 4px; }
.note .body { white-space: pre-wrap; }

.identity { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.identity:last-child { border-bottom: 0; }
.identity .value { flex: 1; font-weight: 600; color: var(--ink); }
.identity a.value { text-decoration: none; }

.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; margin-top: 14px; color: var(--muted); }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty .btn { margin-top: 12px; }

.secret-box { font: 600 20px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.06em;
  background: var(--paper); border: 1px dashed var(--line-strong); border-radius: var(--radius);
  padding: 14px 16px; color: var(--ink); word-break: break-all; }

.access-grid td, .access-grid th { vertical-align: middle; }
.access-grid select { min-width: 220px; }
.access-grid th { color: var(--ink); font-size: 15px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; margin: 6px 0; }
.perm-list { columns: 2; font-size: 14px; }

/* ---------- Leads ---------- */
.text-bad { color: var(--bad); }
.tag-ink { background: var(--ink); color: #fff; border-color: transparent; }
.tag-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag-cancelled { background: #fde7d3; color: #9a4a0b; border: 1px dashed #d9711c; }
.lead-card.is-rebook { border-left: 4px solid #d9711c; background: #fffaf5; }
.alert-rebook { background: #fff1e4; color: #7a3a07; border-left: 4px solid #d9711c; }
.tabs .count { font-size: 12px; opacity: .7; margin-left: 2px; }

/* The board scrolls sideways inside its own box; the page never does. */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: 262px; gap: 12px;
         overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x proximity; align-items: start; }
.board-col { background: #eceaef; border-radius: var(--radius-lg); padding: 10px; scroll-snap-align: start;
             display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.board-col header { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 4px 4px; }
.board-col h2 { font-size: 14px; margin: 0; }
.board-col .count { color: var(--muted); font-size: 13px; font-weight: 600; }
.col-empty { padding: 8px 4px; margin: 0; }
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.lead-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
             padding: 10px 12px; font-size: 13px; }
.lead-card.is-red { border-left: 4px solid #b3261e; }
.lead-name { display: block; font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; }
.lead-name:hover { text-decoration: underline; }
.lead-tags { display: flex; gap: 4px; flex-wrap: wrap; margin: 4px 0; }
.lead-tags:empty { display: none; }
.lead-phone { display: inline-block; font-weight: 600; font-size: 14px; margin: 2px 0 6px; }
.lead-facts, .facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 0; }
.lead-facts dt, .facts dt { color: var(--muted); }
.lead-facts dd, .facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts { font-size: 14px; gap: 6px 14px; }

.call-panel .call-head { margin-bottom: 14px; }
.call-number { font: 500 30px/1.2 var(--display); color: var(--ink); text-decoration: none; }
.call-number:hover { text-decoration: underline; }
.outcome-form > label { display: block; font-weight: 600; margin-bottom: 6px; }
.outcome-form textarea { min-height: 56px; }
.outcomes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.outcomes .btn { width: 100%; }
.outcome-with { display: flex; flex-direction: column; gap: 6px; }
.outcome-with input[type=datetime-local] { font: 14px var(--sans); padding: 8px; border: 1px solid var(--line-strong);
  border-radius: var(--radius); min-height: 40px; width: 100%; }
.touch { border-top: 1px solid var(--line); padding: 8px 0; }
.touch summary { color: var(--ink); font-weight: 500; }
.touch .facts { margin: 8px 0 4px; }
.review-flag { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input[type=text] { width: auto; min-width: 180px; flex: 1; }
.review-flag .inline-form { flex: 1; justify-content: flex-end; }

.switch-panel { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-left: 6px solid var(--muted); }
.switch-panel.is-on { border-left-color: var(--bad); }
.switch-panel .grow { flex: 1; min-width: 240px; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: grid; place-items: center;
                  padding: 16px; z-index: 20; }
.modal { position: static; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto;
         border: 0; border-radius: var(--radius-lg); padding: 22px; background: var(--surface); color: var(--text); }
.modal h2 { margin-bottom: 10px; }
.sms-option { border-top: 1px solid var(--line); padding: 12px 0; display: grid; gap: 6px; }
.sms-option .btn { justify-self: start; }

.due-popup { position: fixed; right: 16px; bottom: 16px; z-index: 30; width: min(360px, calc(100vw - 32px));
             background: var(--surface); border: 1px solid var(--line-strong); border-top: 4px solid var(--ink);
             border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); }
.due-popup[hidden] { display: none; }
.call-popup { bottom: auto; top: 16px; border-top-color: var(--good); }
.due-popup ul { margin: 6px 0 10px; padding-left: 18px; }
.due-popup .actions { display: flex; gap: 8px; }

/* ---------- Diary ---------- */
.diary-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.diary-legend i { display: inline-block; width: 12px; height: 12px; border: 1px solid; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.diary-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.diary { --pxmin: 0.9px; display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(130px, 1fr)); min-width: calc(52px + var(--cols) * 130px); }
.diary-times { padding-top: 34px; }
.diary-times div { height: calc(60 * var(--pxmin)); font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-6px); }
.diary-day { border-left: 1px solid var(--line); }
.diary-day.is-today .diary-day-head { color: var(--ink); background: var(--accent-soft); }
.diary-day-head { display: block; height: 34px; line-height: 34px; text-align: center; font-weight: 600; font-size: 13px; color: var(--muted);
                  text-decoration: none; border-bottom: 1px solid var(--line); }
.diary-slots { position: relative; height: calc(var(--span) * var(--pxmin)); }
.diary-hour { height: calc(60 * var(--pxmin)); border-bottom: 1px solid var(--line); }
.appt { position: absolute; border: 1px solid; border-left-width: 4px; border-radius: 5px; padding: 3px 6px;
        font-size: 12px; line-height: 1.25; color: #1f1b22; text-decoration: none; overflow: hidden; }
.appt:hover { box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 2; }
.appt-meta { display: block; color: #5a5360; font-size: 11px; }
.appt.is-no-show { text-decoration: line-through; opacity: .75; }
.appt.is-cancelled, .legend-cancelled { background: repeating-linear-gradient(135deg, #f4f2f6, #f4f2f6 6px, #e4e0e8 6px, #e4e0e8 12px);
  border-color: #8a8290; border-style: dashed; color: #5a5360; }
.diary-lanes { display: grid; grid-template-columns: repeat(var(--lanes), 1fr); font-size: 10px; color: var(--muted);
  text-align: center; border-bottom: 1px solid var(--line); height: 16px; line-height: 16px; }
.diary-times { padding-top: 50px; }
.calendar-toggles { display: flex; gap: 8px 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.cal-toggle { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; font-size: 14px; padding: 6px 10px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); cursor: pointer; }
.cal-toggle input { accent-color: var(--accent); }
@media (max-width: 860px) { .diary { --pxmin: 0.8px; } }

/* ---------- Reports ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; min-width: 0; }
.tile header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tile h2 { font-size: 15px; margin: 0; }
.tile-value { font: 500 34px/1.1 var(--display); color: var(--ink); margin: 8px 0 4px; }
.tile-rows { width: 100%; font-size: 13px; }
.tile-rows td { padding: 4px 0; border-bottom: 1px solid var(--line); }
.tile-rows tr:last-child td { border-bottom: 0; }
.tile-rows td.num { text-align: right; padding-left: 10px; color: var(--muted); }
.range-form input[type=date] { width: auto; min-height: 40px; padding: 8px; border: 1px solid var(--line-strong); border-radius: var(--radius); font: 14px var(--sans); }
.person-actions { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 2px; }
.person-actions .btn { min-height: 28px; padding: 4px 8px; }

/* ---------- Sign-in pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-public { align-content: center; gap: 14px; }
.back-site, .site-foot { width: 100%; max-width: 420px; margin: 0; font-size: 14px; color: var(--muted); }
.back-site a, .site-foot a { color: inherit; }
.site-foot { text-align: center; line-height: 1.8; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
             border-radius: var(--radius-lg); padding: 34px 32px; }
.auth-card .logo { width: 190px; display: block; margin-bottom: 26px; }
.auth-card h1 { font-size: 30px; margin-bottom: 8px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }
.auth-card .btn-primary { width: 100%; }
.qr { width: 200px; margin: 6px 0 14px; }
.qr svg { width: 100%; height: auto; display: block; }

/* ---------- Mobile ---------- */
.bottom-nav { display: none; }
.show-mobile { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .studio-bar { padding: 12px 16px; position: sticky; top: 0; z-index: 5; }
  .studio-bar .studio-name { font-size: 22px; }
  .studio-bar form { margin-left: 0; width: 100%; }
  .studio-bar select { flex: 1; }
  .studio-bar form label { display: none; }
  .toolbar form { min-width: 0; width: 100%; }
  .page-head .actions { margin-left: 0; }
  main { padding: 20px 16px 96px; }
  h1 { font-size: 28px; }
  .grid-2, .row, .row-3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .hide-mobile { display: none; }
  .show-mobile { display: block; margin-top: 4px; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; bottom: 0; left: 0; right: 0;
    background: var(--surface); border-top: 1px solid var(--line); z-index: 10;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bottom-nav a { text-align: center; padding: 12px 4px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 13px; }
  .bottom-nav a[aria-current="page"] { color: var(--accent); }
  .perm-list { columns: 1; }
  .outcomes { grid-template-columns: 1fr; }
  .board { grid-auto-columns: 82vw; }
  .due-popup { bottom: calc(64px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Diary: click an empty hour to book it; blocked-out time */
.slot-link { position: absolute; display: flex; align-items: center; justify-content: center; color: transparent;
  text-decoration: none; font-size: 12px; border-radius: 4px; }
.slot-link:hover, .slot-link:focus-visible { background: var(--soft, #f3f1ec); color: var(--muted, #666); outline: 1px dashed var(--line); }
.diary-block { position: absolute; border-radius: 5px; padding: 3px 6px; font-size: 12px; overflow: hidden; color: #555;
  border: 1px solid #bbb; background: repeating-linear-gradient(135deg, #eee 0 6px, #e2e2e2 6px 12px); z-index: 1; }
.diary-block .block-remove { display: inline; margin-left: 4px; }
.appt { z-index: 2; }
.slot-results { list-style: none; padding: 0; margin: 0; }
.slot-results li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }

/* Staff permissions: grouped Allow / Deny tables */
.perm-details summary { cursor: pointer; font-weight: 600; margin-top: 6px; }
.perm-table { width: 100%; margin: 10px 0 14px; border-collapse: collapse; font-size: 14px; }
.perm-table caption { text-align: left; font-weight: 700; padding: 6px 0; }
.perm-table th, .perm-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.perm-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.perm-table .center { text-align: center; }
.perm-table select { width: auto; min-width: 9em; }
.perm-table tr.is-allow td:first-child { box-shadow: inset 3px 0 0 #1f8a4c; }
.perm-table tr.is-deny td:first-child { box-shadow: inset 3px 0 0 #c0392b; }
.text-good { color: #1f8a4c; }
.card-field { padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); margin-bottom: 8px; }

/* Client timeline */
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.filter-chips button { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.filter-chips button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 10px 0 10px 14px; border-bottom: 1px solid var(--line); border-left: 3px solid var(--line); }
.timeline .tl-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.timeline .tl-body { white-space: pre-wrap; font-size: 14px; margin: 2px 0; }
.timeline .tl-call { border-left-color: #2f6fd6; }
.timeline .tl-message { border-left-color: #15847e; }
.timeline .tl-note { border-left-color: #b07a2a; }
.timeline .tl-appointment { border-left-color: #7a4bb7; }
.timeline .tl-money { border-left-color: #1f8a4c; }
.timeline .tl-enquiry { border-left-color: #d9711c; }
/* Online discovery-call booking */
.slot-grid { border: 0; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot-grid legend { font-weight: 700; margin-bottom: 8px; }
.slot { position: relative; }
.slot input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.slot span { display: block; text-align: center; padding: 8px 4px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.slot input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.slot input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.row-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 760px) { .row-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .row-4 { grid-template-columns: 1fr; } }

/* Diary: who's working that day (the 8am strip at the top of each day) */
.diary-team { display: flex; flex-wrap: wrap; gap: 2px 10px; padding: 6px 8px; font-size: 12px; line-height: 1.35;
  border-bottom: 1px solid var(--line); background: var(--accent-soft, #ece8e1); color: inherit; text-decoration: none; min-height: 30px; }
.diary-team:hover, .diary-team:focus-visible { outline: 1px dashed var(--line); }
.diary-team.is-empty { background: transparent; }
.team-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; }
.perm-bulk { font-weight: 400; margin-left: 10px; }

/* Printing a report: just the report */
@media print {
  .sidebar, .bottom-nav, .studio-bar, .actions, .no-print, .range-form, .filter-chips, .tabs, .flash, form { display: none !important; }
  .shell, main { display: block !important; margin: 0 !important; padding: 0 !important; }
  body { background: #fff !important; color: #000 !important; font-size: 11pt; }
  .panel, .tile { box-shadow: none !important; border: 1px solid #ccc !important; break-inside: avoid; }
  .tiles { grid-template-columns: repeat(2, 1fr) !important; }
  a { color: inherit !important; text-decoration: none !important; }
  .table-wrap { overflow: visible !important; }
  table { font-size: 9.5pt; }
}
.gift-total { font-size: 18px; margin: 4px 0 18px; }
.plan-preview { font-weight: 600; min-height: 1.4em; margin: 0 0 10px; }
.attention-panel { border-color: #d9711c; background: #fff7ef; }

/* Diary: hover (or tab onto) an appointment to read its notes */
.appt-has-notes { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; border: 1px solid currentColor; border-radius: 3px;
  padding: 0 3px; margin-left: 4px; opacity: .7; }
.appt-hover { display: none; position: absolute; left: 0; top: 100%; z-index: 20; width: 300px; max-width: 70vw; white-space: pre-line;
  background: #fff; color: #222; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.15);
  padding: 10px 12px; font-size: 12.5px; line-height: 1.45; font-weight: 400; }
.appt-hover-h { display: block; margin-top: 6px; font-weight: 700; font-size: 11.5px; color: #555; }
.appt:hover, .appt:focus-visible { z-index: 15; overflow: visible; }
.appt:hover .appt-hover, .appt:focus-visible .appt-hover { display: block; }
.appt.is-late .appt-hover { top: auto; bottom: 100%; }

/* Wide boards (Leads, Sales pipeline): a slider and arrows above, and a scrollbar that's always
   showing below (macOS hides scrollbars until you scroll, so the columns off to the right were
   easy to miss). */
.hscroll { display: flex; align-items: center; gap: 8px; margin: 0 0 10px;
           padding: 4px 0; }
.hscroll[hidden] { display: none; }
.hscroll input[type=range] { flex: 1; min-width: 0; accent-color: var(--accent); height: 22px; cursor: pointer; }
.hscroll .btn { min-width: 44px; padding-inline: 10px; }
.hscroll .hscroll-where { font-size: 12px; color: var(--muted); white-space: nowrap; }
.board, .pipe-board { scrollbar-width: auto; scrollbar-color: #8f879c #e4e1e8; }
.board::-webkit-scrollbar, .pipe-board::-webkit-scrollbar { height: 14px; }
.board::-webkit-scrollbar-track, .pipe-board::-webkit-scrollbar-track { background: #e4e1e8; border-radius: 7px; }
.board::-webkit-scrollbar-thumb, .pipe-board::-webkit-scrollbar-thumb { background: #8f879c; border-radius: 7px; border: 3px solid #e4e1e8; }
@media (max-width: 600px) { .hscroll .hscroll-where { display: none; } }

/* View as (owner or director, read-only) */
.view-as-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
               background: #fff4d6; border: 2px solid #d9a400; color: #4d3a00; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }

/* The "To book" panel beside the diary */
.diary-layout { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 12px; align-items: start; }
.diary-layout.panel-hidden, .diary-layout.no-panel { grid-template-columns: minmax(0, 1fr); }
.diary-layout.panel-hidden .to-book { display: none; }
.to-book { position: sticky; top: 12px; max-height: calc(100vh - 40px); overflow: auto; padding: 12px; }
.to-book-head { display: flex; justify-content: space-between; align-items: baseline; }
.to-book h2 { margin: 0; font-size: 17px; }
.to-book-group { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 6px; }
.to-book-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 8px; background: var(--surface); }
.to-book-name { font-weight: 600; color: var(--ink); }
.to-book-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.to-book-show { margin-bottom: 10px; }
@media (max-width: 900px) { .diary-layout { grid-template-columns: 1fr; } .to-book { position: static; max-height: none; } }

/* Ask Claude */
.ask-btn { position: fixed; right: 18px; bottom: 18px; z-index: 40; border: 0; border-radius: 999px; padding: 11px 18px;
           background: var(--ink); color: #fff; font: inherit; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.18); cursor: pointer; }
.ask-btn:hover { background: #333; }
.ask-panel { position: fixed; right: 18px; bottom: 72px; z-index: 41; width: min(420px, calc(100vw - 32px)); height: min(600px, calc(100vh - 110px));
             display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
             box-shadow: 0 12px 40px rgba(0,0,0,.18); overflow: hidden; }
.ask-panel[hidden] { display: none; }
.ask-panel header { display: flex; align-items: baseline; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.ask-panel header .muted { flex: 1; }
.ask-close { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--muted); }
.ask-log { flex: 1; overflow: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.ask-msg { padding: 9px 12px; border-radius: 10px; max-width: 92%; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ask-msg.bot { background: var(--paper); align-self: flex-start; }
.ask-msg.user { background: var(--ink); color: #fff; align-self: flex-end; white-space: pre-wrap; }
.ask-msg ul { margin: 4px 0; padding-left: 18px; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: flex-end; }
.ask-form textarea { flex: 1; resize: none; font: inherit; font-size: 14px; }
@media (max-width: 760px) { .ask-btn { bottom: 76px; right: 12px; padding: 9px 14px; } .ask-panel { bottom: 124px; right: 12px; } }
.chip { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--accent-soft); }
.testing-bar { background: #fff4d6; border-color: #e7c35a; }
/* The day's diary beside the booking form (Paul, 28 Sep 2026) */
.book-with-day { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(460px, 1.15fr); gap: 16px; align-items: start; }
.day-panel { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; }
.day-panel-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.day-hours { list-style: none; margin: 0; padding: 0; }
.day-hour { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.day-hour-time { color: var(--muted); font-size: 13px; }
.day-item { display: block; border: 1px solid; border-left-width: 4px; border-radius: 5px; padding: 3px 6px; margin-bottom: 4px;
  font-size: 13px; text-decoration: none; color: var(--ink); }
.day-blocked { background: var(--paper); border-color: var(--line); color: var(--muted); }
.day-free { background: none; border: 1px dashed var(--line); border-radius: 5px; padding: 3px 6px; font-size: 13px; color: var(--muted);
  width: 100%; text-align: left; cursor: pointer; }
.day-free:hover { border-color: var(--ink); color: var(--ink); }
@media (max-width: 1100px) { .book-with-day { grid-template-columns: 1fr; } .day-panel { position: static; max-height: none; } }
.day-panel-head { flex-wrap: wrap; gap: 8px; }
.day-panel-nav, .day-panel-views { display: flex; align-items: center; gap: 6px; }
.day-panel-nav strong { min-width: 190px; text-align: center; }
.day-panel-views .is-on { background: var(--ink); color: var(--surface); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week-day { border: 1px solid var(--line); border-radius: 6px; padding: 4px; min-height: 120px; }
.week-day.is-today { border-color: var(--ink); }
.week-day-head { display: block; width: 100%; background: none; border: 0; font-weight: 600; text-align: left; padding: 2px 2px 6px; cursor: pointer; }
.week-day .day-item { font-size: 12px; }

/* Ask Claude: talk, read aloud, confirm cards (2 Oct 2026) */
.ask-tools { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 6px; }
.ask-tools label { margin-right: auto; display: flex; gap: 4px; align-items: center; }
#ask-mic[aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad); }
.ask-card { border: 1px solid var(--line-strong); }
.ask-card-text { white-space: pre-wrap; margin: 6px 0; }
.ask-card-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ask-form { flex-direction: column; align-items: stretch; }
