.nav-header-toggle::before { content: ""; background: currentColor; display: block; mask: var(--control-icon) center / contain no-repeat; -webkit-mask: var(--control-icon) center / contain no-repeat; }
.nav-mini-expand::before { content: ""; display: block; background: currentColor; mask: var(--control-icon) center / contain no-repeat; -webkit-mask: var(--control-icon) center / contain no-repeat; }
body { margin: 0; padding: 0; }
.side-nav { overflow: auto; transition: width .18s ease, padding .18s ease, transform .18s ease; }
.brand-block { position: relative; padding: 2px 0 12px; }
.brand-header-row { grid-template-columns: minmax(0, 1fr) 24px; gap: 10px; }
.brand-home { display: block; width: 100%; min-height: 0; text-align: left; }
.nav-section { margin: 16px 0; }
.nav-section.bottom { margin-bottom: 8px; }
.side-link { width: 100%; justify-content: flex-start; margin-bottom: 4px; background: transparent; border-color: transparent; }
.side-link.child { font-weight: 600; }
.side-link:hover { border-color: var(--nav-line); }
.global-search input { border-radius: 6px; padding-left: 38px; box-shadow: none; }
.global-actions { justify-content: flex-end; white-space: nowrap; position: relative; }
.workspace-menu { position: relative; display: flex; gap: 8px; }
.profile-trigger { padding: 4px 7px; }
.workspace-avatar { flex: 0 0 28px; }
.workspace-menu-panel { top: calc(100% + 8px); right: 0; white-space: normal; }
.workspace-menu.open .workspace-menu-panel { gap: 6px; }
.status-pill { gap: 7px; white-space: nowrap; }
.record-tabs { margin: 0 0 14px; }
.table-toolbar-left,
    .table-toolbar-right { min-width: 0; }
.record-action-bar { flex-wrap: wrap; justify-content: flex-end; max-width: 190px; position: relative; }
.record-panel { margin-bottom: 12px; overflow: hidden; }
:root {

  --c-radius-sm:     6px;
  --c-radius-md:     8px;
  --c-radius-pill:   999px;
  --c-control-h:     32px;
  --c-row-h:         52px;
  --c-row-h-compact: 38px;
  --c-head-h:        34px;

  --c-1: 4px;  --c-2: 8px;  --c-3: 12px; --c-4: 14px;
  --c-5: 16px; --c-6: 18px; --c-7: 22px; --c-8: 40px;

  --c-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

html,
body {
  height: 100%;
  overflow: clip;
}

body {
  min-height: 0;
  background: var(--c-app-bg);
  color: var(--c-text);
  font-family: var(--c-font);
  -webkit-font-smoothing: antialiased;
  letter-spacing: 0;
}

.app-shell {
  --c-shell-sidebar-expanded: 248px;
  --c-shell-sidebar-collapsed: 64px;
  display: grid;
  grid-template-columns: var(--c-shell-sidebar-expanded) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--c-nav-bg);
  border-color: var(--c-line);
}
.app-shell.nav-mini { grid-template-columns: var(--c-shell-sidebar-collapsed) minmax(0, 1fr); }
.app-shell { transition: grid-template-columns .18s ease; }
.app-content {
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  background: var(--c-app-bg);
}

