:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #64748b;
  --line: #dbe3ef;
  --brand: #174ea6;
  --brand-2: #0b2f68;
  --accent: #f97316;
  --good: #0f9f6e;
  --warn: #b7791f;
  --danger: #c2410c;
  --soft-blue: #eef5ff;
  --soft-orange: #fff5ed;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.locked .app-shell {
  display: none;
}

.auth-screen {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 28px;
  align-items: center;
  padding: clamp(22px, 5vw, 72px);
  background:
    radial-gradient(circle at 16% 20%, rgba(249, 115, 22, 0.22), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(96, 165, 250, 0.26), transparent 28%),
    linear-gradient(135deg, #07111f 0%, #0b2f68 52%, #10213d 100%);
}

.auth-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
}

.auth-screen > * {
  position: relative;
  z-index: 1;
}

body:not(.locked) .auth-screen {
  display: none;
}

.session-switch-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(7, 17, 31, 0.72);
  backdrop-filter: blur(12px);
}

body.switching-session .session-switch-overlay {
  display: grid;
}

.session-switch-overlay[hidden] {
  display: none !important;
}

.session-switch-overlay > div {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(420px, 100%);
  border: 1px solid rgba(226, 232, 240, 0.2);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  padding: 28px;
  text-align: center;
}

.session-switch-overlay strong {
  color: var(--brand-2);
  font-size: 20px;
}

.session-switch-overlay small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.status-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid #dbeafe;
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.auth-copy {
  max-width: 720px;
  color: #fff;
}

.auth-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

.auth-copy p {
  max-width: 680px;
  margin: 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 650;
}

.auth-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.auth-proof span {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 9px 12px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.auth-explore-panel {
  display: grid;
  width: min(760px, 100%);
  margin-top: 14px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.auth-explore-panel summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  cursor: pointer;
  color: #fff;
  font-weight: 900;
}

.auth-explore-panel summary span {
  color: #dbeafe;
  font-size: 13px;
  font-weight: 650;
}

.auth-explore-panel .buyer-proof-grid {
  margin-top: 0;
  padding: 0 14px 14px;
}

.buyer-proof-grid {
  display: grid;
  width: min(760px, 100%);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.buyer-commercial-grid {
  margin-top: 10px;
}

.buyer-proof-grid div {
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.28);
  padding: 14px;
}

.proof-run-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
  margin: 18px 0;
}

.proof-card,
.proof-status-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.proof-card h2,
.proof-status-card h2 {
  margin: 4px 0;
  color: var(--brand-2);
  font-size: 26px;
}

.proof-card p {
  color: var(--muted);
  line-height: 1.6;
}

.proof-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proof-status-list {
  display: grid;
  gap: 8px;
}

.proof-status-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
}

.proof-status-list strong {
  color: var(--brand-2);
}

.proof-status-list span {
  color: var(--muted);
  text-align: right;
}


.buyer-proof-grid strong {
  display: block;
  color: #fff;
  font-size: 14px;
}

.buyer-proof-grid span {
  display: block;
  margin-top: 5px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;
}

.auth-suite-links,
.suite-links {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  padding: 10px;
}

.auth-suite-links {
  width: min(520px, 100%);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.auth-suite-links a,
.suite-links a {
  border-radius: 8px;
  color: #e5eefb;
  padding: 10px;
  text-align: center;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
}

.auth-suite-links a:hover,
.auth-suite-links a:focus-visible,
.suite-links a:hover,
.suite-links a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
}

.auth-card {
  display: grid;
  gap: 14px;
  max-height: min(920px, calc(100vh - 44px));
  overflow: auto;
  border: 1px solid rgba(226, 232, 240, 0.7);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
  padding: 24px;
}

.auth-brand {
  color: var(--brand-2);
  margin-bottom: 4px;
}

.auth-card input,
.auth-card select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  font-weight: 750;
}

.auth-card label,
.form-grid label {
  display: grid;
  gap: 8px;
}

.form-error {
  margin: 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.form-error[hidden] {
  display: none;
}

.auth-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  font-weight: 700;
}

.auth-note code {
  color: var(--brand);
  font-weight: 900;
}

.demo-login-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f8fbff;
  padding: 12px;
}

.demo-login-head {
  display: grid;
  gap: 4px;
}

.demo-login-head strong {
  color: var(--ink);
  font-size: 14px;
}

.demo-login-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.demo-picker-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.demo-picker-row label {
  margin: 0;
}

.demo-login-status {
  color: var(--brand-2);
  display: block;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.45;
}

.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-role-card {
  display: grid;
  gap: 5px;
  min-height: 88px;
  border: 1px solid #d7e3f2;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.demo-role-card:hover,
.demo-role-card:focus-visible,
.demo-role-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 107, 21, 0.16);
}

.demo-role-card:disabled {
  cursor: progress;
  opacity: 0.65;
}

.demo-role-card strong {
  font-size: 13px;
}

.demo-role-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.35;
}

.demo-role-card small {
  color: var(--brand-2);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.demo-subrole-panel {
  border-top: 1px solid #dbe7f5;
  padding-top: 10px;
}

.demo-subrole-panel summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.demo-subrole-panel[open] summary {
  margin-bottom: 8px;
}

.demo-advanced-panel p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.45;
  margin: 0 0 8px;
}

.demo-card-group-title {
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  margin: 10px 0 6px;
  text-transform: uppercase;
}

.demo-role-grid.compact .demo-role-card {
  min-height: 82px;
}

.auth-client-signin {
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.auth-client-signin summary {
  display: grid;
  gap: 3px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  list-style-position: inside;
}

.auth-client-signin summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
}

.auth-client-signin[open] {
  display: grid;
  gap: 12px;
}

.auth-client-signin[open] summary {
  margin-bottom: 2px;
}

.uat-signoff-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.uat-signoff-form textarea {
  min-height: 82px;
}

.uat-signoff-form .proof-actions {
  align-items: center;
}

