:root {
  color-scheme: dark;
  --bg: #11110f;
  --bg-elevated: #151513;
  --surface: #191917;
  --surface-2: #20201d;
  --card: #1d1d1a;
  --card2: #24241f;
  --border: #34342e;
  --border2: #47463d;
  --text: #f4f1e8;
  --text-sm: #c8c2b6;
  --text-xs: #8f897d;
  --accent: #14b8a6;
  --accent-h: #67e8d7;
  --green: #4ade80;
  --green-bg: rgba(74, 222, 128, .12);
  --yellow: #fbbf24;
  --yellow-bg: rgba(251, 191, 36, .12);
  --red: #fb7185;
  --red-bg: rgba(251, 113, 133, .12);
  --blue: #60a5fa;
  --blue-bg: rgba(96, 165, 250, .12);
  --violet: #a78bfa;
  --shadow: 0 18px 46px rgba(0, 0, 0, .28);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, .18);
  --radius: 8px;
  --radius-lg: 8px;
  --radius-sm: 6px;
}

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

* {
  margin: 0;
  padding: 0;
}

html {
  background: var(--bg);
  scrollbar-color: var(--border2) var(--bg);
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  background:
    linear-gradient(180deg, rgba(20, 184, 166, .07), rgba(20, 184, 166, 0) 260px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Roboto, Arial, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  padding: 8px 12px;
  border: 1px solid rgba(103, 232, 215, .42);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  transform: translateY(-160%);
  transition: transform .15s ease;
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent-h);
  outline-offset: 2px;
}

a {
  color: var(--accent-h);
  text-decoration: none;
}

a:hover {
  color: #ffffff;
}

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

::selection {
  background: rgba(20, 184, 166, .32);
  color: #ffffff;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: rgba(20, 20, 18, .98);
  border-right: 1px solid var(--border);
  box-shadow: 12px 0 30px rgba(0, 0, 0, .18);
}

.sidebar-logo {
  min-height: 112px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 24px 18px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0));
}

.logo-mark {
  position: relative;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 38%),
    linear-gradient(135deg, #0f766e 0%, #164e63 58%, #312e81 100%);
  border: 1px solid rgba(103, 232, 215, .34);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 14px 28px rgba(20, 184, 166, .14);
}

.logo-mark::before,
.logo-mark::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(255, 255, 255, .18);
  inset: 7px;
  border-radius: var(--radius-sm);
}

.logo-mark::after {
  inset: 10px auto auto 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-right: 2px solid rgba(251, 191, 36, .82);
  border-bottom: 2px solid rgba(251, 191, 36, .82);
  border-radius: 0 0 7px 0;
  transform: rotate(-45deg);
  transform-origin: center;
}

.logo-mark span {
  position: relative;
  z-index: 1;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 50%;
  background: rgba(0, 0, 0, .18);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .12);
}

.logo-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.logo-name {
  display: grid;
  gap: 1px;
}

.logo-name span {
  color: var(--accent-h);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.logo-name strong {
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.logo-rule {
  width: 98px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--yellow), rgba(251, 191, 36, 0));
}

.sidebar-logo .logo-sub {
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .55px;
  line-height: 1.3;
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 14px 12px;
}

.nav-section {
  padding: 18px 12px 7px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-sm);
  font-size: 13px;
  font-weight: 800;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.nav a:hover {
  background: rgba(255, 255, 255, .045);
  border-color: var(--border);
  color: var(--text);
  transform: translateX(2px);
}

.nav a.active {
  background: rgba(20, 184, 166, .12);
  border-color: rgba(103, 232, 215, .28);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.nav-icon {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .035);
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
}

.nav a.active .nav-icon,
.nav a:hover .nav-icon {
  border-color: rgba(103, 232, 215, .34);
  background: rgba(20, 184, 166, .16);
  color: var(--accent-h);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.45;
}

.main-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.page-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: 100%;
  padding: 22px 36px 18px;
  background: rgba(17, 17, 15, .9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.page-header > div:first-child {
  min-width: 0;
}

.page-header-body {
  width: 100%;
  max-width: 1540px;
  padding: 28px 36px 42px;
}

.page-title {
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.page-sub {
  max-width: 980px;
  margin-top: 6px;
  color: var(--text-xs);
  font-size: 13px;
  line-height: 1.45;
}

.card,
.kpi-card,
.object-card,
.deadline-card,
.decision-hero {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0)), var(--card);
  box-shadow: var(--shadow-soft);
}

.card {
  padding: 20px;
  margin-bottom: 18px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .45px;
  text-transform: uppercase;
}

.card-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .12);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  position: relative;
  min-height: 132px;
  overflow: hidden;
  padding: 18px 18px 16px;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
}

.kpi-card:nth-child(2)::before { background: var(--blue); }
.kpi-card:nth-child(3)::before { background: var(--green); }
.kpi-card:nth-child(4)::before { background: var(--yellow); }
.kpi-card:nth-child(5)::before { background: var(--violet); }

.kpi-label {
  margin-bottom: 10px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .75px;
  text-transform: uppercase;
}

.kpi-value {
  color: #ffffff;
  font-size: 34px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.kpi-source,
.kpi-sub {
  display: block;
  margin-top: 8px;
  color: var(--text-xs);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.kpi-source {
  text-transform: uppercase;
  letter-spacing: .5px;
}

.summary-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.summary-bar > div,
.decision-summary > div {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .025);
}

.s-val {
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.s-lbl {
  margin-top: 6px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.s-val.green { color: var(--green); }
.s-val.yellow { color: var(--yellow); }
.s-val.blue { color: var(--blue); }
.s-val.red { color: var(--red); }

.status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .03);
  color: var(--text-sm);
  font-size: 13px;
}

.status-bar b {
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.status-bar.ok {
  border-color: rgba(74, 222, 128, .32);
  background: rgba(74, 222, 128, .08);
  color: var(--green);
}

.status-bar.warn {
  border-color: rgba(251, 191, 36, .32);
  background: rgba(251, 191, 36, .08);
  color: var(--yellow);
}

.status-bar.info {
  border-color: rgba(96, 165, 250, .32);
  background: rgba(96, 165, 250, .08);
  color: #bfdbfe;
}

.executive-cockpit {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012)), var(--surface);
  box-shadow: var(--shadow-soft);
}

.executive-cockpit.cockpit-ok {
  border-color: rgba(74, 222, 128, .28);
}

.executive-cockpit.cockpit-warn {
  border-color: rgba(251, 191, 36, .32);
}

.executive-cockpit.cockpit-error {
  border-color: rgba(251, 113, 133, .36);
}

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

.cockpit-head .card-title {
  margin-bottom: 7px;
}

.cockpit-head p {
  color: var(--text-sm);
  font-size: 13px;
  line-height: 1.45;
}

.cockpit-status {
  flex: 0 0 auto;
  min-width: 94px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: var(--radius-sm);
  background: rgba(148, 163, 184, .1);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .55px;
  text-align: center;
  text-transform: uppercase;
}

.cockpit-status-ok {
  border-color: rgba(74, 222, 128, .3);
  background: var(--green-bg);
  color: var(--green);
}

.cockpit-status-warn {
  border-color: rgba(251, 191, 36, .3);
  background: var(--yellow-bg);
  color: var(--yellow);
}