.global-bar {
  position: sticky; top: 0; z-index: 15;
  display: grid; grid-template-columns: minmax(220px,1fr) minmax(280px,460px) auto;
  align-items: center; gap: var(--c-6);
  min-height: 42px;
  padding: var(--c-2) var(--c-5);
  background: var(--c-surface);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--c-line);
}
.global-workspace-context {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--c-text);
  cursor: pointer;
}
.global-workspace-context:hover { background: transparent; border-color: transparent; }
.global-workspace-context:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 3px; }
.global-workspace-label {
  color: var(--c-text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.global-workspace-context strong {
  color: var(--c-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-workspace-context small {
  color: var(--c-text-muted);
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.global-actions { display: flex; align-items: center; gap: var(--c-2); justify-self: end; min-width: 0; }
.global-context-actions { display: flex; align-items: center; gap: var(--c-2); }
.global-context-actions button { height: var(--c-control-h); min-height: var(--c-control-h); }
.global-search input {
  background: var(--c-surface);
  border-color: var(--c-line);
  color: var(--c-text);
}
.global-bar > .workspace-menu, .global-bar .global-lead > .workspace-menu { min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.workspace-menu-trigger,
.profile-trigger {
  height: var(--c-control-h);
  min-height: var(--c-control-h);
}
.workspace-menu-trigger.profile-trigger {
  width: var(--c-control-h);
  min-width: var(--c-control-h);
  padding: 0;
  border: 0;
  border-radius: var(--c-radius-sm);
  background: transparent;
  box-shadow: none;
}
.workspace-menu-trigger.profile-trigger:hover {
  border-color: transparent;
  background: transparent;
}
.workspace-menu-trigger.profile-trigger:focus-visible {
  border-color: transparent;
  outline: 2px solid var(--c-accent);
  outline-offset: 2px;
}
.workspace-avatar {
  display: grid;
  width: var(--c-control-h);
  height: var(--c-control-h);
  place-items: center;
  border-radius: var(--c-radius-sm);
  background: var(--c-nav-bg);
  color: var(--c-nav-fg);
  font-size: 11px;
  font-weight: 800;
}

.side-nav {
  display: flex; flex-direction: column;
  position: relative; top: auto; align-self: stretch;
  height: 100%; min-height: 0; overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  padding: var(--c-4) var(--c-3);
  background: var(--c-nav-bg); color: var(--c-nav-fg);
  border-right: 1px solid var(--c-nav-border);
}
.brand-block { margin-bottom: var(--c-3); padding-bottom: var(--c-3); border-bottom: 1px solid var(--c-nav-border); }
.brand-header-row { display: flex; align-items: center; justify-content: space-between; min-height: 34px; }
.brand-home { min-width: 0; padding: 0; border: 0; background: transparent; color: var(--c-nav-fg); }
.brand-identity { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand-logo { width: 26px; height: 26px; border-radius: var(--c-radius-sm); }
.brand-text { display: grid; gap: 1px; min-width: 0; text-align: left; }
.brand-text h1 { margin: 0; color: var(--c-nav-fg); font-size: 14px; font-weight: 700; line-height: 1.1; }
.shell-nav-label {
  margin: var(--c-1) 10px var(--c-2);
  color: var(--c-nav-section);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.shell-nav-label-secondary {
  margin-top: var(--c-4);
  padding-top: var(--c-3);
  border-top: 1px solid var(--c-nav-border);
}
.nav-header-toggle,
.nav-mini-expand {
  width: 24px;
  min-width: 24px;
  height: 24px;
  min-height: 24px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 0;
  border-radius: var(--c-radius-sm);
  background: transparent;
  color: var(--c-nav-fg-dim);
  box-shadow: none;
  text-indent: 100%;
}
.nav-header-toggle:hover,
.nav-mini-expand:hover {
  border-color: transparent;
  background: var(--c-nav-hover);
  color: var(--c-nav-fg);
}
.nav-header-toggle:focus-visible,
.nav-mini-expand:focus-visible {
  outline: 2px solid var(--c-accent-nav);
  outline-offset: 2px;
}
.nav-header-toggle::before,
.nav-mini-expand::before {
  width: 12px;
  height: 12px;
}
#navMiniBtn {
  --control-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 18-6-6 6-6'/%3E%3C/svg%3E");
}
#navExpandBtn {
  --control-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E");
  margin: var(--c-2) auto 0;
}
.nav-mini-expand { display: none; }
.app-shell.nav-mini .nav-mini-expand { display: grid; }
.app-shell.nav-mini .brand-text,
.app-shell.nav-mini .nav-header-toggle { display: none; }
.app-shell.nav-mini .shell-nav-label,
.app-shell.nav-mini #runStatus { display: none; }
.app-shell.nav-mini .side-nav { padding: var(--c-4) var(--c-2); }

.side-link {
  display: flex; align-items: center; gap: 10px;
  min-height: 28px; padding: 0 10px;
  border-radius: var(--c-radius-sm);
  font-size: 13px; font-weight: 600; color: var(--c-nav-fg);
  text-decoration: none;
}
.side-link:hover { background: var(--c-nav-hover); color: var(--c-nav-fg); }
.side-link.parent { justify-content: flex-start; text-align: left; }
.side-link-caret { margin-left: auto; }
.side-link.child { min-height: 26px; padding-left: 14px; font-size: 12px; color: var(--c-nav-fg-dim); text-align: left; }
.nav-section + .nav-section { margin-top: var(--c-1); }
.nav-section.bottom { margin-top: auto; padding-top: var(--c-3); border-top: 1px solid var(--c-nav-border); }
#runStatus { display: none; }
.side-link.active {
  background: var(--c-nav-active-bg);
  color: var(--c-accent-nav);
  box-shadow: inset 0 0 0 1px var(--c-nav-active-line);
}
.app-shell.nav-mini .side-link { justify-content: center; padding-left: 0; padding-right: 0; }
.app-shell.nav-mini .side-link span { display: none; }

.workspace-menu-backdrop {
  position: fixed;
  inset: 0 0 auto auto;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  z-index: 40;
  visibility: hidden;
  opacity: 0;
  background: var(--c-drawer-backdrop);
  transition: opacity 160ms ease, visibility 160ms ease;
}
.workspace-menu.open .workspace-menu-backdrop { visibility: visible; opacity: 1; }
body.workspace-drawer-open { overflow: hidden; }
.workspace-menu-panel {
  position: fixed;
  inset: 0 0 auto auto;
  z-index: 41;
  display: flex;
  width: min(430px, 100vw);
  height: 100vh;
  height: 100dvh;
  max-height: none;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--c-line);
  border-radius: 0;
  background: var(--c-surface);
  color: var(--c-text);
  box-shadow: var(--c-shadow-menu);
  flex-direction: column;
  visibility: hidden;
  opacity: 0;
  transform: translateX(100%);
  transition: transform 180ms ease, opacity 180ms ease, visibility 180ms ease;
}
.workspace-menu.open .workspace-menu-panel {
  display: flex;
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
}
.workspace-menu-heading {
  display: flex;
  min-height: 70px;
  padding: var(--c-4) var(--c-5);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--c-line);
}
.workspace-menu-heading h2 { margin: 2px 0 0; font-size: 18px; color: var(--c-text); }
.workspace-menu-eyebrow { color: var(--c-text-faint); font-size: 10px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.workspace-menu-close { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: var(--c-radius-sm); font-size: 22px; line-height: 1; }
.workspace-menu-scroll { min-height: 0; padding: var(--c-3) var(--c-4) var(--c-6); overflow-y: auto; }
.workspace-menu-panel .workspace-menu-user { border-color: var(--c-line); }
.workspace-menu-panel .workspace-menu-user strong,
.workspace-menu-panel .workspace-menu-item,
.workspace-menu-panel .workspace-shell-state strong { color: var(--c-text); }
.workspace-menu-panel .workspace-menu-user small,
.workspace-menu-panel .workspace-menu-item small,
.workspace-menu-panel .workspace-menu-section,
.workspace-menu-panel .workspace-shell-state { color: var(--c-text-muted); }
.workspace-menu-panel .workspace-menu-item:hover,
.workspace-menu-panel .workspace-menu-item:focus-visible { background: var(--c-row-hover); color: var(--c-text); }
.workspace-theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--c-2); margin: 0 var(--c-2) var(--c-4); }
.workspace-theme-option { display: flex; min-height: 42px; padding: var(--c-2) var(--c-3); align-items: center; justify-content: flex-start; gap: var(--c-2); border: 1px solid var(--c-line); background: var(--c-surface-sunk); color: var(--c-text-body); }
.workspace-theme-option[aria-checked="true"] { border-color: var(--c-accent); box-shadow: 0 0 0 2px var(--c-focus-ring); color: var(--c-text); }
.theme-swatch { width: 18px; height: 18px; flex: 0 0 18px; border: 1px solid var(--c-line-strong); border-radius: 999px; }
.theme-swatch-light { background: linear-gradient(135deg, var(--c-theme-light-a) 50%, var(--c-theme-light-b) 50%); }
.theme-swatch-dark { background: linear-gradient(135deg, var(--c-theme-dark-a) 50%, var(--c-theme-dark-b) 50%); }
.theme-swatch-cyberpunk { background: linear-gradient(135deg, var(--c-theme-cyberpunk-a) 50%, var(--c-theme-cyberpunk-b) 50%); }
.theme-swatch-neon { background: linear-gradient(135deg, var(--c-theme-neon-a) 50%, var(--c-theme-neon-b) 50%); }
@media (max-width: 520px) {
  .workspace-theme-options { grid-template-columns: 1fr; }
}

.side-link i {
  width: 18px; height: 18px; flex: 0 0 18px;
  background: currentColor;
  mask-position: center; mask-size: contain; mask-repeat: no-repeat;
  -webkit-mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat;
}
.side-link.child::before,
.side-link.child i { width: 14px; height: 14px; flex: 0 0 14px; opacity: .85; }

.nav-section-title {
  margin: var(--c-4) 10px var(--c-1);
  font-size: 10px; font-weight: 900; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-nav-section);
}
.global-secondary-nav {
  display: flex;
  align-items: center;
  gap: var(--c-1);
  min-height: 30px;
  padding: 0 var(--c-5);
  overflow-x: auto;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-surface);
  scrollbar-width: none;
}
.global-secondary-nav::-webkit-scrollbar { display: none; }
.global-secondary-link {
  height: 30px;
  min-height: 30px;
  padding: 0 var(--c-2);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 11px;
  font-weight: 600;
}
.global-secondary-link:hover { background: var(--c-surface-sunk); color: var(--c-text); }
.global-secondary-link.active,
.global-secondary-link:focus-visible { border-bottom-color: var(--c-accent); color: var(--c-text); outline: 0; }

button, .button, .btn, input[type="submit"],
select, input[type="text"], input[type="email"], input[type="search"], input[type="number"] {
  box-sizing: border-box;
  height: var(--c-control-h);
  border-radius: var(--c-radius-sm);
  font-family: var(--c-font);
  font-size: 13px;
  line-height: 1;
}

button, .button, .btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 var(--c-3);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--c-line);
  background: var(--c-surface);
  color: var(--c-text);
  transition: background .12s ease, border-color .12s ease;
}
button:hover, .button:hover, .btn:hover { border-color: var(--c-line-strong); }