.uat-checkpoint-register {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.uat-checkpoint-register table {
  min-width: 900px;
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(23, 78, 166, 0.22);
  outline-offset: 2px;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px;
  background: #0d1b2f;
  color: #e5eefb;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #ffb37b);
  color: #111827;
  font-weight: 950;
}

.eyelogs-mark {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.22);
  background:
    linear-gradient(135deg, rgba(249, 115, 22, 0.16), transparent 42%),
    linear-gradient(135deg, #07111f, #10213d);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 10px 24px rgba(15, 23, 42, 0.18);
}

.eyelogs-mark::before {
  content: "E";
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  width: 50%;
  align-items: center;
  justify-content: flex-end;
  padding-right: 3px;
  color: #f8fafc;
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.eyelogs-mark::after {
  content: "L";
  position: absolute;
  inset: 8px 0 8px auto;
  display: flex;
  width: 50%;
  align-items: center;
  justify-content: flex-start;
  border-left: 1px solid rgba(249, 115, 22, 0.72);
  padding-left: 5px;
  color: #f8fafc;
  font-size: 23px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
}

.eye-ring {
  display: none;
}

.data-pupil {
  display: none;
}

.brand strong {
  display: block;
  font-size: 18px;
  font-weight: 950;
}

.brand small,
.sidebar-footer small {
  color: #9fb0c7;
}

.sidebar-footer {
  border: 1px solid rgba(226, 232, 240, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.sidebar-footer span {
  display: block;
  color: #93c5fd;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.sidebar-footer small {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #c7d6ea;
  text-align: left;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
}

.nav-item:hover,
.nav-item.active {
  background: #17355f;
  color: #fff;
}

.workspace {
  min-width: 0;
  padding: 22px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: -22px -22px 22px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.9);
  backdrop-filter: blur(16px);
}

.workspace-context-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -8px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(23, 78, 166, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(23, 78, 166, 0.08), rgba(249, 115, 22, 0.08));
  color: var(--ink);
}

.workspace-context-banner.is-error {
  border-color: rgba(185, 28, 28, 0.34);
  background: #fff7f7;
}

.workspace-context-banner div {
  display: grid;
  gap: 3px;
}

.workspace-context-banner strong {
  color: var(--brand-2);
  font-size: 14px;
  font-weight: 950;
}

.workspace-context-banner.is-error strong {
  color: #991b1b;
}

.workspace-context-banner span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.menu-button {
  display: none;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--brand-2);
  font-weight: 900;
  padding: 0 12px;
}

.workflow-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.workflow-nav-button {
  width: 138px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 950;
  padding: 0 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-back::before,
.workflow-forward::after {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: rgba(23, 78, 166, 0.1);
  color: var(--brand);
  flex: 0 0 auto;
}

.workflow-back::before {
  content: "<";
}

.workflow-forward::after {
  content: ">";
}

.workflow-nav-button:not(:disabled):hover {
  border-color: rgba(23, 78, 166, 0.32);
  background: #eef4ff;
}

.workflow-nav-button:disabled {
  opacity: 0.46;
  cursor: not-allowed;
}

.workflow-nav-label {
  min-width: 132px;
  max-width: 180px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(23, 78, 166, 0.14);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.module-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(23, 78, 166, 0.14);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  padding: 12px 14px;
  margin: 12px 0;
}

.module-status-strip div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.module-status-strip strong {
  font-size: 13px;
}

.module-status-strip span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.module-status-strip .btn {
  flex: 0 0 auto;
}

.workflow-pilot {
  position: relative;
  display: grid;
  grid-template-columns: minmax(190px, 0.7fr) minmax(360px, 1.4fr) minmax(240px, 0.85fr);
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
  margin: -4px 0 18px;
  border: 1px solid rgba(23, 78, 166, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 0%, rgba(96, 165, 250, 0.22), transparent 28%),
    linear-gradient(135deg, #ffffff, #f8fbff 55%, #eff6ff);
  box-shadow: 0 18px 48px rgba(15, 47, 104, 0.08);
  padding: 12px;
  perspective: 1100px;
}

.workflow-pilot::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    linear-gradient(rgba(23, 78, 166, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 78, 166, 0.12) 1px, transparent 1px);
  background-size: 34px 34px;
  transform: perspective(800px) rotateX(66deg) translateY(-42%);
  transform-origin: top;
  pointer-events: none;
}

.workflow-pilot > * {
  position: relative;
  z-index: 1;
}

.workflow-pilot-summary,
.workflow-pilot-action {
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(23, 78, 166, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px;
}

.workflow-pilot-summary strong {
  color: var(--brand-2);
  font-size: 18px;
  font-weight: 950;
}

.workflow-pilot-summary small,
.workflow-pilot-action small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.workflow-pilot-orbit {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(104px, 1fr);
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 7px 8px;
  border: 1px solid rgba(23, 78, 166, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(23, 78, 166, 0.06), transparent 18%, transparent 82%, rgba(249, 115, 22, 0.08)),
    rgba(255, 255, 255, 0.72);
  transform: rotateX(7deg);
  transform-style: preserve-3d;
}

.workflow-pilot-orbit::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, rgba(23, 78, 166, 0.14), rgba(249, 115, 22, 0.44), rgba(16, 185, 129, 0.36));
  transform: translateY(-50%) translateZ(-18px);
  pointer-events: none;
}

.workflow-pilot-node {
  position: relative;
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 72px;
  border: 1px solid var(--pilot-border, rgba(203, 213, 225, 0.9));
  border-radius: 8px;
  background: #ffffff;
  color: var(--brand-2);
  padding: 10px;
  text-align: left;
  box-shadow: 0 12px 26px rgba(15, 47, 104, 0.08);
  transform: translateZ(calc(var(--pilot-index, 0) * 2px));
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  cursor: pointer;
}

.workflow-pilot-node::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: var(--pilot-strip, #60a5fa);
}

.workflow-pilot-node span {
  color: #475569;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.workflow-pilot-node strong {
  color: var(--brand-2);
  font-size: 22px;
  line-height: 1;
}

.workflow-pilot-node.ready {
  --pilot-border: rgba(16, 185, 129, 0.46);
  --pilot-strip: #10b981;
}

.workflow-pilot-node.warning {
  --pilot-border: rgba(245, 158, 11, 0.54);
  --pilot-strip: #f59e0b;
}

.workflow-pilot-node.needs-work {
  --pilot-border: rgba(249, 115, 22, 0.54);
  --pilot-strip: #f97316;
}

.workflow-pilot-node.active {
  border-color: rgba(23, 78, 166, 0.42);
  box-shadow: 0 16px 34px rgba(23, 78, 166, 0.18), 0 0 0 2px rgba(23, 78, 166, 0.14);
}

.workflow-pilot-node:hover,
.workflow-pilot-node:focus-visible {
  transform: translateY(-4px) translateZ(32px);
  box-shadow: 0 20px 42px rgba(15, 47, 104, 0.16);
  outline: none;
}

.workflow-pilot-action {
  width: 100%;
  min-height: 0;
  color: var(--brand-2);
  text-align: left;
  cursor: pointer;
}

.workflow-pilot-action span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.workflow-pilot-action strong {
  color: var(--brand-2);
  font-size: 15px;
  font-weight: 950;
}

.workflow-pilot-action.ready {
  border-color: rgba(16, 185, 129, 0.34);
}

.workflow-pilot-action.warning {
  border-color: rgba(245, 158, 11, 0.4);
  background: #fffbeb;
}

.workflow-pilot-action.needs-work {
  border-color: rgba(249, 115, 22, 0.42);
  background: #fff7ed;
}

.global-search {
  position: relative;
}

.global-search label {
  position: absolute;
  left: 14px;
  top: 8px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-search input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 22px 14px 7px;
  font-weight: 700;
}

.topbar-actions,
.head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.sync-status {
  display: grid;
  gap: 3px;
  min-width: 210px;
  justify-items: end;
}

.sync-status small {
  max-width: 260px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
  text-align: right;
}

.topbar-actions select,
.filter-row select,
.filter-row input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 800;
  padding: 0 12px;
}

