@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/*
 * JA Group Services Ltd Head Office Business OS
 *
 * This is the sole authenticated application design system. Module runtimes
 * render components and records; they do not load themes or inject overrides.
 */

:root {
  --bos-sidebar-width: 264px;
  --bos-font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bos-font-heading: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bos-canvas: #f4f6f8;
  --bos-panel: #ffffff;
  --bos-panel-soft: #f8fafc;
  --bos-sidebar: #17263d;
  --bos-sidebar-deep: #101d30;
  --bos-sidebar-hover: #223752;
  --bos-sidebar-active: #2b4669;
  --bos-sidebar-text: #f1f5f9;
  --bos-sidebar-muted: #aebdce;
  --bos-text: #233044;
  --bos-muted: #66758a;
  --bos-subtle: #8793a4;
  --bos-border: #dce3ea;
  --bos-border-soft: #e9edf2;
  --bos-accent: #3568a9;
  --bos-accent-hover: #28598f;
  --bos-accent-soft: #edf4fc;
  --bos-success: #287657;
  --bos-success-soft: #eaf7f1;
  --bos-warning: #9a661f;
  --bos-warning-soft: #fff7e8;
  --bos-danger: #a8444b;
  --bos-danger-soft: #fdf0f1;
  --bos-radius: 5px;
  --bos-radius-large: 7px;
  --bos-shadow: 0 1px 3px rgba(24, 39, 61, .07);
  --bos-shadow-raised: 0 8px 24px rgba(24, 39, 61, .12);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bos-canvas);
  color: var(--bos-text);
  font-family: var(--bos-font-body);
  font-size: 10.75px;
  line-height: 1.4;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid #78a7df;
  outline-offset: 2px;
}

[hidden] { display: none; }

.bos-visually-hidden,
#currentRouteLabel,
#accountFullName,
#accountAuthority,
#operatingContext {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Secure entrance ------------------------------------------------------- */

.login-screen {
  min-height: 100dvh;
  overflow: auto;
  background: #f3f6fa;
  color: var(--bos-text);
  font-family: var(--bos-font-body);
}

.login-topbar {
  min-height: 58px;
  padding: 10px clamp(18px, 4vw, 52px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bos-sidebar-deep);
  color: #fff;
}

.login-brand { display: flex; align-items: center; gap: 10px; }
.login-brand strong, .login-brand span { display: block; }
.login-brand strong { font-family: var(--bos-font-heading); font-size: 13px; }
.login-brand span { margin-top: 1px; color: #b7c5d6; font-size: 9.5px; }
.brand-mark, .security-seal {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: #fff;
  background: #31527c;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--bos-radius);
}
.brand-mark svg, .security-seal svg { width: 18px; height: 18px; }
.version-badge {
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 3px;
  color: #dce6f1;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .08em;
}

.security-gateway-stage {
  width: min(980px, calc(100% - 32px));
  min-height: calc(100dvh - 112px);
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, .7fr);
  align-items: center;
  gap: 22px;
}

.security-command-panel,
.security-access-panel {
  min-width: 0;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--bos-border);
  border-radius: var(--bos-radius-large);
  box-shadow: var(--bos-shadow);
}
.security-command-panel h1,
.security-access-panel h1,
.security-access-panel h2 { margin: 4px 0 8px; font-family: var(--bos-font-heading); font-size: 20px; }
.security-command-panel > p:last-of-type,
.security-access-panel > p { margin: 0; color: var(--bos-muted); font-size: 11px; line-height: 1.55; }
.security-kicker, .eyebrow {
  margin: 0;
  color: var(--bos-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gateway-health {
  margin-top: 18px;
  padding: 10px 11px;
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bos-panel-soft);
  border: 1px solid var(--bos-border);
  border-radius: var(--bos-radius);
}
.gateway-health strong, .gateway-health small { display: block; }
.gateway-health small { margin-top: 2px; color: var(--bos-muted); font-size: 9.5px; }
.entrance-health-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bos-warning); }
.gateway-health[data-state="operational"] .entrance-health-dot { background: var(--bos-success); }
.security-access-panel .security-seal { margin-bottom: 15px; }
.microsoft-login {
  min-height: 36px;
  margin-top: 18px;
  padding: 8px 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  background: var(--bos-accent);
  border: 1px solid var(--bos-accent);
  border-radius: var(--bos-radius);
  font-weight: 650;
  text-decoration: none;
}
.microsoft-login:hover { background: var(--bos-accent-hover); }
.microsoft-mark { width: 15px; height: 15px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; }
.microsoft-mark i { background: #fff; }
.configuration-note { min-height: 16px; margin: 10px 0 0; color: var(--bos-danger); font-size: 9.5px; }
.login-footer {
  min-height: 54px;
  padding: 10px clamp(18px, 4vw, 52px);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  color: var(--bos-muted);
  font-size: 9px;
}

/* Authenticated shell --------------------------------------------------- */

#appShell.business-os-shell {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  background: var(--bos-canvas);
}

.business-os-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  width: var(--bos-sidebar-width);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--bos-sidebar-text);
  background: var(--bos-sidebar);
}