.cockpit-status-error {
  border-color: rgba(251, 113, 133, .34);
  background: var(--red-bg);
  color: var(--red);
}

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

.cockpit-tile {
  min-height: 104px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .15);
}

.cockpit-tile span,
.cockpit-tile em {
  display: block;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .6px;
  line-height: 1.35;
  text-transform: uppercase;
}

.cockpit-tile strong {
  display: block;
  margin: 8px 0 7px;
  color: #ffffff;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.cockpit-tile em {
  color: var(--text-sm);
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
}

.tile-green { border-color: rgba(74, 222, 128, .24); }
.tile-green strong { color: var(--green); }
.tile-yellow { border-color: rgba(251, 191, 36, .28); }
.tile-yellow strong { color: var(--yellow); }
.tile-blue { border-color: rgba(96, 165, 250, .28); }
.tile-blue strong { color: var(--blue); }
.tile-violet { border-color: rgba(167, 139, 250, .28); }
.tile-violet strong { color: #ddd6fe; }

.cockpit-action-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px;
}

.cockpit-action {
  min-height: 76px;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .12);
  color: var(--text-sm);
}

.cockpit-action:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .04);
}

.cockpit-action strong {
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.3;
}

.cockpit-action span {
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.42;
}

.action-ok { border-left-color: var(--green); }
.action-info { border-left-color: var(--blue); }
.action-warn { border-left-color: var(--yellow); }

.worker-profile-band {
  margin-bottom: 18px;
}

.band-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.band-heading .card-title {
  margin-bottom: 0;
}

.band-heading span {
  color: var(--text-xs);
  font-size: 12px;
}

.worker-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.worker-flow-diagram {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(45, 212, 191, .18);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 22%, rgba(20, 184, 166, .16), transparent 28%),
    radial-gradient(circle at 82% 70%, rgba(245, 158, 11, .12), transparent 30%),
    linear-gradient(135deg, rgba(8, 17, 15, .96), rgba(13, 16, 12, .96));
  box-shadow: var(--shadow-soft);
}

.worker-flow-summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.worker-flow-summary div,
.worker-flow-footer {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 12px;
  background: rgba(0, 0, 0, .18);
}

.worker-flow-summary span,
.worker-flow-footer span {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .9px;
  text-transform: uppercase;
}

.worker-flow-summary strong,
.worker-flow-footer strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.35;
}

.worker-flow-canvas {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 12px;
  min-height: 0;
}

.worker-flow-links {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: none;
}

.flow-link {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.flow-link-main {
  color: var(--accent);
  stroke: currentColor;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, .42));
}

.flow-link-gold {
  color: var(--yellow);
  stroke: currentColor;
  stroke-width: 3;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, .42));
}

.flow-link-muted {
  stroke: rgba(148, 163, 184, .32);
  stroke-width: 1.4;
  stroke-dasharray: 4 5;
}

.flow-arrow-accent {
  fill: var(--accent);
}

.flow-arrow-gold {
  fill: var(--yellow);
}

.worker-flow-node {
  position: relative;
  z-index: 2;
  min-height: 234px;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .055), rgba(0, 0, 0, .2));
  box-shadow: 0 16px 35px rgba(0, 0, 0, .24);
}

.worker-flow-node::before {
  content: "";
  position: absolute;
  inset: -1px auto auto -1px;
  width: 46%;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  opacity: .95;
}

.worker-flow-node:not(.worker-flow-node-maintenance)::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 28px;
  right: -21px;
  width: 30px;
  height: 14px;
  background: var(--accent);
  clip-path: polygon(0 36%, 68% 36%, 68% 0, 100% 50%, 68% 100%, 68% 64%, 0 64%);
  filter: drop-shadow(0 0 6px rgba(45, 212, 191, .5));
}

.worker-flow-node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.worker-flow-node-top span {
  display: grid;
  width: 38px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #031312;
  background: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.worker-flow-node-top em {
  max-width: 128px;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, .32);
  border-radius: 8px;
  color: #bfdbfe;
  background: rgba(96, 165, 250, .1);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: .6px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.worker-flow-node h3 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.2;
}

.worker-flow-role,
.worker-flow-power {
  margin: 0 0 9px;
  color: var(--text-sm);
  font-size: 11px;
  line-height: 1.45;
}

.worker-flow-role {
  color: #e5e7eb;
  font-weight: 800;
}

.worker-flow-power {
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  color: #ccfbf1;
}

.worker-flow-rule {
  margin-top: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 10px;
  color: var(--text-xs);
  background: rgba(0, 0, 0, .18);
  font-size: 10.5px;
  line-height: 1.35;
}

.worker-flow-node-pipeline { grid-column: 1; }
.worker-flow-node-pliegos { grid-column: 2; }
.worker-flow-node-legal-audit { grid-column: 3; }
.worker-flow-node-company-docs { grid-column: 4; }
.worker-flow-node-decisions { grid-column: 5; }
.worker-flow-node-maintenance { grid-column: 6; }

.flow-node-live-state {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}

.flow-node-kicker,
.flow-node-activity span {
  color: var(--accent);
  font-size: 9.5px;
  font-weight: 950;
  letter-spacing: .7px;
  line-height: 1;
  text-transform: uppercase;
}

.flow-node-live-state strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.25;
}

.flow-node-live-state small {
  color: var(--text-xs);
  font-size: 10.5px;
  line-height: 1.35;
}

.flow-node-activity {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(0, 0, 0, .16);
}

.flow-node-activity p {
  margin: 0;
  color: var(--text-sm);
  font-size: 11px;
  line-height: 1.42;
}

.worker-flow-node-legal-audit::before,
.worker-flow-node-decisions::before {
  background: var(--yellow);
}

.worker-flow-node-legal-audit::after,
.worker-flow-node-decisions::after {
  background: var(--yellow);
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, .45));
}

.worker-flow-node-legal-audit .worker-flow-node-top span,
.worker-flow-node-decisions .worker-flow-node-top span {
  background: var(--yellow);
}

.worker-flow-node-decisions {
  border-color: rgba(245, 158, 11, .42);
  background:
    linear-gradient(160deg, rgba(245, 158, 11, .11), rgba(0, 0, 0, .22)),
    rgba(255, 255, 255, .035);
}

.flow-node-status-ok { border-color: rgba(74, 222, 128, .38); }
.flow-node-status-ok::before { background: var(--green); }
.flow-node-status-ok .worker-flow-node-top span { background: var(--green); }

.flow-node-status-active { border-color: rgba(45, 212, 191, .42); }
.flow-node-status-active::before { background: var(--accent); }

.flow-node-status-warn { border-color: rgba(251, 191, 36, .42); }
.flow-node-status-warn::before { background: var(--yellow); }
.flow-node-status-warn .worker-flow-node-top span { background: var(--yellow); }

.flow-node-status-error { border-color: rgba(251, 113, 133, .5); }
.flow-node-status-error::before { background: var(--red); }
.flow-node-status-error .worker-flow-node-top span { color: #fff; background: var(--red); }

.flow-node-status-idle { opacity: .88; }

.worker-flow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
}

.worker-flow-footer span {
  margin-bottom: 0;
  color: var(--text-sm);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}