button.primary, .btn-primary, .button.primary {
  border-color: transparent; background: var(--c-accent); color: var(--c-on-accent);
}
button.primary:hover, .btn-primary:hover, .button.primary:hover { background: var(--c-accent-hover); }

button.ghost, .btn-ghost { border-color: transparent; background: transparent; color: var(--c-text-muted); }
button.ghost:hover, .btn-ghost:hover { background: var(--c-surface-sunk); color: var(--c-text); }

button.danger, .btn-danger { border-color: var(--c-line); background: var(--c-surface); color: var(--c-red); }
button.danger:hover, .btn-danger:hover { background: var(--c-red-bg); }

.icon-button {
  width: var(--c-control-h); height: var(--c-control-h);
  padding: 0; display: grid; place-items: center;
  border: 1px solid var(--c-line); border-radius: var(--c-radius-sm);
  background: var(--c-surface); color: var(--c-text-muted); cursor: pointer;
}
.icon-button:hover { color: var(--c-text); border-color: var(--c-line-strong); }

input[type="text"], input[type="email"], input[type="search"], input[type="number"], select {
  width: 100%; padding: 0 11px;
  border: 1px solid var(--c-line); background: var(--c-surface); color: var(--c-text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--c-accent);
  box-shadow: 0 0 0 3px var(--c-focus-ring);
}
::placeholder { color: var(--c-placeholder); }