body.app-focus-mode .proof-accordion,
body.app-focus-mode .dashboard-secondary-actions,
body.app-focus-mode .page-head p,
body.app-focus-mode .launchpad-head p,
body.app-focus-mode .panel > p:not(.form-error) {
  display: none;
}

body.app-focus-mode .page-head {
  margin-bottom: 12px;
}

.role-preview-switch[hidden] {
  display: none;
}

.profile-menu {
  position: relative;
}

.profile-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--brand-2);
  padding: 0 14px 0 8px;
  font-weight: 950;
}

.profile-button span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.profile-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 25;
  display: grid;
  width: min(280px, calc(100vw - 36px));
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow);
}

.profile-panel[hidden] {
  display: none;
}

.profile-panel strong,
.profile-panel small {
  overflow-wrap: anywhere;
}

.demo-role-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.demo-role-switcher span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.demo-role-switcher button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-2);
  font-weight: 900;
  cursor: pointer;
}

.demo-role-switcher button:hover,
.demo-role-switcher button:focus-visible,
.demo-role-switcher button.active {
  border-color: var(--accent);
  color: var(--accent);
}

.demo-role-switcher button.active {
  background: #fff7ed;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 21, 0.18);
}

.demo-context-switcher {
  display: grid;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.demo-context-switcher label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
}

.demo-context-switcher select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-2);
  padding: 0 10px;
  font-weight: 850;
}

.demo-context-switcher small {
  color: var(--muted);
  line-height: 1.35;
}

.btn {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-dark {
  background: var(--brand-2);
  color: #fff;
}

.btn-light {
  background: var(--panel);
  border-color: var(--line);
  color: var(--brand-2);
}

.wide {
  width: 100%;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.page-head h1 {
  max-width: 820px;
  margin: 0 0 10px;
  color: var(--brand-2);
  font-size: clamp(32px, 4.8vw, 58px);
  line-height: 0.98;
  letter-spacing: 0;
}

.page-head p,
.panel p,
.upload-panel p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
  font-weight: 650;
}

.eyebrow {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel,
.table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 16px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric-card strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--brand-2);
  font-size: 28px;
  font-weight: 950;
}

.ai-floating-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 58;
  width: 50px;
  min-width: 50px;
  height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 38%),
    linear-gradient(135deg, #07111f 0%, #174ea6 62%, #f97316 100%);
  color: #fff;
  box-shadow: 0 16px 36px rgba(23, 78, 166, 0.28), 0 8px 18px rgba(15, 23, 42, 0.16);
  font-weight: 950;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.ai-floating-button::after,
.ai-mini-dock::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
}

.ai-floating-button strong,
.ai-floating-button small {
  display: block;
  text-align: left;
  line-height: 1.05;
}

.ai-floating-button > span:last-child {
  position: absolute;
  right: 58px;
  bottom: 4px;
  min-width: 88px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
  color: var(--ink);
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  transform: translateX(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ai-floating-button:hover > span:last-child,
.ai-floating-button:focus-visible > span:last-child {
  opacity: 1;
  transform: translateX(0);
}

.ai-floating-button small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.ai-floating-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 56px rgba(23, 78, 166, 0.34), 0 10px 22px rgba(15, 23, 42, 0.2);
}

.ai-open .ai-floating-button,
.ai-minimized .ai-floating-button {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

.ai-orb {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #fff;
  font-size: 14px;
  font-weight: 950;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.14);
}

.ai-orb.large {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent),
    linear-gradient(135deg, #174ea6, #0f172a);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

.ai-orb.large::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.14);
  transform: translate(16px, -16px);
}

.ai-drawer {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: transparent;
}

.ai-drawer[hidden] {
  display: none;
}

.ai-drawer-panel {
  position: absolute;
  right: 18px;
  bottom: 70px;
  width: min(318px, calc(100vw - 28px));
  max-height: min(470px, calc(100vh - 88px));
  display: flex;
  flex-direction: column;
  gap: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(248, 250, 252, 0.98)),
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), transparent 34%);
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  backdrop-filter: blur(14px);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.22);
  padding: 7px;
  pointer-events: auto;
  overflow: hidden;
  animation: ai-pop 0.16s ease-out;
}

.ai-drawer.is-expanded .ai-drawer-panel {
  right: 18px;
  bottom: 18px;
  width: min(500px, calc(100vw - 36px));
  max-height: min(660px, calc(100vh - 36px));
}

.ai-drawer.is-minimized .ai-drawer-panel {
  display: none;
}

.ai-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%),
    linear-gradient(135deg, #07111f, #174ea6 72%, #f97316);
  color: #ffffff;
  padding: 8px;
}

.ai-brand-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-drawer-head h2 {
  margin: 1px 0 2px;
  color: #ffffff;
  font-size: 15px;
}