@media (max-width: 1180px) {
  .worker-flow-canvas {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-height: 0;
  }

  .worker-flow-node,
  .worker-flow-node-pipeline,
  .worker-flow-node-pliegos,
  .worker-flow-node-legal-audit,
  .worker-flow-node-company-docs,
  .worker-flow-node-decisions,
  .worker-flow-node-maintenance {
    grid-column: auto;
    grid-row: auto;
  }

  .worker-flow-links {
    display: none;
  }

  .worker-flow-node::after {
    display: none;
  }
}

.dashboard-unified-card {
  overflow: hidden;
}

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

.unified-table-head p {
  margin: 5px 0 0;
  color: var(--text-xs);
  font-size: 12px;
  line-height: 1.4;
}

.filter-insight {
  display: grid;
  gap: 3px;
  max-width: 620px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(45, 212, 191, .22);
  border-radius: 8px;
  background: rgba(20, 184, 166, .08);
}

.filter-insight strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.25;
}

.filter-insight span {
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.35;
}

.opportunity-filter-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: 620px;
}

.unified-filter-stack {
  display: grid;
  gap: 8px;
  justify-items: end;
  max-width: 700px;
}

.filter-chip {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 8px;
  color: var(--text-sm);
  background: rgba(255, 255, 255, .035);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
}

.filter-chip strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #e5e7eb;
  background: rgba(148, 163, 184, .16);
  font-size: 11px;
}

.filter-chip.active {
  border-color: rgba(45, 212, 191, .55);
  color: #ffffff;
  background: rgba(20, 184, 166, .16);
}

.filter-chip.active strong {
  color: #031312;
  background: var(--accent);
}

