:root {
  --font-ui: "Segoe UI", Arial, sans-serif;
  color-scheme: light;
  font-family: var(--font-ui);
  --primary-50: #f3f7ff;
  --primary-100: #dbe7ff;
  --primary-200: #b7ceff;
  --primary-400: #4f7cff;
  --primary-500: #1f57ff;
  --primary-600: #183fc7;
  --primary-700: #183fc7;
  --accent: #40c4aa;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --app-background: #f5f7fb;
  --app-text: #0b1d37;
  --surface: #ffffff;
  --surface-translucent: rgba(255, 255, 255, 0.85);
  --header-translucent: rgba(255, 255, 255, 0.95);
  --line: var(--slate-200);
  --sidebar-default-width: 320px;
  --sidebar-min-width: 248px;
  --sidebar-max-width: 420px;
  --sidebar-collapsed-width: 88px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-popover: 0 10px 30px rgba(15, 23, 42, 0.14);
  --ink: var(--app-text);
  --muted: var(--slate-500);
  --paper: var(--app-background);
  --paper-strong: var(--surface);
  --moss: var(--primary-500);
  --moss-soft: var(--primary-100);
  --copper: var(--primary-500);
  --copper-dark: var(--primary-600);
  --sage: var(--primary-100);
  --cream: var(--surface);
  --blueprint: var(--primary-500);
  --danger: #9c332f;
  --shadow: var(--shadow-card);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  background-color: var(--app-background);
  background-image: linear-gradient(135deg, #f9fbff 0%, #f0f4ff 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

body.is-locked {
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

body.is-locked .app-shell {
  display: block;
  width: min(28rem, 100%);
  min-height: auto;
}

body.is-locked .sidebar,
body.is-locked .topbar > div:first-child,
body.is-locked .workspace-section {
  display: none !important;
}

body.is-locked .content {
  padding: 0;
}

body.is-locked .topbar {
  display: block;
  margin: 0;
}

body.is-locked .auth-card {
  min-width: 0;
  width: 100%;
  padding: 1rem;
  box-shadow: var(--shadow);
}

body.is-locked .account-menu {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 18rem minmax(0, 1fr);
  min-height: 100vh;
  max-width: 100vw;
  min-width: 0;
}

.sidebar {
  background: var(--moss);
  color: var(--cream);
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.sidebar::after {
  content: "";
  position: absolute;
  inset: auto -5rem -6rem auto;
  width: 15rem;
  height: 15rem;
  border-radius: 50%;
  background: rgba(182, 201, 169, 0.16);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  position: relative;
  z-index: 1;
}

.brand-row strong {
  display: block;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(251, 245, 231, 0.55);
  display: grid;
  place-items: center;
  color: var(--sage);
  margin-bottom: 0.8rem;
  letter-spacing: -0.08em;
  font-size: 1rem;
}

.eyebrow {
  color: var(--copper);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: none;
}

.sidebar h1 {
  font-size: 1.35rem;
  line-height: 1.15;
  margin: 0.85rem 0 0.45rem;
  letter-spacing: -0.025em;
}

.sidebar p {
  color: rgba(251, 245, 231, 0.72);
  line-height: 1.4;
  font-size: 0.86rem;
}

.nav-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 2.2rem;
  position: relative;
  z-index: 1;
}

.nav-pill {
  border: 1px solid rgba(251, 245, 231, 0.18);
  color: var(--cream);
  padding: 0.8rem 0.9rem;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  text-align: left;
}

.nav-pill:hover,
.nav-pill.active {
  border-color: rgba(251, 245, 231, 0.5);
}

.nav-pill.active {
  background: rgba(251, 245, 231, 0.13);
  box-shadow: inset 4px 0 0 var(--copper);
}

.nav-link {
  display: block;
}

.content {
  padding: 2rem;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.topbar h2 {
  margin: 0.25rem 0 0;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.auth-card {
  min-width: 15rem;
  background: rgba(255, 249, 235, 0.78);
  border: 1px solid var(--line);
  padding: 0.8rem;
}

.auth-card form {
  display: grid;
  gap: 0.45rem;
}

.auth-card label {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  text-transform: none;
}

.auth-card input,
.auth-card select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0.75rem;
}

.auth-card .secondary-button {
  color: var(--moss);
  border-color: rgba(40, 63, 54, 0.28);
}

.form-message {
  border: 1px solid rgba(185, 91, 49, 0.35);
  background: rgba(185, 91, 49, 0.08);
  color: var(--muted);
  margin-top: 0.75rem;
  padding: 0.75rem;
}

.form-message.error {
  border-color: rgba(151, 50, 50, 0.4);
  background: rgba(151, 50, 50, 0.08);
  color: var(--danger);
}

.form-message.success {
  border-color: rgba(40, 63, 54, 0.3);
  background: rgba(40, 63, 54, 0.08);
  color: var(--moss);
}

.modal-form label {
  color: var(--muted);
  display: grid;
  gap: 0.35rem;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

.account-menu {
  position: relative;
}

.account-button {
  align-items: center;
  background: rgba(255, 249, 235, 0.78);
  border: 1px solid var(--line);
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 0.6rem;
  max-width: 17rem;
  padding: 0.45rem 0.65rem;
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  border-color: rgba(40, 63, 54, 0.34);
  background: var(--paper-strong);
}

.account-avatar {
  background: var(--moss);
  color: var(--cream);
  display: grid;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 700;
  height: 1.9rem;
  place-items: center;
  width: 1.9rem;
}

#account-summary {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  min-width: 17rem;
  padding: 0.8rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.45rem);
  z-index: 20;
}

.account-popover .secondary-button {
  color: var(--moss);
  border-color: rgba(40, 63, 54, 0.28);
}

.current-user {
  display: grid;
  gap: 0.2rem;
  margin: 0.55rem 0;
  font-size: 0.82rem;
}

.current-user strong,
.current-user span {
  overflow-wrap: anywhere;
}

.workspace-section {
  display: none;
  max-width: 100%;
  min-width: 0;
}

.workspace-section.active {
  display: block;
  animation: section-in 180ms ease-out;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(0.35rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero {
  background: rgba(255, 249, 235, 0.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(19rem, 0.65fr);
  gap: 1.5rem;
}

.hero h2,
.hero h3 {
  font-size: 1.45rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin: 0.35rem 0 0;
  max-width: none;
}

.hero h3 {
  font-size: 1.45rem;
}

.run-card {
  background: var(--moss);
  color: var(--cream);
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.readiness-card {
  align-self: stretch;
  background: var(--moss);
  color: var(--cream);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem;
  display: grid;
  align-content: end;
}

.readiness-card span {
  color: var(--sage);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: none;
}

.readiness-card strong {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.2rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.readiness-card p {
  color: rgba(251, 245, 231, 0.72);
  line-height: 1.5;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.section-heading h3 {
  margin-bottom: 0;
}

.stage-chip {
  border: 1px solid rgba(182, 95, 52, 0.3);
  color: var(--copper-dark);
  background: rgba(182, 95, 52, 0.08);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.6rem;
  text-transform: none;
  white-space: nowrap;
}

.flow-card {
  display: grid;
  gap: 0.85rem;
}

.flow-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  padding: 1rem;
}

.flow-step h4 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.flow-step p {
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.connector-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.24);
  margin-top: 1rem;
  padding: 1rem;
}

.run-step {
  background: rgba(40, 63, 54, 0.08);
}

.step-number {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--moss);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 0.78rem;
}

.form-grid {
  display: grid;
  gap: 0.85rem;
}

.form-grid.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 0.55fr);
  align-items: end;
}

.form-grid.three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

.upload-grid {
  border-top: 1px solid var(--line);
  margin-top: 0.9rem;
  padding-top: 0.9rem;
}

.flow-card .field label,
.flow-card .field input,
.flow-card .field select,
.flow-card .field textarea {
  color: var(--ink);
}

.flow-card .field label {
  color: var(--muted);
}

.flow-card .field input,
.flow-card .field select,
.flow-card .field textarea {
  border-color: var(--line);
  background: var(--paper-strong);
}

.flow-card .field textarea {
  min-height: 8rem;
  resize: vertical;
}

.flow-card .secondary-button {
  color: var(--moss);
  border-color: rgba(40, 63, 54, 0.28);
}

.flow-card .secondary-button:hover {
  border-color: var(--moss);
}

.admin-workflow {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  gap: 1rem;
}

.admin-workflow.single-admin-tab {
  grid-template-columns: minmax(0, 1fr);
}

.admin-rail {
  display: grid;
  align-content: start;
  gap: 0.55rem;
}

.admin-tab {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  padding: 0.75rem;
  text-align: left;
}

.admin-tab span {
  font-weight: 700;
}

.admin-tab small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.admin-tab.active {
  border-color: var(--copper);
  background: rgba(182, 95, 52, 0.09);
  box-shadow: inset 4px 0 0 var(--copper);
}

.admin-main {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.admin-context {
  border: 1px solid var(--line);
  background: rgba(255, 249, 235, 0.56);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 0.8rem;
}

.admin-context > div {
  min-width: 0;
}

.admin-context strong {
  display: block;
  margin-top: 0.2rem;
  overflow-wrap: anywhere;
}

.admin-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.24);
  display: none;
  gap: 0.9rem;
  padding: 0.9rem;
}

.admin-panel.active {
  display: grid;
}

.admin-panel-heading {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 0.75rem;
}

.admin-panel-heading h4 {
  margin: 0;
}

.admin-panel-heading p {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.25rem 0 0;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: flex-end;
}

.admin-list-card {
  border: 1px solid var(--line);
  background: rgba(255, 249, 235, 0.38);
  min-width: 0;
  padding: 0.85rem;
}

.modal-backdrop {
  align-items: center;
  background: rgba(23, 33, 29, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1.5rem;
  position: fixed;
  z-index: 100;
}

.modal-dialog {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  max-height: min(46rem, calc(100vh - 3rem));
  overflow: auto;
  padding: 1rem;
  width: min(76rem, calc(100vw - 3rem));
}

.small-dialog {
  width: min(38rem, calc(100vw - 3rem));
}

.modal-section {
  display: grid;
  gap: 1rem;
}

.modal-header,
.modal-subheader {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding-bottom: 0.75rem;
}

.modal-subheader {
  border-bottom: 0;
  padding-bottom: 0;
}

.modal-header h4,
.modal-header p,
.modal-subheader h4 {
  margin: 0;
}

.modal-header p {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

.modal-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-form-note { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

.company-onboarding { display: grid; gap: 1rem; }
.onboarding-section { border: 1px solid var(--line); border-radius: 0.75rem; padding: 1rem 1.2rem 1.15rem; display: grid; gap: 0.8rem; min-width: 0; background: var(--paper-strong); }
.onboarding-section legend { color: var(--ink); font-weight: 700; padding: 0 0.35rem; }
.onboarding-step { display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; margin-right: 0.45rem; border-radius: 50%; background: #e8eefc; color: #1745a1; font-size: 0.8rem; }
.onboarding-section label { display: grid; gap: 0.4rem; color: var(--ink); font-size: 0.9rem; font-weight: 600; }
.onboarding-section input:not([type="radio"]), .onboarding-section select { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 0.55rem; background: #fff; color: var(--ink); padding: 0.7rem 0.8rem; font: inherit; }
.onboarding-section input:focus-visible, .onboarding-section select:focus-visible { outline: 2px solid #2758ce; outline-offset: 1px; }
.onboarding-section p { margin: 0; color: var(--muted); font-size: 0.82rem; }
.onboarding-system-users { display: grid; gap: 0.45rem; padding: 0.85rem; border: 1px solid #cbd9f5; border-radius: 0.65rem; background: #f4f7ff; overflow-wrap: anywhere; }
.onboarding-system-users strong { color: var(--ink); font-size: 0.9rem; }
.onboarding-grid, .onboarding-mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.onboarding-section .onboarding-mode { display: flex; gap: 0.65rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 0.65rem; padding: 0.85rem; cursor: pointer; }
.onboarding-mode:has(input:checked) { border-color: #2758ce; background: #f2f6ff; box-shadow: inset 0 0 0 1px #2758ce; }
.onboarding-mode input { margin: 0.2rem 0 0; accent-color: #2758ce; }
.onboarding-mode strong, .onboarding-mode small { display: block; }
.onboarding-mode small { margin-top: 0.3rem; color: var(--muted); font-weight: 400; line-height: 1.4; }
.onboarding-actions { display: flex; justify-content: flex-end; }
@media (max-width: 680px) { .onboarding-grid, .onboarding-mode-grid { grid-template-columns: minmax(0, 1fr); } }

.company-detail-form {
  grid-template-columns: minmax(10rem, 0.7fr) minmax(14rem, 1.2fr) minmax(8rem, 0.5fr) auto;
}

.object-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.object-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.85rem;
}

.object-panel h4 {
  margin: 0;
}

.object-panel-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.setup-list-panel {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
  min-width: 0;
  padding: 1rem;
}

.setup-subsection {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.table-actions,
.modal-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.setup-detail-panel {
  display: grid;
  gap: 1rem;
}

.object-table td:last-child,
.object-table th:last-child {
  text-align: left;
  width: auto;
}

.table-action {
  border: 1px solid rgba(40, 63, 54, 0.22);
  background: rgba(40, 63, 54, 0.06);
  color: var(--moss);
  cursor: pointer;
  padding: 0.35rem 0.55rem;
}

.table-action:hover {
  border-color: var(--moss);
}

.table-action:disabled {
  cursor: default;
  opacity: 0.68;
}

.selected-history-row {
  background: rgba(182, 95, 52, 0.08);
  box-shadow: inset 4px 0 0 var(--copper);
}

.selected-history-row .table-action {
  border-color: rgba(182, 95, 52, 0.34);
  color: var(--copper-dark);
}

.inline-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.admin-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.admin-form-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: minmax(0, 1fr);
}

.admin-form-grid.two-col {
  grid-template-columns: minmax(0, 1fr);
}

.admin-card {
  display: grid;
  gap: 0.55rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  padding: 0.85rem;
}

.admin-card h4 {
  margin: 0 0 0.25rem;
}

.admin-card-wide {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.admin-card-wide h4 {
  grid-column: 1 / -1;
}

.admin-card input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0.7rem;
}

.admin-card select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0.7rem;
}

.admin-card input[readonly] {
  color: var(--muted);
  background: rgba(255, 249, 235, 0.54);
}

.admin-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  margin-top: 0.9rem;
}

.admin-data-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.32);
  padding: 0.9rem;
  min-width: 0;
}

.admin-data-card h4 {
  margin: 0 0 0.55rem;
}

.compact-table {
  font-size: 0.82rem;
  table-layout: fixed;
}

.compact-table code {
  font-size: 0.75rem;
  white-space: normal;
  overflow-wrap: anywhere;
}

.compact-table td:last-child,
.compact-table th:last-child {
  text-align: right;
  width: 5.5rem;
}

.feed-control-table td:last-child,
.feed-control-table th:last-child {
  text-align: left;
  width: 13rem;
}

.control-total-list {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.control-total {
  display: block;
  font-size: 0.78rem;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.permission-chip {
  display: grid;
  gap: 0.15rem;
  border: 1px solid rgba(40, 63, 54, 0.2);
  background: rgba(40, 63, 54, 0.08);
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  font-size: 0.8rem;
}

.permission-chip small {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.68rem;
}

.json-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

.workflow-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.field label {
  display: block;
  color: rgba(251, 245, 231, 0.7);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin-bottom: 0.35rem;
  text-transform: none;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid rgba(251, 245, 231, 0.28);
  color: var(--cream);
  background: rgba(0, 0, 0, 0.18);
  padding: 0.8rem;
  outline: none;
}

.field input:focus,
.field select:focus {
  border-color: var(--sage);
}

.primary-button {
  border: 0;
  background: var(--copper);
  color: #fff9eb;
  padding: 0.9rem 1rem;
  cursor: pointer;
  font-weight: 700;
}

.primary-button:hover {
  background: var(--copper-dark);
}

.secondary-button {
  border: 1px solid rgba(251, 245, 231, 0.38);
  color: var(--cream);
  background: transparent;
  padding: 0.8rem 1rem;
  cursor: pointer;
}

.secondary-button:hover {
  border-color: var(--sage);
}

.secondary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.panel {
  grid-column: span 6;
  background: rgba(255, 249, 235, 0.74);
  border: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
  padding: 1rem;
}

.panel-wide {
  grid-column: span 12;
}

.panel h3 {
  margin: 0 0 0.8rem;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.status-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}

.status-step {
  border: 1px solid var(--line);
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.32);
}

.status-step strong {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: none;
}

.status-step span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
}

.status-step.active {
  border-color: var(--copper);
  box-shadow: inset 0 -4px 0 var(--copper);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.metric-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.insights-overview {
  display: grid;
  gap: 1rem;
}

.insights-metrics {
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

.insight-card {
  min-height: 6rem;
}

.insight-card small {
  color: var(--muted);
  display: block;
  font-family: var(--font-ui);
  font-size: 0.68rem;
  margin-top: 0.45rem;
  overflow-wrap: anywhere;
  text-transform: none;
}

.insight-card-red {
  border-color: rgba(156, 51, 47, 0.38);
  box-shadow: inset 4px 0 0 var(--danger);
}

.two-column-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-panel {
  border: 1px solid var(--line);
  min-width: 0;
  padding: 1rem;
}

.mini-panel h4 {
  margin: 0 0 0.75rem;
}

.movement-waterfall,
.period-chart {
  display: grid;
  gap: 0.65rem;
}

.waterfall-row,
.period-bar {
  align-items: center;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(8rem, 1fr) minmax(8rem, 2fr) minmax(6rem, auto);
  min-width: 0;
}

.waterfall-label,
.period-bar span {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.waterfall-track {
  background: rgba(40, 63, 54, 0.08);
  border: 1px solid var(--line);
  height: 0.72rem;
  min-width: 0;
  overflow: hidden;
}

.waterfall-track span,
.waterfall-track i {
  display: block;
  height: 100%;
}

.waterfall-track .positive,
.waterfall-track i.positive {
  background: var(--blueprint);
}

.waterfall-track .negative,
.waterfall-track i.negative {
  background: var(--copper);
}

.waterfall-amount,
.period-bar em {
  font-family: var(--font-ui);
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.period-chart-row {
  border: 1px solid var(--line);
  display: grid;
  gap: 0.45rem;
  padding: 0.75rem;
}

.period-chart-row > strong {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.heatmap-grid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.heatmap-cell {
  border: 1px solid var(--line);
  min-width: 0;
  padding: 0.85rem;
}

.heatmap-cell span,
.heatmap-cell small,
.heatmap-cell em {
  display: block;
  overflow-wrap: anywhere;
}

.heatmap-cell span {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

.heatmap-cell strong {
  display: block;
  margin-top: 0.4rem;
}

.heatmap-cell small,
.heatmap-cell em {
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.35rem;
}

.heatmap-green {
  background: rgba(182, 201, 169, 0.2);
  box-shadow: inset 4px 0 0 var(--sage);
}

.heatmap-amber {
  background: rgba(182, 95, 52, 0.08);
  box-shadow: inset 4px 0 0 var(--copper);
}

.heatmap-red {
  background: rgba(156, 51, 47, 0.08);
  box-shadow: inset 4px 0 0 var(--danger);
}

.disclosure-card {
  border: 1px solid var(--line);
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.75rem;
}

.disclosure-card span {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

.disclosure-card p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  margin: 0;
}

.metric {
  border: 1px solid var(--line);
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.3);
}

.metric span {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: none;
}

.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.05rem;
  word-break: break-word;
}

.hidden,
[hidden] {
  display: none !important;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.compact-tabs {
  justify-content: center;
  margin-top: -0.25rem;
}

.tab {
  border: 1px solid var(--line);
  background: transparent;
  padding: 0.55rem 0.75rem;
  cursor: pointer;
}

.tab.active {
  color: var(--cream);
  background: var(--blueprint);
  border-color: var(--blueprint);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.run-context-card {
  align-items: start;
  background: rgba(255, 249, 235, 0.56);
  border: 1px solid var(--line);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(12rem, 0.55fr) minmax(0, 1.45fr);
  margin-bottom: 1rem;
  padding: 0.8rem;
}

.run-context-card strong,
.report-browser-header h4 {
  display: block;
  margin: 0.15rem 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.run-context-card dl {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.run-context-card dt,
.run-context-inline span {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

.run-context-card dd {
  margin: 0.15rem 0 0;
}

.report-browser {
  display: grid;
  gap: 0.9rem;
  min-width: 0;
}

.report-browser-header {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(14rem, 0.75fr) minmax(0, 1.25fr);
  padding-bottom: 0.8rem;
}

.report-browser-header p {
  color: var(--muted);
  margin: 0.25rem 0 0;
}

.report-browser-metrics {
  margin: 0;
}

.run-context-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.run-context-inline span {
  background: rgba(40, 63, 54, 0.06);
  border: 1px solid rgba(40, 63, 54, 0.12);
  padding: 0.38rem 0.5rem;
}

.run-context-inline strong {
  color: var(--moss);
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0;
  margin-left: 0.2rem;
  text-transform: none;
}

.report-tabs,
.statement-tabs {
  border-bottom: 1px solid var(--line);
  gap: 0.35rem;
  margin-bottom: 0;
  padding-bottom: 0.45rem;
}

.report-tab,
.statement-tab {
  padding: 0.48rem 0.65rem;
}

.statement-tab {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-tab-panel {
  min-width: 0;
  overflow: hidden;
}

.object-browser {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 1rem;
}

.object-browser > section {
  min-width: 0;
}

.run-browser {
  grid-template-columns: minmax(22rem, 0.95fr) minmax(24rem, 1.05fr);
}

.package-browser-layout {
  max-width: 100%;
  min-width: 0;
}

.package-browser-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  min-width: 0;
}

.package-browser-title {
  align-items: flex-start;
  display: flex;
  gap: 0.8rem;
  min-width: 0;
}

.package-browser-header h4 {
  margin: 0 0 0.2rem;
}

.package-browser-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.package-browser-summary span {
  border: 1px solid var(--line);
  background: rgba(255, 249, 235, 0.58);
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 18rem;
  overflow: hidden;
  padding: 0.28rem 0.45rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.browser-field span {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

.browser-field select {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 0.7rem;
  width: 100%;
}

.compact-button {
  padding: 0.5rem 0.65rem;
  white-space: nowrap;
}

.package-browser-tabs {
  justify-content: flex-start;
}

.report-run-selector {
  align-items: end;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-bottom: 0.85rem;
  max-width: 100%;
}

.report-run-selector label {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.report-run-selector select {
  background: var(--paper-strong);
  border: 1px solid var(--line);
  color: var(--ink);
  min-width: 0;
  padding: 0.7rem;
  width: 100%;
}

.report-run-selector .secondary-button {
  border-color: rgba(40, 63, 54, 0.28);
  color: var(--moss);
}

.aggregation-panel {
  margin-top: 0.9rem;
}

.aggregation-header {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.aggregation-header h4 {
  margin: 0.1rem 0 0;
}

.compact-copy {
  color: var(--muted);
  margin: 0.4rem 0 0.7rem;
}

.aggregation-run-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin-top: 0.7rem;
}

.aggregation-run-option {
  align-items: start;
  border: 1px solid var(--line);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 0.6rem;
}

.aggregation-run-option strong,
.aggregation-run-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aggregation-run-option small {
  color: var(--muted);
  margin-top: 0.2rem;
}

.aggregation-result-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0.8rem;
}

.inline-section-title {
  margin: 0;
}

.dataset-section {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.22);
  margin-top: 0.8rem;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 0.75rem;
}

.dataset-section-header {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.dataset-grid-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.dataset-grid {
  min-width: 62rem;
}

.cell-truncate {
  display: inline-block;
  max-width: min(18rem, 100%);
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.summary-table {
  max-width: 100%;
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.summary-table th,
.summary-table td {
  border-bottom: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: 0.65rem 0.45rem;
  text-align: left;
  vertical-align: top;
  word-break: break-word;
}

.summary-table th {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  text-transform: none;
  letter-spacing: 0.09em;
}

.summary-table td .mono,
.summary-table td.mono,
.key-value-table td.mono,
.mono {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-table td:last-child:has(.table-action) {
  width: 6.25rem;
}

.inline-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.inline-list span {
  border: 1px solid var(--line);
  background: rgba(255, 249, 235, 0.58);
  color: var(--muted);
  padding: 0.22rem 0.4rem;
}

.section-title {
  margin: 1.35rem 0 0.65rem;
  color: var(--copper-dark);
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: none;
}

.minor-title {
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin: 0.85rem 0 0.45rem;
  text-transform: none;
}

.responsive-two-column {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.responsive-two-column > div {
  min-width: 0;
}

.drill-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.drill-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.28);
  padding: 0.85rem;
}

.drill-card-title,
.statement-title {
  font-weight: 700;
  margin-bottom: 0.7rem;
  letter-spacing: -0.02em;
}

.movement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.movement-cell {
  background: rgba(255, 249, 235, 0.72);
  border: 1px solid rgba(23, 33, 29, 0.1);
  padding: 0.55rem;
}

.movement-cell span {
  display: block;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.66rem;
  text-transform: none;
}

.movement-cell strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
}

.hash-strip {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

.statement-block {
  margin-bottom: 1rem;
}

.key-value-table th {
  width: 14rem;
}

.notice {
  border-left: 4px solid var(--copper);
  background: rgba(255, 255, 255, 0.42);
  padding: 0.85rem;
  color: var(--muted);
}

.compact-notice {
  margin: 0.6rem 0 0.8rem;
  padding: 0.55rem 0.75rem;
}

.readiness-summary {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.readiness-pill {
  border: 1px solid var(--line);
  background: rgba(255, 249, 235, 0.58);
  padding: 0.55rem;
  min-width: 0;
}

.readiness-pill span {
  color: var(--muted);
  display: block;
  font-family: var(--font-ui);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: none;
}

.readiness-pill strong {
  display: block;
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readiness-pill.passed {
  border-color: rgba(40, 63, 54, 0.22);
}

.readiness-pill.blocked {
  border-color: rgba(151, 50, 50, 0.34);
}

.status-good {
  color: var(--moss);
  font-weight: 700;
}

.status-bad {
  color: var(--danger);
  font-weight: 800;
}

.validation-errors {
  border: 1px solid rgba(151, 50, 50, 0.22);
  background: rgba(151, 50, 50, 0.06);
  color: var(--danger);
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
}

.validation-errors ul {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}

.validation-errors li {
  margin: 0.25rem 0;
  overflow-wrap: anywhere;
}

.error {
  color: var(--danger);
}

.notice.warning {
  border-color: rgba(182, 95, 52, 0.4);
  background: rgba(182, 95, 52, 0.08);
  color: var(--copper-dark);
}

.mono {
  font-family: var(--font-ui);
}

.detail-link {
  color: var(--blueprint);
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 91, 102, 0.35);
}

.detail-link:hover {
  color: var(--copper-dark);
  border-bottom-color: var(--copper-dark);
}

.muted {
  color: var(--muted);
}

@media (max-width: 980px) {
  .app-shell,
  .hero,
  .topbar,
  .section-heading {
    grid-template-columns: 1fr;
    display: grid;
  }

  .sidebar {
    padding: 1.25rem;
  }

  .content {
    padding: 1rem;
  }

  .panel,
  .panel-wide {
    grid-column: span 12;
  }

  .metric-grid,
  .status-rail,
  .drill-grid,
  .form-grid.two-col,
  .form-grid.three-col,
  .admin-workflow,
  .admin-context,
  .admin-form-grid,
  .admin-form-grid.two-col,
  .admin-card-wide,
  .object-grid,
  .object-browser,
  .two-column-grid,
  .modal-form,
  .company-detail-form,
  .admin-data-grid,
  .admin-summary-grid,
  .run-context-card,
  .run-context-card dl,
  .report-browser-header,
  .responsive-two-column,
  .waterfall-row,
  .period-bar {
    grid-template-columns: 1fr 1fr;
  }

  .movement-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .metric-grid,
  .metric-grid.compact,
  .status-rail,
  .drill-grid,
  .movement-grid,
  .workflow-strip,
  .form-grid.two-col,
  .form-grid.three-col,
  .flow-step,
  .admin-workflow,
  .admin-context,
  .admin-form-grid,
  .admin-form-grid.two-col,
  .admin-card-wide,
  .object-grid,
  .object-browser,
  .two-column-grid,
  .modal-form,
  .company-detail-form,
  .admin-data-grid,
  .admin-summary-grid,
  .run-context-card,
  .run-context-card dl,
  .report-browser-header,
  .responsive-two-column,
  .waterfall-row,
  .period-bar,
  .inline-controls {
    grid-template-columns: 1fr;
  }

  .stage-chip {
    white-space: normal;
  }
}

/* ECL v2 shell adaptation */
.app-shell {
  --sidebar-width: var(--sidebar-default-width);
  display: flex;
  min-height: 100vh;
  max-width: none;
  min-width: 0;
}

.desktop-sidebar-frame {
  position: sticky;
  top: 0;
  z-index: 30;
  width: var(--sidebar-width);
  height: 100vh;
  flex: 0 0 var(--sidebar-width);
}

.workspace-sidebar {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  padding: 24px;
  overflow: hidden;
  color: var(--slate-700);
  background: var(--surface-translucent);
  border-right: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.sidebar-brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.sidebar-logo {
  width: 242px;
  max-width: calc(100% - 48px);
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.sidebar-brand-icon {
  display: none;
}

.login-logo {
  display: block;
  width: 280px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 20px;
}

.sidebar-icon-button {
  display: inline-grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  padding: 0;
  color: var(--slate-600);
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.sidebar-icon-button:hover {
  color: var(--primary-600);
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.sidebar-icon-button span {
  font-size: 24px;
  line-height: 1;
}

.sidebar-module-description {
  margin: 20px 0 18px;
  color: var(--slate-500);
  font-size: 13px;
  line-height: 1.55;
}

.desktop-submenu-nav,
.mobile-submenu-nav {
  display: grid;
  gap: 16px;
}

.desktop-submenu-nav {
  min-height: 0;
  padding: 2px;
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-resize-handle {
  position: absolute;
  inset: 0 -8px 0 auto;
  z-index: 35;
  width: 16px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: col-resize;
}

.sidebar-resize-handle::after {
  content: "";
  position: absolute;
  top: 40px;
  bottom: 40px;
  left: 50%;
  width: 1px;
  background: var(--slate-200);
  transition: background-color 150ms ease, width 150ms ease;
}

.sidebar-resize-handle:hover::after,
.is-resizing-sidebar .sidebar-resize-handle::after {
  width: 2px;
  background: var(--primary-400);
}

.is-resizing-sidebar {
  cursor: col-resize;
  user-select: none;
}

.app-main {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 25;
  background: var(--header-translucent);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.header-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 88px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--slate-200);
}

.header-title-block {
  min-width: 0;
}

.header-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-title-line h1 {
  margin: 0;
  color: var(--slate-900);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

#workspace-subtitle,
#workspace-description {
  margin: 4px 0 0;
  line-height: 1.35;
}

#workspace-subtitle {
  color: var(--slate-500);
  font-size: 14px;
  font-weight: 600;
}

#workspace-description {
  color: var(--slate-400);
  font-size: 13px;
}

.tenant-badge {
  padding: 4px 9px;
  color: var(--primary-600);
  background: var(--primary-50);
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
}

.module-menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--slate-200);
}

.module-menu {
  display: flex;
  flex: 1;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.module-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 16px;
  color: var(--slate-600);
  background: rgba(241, 245, 249, 0.7);
  border: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.module-chip:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.module-chip.active {
  color: #ffffff;
  background: var(--primary-500);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

.module-menu-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 8px;
}

.navigation-action-button,
.navigation-primary-action {
  min-height: 36px;
  padding: 7px 13px;
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.navigation-action-button {
  color: var(--slate-600);
  background: var(--surface);
  border: 1px solid var(--slate-200);
}

.navigation-primary-action {
  color: #ffffff;
  background: var(--primary-500);
  border: 1px solid var(--primary-500);
}

.workspace-content {
  width: 100%;
  min-width: 0;
  padding: 24px;
  overflow-x: hidden;
}

.mobile-submenu-nav {
  display: none;
  margin-bottom: 20px;
}

.submenu-group {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  outline: 1px solid transparent;
}

.submenu-group.active {
  background: rgba(243, 247, 255, 0.6);
  border-color: var(--primary-200);
  outline-color: var(--primary-200);
}

.submenu-group-header {
  display: flex;
  width: 100%;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  color: var(--slate-700);
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
}

.submenu-group-header > span:first-child,
.submenu-item > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.submenu-group-header strong,
.submenu-item strong {
  font-size: 14px;
  font-weight: 600;
}

.submenu-group-header small,
.submenu-item small {
  color: var(--slate-400);
  font-size: 12px;
  line-height: 1.35;
}

.submenu-group.active .submenu-group-header small,
.submenu-item.active small {
  color: var(--primary-500);
}

.submenu-group-count {
  flex: 0 0 auto;
  color: var(--slate-400);
  font-size: 12px;
}

.submenu-group-panel {
  display: none;
  gap: 6px;
  padding: 10px 12px 12px;
  background: rgba(255, 255, 255, 0.8);
  border-top: 1px solid var(--slate-100);
}

.submenu-group-panel.expanded {
  display: grid;
}

.submenu-item-frame {
  display: grid;
  gap: 5px;
}

.submenu-item {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--slate-600);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  text-align: left;
  cursor: pointer;
}

.submenu-item:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.submenu-item.active {
  color: var(--primary-700);
  background: var(--primary-50);
  border-color: var(--primary-200);
  box-shadow: 0 0 0 1px var(--primary-200);
  font-weight: 600;
}

.submenu-item-icon {
  display: grid;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  place-items: center;
}

.submenu-item-icon svg,
.collapsed-submenu-item svg {
  width: 20px;
  height: 20px;
}

.submenu-group.direct {
  padding: 8px;
}

.submenu-group.direct .submenu-item {
  min-height: 64px;
}

.collapsed-submenu-group {
  display: grid;
  justify-content: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-200);
}

.collapsed-submenu-group:last-child {
  border-bottom: 0;
}

.collapsed-submenu-item {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  padding: 0;
  color: var(--slate-500);
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
}

.collapsed-submenu-item.active {
  color: var(--primary-700);
  background: var(--primary-50);
  border-color: var(--primary-200);
  box-shadow: 0 0 0 1px var(--primary-200);
}

[data-sidebar-state="collapsed"] .workspace-sidebar {
  padding: 16px 12px;
}

[data-sidebar-state="collapsed"] .sidebar-brand-row {
  align-items: center;
  flex-direction: column;
}

[data-sidebar-state="collapsed"] .sidebar-logo {
  display: none;
}

[data-sidebar-state="collapsed"] .sidebar-brand-icon {
  display: block;
  width: 40px;
  height: 40px;
  max-width: 40px;
  object-fit: contain;
}

[data-sidebar-state="collapsed"] .sidebar-module-description {
  display: none;
}

[data-sidebar-state="collapsed"] .desktop-submenu-nav {
  margin-top: 24px;
}

[data-sidebar-state="collapsed"] .sidebar-resize-handle {
  pointer-events: none;
}

.navigation-reorder-entry {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: var(--radius-pill);
}

.submenu-group > .navigation-move-controls {
  margin: 0 12px 8px;
}

.navigation-move-controls {
  display: inline-flex;
  gap: 3px;
}

.navigation-move-controls button {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  padding: 0;
  color: var(--slate-600);
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  cursor: pointer;
}

.navigation-move-controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

[data-reorder-kind] {
  cursor: grab;
}

[data-reorder-kind].dragging {
  opacity: 0.45;
}

[data-reorder-kind].drop-target {
  box-shadow: 0 0 0 2px var(--primary-200);
}

.module-destination-panel {
  display: none;
}

.module-destination-panel.active {
  display: block;
}

.auth-card,
.panel,
.admin-card,
.admin-data-card,
.object-panel,
.mini-panel,
.flow-card {
  background: var(--surface);
  border-color: var(--slate-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.panel {
  padding: 20px;
}

.primary-button {
  color: #ffffff;
  background: var(--primary-500);
  border-color: var(--primary-500);
  border-radius: var(--radius-lg);
}

.primary-button:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

.secondary-button {
  color: var(--slate-600);
  background: var(--surface);
  border-color: var(--slate-200);
  border-radius: var(--radius-lg);
}

.secondary-button:hover {
  color: var(--primary-600);
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.tab {
  color: var(--slate-600);
  background: var(--slate-50);
  border-color: var(--slate-200);
  border-radius: var(--radius-pill);
}

.tab.active {
  color: var(--primary-600);
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.stage-chip {
  color: var(--primary-700);
  background: var(--primary-50);
  border-color: var(--primary-100);
  border-radius: var(--radius-pill);
}

input,
select,
textarea {
  color: var(--app-text);
  background: var(--surface);
  border-color: var(--slate-200);
  border-radius: 8px;
}

.summary-table th,
.key-value-table th {
  background: var(--slate-50);
}

.summary-table th,
.summary-table td,
.key-value-table th,
.key-value-table td {
  border-color: var(--slate-200);
}

a,
.detail-link {
  color: var(--primary-600);
}

.eyebrow,
.section-title {
  color: var(--primary-600);
}

.notice {
  background: var(--surface);
  border-left-color: var(--primary-500);
}

.account-button {
  min-height: 44px;
  padding: 4px 10px 4px 5px;
  color: var(--slate-700);
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-pill);
}

.account-button:hover,
.account-button[aria-expanded="true"] {
  color: var(--primary-600);
  background: var(--primary-50);
  border-color: var(--primary-200);
}

.account-avatar {
  width: 36px;
  height: 36px;
  color: #ffffff;
  background: var(--primary-500);
  border-radius: 50%;
}

.account-popover {
  top: calc(100% + 8px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  min-width: 250px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
}

.account-utility-link {
  display: block;
  margin: 8px 0;
  padding: 9px 10px;
  color: var(--primary-600);
  background: var(--primary-50);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.admin-workflow,
.admin-workflow.single-admin-tab {
  display: block;
}

.admin-main {
  min-width: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary-400);
  outline-offset: 2px;
}

body.is-locked {
  display: grid;
  min-height: 100vh;
  padding: 24px;
  place-items: center;
}

body.is-locked .app-shell {
  display: block;
  width: min(460px, 100%);
  min-height: auto;
}

body.is-locked .desktop-sidebar-frame,
body.is-locked .module-menu-row,
body.is-locked .mobile-submenu-nav,
body.is-locked #workspace-heading,
body.is-locked .workspace-content,
body.is-locked .account-menu {
  display: none !important;
}

body.is-locked .app-header {
  position: static;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body.is-locked .header-primary-row {
  min-height: auto;
  padding: 0;
  border: 0;
}

body.is-locked .auth-card {
  width: 100%;
  min-width: 0;
  padding: 24px;
  box-shadow: var(--shadow-popover);
}

@media (max-width: 1023px) {
  .desktop-sidebar-frame {
    display: none;
  }

  .header-primary-row {
    flex-wrap: wrap;
  }

  .workspace-content {
    padding: 20px;
  }

  .mobile-submenu-nav {
    display: grid;
  }

  .mobile-submenu-nav .submenu-group-panel {
    padding: 8px;
  }
}

@media (max-width: 639px) {
  .header-primary-row {
    align-items: flex-start;
    padding: 14px 16px;
  }

  .header-title-block {
    flex: 1 0 100%;
  }

  #workspace-description {
    display: none;
  }

  .module-menu-row {
    align-items: flex-start;
    flex-direction: column;
    padding: 8px 16px;
  }

  .module-menu {
    width: 100%;
  }

  .module-chip {
    min-height: 44px;
    padding: 8px 14px;
  }

  .module-menu-actions {
    width: 100%;
  }

  .workspace-content {
    padding: 16px;
  }

  .submenu-group-header,
  .submenu-item,
  .navigation-action-button,
  .navigation-primary-action {
    min-height: 44px;
  }

  #account-summary {
    max-width: 120px;
  }
}

.password-field {
  position: relative;
  display: block;
  min-width: 0;
  width: 100%;
}

.password-field input {
  box-sizing: border-box;
  width: 100%;
  padding-right: 48px;
}

.password-visibility-toggle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #315178;
  cursor: pointer;
}

.password-visibility-toggle:hover {
  background: #edf2ff;
}

.password-visibility-toggle:focus-visible {
  outline: 2px solid #2457ff;
  outline-offset: -2px;
}

/* Approved business typography across workspace surfaces. */
body { font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: var(--font-ui); font-size: 14px; }
h1, h2, h3, h4 { font-family: var(--font-ui); letter-spacing: -0.02em; }
.summary-table th, .section-title, .minor-title, label, .movement-cell span {
  text-transform: none; letter-spacing: normal; font-size: 13px; font-weight: 600;
}
.summary-table td { font-size: 14px; line-height: 1.5; }
.summary-table th { background: #f8fafc; color: #52647d; }
.key-value-table th, .key-value-table td { padding: 16px 18px; }
.key-value-table th { width: 38%; font-size: 14px; }
.key-value-table td { color: #172b4d; font-weight: 400; }
.modal h3 { font-size: 22px; line-height: 1.35; }
.mono { font-variant-numeric: tabular-nums; }
pre, code, .json-preview { font-family: Consolas, "Courier New", monospace; }
.detail-status { display: inline-flex; align-items: center; gap: 7px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.detail-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.detail-status.is-active { background: #eaf7ef; color: #247448; border: 1px solid #d4eddd; }
.detail-status.is-inactive { background: #f1f5f9; color: #52647d; border: 1px solid #dce3ec; }
@media (max-width: 600px) {
  .key-value-table th, .key-value-table td { padding: 12px; }
}

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