.ai-drawer-head p,
.ai-disclaimer {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ai-drawer-head p {
  display: block;
  color: rgba(255, 255, 255, 0.74);
  margin: 0;
  max-width: 200px;
}

.ai-brand-row .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.ai-window-actions {
  display: inline-flex;
  gap: 5px;
  flex: 0 0 auto;
}

.ai-icon-btn {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.ai-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
}

.ai-icon-expand {
  border: 2px solid currentColor;
  border-radius: 3px;
}

.ai-icon-minimize::before,
.ai-icon-close::before,
.ai-icon-close::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  top: 6px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.ai-icon-close::before {
  transform: rotate(45deg);
}

.ai-icon-close::after {
  transform: rotate(-45deg);
}

.ai-icon-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.36);
  color: #ffffff;
  transform: translateY(-1px);
}

.ai-icon-btn.danger:hover {
  background: #fff7ed;
  border-color: rgba(249, 115, 22, 0.38);
  color: #c2410c;
}

.ai-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 5px;
}

.ai-tools .btn {
  padding: 6px 8px;
  font-size: 12px;
}

.ai-tools .status-pill {
  margin-right: auto;
}

.status-pill.offline {
  background: #fef3c7;
  color: #92400e;
}

.ai-context {
  border: 1px solid rgba(37, 99, 235, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  overflow: hidden;
}

.ai-context summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  color: #174ea6;
  cursor: pointer;
  font-size: 12px;
  font-weight: 950;
  list-style: none;
}

.ai-context summary::-webkit-details-marker {
  display: none;
}

.ai-context summary::after {
  content: "+";
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #174ea6;
  font-size: 14px;
  line-height: 1;
}

.ai-context[open] summary::after {
  content: "-";
}

.ai-context small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-snapshot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0 8px 8px;
}

.ai-snapshot div {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
}

.ai-snapshot strong {
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.ai-snapshot span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.ai-capability-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 8px 8px;
}

.ai-capability-strip span {
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 850;
}

.ai-thread {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 100px;
  max-height: 176px;
  flex: 1;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(239, 246, 255, 0.82)),
    linear-gradient(90deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(37, 99, 235, 0.04) 1px, transparent 1px),
    #f8fafc;
  background-size: auto, 28px 28px, 28px 28px;
  padding: 8px;
  overscroll-behavior: contain;
}

.ai-drawer.is-expanded .ai-thread {
  min-height: 240px;
  max-height: 360px;
}

.ai-message {
  max-width: min(94%, 300px);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.ai-message.assistant {
  border-left: 3px solid #174ea6;
}

.ai-message.user {
  justify-self: end;
  border-color: rgba(15, 23, 42, 0.16);
  background: #0f172a;
  color: #ffffff;
}

.ai-message.user strong,
.ai-message.user p {
  color: #ffffff;
}

.ai-message.instant {
  border-color: rgba(249, 115, 22, 0.24);
  background: #fffaf5;
}

.ai-message strong {
  display: block;
  margin-bottom: 4px;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 950;
}

.ai-message p {
  white-space: pre-wrap;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
}

.ai-message.thinking p {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 5px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse-dot 1s infinite ease-in-out;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes pulse-dot {
  0%, 80%, 100% {
    opacity: 0.28;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.ai-compose {
  display: grid;
  gap: 6px;
  margin-top: 0;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 8px;
  background: #ffffff;
  padding: 7px;
}

.ai-compose label {
  display: none;
}

.ai-compose textarea {
  width: 100%;
  min-height: 42px;
  max-height: 84px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  padding: 9px;
  resize: vertical;
  background: #f8fafc;
}

.ai-compose-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-compose textarea:focus {
  outline: 3px solid rgba(37, 99, 235, 0.14);
  border-color: rgba(37, 99, 235, 0.48);
}

.ai-quick-panel {
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  overflow: hidden;
}

.ai-quick-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  cursor: pointer;
  list-style: none;
}

.ai-quick-panel summary::-webkit-details-marker {
  display: none;
}

.ai-quick-panel summary::after {
  content: "+";
  display: grid;
  width: 20px;
  height: 20px;
  margin-left: auto;
  place-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #174ea6;
  font-size: 14px;
  font-weight: 950;
}

.ai-quick-panel[open] summary::after {
  content: "-";
}

.ai-quick-panel summary strong {
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 950;
}

.ai-quick-panel summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-quick-actions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 8px 8px;
  scrollbar-width: thin;
}

.ai-quick-actions .queue-item {
  min-width: auto;
  flex: 0 0 auto;
  display: block;
  min-height: 34px;
  padding: 7px 11px;
  border-color: rgba(148, 163, 184, 0.34);
  background: #fff;
  white-space: nowrap;
  border-radius: 8px;
}

.ai-quick-actions .queue-item strong,
.ai-quick-actions .queue-item span {
  display: block;
}

.ai-quick-actions .queue-item span {
  display: none;
}

.ai-quick-actions .queue-item:hover {
  border-color: rgba(37, 99, 235, 0.34);
  background: #eff6ff;
}

.ai-disclaimer {
  margin: 0;
  font-size: 11px;
}

.ai-mini-dock {
  position: absolute;
  right: 18px;
  bottom: 18px;
  width: min(148px, calc(100vw - 28px));
  min-height: 44px;
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(23, 78, 166, 0.96)),
    #0f172a;
  color: #ffffff;
  box-shadow: 0 20px 58px rgba(15, 23, 42, 0.3);
  cursor: pointer;
  padding: 7px 10px;
  pointer-events: auto;
  text-align: left;
}

.ai-drawer.is-minimized .ai-mini-dock {
  display: inline-flex;
}

.ai-mini-dock strong,
.ai-mini-dock small {
  display: block;
}

.ai-mini-dock small {
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
}

@keyframes ai-pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.operator-launchpad {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  border-color: rgba(37, 99, 235, 0.24);
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.94), rgba(255, 255, 255, 0.98)),
    var(--panel);
}

.launchpad-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.launchpad-head h2 {
  margin: 4px 0 6px;
  color: var(--brand-2);
  font-size: 26px;
}

.launchpad-head p {
  max-width: 800px;
}