.segmented {
  box-sizing: border-box; display: inline-flex;
  height: var(--c-control-h);
  border: 1px solid var(--c-line); border-radius: var(--c-radius-sm);
  background: var(--c-surface); overflow: hidden;
}
.segmented > * {
  display: inline-flex; align-items: center; padding: 0 10px;
  font-size: 12px; font-weight: 600; color: var(--c-text-muted); cursor: pointer;
}
.segmented > .is-on {
  background: var(--c-accent-soft);
  color: var(--c-accent-hover);
  box-shadow: inset 0 0 0 1px var(--c-accent-line);
}

button.secondary, .download.secondary,
.quick-actions button.secondary, .quick-actions .download.secondary {
  background: var(--c-accent-soft);
  border-color: var(--c-accent-line);
  color: var(--c-accent-hover);
}
button.secondary:hover, .download.secondary:hover,
.quick-actions button.secondary:hover, .quick-actions .download.secondary:hover {
  background: var(--c-accent-line);
  border-color: var(--c-accent);
  color: var(--c-accent-hover);
}
button.secondary:disabled, .download.secondary[aria-disabled="true"] {
  background: var(--c-surface-sunk);
  border-color: var(--c-line);
  color: var(--c-text-faint);
}

.switch { width: 38px; height: 22px; border-radius: var(--c-radius-pill); padding: 2px; background: var(--c-switch-off); cursor: pointer; }
.switch > i { display: block; width: 18px; height: 18px; border-radius: var(--c-radius-pill); background: var(--c-surface); box-shadow: var(--c-switch-shadow); transition: transform .14s ease; }
.switch.is-on { background: var(--c-accent); }
.switch.is-on > i { transform: translateX(16px); }