.business-os-brand {
  min-height: 59px;
  padding: 11px 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  background: var(--bos-sidebar-deep);
}
.business-os-brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: var(--bos-radius);
  background: #31527c;
}
.business-os-brand-mark svg { width: 17px; height: 17px; }
.business-os-brand-copy { min-width: 0; }
.business-os-brand-copy strong, .business-os-brand-copy span { display: block; }
.business-os-brand-copy strong { color: #fff; font-family: var(--bos-font-heading); font-size: 12.5px; font-weight: 650; }
.business-os-brand-copy span { margin-top: 1px; color: var(--bos-sidebar-muted); font-size: 9px; }
.drawer-close {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
}

.business-os-search {
  margin: 9px 10px 7px;
  min-height: 30px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: var(--bos-radius);
  background: rgba(255, 255, 255, .055);
}
.business-os-search svg { width: 13px; height: 13px; stroke: var(--bos-sidebar-muted); fill: none; stroke-width: 1.8; }
.business-os-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #fff; font-size: 9.75px; }
.business-os-search input::placeholder { color: #95a7bb; }

#mainNavigation.business-os-navigation {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 8px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .22) transparent;
}
.business-os-navigation > .nav-item { margin-bottom: 5px; }
.business-os-navigation details { margin: 2px 0; }
.business-os-navigation summary {
  min-height: 25px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a7bc;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: .065em;
  text-transform: uppercase;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.business-os-navigation summary::-webkit-details-marker { display: none; }
.business-os-navigation summary::after { content: "›"; font-size: 12px; transform: rotate(90deg); transition: transform .15s ease; }
.business-os-navigation details:not([open]) summary::after { transform: rotate(0); }
.business-os-navigation details > div { display: grid; gap: 1px; padding-bottom: 3px; }

.nav-item {
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #dbe4ef;
  font-size: 9.75px;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.nav-item:hover { background: var(--bos-sidebar-hover); color: #fff; }
.nav-item.active, .nav-item[aria-current="page"] { background: var(--bos-sidebar-active); color: #fff; box-shadow: inset 2px 0 #7aa6d8; }
.nav-item svg { width: 14px; height: 14px; flex: 0 0 14px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.business-os-sidebar-footer {
  flex: 0 0 auto;
  border-top: 1px solid rgba(255, 255, 255, .1);
  background: rgba(8, 17, 30, .18);
}
.business-os-queue {
  width: 100%;
  padding: 9px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .09);
  background: transparent;
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.business-os-queue span { grid-column: 1; color: #93a6bb; font-size: 8px; font-weight: 700; letter-spacing: .08em; }
.business-os-queue strong { grid-column: 1; font-size: 10px; font-weight: 600; }
.business-os-queue em { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 22px; padding: 3px 5px; border-radius: 10px; background: rgba(255, 255, 255, .12); font-size: 9px; font-style: normal; text-align: center; }
.business-os-queue[data-queue-state="waiting"] em { background: #bd7932; color: #fff; }

.business-os-user {
  padding: 9px 11px;
  display: grid;
  grid-template-columns: 29px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}
.business-os-avatar { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; background: #314a6b; color: #fff; font-size: 9px; font-weight: 700; }
.business-os-user-copy { min-width: 0; }
.business-os-user-copy strong, .business-os-user-copy span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.business-os-user-copy strong { color: #fff; font-size: 9.5px; }
.business-os-user-copy span { margin-top: 1px; color: var(--bos-sidebar-muted); font-size: 8.5px; }
.business-os-signout { width: 27px; height: 27px; display: grid; place-items: center; border: 0; border-radius: 4px; background: transparent; color: #cbd6e3; cursor: pointer; }
.business-os-signout:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.business-os-signout svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.business-os-runtime-meta { padding: 0 11px 8px; display: flex; justify-content: space-between; color: #8195aa; font-size: 7.75px; }
.business-os-sidebar-tools { display: flex; gap: 5px; align-items: center; }

.business-os-workspace {
  position: fixed;
  inset: 0 0 0 var(--bos-sidebar-width);
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--bos-canvas);
}
.business-os-content {
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding: 14px 16px 24px;
}
.business-os-mobile-menu {
  position: fixed;
  z-index: 50;
  top: 9px;
  left: 9px;
  width: 32px;
  height: 32px;
  display: none;
  place-items: center;
  border: 1px solid var(--bos-border);
  border-radius: var(--bos-radius);
  background: #fff;
  color: var(--bos-text);
  box-shadow: var(--bos-shadow);
  cursor: pointer;
}
.business-os-mobile-menu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.menu-backdrop { display: none; }

/* Shared components ----------------------------------------------------- */

h1, h2, h3, h4 { font-family: var(--bos-font-heading); color: var(--bos-text); }
.bos-page-title {
  min-height: 43px;
  padding: 1px 0 9px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.bos-page-title h1 { margin: 0; font-size: 16px; line-height: 1.25; font-weight: 650; letter-spacing: -.012em; }
.bos-page-title p { margin: 3px 0 0; color: var(--bos-muted); font-size: 9.75px; }
.bos-eyebrow { display: block; margin-bottom: 2px; color: var(--bos-accent); font-size: 8.5px; font-weight: 700; letter-spacing: .055em; text-transform: uppercase; }
.bos-page-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.bos-button, .button, .cb-btn, .cc-ops-btn {
  min-height: 29px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid #cbd5df;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.bos-button:hover, .button:hover, .cb-btn:hover, .cc-ops-btn:hover { border-color: #aeb9c6; background: #f9fafb; }
.bos-button.primary, .button.primary, .cb-btn.primary, .cc-ops-btn.primary { border-color: var(--bos-accent); background: var(--bos-accent); color: #fff; }
.bos-button.primary:hover, .button.primary:hover, .cb-btn.primary:hover, .cc-ops-btn.primary:hover { border-color: var(--bos-accent-hover); background: var(--bos-accent-hover); }
.bos-button.danger, .button.danger, .cb-btn.danger { border-color: #e7bcc0; color: var(--bos-danger); background: #fff; }
.bos-button.small, .button.small, .cb-btn.small, .cc-ops-btn.small { min-height: 25px; padding: 4px 7px; font-size: 8.75px; }
.bos-button:disabled, .button:disabled, .cb-btn:disabled { opacity: .48; cursor: not-allowed; }

.bos-view-tabs {
  min-height: 30px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  overflow-x: auto;
  border-bottom: 1px solid var(--bos-border);
  scrollbar-width: thin;
}
.bos-view-tabs button {
  min-height: 29px;
  padding: 6px 10px;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--bos-muted);
  font-size: 9.5px;
  font-weight: 600;
  cursor: pointer;
}
.bos-view-tabs button:hover { color: var(--bos-text); background: #eef2f6; }
.bos-view-tabs button.active { border-bottom-color: var(--bos-accent); color: var(--bos-accent); }

.bos-toolbar {
  min-height: 38px;
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--bos-border);
  border-top: 0;
  background: #fff;
}
.bos-toolbar-controls, .bos-toolbar-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bos-tool-button {
  min-height: 27px;
  padding: 4px 7px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: #445268;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
}
.bos-tool-button:hover, .bos-tool-button.active { border-color: var(--bos-border); background: var(--bos-panel-soft); }
.bos-tool-button svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bos-toolbar-search { width: min(230px, 34vw); min-height: 27px; padding: 0 7px; display: flex; align-items: center; gap: 5px; border: 1px solid var(--bos-border); border-radius: 4px; background: #fff; }
.bos-toolbar-search svg { width: 12px; height: 12px; flex: 0 0 12px; fill: none; stroke: var(--bos-muted); stroke-width: 1.8; }
.bos-toolbar-search input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--bos-text); background: transparent; font-size: 9.25px; }

.bos-table-layout { min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); }
.bos-table-area { min-width: 0; border: 1px solid var(--bos-border); border-top: 0; background: #fff; }
.bos-filter-panel[hidden] + .bos-table-area { grid-column: 1 / -1; }
.bos-table-wrap, .table-wrap {
  width: 100%;
  min-width: 0;
  overflow: auto;
  background: #fff;
  scrollbar-width: thin;
}
.bos-table, .data-table, .crm-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  table-layout: auto;
  background: #fff;
  color: var(--bos-text);
  font-size: 9.5px;
}
.bos-table caption, .data-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.bos-table th, .data-table th, .crm-table th {
  height: 29px;
  padding: 6px 7px;
  border-bottom: 1px solid #d4dce5;
  background: #f7f9fb;
  color: #5d6b7e;
  font-size: 8.75px;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
}
.bos-table td, .data-table td, .crm-table td {
  height: 36px;
  max-width: 260px;
  padding: 6px 7px;
  border-bottom: 1px solid var(--bos-border-soft);
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.bos-table tbody tr:last-child td, .data-table tbody tr:last-child td, .crm-table tbody tr:last-child td { border-bottom: 0; }
.bos-table tbody tr[data-call-id], .data-table tbody tr[data-open] { cursor: pointer; }
.bos-table tbody tr:hover, .data-table tbody tr:hover { background: #f8fbff; }
.bos-table strong, .data-table strong { font-weight: 600; }
.bos-table small, .data-table small { display: block; margin-top: 1px; color: var(--bos-muted); font-size: 8.5px; }
.bos-table .select-column { width: 30px; text-align: center; }
.bos-table input[type="checkbox"] { width: 12px; height: 12px; margin: 0; accent-color: var(--bos-accent); }
.bos-table.dense td { height: 31px; padding-top: 4px; padding-bottom: 4px; }
.bos-table .mono, .data-table .mono, .mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 9px; }
.bos-table-link { padding: 0; border: 0; background: transparent; color: var(--bos-accent); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.bos-table-link:hover { text-decoration: underline; }

.bos-filter-panel {
  width: 216px;
  min-height: 100%;
  border: 1px solid var(--bos-border);
  border-top: 0;
  border-right: 0;
  background: #fff;
}
.bos-filter-panel > header { min-height: 34px; padding: 7px 9px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--bos-border); }
.bos-filter-panel > header strong { font-family: var(--bos-font-heading); font-size: 10px; }
.bos-filter-panel > header button { width: 22px; height: 22px; border: 0; background: transparent; color: var(--bos-muted); cursor: pointer; }
.bos-filter-body { padding: 8px 9px; display: grid; gap: 10px; }
.bos-filter-group { display: grid; gap: 4px; }
.bos-filter-group > strong { color: #536175; font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.bos-filter-group label { display: flex; align-items: center; gap: 5px; color: #445268; font-size: 9px; }
.bos-filter-group input[type="checkbox"] { width: 12px; height: 12px; margin: 0; accent-color: var(--bos-accent); }
.bos-filter-group input[type="date"], .bos-filter-group select { width: 100%; min-height: 27px; padding: 4px 6px; border: 1px solid var(--bos-border); border-radius: 4px; background: #fff; color: var(--bos-text); font-size: 9px; }
.bos-filter-actions { display: flex; gap: 5px; }

.bos-column-menu, .bos-sort-menu {
  position: absolute;
  z-index: 45;
  top: 37px;
  right: 6px;
  width: 210px;
  padding: 7px;
  display: grid;
  gap: 3px;
  border: 1px solid var(--bos-border);
  border-radius: var(--bos-radius);
  background: #fff;
  box-shadow: var(--bos-shadow-raised);
}
.bos-toolbar { position: relative; }
.bos-column-menu label { min-height: 24px; padding: 4px 5px; display: flex; align-items: center; gap: 5px; border-radius: 3px; }
.bos-column-menu label:hover { background: var(--bos-panel-soft); }
.bos-sort-menu select { min-height: 28px; border: 1px solid var(--bos-border); border-radius: 4px; }

.bos-status, .tag {
  max-width: 100%;
  padding: 2px 6px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d5dde6;
  border-radius: 9px;
  background: #f4f6f8;
  color: #536175;
  font-size: 8px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
}
.bos-status.connected, .bos-status.completed, .bos-status.active, .bos-status.matched, .tag.active { border-color: #b8dccc; background: var(--bos-success-soft); color: var(--bos-success); }
.bos-status.ringing, .bos-status.queued, .bos-status.received, .bos-status.trying, .bos-status.dialling, .bos-status.dialing { border-color: #bcd0e8; background: var(--bos-accent-soft); color: var(--bos-accent); }
.bos-status.missed, .bos-status.failed, .bos-status.busy, .bos-status.no-answer, .bos-status.unanswered, .tag.critical { border-color: #e5bdc1; background: var(--bos-danger-soft); color: var(--bos-danger); }
.bos-status.waiting, .bos-status.warning, .bos-status.escalated, .tag.high { border-color: #ead2a9; background: var(--bos-warning-soft); color: var(--bos-warning); }

.bos-state, .empty-state, .loading-state {
  min-height: 104px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: var(--bos-muted);
  text-align: left;
}
.bos-state > div, .empty-state > div { min-width: 0; }
.bos-state strong, .bos-state p, .empty-state strong, .empty-state span, .loading-state p { display: block; margin: 0; }
.bos-state strong, .empty-state strong { color: var(--bos-text); font-family: var(--bos-font-heading); font-size: 10px; }
.bos-state p, .empty-state span { margin-top: 2px; font-size: 9px; }
.bos-state-icon, .spinner { width: 20px; height: 20px; flex: 0 0 20px; border: 2px solid #cbd5df; border-radius: 50%; }
.bos-state.loading .bos-state-icon, .spinner { border-top-color: var(--bos-accent); animation: bos-spin .8s linear infinite; }
.bos-state.empty .bos-state-icon { border: 0; border-radius: 4px; background: #eef2f6; }
.bos-state.empty .bos-state-icon::after { content: "—"; display: grid; place-items: center; height: 100%; color: var(--bos-subtle); }
.bos-state.error .bos-state-icon { border-color: #e0aeb3; background: var(--bos-danger-soft); }
.bos-state-action { margin-top: 6px; }
@keyframes bos-spin { to { transform: rotate(360deg); } }

.panel, .enterprise-panel, .crm-widget, .bos-widget {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--bos-border);
  border-radius: var(--bos-radius);
  background: #fff;
  box-shadow: var(--bos-shadow);
}
.panel + .panel, .enterprise-panel + .enterprise-panel { margin-top: 10px; }
.panel-header, .enterprise-panel-header, .bos-widget > header {
  min-height: 36px;
  padding: 8px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--bos-border-soft);
}
.panel-header h2, .enterprise-panel-header h2, .bos-widget h2 { margin: 0; font-size: 11px; font-weight: 650; }
.panel-header p, .enterprise-panel-header p { margin: 2px 0 0; color: var(--bos-muted); font-size: 8.75px; }
.panel-body { padding: 10px; }

.page-heading {
  margin-bottom: 9px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.page-heading h1 { margin: 0; font-size: 16px; }
.page-heading h2 { margin: 0; font-size: 13px; }
.page-heading p { margin: 3px 0 0; color: var(--bos-muted); font-size: 9.5px; }
.toolbar { padding: 7px; display: flex; align-items: end; gap: 6px; flex-wrap: wrap; }
.toolbar label, .field { display: grid; gap: 3px; color: #566579; font-size: 8.5px; }
.toolbar input, .toolbar select, .field input, .field select, .field textarea,
form input, form select, form textarea {
  min-height: 29px;
  padding: 5px 7px;
  border: 1px solid #cbd5df;
  border-radius: 4px;
  background: #fff;
  color: var(--bos-text);
  font-size: 9.5px;
}
form textarea { min-height: 72px; resize: vertical; }
.search-field { min-width: 220px; flex: 1 1 260px; }
.primary-cell { display: flex; align-items: center; gap: 6px; }
.primary-cell > div:last-child { min-width: 0; }
.mini-avatar { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 50%; background: #edf2f7; color: #475569; font-size: 8px; font-weight: 700; }

/* Record pages ---------------------------------------------------------- */

.bos-record-page { min-height: calc(100dvh - 28px); display: flex; flex-direction: column; }
.bos-record-header {
  padding: 9px 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 12px;
  border: 1px solid var(--bos-border);
  border-radius: var(--bos-radius) var(--bos-radius) 0 0;
  background: #fff;
}
.bos-record-back { grid-column: 1 / -1; width: max-content; padding: 0; border: 0; background: transparent; color: var(--bos-accent); font-size: 8.75px; cursor: pointer; }
.bos-record-heading { min-width: 0; display: flex; align-items: center; gap: 10px; }
.bos-record-heading h1 { margin: 0; font-size: 15px; }
.bos-record-heading p { margin: 2px 0 0; color: var(--bos-muted); font-size: 9.25px; }
.bos-record-badges, .bos-record-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bos-record-actions { justify-content: flex-end; }
.bos-record-tabs { min-height: 32px; padding: 0 8px; display: flex; align-items: end; gap: 1px; overflow-x: auto; border: 1px solid var(--bos-border); border-top: 0; background: #fff; }
.bos-record-tabs button { min-height: 31px; padding: 6px 9px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--bos-muted); font-size: 9px; font-weight: 600; cursor: pointer; }
.bos-record-tabs button.active { border-bottom-color: var(--bos-accent); color: var(--bos-accent); }
.bos-record-body { flex: 1 1 auto; min-height: 0; padding: 10px; border: 1px solid var(--bos-border); border-top: 0; background: #fff; }
.bos-record-section + .bos-record-section { margin-top: 10px; }
.bos-record-section > header { margin-bottom: 6px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bos-record-section h2 { margin: 0; font-size: 11px; }
.bos-record-section > p { margin: 0 0 8px; color: var(--bos-muted); font-size: 9px; }
.bos-form-checks { margin-top: 7px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--bos-muted); font-size: 8.75px; }
.bos-form-checks label { display: inline-flex; align-items: center; gap: 4px; }
.bos-form-field { margin-top: 7px; }
.bos-form-actions { margin-top: 8px; }
.bos-form-stack { margin-top: 7px; display: grid; gap: 5px; }
.bos-inline-check { margin-top: 7px; display: flex; align-items: center; gap: 5px; }
.bos-record-nested { margin-top: 8px; }
.bos-score-grid { display: grid; grid-template-columns: repeat(5, minmax(100px, 1fr)); gap: 6px; }
.bos-secondary-action { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--bos-border-soft); }
.bos-secondary-action summary { width: max-content; color: var(--bos-accent); font-size: 9px; font-weight: 650; cursor: pointer; }
.bos-secondary-action form { margin-top: 8px; }
.bos-provider-text { margin-top: 7px; padding: 8px; border: 1px solid var(--bos-border-soft); background: var(--bos-panel-soft); }
.bos-provider-text strong, .bos-provider-text summary { font-size: 9px; font-weight: 650; }
.bos-provider-text p { margin: 4px 0 0; color: #45546a; font-size: 8.75px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.bos-details-grid { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--bos-border); border-right: 0; border-bottom: 0; }
.bos-details-grid > div { min-width: 0; min-height: 53px; padding: 7px 8px; border-right: 1px solid var(--bos-border); border-bottom: 1px solid var(--bos-border); }
.bos-details-grid dt { margin: 0 0 3px; color: var(--bos-muted); font-size: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .025em; }
.bos-details-grid dd { margin: 0; color: var(--bos-text); font-size: 9.5px; font-weight: 550; overflow-wrap: anywhere; }
.bos-security-boundary { padding: 8px 9px; display: flex; gap: 7px; border: 1px solid #d5dfeb; border-left: 3px solid var(--bos-accent); border-radius: 3px; background: #f7faff; color: #435168; font-size: 9px; }
.bos-record-list { display: grid; gap: 5px; }
.bos-record-list > article { padding: 7px 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border: 1px solid var(--bos-border-soft); border-radius: 4px; }
.bos-record-list strong, .bos-record-list span, .bos-record-list small { display: block; }
.bos-record-list span, .bos-record-list small { margin-top: 2px; color: var(--bos-muted); font-size: 8.5px; }
.bos-link-customer { max-width: 650px; }
.bos-customer-search-results { margin-top: 6px; display: grid; gap: 4px; }
.bos-customer-result { width: 100%; padding: 7px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid var(--bos-border); border-radius: 4px; background: #fff; text-align: left; cursor: pointer; }
.bos-customer-result:hover { background: #f8fbff; border-color: #b9cadc; }

.bos-drawer {
  position: fixed;
  z-index: 80;
  inset: 0 0 0 auto;
  width: min(430px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--bos-border);
  background: #fff;
  box-shadow: -10px 0 30px rgba(24, 39, 61, .12);
}
.bos-drawer > header { min-height: 45px; padding: 10px 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--bos-border); }
.bos-drawer h2 { margin: 0; font-size: 12px; }
.bos-drawer > header button { width: 26px; height: 26px; border: 0; background: transparent; color: var(--bos-muted); cursor: pointer; }
.bos-drawer-body { flex: 1 1 auto; min-height: 0; padding: 10px 12px; overflow: auto; }
.bos-drawer > footer { padding: 9px 12px; border-top: 1px solid var(--bos-border); }

/* Calls module ---------------------------------------------------------- */

.bos-calls-page { min-height: calc(100dvh - 38px); display: flex; flex-direction: column; }
.bos-calls-table-shell { min-height: 380px; flex: 1 1 auto; display: flex; flex-direction: column; }
.bos-calls-table-shell .bos-table-layout { min-height: 0; flex: 1 1 auto; }
.bos-calls-table-shell .bos-table-area { min-height: 0; display: flex; flex-direction: column; }
.bos-calls-table-shell .bos-table-wrap { flex: 1 1 auto; min-height: 0; }
.bos-call-contact strong, .bos-call-contact span { display: block; }
.bos-call-contact span { margin-top: 1px; color: var(--bos-muted); font-size: 8.5px; }
.bos-call-direction { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.bos-call-direction::before { width: 15px; height: 15px; display: grid; place-items: center; border-radius: 50%; background: #edf2f7; color: #506175; font-size: 8px; }
.bos-call-direction.inbound::before { content: "↙"; }
.bos-call-direction.outbound::before { content: "↗"; }
.bos-call-direction.missed::before { content: "↙"; background: var(--bos-danger-soft); color: var(--bos-danger); }
.bos-call-footer { min-height: 30px; padding: 6px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--bos-border); color: var(--bos-muted); font-size: 8.5px; }

.head-office-call-notifications {
  position: fixed;
  z-index: 90;
  top: 12px;
  right: 12px;
  width: min(310px, calc(100vw - 24px));
  display: grid;
  gap: 7px;
  pointer-events: none;
}
.bos-call-notification {
  padding: 9px;
  border: 1px solid #ccd6e0;
  border-radius: var(--bos-radius);
  background: #fff;
  box-shadow: var(--bos-shadow-raised);
  color: var(--bos-text);
  pointer-events: auto;
}
.bos-call-notification > header { display: grid; grid-template-columns: 26px minmax(0, 1fr) 22px; align-items: center; gap: 7px; }
.bos-call-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--bos-accent-soft); color: var(--bos-accent); font-size: 12px; }
.bos-call-notification.outbound .bos-call-icon { background: var(--bos-success-soft); color: var(--bos-success); }
.bos-call-notification header span, .bos-call-notification header strong { display: block; }
.bos-call-notification header div > span { color: var(--bos-muted); font-size: 7.75px; font-weight: 700; letter-spacing: .065em; text-transform: uppercase; }
.bos-call-notification header div > strong { margin-top: 1px; font-family: var(--bos-font-heading); font-size: 10.5px; }
.bos-call-notification header button { width: 22px; height: 22px; border: 0; background: transparent; color: var(--bos-muted); cursor: pointer; }
.bos-call-number { margin: 6px 0 0 33px; padding: 0; border: 0; background: transparent; color: var(--bos-accent); font-size: 9.5px; font-weight: 600; cursor: pointer; }
.bos-call-notification-meta { margin: 6px 0 0 33px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--bos-muted); font-size: 8.5px; }
.bos-call-notification-meta strong { color: var(--bos-text); font-variant-numeric: tabular-nums; }
.bos-call-notification-state { margin: 6px 0 0 33px; }
.bos-call-notification > footer { margin: 8px 0 0 33px; display: flex; gap: 4px; flex-wrap: wrap; }

/* Home dashboard -------------------------------------------------------- */

.bos-home { display: grid; gap: 10px; }
.bos-home-welcome { min-height: 42px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.bos-home-welcome h1 { margin: 0; font-size: 16px; font-weight: 650; }
.bos-home-welcome p { margin: 3px 0 0; color: var(--bos-muted); font-size: 9.5px; }
.bos-home-environment { padding: 3px 7px; border: 1px solid var(--bos-border); border-radius: 9px; background: #fff; color: var(--bos-muted); font-size: 8px; }
.bos-home-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.bos-home-metric { min-width: 0; min-height: 68px; padding: 9px 10px; display: grid; gap: 3px; border: 1px solid var(--bos-border); border-radius: var(--bos-radius); background: #fff; box-shadow: var(--bos-shadow); }
.bos-home-metric span { color: var(--bos-muted); font-size: 8.5px; font-weight: 600; }
.bos-home-metric strong { font-family: var(--bos-font-heading); font-size: 17px; font-weight: 650; }
.bos-home-metric small { color: var(--bos-subtle); font-size: 8px; }
.bos-home-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bos-widget > header button { padding: 0; border: 0; background: transparent; color: var(--bos-accent); font-size: 8.5px; cursor: pointer; }
.bos-widget-body { min-height: 140px; overflow: auto; }
.bos-widget .bos-table, .bos-widget .crm-table { min-width: 0; table-layout: fixed; }
.bos-widget > footer { min-height: 27px; padding: 5px 8px; display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--bos-border-soft); color: var(--bos-muted); font-size: 8px; }
.bos-home-operations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bos-operation-widget { min-width: 0; padding: 9px; border: 1px solid var(--bos-border); border-radius: var(--bos-radius); background: #fff; }
.bos-operation-widget h2 { margin: 0 0 6px; font-size: 10.5px; }
.bos-operation-list { display: grid; gap: 4px; }
.bos-operation-list > div { min-height: 26px; padding: 4px 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--bos-border-soft); }
.bos-operation-list > div:last-child { border-bottom: 0; }
.bos-operation-list span { color: var(--bos-muted); font-size: 8.5px; }
.bos-operation-list strong { font-size: 8.75px; text-align: right; }

/* Existing module compatibility within the same system ----------------- */

.workspace-view, .system-control-page, .customer-record-page, .callback-service, .call-centre-ops, .cc-wallboard, .customer-service-centre { min-width: 0; width: 100%; }

/* Existing governed workspaces expressed through the shared system -------- */

.customer-record-page, .customer-record-main, .customer-record-layout, .customer-record-tab-panel { min-width: 0; width: 100%; }
.customer-record-page, .customer-record-tab-panel { display: grid; gap: 9px; }
.customer-record-header { padding: 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border: 1px solid var(--bos-border); background: #fff; }
.customer-record-header h1 { margin: 1px 0; font-size: 15px; }
.customer-record-identity, .customer-record-header .eyebrow { color: var(--bos-muted); font-size: 8.75px; }
.customer-record-actions, .inline-actions, .central-payments-actions, .soc-command-actions, .didit-toolbar-actions, .didit-session-actions { display: flex; justify-content: flex-end; gap: 5px; flex-wrap: wrap; }
.customer-record-back { width: max-content; padding: 0; border: 0; background: transparent; color: var(--bos-accent); font-size: 8.75px; font-weight: 650; cursor: pointer; }
.customer-record-tabs { min-height: 32px; padding: 0 7px; display: flex; align-items: end; gap: 1px; overflow-x: auto; border: 1px solid var(--bos-border); background: #fff; }
.customer-record-tab { min-height: 31px; padding: 6px 8px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--bos-muted); font-size: 9px; font-weight: 650; cursor: pointer; }
.customer-record-tab.active { border-bottom-color: var(--bos-accent); color: var(--bos-accent); }
.customer-record-tab > span { margin-left: 3px; color: inherit; font-size: 8px; }
.customer-record-tab-panel[hidden] { display: none; }
.customer-record-overview-grid, .customer-record-two-column, .customer-record-facts, .customer-record-edit-body { display: grid; gap: 7px; }
.customer-record-overview-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.customer-record-overview-grid.compact { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.customer-record-two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.customer-record-metric, .customer-record-panel, .customer-record-edit-box { min-width: 0; border: 1px solid var(--bos-border); background: #fff; }
.customer-record-metric { min-height: 66px; padding: 8px; display: grid; align-content: center; gap: 2px; }
.customer-record-metric > span, .customer-record-metric > small { color: var(--bos-muted); font-size: 8px; }
.customer-record-metric > strong { font: 650 14px var(--bos-heading); }
.customer-record-panel > header { padding: 7px 8px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--bos-border); }
.customer-record-panel h2 { margin: 0; font-size: 10.5px; }
.customer-record-panel header p { margin: 2px 0 0; color: var(--bos-muted); font-size: 8.5px; }
.customer-record-panel-body, .customer-record-edit-box { padding: 8px; }
.customer-record-facts { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.customer-record-fact { min-width: 0; padding: 6px; border: 1px solid var(--bos-border-soft); }
.customer-record-fact dt { color: var(--bos-muted); font-size: 7.75px; text-transform: uppercase; }
.customer-record-fact dd { margin: 2px 0 0; font-size: 9px; overflow-wrap: anywhere; }
.customer-record-table-wrap, .staff-directory-table-wrap, .soc-scroll { max-width: 100%; overflow: auto; }
.customer-record-table, .central-payments-table, .data-table, .soc-compact-table { width: 100%; border-collapse: collapse; font-size: 8.75px; }
.customer-record-table th, .customer-record-table td, .central-payments-table th, .central-payments-table td, .data-table th, .data-table td, .soc-compact-table th, .soc-compact-table td { padding: 5px 7px; border-bottom: 1px solid var(--bos-border-soft); text-align: left; vertical-align: top; }
.customer-record-table th, .central-payments-table th, .data-table th, .soc-compact-table th { background: #f6f8fb; color: var(--bos-muted); font-size: 7.75px; text-transform: uppercase; }
.customer-record-empty, .didit-empty, .soc-empty, .central-payments-empty { padding: 12px; border: 1px dashed var(--bos-border); color: var(--bos-muted); font-size: 8.75px; text-align: center; }

.didit-page, .soc-page, .staff-directory-workspace, .central-payments-catalogue-status { min-width: 0; display: grid; gap: 9px; }
.didit-metrics, .soc-metric-grid, .central-payments-metrics, .metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 7px; }
.didit-metric, .soc-metric, .central-payments-metric, .metric-card, .didit-config-card { min-width: 0; padding: 8px; border: 1px solid var(--bos-border); background: #fff; }
.didit-panel, .soc-panel, .central-payments-card { min-width: 0; border: 1px solid var(--bos-border); background: #fff; }
.soc-panel-header, .central-payments-heading, .central-payments-section-title { padding: 7px 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--bos-border); }
.soc-panel-body, .central-payments-card { padding: 8px; }
.soc-grid, .central-payments-grid, .didit-configuration, .didit-webhooks, .staff-directory-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 7px; }
.didit-filters, .staff-directory-toolbar, .central-payments-form, .form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 6px; align-items: end; }
.central-payments-form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.didit-session, .soc-status-item, .soc-config-item, .soc-lockdown-row, .staff-directory-detail-panel { padding: 7px; border: 1px solid var(--bos-border-soft); background: #fff; }
.didit-session-list, .soc-stack, .soc-config-list, .staff-directory-detail-actions { display: grid; gap: 5px; }
.staff-directory-page-controls, .staff-directory-role, .staff-directory-assurance, .staff-directory-status-line { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.staff-directory-page-controls { justify-content: flex-end; color: var(--bos-muted); font-size: 8.5px; }
.staff-directory-detail-field span, .staff-directory-role small, .staff-directory-assurance small { display: block; color: var(--bos-muted); font-size: 8px; }
.central-payments-code, .soc-code, .customer-record-mono, .customer-record-ucn { font-family: var(--bos-mono); overflow-wrap: anywhere; }
.central-payments-notice, .notice, .didit-secure-link, .bos-security-boundary { border-radius: 3px; }

.support-metrics, .support-branch-grid, .support-toggle-grid, .full-control-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 7px; }
.support-workspace-tabs, .support-compose-stack { display: flex; gap: 5px; flex-wrap: wrap; }
.support-conversation-layout { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(210px, 290px); gap: 8px; }
.support-transcript-panel, .support-conversation-sidebar, .support-branch-card, .full-control-section { min-width: 0; border: 1px solid var(--bos-border); background: #fff; }
.support-transcript { max-height: min(58dvh, 620px); padding: 8px; display: grid; gap: 6px; overflow: auto; }
.support-message { max-width: min(86%, 680px); padding: 7px 8px; border: 1px solid var(--bos-border-soft); border-radius: 4px; background: var(--bos-panel-soft); font-size: 9px; }
.support-message.customer { justify-self: start; }
.support-message.staff, .support-message.ai { justify-self: end; background: var(--bos-accent-soft); }
.support-compose, .support-status-form, .support-context-list, .support-event-list, .full-control-section { padding: 8px; }
.support-context-list, .support-event-list, .summary-list { display: grid; gap: 5px; }
.summary-item, .support-branch-notice, .full-control-profile-strip { padding: 6px; border: 1px solid var(--bos-border-soft); }
.support-tag, .support-presence, .csc-control-status { display: inline-flex; padding: 2px 5px; border-radius: 999px; background: #edf2f7; color: var(--bos-muted); font-size: 7.75px; font-weight: 650; }
.support-tag.active, .support-presence.human, .csc-control-status.connected { background: var(--bos-success-soft); color: var(--bos-success); }
.support-tag.escalated, .support-tag.security_review_required { background: var(--bos-danger-soft); color: var(--bos-danger); }
.support-back-link { padding: 0; border: 0; background: transparent; color: var(--bos-accent); font-weight: 650; cursor: pointer; }
.full-control-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.full-control-section { margin-top: 7px; }
.full-control-section h3 { margin: 0 0 6px; font-size: 10px; }
.enterprise-metrics, .platform-crm-summary, .home-metrics, .cb-metrics, .cc-ops-metrics { margin-bottom: 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 7px; }
.enterprise-metric, .platform-crm-stat, .cb-metric, .cc-ops-metric { min-width: 0; padding: 8px 9px; border: 1px solid var(--bos-border); border-radius: var(--bos-radius); background: #fff; }
.enterprise-metric span, .enterprise-metric strong, .enterprise-metric small,
.platform-crm-stat span, .platform-crm-stat strong, .platform-crm-stat small,
.cb-metric span, .cb-metric strong, .cb-metric small,
.cc-ops-metric span, .cc-ops-metric strong, .cc-ops-metric small { display: block; }
.enterprise-metric span, .platform-crm-stat span, .cb-metric span, .cc-ops-metric span { color: var(--bos-muted); font-size: 8px; font-weight: 650; text-transform: uppercase; }
.enterprise-metric strong, .platform-crm-stat strong, .cb-metric strong, .cc-ops-metric strong { margin: 4px 0 2px; font-family: var(--bos-font-heading); font-size: 15px; }
.enterprise-metric small, .platform-crm-stat small, .cb-metric small, .cc-ops-metric small { color: var(--bos-subtle); font-size: 8px; }
.enterprise-command-bar, .cc-ops-toolbar, .cc-wallboard-header, .cb-hero { margin-bottom: 8px; padding: 8px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border: 1px solid var(--bos-border); border-radius: var(--bos-radius); background: #fff; }
.enterprise-command-title strong, .enterprise-command-title span { display: block; }
.enterprise-command-title strong, .cc-ops-toolbar h2, .cc-wallboard-header h1, .cb-hero h1 { margin: 0; font-family: var(--bos-font-heading); font-size: 13px; }
.enterprise-command-title span, .enterprise-command-meta, .cc-ops-toolbar p, .cc-wallboard-header p, .cb-hero p { margin: 2px 0 0; color: var(--bos-muted); font-size: 8.5px; }
.workspace-lower-grid, .workspace-action-list, .cc-two-col, .cb-manage-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.workspace-register-list, .cb-list, .cc-work-list, .cc-live-call-list, .cc-alert-list { display: grid; gap: 5px; }
.workspace-register-list > div, .cb-card, .cc-work-item, .cc-live-call, .cc-alert { padding: 7px 8px; border: 1px solid var(--bos-border); border-radius: 4px; background: #fff; }
.cb-panel, .cc-ops-section { margin-bottom: 8px; padding: 9px; border: 1px solid var(--bos-border); border-radius: var(--bos-radius); background: #fff; }
.cb-panel-head, .cc-ops-section-head, .cb-card-head, .cb-actions, .cc-adviser-controls { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; flex-wrap: wrap; }
.cb-panel-head h2, .cc-ops-section-head h3, .cb-card-head h3 { margin: 0; font-size: 10.5px; }
.cb-panel-head p, .cc-ops-section-head p, .cb-card-head p { margin: 2px 0 0; color: var(--bos-muted); font-size: 8.5px; }
.cb-create-form, .cb-manage form { display: grid; gap: 7px; }
.cb-form-grid, .cb-card-grid, .cc-adviser-grid, .cc-department-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 6px; }
.cb-form-grid label, .cb-create-form > label, .cb-manage form > label { display: grid; gap: 3px; color: var(--bos-muted); font-size: 8.5px; }
.cb-card { margin-top: 6px; }
.cb-card-grid { margin: 7px 0; }
.cb-card-grid > div span, .cb-card-grid > div strong { display: block; }
.cb-card-grid > div span { color: var(--bos-muted); font-size: 8px; }
.cb-card-grid > div strong { margin-top: 1px; font-size: 8.75px; }
.cb-reason { padding: 6px 0; border-top: 1px solid var(--bos-border-soft); }
.cb-reason span { color: var(--bos-muted); font-size: 8px; }
.cb-reason p { margin: 2px 0; font-size: 9px; }
.cb-badges { display: flex; gap: 4px; }
.cb-badges span { padding: 2px 5px; border-radius: 8px; background: #f1f4f7; color: var(--bos-muted); font-size: 8px; }
.cb-empty, .cc-empty { min-height: 70px; display: grid; place-items: center; color: var(--bos-muted); font-size: 9px; }
.notice { padding: 8px; display: flex; gap: 7px; border: 1px solid var(--bos-border); border-radius: 4px; background: var(--bos-panel-soft); color: #45546a; font-size: 9px; }

/* Modal, toasts and mobile app ----------------------------------------- */

dialog { width: min(650px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid var(--bos-border); border-radius: var(--bos-radius-large); background: #fff; box-shadow: var(--bos-shadow-raised); }
dialog::backdrop { background: rgba(15, 27, 43, .42); }
.modal-shell > header { padding: 10px 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--bos-border); }
.modal-shell h2 { margin: 1px 0; font-size: 13px; }
.modal-shell header p { margin: 0; color: var(--bos-muted); font-size: 8.75px; }
.modal-content { max-height: calc(100dvh - 110px); padding: 11px 12px; overflow: auto; }
.icon-button { width: 25px; height: 25px; border: 0; background: transparent; color: var(--bos-muted); cursor: pointer; }
.toast-region { position: fixed; z-index: 120; right: 12px; bottom: 12px; width: min(300px, calc(100vw - 24px)); display: grid; gap: 6px; }
.toast { padding: 8px 9px; display: grid; gap: 2px; border: 1px solid var(--bos-border); border-left: 3px solid var(--bos-success); border-radius: var(--bos-radius); background: #fff; box-shadow: var(--bos-shadow-raised); }
.toast.error { border-left-color: var(--bos-danger); }
.toast strong { font-size: 9.5px; }
.toast span { color: var(--bos-muted); font-size: 8.5px; }
.pwa-mobile-dock { display: none; }
.pwa-install-button, .pwa-network-state { border: 0; background: transparent; color: var(--bos-sidebar-muted); font-size: 7.5px; }
.pwa-install-button svg { display: none; }

/* Authenticated standalone control pages ------------------------------- */

body.business-os-standalone { height: auto; min-height: 100%; overflow: auto; }
.business-os-standalone .topbar { position: sticky; z-index: 10; top: 0; min-height: 52px; padding: 9px max(14px, calc((100% - 1080px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #2b405d; background: var(--bos-sidebar); color: #fff; }
.business-os-standalone .topbar h1 { margin: 1px 0; font-size: 14px; }
.business-os-standalone .topbar .eyebrow { color: #b9c7d6; }
.business-os-standalone .layout { width: min(1080px, calc(100% - 24px)); margin: 12px auto 30px; display: grid; gap: 9px; }
.business-os-standalone .card { min-width: 0; padding: 10px; border: 1px solid var(--bos-border); background: #fff; box-shadow: var(--bos-shadow); }
.business-os-standalone .card-head { margin: -10px -10px 9px; padding: 8px 10px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--bos-border-soft); }
.business-os-standalone .card h2 { margin: 1px 0; font-size: 11px; }
.business-os-standalone .card p { margin: 2px 0 0; color: var(--bos-muted); font-size: 8.75px; }
.business-os-standalone .grid { display: grid; gap: 7px; }
.business-os-standalone .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.business-os-standalone label { display: grid; gap: 3px; color: var(--bos-muted); font-size: 8.5px; }
.business-os-standalone .record { min-width: 0; padding: 7px 0; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--bos-border-soft); }
.business-os-standalone .record strong, .business-os-standalone .record small { display: block; }
.business-os-standalone .record small { margin-top: 2px; color: var(--bos-muted); font-size: 8.25px; }
.business-os-standalone .actions, .business-os-standalone .checks { margin-top: 9px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.business-os-standalone .checks label { display: inline-flex; align-items: center; gap: 4px; }
.business-os-standalone .badge { padding: 2px 5px; border: 1px solid var(--bos-border); border-radius: 999px; background: var(--bos-panel-soft); color: var(--bos-muted); font-size: 7.75px; font-weight: 700; }
.business-os-standalone .badge.open { border-color: #b8dfcd; background: var(--bos-success-soft); color: var(--bos-success); }
.business-os-standalone .badge.closed { border-color: #e6c4c7; background: var(--bos-danger-soft); color: var(--bos-danger); }

@media (max-width: 1180px) {
  .bos-details-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bos-home-operations { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  html, body { overflow: hidden; }
  .security-gateway-stage { grid-template-columns: 1fr; padding: 24px 0; }
  .business-os-sidebar { transform: translateX(-102%); transition: transform .18s ease; box-shadow: var(--bos-shadow-raised); }
  .business-os-sidebar.open { transform: translateX(0); }
  .drawer-close { display: grid; place-items: center; }
  .business-os-workspace { left: 0; }
  .business-os-content { padding: 49px 10px 70px; }
  .business-os-mobile-menu { display: grid; }
  .menu-backdrop { position: fixed; z-index: 55; inset: 0; display: block; border: 0; background: rgba(15, 27, 43, .36); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
  .menu-backdrop.open, body.head-office-drawer-open .menu-backdrop { opacity: 1; pointer-events: auto; }
  .bos-home-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bos-home-grid { grid-template-columns: 1fr; }
  .bos-details-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bos-table-layout { grid-template-columns: 1fr; }
  .bos-filter-panel { width: 100%; border-right: 1px solid var(--bos-border); }
  .head-office-call-notifications { top: 8px; right: 8px; }
  .pwa-mobile-dock { position: fixed; z-index: 48; inset: auto 0 0; min-height: 54px; padding: 4px max(6px, env(safe-area-inset-right)) max(4px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; border-top: 1px solid var(--bos-border); background: #fff; box-shadow: 0 -4px 14px rgba(24,39,61,.08); }
  .pwa-mobile-dock button { min-height: 43px; display: grid; place-items: center; gap: 1px; border: 0; border-radius: 4px; background: transparent; color: var(--bos-muted); font-size: 7.5px; }
  .pwa-mobile-dock button.active { color: var(--bos-accent); background: var(--bos-accent-soft); }
  .pwa-mobile-dock svg { width: 16px; height: 16px; }
}

@media (max-width: 640px) {
  .security-command-panel, .security-access-panel { padding: 20px; }
  .login-footer { align-items: flex-start; flex-direction: column; }
  .bos-page-title, .page-heading, .bos-home-welcome { flex-direction: column; }
  .bos-toolbar { align-items: stretch; flex-direction: column; }
  .bos-toolbar-controls, .bos-toolbar-actions { width: 100%; }
  .bos-toolbar-search { width: 100%; flex: 1 1 100%; order: -1; }
  .bos-details-grid { grid-template-columns: 1fr; }
  .bos-score-grid { grid-template-columns: 1fr; }
  .customer-record-header { flex-direction: column; }
  .customer-record-actions { justify-content: flex-start; }
  .customer-record-overview-grid, .customer-record-two-column, .central-payments-form.two { grid-template-columns: 1fr; }
  .business-os-standalone .topbar { align-items: flex-start; flex-direction: column; }
  .business-os-standalone .grid.two { grid-template-columns: 1fr; }
  .support-conversation-layout, .full-control-fields { grid-template-columns: 1fr; }
  .support-message { max-width: 96%; }
  .bos-record-header { grid-template-columns: 1fr; }
  .bos-record-actions { justify-content: flex-start; }
  .bos-home-metrics { grid-template-columns: 1fr; }
  .workspace-lower-grid, .workspace-action-list, .cc-two-col, .cb-manage-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto; transition-duration: .01ms; animation-duration: .01ms; animation-iteration-count: 1; }
}