.live-action-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.live-action-grid.compact-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.live-action-card {
  display: grid;
  align-content: start;
  min-height: 116px;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.live-action-card.primary {
  border-color: rgba(249, 115, 22, 0.42);
  background: #fff7ed;
}

.live-action-card strong {
  color: var(--brand-2);
  font-size: 17px;
}

.live-action-card span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.compact-actions .live-action-card {
  min-height: 96px;
}

.live-action-card:hover,
.live-action-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.operations-map-3d {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border-color: rgba(15, 47, 104, 0.18);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(11, 47, 104, 0.96) 46%, rgba(20, 83, 45, 0.88)),
    #0f172a;
  color: #ffffff;
}

.operations-map-3d::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 1px, transparent 1px);
  background-size: 44px 44px;
  transform: perspective(900px) rotateX(62deg) translateY(-18%);
  transform-origin: top;
  pointer-events: none;
}

.operations-map-3d > * {
  position: relative;
  z-index: 1;
}

.operations-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.operations-map-head h2 {
  margin: 2px 0 0;
  color: #ffffff;
  font-size: 26px;
}

.operations-map-status {
  display: grid;
  min-width: 190px;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
  text-align: right;
}

.operations-map-status strong,
.operations-map-status span {
  display: block;
}

.operations-map-status strong {
  font-size: 14px;
}

.operations-map-status span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 850;
}

.operations-map-status.ready {
  border-color: rgba(34, 197, 94, 0.52);
  background: rgba(20, 83, 45, 0.44);
}

.operations-map-status.warning {
  border-color: rgba(251, 191, 36, 0.52);
  background: rgba(120, 53, 15, 0.42);
}

.operations-map-status.needs-work {
  border-color: rgba(249, 115, 22, 0.52);
  background: rgba(124, 45, 18, 0.44);
}

.operations-map-shell {
  min-height: 224px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.1)),
    rgba(15, 23, 42, 0.36);
  padding: 18px;
  perspective: 1180px;
}

.operations-map-stage {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-height: 180px;
  transform: rotateX(9deg) rotateY(-4deg);
  transform-style: preserve-3d;
}

.operations-map-stage::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.64), rgba(249, 115, 22, 0.72), rgba(16, 185, 129, 0.58), transparent);
  transform: translateY(-50%) translateZ(-14px);
}

.operations-map-node {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 130px;
  border: 1px solid var(--node-border, rgba(226, 232, 240, 0.42));
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.92)),
    #ffffff;
  color: var(--brand-2);
  padding: 14px;
  text-align: left;
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.18);
  transform: translateZ(calc(var(--node-index, 0) * 3px));
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  cursor: pointer;
}

.operations-map-node::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 4px;
  border-radius: 8px 8px 0 0;
  background: var(--node-strip, #60a5fa);
}

.operations-map-node span,
.operations-map-node strong,
.operations-map-node small {
  display: block;
}

.operations-map-node span {
  color: #475569;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.operations-map-node strong {
  margin-top: 8px;
  color: var(--brand-2);
  font-size: 32px;
  line-height: 1;
}

.operations-map-node small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.operations-map-node.ready {
  --node-border: rgba(16, 185, 129, 0.54);
  --node-strip: #10b981;
}

.operations-map-node.warning {
  --node-border: rgba(245, 158, 11, 0.62);
  --node-strip: #f59e0b;
}

.operations-map-node.needs-work {
  --node-border: rgba(249, 115, 22, 0.62);
  --node-strip: #f97316;
}

.operations-map-node.active {
  box-shadow: 0 24px 56px rgba(96, 165, 250, 0.24), 0 0 0 2px rgba(96, 165, 250, 0.36);
}

.operations-map-node:hover,
.operations-map-node:focus-visible {
  border-color: #ffffff;
  transform: translateY(-5px) translateZ(46px);
  box-shadow: 0 30px 68px rgba(0, 0, 0, 0.28);
}

@media (prefers-reduced-motion: no-preference) {
  .operations-map-stage {
    animation: operations-map-drift 9s ease-in-out infinite;
  }
}

@keyframes operations-map-drift {
  0%,
  100% {
    transform: rotateX(9deg) rotateY(-4deg) translateY(0);
  }
  50% {
    transform: rotateX(7deg) rotateY(-2deg) translateY(-4px);
  }
}

.dashboard-secondary-actions {
  border: 1px solid #dbe7f5;
  border-radius: 14px;
  background: #f8fbff;
  padding: 12px 14px;
}

.dashboard-secondary-actions summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.dashboard-secondary-actions summary strong {
  color: var(--brand-2);
}

.dashboard-secondary-actions summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.dashboard-secondary-actions .inline-actions {
  margin-top: 12px;
}

.dashboard-insights .dashboard-grid {
  margin-top: 14px;
}

.workflow-drawer {
  margin: 14px 0;
}

.workflow-drawer summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #dbe7f5;
  border-radius: 8px;
  background: #f8fbff;
  padding: 14px 16px;
  cursor: pointer;
}

.workflow-drawer summary strong {
  color: var(--brand-2);
}

.workflow-drawer summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workflow-drawer[open] summary {
  margin-bottom: 12px;
}

.proof-accordion {
  margin: 16px 0;
}

.proof-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.proof-accordion summary strong {
  color: var(--brand-2);
}

.proof-accordion summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.proof-accordion[open] summary {
  margin-bottom: 12px;
}

.focus-pulse {
  outline: 3px solid rgba(249, 115, 22, 0.34);
  outline-offset: 6px;
  border-radius: 8px;
  transition: outline-color 0.2s ease;
}

.module-toolbar,
.action-form-panel {
  margin-bottom: 16px;
}

.form-advanced {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.form-advanced summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--brand-2);
}

.form-advanced .compact-form {
  margin-top: 10px;
}

.toolbar-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(2, minmax(160px, 0.8fr)) auto;
  gap: 12px;
  align-items: end;
}

.toolbar-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.inline-check {
  display: inline-flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px !important;
  min-height: 44px;
  color: var(--brand-2) !important;
}

.inline-check input {
  width: auto;
}