.card, .record-panel, .panel, .data-table-wrap, .stat {
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius-md);
  background: var(--c-surface);
  box-shadow: var(--c-shadow-card);
}
.card { padding: var(--c-5); }

.workspace-menu {
  min-width: 210px; padding: var(--c-2);
  border: 1px solid var(--c-line); border-radius: var(--c-radius-md);
  background: var(--c-surface); box-shadow: var(--c-shadow-menu);
}
.workspace-menu a {
  display: flex; align-items: center; width: 100%;
  min-height: var(--c-control-h); padding: 0 var(--c-2);
  border: 0; background: none; border-radius: var(--c-radius-sm);
  font-size: 13px; font-weight: 600; color: var(--c-text); text-align: left;
}

.badge, .status-pill {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 var(--c-2);
  border-radius: var(--c-radius-pill);
  font-size: 11px; font-weight: 800; line-height: 1.2;
  background: var(--c-badge-bg); border: 1px solid var(--c-line-strong); color: var(--c-text-label);
}
.badge.is-green,  .status-pill.is-customer  { background:var(--c-green-bg); border-color:var(--c-green-border); color:var(--c-green); }
.badge.is-blue,   .status-pill.is-prospect  { background:var(--c-accent-soft); border-color:var(--c-accent-line); color:var(--c-accent-hover); }
.badge.is-purple, .status-pill.is-scheduled { background:var(--c-purple-bg); border-color:var(--c-purple-border); color:var(--c-purple); }
.badge.is-yellow, .status-pill.is-pending   { background:var(--c-amber-bg); border-color:var(--c-amber-border); color:var(--c-amber); }
.badge.is-orange, .status-pill.is-warning   { background:var(--c-amber-bg); border-color:var(--c-amber-border); color:var(--c-amber-strong); }
.badge.is-red,    .status-pill.is-failed    { background:var(--c-red-bg); border-color:var(--c-red-border); color:var(--c-red); }
.badge.completed, .status-badge.completed { background: var(--c-green-bg); border-color: var(--c-green-border); color: var(--c-green); }
.badge.active, .status-badge.active { background: var(--c-accent-soft); border-color: var(--c-accent-line); color: var(--c-accent-hover); }
.badge.scheduled, .status-badge.scheduled { background: var(--c-surface-sunk); border-color: var(--c-line); color: var(--c-text); }
.badge.pending, .status-badge.pending { background: var(--c-amber-bg); border-color: var(--c-amber-border); color: var(--c-amber); }
.badge.warning, .status-badge.warning, .review { background: var(--c-amber-bg); border-color: var(--c-amber-border); color: var(--c-amber-strong); }
.badge.danger, .status-badge.danger, .exclude { background: var(--c-red-bg); border-color: var(--c-red-border); color: var(--c-red); }
.badge.neutral, .status-badge.neutral, .status-pill.idle { background: var(--c-badge-bg); border-color: var(--c-line-strong); color: var(--c-text-label); }