.filter-status {
  min-height: 18px;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

.unified-opportunities-table {
  min-width: 880px;
}

.unified-process-cell {
  min-width: 300px;
}

.row-muted {
  margin-top: 4px;
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.row-money {
  margin-top: 7px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.line-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 999px;
  color: var(--text);
  background: rgba(148, 163, 184, .1);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.line-construccion_mantenimiento {
  border-color: rgba(74, 222, 128, .34);
  color: var(--green);
  background: rgba(74, 222, 128, .11);
}

.line-interventorias {
  border-color: rgba(96, 165, 250, .36);
  color: #bfdbfe;
  background: rgba(96, 165, 250, .12);
}

.line-consultorias {
  border-color: rgba(251, 191, 36, .36);
  color: var(--yellow);
  background: rgba(251, 191, 36, .1);
}

.priority-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.priority-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 999px;
  color: var(--text-sm);
  background: rgba(148, 163, 184, .1);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.priority-alta {
  border-color: rgba(74, 222, 128, .34);
  color: var(--green);
  background: rgba(74, 222, 128, .11);
}

.priority-revisar {
  border-color: rgba(251, 191, 36, .36);
  color: var(--yellow);
  background: rgba(251, 191, 36, .1);
}

.priority-baja {
  border-color: rgba(148, 163, 184, .25);
  color: #cbd5e1;
  background: rgba(148, 163, 184, .1);
}

.pliego-state-cell {
  min-width: 150px;
}

/* Estado SECOP del proceso (borrador, abierto, evaluación, adjudicado, etc.) */
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 8px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(148, 163, 184, .1);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.status-borrador     { border-color: rgba(148,163,184,.4);  color:#94a3b8; background:rgba(148,163,184,.08); }
.status-publicado    { border-color: rgba(14,165,233,.4);   color:#38bdf8; background:rgba(14,165,233,.10); }
.status-manifestacion{ border-color: rgba(168,85,247,.4);   color:#c084fc; background:rgba(168,85,247,.10); }
.status-abierto      { border-color: rgba(34,197,94,.4);    color:#4ade80; background:rgba(34,197,94,.10); }
.status-evaluacion   { border-color: rgba(251,191,36,.4);   color:#fbbf24; background:rgba(251,191,36,.10); }
.status-adjudicado   { border-color: rgba(16,185,129,.45);  color:#10b981; background:rgba(16,185,129,.12); }
.status-cerrado      { border-color: rgba(100,116,139,.4);  color:#94a3b8; background:rgba(100,116,139,.10); }
.status-desierto     { border-color: rgba(239,68,68,.4);    color:#fca5a5; background:rgba(239,68,68,.10); }
.status-cancelado    { border-color: rgba(239,68,68,.5);    color:#ef4444; background:rgba(239,68,68,.12); }
.status-otro         { border-color: rgba(148,163,184,.25); color:#cbd5e1; background:rgba(148,163,184,.08); }
.status-desconocido  { border-color: rgba(148,163,184,.2);  color:#94a3b8; background:rgba(148,163,184,.06); }

@media (max-width: 720px) {
  .worker-flow-diagram {
    padding: 12px;
  }

  .worker-flow-summary,
  .worker-flow-canvas {
    grid-template-columns: 1fr;
  }

  .band-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .worker-flow-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .unified-table-head {
    flex-direction: column;
  }

  .opportunity-filter-group {
    justify-content: flex-start;
    max-width: none;
    width: 100%;
  }

  .unified-filter-stack {
    justify-items: stretch;
    max-width: none;
    width: 100%;
  }
}

.worker-profile {
  min-height: 260px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .032);
  box-shadow: var(--shadow-soft);
}

.worker-profile-top {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.worker-profile-top span {
  width: fit-content;
  padding: 4px 7px;
  border: 1px solid rgba(96, 165, 250, .28);
  border-radius: 4px;
  color: #bfdbfe;
  background: rgba(96, 165, 250, .08);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.worker-profile-top strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.25;
}

.worker-role,
.worker-mission,
.worker-ai-power {
  margin: 0 0 10px;
  color: var(--text-sm);
  font-size: 12px;
  line-height: 1.45;
}

.worker-role {
  color: #e5e7eb;
  font-weight: 800;
}

.worker-ai-power {
  padding-left: 10px;
  border-left: 2px solid var(--accent);
  color: #ccfbf1;
}

.worker-rules {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.worker-rules span {
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.35;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .12);
}

.scroll-after-8 {
  max-height: min(68vh, 650px);
  overflow: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) rgba(0, 0, 0, .08);
}

.scroll-after-8::-webkit-scrollbar,
.scroll-after-8-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.scroll-after-8::-webkit-scrollbar-thumb,
.scroll-after-8-list::-webkit-scrollbar-thumb {
  border: 2px solid rgba(7, 10, 18, .82);
  border-radius: 999px;
  background: rgba(148, 163, 184, .44);
}

.scroll-after-8::-webkit-scrollbar-track,
.scroll-after-8-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .08);
}

table {
  width: 100%;
  border-collapse: collapse;
}

.opportunities-table {
  min-width: 980px;
  table-layout: fixed;
}

.opportunities-table .col-process { width: 38%; }
.opportunities-table .col-entity { width: 13%; }
.opportunities-table .col-status { width: 8%; }
.opportunities-table .col-score { width: 7%; }
.opportunities-table .col-segment { width: 12%; }
.opportunities-table .col-recommendation { width: 13%; }
.opportunities-table .col-actions { width: 9%; }

thead tr {
  border-bottom: 1px solid var(--border2);
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 12px;
  background: var(--surface-2);
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .65px;
  text-align: left;
  text-transform: uppercase;
  white-space: normal;
}

td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .055);
  color: var(--text);
  font-size: 13px;
  vertical-align: top;
}

tbody tr {
  transition: background .16s ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, .035);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.truncate,
.process-name-cell,
.process-title-full,
.process-name-cell-compact,
.text-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.process-title-full {
  display: block;
  color: #ffffff;
  font-weight: 800;
  line-height: 1.38;
}

.truncate {
  max-width: 240px;
}

.money-value {
  max-width: 230px;
  color: var(--accent-h);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.35;
  text-align: right;
}

.meta-value {
  max-width: 240px;
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.actions-cell {
  min-width: 96px;
  white-space: normal;
}

.snippet {
  color: var(--text-sm);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.snippet b {
  color: var(--text);
}

.badge,
.score-pill,
.decision-pill,
.normative-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  white-space: nowrap;
}

.badge {
  gap: 5px;
  min-height: 24px;
  padding: 4px 9px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .2px;
}

.badge-ok {
  background: var(--green-bg);
  border: 1px solid rgba(74, 222, 128, .3);
  color: var(--green);
}

.badge-captcha {
  background: var(--yellow-bg);
  border: 1px solid rgba(251, 191, 36, .3);
  color: var(--yellow);
}

.badge-error {
  background: var(--red-bg);
  border: 1px solid rgba(251, 113, 133, .34);
  color: var(--red);
}

.badge-waf {
  background: rgba(148, 163, 184, .12);
  border: 1px solid rgba(148, 163, 184, .25);
  color: #cbd5e1;
}

.score-pill {
  min-width: 44px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 900;
}

.score-high {
  background: var(--green-bg);
  color: var(--green);
}

.score-mid {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.score-low {
  background: rgba(148, 163, 184, .12);
  color: #cbd5e1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  transition: background .16s ease, color .16s ease, border-color .16s ease, transform .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: rgba(103, 232, 215, .38);
  color: #061311;
}

.btn-primary:hover {
  background: var(--accent-h);
  color: #061311;
}

.btn-ghost {
  background: rgba(255, 255, 255, .025);
  border-color: var(--border2);
  color: var(--text-sm);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, .07);
  color: #ffffff;
}

.btn-danger {
  background: rgba(251, 113, 133, .08);
  border-color: rgba(251, 113, 133, .32);
  color: var(--red);
}

.btn-danger:hover {
  background: rgba(251, 113, 133, .16);
}

.btn-sm {
  min-height: 28px;
  padding: 5px 9px;
  font-size: 11px;
}

.alert,
.empty-state {
  border-radius: var(--radius);
}

.alert {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(251, 113, 133, .34);
  background: var(--red-bg);
  color: var(--red);
  font-size: 13px;
}

.empty-state {
  padding: 22px;
  color: var(--text-xs);
  font-style: italic;
  text-align: center;
}

.divider {
  height: 1px;
  margin: 16px 0;
  background: var(--border);
}

.object-card {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(280px, .82fr);
  gap: 18px;
  margin-bottom: 14px;
  padding: 20px;
  border-color: rgba(103, 232, 215, .2);
}

.object-label,
.deadline-label,
.decision-eyebrow {
  margin-bottom: 7px;
  color: var(--accent-h);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .75px;
  text-transform: uppercase;
}

.object-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.object-meta-grid {
  display: grid;
  gap: 9px;
}

.object-meta-grid div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .14);
}

.object-meta-grid span,
.plazo-meta span,
.plazo-meta small,
.deadline-counter span,
.deadline-mini span {
  display: block;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .55px;
  text-transform: uppercase;
}

.object-meta-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.deadline-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 16px 18px;
}

.deadline-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.35;
}

.deadline-meta {
  margin-top: 6px;
  color: var(--text-xs);
  font-size: 12px;
}

.deadline-counter {
  min-width: 78px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .18);
  text-align: center;
}

.deadline-counter strong {
  display: block;
  color: #ffffff;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}

.deadline-vigente,
.deadline-proximo {
  border-color: rgba(96, 165, 250, .3);
}

.deadline-hoy,
.deadline-urgente,
.deadline-sin_fecha {
  border-color: rgba(251, 191, 36, .34);
}

.deadline-vencido {
  border-color: rgba(251, 113, 133, .34);
}

.deadline-mini {
  max-width: 260px;
  padding: 8px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .16);
  color: var(--text-sm);
  font-size: 11px;
  line-height: 1.35;
  text-align: right;
}

.plazo-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.plazo-meta strong {
  color: var(--text-sm);
  font-size: 11px;
  font-weight: 900;
}

.pliego-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 900px;
  margin-top: 8px;
}

.pliego-signals span {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid rgba(20, 184, 166, .26);
  border-radius: 999px;
  background: rgba(20, 184, 166, .08);
  color: var(--accent-h);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.pliego-signals em,
.pliego-status-note,
.extracted-empty {
  color: var(--text-xs);
  font-size: 12px;
  font-style: italic;
  line-height: 1.45;
}

.pliego-status-note {
  margin-top: 8px;
}

.extracted-section {
  margin-bottom: 12px;
}

.extracted-heading {
  margin-bottom: 12px;
  color: var(--text-xs);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.extracted-blocks {
  display: grid;
  gap: 10px;
}

.extracted-block {
  max-height: 310px;
  overflow-y: auto;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .16);
  scrollbar-color: var(--border2) transparent;
}

.extracted-block-title {
  margin-bottom: 8px;
  color: var(--accent-h);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .65px;
  line-height: 1.35;
  text-transform: uppercase;
}

.extracted-copy {
  color: var(--text);
  font-size: 13px;
  line-height: 1.72;
  overflow-wrap: anywhere;
  text-align: justify;
  text-wrap: pretty;
  white-space: pre-line;
}

.section-inventory-card {
  margin-bottom: 12px;
}

.reviewer-memo-card {
  margin-bottom: 18px;
  border-color: rgba(20, 184, 166, .22);
}

.reviewer-memo-head {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, .6fr);
  gap: 10px;
  margin-bottom: 12px;
}

.reviewer-memo-head div,
.reviewer-memo-grid > div {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .14);
  background: rgba(2, 6, 23, .28);
}

.reviewer-memo-head span,
.reviewer-memo-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .65px;
  text-transform: uppercase;
}

.reviewer-memo-head strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

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

.reviewer-memo-grid p {
  margin: 0 0 8px;
  color: var(--text-sm);
  font-size: 12px;
  line-height: 1.45;
}

.reviewer-memo-grid p:last-child {
  margin-bottom: 0;
}

.reviewer-evidence-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.reviewer-evidence-row span {
  padding: 5px 8px;
  border: 1px solid rgba(20, 184, 166, .22);
  background: rgba(20, 184, 166, .08);
  color: #99f6e4;
  font-size: 10px;
  font-weight: 800;
}

.section-inventory-summary,
.section-chip-row,
.normative-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.section-inventory-summary {
  margin: 4px 0 12px;
  color: var(--text-sm);
  font-size: 12px;
}

.section-inventory-summary span,
.section-chip,
.normative-kpi-row span {
  border-radius: 999px;
  font-weight: 800;
}

.section-inventory-summary span {
  padding: 6px 9px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, .14);
}

.section-chip-row {
  margin-bottom: 12px;
}

.section-chip {
  padding: 5px 8px;
  border: 1px solid rgba(20, 184, 166, .24);
  background: rgba(20, 184, 166, .08);
  color: var(--accent-h);
  font-size: 10px;
  letter-spacing: .45px;
  text-transform: uppercase;
}

.section-inventory-grid,
.section-group-grid {
  max-height: 720px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: var(--border2) transparent;
}

.section-inventory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.section-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 12px;
}