.module-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.module-kpis span {
  display: grid;
  gap: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.module-kpis strong {
  color: var(--brand-2);
  font-size: 20px;
}

.employee-command-center,
.attendance-command-center,
.leave-command-center,
.payroll-command-center {
  display: grid;
  gap: 14px;
  margin: 14px 0;
  border-color: rgba(23, 78, 166, 0.22);
  background:
    linear-gradient(135deg, #ffffff, #f8fbff),
    var(--panel);
}

.employee-command-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.employee-command-main h2 {
  margin: 2px 0 6px;
  color: var(--brand-2);
  font-size: 24px;
}

.employee-command-main h2 small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.employee-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.employee-snapshot-grid div,
.employee-next-action {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.employee-snapshot-grid strong,
.employee-snapshot-grid span {
  display: block;
}

.employee-snapshot-grid strong {
  color: var(--brand-2);
  font-size: 19px;
}

.employee-snapshot-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.employee-next-action {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-color: rgba(249, 115, 22, 0.28);
  background: #fff7ed;
}

.employee-next-action strong {
  color: var(--brand-2);
}

.employee-next-action span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.employee-action-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.module-table td:last-child {
  min-width: 250px;
}

.action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
  margin-bottom: 14px;
}

.action-card.priority {
  border-color: rgba(249, 115, 22, 0.32);
  background: linear-gradient(180deg, #fff, #fff7ed);
}

.exception-list,
.quality-grid,
.state-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.exception-list div,
.quality-grid div,
.state-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.exception-list strong,
.quality-grid strong,
.state-grid strong {
  display: block;
  color: var(--brand-2);
  font-size: 24px;
  margin-bottom: 4px;
}

.exception-list span,
.quality-grid span,
.state-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.work-queue {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.employee-readiness-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.employee-readiness-actions .queue-item {
  min-height: 76px;
}

.queue-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
}

.queue-item.active {
  border-color: rgba(23, 78, 166, 0.38);
  background: #eff6ff;
  box-shadow: 0 10px 26px rgba(23, 78, 166, 0.08);
}

.queue-item strong {
  color: var(--brand-2);
}

.queue-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.health-meter {
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
  margin: 14px 0;
}

.health-meter span {
  display: block;
  width: var(--score);
  height: 100%;
  background: linear-gradient(90deg, var(--good), #68d391);
}

.record-health-list {
  display: grid;
  gap: 8px;
}

.record-health-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 11px 12px;
  text-align: left;
}

.record-health-item strong {
  color: var(--brand-2);
  font-size: 12px;
  text-transform: uppercase;
}

.record-health-item span {
  color: var(--ink);
  font-weight: 900;
}

.record-health-item small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.record-health-item.ready {
  border-color: rgba(22, 163, 74, 0.28);
  background: #f0fdf4;
}

.record-health-item.needs-work {
  border-color: rgba(249, 115, 22, 0.3);
  background: #fff7ed;
}

.dashboard-grid,
.payroll-grid,
.resume-grid,
.settings-grid,
.admin-grid,
.workflow-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 14px;
  margin-bottom: 14px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.panel h2 {
  margin: 0;
  color: var(--brand-2);
  font-size: 24px;
  line-height: 1.1;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.success {
  background: #e8fff6;
  color: var(--good);
}

.status-pill.warning {
  background: #fff8e6;
  color: var(--warn);
}

.status-pill.local {
  background: #fff7ed;
  color: var(--danger);
}

.status-pill.offline {
  background: #fef2f2;
  color: #b91c1c;
}

.payslip-proof {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.proof-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.payslip-proof small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.funnel-bars {
  display: grid;
  gap: 12px;
}

.funnel-bars div {
  position: relative;
  display: flex;
  justify-content: space-between;
  overflow: hidden;
  border-radius: 8px;
  background: #edf3fb;
  padding: 12px;
  color: var(--brand-2);
  font-weight: 900;
}

.funnel-bars div::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w);
  background: linear-gradient(90deg, rgba(23, 78, 166, 0.18), rgba(249, 115, 22, 0.16));
}

.funnel-bars span,
.funnel-bars strong {
  position: relative;
}

.risk-list,
.salary-lines,
.role-list,
.trust-checks,
.readiness-list {
  display: grid;
  gap: 10px;
}

.risk-list div,
.salary-lines div,
.role-list div,
.trust-checks div,
.readiness-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdff;
}

.risk-list strong,
.salary-lines strong {
  color: var(--brand-2);
  font-size: 22px;
}

.risk-list span,
.salary-lines span,
.role-list span,
.readiness-list span {
  color: var(--muted);
  font-weight: 750;
}

.readiness-list strong {
  color: var(--brand-2);
}

.architecture-strip {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) 1fr;
  gap: 16px;
  align-items: center;
}

.architecture-tags,
.adoption-strip,
.document-grid,
.service-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adoption-strip {
  margin-top: 14px;
}

.adoption-strip span {
  border: 1px solid rgba(23, 78, 166, 0.16);
  border-radius: 999px;
  background: #edf3fb;
  color: var(--brand-2);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.architecture-tags span,
.candidate-card div span {
  border-radius: 999px;
  background: var(--soft-blue);
  color: var(--brand);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.kanban {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.kanban-column {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf3fb;
  padding: 10px;
}

.kanban-column.hidden {
  display: none;
}

.kanban-column header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.kanban-column h2 {
  margin: 0;
  color: var(--brand-2);
  font-size: 15px;
}

.kanban-column header span {
  color: var(--muted);
  font-weight: 900;
}

.candidate-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}

.candidate-card strong {
  color: var(--brand-2);
}

.candidate-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.candidate-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.candidate-card.hidden {
  display: none;
}

.candidate-card.hired {
  border-color: rgba(15, 159, 110, 0.35);
}

.candidate-card.attention {
  border-color: rgba(249, 115, 22, 0.5);
  box-shadow: inset 3px 0 0 var(--accent);
}

.ats-quality {
  margin-top: 16px;
}

.detail-panel,
.approval-detail {
  margin-top: 16px;
}

.detail-grid,
.approval-grid,
.audit-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.detail-grid section,
.approval-grid section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.detail-grid h3,
.approval-grid h3 {
  margin: 0 0 10px;
  color: var(--brand-2);
  font-size: 15px;
}

.compact-dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.compact-dl div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
}

.compact-dl dt {
  color: var(--muted);
  font-weight: 900;
}

.compact-dl dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}

.timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  border-left: 3px solid var(--accent);
  padding-left: 10px;
}

.timeline strong,
.timeline span {
  display: block;
}

.timeline strong {
  color: var(--brand-2);
}