.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}
.data-table-wrap table {
  display: table;
  table-layout: auto;
  inline-size: max-content;
  width: max-content;
  min-width: 100%;
  max-width: none;
  border-collapse: collapse;
}

thead th {
  height: var(--c-head-h); padding: 0 var(--c-3);
  background: var(--c-surface-head);
  border-bottom: 1px solid var(--c-line);
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  text-transform: uppercase; color: var(--c-text-faint);
  text-align: left; white-space: nowrap;
}
tbody td {
  height: var(--c-row-h); padding: 0 var(--c-3);
  border-bottom: 1px solid var(--c-line);
  font-size: 13px; color: var(--c-text-body);
  vertical-align: middle;
}
tbody tr:hover td { background: var(--c-row-hover); }
tbody tr:last-child td { border-bottom: 0; }

[data-density="compact"] tbody td { height: var(--c-row-h-compact); }

th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.date, td.date { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-weight: 600; }

td .cell-main { font-size: 13px; font-weight: 600; color: var(--c-text-body); }
td .cell-sub  { font-size: 12px; color: var(--c-text-muted); }
td .cell-main, td .cell-sub { white-space: nowrap; overflow: visible; text-overflow: clip; }

.data-table-wrap th,
.data-table-wrap td { white-space: nowrap; max-width: none; overflow: visible; text-overflow: clip; }
.data-table-wrap th:first-child,
.data-table-wrap td:first-child { min-width: 180px; }
.data-table-wrap th:nth-child(2),
.data-table-wrap td:nth-child(2) { min-width: 160px; }
.data-table-wrap th:nth-child(3),
.data-table-wrap td:nth-child(3) { min-width: 140px; }
.data-table-wrap th:nth-child(n + 4),
.data-table-wrap td:nth-child(n + 4) { min-width: 120px; }

.stat { padding: var(--c-3) var(--c-4); }
.empty-state {
  padding: 44px var(--c-7); text-align: center;
  border: 1px solid var(--c-line); border-radius: var(--c-radius-md);
  background: var(--c-surface); box-shadow: var(--c-shadow-card);
}
.empty-state h3 { margin: 0; font-size: 15px; font-weight: 700; }
.empty-state p { margin: 6px auto var(--c-4); max-width: 460px; font-size: 13px; line-height: 1.5; color: var(--c-text-muted); }

@keyframes corvo-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.record-action-bar { display: flex; align-items: center; gap: var(--c-2); }
.record-action-bar .quick {
  width: var(--c-control-h); height: var(--c-control-h);
  border-radius: var(--c-radius-pill);
  border: 1px solid var(--c-line); background: var(--c-surface);
  display: grid; place-items: center; color: var(--c-text-muted); cursor: pointer;
}
.record-action-bar .quick:hover { color: var(--c-accent); border-color: var(--c-accent-line); background: var(--c-accent-soft); }