.section-inventory-item,
.section-group-card,
.normative-item {
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .16);
}

.section-inventory-item {
  min-height: 210px;
  padding: 13px 14px;
}

.section-group-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: 13px 14px;
}

.section-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.section-group-title {
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.3;
}

.section-group-sub {
  margin-top: 3px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .55px;
  text-transform: uppercase;
}

.section-group-scroll {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-color: var(--border2) transparent;
}

.section-group-entry {
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}

.section-group-entry:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.section-inventory-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .55px;
  text-transform: uppercase;
}

.section-inventory-index {
  margin: -2px 0 8px;
  color: var(--accent-h);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.section-inventory-title {
  margin-bottom: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.section-inventory-copy {
  color: var(--text-sm);
  font-size: 12px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  text-align: justify;
  white-space: pre-line;
}

.section-quality {
  margin: 0 0 8px;
  padding: 8px 9px;
  border: 1px solid rgba(251, 191, 36, .3);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, .08);
  color: var(--yellow);
  font-size: 11px;
  line-height: 1.35;
}

.section-quality-baja {
  border-color: rgba(251, 113, 133, .34);
  background: rgba(251, 113, 133, .08);
  color: var(--red);
}

.section-quality-incompleta {
  border-color: rgba(251, 191, 36, .3);
  background: rgba(251, 191, 36, .08);
  color: var(--yellow);
}

.normative-card {
  border-color: rgba(167, 139, 250, .22);
}

.normative-summary {
  margin: -4px 0 16px;
  color: var(--text-sm);
  font-size: 13px;
  line-height: 1.6;
}

.normative-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.normative-item {
  min-height: 132px;
  padding: 14px;
}

.normative-label {
  margin-bottom: 8px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.normative-status {
  margin-bottom: 10px;
  padding: 4px 9px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(148, 163, 184, .12);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.normative-status.cumplimiento,
.normative-status.aplica {
  border-color: rgba(74, 222, 128, .3);
  background: var(--green-bg);
  color: var(--green);
}

.normative-status.omision,
.normative-status.requiere_revision_humana,
.normative-status.indeterminado,
.normative-status.ambiguedad,
.normative-status.no_aplica {
  border-color: rgba(251, 191, 36, .3);
  background: var(--yellow-bg);
  color: var(--yellow);
}

.normative-status.contradiccion {
  border-color: rgba(251, 113, 133, .34);
  background: var(--red-bg);
  color: var(--red);
}

.normative-copy {
  color: var(--text-sm);
  font-size: 12.5px;
  line-height: 1.5;
}

.normative-kpi-row {
  margin: -5px 0 14px;
}

.normative-kpi-row span {
  padding: 5px 8px;
  border: 1px solid rgba(167, 139, 250, .26);
  background: rgba(167, 139, 250, .09);
  color: #ddd6fe;
  font-size: 11px;
  letter-spacing: .45px;
  text-transform: uppercase;
}

.normative-action {
  margin-top: 10px;
  padding: 9px 10px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: rgba(20, 184, 166, .08);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.normative-evidence {
  margin-top: 10px;
  color: var(--text-xs);
  font-size: 12px;
}

.normative-evidence summary {
  cursor: pointer;
  color: var(--accent-h);
  font-weight: 800;
}

.normative-evidence p {
  margin-top: 8px;
  color: var(--text-sm);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.normative-action-panel,
.normative-matrix {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-sm);
  font-size: 12px;
}

.normative-panel-title {
  color: var(--accent-h);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
}

.normative-action-panel div:not(.normative-panel-title),
.normative-matrix-row {
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, .07);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .16);
  line-height: 1.45;
}

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

.normative-matrix-row strong {
  color: var(--text);
  font-size: 12px;
}

.normative-matrix-row span {
  color: var(--text-xs);
  font-size: 11px;
  text-align: right;
}

.normative-findings {
  display: grid;
  gap: 7px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-sm);
  font-size: 12px;
  scrollbar-color: var(--border2) transparent;
}

.normative-pending {
  padding: 14px 16px;
  border: 1px dashed rgba(251, 191, 36, .36);
  border-radius: var(--radius);
  background: rgba(251, 191, 36, .07);
  color: var(--yellow);
  font-size: 13px;
  line-height: 1.55;
}

.normative-scroll-grid {
  max-height: 460px;
}

.normative-section-item {
  min-height: 176px;
}

.normative-section-item .normative-status {
  margin-bottom: 8px;
}

.decision-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 20px;
  border-color: rgba(103, 232, 215, .2);
}

.decision-title {
  color: #ffffff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.decision-hero-metrics {
  min-width: 420px;
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 10px;
}

.decision-hero-metrics div {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .16);
}

.decision-hero-metrics b {
  display: block;
  color: #ffffff;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
}

.decision-hero-metrics span {
  display: block;
  margin-top: 6px;
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .55px;
  text-transform: uppercase;
}

.decision-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(280px, .9fr);
  gap: 18px;
}

.company-scope-panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(96, 165, 250, .24);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(96, 165, 250, .045), rgba(255, 255, 255, .012)), var(--surface);
  box-shadow: var(--shadow-soft);
}

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

.company-scope-head .card-title {
  margin-bottom: 7px;
}

.company-scope-head p {
  color: var(--text-sm);
  font-size: 12px;
}

.scope-mode {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .16);
}

.scope-mode label {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-sm);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.scope-mode input {
  accent-color: var(--accent);
}

.company-scope-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 9px;
}

.company-scope-item {
  min-height: 82px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, .14);
  cursor: pointer;
}

.company-scope-item:hover {
  border-color: rgba(103, 232, 215, .28);
  background: rgba(20, 184, 166, .055);
}

.company-scope-item input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.company-scope-item span,
.company-scope-item strong,
.company-scope-item em,
.company-scope-item b {
  min-width: 0;
}