.timeline span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.audit-json {
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.import-result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.score-grid,
.process-steps,
.tab-strip,
.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preflight-actions {
  margin-top: 10px;
}

.action-hint {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 850;
  min-height: 34px;
}

.score-grid span,
.process-steps span,
.tab-strip button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-2);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
}

.process-steps {
  margin-bottom: 14px;
}

.process-steps .done {
  background: #e8fff6;
  color: var(--good);
}

.process-steps .active {
  background: var(--soft-orange);
  color: var(--danger);
}

.tab-strip {
  margin-bottom: 14px;
}

.tab-strip button {
  cursor: pointer;
}

.tab-strip button.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.checklist {
  display: grid;
  gap: 8px;
}

.checklist label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
}

.compact-table {
  box-shadow: none;
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-stack .btn {
  min-height: 34px;
  padding: 8px 12px;
  white-space: nowrap;
}

.support-template-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.support-template-strip .btn {
  min-height: 36px;
}

.support-note-input,
.leave-decision-note-input {
  width: min(280px, 100%);
  min-height: 64px;
  resize: vertical;
  font-size: 12px;
}

.support-comment-input {
  width: min(280px, 100%);
  min-height: 56px;
  resize: vertical;
  font-size: 12px;
}

.support-internal-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.support-comments {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.support-comments.empty span,
.support-comment {
  display: block;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #f8fafc;
  padding: 7px 8px;
}

.support-comment.internal {
  border-color: rgba(249, 115, 22, 0.24);
  background: #fff7ed;
}

.support-comment strong {
  display: block;
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 950;
}

.support-comment span,
.support-comments.empty span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  overflow-wrap: anywhere;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-grid span,
.calendar-grid button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-2);
  font-weight: 900;
  text-align: center;
}

.calendar-grid span {
  display: grid;
  place-items: center;
  background: var(--soft-blue);
}

.calendar-grid button.risk {
  background: #fff1f2;
  color: var(--danger);
}

.filter-stack {
  display: grid;
  gap: 10px;
  align-content: start;
}

.filter-stack select,
.filter-stack input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
}

.settings-matrix {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: none;
  max-width: min(360px, calc(100vw - 36px));
  border-radius: 8px;
  background: var(--brand-2);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 900;
}

.toast.show {
  display: block;
}

.empty-state {
  display: grid;
  gap: 6px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--brand-2);
  font-size: 14px;
}

.empty-state span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.muted {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.activity-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 10px 0 0;
  list-style: none;
}

.activity-list li {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
}

.activity-list span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.upload-panel {
  display: grid;
  align-content: center;
  gap: 14px;
  min-height: 280px;
  border-style: dashed;
  background: var(--soft-blue);
  cursor: pointer;
}

.upload-panel strong {
  color: var(--brand-2);
  font-size: 28px;
}

.parsed-fields {
  display: grid;
  gap: 10px;
  margin: 0;
}

.parsed-fields div {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.parsed-fields dt {
  color: var(--muted);
  font-weight: 900;
}

.parsed-fields dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}

.table-card,
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.access-table {
  min-width: 860px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 14px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  background: #fbfdff;
}

td {
  color: var(--ink);
  font-weight: 700;
}

.table-card tr.is-selected td {
  background: rgba(23, 78, 166, 0.08);
  box-shadow: inset 3px 0 0 var(--brand-2);
}

td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.payroll-grid,
.settings-grid {
  align-items: start;
}

.salary-lines .total {
  background: var(--soft-orange);
  border-color: rgba(249, 115, 22, 0.28);
}

.document-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.template-card {
  display: grid;
  gap: 12px;
}

pre {
  overflow-x: auto;
  margin: 0;
  border-radius: 8px;
  background: #0d1b2f;
  color: #dbeafe;
  padding: 14px;
  line-height: 1.55;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  font-weight: 700;
}

.form-grid textarea {
  min-height: 112px;
  resize: vertical;
}

.confirm-copy {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(12px);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.28);
}

.modal-wide {
  width: min(860px, 100%);
}

.command-backdrop {
  align-items: flex-start;
  padding-top: 72px;
}

.command-palette {
  width: min(720px, 100%);
  padding: 16px;
}

.command-search {
  display: grid;
  gap: 7px;
  margin: 14px 0;
}

.command-search span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.command-search input {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
  color: var(--ink);
  padding: 0 14px;
  font-weight: 850;
}

.command-list {
  display: grid;
  gap: 8px;
}

.command-item {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1.2fr);
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  text-align: left;
  cursor: pointer;
}

.command-item:hover,
.command-item:focus-visible {
  border-color: rgba(23, 78, 166, 0.34);
  background: #eef4ff;
  outline: none;
}

.command-item strong {
  font-size: 14px;
  font-weight: 950;
}

.command-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.api-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

body.sidebar-open {
  overflow: hidden;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 15;
    width: min(320px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }

  body.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .menu-button {
    display: inline-flex;
    align-items: center;
  }

  .topbar {
    grid-template-columns: auto auto 1fr;
  }

  .topbar-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .workflow-pilot {
    grid-template-columns: 1fr;
  }

  .workflow-pilot-orbit {
    transform: none;
  }
}