.record-tabs { display: flex; gap: var(--c-5); border-bottom: 1px solid var(--c-line); }
.record-tabs a { padding: 10px 0; font-size: 13px; font-weight: 600; color: var(--c-text-muted); text-decoration: none; }
.record-tabs a.is-active { color: var(--c-text); box-shadow: inset 0 -2px 0 var(--c-accent); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--c-4); }
.field-grid label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 700; color: var(--c-text-label); }
.field-hint { margin-top: 5px; font-size: 11.5px; line-height: 1.45; color: var(--c-text-faint); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: var(--c-4); }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.15; }
.page-head .sub { margin-top: 3px; font-size: 13px; color: var(--c-text-muted); }
.page-body { padding: var(--c-6) var(--c-7) var(--c-8); }

main.page, main.single-page {
  width: 100%; max-width: none; margin: 0; padding: var(--c-6) var(--c-7) var(--c-8);
  display: none; grid-template-columns: 1fr; gap: var(--c-4);
  background: var(--c-app-bg);
}
main.page.active { display: grid; }
main.page > section, main.page > aside,
main.single-page > section, main.single-page > aside {
  min-width: 0;
  border: 1px solid var(--c-line);
  border-radius: var(--c-radius-md);
  background: var(--c-surface);
  box-shadow: var(--c-shadow-card);
}

.panel-body { padding: var(--c-5); }
.app-shell.nav-mini .side-children { display: none; }

.density-host { display: inline-flex; align-items: center; margin-left: auto; }
.table-state-loading { color: var(--c-text-muted); }
.table-state-error h3 { color: var(--c-red); }

.funnel-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--c-3); margin-bottom: 5px; }
.funnel-head b { font-size: 13px; font-weight: 600; }
.funnel-head span { font-size: 12px; color: var(--c-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.funnel-fill { height: 100%; border-radius: var(--c-radius-sm); background: var(--chart-1); }

.bullet-row { margin-bottom: var(--c-3); }
.bullet-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 5px; }
.bullet-head b { font-size: 13px; font-weight: 600; }
.bullet-head span { font-size: 12px; color: var(--c-text-muted); font-variant-numeric: tabular-nums; }
.bullet-track { position: relative; height: 12px; border-radius: var(--c-radius-sm); background: var(--c-line-soft); }
.bullet-fill { height: 100%; border-radius: var(--c-radius-sm); background: var(--chart-1); }
.bullet-target { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--c-text); }

.heatmap { display: grid; gap: 3px; }
.heatmap-cell { border-radius: 6px; background: var(--c-line-soft); aspect-ratio: 1 / 1; }
.heatmap-cell.q1 { background: var(--chart-4); opacity: .28; }
.heatmap-cell.q2 { background: var(--chart-4); opacity: .52; }
.heatmap-cell.q3 { background: var(--chart-1); opacity: .74; }
.heatmap-cell.q4 { background: var(--chart-1); }
.heatmap-label { font-size: 11px; color: var(--c-text-faint); text-align: center; }
.heatmap-legend { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--c-text-muted); }

.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--c-3); margin-top: var(--c-2); font-size: 12px; color: var(--c-text-muted); }
.chart-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 6px; margin-right: 5px; vertical-align: -1px; }
.chart-legend .s1 { background: var(--chart-1); }
.chart-legend .s2 { background: var(--chart-2); }
.chart-legend .s3 { background: var(--chart-3); }
.chart-legend .s4 { background: var(--chart-4); }
.chart-legend .s5 { background: var(--chart-5); }

.chart-data-details { margin-top: var(--c-3); }
.chart-data-details > summary { font-size: 12px; font-weight: 600; color: var(--c-text-muted); cursor: pointer; }
.chart-data-details > summary:hover { color: var(--c-text); }

.autosave-note { display: flex; align-items: center; gap: 6px; margin: var(--c-4) 0 0; font-size: 13px; color: var(--c-text-muted); }
.autosave-tick { color: var(--c-green); font-size: 14px; line-height: 1; }
.inline-edit-error { display: block; margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--c-red); }

