:root {
  --navy-950: #091327;
  --navy-900: #101c35;
  --navy-800: #172642;
  --navy-700: #243758;
  --gold-500: #e6b94b;
  --gold-400: #f2cf70;
  --teal-500: #2ec4b6;
  --pink-500: #ef6aa6;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eef2f8;
  --text: #172033;
  --muted: #6a768b;
  --border: #dfe5ef;
  --danger: #b42318;
  --danger-soft: #fff1ef;
  --success: #067647;
  --success-soft: #ecfdf3;
  --shadow: 0 16px 42px rgba(13, 29, 58, 0.08);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--surface-2); color: var(--text); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 26px 20px; background: radial-gradient(circle at 0 0, #223a67 0, var(--navy-950) 42%, #07101f 100%); color: #fff; }
.brand-block { display: flex; align-items: center; gap: 12px; padding: 4px 6px 24px; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: linear-gradient(145deg, var(--gold-400), var(--gold-500)); color: var(--navy-950); font-weight: 900; letter-spacing: -.03em; box-shadow: 0 8px 24px rgba(230, 185, 75, .28); }
.brand-mark.large { width: 56px; height: 56px; border-radius: 18px; font-size: 1.1rem; }
.brand-name { font-weight: 800; font-size: .98rem; }
.brand-subtitle { color: #aebbd0; font-size: .78rem; margin-top: 2px; }
.nav-list { display: grid; gap: 8px; margin-top: 14px; }
.nav-link { min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 13px; color: #c5d0e2; text-decoration: none; font-weight: 650; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: linear-gradient(90deg, rgba(230,185,75,.20), rgba(230,185,75,.06)); color: #fff; box-shadow: inset 3px 0 0 var(--gold-500); }
.nav-link.disabled { opacity: .58; cursor: default; }
.nav-icon { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; font-size: .77rem; font-weight: 900; }
.soon { margin-left: auto; font-size: .64rem; padding: 4px 7px; border-radius: 99px; background: rgba(255,255,255,.07); color: #b9c6db; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.08); padding-top: 18px; }
.security-note { display: flex; align-items: center; gap: 8px; color: #aebbd0; font-size: .75rem; margin-bottom: 14px; }
.security-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.10); }
.user-chip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.user-avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.09); font-weight: 800; }
.user-meta { display: grid; gap: 1px; min-width: 0; }
.user-meta strong { font-size: .86rem; }
.user-meta span { font-size: .72rem; color: #9dacbf; }
.text-button { padding: 0; border: 0; background: none; color: #9dacbf; cursor: pointer; font-size: .76rem; }
.text-button:hover { color: #fff; }


/* V7.6.1 Grouped + collapsible primary navigation ----------------------- */
.app-shell {
  --sidebar-width: 270px;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
}
.app-shell.sidebar-collapsed { --sidebar-width: 84px; }
.sidebar {
  min-width: 0;
  transition: padding .18s ease;
}
.sidebar-collapse-toggle {
  position: absolute;
  top: 28px;
  right: -14px;
  z-index: 8;
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: #142441;
  color: #dce5f3;
  box-shadow: 0 7px 18px rgba(4, 10, 22, .24);
  cursor: pointer;
  transition: background .14s ease, transform .14s ease;
}
.sidebar-collapse-toggle:hover { background: #20385e; color: #fff; transform: scale(1.04); }
.sidebar-collapse-toggle:focus-visible,
.nav-group-summary:focus-visible,
.nav-link:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 2px; }
.sidebar-toggle-icon { font-size: 1.15rem; line-height: 1; transform: translateY(-1px); }
.nav-list {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  align-content: start;
  padding: 2px 4px 8px 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
}
.nav-list::-webkit-scrollbar { width: 6px; }
.nav-list::-webkit-scrollbar-track { background: transparent; }
.nav-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 99px; }
.nav-group { min-width: 0; }
.nav-group > summary { list-style: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::marker { content: ""; }
.nav-group-summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 13px;
  color: #b8c5d9;
  font-weight: 780;
  cursor: pointer;
  user-select: none;
  transition: background .14s ease, color .14s ease;
}
.nav-group-summary:hover { background: rgba(255,255,255,.055); color: #fff; }
.nav-group.active > .nav-group-summary { color: #fff; background: rgba(255,255,255,.045); }
.nav-group-label { min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-group-chevron {
  margin-left: auto;
  color: #8797b0;
  font-size: 1rem;
  transition: transform .16s ease, color .16s ease;
}
.nav-group[open] > .nav-group-summary .nav-group-chevron { transform: rotate(90deg); color: var(--gold-400); }
.nav-group-items {
  display: grid;
  gap: 3px;
  margin: 3px 0 6px 14px;
  padding: 2px 0 2px 10px;
  border-left: 1px solid rgba(255,255,255,.09);
}
.nav-group-items .nav-link { min-height: 40px; padding: 7px 10px; border-radius: 11px; font-size: .88rem; }
.nav-group-items .nav-icon { width: 25px; height: 25px; border-radius: 8px; font-size: .68rem; }
.nav-standalone { margin-bottom: 2px; }

.app-shell.sidebar-collapsed .sidebar { padding-left: 12px; padding-right: 12px; }
.app-shell.sidebar-collapsed .brand-block { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.sidebar-collapsed .brand-block > div:last-child { display: none; }
.app-shell.sidebar-collapsed .tenant-switcher { display: none; }
.app-shell.sidebar-collapsed .nav-list { padding-right: 0; }
.app-shell.sidebar-collapsed .nav-link,
.app-shell.sidebar-collapsed .nav-group-summary { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-group-label,
.app-shell.sidebar-collapsed .nav-group-chevron { display: none; }
.app-shell.sidebar-collapsed .nav-group-items { display: none; }
.app-shell.sidebar-collapsed .nav-icon { flex: 0 0 auto; }
.app-shell.sidebar-collapsed .sidebar-footer { display: flex; justify-content: center; padding-top: 14px; }
.app-shell.sidebar-collapsed .security-note { margin: 0; }
.app-shell.sidebar-collapsed .security-note-label,
.app-shell.sidebar-collapsed .user-chip,
.app-shell.sidebar-collapsed .sidebar-footer > .text-button,
.app-shell.sidebar-collapsed .sidebar-footer > form { display: none; }

@media (max-width: 820px) {
  .sidebar-collapse-toggle { display: none; }
  .nav-list { display: grid; overflow: visible; gap: 6px; padding-right: 0; }
  .nav-group-items { margin-left: 16px; }
}

.main-content { min-width: 0; padding: 34px clamp(24px, 4vw, 58px) 56px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.page-header.compact { align-items: center; }
.page-header h1 { font-size: clamp(2rem, 3vw, 3rem); line-height: 1; letter-spacing: -.045em; margin: 6px 0 10px; }
.page-header p { margin: 0; color: var(--muted); max-width: 720px; }
.eyebrow { display: inline-block; text-transform: uppercase; letter-spacing: .16em; font-weight: 900; color: #8a651a; font-size: .68rem; }
.back-link { display: inline-block; margin-bottom: 11px; color: var(--muted); text-decoration: none; font-size: .84rem; font-weight: 700; }
.back-link:hover, .text-link:hover { color: var(--navy-800); }
.title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.title-row h1 { margin-right: 2px; }

.primary-button, .secondary-button, .danger-button, .danger-outline { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-weight: 800; border: 1px solid transparent; text-decoration: none; cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.primary-button { color: var(--navy-950); background: linear-gradient(145deg, var(--gold-400), var(--gold-500)); box-shadow: 0 10px 24px rgba(166, 118, 12, .18); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(166,118,12,.24); }
.secondary-button { color: var(--navy-800); background: #fff; border-color: var(--border); }
.secondary-button:hover { background: var(--surface-3); }
.secondary-button:disabled { opacity: .48; cursor: not-allowed; }
.danger-button { background: var(--danger); color: #fff; }
.danger-outline { width: 100%; background: #fff; border-color: #f1b5af; color: var(--danger); }
.danger-text { border: 0; background: transparent; color: var(--danger); font-weight: 750; cursor: pointer; padding: 10px; }
.full, .full-width { width: 100%; }
.button-plus { font-size: 1.15rem; line-height: 1; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric-card { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 20px 18px; box-shadow: 0 8px 22px rgba(16, 35, 66, .045); }
.metric-card.accent { background: linear-gradient(145deg, var(--navy-900), var(--navy-800)); color: #fff; border-color: transparent; }
.metric-card.money-card::after { content: ""; position: absolute; width: 96px; height: 96px; border-radius: 50%; right: -32px; top: -34px; background: rgba(46,196,182,.12); }
.metric-top { display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-weight: 750; font-size: .78rem; }
.accent .metric-top { color: #b7c5dc; }
.metric-card strong { display: block; font-size: 2rem; letter-spacing: -.04em; margin: 13px 0 4px; }
.metric-card small { color: var(--muted); font-size: .73rem; }
.accent small { color: #9fb0ca; }
.metric-glyph { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 9px; background: rgba(230,185,75,.14); color: var(--gold-500); font-weight: 900; }
.status-orb { width: 11px; height: 11px; border-radius: 50%; margin: 6px; }
.status-orb.draft { background: #98a2b3; }
.status-orb.sent { background: #4f8cff; box-shadow: 0 0 0 5px rgba(79,140,255,.10); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.quote-panel { overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.panel-head h2, .section-heading h2, .action-card h2 { margin: 0; font-size: 1rem; }
.panel-head p, .section-heading p, .action-card p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.search-wrap { min-width: min(320px, 45vw); display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 0 11px; }
.search-wrap input { width: 100%; min-height: 42px; border: 0; outline: 0; background: transparent; color: var(--text); }
.filter-bar select { min-height: 42px; border: 1px solid var(--border); border-radius: 11px; background: #fff; color: var(--text); padding: 0 36px 0 12px; }
.text-link { color: var(--muted); font-size: .78rem; font-weight: 750; text-decoration: none; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.data-table th { padding: 13px 18px; text-align: left; color: #7a879a; font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; background: #fafbfd; }
.data-table td { padding: 17px 18px; border-top: 1px solid #edf0f5; vertical-align: middle; font-size: .86rem; }
.data-table tbody tr:hover { background: #fbfcff; }
.data-table .numeric { text-align: right; }
.quote-number { color: #183f7a; font-weight: 900; text-decoration: none; }
.quote-number:hover { color: #8a651a; }
.muted-line { color: var(--muted); font-size: .73rem; margin-top: 4px; }
.total-cell { font-weight: 850; font-variant-numeric: tabular-nums; }
.row-action { width: 60px; text-align: right; }
.icon-button { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--navy-800); text-decoration: none; cursor: pointer; }
.status-pill { display: inline-flex; align-items: center; min-height: 28px; padding: 5px 9px; border-radius: 99px; font-size: .68rem; font-weight: 900; letter-spacing: .025em; background: #f0f2f5; color: #475467; }
.status-pill.draft { background: #f2f4f7; color: #475467; }
.status-pill.sent { background: #eff6ff; color: #175cd3; }
.status-pill.accepted { background: #ecfdf3; color: #067647; }
.status-pill.converted { background: #f4f3ff; color: #5925dc; }
.status-pill.cancelled, .status-pill.declined { background: #fff1f3; color: #c01048; }
.status-pill.expired { background: #fff8eb; color: #b54708; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 17px; border-top: 1px solid var(--border); color: var(--muted); font-size: .78rem; }
.pagination a { color: #1849a9; font-weight: 750; text-decoration: none; }
.empty-state { text-align: center; padding: 58px 24px 64px; }
.empty-icon { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 18px; background: #fff7df; color: #8a651a; font-weight: 950; margin: 0 auto 14px; }
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { margin: 0 auto 18px; color: var(--muted); max-width: 450px; }

.form-panel { padding: 24px; }
.narrow-panel { max-width: 920px; }
.section-heading { display: flex; align-items: flex-start; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.section-heading.small { border-bottom: 0; padding-bottom: 6px; margin-bottom: 10px; }
.section-number { width: 30px; height: 30px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; background: #fff5d7; color: #8a651a; font-weight: 900; font-size: .72rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* D30A: author CSS must not override the HTML hidden attribute on the explicit
   multi-day Event End Date field. */
#event-end-date-group[hidden] { display: none !important; }
.form-stack { display: grid; gap: 16px; }
.field-group { display: grid; gap: 7px; }
.span-2 { grid-column: span 2; }
.field-label { font-size: .75rem; font-weight: 800; color: #344054; }
.field-input { width: 100%; min-height: 44px; border: 1px solid #ccd5e1; border-radius: 11px; background: #fff; padding: 10px 12px; outline: none; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.field-input:focus { border-color: #4f74a8; box-shadow: 0 0 0 4px rgba(79,116,168,.10); }
.textarea { resize: vertical; min-height: 100px; }
.field-error { color: var(--danger); font-size: .72rem; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 6px; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.summary-card, .action-card { padding: 22px; }
.detail-list { margin: 0; }
.detail-list > div { display: grid; grid-template-columns: 150px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid #edf0f5; }
.detail-list dt { color: var(--muted); font-size: .76rem; font-weight: 750; }
.detail-list dd { margin: 0; font-weight: 720; }
.large-value { font-size: 1.25rem; }
.action-card { display: grid; gap: 12px; }
.policy-note { padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: .74rem; line-height: 1.5; }

.modal-card { width: min(520px, calc(100vw - 34px)); border: 0; border-radius: 20px; padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.modal-card::backdrop { background: rgba(7,16,31,.62); backdrop-filter: blur(3px); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-head h2 { margin: 0; font-size: 1.1rem; }
.modal-card p { color: var(--muted); font-size: .82rem; }

.flash-stack { display: grid; gap: 8px; margin-bottom: 18px; }
.flash { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: #fff; font-size: .82rem; }
.flash.success { background: var(--success-soft); border-color: #abefc6; color: var(--success); }
.flash.error { background: var(--danger-soft); border-color: #f4c7c3; color: var(--danger); }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #284978 0, #10203a 30%, #07111f 70%); }
.auth-card { width: min(460px, 100%); padding: 30px; background: rgba(255,255,255,.98); border-radius: 26px; box-shadow: 0 32px 100px rgba(0,0,0,.28); }
.auth-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 32px; }
.auth-brand h1 { margin: 0; font-size: 1rem; }
.auth-brand p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.auth-copy h2 { font-size: 2rem; letter-spacing: -.04em; margin: 5px 0 8px; }
.auth-copy p { margin: 0 0 22px; color: var(--muted); }
.auth-footnote { margin-top: 18px; color: #8490a3; font-size: .68rem; line-height: 1.5; }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .filter-bar { width: 100%; justify-content: flex-start; }
  .search-wrap { flex: 1 1 280px; }
}
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px 18px; }
  .brand-block { padding-bottom: 8px; }
  .nav-list { display: grid; overflow: visible; margin-top: 8px; padding: 0 0 4px; gap: 6px; }
  .nav-link { white-space: nowrap; min-height: 42px; }
  .sidebar-footer { display: none; }
  .main-content { padding: 24px 18px 42px; }
  .page-header { align-items: flex-start; flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .metric-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .filter-bar { display: grid; grid-template-columns: 1fr; }
  .search-wrap { min-width: 0; width: 100%; }
  .detail-list > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Quote Builder ---------------------------------------------------------- */
.sidebar-logo { width: 44px; height: 44px; object-fit: cover; border-radius: 14px; border: 1px solid rgba(255,255,255,.14); background: #fff; }
.builder-header { align-items: center; }
.builder-header-meta { min-width: 180px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(16,35,66,.04); }
.builder-header-meta span { display: block; color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.builder-header-meta strong { display: block; margin-top: 4px; color: var(--navy-800); font-size: .88rem; }
.validation-summary { display: flex; gap: 8px 16px; flex-wrap: wrap; align-items: center; padding: 13px 16px; margin: -8px 0 18px; border: 1px solid #f4c7c3; border-radius: 13px; background: var(--danger-soft); color: var(--danger); font-size: .82rem; }
.validation-summary span { color: #7a271a; }
.quote-builder { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.builder-main { display: grid; gap: 18px; min-width: 0; }
.builder-section { padding: 22px; }
.builder-sidebar { position: sticky; top: 20px; display: grid; gap: 16px; }
.business-preview-card, .totals-card, .snapshot-card { padding: 20px; }
.mini-label { color: #8a651a; font-size: .64rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; }
.business-preview { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.business-logo-preview { width: 74px; height: 56px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: #fff; }
.business-preview > div:last-child { display: grid; gap: 3px; min-width: 0; }
.business-preview strong { color: var(--navy-800); font-size: .86rem; }
.business-preview span { color: var(--muted); font-size: .72rem; overflow-wrap: anywhere; }
.business-preview-card p { margin: 10px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.5; }
.compact-address { display: grid; grid-template-columns: .75fr 1.25fr; gap: 10px; }
.internal-note-field { padding: 14px; border-radius: 14px; background: #fff9eb; border: 1px solid #f4ddb0; }
.internal-note-detail { padding: 14px 16px; border-radius: 14px; background: #fff9eb; border: 1px solid #f4ddb0; color: var(--text); line-height: 1.6; overflow-wrap: anywhere; }
.line-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.heading-with-number { display: flex; align-items: flex-start; gap: 12px; }
.compact-button { min-height: 38px; padding: 7px 11px; font-size: .76rem; }
.line-items { display: grid; gap: 8px; margin-top: 16px; }
.line-item-head, .line-item-row { display: grid; grid-template-columns: 84px minmax(220px, 2.35fr) .58fr .9fr .9fr .9fr 34px; gap: 8px; align-items: center; }
.line-item-head { padding: 0 2px 2px; color: var(--muted); font-size: .65rem; text-transform: uppercase; letter-spacing: .065em; font-weight: 800; }
.line-item-row { position: relative; padding: 9px; border: 1px solid #e6eaf1; border-radius: 13px; background: #fbfcff; }
.line-flag-stack { display: grid; gap: 5px; align-content: center; min-width: 0; }
.line-required-control, .line-taxable-control { display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--muted); font-size: .66rem; font-weight: 800; cursor: pointer; }
.line-required, .line-taxable-toggle { width: 18px; height: 18px; accent-color: var(--navy-800); cursor: pointer; flex: 0 0 auto; }
.line-taxable-control { font-size: .62rem; }
.line-item-row.is-required { border-color: #c7d4e8; background: #f8fbff; }
.line-item-row.is-required .line-required-control { color: var(--navy-800); }
.line-item-row.is-optional .line-required-control { color: #8a651a; }
.quote-rule-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; padding: 10px 12px; border: 1px solid #dce4f0; border-radius: 11px; background: #f8fafc; color: var(--muted); }
.quote-rule-note > span { font-weight: 900; }
.quote-rule-note p { margin: 0; font-size: .69rem; line-height: 1.45; }
.quote-rule-note.rule-valid { border-color: #b7e4c7; background: #f0fdf4; color: var(--success); }
.quote-rule-note.rule-invalid { border-color: #f0b8b8; background: var(--danger-soft); color: var(--danger); }
.line-field { min-width: 0; }
.line-field .field-input { min-height: 40px; padding: 8px 10px; }
.money-wrap { position: relative; display: flex; align-items: center; }
.money-wrap > span { position: absolute; left: 10px; z-index: 1; color: var(--muted); font-size: .78rem; pointer-events: none; }
.money-wrap .field-input { padding-left: 23px; }
.money-input { font-variant-numeric: tabular-nums; }
.line-total { text-align: right; padding-right: 4px; font-size: .82rem; font-weight: 850; color: var(--navy-800); font-variant-numeric: tabular-nums; }
.remove-line { width: 32px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: #98a2b3; cursor: pointer; font-size: 1.15rem; }
.remove-line:hover { background: var(--danger-soft); color: var(--danger); }
.line-error { grid-column: 1 / -1; }
.block-error { margin-top: 12px; }
.totals-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.totals-title h2 { margin: 4px 0 0; color: var(--navy-800); font-size: 1.12rem; }
.live-badge { padding: 4px 8px; border-radius: 99px; background: #ecfdf3; color: var(--success); font-size: .63rem; font-weight: 900; text-transform: uppercase; letter-spacing: .07em; }
.totals-list { display: grid; gap: 0; margin: 18px 0 14px; }
.totals-list > div { display: flex; justify-content: space-between; gap: 14px; align-items: center; padding: 9px 0; border-bottom: 1px solid #edf0f5; }
.totals-list dt { color: var(--muted); font-size: .76rem; }
.totals-list dd { margin: 0; color: var(--text); font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.totals-list .sidebar-field { align-items: center; }
.compact-money { width: 112px; }
.summary-input { min-height: 36px !important; padding-top: 6px !important; padding-bottom: 6px !important; text-align: right; }
.summary-input[readonly] { background: #f3f6fa; color: var(--navy-800); cursor: default; }
.tax-calculation-help { display: block; margin: -3px 0 7px; color: var(--muted); font-size: .64rem; line-height: 1.45; }
.grand-total { color: var(--navy-800) !important; font-size: 1.22rem !important; }
.deposit-box { padding: 13px; margin-top: 10px; border: 1px solid #dce4f0; border-radius: 13px; background: var(--surface-2); }
.deposit-box .money-wrap { margin-top: 7px; }
.deposit-box small { display: block; margin-top: 7px; color: var(--muted); font-size: .67rem; line-height: 1.45; }
.sidebar-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
.calculation-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--border); }
.calculation-note > span { color: var(--success); font-weight: 900; }
.calculation-note p { margin: 0; color: var(--muted); font-size: .67rem; line-height: 1.45; }

/* Expanded quote detail -------------------------------------------------- */
.header-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.inline-form { display: inline-flex; }
.quote-detail-grid { grid-template-columns: minmax(0, 1fr) 310px; }
.detail-stack, .detail-side-stack { display: grid; gap: 18px; align-content: start; }
.detail-side-stack { position: sticky; top: 20px; }
.detail-list-wide > div { grid-template-columns: minmax(120px, .7fr) minmax(0, 1.7fr); }
.preline { white-space: pre-line; }
.detail-item-table { min-width: 640px; }
.detail-item-table-wrap { margin: 12px -18px -2px; }
.item-type-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 64px; padding: 4px 7px; border-radius: 999px; font-size: .62rem; font-weight: 900; text-transform: uppercase; letter-spacing: .045em; }
.item-type-pill.required { background: #eaf2ff; color: var(--navy-800); }
.item-type-pill.optional { background: #fff7e6; color: #8a651a; }
.detail-financials { width: min(360px, 100%); margin: 16px 0 0 auto; display: grid; gap: 0; }
.detail-financials > div { display: flex; justify-content: space-between; gap: 18px; padding: 7px 0; border-bottom: 1px solid #edf0f5; }
.detail-financials dt { color: var(--muted); font-size: .76rem; }
.detail-financials dd { margin: 0; font-size: .8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.detail-financials .financial-total { margin-top: 4px; border-top: 2px solid var(--gold-500); border-bottom: 0; padding-top: 11px; }
.detail-financials .financial-total dt, .detail-financials .financial-total dd { color: var(--navy-800); font-size: .94rem; font-weight: 900; }
.snapshot-card h2 { margin: 5px 0 7px; color: var(--navy-800); font-size: 1rem; }
.snapshot-card p { margin: 0 0 12px; color: var(--muted); font-size: .74rem; line-height: 1.5; }
.snapshot-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: .72rem; }
.snapshot-row span { color: var(--muted); }
.snapshot-row strong { color: var(--navy-800); text-align: right; }

@media (max-width: 1180px) {
  .quote-builder { grid-template-columns: 1fr; }
  .builder-sidebar { position: static; grid-template-columns: minmax(0, .8fr) minmax(300px, 1.2fr); }
  .line-item-head, .line-item-row { grid-template-columns: 82px minmax(210px, 2fr) .65fr .9fr .9fr .9fr 34px; }
}
@media (max-width: 900px) {
  .builder-sidebar { grid-template-columns: 1fr; }
  .quote-detail-grid { grid-template-columns: 1fr; }
  .detail-side-stack { position: static; }
  .line-item-head { display: none; }
  .line-item-row { grid-template-columns: 112px repeat(2, minmax(0, 1fr)) 34px; align-items: start; }
  .line-flag-stack { grid-column: 1; grid-row: 1; min-height: 40px; }
  .description-field { grid-column: 2 / 4; }
  .line-total { align-self: center; text-align: left; padding-left: 3px; }
  .remove-line { grid-column: 4; grid-row: 1; }
}
@media (max-width: 580px) {
  .builder-section { padding: 17px; }
  .builder-header-meta { width: 100%; }
  .compact-address { grid-template-columns: 1fr; }
  .line-heading { align-items: flex-start; flex-direction: column; }
  .line-item-row { grid-template-columns: 104px 1fr 30px; }
  .line-flag-stack { grid-column: 1; grid-row: 1; }
  .description-field { grid-column: 1 / 3; grid-row: 2; }
  .remove-line { grid-column: 3; grid-row: 1; }
}
.auth-logo { width: 70px; height: 54px; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); background: #fff; }


/* Quote lifecycle & invoice register ------------------------------------ */
.lifecycle-strip { margin: -6px 0 20px; padding: 14px 18px; display: flex; align-items: center; gap: 10px; overflow-x: auto; }
.lifecycle-stage { display: inline-flex; align-items: center; gap: 7px; min-width: max-content; color: #98a2b3; font-size: .72rem; }
.lifecycle-stage strong { font-weight: 800; }
.lifecycle-dot { width: 10px; height: 10px; border: 2px solid #cfd6e2; border-radius: 50%; background: #fff; }
.lifecycle-stage.complete { color: var(--navy-800); }
.lifecycle-stage.complete .lifecycle-dot { border-color: var(--success); background: var(--success); box-shadow: 0 0 0 4px #ecfdf3; }
.lifecycle-stage.current { color: var(--navy-800); }
.lifecycle-stage.current .lifecycle-dot { border-color: var(--gold-500); background: var(--gold-500); box-shadow: 0 0 0 4px #fff7e1; }
.lifecycle-line { width: 34px; height: 1px; flex: 0 0 34px; background: #dfe5ef; }
.lifecycle-terminal { margin-left: auto; padding: 6px 10px; border-radius: 999px; font-size: .68rem; }
.lifecycle-terminal.declined, .lifecycle-terminal.cancelled { background: var(--danger-soft); color: var(--danger); }
.lifecycle-terminal.expired { background: #fff8eb; color: #b54708; }
.lifecycle-action-card .primary-button + .secondary-button { margin-top: -3px; }
.conversion-summary { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; margin: 16px 0 4px; padding: 13px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: .78rem; }
.conversion-summary span { color: var(--muted); }
.conversion-summary strong { color: var(--navy-800); }
.audit-card { overflow: hidden; }
.audit-timeline { display: grid; gap: 0; margin-top: 12px; }
.audit-entry { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid #edf0f5; }
.audit-entry:first-child { border-top: 0; }
.audit-dot { width: 9px; height: 9px; margin-top: 4px; border-radius: 50%; background: var(--gold-500); box-shadow: 0 0 0 4px #fff7e1; }
.audit-entry > div { display: grid; gap: 3px; min-width: 0; }
.audit-entry strong { color: var(--navy-800); font-size: .75rem; }
.audit-entry span { color: var(--muted); font-size: .66rem; }
.audit-entry p { margin: 2px 0 0; color: #596579; font-size: .7rem; line-height: 1.45; overflow-wrap: anywhere; }
.status-pill.issued, .status-pill.partially_paid { background: #eff6ff; color: #175cd3; }
.status-pill.paid { background: #ecfdf3; color: #067647; }
.status-pill.overdue { background: #fff1f3; color: #c01048; }
@media (max-width: 700px) { .lifecycle-line { width: 20px; flex-basis: 20px; } .lifecycle-terminal { margin-left: 0; } }

/* Invoice builder, schedules, and payments -------------------------------- */
.invoice-builder { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 18px; align-items: start; }
.payment-schedule-editor { display: grid; gap: 8px; margin-top: 14px; }
.schedule-head, .schedule-edit-row { display: grid; grid-template-columns: minmax(200px, 1.7fr) 1fr 1fr 34px; gap: 9px; align-items: start; }
.schedule-head { padding: 0 10px; color: var(--muted); font-size: .67rem; font-weight: 850; text-transform: uppercase; letter-spacing: .045em; }
.schedule-edit-row { padding: 9px; border: 1px solid #e6eaf1; border-radius: 13px; background: #fbfcff; }
.schedule-validation { margin-top: 14px; padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; border: 1px solid #dce4f0; border-radius: 12px; background: #f8fafc; }
.schedule-validation span { color: var(--muted); font-size: .75rem; }
.schedule-validation strong { color: var(--navy-800); font-size: .95rem; }
.schedule-validation small { grid-column: 1 / -1; color: var(--muted); font-size: .67rem; }
.schedule-validation.is-valid { border-color: #b7e4c7; background: #f0fdf4; }
.schedule-validation.is-invalid { border-color: #f0b8b8; background: var(--danger-soft); }
.schedule-status { display: inline-flex; align-items: center; padding: 4px 7px; border-radius: 999px; font-size: .61rem; font-weight: 900; text-transform: uppercase; letter-spacing: .035em; background: #f2f4f7; color: #475467; }
.schedule-status.paid, .schedule-status.posted { background: #ecfdf3; color: #067647; }
.schedule-status.partially_paid { background: #eff6ff; color: #175cd3; }
.schedule-status.overdue { background: #fff1f3; color: #c01048; }
.schedule-status.voided { background: #f2f4f7; color: #667085; text-decoration: line-through; }
.payment-table { min-width: 720px; }
.voided-row { opacity: .62; }
.voided-row .total-cell { text-decoration: line-through; }
.financial-snapshot h2 { margin: 4px 0; font-size: 1.7rem; }
.terms-preview { margin-top: 16px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.terms-preview p { margin: 7px 0 0; color: #475467; font-size: .75rem; line-height: 1.55; }
.empty-inline { display: grid; gap: 4px; padding: 18px; border: 1px dashed #d6dde8; border-radius: 12px; background: #fbfcfe; }
.empty-inline strong { color: var(--navy-800); font-size: .8rem; }
.empty-inline span { color: var(--muted); font-size: .72rem; }
.danger-text { color: var(--danger) !important; }
.paid-card { border-color: #b7e4c7; background: #f7fef9; }
.conflict-state { max-width: 620px; margin: 50px auto; padding: 42px; }
@media (max-width: 980px) { .invoice-builder { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .schedule-head { display: none; }
  .schedule-edit-row { grid-template-columns: 1fr 1fr 32px; }
  .schedule-edit-row > div:first-child { grid-column: 1 / 3; }
}

/* V5 receipts and reminder delivery states */
.status-pill.active, .status-pill.sent { background: #ecfdf3; color: #067647; }
.status-pill.voided, .status-pill.failed { background: #fff1f3; color: #c01048; }
.status-pill.pending { background: #fff8eb; color: #b54708; }
.status-pill.skipped { background: #f2f4f7; color: #475467; }
.muted-small { color: var(--muted); font-size: .72rem; margin-top: 4px; max-width: 430px; }
.search-input { min-height: 42px; min-width: 320px; border: 1px solid var(--border); border-radius: 11px; background: #fff; color: var(--text); padding: 0 12px; }

/* V5.4 Reporting --------------------------------------------------------- */
.reporting-header { align-items: center; }
.report-export-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.report-export-actions form { margin: 0; }
.report-export-actions button:disabled { opacity: .48; cursor: not-allowed; transform: none; box-shadow: none; }
.report-tabs { display: flex; gap: 8px; overflow-x: auto; margin: -8px 0 18px; padding: 4px 0; }
.report-tab { flex: 0 0 auto; padding: 9px 13px; border: 1px solid var(--border); border-radius: 999px; background: #fff; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 800; }
.report-tab:hover { border-color: #c3cfdf; color: var(--navy-800); }
.report-tab.active { border-color: #ead08a; background: #fff8e5; color: #7a5813; box-shadow: 0 6px 20px rgba(166,118,12,.08); }
.reporting-filter-panel { display: grid; grid-template-columns: minmax(220px,.55fr) minmax(0,1.45fr); gap: 26px; align-items: end; padding: 22px; margin-bottom: 18px; }
.reporting-filter-copy h2 { margin: 5px 0 6px; color: var(--navy-800); font-size: 1.15rem; }
.reporting-filter-copy p { margin: 0; color: var(--muted); font-size: .76rem; line-height: 1.5; }
.report-filter-form { display: grid; grid-template-columns: minmax(220px,1.5fr) minmax(140px,.75fr) minmax(150px,.8fr) minmax(150px,.8fr) auto; gap: 10px; align-items: end; }
.report-filter-form .field-label { white-space: nowrap; }
.report-filter-actions { display: flex; align-items: center; gap: 9px; min-height: 44px; }
.report-metrics { margin-bottom: 18px; }
.report-results-panel { overflow: hidden; }
.report-table-wrap { max-height: none; }
.report-table { min-width: 980px; }
.report-table th, .report-table td { white-space: nowrap; }
.report-table td:nth-child(2), .report-table td:nth-child(3), .report-table td:nth-child(4) { max-width: 250px; overflow: hidden; text-overflow: ellipsis; }
.report-export-note { color: var(--muted); font-size: .7rem; }
.report-cap-warning { padding: 8px 10px; border: 1px solid #f4c7c3; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: .7rem; font-weight: 750; }
@media (max-width: 1250px) {
  .reporting-filter-panel { grid-template-columns: 1fr; align-items: start; }
  .report-filter-form { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .report-search-field { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .reporting-header { align-items: flex-start; }
  .report-export-actions { width: 100%; }
  .report-export-actions form { flex: 1 1 140px; }
  .report-export-actions button { width: 100%; }
  .report-filter-form { grid-template-columns: 1fr; }
  .report-search-field { grid-column: auto; }
}

/* V6 Calendar & Availability ---------------------------------------------- */
.calendar-page-header { align-items: center; }
.calendar-metrics { margin-bottom: 18px; }
.availability-panel { padding: 22px; margin-bottom: 18px; display: grid; grid-template-columns: minmax(250px,.8fr) minmax(480px,1.4fr); gap: 18px 28px; align-items: end; }
.availability-copy h2 { margin: 5px 0 6px; color: var(--navy-800); font-size: 1.12rem; }
.availability-copy p { margin: 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.availability-check-form { display: grid; grid-template-columns: 1.15fr 1fr .8fr .8fr auto; gap: 10px; align-items: end; }
.availability-check-form label { display: grid; gap: 5px; }
.availability-result { grid-column: 1 / -1; min-height: 0; display: none; gap: 4px; padding: 12px 14px; border-radius: 12px; font-size: .75rem; }
.availability-result:not(:empty) { display: grid; }
.availability-result strong { font-size: .82rem; }
.availability-result span, .availability-result small { line-height: 1.45; }
.availability-result.available { border: 1px solid #a9dfbd; background: #f0fdf4; color: #067647; }
.availability-result.conflict, .availability-result.invalid { border: 1px solid #f1b4b4; background: #fff1f3; color: #b42318; }
.availability-result.loading { border: 1px solid #d6dde8; background: #f8fafc; color: var(--muted); }
.availability-conflict-list { margin-top: 6px; display: grid; gap: 6px; }
.availability-conflict-item { display: grid; gap: 2px; padding: 8px 10px; border: 1px solid rgba(180,35,24,.18); border-radius: 9px; background: rgba(255,255,255,.65); color: inherit; text-decoration: none; }
.availability-conflict-item span { font-size: .68rem; opacity: .88; }
.availability-builder-card { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; padding: 14px; border: 1px solid #dbe5f1; border-radius: 13px; background: linear-gradient(135deg,#f8fbff,#fffdf8); }
.availability-builder-card p { margin: 3px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.availability-builder-actions { display: flex; align-items: center; gap: 10px; }
.availability-builder-card .availability-result { grid-column: 1 / -1; }
.month-calendar-panel { overflow: hidden; padding: 0; }
.calendar-toolbar { padding: 18px 20px 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--border); }
.calendar-toolbar h2 { margin: 3px 0 0; color: var(--navy-800); font-size: 1.25rem; }
.calendar-toolbar-actions { display: flex; align-items: center; gap: 8px; }
.calendar-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 20px; border-bottom: 1px solid var(--border); background: #fbfcfe; color: var(--muted); font-size: .68rem; font-weight: 700; }
.calendar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.booked { background: #12b76a; }
.legend-dot.tentative { background: #eaaa08; }
.legend-dot.inquiry { background: #2e90fa; }
.calendar-grid { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); }
.calendar-weekdays { border-bottom: 1px solid var(--border); background: #f8fafc; }
.calendar-weekdays div { padding: 9px 8px; color: var(--muted); font-size: .64rem; font-weight: 850; text-align: center; text-transform: uppercase; letter-spacing: .055em; }
.month-grid { background: var(--border); gap: 1px; }
.calendar-day { min-height: 132px; padding: 9px; background: #fff; color: inherit; text-decoration: none; overflow: hidden; transition: background .15s ease, box-shadow .15s ease; }
.calendar-day:hover { background: #fbfdff; box-shadow: inset 0 0 0 1px #cad8e8; z-index: 1; }
.calendar-day.outside-month { background: #f9fafb; opacity: .56; }
.calendar-day.today { box-shadow: inset 0 0 0 2px #d7aa31; }
.calendar-day-number { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.calendar-day-number span { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; color: var(--navy-800); font-size: .72rem; font-weight: 850; }
.calendar-day.today .calendar-day-number span { background: #fff4cc; color: #74520b; }
.calendar-day-number em { color: #8a6516; font-size: .58rem; font-style: normal; font-weight: 850; text-transform: uppercase; }
.calendar-day-events { display: grid; gap: 4px; }
.calendar-event { display: grid; grid-template-columns: auto minmax(0,1fr); gap: 5px; align-items: center; min-height: 23px; padding: 4px 6px; border-radius: 7px; font-size: .61rem; border-left: 3px solid transparent; }
.calendar-event strong { font-size: .59rem; white-space: nowrap; }
.calendar-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event.booked { background: #ecfdf3; color: #067647; border-left-color: #12b76a; }
.calendar-event.tentative { background: #fff8e8; color: #9b6507; border-left-color: #eaaa08; }
.calendar-event.inquiry { background: #eff8ff; color: #175cd3; border-left-color: #2e90fa; }
.more-events { color: var(--muted); font-size: .59rem; font-weight: 750; padding-left: 5px; }
.day-schedule-panel { padding: 20px; }
.day-schedule-list { display: grid; gap: 12px; }
.day-booking { display: grid; grid-template-columns: 135px minmax(0,1fr); border: 1px solid var(--border); border-left: 5px solid #98a2b3; border-radius: 14px; overflow: hidden; background: #fff; }
.day-booking.booked { border-left-color: #12b76a; }
.day-booking.tentative { border-left-color: #eaaa08; }
.day-booking.inquiry { border-left-color: #2e90fa; }
.day-booking-time { padding: 18px; background: #f8fafc; display: grid; align-content: start; gap: 3px; }
.day-booking-time strong { color: var(--navy-800); font-size: 1rem; }
.day-booking-time span { color: var(--muted); font-size: .68rem; }
.day-booking-main { padding: 17px 18px; }
.day-booking-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.day-booking-heading h2 { margin: 5px 0 0; color: var(--navy-800); font-size: 1rem; }
.day-booking-meta { margin-top: 14px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px 16px; }
.day-booking-meta span { display: grid; gap: 3px; color: #475467; font-size: .72rem; }
.day-booking-meta strong { color: var(--muted); font-size: .59rem; text-transform: uppercase; letter-spacing: .045em; }
.booking-status-banner { margin-bottom: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #f8fafc; }
.booking-status-banner > div { display: grid; gap: 3px; }
.booking-status-banner > div strong { color: var(--navy-800); font-size: .9rem; }
.booking-status-banner.booked { background: #f0fdf4; border-color: #b7e4c7; }
.booking-status-banner.tentative { background: #fff8e8; border-color: #f0d58b; }
.booking-status-banner.inquiry { background: #eff8ff; border-color: #b9dcf7; }
.status-pill.booked { background: #ecfdf3; color: #067647; }
.status-pill.tentative { background: #fff8e8; color: #9b6507; }
.status-pill.inquiry { background: #eff8ff; color: #175cd3; }
.status-pill.released, .status-pill.cancelled { background: #f2f4f7; color: #475467; }
.calendar-empty { padding: 58px 20px; }
@media (max-width: 1050px) {
  .availability-panel { grid-template-columns: 1fr; }
  .availability-check-form { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .availability-check-form button { grid-column: 1 / -1; }
  .calendar-day { min-height: 112px; }
  .day-booking-meta { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .calendar-weekdays { display: none; }
  .month-grid { display: grid; grid-template-columns: 1fr; gap: 8px; background: transparent; padding: 12px; }
  .calendar-day { min-height: 0; border: 1px solid var(--border); border-radius: 11px; }
  .calendar-day.outside-month { display: none; }
  .availability-check-form { grid-template-columns: 1fr; }
  .availability-check-form button { grid-column: auto; }
  .availability-builder-card { grid-template-columns: 1fr; }
  .availability-builder-actions { flex-wrap: wrap; }
  .day-booking { grid-template-columns: 1fr; }
  .day-booking-time { grid-template-columns: auto 1fr; align-items: baseline; }
  .day-booking-meta { grid-template-columns: 1fr; }
  .day-booking-heading { flex-direction: column; }
}

/* V6.1 Existing client lookup */
.client-lookup { margin: 0 0 18px; padding: 14px; border: 1px solid #dbe5f1; border-radius: 13px; background: linear-gradient(135deg,#f8fbff,#fffdf8); }
.client-lookup { display: grid; grid-template-columns: 1fr minmax(360px, 1.25fr); gap: 10px 18px; align-items: end; }
.client-lookup-copy p { margin: 3px 0 0; color: var(--muted); font-size: .72rem; line-height: 1.45; }
.client-lookup-controls { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.client-search-results { grid-column: 1 / -1; display: grid; gap: 6px; }
.client-search-results:empty { display: none; }
.client-search-results.loading, .client-search-results.selected, .client-search-empty { color: var(--muted); font-size: .75rem; }
.client-search-results.selected { color: #17633a; font-weight: 700; }
.client-search-result { width: 100%; border: 1px solid #dde5ef; background: #fff; border-radius: 10px; padding: 10px 12px; text-align: left; cursor: pointer; display: grid; gap: 2px; color: var(--text); }
.client-search-result:hover, .client-search-result:focus-visible { border-color: #b7892d; box-shadow: 0 0 0 3px rgba(214,168,75,.14); outline: none; }
.client-search-result strong { font-size: .82rem; }
.client-search-result span { color: var(--muted); font-size: .7rem; }
.sr-only { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
@media (max-width: 850px) { .client-lookup { grid-template-columns: 1fr; } .client-lookup-controls { grid-template-columns: 1fr; } }

/* V6.2 Price List & catalog-backed quote items ---------------------------- */
.line-heading-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: nowrap; flex: 0 0 auto; margin-left: auto; }
.line-heading-actions > * { flex: 0 0 auto; white-space: nowrap; }
.line-catalog-field { min-width: 0; display: grid; gap: 6px; }
.line-catalog-select { width: 100%; }
.custom-description-field { display: block; }
.custom-description-field.is-hidden { display: none; }
.line-price[readonly] { background: #f2f4f7; color: #475467; cursor: not-allowed; }
.line-item-row .line-price-list-id { display: none; }

.price-list-layout { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(620px,1.7fr); gap: 18px; align-items: start; }
.price-list-form-card, .price-list-table-card { padding: 20px; }
.compact-heading { margin-bottom: 14px; }
.stack-form { display: grid; gap: 14px; }
.toggle-row { display: flex; align-items: center; gap: 9px; color: #344054; font-size: .78rem; font-weight: 700; }
.price-list-toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 14px; }
.price-list-toolbar h2 { margin: 3px 0 0; color: var(--navy-800); font-size: 1.08rem; }
.inline-search-form { display: flex; gap: 8px; align-items: center; }
.inline-search-form .field-input { min-width: 220px; }
.table-scroll { overflow-x: auto; }
.price-list-table { min-width: 850px; }
.table-actions { display: flex; gap: 7px; justify-content: flex-end; align-items: center; }
.table-actions form { margin: 0; }
.info-callout { display: grid; gap: 3px; padding: 12px 14px; border: 1px solid #dbe5f1; border-radius: 11px; background: #f8fbff; color: #475467; font-size: .74rem; }
.info-callout strong { color: var(--navy-800); }

@media (max-width: 1120px) {
  .price-list-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .price-list-toolbar { align-items: stretch; flex-direction: column; }
  .inline-search-form { display: grid; grid-template-columns: 1fr auto; }
  .inline-search-form .field-input { min-width: 0; }
  .line-heading-actions { width: auto; align-self: flex-end; }
}

/* Change Orders ------------------------------------------------------------ */
.change-items { display: grid; gap: 8px; }
.change-item-head, .change-item-row { display: grid; grid-template-columns: .72fr 2.35fr .55fr .85fr .85fr .9fr 34px; gap: 8px; align-items: start; }
.change-item-head { color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .045em; padding: 0 2px 4px; }
.change-item-row { padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfe; }
.change-price-list-id { display: none; }
.change-custom-description { margin-top: 7px; }
.change-line-total { min-height: 42px; display: flex; align-items: center; justify-content: flex-end; color: var(--navy-800); font-weight: 800; font-size: .78rem; }
.change-action-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; font-size: .64rem; font-weight: 850; text-transform: uppercase; }
.change-action-pill.add { background: #ecfdf3; color: #067647; }
.change-action-pill.remove { background: #fef3f2; color: #b42318; }
.negative-value { color: #b42318 !important; }
.status-pill.applied { background: #ecfdf3; color: #067647; }
@media (max-width: 980px) { .change-item-head { display: none; } .change-item-row { grid-template-columns: 1fr 1fr; } .change-item-row .line-catalog-field { grid-column: 1 / -1; } }

/* V6.4 Aggregate contract / event balance --------------------------------- */
.contract-summary-card .financial-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; }
.contract-summary-card .financial-grid > div { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 11px; background: #fbfcfe; }
.contract-summary-card .financial-grid span { color: var(--muted); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.contract-summary-card .financial-grid strong { color: var(--navy-800); font-size: .95rem; }
.contract-summary-card .financial-grid .total-emphasis { background: #fff8e8; border-color: #e8c878; }
.contract-summary-card .financial-grid .total-emphasis strong { font-size: 1.08rem; }
.contract-total-row { margin-top: 8px; padding-top: 9px; border-top: 1px solid var(--border); }
.detail-list .emphasis-row { background: #fff8e8; border: 1px solid #e8c878; border-radius: 9px; padding: 10px 12px; margin-top: 5px; }
.detail-list .emphasis-row dd { color: var(--navy-800); font-weight: 850; }
@media (max-width: 900px) { .contract-summary-card .financial-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 620px) { .contract-summary-card .financial-grid { grid-template-columns: 1fr; } }

/* V6.5 Color Palette ------------------------------------------------------- */
.palette-search-panel { padding: 18px 20px; margin-bottom: 18px; }
.palette-search-form { display: grid; grid-template-columns: minmax(260px,1.4fr) repeat(2,minmax(170px,.75fr)) auto auto; gap: 8px; align-items: center; }
.palette-builder-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(320px,.82fr); gap: 18px; align-items: start; }
.palette-results-panel, .palette-queue-panel, .palette-recent-panel { padding: 20px; }
.palette-card-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(150px,1fr)); gap: 12px; }
.palette-card { position: relative; display: grid; gap: 4px; min-height: 144px; padding: 14px 12px 12px; border: 1px solid var(--border); border-radius: 14px; background: #fff; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.palette-card:hover { transform: translateY(-1px); border-color: #d4b35c; box-shadow: 0 10px 26px rgba(16,28,53,.08); }
.palette-card-check { position: absolute; right: 10px; top: 10px; width: 16px; height: 16px; }
.palette-card-code { color: var(--navy-800); font-size: .84rem; font-weight: 900; letter-spacing: .03em; }
.palette-card > span, .palette-card small { color: var(--muted); font-size: .72rem; }
.swatch-chip { width: 42px; height: 42px; border-radius: 999px; border: 1px solid rgba(16,24,40,.1); background: #ccc; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); overflow: hidden; flex: 0 0 auto; }
.swatch-chip .swatch-svg { display: block; width: 100%; height: 100%; }
.swatch-chip.small { width: 18px; height: 18px; }
.swatch-chip.large { width: 54px; height: 54px; }
.queue-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.palette-queue-list { display: grid; gap: 10px; min-height: 170px; max-height: 460px; overflow: auto; padding-right: 4px; }
.queue-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: #fbfcfe; }
.queue-copy { display: grid; gap: 2px; }
.queue-copy span { color: var(--text); font-size: .78rem; }
.queue-copy small { color: var(--muted); font-size: .7rem; }
.compact-empty { min-height: 120px; }
.helper-copy { color: var(--muted); font-size: .74rem; line-height: 1.45; }
.palette-detail-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.palette-detail-card { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 14px; background: #fbfcfe; }
.note-banner { margin-top: 14px; padding: 12px 14px; border: 1px solid #e8c878; border-radius: 12px; background: #fff8e8; color: #4b5565; font-size: .8rem; }
.detail-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.modal-dialog { border: 0; padding: 0; background: transparent; }
.modal-dialog::backdrop { background: rgba(7,16,31,.62); backdrop-filter: blur(3px); }
.modal-shell { width: min(560px, calc(100vw - 28px)); border-radius: 20px; padding: 22px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.24); }
.modal-shell-wide { width: min(640px, calc(100vw - 28px)); }
.modal-header, .modal-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-header h2 { margin: 0; color: var(--navy-800); font-size: 1.1rem; }
.modal-body { display: grid; gap: 12px; margin-top: 10px; }
.email-dialog-row { display: grid; gap: 10px; }
.inline-actions-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; cursor: pointer; }
.icon-button:hover { color: var(--navy-800); }
@media (max-width: 1180px) { .palette-builder-layout { grid-template-columns: 1fr; } }
@media (max-width: 920px) { .detail-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .palette-search-form { grid-template-columns: 1fr; }
  .header-actions { width: 100%; }
  .header-actions .primary-button, .header-actions .secondary-button { width: 100%; justify-content: center; }
  .inline-actions-row { grid-template-columns: 1fr; }
}

/* V6.6: keep Saved Palettes compact while retaining the latest 50 records. */
.palette-recent-scroll {
  max-height: 660px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.palette-recent-scroll table { margin: 0; }
.palette-recent-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
  box-shadow: 0 1px 0 var(--border);
}

/* V6.6: Quote Builder saved-palette integration. */
.quote-palette-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.quote-palette-actions { justify-content: flex-end; }
.quote-palette-select-wrap { min-width: 0; }
.quote-palette-picker .palette-toggle-row { grid-column: 1 / -1; }
.quote-palette-preview {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  min-height: 0;
}
.quote-palette-preview .palette-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.quote-palette-preview-grid,
.quote-detail-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 9px;
}
.quote-palette-mini {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fbfcfe;
}
.quote-palette-mini .swatch-svg { width: 38px; height: 38px; }
.quote-palette-mini strong { display: block; font-size: .78rem; color: var(--navy-800); }
.quote-palette-mini span { display: block; font-size: .69rem; color: var(--muted); line-height: 1.25; }
.palette-toggle-row {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: .78rem;
}
.palette-toggle-row input { width: 16px; height: 16px; }
@media (max-width: 720px) {
  .quote-palette-picker { grid-template-columns: 1fr; }
  .quote-palette-picker .palette-toggle-row,
  .quote-palette-preview { grid-column: 1; }
}

/* V6.10.2: compact recent-record registers. The class is only applied when
   a result set contains more than 15 rows, so smaller lists remain unchanged. */
.recent-records-scroll {
  max-height: 880px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.recent-records-scroll table { margin: 0; }
.recent-records-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #f7f9fc;
  box-shadow: 0 1px 0 var(--border);
}

/* V6.12 Users & Roles Management */
.admin-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -10px 0 20px;
}
.admin-tab {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: #fff;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
  text-decoration: none;
}
.admin-tab:hover { color: var(--navy-800); background: var(--surface-3); }
.admin-tab.active { color: var(--navy-900); border-color: #d7b75d; background: #fff9e8; }
.admin-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.admin-audit-panel { margin-top: 20px; }
.admin-audit-details { max-width: 680px; color: var(--muted); font-size: .76rem; line-height: 1.45; overflow-wrap: anywhere; }
.admin-checkbox-field { align-content: end; }
.admin-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}
.admin-check-row input { width: 17px; height: 17px; margin-top: 2px; }
.admin-check-row span { display: grid; gap: 2px; }
.admin-check-row strong { font-size: .78rem; }
.admin-check-row small { color: var(--muted); font-size: .7rem; line-height: 1.35; }
.admin-role-panel { max-width: 1180px; }
.permission-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.permission-group { border: 1px solid var(--border); border-radius: 14px; background: #fff; overflow: hidden; }
.permission-group h3 { margin: 0; padding: 12px 14px; background: #f7f9fc; border-bottom: 1px solid var(--border); font-size: .78rem; color: var(--navy-800); }
.permission-list { display: grid; }
.permission-row { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-top: 1px solid #edf0f5; cursor: pointer; }
.permission-row:first-child { border-top: 0; }
.permission-row:hover { background: #fbfcff; }
.permission-row input { width: 16px; height: 16px; margin-top: 2px; flex: 0 0 auto; }
.permission-row span { display: grid; gap: 3px; }
.permission-row strong { font-size: .76rem; color: #344054; }
.permission-row small { font-size: .67rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.admin-permission-error { margin-bottom: 10px; }
@media (max-width: 900px) {
  .admin-metrics, .permission-groups { grid-template-columns: 1fr; }
}

/* V6.13 secure customer quote response */
.customer-response-page {
  min-height: 100vh;
  margin: 0;
  background: #f4f7fb;
}
.customer-response-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}
.customer-response-card {
  width: min(680px, 100%);
  background: #fff;
  border: 1px solid #dfe5ef;
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(16, 28, 53, 0.12);
  padding: 28px;
}
.customer-response-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid #e7ebf2;
}
.customer-response-brand img {
  width: 74px;
  height: 56px;
  object-fit: contain;
  border-radius: 10px;
}
.customer-response-brand h1,
.customer-response-summary h2,
.customer-response-status h2 {
  margin: 2px 0 0;
}
.customer-response-summary > p {
  color: #667085;
  margin-bottom: 20px;
}
.customer-response-form {
  margin-top: 22px;
}
.customer-response-warning {
  padding: 13px 15px;
  border: 1px solid #e5d19a;
  background: #fffaf0;
  border-radius: 10px;
  color: #594511;
  line-height: 1.45;
}
.customer-response-submit {
  min-height: 48px;
  font-size: 0.98rem;
}
.customer-response-footnote {
  color: #667085;
  font-size: 0.82rem;
  line-height: 1.45;
  margin: 18px 0 0;
  text-align: center;
}
.customer-response-status {
  text-align: center;
}
.customer-response-status .customer-response-brand {
  text-align: left;
}
.response-status-icon {
  width: 58px;
  height: 58px;
  margin: 8px auto 16px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.75rem;
  font-weight: 800;
  background: #e9f7ef;
  color: #176b3a;
}
.customer-response-status.notice .response-status-icon {
  background: #fff3e3;
  color: #9b5b00;
}
.secure-response-card .snapshot-row strong {
  text-align: right;
}
@media (max-width: 640px) {
  .customer-response-card { padding: 20px; border-radius: 14px; }
  .customer-response-shell { padding: 18px 12px; }
}

/* V6.14 Inventory Management */
.inventory-track-panel { margin-bottom: 20px; }
.inventory-track-form {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(130px, 1fr)) auto;
  gap: 12px;
  align-items: end;
}
.inventory-track-submit { margin-bottom: 1px; }
.inventory-filter-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
}
.inventory-filter-form .field-input { min-width: 140px; width: auto; }
.inventory-filter-form input[type="search"] { min-width: 220px; }
.compact-toggle { min-height: 38px; padding: 0 6px; }
.inventory-color-cell { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.inventory-color-cell div { display: grid; gap: 2px; }
.inventory-color-cell small { color: var(--muted); }
.inventory-swatch { width: 32px; height: 32px; flex: 0 0 32px; display: inline-flex; }
.inventory-swatch svg { width: 100%; height: 100%; }
.inventory-swatch.large { width: 52px; height: 52px; flex-basis: 52px; }
.inventory-count { font-size: 1.1rem; }
.inventory-history-panel { margin-top: 20px; }
.inventory-summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 18px; }
.inventory-hero-count { display: block; font-size: 2rem; margin: 6px 0; }
.inventory-color-summary { display: flex; gap: 14px; align-items: center; }
.inventory-color-summary div { display: grid; gap: 3px; }
.inventory-detail-grid { display: grid; grid-template-columns: 1.35fr .85fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 1000px) {
  .inventory-track-form { grid-template-columns: 1fr 1fr; }
  .inventory-color-field { grid-column: 1 / -1; }
  .inventory-summary-grid, .inventory-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .inventory-track-form { grid-template-columns: 1fr; }
  .inventory-color-field { grid-column: auto; }
  .inventory-filter-form { justify-content: stretch; }
  .inventory-filter-form .field-input, .inventory-filter-form input[type="search"] { width: 100%; min-width: 0; }
}


/* V6.15 Expense & Cost Tracking */
.expense-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; margin-bottom:1rem; }
.expense-total { font-size:1.55rem; line-height:1.1; }
.expense-filter-form { display:flex; flex-wrap:wrap; gap:.55rem; align-items:center; justify-content:flex-end; }
.expense-filter-form .field-input { min-width:140px; }
.expense-form-panel { max-width:900px; }
.expense-inline-cost { border-top:1px solid var(--border-color, #e5e7eb); margin-top:.75rem; padding-top:1rem; }
.detail-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:1rem; }
.detail-grid > div { display:flex; flex-direction:column; gap:.25rem; }
.detail-notes { margin-top:1.25rem; }
.danger-panel { border-color:#f3c6c6; }
.inline-form { display:flex; gap:.75rem; align-items:center; }
.inline-form .field-input { flex:1; }
@media (max-width: 1000px) { .expense-summary-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .detail-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 680px) { .expense-summary-grid,.detail-grid { grid-template-columns:1fr; } .inline-form { flex-direction:column; align-items:stretch; } }

/* V6.16 Year End & Business Intelligence -------------------------------- */
.finance-overview { margin-bottom: 24px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: linear-gradient(135deg, #ffffff 0%, #f8fbff 56%, #fffaf0 100%); box-shadow: var(--shadow); }
.finance-overview-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.finance-overview-head h2 { margin: 3px 0 4px; font-size: 1.25rem; }
.finance-overview-head p { margin: 0; color: var(--muted); }
.finance-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.finance-kpi-card { position: relative; overflow: hidden; min-height: 142px; padding: 20px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: 0 10px 30px rgba(17, 35, 65, .06); }
.finance-kpi-card::after { content: ""; position: absolute; width: 90px; height: 90px; right: -30px; top: -30px; border-radius: 50%; background: rgba(23, 38, 66, .05); }
.finance-kpi-card.revenue { background: linear-gradient(145deg, #f0fdfa, #ffffff 66%); border-color: #b7ece4; }
.finance-kpi-card.expense { background: linear-gradient(145deg, #fff8ed, #ffffff 66%); border-color: #f5d7a4; }
.finance-kpi-card.profit-positive { background: linear-gradient(145deg, #ecfdf3, #ffffff 68%); border-color: #a7e5c0; }
.finance-kpi-card.profit-negative { background: linear-gradient(145deg, #fff1ef, #ffffff 68%); border-color: #f2b8b3; }
.finance-kpi-label { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.finance-kpi-card strong { display: block; margin: 8px 0 6px; color: var(--navy-900); font-size: clamp(1.55rem, 3vw, 2.25rem); letter-spacing: -.04em; }
.finance-kpi-card.profit-positive strong { color: var(--success); }
.finance-kpi-card.profit-negative strong { color: var(--danger); }
.finance-kpi-card small { color: var(--muted); line-height: 1.45; }
.finance-kpi-card.featured { min-height: 160px; }
.finance-kpi-card.compact-kpi { min-height: 122px; background: #fff; }

.year-end-page-header { align-items: center; }
.year-end-page-header h1 { max-width: 820px; }
.year-end-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; padding: 22px 24px; background: linear-gradient(130deg, #12233f 0%, #1f3b65 58%, #6a5627 140%); color: #fff; }
.year-end-hero h2 { margin: 4px 0 5px; font-size: 1.35rem; }
.year-end-hero p { margin: 0; max-width: 820px; color: #d4deec; line-height: 1.55; }
.year-end-hero .mini-label { color: #f3d47f; }
.year-shortcuts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.year-shortcuts a { padding: 8px 11px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: #fff; text-decoration: none; font-size: .78rem; font-weight: 800; background: rgba(255,255,255,.07); }
.year-shortcuts a:hover { background: rgba(255,255,255,.14); }
.year-end-filter-panel { margin-bottom: 20px; }
.year-end-filter-grid { display: grid; grid-template-columns: 1fr 1fr 1.25fr 1.25fr; gap: 14px; align-items: end; }
.year-end-item-filter { grid-column: span 2; }
.year-end-filter-actions { display: flex; align-items: center; gap: 14px; min-height: 46px; }
.filter-context-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid var(--border); color: var(--muted); font-size: .82rem; line-height: 1.55; }
.year-end-kpis { margin-bottom: 22px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.year-end-two-column { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, .75fr); gap: 20px; margin-bottom: 20px; }
.client-tax-grid { grid-template-columns: 1fr 1fr; }
.trend-panel, .insights-panel, .tax-summary-panel { min-width: 0; }
.trend-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: .74rem; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-left: 6px; }
.revenue-dot { background: #147d73; }
.expense-dot { background: #d97706; }
.profit-dot { background: #15803d; }
.trend-chart-shell { overflow-x: auto; margin: 4px 0 10px; border: 1px solid var(--border); border-radius: 14px; background: linear-gradient(180deg, #fbfdff, #fff); }
.trend-chart { display: block; min-width: 680px; width: 100%; height: auto; }
.trend-axis-label { fill: #77839a; font-size: 14px; font-family: Inter, ui-sans-serif, system-ui, sans-serif; }
.year-end-mini-table { max-height: 330px; overflow: auto; }
.year-end-tall-table { max-height: 470px; overflow: auto; }
.year-end-detail-scroll { max-height: 620px; overflow: auto; }
.year-end-mini-table thead, .year-end-tall-table thead, .year-end-detail-scroll thead { position: sticky; top: 0; z-index: 2; }
.insight-stack { display: grid; gap: 10px; }
.insight-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 14px; background: #fbfcff; }
.insight-card.positive { background: #f2fbf6; border-color: #c5ead4; }
.insight-card.warning { background: #fff9ef; border-color: #f1ddb6; }
.insight-card.accent { background: #f6f3ff; border-color: #ddd2f6; }
.insight-marker { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; background: var(--navy-800); color: #fff; font-weight: 900; font-size: .76rem; }
.insight-card strong { display: block; margin-bottom: 3px; color: var(--navy-900); }
.insight-card p { margin: 0; color: var(--muted); font-size: .79rem; line-height: 1.48; }
.positive-money { color: var(--success) !important; font-weight: 800; }
.negative-money { color: var(--danger) !important; font-weight: 800; }
.table-subtext { display: block; margin-top: 3px; color: var(--muted); font-size: .71rem; font-weight: 500; }
.service-profit-table td:first-child { min-width: 155px; }
.tax-detail-panel { margin-bottom: 20px; }
.management-note-panel { padding: 17px 19px; border-radius: 15px; border: 1px dashed #b9c7da; background: #f8fafc; color: var(--muted); line-height: 1.6; }
.management-note-panel strong { color: var(--navy-900); }
.management-note-panel p { margin: 5px 0 0; }

@media (max-width: 1180px) {
  .year-end-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .year-end-item-filter { grid-column: span 1; }
  .year-end-two-column, .client-tax-grid { grid-template-columns: 1fr; }
}
@media (max-width: 840px) {
  .finance-overview-head, .year-end-hero { align-items: flex-start; flex-direction: column; }
  .finance-kpi-grid, .year-end-kpis { grid-template-columns: 1fr; }
  .year-shortcuts { justify-content: flex-start; }
  .year-end-filter-grid { grid-template-columns: 1fr; }
  .year-end-filter-actions { flex-wrap: wrap; }
}


/* V7.0 multi-tenant business context ------------------------------------- */
.tenant-switcher { margin: 0 14px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 12px; background: rgba(255,255,255,.05); color: #fff; }
.tenant-switcher summary { cursor: pointer; padding: 10px 12px; font-size: .78rem; font-weight: 800; list-style: none; }
.tenant-switcher summary::-webkit-details-marker { display: none; }
.tenant-switcher-menu { display: grid; gap: 6px; padding: 0 8px 8px; }
.tenant-switch-button { width: 100%; padding: 9px 10px; border: 0; border-radius: 9px; text-align: left; background: rgba(255,255,255,.09); color: #fff; cursor: pointer; font: inherit; font-size: .76rem; font-weight: 700; }
.tenant-switch-button:hover { background: rgba(255,255,255,.16); }

/* V7.1 tenant configuration ------------------------------------------------ */
.settings-form { display: grid; gap: 18px; }
.settings-section { padding: 22px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.toggle-stack { display: grid; align-content: end; gap: 8px; }
.sticky-settings-actions { position: sticky; bottom: 14px; z-index: 5; width: fit-content; max-width: calc(100% - 24px); margin-left: auto; justify-self: end; justify-content: flex-end; padding: 12px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); }
.deposit-mode-toggle { display: inline-flex; flex-wrap: wrap; gap: 6px; width: fit-content; padding: 5px; border: 1px solid var(--border); border-radius: 12px; background: #f7f9fc; }
.deposit-mode-option { position: relative; cursor: pointer; }
.deposit-mode-input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; pointer-events: none; }
.deposit-mode-option span { display: block; min-width: 122px; padding: 9px 14px; border-radius: 9px; text-align: center; color: var(--muted); font-weight: 800; transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
.deposit-mode-input:checked + span { background: #fff; color: var(--navy-900); box-shadow: 0 2px 8px rgba(16,28,53,.12); }
.deposit-mode-input:focus-visible + span { outline: 3px solid rgba(46,196,182,.28); outline-offset: 2px; }
.deposit-default-value-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 12px; }
.deposit-default-value[hidden] { display: none !important; }
@media (max-width: 900px) { .form-grid-3 { grid-template-columns: 1fr; } .sticky-settings-actions { position: static; width: 100%; max-width: none; margin-left: 0; justify-self: stretch; } .deposit-default-value-grid { grid-template-columns: 1fr; } }

/* V7.2 SaaS platform administration -------------------------------------- */
.platform-page-header { border-bottom: 1px solid var(--border); padding-bottom: 18px; }
.platform-kpi-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:14px; margin-bottom:20px; }
.platform-kpi { min-height:132px; }
.platform-kpi strong { display:block; margin:7px 0 5px; color:var(--navy-900); font-size:1.8rem; }
.platform-kpi small { color:var(--muted); }
.platform-small-value { font-size:1.15rem !important; }
.platform-grid-2 { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:20px; }
.platform-link-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.platform-link-grid a { display:grid; gap:4px; padding:15px; border:1px solid var(--border); border-radius:14px; text-decoration:none; background:#fbfcff; color:var(--navy-900); }
.platform-link-grid a span { color:var(--muted); font-size:.78rem; }
.platform-filter-bar { display:flex; gap:10px; align-items:center; margin-bottom:16px; }
.platform-filter-bar .field-input { max-width:320px; }
.platform-form-narrow { max-width:900px; }
.platform-detail-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:0 0 18px; }
.platform-detail-list div { padding:11px 12px; border:1px solid var(--border); border-radius:12px; background:#fbfcff; }
.platform-detail-list dt { color:var(--muted); font-size:.72rem; font-weight:800; text-transform:uppercase; }
.platform-detail-list dd { margin:4px 0 0; font-weight:800; color:var(--navy-900); }
.platform-feature-form { display:grid; grid-template-columns:120px minmax(160px,1fr) auto; gap:7px; min-width:360px; }
.platform-limit-input { max-width:150px; }
.platform-audit-row { display:grid; grid-template-columns:minmax(150px,.7fr) minmax(180px,1.4fr) auto; gap:12px; align-items:center; padding:10px 0; border-bottom:1px solid var(--border); }
.platform-audit-row:last-child { border-bottom:0; }
.platform-audit-row span,.platform-audit-row small { color:var(--muted); }
.support-access-panel { border-color:#c7d8ef; background:linear-gradient(145deg,#f4f8ff,#fff); }
.support-mode-banner { position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; gap:14px; margin:-28px -28px 22px; padding:13px 18px; color:#fff; background:#7a321d; box-shadow:0 8px 24px rgba(50,20,12,.18); }
.support-mode-banner div { display:grid; gap:2px; }
.support-mode-banner span { font-size:.76rem; color:#ffe6dd; }
.support-mode-banner .secondary-button { background:#fff; color:#7a321d; border-color:#fff; }
.status-badge { display:inline-flex; padding:4px 8px; border-radius:999px; font-size:.69rem; font-weight:900; letter-spacing:.03em; text-transform:uppercase; }
.status-active { background:#e8f8ef; color:#17623b; }
.status-warning { background:#fff0e8; color:#9a431f; }
.security-callout { align-self:start; background:#f7f9fc; border-style:dashed; }
@media (max-width:1100px) { .platform-kpi-grid,.platform-link-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } .platform-grid-2 { grid-template-columns:1fr; } }
@media (max-width:700px) { .platform-kpi-grid,.platform-link-grid,.platform-detail-list { grid-template-columns:1fr; } .platform-feature-form { grid-template-columns:1fr; min-width:220px; } .support-mode-banner { position:static; flex-direction:column; align-items:flex-start; } }


/* V7.4.1 cosmetic layout refinements ------------------------------------- */
/* Subscription & Billing gets dedicated summary cards rather than relying
   on reporting-specific classes. This keeps plan/status/usage information
   visually separated and responsive. */
.billing-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 22px;
}
.billing-summary-card {
  min-width: 0;
  min-height: 128px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
}
.billing-summary-card .mini-label {
  margin-bottom: 10px;
}
.billing-summary-card > strong {
  display: block;
  width: 100%;
  margin: 0 0 8px;
  color: var(--navy-900);
  font-size: clamp(1.05rem, 1.4vw, 1.35rem);
  line-height: 1.22;
  overflow-wrap: anywhere;
}
.billing-summary-card > small {
  display: block;
  margin-top: auto;
  padding-top: 4px;
  color: var(--muted);
  font-size: .74rem;
  line-height: 1.45;
}

/* V7.9.0 quote detail full-workspace correction -------------------------
   The legacy V6.15 expense stylesheet later redefines the generic
   .detail-grid as a three-column layout. Quote detail intentionally uses a
   flexible primary workspace plus a stable right rail, so restate this rule
   after the legacy block to prevent an unused third column on wide screens. */
.quote-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 22px;
  align-items: start;
  width: 100%;
}
.quote-detail-grid > .detail-stack,
.quote-detail-grid > .detail-side-stack {
  min-width: 0;
}
.quote-detail-grid .detail-side-stack {
  width: 100%;
}

@media (max-width: 1320px) {
  .quote-detail-grid { grid-template-columns: minmax(0, 1fr) minmax(330px, 380px); }
}
@media (max-width: 980px) {
  .quote-detail-grid { grid-template-columns: 1fr; }
  .quote-detail-grid .detail-side-stack { position: static; }
}

/* The legacy V6.15 expense stylesheet later redefined .detail-grid as a
   three-column grid. Give invoice detail an explicit late rule so the invoice
   always uses the full workspace: primary content on the left and financial /
   delivery / payment actions in a stable right rail. */
.invoice-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 22px;
  align-items: start;
  width: 100%;
}
.invoice-detail-grid > .detail-stack,
.invoice-detail-grid > .detail-side-stack {
  min-width: 0;
}
.invoice-detail-grid .detail-side-stack {
  width: 100%;
}
.invoice-page-header .header-actions {
  justify-content: flex-end;
}

@media (max-width: 1320px) {
  .billing-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .invoice-detail-grid { grid-template-columns: minmax(0, 1fr) minmax(330px, 380px); }
}
@media (max-width: 980px) {
  .invoice-detail-grid { grid-template-columns: 1fr; }
  .invoice-detail-grid .detail-side-stack { position: static; }
}
@media (max-width: 720px) {
  .billing-summary-grid { grid-template-columns: 1fr; }
  .billing-summary-card { min-height: 0; }
  .invoice-page-header .header-actions { width: 100%; justify-content: flex-start; }
}

/* V7.5 account-security center ------------------------------------------ */
.security-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:18px; }
.security-card { min-width:0; }
.security-status-row { display:flex; align-items:center; gap:10px; margin:0 0 16px; color:var(--muted); }
.compact-form { margin-top:14px; }
.security-details { margin-top:16px; border-top:1px solid var(--border); padding-top:12px; }
.security-details summary { cursor:pointer; font-weight:800; color:var(--navy-900); }
.security-secret,.security-uri { display:block; margin:8px 0 14px; padding:11px 12px; border:1px solid var(--border); border-radius:10px; background:#f6f8fb; overflow-wrap:anywhere; user-select:all; }
.recovery-code-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin:16px 0; }
.recovery-code-grid code { padding:11px 12px; border:1px solid var(--border); border-radius:10px; background:#f6f8fb; font-weight:800; text-align:center; letter-spacing:.04em; user-select:all; }
.security-warning { padding:12px 14px; border-radius:10px; background:#fff6e6; border:1px solid #efd49a; color:#714d12; }
.security-event-list { display:grid; gap:0; }
.security-event-row { display:flex; justify-content:space-between; align-items:center; gap:14px; padding:12px 0; border-bottom:1px solid var(--border); }
.security-event-row:last-child { border-bottom:0; }
.security-event-row > div { display:grid; gap:3px; }
.security-event-row > div:last-child { justify-items:end; }
.security-event-row small { color:var(--muted); }
@media (max-width:900px) { .security-grid { grid-template-columns:1fr; } }
@media (max-width:620px) { .recovery-code-grid { grid-template-columns:1fr; } .security-event-row { align-items:flex-start; flex-direction:column; } .security-event-row > div:last-child { justify-items:start; } }

/* V7.5.3 MFA enrollment UX --------------------------------------------- */
.mfa-enrollment-auth-card { width: min(840px, 100%); }

.mfa-enrollment-shell {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 12px 0 34px;
}
.mfa-enrollment-header {
  margin-bottom: 18px;
}
.mfa-enrollment-header h1 {
  margin: 4px 0 6px;
}
.mfa-enrollment-header p {
  margin: 0;
  max-width: 700px;
  color: var(--muted);
  line-height: 1.55;
}
.mfa-enrollment-card {
  padding: clamp(20px, 4vw, 34px);
  border-radius: 18px;
}
.mfa-step-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}
.mfa-step-heading h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
  color: var(--navy-900);
}
.mfa-step-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.mfa-step-number {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--navy-900);
  color: #fff;
  font-weight: 900;
  line-height: 1;
}
.mfa-qr-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 26px;
  margin: 0 0 18px 48px;
}
.mfa-qr-frame {
  display: grid;
  place-items: center;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(14, 35, 62, .08);
}
.mfa-qr-image {
  display: block;
  width: min(100%, 248px);
  height: auto;
  aspect-ratio: 1;
}
.mfa-qr-guidance {
  display: grid;
  gap: 8px;
  align-content: center;
}
.mfa-qr-guidance p,
.mfa-qr-guidance small {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.mfa-deep-link {
  width: fit-content;
  text-decoration: none;
}
.mfa-secret-warning {
  margin: 0 0 18px 48px;
  padding: 11px 13px;
  border: 1px solid #efd49a;
  border-radius: 10px;
  background: #fff9ed;
  color: #714d12;
  line-height: 1.45;
}
.mfa-manual-fallback {
  margin-left: 48px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
  overflow: hidden;
}
.mfa-manual-fallback summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: var(--navy-900);
}
.mfa-manual-content {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.mfa-manual-content > p {
  color: var(--muted);
  line-height: 1.5;
}
.mfa-manual-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.mfa-secret-value {
  margin-bottom: 0;
  font-size: .95rem;
  letter-spacing: .06em;
}
.mfa-copy-button {
  white-space: nowrap;
}
.mfa-manual-settings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0 0;
}
.mfa-manual-settings > div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
}
.mfa-manual-settings dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.mfa-manual-settings dd {
  margin: 0;
  color: var(--navy-900);
  font-weight: 800;
}
.mfa-step-divider {
  height: 1px;
  margin: 28px 0 24px;
  background: var(--border);
}
.mfa-verification-form {
  margin-left: 48px;
}
.mfa-code-input {
  max-width: 270px;
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: .28em;
  font-variant-numeric: tabular-nums;
}
.field-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}
.mfa-enable-button {
  width: 100%;
  margin-top: 4px;
}
.mfa-success-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #e8f7ee;
  color: #1d7a45;
  font-size: 1.6rem;
  font-weight: 900;
}
.recovery-step-heading {
  margin-bottom: 14px;
}
.mfa-recovery-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 16px;
}
.mfa-finish-button {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  margin-top: 16px;
}
.copy-feedback {
  outline: 3px solid rgba(28, 119, 74, .16);
}

@media (max-width: 760px) {
  .mfa-enrollment-shell { width: 100%; }
  .mfa-qr-layout {
    grid-template-columns: 1fr;
    margin-left: 0;
    gap: 16px;
  }
  .mfa-qr-frame { max-width: 300px; margin: 0 auto; }
  .mfa-qr-guidance { text-align: center; justify-items: center; }
  .mfa-secret-warning,
  .mfa-manual-fallback,
  .mfa-verification-form { margin-left: 0; }
}
@media (max-width: 560px) {
  .mfa-enrollment-card { padding: 18px; }
  .mfa-manual-row { grid-template-columns: 1fr; align-items: stretch; }
  .mfa-manual-settings { grid-template-columns: 1fr; }
  .mfa-code-input { max-width: none; width: 100%; }
  .mfa-recovery-actions { display: grid; grid-template-columns: 1fr; }
}

/* V7.6 Advanced Intelligence */
.intelligence-header { align-items: end; gap: 24px; }
.intelligence-period-form { min-width: 190px; }
.intelligence-period-form label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 12px; }
.intelligence-period-form select { min-width: 190px; }
.intelligence-kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.intelligence-kpi { background: #fff; border: 1px solid var(--border, #d9e0ea); border-radius: 16px; padding: 18px; min-width: 0; box-shadow: 0 7px 22px rgba(15, 31, 55, .05); }
.intelligence-kpi .kpi-label { display: block; color: var(--muted, #64748b); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 8px; }
.intelligence-kpi > strong { display: block; font-size: 25px; line-height: 1.1; margin-bottom: 6px; overflow-wrap: anywhere; }
.intelligence-kpi > span:last-child { color: var(--muted, #64748b); font-size: 12px; }
.health-score { font-size: 38px !important; }
.health-score small { font-size: 15px; color: var(--muted, #64748b); font-weight: 700; }
.health-badge, .confidence-pill, .status-chip { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 800; background: #eef4ff; color: #274c77; }
.intelligence-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 16px; margin-bottom: 16px; }
.intelligence-signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.intelligence-panel { padding: 20px; }
.panel-heading, .ai-advisor-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.panel-heading h2, .intelligence-panel h2 { margin-top: 3px; }
.metric-list { margin: 14px 0 0; }
.metric-list > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border, #e2e8f0); }
.metric-list dt { color: var(--muted, #64748b); }
.metric-list dd { margin: 0; font-weight: 800; }
.signal-stack { display: grid; gap: 10px; margin-top: 14px; }
.signal-card { border: 1px solid var(--border, #e2e8f0); border-radius: 13px; padding: 14px; background: #fafcff; }
.signal-card.opportunity { border-left: 4px solid #2f855a; }
.signal-card.risk { border-left: 4px solid #c05621; }
.signal-card p { margin: 5px 0 0; color: var(--muted, #475569); line-height: 1.55; }
.value-positive { color: #137333 !important; }
.value-negative { color: #b42318 !important; }
.microcopy { color: var(--muted, #64748b); font-size: 11px; margin: 12px 0 0; }
.ai-advisor-panel { margin-bottom: 24px; }
.status-active { background: #e9f8ef; color: #176b3a; }
.status-muted { background: #eef2f7; color: #52606d; }
.status-error { background: #fff0ef; color: #a62a20; }
.privacy-callout { margin: 16px 0; border: 1px solid #bfd8f6; background: #f4f9ff; border-radius: 13px; padding: 14px 16px; }
.privacy-callout p { margin: 5px 0 0; line-height: 1.5; color: #425466; }
.ai-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ai-settings-form, .ai-generation-card { border: 1px solid var(--border, #e2e8f0); border-radius: 14px; padding: 16px; background: #fff; }
.ai-settings-form h3, .ai-generation-card h3 { margin-top: 0; }
.ai-generation-card form { display: grid; gap: 9px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0; line-height: 1.45; }
.check-row input { width: auto; margin-top: 3px; }
.ai-history { margin-top: 18px; }
.history-list { border: 1px solid var(--border, #e2e8f0); border-radius: 13px; overflow: hidden; }
.history-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 14px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--border, #e2e8f0); background: #fff; }
.history-row:last-child { border-bottom: 0; }
.history-row:hover { background: #f8fafc; }
.history-row small { display: block; color: var(--muted, #64748b); margin-top: 3px; }
.ai-generated-label { display: flex; flex-direction: column; gap: 3px; border-bottom: 1px solid var(--border, #e2e8f0); padding-bottom: 14px; margin-bottom: 16px; }
.ai-generated-label span { color: var(--muted, #64748b); font-size: 12px; }
.ai-briefing-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.65; margin: 0; background: transparent; }
.briefing-meta { display: grid; gap: 6px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border, #e2e8f0); color: var(--muted, #64748b); font-size: 11px; }
.briefing-meta code { overflow-wrap: anywhere; }
@media (max-width: 1200px) { .intelligence-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .intelligence-layout, .intelligence-signal-grid, .ai-control-grid { grid-template-columns: 1fr; } .intelligence-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .intelligence-header { align-items: stretch; } }
@media (max-width: 620px) { .intelligence-kpi-grid { grid-template-columns: 1fr; } .panel-heading, .ai-advisor-heading { flex-direction: column; } }

/* V7.6.4 quote palette workflow + compact invoice cancellation ------------ */
.quote-palette-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.quote-palette-refresh-status {
  min-width: 0;
}
.invoice-page-header .invoice-cancel-button {
  width: auto;
  min-height: 36px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: .8rem;
}
@media (max-width: 720px) {
  .invoice-page-header .invoice-cancel-button {
    width: auto;
  }
}

/* V8.0 multi-vendor catalog + generalized inventory */
.palette-search-form-v8 { grid-template-columns: minmax(150px,.8fr) minmax(220px,1.5fr) minmax(140px,.8fr) minmax(140px,.8fr) auto auto; }
.palette-card-vendor { display:block; color:var(--purple-700, #7d3fc1); font-size:.68rem !important; font-weight:800; letter-spacing:.05em; text-transform:uppercase; }
.vendor-preference-grid, .vendor-admin-grid, .inventory-category-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:14px; }
.vendor-preference-card, .inventory-category-card { border:1px solid var(--border); border-radius:14px; padding:16px; background:#fff; display:grid; gap:12px; }
.vendor-preference-card h3, .vendor-admin-card h3 { margin:2px 0 4px; }
.vendor-default-choice { display:flex; gap:8px; align-items:center; font-size:.82rem; color:var(--muted); }
.vendor-admin-card { border:1px solid var(--border); border-radius:14px; padding:16px; background:#fff; text-decoration:none; color:inherit; display:grid; gap:6px; transition:transform .12s ease, box-shadow .12s ease; }
.vendor-admin-card:hover { transform:translateY(-1px); box-shadow:0 10px 28px rgba(16,28,53,.08); }
.vendor-admin-card > strong { font-size:1.8rem; color:var(--navy-900); }
.vendor-admin-card > span, .vendor-admin-card > small { color:var(--muted); }
.vendor-admin-swatch-grid .vendor-swatch-admin-card { min-height:190px; }
/* V8.1.0 Hotfix 21 — uniform Inventory add-item row alignment */
.inventory-track-form-v8 { grid-template-columns:repeat(4,minmax(150px,1fr)); align-items:start; }
.inventory-track-form-v8 .inventory-track-submit { grid-column:-2 / -1; align-self:end; margin-bottom:0; }
.inventory-filter-form-v8 { grid-template-columns:minmax(170px,1fr) repeat(3,minmax(130px,.7fr)) auto auto auto; }
.inventory-category-icon { width:32px; height:32px; border-radius:10px; display:inline-grid; place-items:center; flex:0 0 auto; background:linear-gradient(135deg,#eff3fb,#f4eefe); color:var(--purple-700,#7d3fc1); font-size:.72rem; font-weight:900; border:1px solid var(--border); }
.inventory-category-icon.large { width:48px; height:48px; border-radius:14px; font-size:.85rem; }
.inventory-category-create { align-items:end; }
.inventory-form-help { margin-top:10px; }
[hidden].balloon-only-field, [hidden].general-only-field { display:none !important; }
@media (max-width: 1200px) {
  .inventory-track-form-v8 { grid-template-columns:repeat(2,minmax(180px,1fr)); }
  .inventory-filter-form-v8 { grid-template-columns:repeat(2,minmax(160px,1fr)); }
  .palette-search-form-v8 { grid-template-columns:repeat(2,minmax(180px,1fr)); }
}
@media (max-width: 720px) {
  .inventory-track-form-v8, .inventory-filter-form-v8, .palette-search-form-v8 { grid-template-columns:1fr; }
}

/* V8.1.0 UI Hotfix 03 — bounded Account Security history --------------- */
.security-history-panel { margin-top: 18px; overflow: hidden; }
.security-history-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; padding:20px 22px 12px; }
.security-history-limit { flex:0 0 auto; padding:6px 9px; border-radius:999px; background:#f3f6fa; border:1px solid var(--border); color:var(--muted); font-size:.7rem; font-weight:800; white-space:nowrap; }
.security-history-filter { display:grid; grid-template-columns:repeat(4,minmax(145px,1fr)); gap:10px 12px; padding:0 22px 18px; border-bottom:1px solid var(--border); }
.security-event-filter { grid-template-columns:repeat(3,minmax(160px,1fr)); }
.security-history-filter .field-group { margin:0; }
.security-history-filter .field-input { min-width:0; width:100%; }
.security-history-filter-actions { display:flex; align-items:center; gap:12px; align-self:end; min-height:42px; }
.security-history-cap-note { margin:12px 22px 0; padding:10px 12px; border:1px solid #efd49a; border-radius:10px; background:#fff8eb; color:#714d12; font-size:.76rem; }
.security-history-scroll { overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.security-session-scroll { max-height:calc(15 * 3.75rem + 2.75rem); }
.security-central-event-scroll { max-height:calc(15 * 3.75rem + 2.75rem); }
.security-central-event-scroll .data-table thead th { position:sticky; top:0; z-index:2; box-shadow:0 1px 0 #edf0f5; }
.security-central-event-scroll .data-table td { height:3.75rem; padding-top:10px; padding-bottom:10px; vertical-align:middle; }
.security-central-event-scroll .data-table td { white-space:nowrap; }
.security-event-scroll { max-height:calc(15 * 4.5rem); padding:0 22px; }
.security-session-scroll .data-table thead th { position:sticky; top:0; z-index:2; box-shadow:0 1px 0 #edf0f5; }
.security-session-scroll .data-table td { height:3.75rem; padding-top:10px; padding-bottom:10px; }
.security-event-scroll .security-event-row { min-height:4.5rem; }
@media (max-width:1100px) {
  .security-history-filter, .security-event-filter { grid-template-columns:repeat(2,minmax(160px,1fr)); }
}
@media (max-width:700px) {
  .security-history-heading { flex-direction:column; }
  .security-history-filter, .security-event-filter { grid-template-columns:1fr; }
  .security-history-filter-actions { flex-wrap:wrap; }
  .security-history-limit { white-space:normal; }
}

.security-session-scroll .data-table td:first-child { max-width:360px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.security-session-scroll .data-table td:nth-child(n+2) { white-space:nowrap; }
.security-event-scroll .security-event-row { height:4.5rem; overflow:hidden; }
.security-event-scroll .security-event-row > div:first-child { min-width:0; overflow:hidden; }
.security-event-scroll .security-event-row small { display:block; max-width:min(720px,60vw); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }

/* V8.1.0 UI Hotfix 05 — bounded Users & Roles administration ---------- */
.admin-directory-filter { grid-template-columns:minmax(260px,2fr) minmax(220px,1fr); }
.admin-security-filter { grid-template-columns:repeat(3,minmax(160px,1fr)); }
.admin-security-admin-scroll { max-height:calc(15 * 3.75rem + 2.75rem); }
.admin-security-admin-scroll .data-table thead th { position:sticky; top:0; z-index:2; box-shadow:0 1px 0 #edf0f5; }
.admin-security-admin-scroll .data-table td { height:3.75rem; padding-top:10px; padding-bottom:10px; vertical-align:middle; }
.admin-security-admin-scroll .data-table td:first-child,
.admin-security-admin-scroll .data-table td:nth-child(2),
.admin-security-admin-scroll .data-table td:nth-child(3) { white-space:nowrap; }
.admin-security-admin-scroll .admin-audit-details { max-width:min(720px,55vw); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
@media (max-width:1000px) {
  .admin-security-filter { grid-template-columns:repeat(2,minmax(160px,1fr)); }
}
@media (max-width:700px) {
  .admin-directory-filter, .admin-security-filter { grid-template-columns:1fr; }
}

/* V8.1 secure electronic-signature workflow */
.signature-policy-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.signature-policy-card { border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px; display: flex; justify-content: space-between; align-items: center; gap: 18px; background: #fbfcfe; }
.signature-policy-card p { margin: 4px 0 0; color: #667085; font-size: .78rem; line-height: 1.45; }
.settings-toggle-switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; flex: 0 0 auto; }
.settings-toggle-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.settings-toggle-slider { width: 46px; height: 25px; border-radius: 999px; background: #cbd5e1; position: relative; transition: background .18s ease; box-shadow: inset 0 0 0 1px rgba(15,23,42,.08); }
.settings-toggle-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.28); transition: transform .18s ease; }
.settings-toggle-input:checked + .settings-toggle-slider { background: #17365D; }
.settings-toggle-input:checked + .settings-toggle-slider::after { transform: translateX(21px); }
.settings-toggle-input:focus-visible + .settings-toggle-slider { outline: 3px solid rgba(23,54,93,.25); outline-offset: 2px; }
.settings-toggle-label { min-width: 54px; color: #344054; font-size: .76rem; font-weight: 800; }
.security-callout { margin-top: 14px; padding: 12px 14px; border-radius: 9px; background: #f0f7ff; border: 1px solid #c9def5; color: #29435f; font-size: .78rem; line-height: 1.5; }
.electronic-signature-panel { border: 1px solid #c9d6e6; border-radius: 12px; padding: 16px; background: #f9fbfe; display: grid; gap: 14px; }
.signature-panel-heading h3 { margin: 3px 0 5px; color: #17365D; }
.signature-panel-heading p { margin: 0; color: #667085; font-size: .82rem; line-height: 1.5; }
.signature-canvas-wrap { border: 1px solid #98a2b3; border-radius: 8px; background: #fff; overflow: hidden; }
.signature-canvas { display: block; width: 100%; height: 190px; background: #fff; touch-action: none; cursor: crosshair; }
.signature-canvas:focus { outline: 3px solid rgba(23,54,93,.22); outline-offset: -3px; }
.signature-canvas-error { box-shadow: inset 0 0 0 2px #b42318; }
.signature-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; }
.signature-help { color: #667085; font-size: .74rem; }
.signature-ack-row { display: flex; align-items: flex-start; gap: 9px; padding: 11px; border-radius: 8px; background: #fff; border: 1px solid #e2e8f0; color: #344054; font-size: .79rem; line-height: 1.45; }
.signature-ack-row input { margin-top: 2px; flex: 0 0 auto; }
.signature-error { padding: 10px 12px; border-radius: 8px; border: 1px solid #f7b6b2; background: #fff1f0; color: #9f1c16; font-weight: 700; font-size: .79rem; }
.acceptance-evidence-card .acceptance-signature-image { max-width: 360px; width: 100%; max-height: 120px; object-fit: contain; background: #fff; border: 1px solid #d9e0ea; border-radius: 7px; padding: 8px; }
.hash-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; overflow-wrap: anywhere; }
@media (max-width: 760px) { .signature-policy-grid { grid-template-columns: 1fr; } .signature-policy-card { align-items: flex-start; flex-direction: column; } .signature-canvas { height: 165px; } }
.signature-proof-panel { margin-top: 16px; display: grid; gap: 8px; }
.acceptance-evidence-card .detail-list dd { min-width: 0; overflow-wrap: anywhere; }

/* V8.1 Business Notes / Knowledge Base */
.notes-filter-form { display:grid; grid-template-columns:minmax(230px,2fr) minmax(160px,1fr) minmax(130px,.7fr) auto auto; gap:10px; align-items:center; }
.notes-list-scroll { max-height:calc(15 * 3.75rem + 2.75rem); overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.notes-guidance-panel { margin-top:18px; }
.notes-editor-panel form { display:grid; gap:18px; }
.note-body-input { min-height:300px; resize:vertical; line-height:1.55; }
.notes-detail-grid { display:grid; grid-template-columns:minmax(0,2fr) minmax(280px,.8fr); gap:18px; align-items:start; }
.note-body-display { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.7; font-size:1rem; }
.note-tag-line { display:flex; gap:12px; align-items:baseline; padding-bottom:16px; margin-bottom:18px; border-bottom:1px solid var(--border-color, #d9e1ec); overflow-wrap:anywhere; }
.note-tags-compact { display:block; max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notes-meta-list { margin:14px 0 0; display:grid; gap:12px; }
.notes-meta-list > div { display:grid; gap:3px; padding-bottom:10px; border-bottom:1px solid var(--border-color, #d9e1ec); }
.notes-meta-list dt { font-size:.78rem; font-weight:800; text-transform:uppercase; letter-spacing:.04em; opacity:.72; }
.notes-meta-list dd { margin:0; overflow-wrap:anywhere; }
.notes-actions-panel { margin-top:18px; }
.notes-action-row { justify-content:flex-start; flex-wrap:wrap; margin-top:10px; }
.notes-action-row form { margin:0; }
@media (max-width: 900px) {
  .notes-filter-form { grid-template-columns:1fr 1fr; }
  .notes-detail-grid { grid-template-columns:1fr; }
}
@media (max-width: 620px) {
  .notes-filter-form { grid-template-columns:1fr; }
}

/* V8.1 Hotfix 16: palette inventory-at-a-glance -------------------------- */
.palette-stock-help { display:flex; justify-content:space-between; gap:12px; align-items:center; flex-wrap:wrap; margin:0 0 12px; padding:9px 11px; border:1px solid var(--border); border-radius:11px; background:#fbfcfe; color:var(--muted); font-size:.74rem; }
.palette-stock-legend { display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:.7rem; font-weight:800; }
.palette-stock-legend > span { display:inline-flex; align-items:center; gap:5px; }
.palette-stock-legend i, .palette-stock-dot { width:9px; height:9px; border-radius:999px; display:inline-block; flex:0 0 auto; }
.palette-stock-legend-in i, .palette-stock-badge-in .palette-stock-dot { background:#16803a; }
.palette-stock-legend-low i, .palette-stock-badge-low .palette-stock-dot { background:#c27300; }
.palette-stock-legend-out i, .palette-stock-badge-out .palette-stock-dot, .palette-stock-dot-out { background:#b42318; }
.palette-stock-legend-out { color:#b42318; }
.palette-card-stock-aware { padding-top:14px; }
.palette-stock-trigger { outline:none; }
.palette-stock-trigger:focus-visible { box-shadow:0 0 0 3px rgba(45,91,170,.25), inset 0 0 0 1px rgba(255,255,255,.28); }
.palette-stock-badge { position:absolute; left:62px; top:18px; min-height:24px; padding:3px 7px; border-radius:999px; display:inline-flex !important; align-items:center; gap:5px; width:max-content; max-width:78px; font-size:.66rem !important; font-weight:900; line-height:1; border:1px solid transparent; background:#f7f9fc; z-index:1; }
.palette-stock-badge-in { color:#126b31 !important; border-color:#b7e2c4; background:#eefaf2; }
.palette-stock-badge-low { color:#9a4d00 !important; border-color:#f0cf91; background:#fff8e8; }
.palette-stock-badge-out { color:#b42318 !important; border-color:#f1b8b3; background:#fff1f0; }
.palette-inventory-tooltip { position:fixed; z-index:500; width:min(300px,calc(100vw - 20px)); max-height:min(390px,calc(100vh - 20px)); overflow:auto; padding:13px 14px; border:1px solid #cfd8e8; border-radius:13px; background:#fff; color:var(--navy-900); box-shadow:0 18px 45px rgba(16,28,53,.22); pointer-events:none; }
.palette-inventory-tooltip[hidden] { display:none !important; }
.palette-inventory-tooltip-head { display:grid; gap:2px; padding-bottom:9px; margin-bottom:8px; border-bottom:1px solid var(--border); }
.palette-inventory-tooltip-head strong { font-size:.83rem; }
.palette-inventory-tooltip-head span { color:var(--muted); font-size:.68rem; }
.palette-inventory-tooltip-empty { display:flex; align-items:center; gap:9px; padding:5px 0 8px; color:#b42318; font-size:.76rem; font-weight:850; }
.palette-inventory-size-list { display:grid; gap:5px; }
.palette-inventory-size-row { display:grid; grid-template-columns:52px 1fr auto; gap:8px; align-items:center; padding:6px 7px; border-radius:8px; background:#f8fafc; font-size:.72rem; }
.palette-inventory-size-row strong { color:var(--navy-900); }
.palette-inventory-size-row small { color:var(--muted); text-align:right; }
.palette-inventory-size-row.is-low, .palette-inventory-size-row.is-out { background:#fff1f0; }
.palette-inventory-size-row.is-low strong, .palette-inventory-size-row.is-low .palette-inventory-qty, .palette-inventory-size-row.is-out strong, .palette-inventory-size-row.is-out .palette-inventory-qty, .palette-inventory-size-row.is-low small, .palette-inventory-size-row.is-out small { color:#b42318; }
.palette-inventory-qty { font-weight:850; color:#126b31; }
.palette-inventory-tooltip-total { display:flex; justify-content:space-between; gap:10px; margin-top:9px; padding-top:9px; border-top:1px solid var(--border); font-size:.73rem; }
.palette-inventory-tooltip-total strong { color:var(--navy-900); }
@media (max-width:720px) { .palette-stock-help { align-items:flex-start; } .palette-inventory-tooltip { width:min(320px,calc(100vw - 16px)); } }

/* V8.1.0 Hotfix 20 — local searchable inventory balloon color picker ---- */
.inventory-color-combobox { position:relative; min-width:0; }
.inventory-color-native-select { display:none; }
.inventory-color-search-input { padding-right:38px; }
.inventory-color-combobox::after { content:"⌄"; position:absolute; right:13px; top:50%; transform:translateY(-52%); color:#667085; font-size:1rem; font-weight:900; pointer-events:none; }
.inventory-color-search-results { position:absolute; z-index:120; top:calc(100% + 6px); left:0; right:0; max-height:300px; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; padding:6px; border:1px solid #cfd8e8; border-radius:12px; background:#fff; box-shadow:0 16px 38px rgba(16,28,53,.16); }
.inventory-color-search-results[hidden] { display:none !important; }
.inventory-color-search-option { display:block; width:100%; min-height:38px; padding:8px 10px; border:0; border-radius:8px; background:transparent; color:var(--text); text-align:left; line-height:1.35; cursor:pointer; overflow-wrap:anywhere; }
.inventory-color-search-option:hover,
.inventory-color-search-option.is-active { background:#f4f7fb; color:var(--navy-900); outline:none; }
.inventory-color-search-option[aria-selected="true"] { font-weight:850; background:#fff8e8; color:#76530d; }
.inventory-color-search-empty { padding:10px; color:var(--muted); font-size:.74rem; line-height:1.45; }
.inventory-color-search-hint { color:var(--muted); font-size:.68rem; line-height:1.4; }
@media (max-width:640px) { .inventory-color-search-results { max-height:240px; } }

/* V8.1.0 Hotfix 18 — bounded Platform Trial Guard history ------------- */
.platform-trial-history-filter { grid-template-columns:repeat(4,minmax(145px,1fr)); }
.platform-trial-history-scroll { max-height:calc(15 * 3.75rem + 2.75rem); }
.platform-trial-history-scroll .data-table thead th { position:sticky; top:0; z-index:2; box-shadow:0 1px 0 #edf0f5; }
.platform-trial-history-scroll .data-table td { height:3.75rem; padding-top:10px; padding-bottom:10px; vertical-align:middle; white-space:nowrap; }
.platform-trial-history-scroll .data-table td:last-child { max-width:360px; overflow:hidden; text-overflow:ellipsis; }
@media (max-width:1100px) { .platform-trial-history-filter { grid-template-columns:repeat(2,minmax(160px,1fr)); } }
@media (max-width:700px) { .platform-trial-history-filter { grid-template-columns:1fr; } }

/* V8.1.0 Hotfix 19 — inventory section exports + bounded activity search */
.inventory-section-toolbar,
.inventory-section-heading { align-items:flex-start; gap:16px; }
.inventory-export-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.inventory-export-actions .inline-form { gap:0; }
.inventory-stock-filter { margin-bottom:14px; }
.inventory-activity-filter { grid-template-columns:repeat(4,minmax(145px,1fr)); padding-top:0; }
.inventory-activity-filter-note { margin:10px 22px 0; }
.inventory-filter-cap-note { margin:12px 22px 0; }
.inventory-history-panel .recent-records-scroll { max-height:calc(15 * 3.75rem + 2.75rem); overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.inventory-history-panel .recent-records-scroll thead th { position:sticky; top:0; z-index:2; background:#fff; box-shadow:0 1px 0 #edf0f5; }
.inventory-history-panel .recent-records-scroll td { height:3.75rem; vertical-align:middle; }
@media (max-width:1100px) {
  .inventory-activity-filter { grid-template-columns:repeat(2,minmax(160px,1fr)); }
}
@media (max-width:720px) {
  .inventory-section-toolbar,
  .inventory-section-heading { flex-direction:column; align-items:stretch; }
  .inventory-export-actions { justify-content:flex-start; }
  .inventory-activity-filter { grid-template-columns:1fr; }
  .inventory-activity-filter-note,
  .inventory-filter-cap-note { margin-left:0; margin-right:0; }
}

/* V8.1.0 Hotfix 22 — 15-row Inventory Stock server-side pagination ----- */
.inventory-stock-table-scroll { overflow-x:auto; }
.inventory-stock-pagination { margin-top:0; justify-content:flex-end; gap:10px; padding:14px 0 0; border-top:0; }
.inventory-stock-page-label { min-width:72px; text-align:center; color:var(--muted); font-weight:800; }
.pagination-disabled { opacity:.45; cursor:not-allowed; pointer-events:none; user-select:none; }
@media (max-width:640px) {
  .inventory-stock-pagination { justify-content:center; }
}

/* V8.1 Hotfix 26 — platform legal notice + concise color disclaimers ------- */
.page-color-disclaimer {
  display:flex;
  align-items:flex-start;
  gap:5px;
  margin:-4px 0 14px;
  color:#111827;
  font-size:.78rem;
  line-height:1.45;
}
.color-disclaimer-asterisk {
  color:#d01818;
  font-size:1rem;
  font-weight:950;
  line-height:1.05;
  flex:0 0 auto;
}
.page-color-disclaimer strong { color:#111827; white-space:nowrap; }
.legal-page-header { margin-bottom:16px; }
.legal-notice-panel { max-width:980px; }
.legal-notice-panel + .legal-notice-panel { margin-top:16px; }
.legal-notice-panel p { margin:0 0 12px; color:var(--text); line-height:1.7; }
.legal-notice-panel p:last-child { margin-bottom:0; }

/* V8.1 Hotfix 27: default and searched Service Catalog results scroll after
   15 visible rows while the column headings remain visible. */
.service-catalog-scroll {
  max-height:calc(15 * 3.75rem + 2.75rem);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.service-catalog-scroll .data-table thead th {
  position:sticky;
  top:0;
  z-index:2;
  background:#fff;
  box-shadow:0 1px 0 #edf0f5;
}
.service-catalog-scroll .data-table td {
  height:3.75rem;
  vertical-align:middle;
}
@media (max-width:720px) {
  .page-color-disclaimer { margin-top:0; flex-wrap:wrap; }
  .page-color-disclaimer strong { white-space:normal; }
}


/* V8.1 Hotfix 29 — business account/data lifecycle */
.account-deletion-pending,
.danger-zone {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
}
.account-deletion-pending {
  background: linear-gradient(180deg, var(--danger-soft), var(--surface));
}
.summary-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.summary-list > div {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.summary-list dt {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.summary-list dd {
  margin: 5px 0 0;
  font-weight: 700;
}
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}
.checkbox-row input {
  margin-top: .2rem;
}

/* V8.1 Hotfix 32 — tenant Stripe Connect / invoice-payment UX */
.stripe-connect-card { border-top: 3px solid #635bff; }
.stripe-setup-modal { width: min(760px, calc(100vw - 32px)); max-height: 88vh; overflow: auto; }
.stripe-setup-intro { font-size: 1.05rem; line-height: 1.55; }
.stripe-quick-steps { margin: 16px 0; padding: 16px 18px; border: 1px solid var(--border, #d9e0ea); border-radius: 14px; background: rgba(99,91,255,.035); }
.stripe-quick-steps h3 { margin-top: 0; }
.stripe-quick-steps ol { margin-bottom: 0; padding-left: 22px; }
.stripe-quick-steps li { margin: 7px 0; }
.stripe-connection-summary code, .provider-reference code { overflow-wrap: anywhere; }
.payment-source-badge { display:inline-flex;align-items:center;gap:5px;padding:3px 8px;border-radius:999px;font-size:.72rem;font-weight:800;letter-spacing:.02em;white-space:nowrap; }
.payment-source-badge.stripe { background: rgba(99,91,255,.12); color:#5147d9; border:1px solid rgba(99,91,255,.22); }
.payment-source-badge.manual { background: rgba(23,54,93,.08); color:#17365d; border:1px solid rgba(23,54,93,.15); }
.provider-reference { margin-top:4px;font-size:.72rem;color:var(--muted, #667085);max-width:260px;overflow-wrap:anywhere; }
.stripe-payment-status-card { border-left: 4px solid #635bff; }
.public-payment-shell { min-height:68vh;display:grid;place-items:start center;padding:32px 16px; }
.public-payment-card { width:min(680px,100%);padding:clamp(24px,5vw,44px); }
.public-payment-card h1 { margin:.25rem 0 .75rem; }
.public-payment-lead { font-size:1.02rem;line-height:1.65;color:var(--text, #1f2937); }
.secure-payment-mark { width:44px;height:44px;border-radius:50%;display:grid;place-items:center;background:rgba(16,185,129,.12);color:#047857;font-weight:900;font-size:1.2rem;margin-bottom:14px; }
.public-payment-card.unavailable .secure-payment-mark { background:rgba(220,38,38,.10);color:#b91c1c; }
.stripe-payment-summary { margin:22px 0; }
.public-payment-action { margin:24px 0 12px; }
.payment-choice-list { display:grid;gap:10px;margin-top:10px; }
.payment-choice { display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--border, #d0d5dd);border-radius:10px;cursor:pointer; }
.payment-choice input { flex:0 0 auto; }
.payment-choice span { flex:1;display:flex;align-items:center;justify-content:space-between;gap:12px; }
.payment-choice small { color:var(--muted, #667085);font-size:.9rem; }
.payment-continue-button { width:100%;min-height:48px; }
.customer-comfort-note { margin-top:18px;padding:14px 16px;border:1px solid rgba(99,91,255,.18);border-radius:12px;background:rgba(99,91,255,.035);line-height:1.55; }
.public-payment-footnote { margin-top:18px;font-size:.84rem;color:var(--muted, #667085);line-height:1.5; }

/* V8.2.2 external calendar integration */
.calendar-integration-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px; margin-bottom:18px; }
.calendar-provider-card { display:grid; align-content:start; gap:16px; }
.calendar-provider-status { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.calendar-disconnect-details { margin-top:4px; }
@media (max-width:900px) { .calendar-integration-grid { grid-template-columns:1fr; } }


/* V8.2.3B Browser, mobile & accessibility hardening --------------------- */
.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 10000;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: var(--navy-900);
  border: 2px solid var(--gold-500);
  box-shadow: var(--shadow);
  font-weight: 850;
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

:where(a[href], button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid #2f6fed;
  outline-offset: 3px;
}
.sidebar :where(a[href], button, summary):focus-visible { outline-color: var(--gold-400); }

.icon-button { min-width: 44px; min-height: 44px; display: inline-grid; place-items: center; }
.table-wrap { -webkit-overflow-scrolling: touch; overscroll-behavior-inline: contain; }
.modal-card { max-height: calc(100dvh - 28px); overflow-y: auto; }
.modal-shell { max-height: calc(100dvh - 28px); overflow-y: auto; }

@media (max-width: 820px) {
  .nav-link, .nav-group-summary { min-height: 44px; }
}

@media (max-width: 580px) {
  .form-actions, .modal-actions, .modal-footer { align-items: stretch; flex-direction: column; }
  .form-actions > :is(button, a, input[type="submit"]),
  .modal-actions > :is(button, a, input[type="submit"]),
  .modal-footer > :is(button, a, input[type="submit"]) { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}


/* V8.2.4 D11C customer profile refinements */
.customer-contact-add-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding-inline: 17px;
  box-shadow: 0 12px 26px color-mix(in srgb, var(--tenant-primary, var(--gold-500)) 24%, transparent);
}
.customer-contact-add-button:hover { transform: translateY(-2px); }
.customer-contacts-scroll {
  max-height: 760px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.customer-contacts-scroll table { margin: 0; }
.customer-contacts-scroll thead th { position: sticky; top: 0; z-index: 3; background: #f7f9fc; box-shadow: 0 1px 0 var(--border); }
.customer-history-heading { margin-bottom: 4px; }
.customer-history-counts { display: flex; gap: 28px; flex-wrap: wrap; padding: 0 0 14px; }
.customer-history-counts > div { min-width: 130px; display: grid; gap: 4px; }
.customer-history-counts strong { font-size: 1.15rem; }
.customer-history-search { justify-content: flex-start; margin: 4px 0 16px; }
.customer-history-table { min-width: 680px; }
@media (max-width: 720px) {
  .customer-contact-add-button { width: 100%; }
  .customer-history-search { align-items: stretch; }
  .customer-history-search .search-wrap,
  .customer-history-search select,
  .customer-history-search .secondary-button { width: 100%; }
}

/* V8.2.4 D25D Balloons..Tied By T login branding */
.btbt-login-theme {
  background:
    radial-gradient(circle at 12% 10%, rgba(123, 44, 191, .34), transparent 34%),
    radial-gradient(circle at 88% 88%, rgba(18, 166, 183, .22), transparent 32%),
    linear-gradient(145deg, #0c2038 0%, #172a5c 46%, #351667 100%);
}

.btbt-login-theme h1,
.btbt-login-theme .auth-title,
.btbt-login-theme .login-title {
  color: #4b1f82;
}

.btbt-login-theme .eyebrow,
.btbt-login-theme .mini-label,
.btbt-login-theme .auth-eyebrow {
  color: #7c2dbb;
}

.btbt-login-theme a {
  color: #5f2aa6;
}

.btbt-login-theme a:hover,
.btbt-login-theme a:focus-visible {
  color: #159fb1;
}

.btbt-login-theme input:focus,
.btbt-login-theme select:focus,
.btbt-login-theme textarea:focus {
  border-color: #18a6b8;
  box-shadow: 0 0 0 3px rgba(24, 166, 184, .16);
}

.btbt-login-theme button[type="submit"],
.btbt-login-theme input[type="submit"],
.btbt-login-theme .primary-button {
  background: linear-gradient(90deg, #7c2dbb 0%, #3f43b9 52%, #159fb1 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 12px 28px rgba(74, 35, 134, .20);
}

.btbt-login-theme button[type="submit"]:hover,
.btbt-login-theme button[type="submit"]:focus-visible,
.btbt-login-theme input[type="submit"]:hover,
.btbt-login-theme input[type="submit"]:focus-visible,
.btbt-login-theme .primary-button:hover,
.btbt-login-theme .primary-button:focus-visible {
  filter: brightness(1.05);
}

.btbt-login-brand-mark {
  width: 108px !important;
  height: 76px !important;
  min-width: 108px !important;
  padding: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: visible !important;
  box-shadow: none !important;
}

.btbt-login-logo {
  display: block;
  width: 108px;
  height: 76px;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 560px) {
  .btbt-login-brand-mark {
    width: 92px !important;
    height: 66px !important;
    min-width: 92px !important;
  }

  .btbt-login-logo {
    width: 92px;
    height: 66px;
  }
}

/* V8.2.4 D25D Hotfix 2A login copy + palette alignment */
.btbt-login-theme .btbt-login-brand-title {
  color: #ffffff !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em;
}

.btbt-login-theme h1,
.btbt-login-theme .btbt-login-heading {
  color: #ffffff !important;
}

.btbt-login-theme label {
  color: #ffffff !important;
  font-weight: 700;
}

.btbt-login-theme a {
  color: #34d3c7 !important;
}

.btbt-login-theme a:hover,
.btbt-login-theme a:focus-visible {
  color: #7cebe2 !important;
}

.btbt-login-theme .btbt-login-brand-mark {
  border-radius: 20px !important;
  overflow: hidden !important;
}

.btbt-login-theme .btbt-login-logo {
  border-radius: 20px !important;
}

/* V8.2.4 D25D Hotfix 4 final login cleanup */
.btbt-login-theme h1,
.btbt-login-theme .auth-title,
.btbt-login-theme .login-title,
.btbt-login-theme .btbt-login-heading {
  color: #ffffff !important;
}

.btbt-login-theme .btbt-login-brand-title {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* V8.2.4 D25D Hotfix 7 exact header fix */
.btbt-login-theme .btbt-login-brand-title,
.btbt-login-theme .btbt-login-heading {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* V8.2.5 D27C: bounded Client Intake history tables scroll after approximately 15 records. */
.client-intake-history-scroll {
  max-height: calc(15 * 5.25rem + 3rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.client-intake-history-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface, #fff);
}

/* D30F: Quotes contextual help and in-app guide system. */
.quote-header-help-actions,
.quote-builder-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.quote-help-button {
  border-color: rgba(129, 74, 191, .28);
  color: #6f35a5;
  background: #fff;
}
.quote-help-button:hover { background: #f8f2fc; }
.quote-help-question {
  width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #18a9a0;
  color: #fff;
  font-size: .78rem;
  font-weight: 900;
}
.quote-help-dialog { width: min(720px, calc(100vw - 34px)); }
.quote-help-dialog-head .mini-label,
.quote-help-page-header .eyebrow { color: #6f35a5; }
.quote-help-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}
.quote-help-quick-card {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid #e7d7f3;
  border-radius: 13px;
  background: #fbf8fd;
}
.quote-help-quick-card strong { color: #6f35a5; font-size: .84rem; }
.quote-help-quick-card span { color: var(--muted); font-size: .76rem; line-height: 1.48; }
.quote-help-dialog-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.quote-help-page-header { align-items: center; }
.quote-help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  align-items: center;
  gap: 28px;
  padding: 26px;
  margin-bottom: 18px;
  border-top: 4px solid #18a9a0;
}
.quote-help-hero h2 { margin: 7px 0 8px; font-size: 1.35rem; }
.quote-help-hero p { margin: 0; color: var(--muted); line-height: 1.65; }
.quote-help-lifecycle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.quote-help-lifecycle span {
  padding: 9px 11px;
  border-radius: 999px;
  background: #f4ecfa;
  color: #6f35a5;
  font-size: .76rem;
  font-weight: 850;
}
.quote-help-lifecycle b { color: #18a9a0; }
.quote-help-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.quote-help-section { padding: 22px; }
.quote-help-section.span-2 { grid-column: span 2; }
.quote-help-section h2 { margin: 0 0 9px; color: #6f35a5; font-size: 1.05rem; }
.quote-help-section p,
.quote-help-section li { color: #475467; font-size: .83rem; line-height: 1.62; }
.quote-help-section ul { margin: 8px 0 0; padding-left: 20px; }
.quote-help-tip,
.quote-help-callout {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: .78rem;
  line-height: 1.5;
}
.quote-help-tip { background: #edf9f7; border: 1px solid #b8e8e3; color: #285f5b; }
.quote-help-callout { background: #f8f2fc; border: 1px solid #e4d1f1; color: #5c3b71; }
.quote-help-definition-grid,
.quote-help-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.quote-help-definition-grid > div {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-2);
}
.quote-help-definition-grid strong { color: #6f35a5; font-size: .79rem; }
.quote-help-definition-grid span { color: var(--muted); font-size: .75rem; line-height: 1.45; }
.quote-help-check-grid span {
  padding: 10px 12px;
  border-radius: 10px;
  background: #edf9f7;
  color: #285f5b;
  font-size: .76rem;
  font-weight: 700;
}
.quote-help-button-table { display: grid; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.quote-help-button-row { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(0, 2fr); }
.quote-help-button-row > * { padding: 10px 12px; border-top: 1px solid var(--border); font-size: .76rem; }
.quote-help-button-row > :first-child { color: #6f35a5; font-weight: 800; border-right: 1px solid var(--border); }
.quote-help-button-head { background: #f8f2fc; }
.quote-help-button-head > * { border-top: 0; }

.quote-help-toc {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.quote-help-toc strong { color: #6f35a5; font-size: .78rem; }
.quote-help-toc a {
  text-decoration: none;
  color: #285f5b;
  font-size: .74rem;
  font-weight: 800;
  padding: 7px 9px;
  border-radius: 999px;
  background: #edf9f7;
}
.quote-help-walkthrough { display: grid; gap: 18px; }
.quote-help-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 16px;
  padding: 22px;
  scroll-margin-top: 20px;
}
.quote-help-step-number {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #7f3fb6, #9f56d2);
  color: #fff;
  font-weight: 900;
}
.quote-help-step-body { min-width: 0; }
.quote-help-step h2 { margin: 3px 0 8px; color: #6f35a5; font-size: 1.1rem; }
.quote-help-step p { color: #475467; font-size: .84rem; line-height: 1.62; }
.quote-help-step figure {
  margin: 16px 0 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}
.quote-help-step figure img { display: block; width: 100%; height: auto; }
.quote-help-step figcaption {
  padding: 8px 11px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .7rem;
  font-weight: 700;
}
.quote-help-step .quote-help-narrow-figure { max-width: 520px; }
.quote-help-two-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quote-help-button-notes {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
.quote-help-button-notes > strong { color: #6f35a5; font-size: .78rem; }
.quote-help-button-notes > span {
  padding: 7px 9px;
  border-radius: 9px;
  background: #f7f4fa;
  color: #475467;
  font-size: .72rem;
  line-height: 1.42;
}
.quote-help-finish {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px;
  margin-top: 18px;
  border-top: 4px solid #18a9a0;
}
.quote-help-finish h2 { margin: 5px 0 4px; color: #6f35a5; }
.quote-help-finish p { margin: 0; color: var(--muted); font-size: .8rem; }

@media (max-width: 820px) {
  .quote-builder-header-actions { width: 100%; justify-content: flex-start; }
  .quote-builder-header-actions .builder-header-meta { flex: 1 1 240px; }
  .quote-help-hero,
  .quote-help-content-grid { grid-template-columns: 1fr; }
  .quote-help-section.span-2 { grid-column: span 1; }
  .quote-help-two-figures { grid-template-columns: 1fr; }
}
@media (max-width: 580px) {
  .quote-help-quick-grid,
  .quote-help-definition-grid,
  .quote-help-check-grid { grid-template-columns: 1fr; }
  .quote-help-step { grid-template-columns: 1fr; }
  .quote-help-button-row { grid-template-columns: 1fr; }
  .quote-help-button-row > :first-child { border-right: 0; }
  .quote-help-finish { align-items: flex-start; flex-direction: column; }
  .quote-help-dialog-actions .primary-button,
  .quote-help-dialog-actions .secondary-button { width: 100%; }
}


/* D30F2: Help Center reference banner for quote help surfaces. */
.quote-help-center-banner {
  flex: 1 1 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  min-width: 220px;
}
.quote-help-center-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  margin: 4px 0 14px;
}
.quote-help-center-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 999px;
  background: #cf3038;
  color: #fff;
  font-size: .84rem;
  font-weight: 900;
  letter-spacing: .16em;
  box-shadow: 0 10px 22px rgba(207, 48, 56, .18);
}
.quote-help-center-banner p,
.quote-help-center-inline p {
  margin: 0;
  max-width: 360px;
  color: #6b7280;
  font-size: .78rem;
  line-height: 1.5;
}
@media (max-width: 920px) {
  .quote-help-center-banner {
    width: 100%;
    order: 3;
  }
}

/* D30K1: keep tall reminder rule screenshots compact in the Help walkthrough. */
.quote-help-step .reminder-help-form-figure {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

/* D30M: keep Pricing Add/Edit screenshots compact in the Help walkthrough. */
.quote-help-step .pricing-help-form-figure {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

/* D30N: keep the portrait Color Palette queue screenshot compact in Help. */
.quote-help-step .color-palette-help-queue-figure {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

/* D30O: keep the Inventory item-detail Help screenshot compact and centered. */
.quote-help-step .inventory-help-detail-figure {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* D30P: keep large Expenses Help screenshots comfortable within the walkthrough. */
.quote-help-step figure.expenses-dashboard-figure,
.quote-help-step figure.expenses-categories-figure,
.quote-help-step figure.expenses-import-figure {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

/* D30Q Notes Help */
.quote-help-step .notes-help-dashboard-figure {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.quote-help-step .notes-help-form-figure {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.quote-help-step .notes-help-detail-figure {
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

/* D30R: compact Users & Roles Help walkthrough screenshots. */
.quote-help-step .admin-help-mfa-figure {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.quote-help-step .admin-help-user-form-figure {
  max-width: 610px;
  margin-left: auto;
  margin-right: auto;
}
.quote-help-step .admin-help-role-form-figure {
  max-width: 690px;
  margin-left: auto;
  margin-right: auto;
}

/* D30T: keep the tall Stripe Business Settings help screenshot compact. */
.quote-help-step .business-settings-help-stripe-figure {
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}


/* D31A Balloon Mockups + press-and-hold password reveal */
.password-hold-wrap { position: relative; display: flex; align-items: center; }
.password-hold-wrap .field-input { padding-right: 3rem; width: 100%; }
.password-hold-button { position: absolute; right: .55rem; top: 50%; transform: translateY(-50%); width: 2.15rem; height: 2.15rem; display: inline-grid; place-items: center; border: 0; border-radius: .6rem; background: transparent; color: var(--navy-700); cursor: pointer; touch-action: none; }
.password-hold-button:hover, .password-hold-button:focus-visible, .password-hold-button.revealing { background: rgba(38, 191, 180, .12); color: var(--purple-600, #9333cc); outline: none; }
.password-hold-button svg { width: 1.35rem; height: 1.35rem; }

.mockup-presentation-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(310px, .9fr); gap: 1rem; align-items: start; }
.mockup-main-preview { min-width: 0; }
.mockup-detail-stack { display: grid; gap: 1rem; }
.mockup-render-image { display: block; width: 100%; height: auto; border-radius: 1rem; border: 1px solid var(--border-color, #dce3ed); background: #f8fafc; }
.mockup-detail-list > div { grid-template-columns: 1fr auto; gap: 1rem; }
.mockup-palette-row { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }
.mockup-palette-chip { display: grid; justify-items: center; gap: .35rem; min-width: 64px; text-align: center; }
.mockup-palette-swatch { width: 46px; height: 46px; filter: drop-shadow(0 2px 3px rgba(15,23,42,.18)); }
.mockup-secondary-views { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.mockup-secondary-views .panel { display: grid; gap: .75rem; }
.mockup-engine-note { margin-top: 1rem; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.mockup-custom-color-grid { display: grid; grid-template-columns: repeat(6, minmax(80px, 1fr)); gap: .8rem; }
.mockup-color-input { width: 100%; min-height: 48px; padding: .25rem; border: 1px solid var(--border-color, #dce3ed); border-radius: .7rem; background: white; }
.mockup-size-mix-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: .8rem; }
.mockup-form-actions, .mockup-editor-save, .mockup-editor-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.mockup-editor-canvas { position: relative; max-width: 1100px; margin: 0 auto; user-select: none; }
.mockup-editor-canvas > img { display: block; width: 100%; height: auto; border-radius: 1rem; }
.mockup-editor-overlay { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.mockup-balloon-handle { stroke: rgba(255,255,255,.94); stroke-width: 2.5; paint-order: stroke; cursor: grab; opacity: .78; filter: drop-shadow(0 2px 3px rgba(15,23,42,.38)); touch-action: none; }
.mockup-balloon-handle:hover, .mockup-balloon-handle:focus-visible, .mockup-balloon-handle.selected { opacity: 1; stroke: #a855f7; stroke-width: 4; outline: none; cursor: grabbing; }
.mockup-editor-save { margin-top: 1rem; }
.compact-table td, .compact-table th { padding-top: .5rem; padding-bottom: .5rem; }

@media (max-width: 980px) {
  .mockup-presentation-grid { grid-template-columns: 1fr; }
  .mockup-secondary-views { grid-template-columns: 1fr; }
  .mockup-custom-color-grid { grid-template-columns: repeat(3, 1fr); }
  .mockup-size-mix-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .mockup-custom-color-grid, .mockup-size-mix-grid { grid-template-columns: repeat(2, 1fr); }
  .mockup-form-actions, .mockup-editor-save, .mockup-editor-toolbar, .mockup-engine-note { align-items: stretch; flex-direction: column; }
}

.quote-mockup-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .7rem; }
.record-link-card { display: grid; gap: .25rem; padding: .8rem .9rem; border: 1px solid var(--border-color, #dce3ed); border-radius: .8rem; background: #fff; text-decoration: none; color: inherit; }
.record-link-card:hover { border-color: rgba(147,51,204,.45); box-shadow: 0 5px 18px rgba(15,23,42,.08); }
.record-link-card span { color: var(--muted-text, #64748b); font-size: .86rem; }

/* D32E compact notification routing cards. */
.notification-rule-stack { gap: .65rem; }
.notification-rule-card { padding: .75rem 1rem; }
.notification-rule-form { display: grid; gap: .45rem; }
.notification-rule-line { min-width: 0; }
.notification-rule-primary {
  display: grid;
  grid-template-columns: minmax(240px, .42fr) minmax(360px, 1fr);
  gap: 1rem;
  align-items: center;
}
.notification-title-status { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.notification-title-status h2 { margin: 0; font-size: 1rem; line-height: 1.2; }
.notification-recipient-field { min-width: 0; }
.notification-recipient-input { width: 100%; min-height: 38px; }
.notification-rule-actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notification-toggle-group { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem 1.25rem; }
.notification-toggle-group .checkbox-line { margin: 0; }
.notification-save-button { flex: 0 0 auto; }
.notification-recipient-help { margin: 0; line-height: 1.25; }
@media (max-width: 900px) {
  .notification-rule-primary { grid-template-columns: 1fr; gap: .55rem; }
  .notification-rule-actions { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 560px) {
  .notification-rule-card { padding: .75rem; }
  .notification-title-status { align-items: flex-start; flex-wrap: wrap; }
  .notification-rule-actions { display: grid; grid-template-columns: 1fr; }
  .notification-toggle-group { align-items: flex-start; }
  .notification-save-button { width: 100%; }
}

/* D32E refund ledger detail rows. */
.refund-ledger-row td { background: color-mix(in srgb, var(--surface-soft, #f8fafc) 78%, transparent); font-size: .9rem; }
.refund-ledger-row td:first-child { padding-left: 1.15rem; }


/* V8.2.5 D32J — trial countdown + bounded/searchable recent businesses. */
.platform-recent-business-filter {
  display:grid;
  grid-template-columns:minmax(180px,1.5fr) minmax(145px,1fr) minmax(145px,1fr) auto;
  gap:10px;
  align-items:end;
  margin:0 0 8px;
}
.platform-recent-business-filter label { display:grid; gap:5px; }
.platform-recent-business-filter-actions { align-items:center; min-height:42px; }
.platform-recent-business-filter-note { margin:6px 0 10px; }
.platform-recent-businesses-scroll {
  max-height:calc(5 * 4.25rem + 2.75rem);
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}
.platform-recent-businesses-scroll .data-table thead th {
  position:sticky;
  top:0;
  z-index:2;
  background:var(--surface, #fff);
  box-shadow:0 1px 0 #edf0f5;
}
.platform-recent-businesses-scroll .data-table td { min-height:4.25rem; vertical-align:middle; }
@media (max-width:1050px) {
  .platform-recent-business-filter { grid-template-columns:1fr 1fr; }
}
@media (max-width:650px) {
  .platform-recent-business-filter { grid-template-columns:1fr; }
}

/* D32J2A: polished BalloonsTBT login logo */
.btbt-login-theme .auth-brand {
  justify-content: center;
  margin-bottom: 26px;
}

.btbt-login-theme .btbt-login-brand-mark {
  width: 210px !important;
  height: auto !important;
  min-width: 0 !important;
  padding: 6px !important;
  border-radius: 26px !important;
  overflow: hidden !important;
  background:
    linear-gradient(
      135deg,
      rgba(125, 67, 190, 0.90),
      rgba(31, 181, 184, 0.80),
      rgba(39, 105, 191, 0.90)
    ) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow:
    0 14px 32px rgba(0, 0, 0, 0.28),
    0 0 22px rgba(61, 201, 196, 0.12) !important;
}

.btbt-login-theme .btbt-login-logo {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  object-fit: contain;
  object-position: center;
  border-radius: 20px !important;
  overflow: hidden;
}

@media (max-width: 560px) {
  .btbt-login-theme .btbt-login-brand-mark {
    width: 180px !important;
    padding: 5px !important;
    border-radius: 23px !important;
  }

  .btbt-login-theme .btbt-login-logo {
    border-radius: 18px !important;
  }
}

/* D32K: same-time bookings remain independent and render side by side. */
.day-booking-group { display: grid; gap: 8px; }
.day-booking-group-grid { display: grid; gap: 12px; }
.day-booking-group.multiple .day-booking-group-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.day-booking-group-label { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.day-booking-group.multiple .day-booking { grid-template-columns: 110px minmax(0,1fr); }
@media (max-width: 760px) {
  .day-booking-group.multiple .day-booking-group-grid { grid-template-columns: 1fr; }
  .day-booking-group.multiple .day-booking { grid-template-columns: 1fr; }
}

/* D32L: bounded Feedback & Support history + tenant-themed refund action. */
.feedback-history-filter {
  grid-template-columns: minmax(180px, 1.25fr) minmax(150px, .9fr) minmax(150px, .9fr) auto;
}
.feedback-history-scroll {
  max-height: calc(15 * 4.25rem + 2.75rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}
.feedback-history-scroll .data-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
}
.feedback-filter-error { margin: 12px 22px; }

.refund-action-button {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid var(--gold-500);
  border-radius: 9px;
  background: var(--gold-500);
  color: var(--navy-950);
  font: inherit;
  font-size: .76rem;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: filter .14s ease, transform .14s ease, box-shadow .14s ease;
}
.refund-action-button:hover {
  color: var(--navy-950);
  filter: brightness(.92);
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(18, 36, 65, .12);
}
.refund-action-button:focus-visible {
  outline: 3px solid var(--teal-500);
  outline-offset: 2px;
}

@media (max-width: 1000px) {
  .feedback-history-filter { grid-template-columns: repeat(2, minmax(160px, 1fr)); }
}
@media (max-width: 700px) {
  .feedback-history-filter { grid-template-columns: 1fr; }
  .feedback-filter-error { margin-left: 0; margin-right: 0; }
}