@media (max-width: 860px) {
  .auth-screen {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .workspace {
    padding: 16px;
  }

  .topbar {
    margin: -16px -16px 16px;
    padding: 12px 16px;
    grid-template-columns: auto 1fr;
  }

  .global-search {
    grid-column: 1 / -1;
  }

  .workflow-nav {
    justify-content: flex-end;
    gap: 4px;
  }

  .workflow-nav-button {
    width: 92px;
    padding: 0 8px;
  }

  .workflow-nav-label {
    min-width: 92px;
    max-width: 116px;
    padding: 0 8px;
  }

  .workflow-pilot {
    padding: 10px;
  }

  .workflow-pilot-orbit {
    grid-auto-columns: minmax(86px, 42%);
  }

  .workflow-pilot-node {
    min-height: 64px;
  }

  .page-head,
  .panel-head {
    flex-direction: column;
  }

  .metric-grid,
  .live-action-grid,
  .operations-map-stage,
  .employee-snapshot-grid,
  .action-grid,
  .dashboard-grid,
  .payroll-grid,
  .resume-grid,
  .settings-grid,
  .admin-grid,
  .settings-matrix,
  .detail-grid,
  .approval-grid,
  .audit-layout,
  .architecture-strip,
  .filter-row,
  .document-grid,
  .proof-run-panel,
  .toolbar-grid,
  .module-kpis,
  .api-grid {
    grid-template-columns: 1fr;
  }

  .exception-list,
  .quality-grid,
  .buyer-proof-grid,
  .state-grid {
    grid-template-columns: 1fr;
  }

  .ai-message {
    max-width: 100%;
  }

  .ai-drawer-panel {
    right: 12px;
    bottom: 66px;
    width: calc(100vw - 24px);
    max-height: min(460px, calc(100vh - 82px));
  }

  .ai-drawer.is-expanded .ai-drawer-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }

  .ai-drawer-head p {
    display: none;
  }

  .ai-thread {
    min-height: 136px;
    max-height: 206px;
  }

  .ai-drawer.is-expanded .ai-thread {
    min-height: 240px;
    max-height: 48vh;
  }

  .ai-snapshot {
    grid-template-columns: 1fr;
  }

  .head-actions,
  .topbar-actions {
    width: 100%;
  }

  .sync-status {
    width: 100%;
    justify-items: start;
  }

  .sync-status small {
    max-width: none;
    text-align: left;
  }

  .head-actions .btn,
  .topbar-actions .btn,
  .topbar-actions select {
    flex: 1;
  }

  .operations-map-head {
    flex-direction: column;
  }

  .operations-map-status {
    width: 100%;
    text-align: left;
  }

  .operations-map-shell {
    min-height: auto;
    perspective: none;
    padding: 12px;
  }

  .operations-map-stage {
    animation: none;
    min-height: auto;
    transform: none;
  }

  .operations-map-stage::before {
    display: none;
  }

  .operations-map-node,
  .operations-map-node:hover,
  .operations-map-node:focus-visible {
    min-height: 106px;
    transform: none;
  }

  .employee-command-main,
  .employee-next-action {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 720px) {
  .auth-screen {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    min-height: 100svh;
    align-content: start;
    align-items: stretch;
    gap: 18px;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 22px;
  }

  .auth-copy,
  .auth-card,
  .auth-explore-panel,
  .auth-suite-links,
  .buyer-proof-grid {
    width: calc(100vw - 44px);
    max-width: 100%;
    min-width: 0;
  }

  .auth-copy h1 {
    font-size: 40px;
    line-height: 1.03;
    overflow-wrap: anywhere;
  }

  .auth-copy p,
  .auth-explore-panel summary span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .auth-proof span {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .auth-suite-links a,
  .auth-explore-panel summary strong,
  .auth-card strong,
  .auth-card span,
  .auth-card small,
  .auth-card p {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .auth-suite-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .auth-card {
    max-height: none;
    padding: 18px;
  }

  .app-shell {
    min-height: 100svh;
    background: #f7f9fc;
  }

  .workspace {
    min-height: 100svh;
    padding: 14px 14px calc(96px + env(safe-area-inset-bottom));
  }

  .topbar {
    top: 0;
    margin: -14px -14px 14px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-bottom-color: rgba(148, 163, 184, 0.26);
    background: rgba(248, 250, 252, 0.92);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  }

  .menu-button {
    display: none;
  }

  .workflow-nav {
    width: 100%;
    justify-content: space-between;
  }

  .workflow-nav-label {
    flex: 1;
    max-width: none;
  }

  .topbar-actions {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .topbar-actions::-webkit-scrollbar {
    display: none;
  }

  .topbar-actions .btn,
  .topbar-actions select {
    flex: 0 0 auto;
    min-width: max-content;
  }

  .sync-status {
    flex: 1 0 190px;
  }

  .sidebar {
    inset: auto 0 0;
    z-index: 20;
    width: 100%;
    height: auto;
    max-height: calc(86px + env(safe-area-inset-bottom));
    transform: none;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(13, 27, 47, 0.94);
    box-shadow: 0 -16px 34px rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(18px);
    overflow: hidden;
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .brand,
  .suite-links,
  .sidebar-footer {
    display: none;
  }

  .nav-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    padding-bottom: 2px;
    scrollbar-width: none;
  }

  .nav-list::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    flex: 0 0 76px;
    min-height: 58px;
    scroll-snap-align: start;
    justify-content: center;
    border: 1px solid rgba(226, 232, 240, 0.08);
    padding: 8px 6px;
    color: #d7e2f2;
    text-align: center;
    font-size: 11px;
    line-height: 1.15;
  }

  .nav-item.active {
    border-color: rgba(255, 179, 123, 0.6);
    background: linear-gradient(180deg, rgba(255, 179, 123, 0.18), rgba(23, 78, 166, 0.32));
    color: #ffffff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }

  .page-head {
    gap: 12px;
    margin-bottom: 14px;
  }

  .page-head h1 {
    max-width: 100%;
    font-size: 30px;
    line-height: 1.05;
  }

  .page-head p {
    max-width: 100%;
  }

  .metric-card,
  .panel,
  .table-card {
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
  }

  .panel,
  .metric-card {
    padding: 16px;
  }

  .table-wrap,
  .table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-wrap table,
  .table-card table {
    min-width: 680px;
  }
}

@media (max-width: 520px) {
  .demo-picker-row {
    grid-template-columns: 1fr;
  }

  .demo-role-grid {
    grid-template-columns: 1fr;
  }

  .page-head h1 {
    font-size: 28px;
  }

  .metric-card strong {
    font-size: 24px;
  }

  .ai-drawer-panel {
    padding: 10px;
  }

  .ai-floating-button {
    right: 14px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    min-width: 58px;
    width: 58px;
    height: 58px;
    padding: 0;
  }

  .ai-floating-button > span:last-child {
    display: none;
  }

  .ai-mini-dock {
    right: 14px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    min-height: 58px;
    justify-content: center;
    padding: 0;
  }

  .ai-mini-dock > span:last-child {
    display: none;
  }

  .ai-tools .btn {
    flex: 1;
  }

  .ai-disclaimer {
    display: none;
  }

  .parsed-fields div {
    grid-template-columns: 1fr;
  }

  .risk-list div,
  .salary-lines div,
  .role-list div,
  .queue-item {
    flex-direction: column;
  }

  .compact-dl div {
    grid-template-columns: 1fr;
  }

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