.company-scope-item strong {
  display: block;
  color: #ffffff;
  font-size: 13px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.company-scope-item em {
  display: block;
  margin-top: 3px;
  color: var(--text-xs);
  font-size: 11px;
  font-style: normal;
}

.company-scope-item b {
  grid-column: 2;
  color: var(--accent-h);
  font-size: 11px;
  font-weight: 900;
}

.company-scope-item.scope-disabled {
  opacity: .56;
  cursor: default;
}

.scope-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.company-list {
  display: grid;
  gap: 10px;
}

.pliegos-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scroll-after-8-list {
  max-height: min(72vh, 980px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--border2) rgba(0, 0, 0, .08);
}

.company-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.company-row:last-child {
  border-bottom: 0;
}

.company-name {
  color: #ffffff;
  font-weight: 900;
  line-height: 1.25;
}

.company-meta {
  margin-top: 3px;
  color: var(--text-xs);
  font-size: 11px;
}

.company-stats {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.company-stats span {
  padding: 4px 8px;
  border: 1px solid rgba(20, 184, 166, .22);
  border-radius: 999px;
  background: rgba(20, 184, 166, .08);
  color: var(--accent-h);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.decision-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.decision-table {
  min-width: 1040px;
  table-layout: fixed;
}

.decision-table th:nth-child(1) { width: 30%; }
.decision-table th:nth-child(2) { width: 12%; }
.decision-table th:nth-child(3) { width: 10%; }
.decision-table th:nth-child(4) { width: 17%; }
.decision-table th:nth-child(5),
.decision-table th:nth-child(6),
.decision-table th:nth-child(7) { width: 8%; }
.decision-table th:nth-child(8) { width: 5%; }
.decision-table th:nth-child(9) { width: 4%; }

.decision-reason {
  margin-top: 6px;
  color: var(--text-xs);
  font-size: 12px;
  line-height: 1.35;
}

.decision-gap {
  margin-top: 3px;
  color: var(--text-xs);
  font-size: 11px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.decision-pill {
  min-width: 74px;
  padding: 5px 9px;
  border: 1px solid rgba(148, 163, 184, .25);
  background: rgba(148, 163, 184, .12);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .35px;
  text-transform: uppercase;
}

.decision-go,
.decision-solo {
  border-color: rgba(74, 222, 128, .3);
  background: var(--green-bg);
  color: var(--green);
}

.decision-plural {
  border-color: rgba(96, 165, 250, .3);
  background: var(--blue-bg);
  color: #bfdbfe;
}

.decision-review {
  border-color: rgba(251, 191, 36, .3);
  background: var(--yellow-bg);
  color: var(--yellow);
}

.decision-discard {
  border-color: rgba(251, 113, 133, .34);
  background: var(--red-bg);
  color: var(--red);
}

.decision-pendiente {
  border-color: rgba(148, 163, 184, .25);
  background: rgba(148, 163, 184, .12);
  color: #cbd5e1;
}

.decision-detail-row td {
  padding-top: 0;
  background: rgba(15, 23, 42, .38);
}

.rup-trace {
  border: 1px solid rgba(148, 163, 184, .16);
  background: rgba(2, 6, 23, .35);
  overflow: hidden;
}

.rup-trace summary {
  min-height: 36px;
  padding: 9px 12px;
  color: var(--text-sm);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .2px;
  cursor: pointer;
}

.rup-trace[open] summary {
  border-bottom: 1px solid rgba(148, 163, 184, .14);
}

.rup-trace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 12px;
  padding: 12px;
}

.rup-trace-panel {
  min-width: 0;
}

.rup-trace-label {
  color: var(--text-xs);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.rup-trace-metrics,
.rup-score-breakdown,
.rup-contract-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.rup-trace-metrics span,
.rup-score-breakdown span,
.rup-contract-meta span {
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(15, 23, 42, .62);
  color: var(--text-sm);
  padding: 4px 7px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.rup-trace-panel p {
  margin: 10px 0 0;
  max-height: 88px;
  overflow: auto;
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.45;
}

.decision-memo {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .9fr) minmax(0, .95fr);
  gap: 10px;
  padding: 0 12px 12px;
}

.decision-memo > div {
  padding: 10px;
  border: 1px solid rgba(20, 184, 166, .18);
  background: rgba(20, 184, 166, .06);
}

.decision-memo strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.decision-memo p {
  margin: 7px 0 0;
  color: var(--text-sm);
  font-size: 11px;
  line-height: 1.45;
}

.decision-memo span {
  display: block;
  margin-top: 7px;
  color: #99f6e4;
  font-size: 11px;
  line-height: 1.35;
}

.rup-contract-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.rup-contract {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border-top: 1px solid rgba(148, 163, 184, .12);
  padding-top: 8px;
}

.rup-contract b,
.rup-contract span {
  display: block;
}

.rup-contract b {
  color: var(--text);
  font-size: 12px;
}

.rup-contract-meta span {
  max-width: 260px;
  white-space: normal;
}

.rup-contract > div:first-child span {
  margin-top: 3px;
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.35;
}

details summary {
  border-radius: var(--radius);
}

pre {
  font-family: inherit;
}

@media (max-width: 1180px) {
  body {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .page-header,
  .page-header-body {
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (max-width: 960px) {
  body {
    display: block;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .sidebar-logo {
    min-height: auto;
  }

  .page-header {
    position: relative;
    padding: 22px 20px;
  }

  .page-header-body {
    padding: 20px 16px 34px;
  }

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

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

  .cockpit-head {
    flex-direction: column;
  }

  .table-wrap {
    margin: 0 -4px;
  }

  .opportunities-table {
    min-width: 820px;
  }

  .object-card {
    grid-template-columns: 1fr;
  }

  .deadline-card {
    align-items: flex-start;
  }

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

  .decision-hero-metrics {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
  }

  .company-scope-head {
    flex-direction: column;
  }

  .scope-mode {
    width: 100%;
    justify-content: flex-start;
  }

  .reviewer-memo-head,
  .reviewer-memo-grid,
  .decision-memo {
    grid-template-columns: 1fr;
  }

  .rup-trace-grid,
  .rup-contract {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .kpi-grid,
  .cockpit-grid,
  .decision-hero-metrics {
    grid-template-columns: 1fr;
  }

  .kpi-card {
    min-height: 118px;
  }

  .summary-bar,
  .decision-summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .company-scope-panel {
    padding: 16px;
  }

  .company-scope-grid {
    grid-template-columns: 1fr;
  }

  .scope-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .card,
  .executive-cockpit,
  .object-card,
  .deadline-card,
  .decision-hero {
    padding: 16px;
  }

  .page-title {
    font-size: 21px;
  }

  .opportunities-table {
    min-width: 760px;
  }
}

/* ============================================================
   SIDEBAR USER BLOCK
   ============================================================ */

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.sidebar-user-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e 0%, #164e63 100%);
  border: 1px solid rgba(103, 232, 215, .34);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.sidebar-user-info {
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--accent);
}

.sidebar-logout {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-xs);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .3px;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
  white-space: nowrap;
}

.sidebar-logout:hover {
  color: var(--red);
  background: var(--red-bg);
  border-color: rgba(251, 113, 133, .22);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */

.login-body {
  display: grid;
  place-items: center;
  min-height: 100vh;
  grid-template-columns: 1fr;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(20, 184, 166, .13), transparent),
    var(--bg);
}

.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 24px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* Logo — reusar las clases de sidebar-logo */
.login-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.login-logo .logo-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
}

.login-logo .logo-name strong {
  font-size: 24px;
}

/* Card */
.login-card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.2px;
}

/* Error banner */
.login-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--red-bg);
  border: 1px solid rgba(251, 113, 133, .28);
  border-radius: var(--radius-sm);
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
}

/* Form */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.login-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-sm);
}

.login-input-wrap {
  position: relative;
}

.login-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.login-input-wrap .login-input {
  padding-right: 42px;
}

.login-input::placeholder {
  color: var(--text-xs);
}

.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 184, 166, .15);
}

.login-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-xs);
  cursor: pointer;
  padding: 4px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: color .15s;
}

.login-eye:hover {
  color: var(--text-sm);
}

/* Submit button */
.login-btn {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 20px;
  background: var(--accent);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(20, 184, 166, .28);
}

.login-btn:hover {
  background: var(--accent-h);
  box-shadow: 0 6px 22px rgba(20, 184, 166, .38);
}

.login-btn:active {
  transform: scale(.98);
}

.login-footer {
  color: var(--text-xs);
  font-size: 11px;
  letter-spacing: .4px;
  text-transform: uppercase;
}

@media (max-width: 440px) {
  .login-card {
    padding: 24px 18px;
  }
}