.result-sheet { padding: var(--c-5); border: 1px solid var(--c-line); border-radius: var(--c-radius-md); background: var(--c-surface); box-shadow: var(--c-shadow-card); }
.result-sheet h3 { margin: 0 0 var(--c-3); font-size: 15px; font-weight: 700; }
.result-sheet-invalid { border-color: var(--c-red-border); }
.result-sheet-invalid h3 { color: var(--c-red); }
.result-tallies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--c-3); }
.result-tally { padding: var(--c-3) var(--c-4); border: 1px solid var(--c-line); border-radius: var(--c-radius-sm); background: var(--c-surface-sunk); }
.result-tally b { display: block; font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.result-tally span { display: block; margin-top: 4px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--c-text-faint); }
.result-tally i { display: block; margin-top: 5px; font-size: 12px; font-style: normal; color: var(--c-text-muted); }
.result-tally.is-ok b { color: var(--c-green); }
.result-tally.is-warn b { color: var(--c-amber); }
.result-tally.is-bad b { color: var(--c-red); }
.result-reasons { margin-top: var(--c-4); }

.data-table-wrap table[hidden],
.record-page > table[hidden],
.view-panel > table[hidden],
.record-panel > table[hidden] { display: none; }

.table-toolbar-rule { width: 1px; align-self: stretch; min-height: 20px; background: var(--c-line); margin: 0 var(--c-1); flex: 0 0 auto; }
.table-toolbar-system { display: flex; align-items: center; justify-content: space-between; gap: var(--c-2); flex-wrap: wrap; }
.table-toolbar-left { display: flex; align-items: center; gap: var(--c-2); min-width: 0; flex: 1 1 auto; }
.table-toolbar-right { display: flex; align-items: center; gap: var(--c-2); flex: 0 0 auto; margin-left: var(--c-3); }

.table-toolbar-left > .view-tabs { min-width: 0; overflow-x: auto; flex: 0 1 auto; scrollbar-width: none; }
.table-toolbar-left > .view-tabs::-webkit-scrollbar { display: none; }
.table-toolbar-system { flex-wrap: nowrap; }

.table-toolbar-system[data-contacts-toolbar="true"] { align-items: flex-start; }
.contacts-toolbar-layout { display: grid; gap: var(--c-2); }
.contacts-toolbar-layout .table-toolbar-control-plane { display: flex; align-items: center; gap: var(--c-2); min-width: 0; }
.contacts-toolbar-layout > .view-tabs { order: 2; min-width: 0; overflow-x: auto; }

.side-nav { display: flex; flex-direction: column; overflow-y: auto; }
.side-nav > .nav-section.bottom { margin-top: auto; }
.side-link { min-height: 30px; }
.nav-section-title { margin: var(--c-3) 10px var(--c-1); }
.nav-section { margin-bottom: var(--c-1); }

.capability-foundation { display: grid; gap: var(--c-4); }
.capability-foundation .crm-toolbar { align-items: flex-start; }
.capability-foundation h3 { margin: var(--c-2) 0 var(--c-1); }
.capability-foundation p { margin: 0; color: var(--c-text-muted); }
.capability-boundary { display: grid; gap: 4px; padding: var(--c-3) var(--c-4); border: 1px solid var(--c-amber-border); border-radius: var(--c-radius-sm); background: var(--c-amber-soft); color: var(--c-text); }
.capability-boundary span { color: var(--c-text-muted); }
.capability-plan { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--c-3); }
.capability-plan > div { display: flex; align-items: center; gap: var(--c-2); padding: var(--c-3); border: 1px solid var(--c-line); border-radius: var(--c-radius-sm); background: var(--c-surface-sunk); }
.capability-plan > div > span { display: grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 999px; background: var(--c-accent-soft); color: var(--c-accent); font-weight: 800; }
.capability-plan > div > p { color: var(--c-text); font-size: 13px; font-weight: 600; }
@media (max-width: 760px) { .capability-plan { grid-template-columns: 1fr; } }

.global-back { box-sizing: border-box; display: grid; place-items: center; width: 32px; height: 32px; margin-right: 2px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-surface); color: var(--c-text); font-size: 15px; cursor: pointer; }
.global-back:hover { background: var(--c-bg); }
.global-lead { display: flex; align-items: center; gap: 10px; min-width: 0; }
