:root {
  --acp-ink: #1a1a1a;
  --acp-muted: #6b7280;
  --acp-border: #e5e7eb;
  --acp-bg: #f7f7f8;
  --acp-primary: #2563eb;
  --acp-primary-dark: #1d4ed8;
  --acp-danger: #b3261e;
  --acp-sidebar: #111827;
  --acp-sidebar-text: #d1d5db;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--acp-ink);
  background: var(--acp-bg);
}
a { color: var(--acp-primary); }

.acp-shell { display: flex; min-height: 100vh; }
.acp-sidebar {
  width: 220px;
  flex-shrink: 0;
  /* Stays in view and scrolls on its own, so a long menu no longer makes every page scroll past its content. */
  position: sticky; top: 0; height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--acp-sidebar);
  color: var(--acp-sidebar-text);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
}
.acp-sidebar .brand { color: #fff; font-weight: 700; font-size: 16px; margin-bottom: 24px; padding: 0 8px; }
.acp-sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.acp-sidebar a {
  color: var(--acp-sidebar-text);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 14px;
}
.acp-sidebar a:hover { background: rgba(255,255,255,.08); color: #fff; }
.acp-sidebar a.active { background: var(--acp-primary); color: #fff; }
.acp-sidebar button.logout {
  background: none; border: 1px solid rgba(255,255,255,.25); color: var(--acp-sidebar-text);
  padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.acp-sidebar button.logout:hover { background: rgba(255,255,255,.08); color: #fff; }

/* The content column. Wide by default so tables and dashboards use the screen; pages that are a single narrow form add
   "acp-main-narrow" (see the main_class block in base.html). */
.acp-main { flex: 1; min-width: 0; padding: 24px 32px 40px; max-width: 1360px; }
.acp-main.acp-main-narrow { max-width: 960px; }
.acp-main h1 { margin-top: 0; font-size: 22px; }
.acp-main h2 { font-size: 16px; color: var(--acp-muted); font-weight: 600; margin: 22px 0 8px; }

.acp-card {
  background: #fff; border: 1px solid var(--acp-border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 14px;
}
.acp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.acp-stat .value { font-size: 26px; font-weight: 700; }
.acp-stat .label { font-size: 12px; color: var(--acp-muted); text-transform: uppercase; letter-spacing: .03em; }

table.acp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.acp-table th { text-align: left; font-size: 12px; color: var(--acp-muted); text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--acp-border); }
table.acp-table td { padding: 8px; border-bottom: 1px solid var(--acp-border); vertical-align: top; }
table.acp-table tr:last-child td { border-bottom: none; }

.acp-form label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
.acp-form input[type=text], .acp-form input[type=email], .acp-form input[type=tel], .acp-form input[type=password],
.acp-form input[type=url], .acp-form input[type=number], .acp-form input[type=date], .acp-form input[type=search], .acp-form textarea, .acp-form select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--acp-border); border-radius: 6px; font-size: 14px; font-family: inherit;
}
.acp-form textarea { min-height: 70px; resize: vertical; }
.acp-form .row { display: flex; gap: 12px; }
.acp-form .row > * { flex: 1; }

.acp-btn {
  background: var(--acp-primary); color: #fff; border: none; border-radius: 6px;
  padding: 8px 16px; font-size: 14px; cursor: pointer;
  display: inline-block; text-decoration: none;
}
.acp-btn:hover { background: var(--acp-primary-dark); text-decoration: none; }
.acp-btn:disabled { opacity: .5; cursor: default; }
.acp-btn.secondary { background: #fff; color: var(--acp-ink); border: 1px solid var(--acp-border); }
.acp-btn.danger { background: #fff; color: var(--acp-danger); border: 1px solid #f0c9c6; }
.acp-btn.danger:hover { background: #fdecea; }
.acp-btn.small { padding: 4px 10px; font-size: 12px; }

.acp-error { color: var(--acp-danger); font-size: 13px; margin-top: 8px; }
.acp-empty { color: var(--acp-muted); font-size: 14px; padding: 10px 0; }
.acp-badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #eef2ff; color: var(--acp-primary); }
.acp-badge.inactive { background: #f3f4f6; color: var(--acp-muted); }
.acp-badge.success { background: #e9f9ee; color: #0a7a3c; }
.acp-badge.warn { background: #fff4e5; color: #92610f; }
.acp-key { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-size: 13px; }

/* Sidebar organization context + grouped navigation */
.acp-sidebar .org { padding: 8px; margin-bottom: 16px; border-radius: 6px; background: rgba(255,255,255,.06); }
.acp-sidebar .org-label { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .7; }
.acp-sidebar .org-name { color: #fff; font-weight: 600; margin-top: 2px; }
.acp-sidebar .org-switch { width: 100%; margin-top: 4px; }
.acp-sidebar .org-role { font-size: 12px; opacity: .7; margin-top: 2px; }
.acp-sidebar .nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .6; margin: 16px 8px 4px; }

/* Booking UI */
[x-cloak] { display: none !important; }
.acp-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #e5e7eb; color: #374151; }
.acp-badge.confirmed { background: #dcfce7; color: #166534; }
.acp-badge.rescheduled { background: #ede9fe; color: #5b21b6; }
.acp-badge.pending { background: #fef3c7; color: #92400e; }
.acp-badge.completed { background: #dbeafe; color: #1e40af; }
.acp-badge.cancelled { background: #f3f4f6; color: #6b7280; text-decoration: line-through; }
.acp-badge.no_show { background: #fee2e2; color: #991b1b; }
.acp-modal-backdrop { position: fixed; inset: 0; background: rgba(17,24,39,.5); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; z-index: 50; }
.acp-modal { position: relative; background: #fff; border-radius: 10px; width: 100%; max-width: 560px; padding: 22px 24px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.acp-modal-close { position: absolute; top: 8px; right: 12px; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--acp-muted); }
.acp-dl { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; margin: 0; }
.acp-dl dt { color: var(--acp-muted); font-size: 13px; }
.acp-dl dd { margin: 0; }
.acp-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.acp-subpanel { margin-top: 12px; padding: 12px; border: 1px solid var(--acp-border); border-radius: 8px; background: #f9fafb; }
.acp-history { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.acp-history li { padding: 4px 0; border-bottom: 1px solid var(--acp-border); }
.acp-chip { border: 1px solid var(--acp-border); background: #fff; border-radius: 6px; padding: 4px 10px; margin: 0 6px 6px 0; cursor: pointer; font-size: 13px; }
.acp-chip.on { background: var(--acp-primary); color: #fff; border-color: var(--acp-primary); }
.acp-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.acp-kpi { background: #fff; border: 1px solid var(--acp-border); border-radius: 8px; padding: 14px; }
.acp-kpi .value { font-size: 26px; font-weight: 700; }
.acp-kpi .label { color: var(--acp-muted); font-size: 12px; text-transform: uppercase; }
.acp-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.acp-toolbar select, .acp-toolbar input { padding: 6px 8px; border: 1px solid var(--acp-border); border-radius: 6px; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f9fafb; }

/* Calendar */

/* ---- small screens ---------------------------------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acp-topbar { display: none; }

@media (max-width: 860px) {
  .acp-shell { flex-direction: column; }
  .acp-topbar {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--acp-sidebar); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 20;
  }
  .acp-topbar .brand { font-weight: 700; font-size: 16px; }
  .acp-menu-btn { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 6px; font-size: 20px; line-height: 1; padding: 6px 12px; cursor: pointer; }
  .acp-sidebar { display: none; width: 100%; padding: 12px 14px 16px; }
  .acp-sidebar .brand { display: none; }
  body.nav-open .acp-sidebar { display: flex; }
  .acp-sidebar a { padding: 12px 10px; }
  .acp-main { padding: 16px; max-width: none; width: 100%; }
  .acp-form .row { flex-direction: column; gap: 0; }
  .acp-card { padding: 14px; }
  .acp-btn, .acp-form input, .acp-form select { min-height: 40px; }
  table { max-width: 100%; }
  table.acp-table, .acp-main table:not(.acp-table) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Tables marked "stack" become one card per row, each cell labelled by its column (data-label). */
  table.acp-table.stack { overflow: visible; }
  table.acp-table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.acp-table.stack tbody, table.acp-table.stack tr, table.acp-table.stack td { display: block; width: 100%; }
  table.acp-table.stack tr { border: 1px solid var(--acp-border); border-radius: 8px; padding: 6px 10px; margin-bottom: 10px; background: #fff; }
  table.acp-table.stack td { display: flex; justify-content: space-between; gap: 12px; border: none; padding: 5px 0; text-align: right; }
  table.acp-table.stack td::before { content: attr(data-label); color: var(--acp-muted); font-size: 12px; text-transform: uppercase; text-align: left; flex-shrink: 0; }
  .acp-kpis { grid-template-columns: repeat(2, 1fr); }
  .acp-history li { word-break: break-word; }
}

/* ---- dashboard: sections flow in two columns on a wide screen -------------------------------------------------- */
@media (min-width: 1180px) {
  .acp-main.acp-dash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; align-content: start; }
  .acp-main.acp-dash > :not(.dash-sec) { grid-column: 1 / -1; }  /* headings, alerts and the KPI row span both columns */
  .acp-main.acp-dash .dash-sec { min-width: 0; }
  .acp-main.acp-dash .dash-sec > h2:first-child { margin-top: 6px; }
}
/* ---- the sidebar must not be sticky on a phone, where it becomes the menu ---------------------------------------- */
@media (max-width: 860px) {
  .acp-sidebar { position: static; height: auto; overflow: visible; }
  .acp-main, .acp-main.acp-main-narrow { max-width: none; }
}

/* ---- forms keep a readable width even on a wide page ---------------------------------------------------------------- */
.acp-main .acp-form { max-width: 880px; }
.acp-main .acp-form.acp-form-wide, #finance-form .acp-form, #finance-settings .acp-form { max-width: none; }
#finance-settings .acp-form .acp-card { max-width: 880px; }
/* a card that is just a form is as narrow as the form, so there is no empty strip inside it */
.acp-main .acp-card:has(> form.acp-form), .acp-main .acp-card:has(> .acp-form) { max-width: 880px; }

/* ---- sidebar spacing groups and breadcrumbs ----------------------------------------------------------------------------- */
.acp-sidebar .nav-gap { height: 14px; }
.acp-sidebar a[aria-current="page"] { font-weight: 600; }
.acp-crumbs { margin: -4px 0 8px; font-size: 13px; }
.acp-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; color: var(--acp-muted); }
.acp-crumbs li + li::before { content: "›"; margin-right: 4px; color: #9ca3af; }
.acp-crumbs a { text-decoration: none; }
.acp-crumbs a:hover { text-decoration: underline; }
.acp-crumbs [aria-current="page"] { color: var(--acp-ink); font-weight: 600; }

/* ---- settings landing and hub cards -------------------------------------------------------------------------------------- */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 12px; }
.set-grid > .set-card { margin: 0; display: flex; flex-direction: column; }
.set-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-head h2 { margin: 0; font-size: 16px; color: var(--acp-ink); }
.set-n { width: 22px; height: 22px; border-radius: 999px; background: #eef2ff; color: var(--acp-primary); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.set-desc { color: var(--acp-muted); font-size: 13px; margin: 8px 0; flex: 1; }
.set-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.set-card.locked { background: #f9fafb; border-style: dashed; }
.set-locked { font-size: 13px; color: var(--acp-muted); margin: 0; }

/* ---- home dashboard ------------------------------------------------------------------------------------------------------- */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 4px 0 6px; }
.dash-kpi { display: flex; flex-direction: column; gap: 2px; background: #fff; border: 1px solid var(--acp-border); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--acp-ink); }
.dash-kpi:hover { border-color: #c7d2fe; box-shadow: 0 1px 4px rgba(37, 99, 235, .12); }
.dash-kpi:focus-visible { outline: 2px solid var(--acp-primary); outline-offset: 2px; }
.dash-kpi .v { font-size: 26px; font-weight: 700; line-height: 1.2; }
.dash-kpi .l { font-size: 13px; color: var(--acp-muted); }
.dash-kpi .s { font-size: 12px; color: var(--acp-muted); min-height: 16px; }
.dash-kpi .s.bad, .dash-list .dot.bad { color: #b3261e; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li + li { border-top: 1px solid var(--acp-border); }
.dash-list a { display: flex; align-items: center; gap: 12px; padding: 9px 2px; color: inherit; text-decoration: none; }
.dash-list a:hover { background: #f9fafb; }
.dash-list .t { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 48px; }
.dash-list .who { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.dash-list .who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.dash-list .sub { font-size: 12px; color: var(--acp-muted); }
.dash-list .dot { width: 9px; height: 9px; border-radius: 999px; background: #d97706; flex-shrink: 0; }
.dash-list .dot.bad { background: #b3261e; }

/* ---- tabs and small menus ------------------------------------------------------------------------------------------------- */
.acp-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--acp-border); margin: 14px 0 4px; overflow-x: auto; }
.acp-tabs button, .acp-tabs a { text-decoration: none; background: none; border: 0; border-bottom: 2px solid transparent; padding: 9px 14px; font: inherit; font-size: 14px; color: var(--acp-muted); cursor: pointer; white-space: nowrap; }
.acp-tabs button:hover, .acp-tabs a:hover { color: var(--acp-ink); }
.acp-tabs button.on, .acp-tabs a.on { color: var(--acp-primary); border-bottom-color: var(--acp-primary); font-weight: 600; }
.acp-tabs button:focus-visible, .acp-tabs a:focus-visible { outline: 2px solid var(--acp-primary); outline-offset: -2px; }
.acp-menu { position: relative; }
.acp-menu-list { position: absolute; right: 0; top: calc(100% + 4px); min-width: 220px; background: #fff; border: 1px solid var(--acp-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); padding: 4px; z-index: 30; }
.acp-menu-list button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; font: inherit; font-size: 14px; border-radius: 6px; cursor: pointer; }
.acp-menu-list button:hover, .acp-menu-list button:focus-visible { background: #f3f4f6; outline: none; }

.dash-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 4px; }

.acp-sidebar nav a, .acp-sidebar button.logout { display: flex; align-items: center; gap: 10px; }
.acp-sidebar nav a svg, .acp-sidebar button.logout svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.acp-sidebar nav a.active svg { opacity: 1; }
.acp-sidebar button.logout { justify-content: center; }

/* New / edit quote or invoice */
.fin-back { margin: 0 0 10px; } .fin-back a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; } .fin-back svg { width: 16px; height: 16px; }
.fin-sub { color: var(--acp-muted); margin: 0 0 18px; }
.fin-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.acp-main .fin-card-head h2 { margin: 0; font-size: 16px; color: var(--acp-ink); } .fin-card-head p { margin: 1px 0 0; font-size: 13px; color: var(--acp-muted); }
.fin-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e0ecff; color: #1d4ed8; flex: none; }
.fin-ico svg { width: 20px; height: 20px; }
.fin-cust { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 20px; align-items: center; }
.fin-cust .fin-card-head { margin: 0; }
.fin-search { position: relative; } .fin-search input { padding-right: 38px; margin: 0; }
.fin-search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--acp-muted); pointer-events: none; }
.fin-lines-card { padding: 0; } .fin-lines-card .fin-card-head { padding: 18px 20px 4px; }
.fin-lines { padding: 0 20px 8px; }
.fin-line { display: grid; grid-template-columns: minmax(0, 3fr) 90px 130px 110px 36px; gap: 10px; align-items: center; padding: 6px 0; }
.fin-line input, .fin-line select { margin: 0; width: 100%; }
.fin-line-head { font-weight: 600; font-size: 13px; background: #f9fafb; border-radius: 6px; padding: 8px 10px; margin: 8px 0 4px; }
.fin-desc { display: grid; grid-template-columns: minmax(130px, 1fr) minmax(0, 2fr); gap: 8px; }
.fin-line-total { font-variant-numeric: tabular-nums; }
.fin-icon-btn { background: none; border: 0; cursor: pointer; color: var(--acp-muted); padding: 6px; border-radius: 6px; } .fin-icon-btn:hover { background: #f3f4f6; color: #b3261e; }
.fin-icon-btn svg { width: 18px; height: 18px; display: block; }
.fin-foot { display: grid; grid-template-columns: 1fr minmax(240px, 320px); border-top: 1px solid var(--acp-border); }
.fin-foot-controls { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 14px; padding: 16px 20px; align-content: start; }
.fin-foot-totals { background: #f3f4f6; padding: 16px 20px; display: grid; gap: 8px; align-content: start; border-radius: 0 0 var(--acp-radius, 8px) 0; }
.fin-foot-totals > div { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }
.fin-total { border-top: 1px solid var(--acp-border); padding-top: 10px; font-weight: 700; font-size: 18px; } .fin-total span:last-child { color: #1d4ed8; }
.fin-actions { display: flex; gap: 10px; justify-content: flex-end; margin: 4px 0 10px; }
.fin-actions .acp-btn { display: inline-flex; align-items: center; gap: 8px; } .fin-actions svg { width: 16px; height: 16px; }
@media (max-width: 800px) {
  .fin-cust, .fin-foot { grid-template-columns: 1fr; }
  .fin-foot-controls { grid-template-columns: 1fr; }
  .fin-line-head { display: none; }
  .fin-line { grid-template-columns: 1fr 1fr auto auto; align-items: center; border-bottom: 1px solid var(--acp-border); padding: 10px 0; }
  .fin-desc { grid-column: 1 / -1; grid-template-columns: 1fr; }
  .fin-line-total { text-align: right; min-width: 64px; }
  .fin-actions { justify-content: stretch; } .fin-actions .acp-btn { flex: 1; justify-content: center; }
}

/* Light client sidebar (the admin portal keeps its own dark one) */
.acp-sidebar.acp-light { background: linear-gradient(180deg, #fff 0%, #f8fafc 100%); color: #1f2937; border-right: 1px solid var(--acp-border); padding: 22px 14px 16px; }
.acp-light .brand { display: flex; align-items: center; gap: 8px; color: #0f172a; font-size: 17px; margin-bottom: 20px; }
.acp-light .brand-mark { width: 26px; height: 26px; flex: none; }
.acp-light .org { position: relative; background: #fff; border: 1px solid var(--acp-border); padding: 10px 12px; margin-bottom: 18px; border-radius: 10px; }
.acp-light .org-label { font-size: 10px; letter-spacing: .06em; color: #64748b; opacity: 1; }
.acp-light .org-name { color: #0f172a; font-size: 15px; font-weight: 700; margin-top: 2px; }
/* A long organisation name (a whole web address, say) is cut with an ellipsis instead of spilling out of its card; the full name is in the tooltip. */
.acp-sidebar .org { min-width: 0; overflow: hidden; flex-shrink: 0; }
.acp-sidebar .org-name, .acp-sidebar .org-switch { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acp-light .org-switch { padding-right: 22px; }
.acp-light .org-name.long { font-size: 13px; }
.acp-light .org-role { color: #64748b; opacity: 1; }
.acp-light .org-switch { background: transparent; border: 0; padding: 2px 18px 2px 0; margin: 2px 0 0; width: 100%; font: inherit; font-weight: 700; font-size: 15px; color: #0f172a; appearance: none; -webkit-appearance: none; cursor: pointer; }
.acp-light .org-chev { position: absolute; right: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: #64748b; pointer-events: none; }
.acp-light nav { gap: 4px; }
.acp-light nav a { color: #1f2937; font-weight: 500; font-size: 15px; padding: 10px 12px; border-radius: 8px; gap: 12px; }
.acp-light nav a svg { width: 20px; height: 20px; opacity: 1; color: #374151; }
.acp-light nav a:hover { background: #f1f5f9; color: #0f172a; }
.acp-light nav a.active, .acp-light nav a.active:hover { background: var(--acp-primary); color: #fff; }
.acp-light nav a.active svg { color: #fff; }
.acp-light .nav-gap { height: 1px; background: var(--acp-border); margin: 10px 4px; }
.acp-sidebar.acp-light button.logout { margin-top: 12px; border: 0; background: none; color: #475569; font-size: 14px; padding: 10px 12px; justify-content: flex-start; border-radius: 8px; }
.acp-sidebar.acp-light button.logout:hover { background: #f1f5f9; color: #0f172a; }
.acp-sidebar.acp-light button.logout svg { width: 20px; height: 20px; color: #374151; opacity: 1; }

/* "View as client" banner: always visible above the portal while an admin is looking at a client read-only */
.acp-viewas { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fef3c7; color: #78350f; border-bottom: 1px solid #fcd34d; padding: 8px 16px; font-size: 14px; }
.acp-viewas form { margin: 0; }
@media (min-width: 861px) { .acp-viewas ~ .acp-shell .acp-sidebar { top: 40px; height: calc(100vh - 40px); } }

/* Customers list and add form */
.req { color: var(--acp-danger, #b3261e); font-weight: 700; }
.acp-field-error { color: var(--acp-danger, #b3261e); font-size: 13px; margin: 4px 0; }
.acp-form input[aria-invalid="true"] { border-color: var(--acp-danger, #b3261e); }
.acp-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.acp-tag { font-size: 11px; background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 1px 8px; }
.cust-note { max-width: 260px; font-size: 13px; }

/* Customer record: the at-a-glance hub */
.hub { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.hub-card { background: #fff; border: 1px solid var(--acp-border); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.acp-main .hub-card h3 { margin: 0; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--acp-muted); font-weight: 600; }
.hub-fig { font-size: 26px; font-weight: 700; margin: 4px 0 0; }
.hub-sub { margin: 2px 0 8px; font-size: 13px; color: var(--acp-muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hub-sub.bad { color: var(--acp-danger, #b3261e); font-weight: 600; }
.hub-links { margin: 0; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }

/* Dashboard: "Get started" checklist */
.onb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.onb-sub { margin: 2px 0 0; color: var(--acp-muted); font-size: 13px; }
.onb-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.onb-steps li { display: flex; gap: 12px; align-items: flex-start; }
.onb-steps .tick { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; box-sizing: border-box; margin-top: 3px; }
.onb-steps li.done .tick { background: #16a34a; border-color: #16a34a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E"); background-size: 12px; background-position: center; background-repeat: no-repeat; }
.onb-steps li.done .onb-body { color: var(--acp-muted); }
.onb-text { color: var(--acp-muted); font-size: 13px; margin-right: 6px; }
.onb-body .acp-btn { margin-left: 4px; }
.onb-done { font-size: 12px; color: #166534; font-weight: 600; }

/* Cmd+K search */
.cmdk-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin: 0 0 14px; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--acp-border); background: #fff; color: #475569; font: inherit; font-size: 14px; cursor: pointer; text-align: left; }
.cmdk-btn:hover { background: #f1f5f9; color: #0f172a; }
.cmdk-btn svg { width: 18px; height: 18px; flex: none; }
.cmdk-btn span { flex: 1; }
.cmdk-btn kbd, .cmdk-input kbd { font: inherit; font-size: 11px; padding: 2px 6px; border-radius: 5px; border: 1px solid #cbd5e1; color: #64748b; background: transparent; }
.cmdk-topbtns { display: flex; align-items: center; gap: 8px; }
.cmdk-topsearch { display: none; background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 6px; padding: 6px 9px; cursor: pointer; }
.cmdk-topsearch svg { width: 20px; height: 20px; display: block; }
.cmdk-bg { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.cmdk { width: min(640px, calc(100vw - 24px)); background: #fff; border-radius: 12px; box-shadow: 0 20px 50px rgba(15,23,42,.35); overflow: hidden; }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--acp-border); }
.cmdk-input svg { width: 20px; height: 20px; color: #64748b; flex: none; }
.cmdk-input input { flex: 1; border: 0; outline: 0; font-size: 16px; padding: 6px 0; background: transparent; min-height: 0; }
.cmdk-body { max-height: 56vh; overflow-y: auto; padding: 6px 0 10px; }
.cmdk-hint { margin: 0; padding: 14px 18px; color: #64748b; font-size: 14px; }
.cmdk-group { padding: 10px 18px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.cmdk-item { display: flex; flex-direction: column; gap: 1px; padding: 8px 18px; text-decoration: none; color: #0f172a; border-left: 3px solid transparent; }
.cmdk-item .t { font-size: 15px; } .cmdk-item .s { font-size: 12.5px; color: #64748b; }
.cmdk-item.on { background: #eff6ff; border-left-color: var(--acp-primary); }
@media screen and (max-width: 860px) { .cmdk-topsearch { display: block; } .acp-sidebar .cmdk-btn { padding: 12px; } }  /* spelled differently on purpose: tests look for the shell's own last 860px block */

/* Review and send */
.send-review { border: 2px solid var(--acp-primary); border-radius: 10px; padding: 16px 18px; margin-top: 14px; background: #f8fbff; }
.acp-main .send-review h2 { margin: 0 0 8px; color: var(--acp-ink); font-size: 17px; outline: none; }
.send-warnings { margin: 0 0 10px; padding: 8px 12px 8px 28px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; color: #78350f; font-size: 13px; }
.send-note { margin: 0 0 12px; font-size: 13px; color: var(--acp-muted); }
.row-next { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; }

/* Logo preview (finance settings) */
.logo-box { display: inline-block; padding: 8px; border: 1px solid var(--acp-border); border-radius: 8px; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 14px 14px; line-height: 0; }
.logo-box img { display: block; }
.logo-missing { margin: 4px 0 6px; padding: 10px 12px; border: 1px solid #fcd34d; background: #fffbeb; color: #78350f; border-radius: 8px; font-size: 14px; }
.logo-pending { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 10px 0; padding: 12px; border: 2px solid var(--acp-primary); border-radius: 10px; background: #f8fbff; }