/* ============================================================
   USER MANAGEMENT PAGE
   ============================================================ */

.user-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 14px;
  align-items: flex-end;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--text-xs);
}

.field-input,
.field-select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color .16s;
  width: 100%;
}

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

.field-input::placeholder {
  color: var(--text-xs);
}

.badge-admin {
  background: rgba(20, 184, 166, .14);
  border: 1px solid rgba(20, 184, 166, .35);
  color: var(--accent-h);
}

.badge-viewer {
  background: rgba(96, 165, 250, .12);
  border: 1px solid rgba(96, 165, 250, .3);
  color: var(--blue);
}

@media (max-width: 760px) {
  .user-form-grid {
    grid-template-columns: 1fr;
  }
}

/* Decision execution and proposal prep */
.decision-execution-row td {
  background: color-mix(in srgb, var(--panel) 92%, var(--accent) 8%);
  border-top: 0;
}
.execution-panel {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
}
.execution-head,
.execution-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.execution-head p,
.execution-foot span {
  margin: 4px 0 0;
  color: var(--text-xs);
  font-size: 12px;
}
.execution-form {
  margin-top: 12px;
}
.execution-grid {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(220px, 1fr) minmax(220px, 1.2fr);
  gap: 10px;
}
.execution-grid label {
  display: grid;
  gap: 5px;
  color: var(--text-xs);
  font-size: 12px;
}
.execution-grid select,
.execution-grid input,
.participant-row input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 7px 9px;
}
.participant-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.participant-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 0.5fr) 90px;
  gap: 8px;
  align-items: center;
}
.participant-row span {
  color: var(--text-sm);
  font-weight: 600;
}
.proposal-prep-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
  color: var(--text-sm);
  background: var(--panel-soft);
}
.proposal-prep-status.status-ready_for_review {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 45%, var(--border));
}
.proposal-prep-status.status-ready {
  color: var(--green);
  border-color: color-mix(in srgb, var(--green) 45%, var(--border));
}
.proposal-prep-status.status-needs_user_data,
.proposal-prep-status.status-preparing_formats,
.proposal-prep-status.status-attention {
  color: var(--yellow);
  border-color: color-mix(in srgb, var(--yellow) 45%, var(--border));
}
.proposal-prep-status.status-failed,
.proposal-prep-status.status-discarded,
.proposal-prep-status.status-blocked,
.proposal-prep-status.status-invalidated {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 45%, var(--border));
}
@media (max-width: 900px) {
  .execution-head,
  .execution-foot {
    align-items: stretch;
    flex-direction: column;
  }
  .execution-grid,
  .participant-row {
    grid-template-columns: 1fr;
  }
}

/* Proposal prep module */
.prep-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, .025), rgba(255, 255, 255, 0)), var(--card);
  box-shadow: var(--shadow-soft);
}
.prep-module-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}
.prep-module-head p,
.prep-alert span {
  margin: 0;
  color: var(--text-xs);
  font-size: 12px;
  line-height: 1.45;
}
.prep-alert {
  display: grid;
  gap: 6px;
  border-color: color-mix(in srgb, var(--yellow) 36%, var(--border));
}
.prep-table .process-name-cell {
  min-width: 260px;
}
.prep-table {
  min-width: 1320px;
}
.prep-table th:nth-child(1) { width: 22%; }
.prep-table th:nth-child(2) { width: 9%; }
.prep-table th:nth-child(3) { width: 8%; }
.prep-table th:nth-child(4) { width: 15%; }
.prep-table th:nth-child(5) { width: 8%; }
.prep-table th:nth-child(6) { width: 9%; }
.prep-table th:nth-child(7) { width: 14%; }
.prep-table th:nth-child(8) { width: 8%; }
.prep-table th:nth-child(9) { width: 7%; }
.prep-actions {
  min-width: 180px;
}
.prep-actions form {
  display: inline-flex;
  margin: 0 6px 6px 0;
}
.prep-actions .btn {
  margin: 0 6px 6px 0;
}
.no-rejection-details {
  margin-top: 6px;
  color: var(--text-xs);
  font-size: 11px;
}
.no-rejection-details summary {
  cursor: pointer;
  font-weight: 800;
  text-transform: uppercase;
}
.no-rejection-details ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding-left: 14px;
}
.no-rejection-details li {
  line-height: 1.35;
}
.no-rejection-details span {
  display: block;
  margin-top: 2px;
}
.prep-empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 18px;
  color: var(--text-sm);
}
.prep-empty span {
  color: var(--text-xs);
}
@media (max-width: 900px) {
  .prep-hero,
  .prep-module-head {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Company legal profiles */
.company-profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}
.company-profile-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.company-profile-head,
.company-profile-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.company-profile-missing {
  margin: 10px 0 12px;
  color: var(--yellow);
  font-size: 12px;
  line-height: 1.45;
}
.company-profile-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.company-profile-form label {
  display: grid;
  gap: 5px;
  color: var(--text-xs);
  font-size: 12px;
}
.company-profile-form input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 7px 9px;
}
.company-profile-actions {
  margin-top: 14px;
  color: var(--text-xs);
  font-size: 12px;
}
@media (max-width: 760px) {
  .company-profile-grid,
  .company-profile-form {
    grid-template-columns: 1fr;
  }
}

/* ---- Flow actions row inside table ---- */
.flow-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.flow-sep {
  color: var(--border);
  font-size: 12px;
  flex-shrink: 0;
  padding: 0 1px;
}

/* ---- Process flow navigation strip ---- */
.process-flow-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--card2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  flex-wrap: wrap;
}
.pf-step {
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}
.pf-active {
  background: var(--accent-h);
  color: #fff;
  font-weight: 700;
}
.pf-link {
  color: var(--text-xs);
  text-decoration: none;
  border: 1px solid var(--border);
  transition: border-color .15s, color .15s;
}
.pf-link:hover {
  color: var(--accent-h);
  border-color: var(--accent-h);
}
.pf-arrow {
  color: var(--border);
  font-size: 14px;
  flex-shrink: 0;
}

/* ---- Company document upload section ---- */
.company-docs-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.company-docs-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-xs);
  margin-bottom: 4px;
}
.company-docs-subtitle {
  font-size: 12px;
  color: var(--text-xs);
  margin-bottom: 14px;
  line-height: 1.5;
}
.company-docs-group {
  margin-bottom: 12px;
}
.company-docs-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-xs);
  margin-bottom: 5px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--border);
}
.company-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.company-doc-row:last-child { border-bottom: none; }
.company-doc-info {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.company-doc-status-icon {
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}
.doc-uploaded .company-doc-status-icon { color: var(--green); }
.doc-missing  .company-doc-status-icon { color: var(--border); }
.doc-expired  .company-doc-status-icon { color: #c0392b; }
.doc-expiring .company-doc-status-icon { color: #d68910; }
.doc-expired  { background: rgba(192, 57, 43, 0.06); }
.doc-expiring { background: rgba(214, 137, 16, 0.05); }
.doc-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  margin-left: 2px;
}
.doc-badge-valid    { background: #e6f4ea; color: #1e6e3a; }
.doc-badge-expiring { background: #fef3cd; color: #8a5a00; }
.doc-badge-expired  { background: #f9d6d4; color: #8a1f15; }
.doc-badge-permanent{ background: #e3e7ee; color: #3b4a63; }
.company-doc-meta {
  white-space: normal !important;
  max-width: none !important;
}
.company-doc-label {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
.doc-uploaded .company-doc-label { font-weight: 500; }
.company-doc-meta {
  font-size: 11px;
  color: var(--text-xs);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.company-doc-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.company-doc-upload-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.company-doc-upload-zone {
  cursor: pointer;
  margin: 0;
  gap: 5px;
}
.company-doc-upload-zone.is-dragover,
.company-doc-upload-zone.is-uploading {
  border-color: rgba(103, 232, 215, .6);
  background: rgba(20, 184, 166, .12);
  color: #ffffff;
}
.company-upload-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 106px;
}
.company-upload-progress[hidden] {
  display: none;
}
.company-upload-progress-track {
  width: 70px;
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--border);
}
.company-upload-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  transition: width .18s ease;
}
.company-upload-progress-text,
.company-upload-message {
  color: var(--text-xs);
  font-size: 11px;
  line-height: 1.2;
}
.company-upload-message {
  max-width: 180px;
  overflow-wrap: anywhere;
}
.btn-xs {
  font-size: 11px;
  padding: 3px 9px;
  min-height: 26px;
}
.company-docs-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 12px;
  background: var(--card2);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-xs);
}
.company-docs-bar {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.company-docs-bar-fill {
  height: 5px;
  background: var(--green);
  border-radius: 3px;
  transition: width .3s;
}
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─────────────────────────────────────────────────────────────────────────
   Evaluación cuantitativa por proponente (opportunity_detail)
   ───────────────────────────────────────────────────────────────────────── */
.eval-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-xs);
  margin-bottom: 4px;
}
.eval-input {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.eval-input:focus {
  outline: none;
  border-color: var(--accent-h);
  box-shadow: 0 0 0 1px rgba(103, 232, 215, .25);
}
.eval-selector { border-color: rgba(96, 165, 250, .25); }

.cons-row {
  display: grid;
  grid-template-columns: 1fr 90px auto auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.cons-pct-suffix {
  font-size: 11px;
  color: var(--text-xs);
}

.eval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.eval-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-soft);
}
.eval-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-sm);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.eval-card-body {
  font-size: 12px;
  color: var(--text);
}
.eval-empty {
  font-size: 12px;
  font-style: italic;
  color: var(--text-xs);
  padding: 4px 0;
}
.eval-error {
  font-size: 12px;
  color: var(--red);
  padding: 6px 8px;
  background: rgba(251, 113, 133, .08);
  border: 1px solid rgba(251, 113, 133, .25);
  border-radius: var(--radius-sm);
}

/* Verdict badges */
.eval-verdict {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.eval-verdict[data-empty] {
  background: var(--surface-2);
  color: var(--text-xs);
}
.eval-verdict-ok      { background: rgba(74, 222, 128, .15); color: var(--green); }
.eval-verdict-fail    { background: rgba(251, 113, 133, .15); color: var(--red); }
.eval-verdict-warn    { background: rgba(251, 191, 36, .15); color: var(--yellow); }
.eval-verdict-neutral { background: var(--surface-2); color: var(--text-xs); }

/* Tablas compactas dentro de cards */
.eval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin: 6px 0;
}
.eval-table th,
.eval-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.eval-table th {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-xs);
  background: var(--surface-2);
}
.eval-table td { color: var(--text); }

.eval-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 9px;
  letter-spacing: .3px;
}
.eval-pill-ok      { background: rgba(74, 222, 128, .12); color: var(--green); }
.eval-pill-fail    { background: rgba(251, 113, 133, .12); color: var(--red); }
.eval-pill-warn    { background: rgba(251, 191, 36, .12); color: var(--yellow); }
.eval-pill-neutral { background: var(--surface-2); color: var(--text-xs); }

.eval-stat-line {
  font-size: 12px;
  color: var(--text);
  margin: 6px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

/* Score projection */
.score-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.score-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
.score-pct {
  font-size: 12px;
  color: var(--text-xs);
}
.score-bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.score-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}
.score-bar-ok   { background: var(--green); }
.score-bar-warn { background: var(--yellow); }
.score-bar-fail { background: var(--red); }

/* Subtabla consorcio */
.eval-sub {
  margin-top: 8px;
  border-top: 1px dashed var(--border);
  padding-top: 6px;
}
.eval-sub > summary {
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-xs);
  padding: 4px 0;
  list-style: none;
}
.eval-sub > summary::before { content: '▸ '; }
.eval-sub[open] > summary::before { content: '▾ '; }
.eval-sub-block {
  padding: 6px 8px;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.eval-sub-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.eval-sub-pct {
  font-size: 10px;
  color: var(--accent-h);
  margin-left: 4px;
}

/* Botón disabled (PDF comparación sin proponente) */
.eval-disabled {
  opacity: .45;
  pointer-events: none;
  cursor: not-allowed;
}

/* ============ Secciones cuantitativas de perfil empresa ============ */
.company-quant-section {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
}
.company-quant-section .company-docs-title {
  margin: 0 0 4px;
}
.company-quant-section .company-docs-subtitle {
  margin-bottom: 10px;
}
.indicator-empty {
  font-size: 12.5px;
  color: var(--muted, #97968b);
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,.015);
}
.indicator-empty.err {
  border-color: #8a1f15;
  color: #f9d6d4;
  background: rgba(192, 57, 43, .08);
}
.quant-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin: 6px 0 4px;
}
.quant-table th,
.quant-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.quant-table thead th {
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted, #97968b);
  background: rgba(255,255,255,.02);
}
.quant-table tbody tr:last-child td { border-bottom: none; }
.quant-sub {
  font-size: 11px;
  color: var(--muted, #97968b);
  margin-top: 2px;
}
.quant-meta {
  font-size: 11.5px;
  color: var(--muted, #97968b);
  margin-top: 4px;
}

/* Forms colapsables */
.collapsible-form {
  margin-top: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,.015);
}
.collapsible-form > summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent-h, #67e8d7);
  list-style: none;
  user-select: none;
}
.collapsible-form > summary::-webkit-details-marker { display: none; }
.collapsible-form[open] > summary {
  border-bottom: 1px solid var(--border);
}
.quant-form {
  padding: 12px;
}
.quant-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px 12px;
}
.quant-form-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  color: var(--muted, #97968b);
}
.quant-form-grid label.quant-span-2 {
  grid-column: span 2;
}
.quant-form-grid input {
  padding: 5px 8px;
  border: 1px solid var(--border);
  background: var(--card2, #24241f);
  color: inherit;
  border-radius: 4px;
  font-size: 12.5px;
}
.quant-form-grid input:focus {
  outline: none;
  border-color: var(--accent, #14b8a6);
}
.quant-form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
.indicator-message {
  font-size: 12px;
  color: var(--muted, #97968b);
}
.indicator-message.msg-ok  { color: var(--green, #4ade80); }
.indicator-message.msg-err { color: #f9a8a0; }

/* Tabla de personal: celda CV */
.person-cv-cell {
  white-space: nowrap;
}
.person-cv-form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}
.person-cv-msg {
  font-size: 11px;
}

@media (max-width: 720px) {
  .quant-form-grid label.quant-span-2 { grid-column: span 1; }
  .quant-table { font-size: 11.5px; }
  .quant-table th, .quant-table td { padding: 5px 6px; }
}
