:root {
  --color-primary-950: #210844;
  --color-primary-900: #2e1065;
  --color-primary-800: #4c1d95;
  --color-primary-700: #6d28d9;
  --color-primary-600: #7c3aed;
  --color-primary-500: #8b5cf6;
  --color-primary-100: #ede9fe;
  --color-primary-050: #f5f3ff;
  --color-bg: #f7f3ff;
  --color-bg-strong: #dfd6f4;
  --color-surface: #ffffff;
  --color-surface-soft: #fbfaff;
  --color-surface-warm: #fefcff;
  --color-border: #ddd6fe;
  --color-border-strong: #a78bfa;
  --color-text: #1f1633;
  --color-text-muted: #6b5f80;
  --color-success: #047857;
  --color-success-bg: #ecfdf5;
  --color-warning: #b45309;
  --color-warning-bg: #fffbeb;
  --color-danger: #b91c1c;
  --color-danger-bg: #fef2f2;
  --color-info: #2563eb;
  --color-info-bg: #eff6ff;
  --color-neutral: #475569;
  --color-neutral-bg: #f8fafc;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 999px;
  --shadow-low: 0 8px 18px rgba(46, 16, 101, 0.08);
  --shadow-medium: 0 16px 34px rgba(46, 16, 101, 0.14);
  --shadow-focus: 0 0 0 3px rgba(124, 58, 237, 0.18);
  --text-xs: 0.72rem;
  --text-sm: 0.82rem;
  --text-base: 0.92rem;
  --text-md: 1rem;
  --text-lg: 1.18rem;
  --text-xl: 1.45rem;
  --motion-fast: 120ms;
  --motion-base: 160ms;
  --motion-slow: 220ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --bg-a: var(--color-bg);
  --bg-b: var(--color-bg-strong);
  --surface: var(--color-surface);
  --surface-soft: var(--color-primary-050);
  --ink: var(--color-text);
  --ink-soft: var(--color-text-muted);
  --line: var(--color-border);
  --line-strong: var(--color-border-strong);
  --border: var(--color-border);
  --brand: var(--color-primary-800);
  --brand-soft: var(--color-primary-100);
  --accent: var(--color-primary-600);
  --warn: var(--color-warning);
  --danger: var(--color-danger);
  --muted: var(--color-text-muted);
  --shadow-soft: var(--shadow-low);
  --shadow-hard: var(--shadow-medium);
  --font-main: "IBM Plex Sans", "Source Sans 3", "Trebuchet MS", sans-serif;
  --font-title: "Space Grotesk", "Aptos", "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

body {
  color: var(--ink);
  font-family: var(--font-main);
  overflow-x: clip;
  background:
    radial-gradient(circle at 14% 10%, #fcf8ff 0, transparent 40%),
    radial-gradient(circle at 82% 2%, #efe7ff 0, transparent 35%),
    linear-gradient(165deg, var(--bg-a), var(--bg-b));
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 204px minmax(0, 1fr);
  min-width: 0;
  max-width: 100%;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fbf8ff, #eee6ff);
  padding: 0.7rem;
  position: sticky;
  top: 0;
  height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  z-index: 30;
}

.nav-close,
.nav-toggle,
.sidebar-backdrop {
  display: none;
}

.brand {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem;
  background: #fdfaff;
}

.brand h1 {
  font-family: var(--font-title);
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  margin: 0;
}

.brand p {
  margin: 0.35rem 0 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  margin-top: 0.62rem;
}

.nav-item {
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #452f7a;
  padding: 0.38rem 0.52rem;
  font-weight: 750;
  font-size: 0.82rem;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.nav-item:hover {
  background: #eee5ff;
  border-color: #d8c1ff;
}

.nav-item.is-active {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  border-color: #7c3aed;
  color: #fff;
  box-shadow: var(--shadow-soft);
  transform: translateX(2px);
}

.nav-item-secondary {
  font-size: 0.76rem;
  font-weight: 650;
  margin-left: 0.35rem;
  opacity: 0.76;
  padding-block: 0.28rem;
}

.nav-item-secondary::before {
  content: "· ";
}

.workspace {
  padding: 0.58rem 0.72rem 0.9rem;
  min-width: 0;
  max-width: 100%;
}

main {
  min-width: 0;
  max-width: 100%;
}

.workspace-header {
  margin-bottom: 0.48rem;
  padding: 0.38rem 0.52rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #fefcff, #f4ecff);
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.workspace-header .header-main {
  min-width: 0;
  max-width: 100%;
}

.workspace-header .header-main > * {
  min-width: 0;
}

.workspace-header .crumb {
  display: none;
}

.workspace-header h2 {
  font-family: var(--font-title);
  margin: 0.08rem 0 0;
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.header-status-pill {
  border: 1px solid #b395e6;
  border-radius: 999px;
  background: #f1e7ff;
  color: #4e2f84;
  padding: 0.3rem 0.48rem;
  font-size: 0.72rem;
  white-space: nowrap;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.view {
  display: none;
  grid-template-columns: 1fr;
  gap: 0.95rem;
  min-width: 0;
  max-width: 100%;
}

.view.is-visible {
  display: grid;
}

.hero-card,
.module-intro {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(130deg, #fefcff, #efe6ff);
  box-shadow: var(--shadow-soft);
  padding: 0.68rem;
  min-width: 0;
  max-width: 100%;
}

.hero-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.8rem;
}

.hero-card h3,
.module-intro h3 {
  margin: 0.12rem 0 0.22rem;
  font-family: var(--font-title);
  font-size: 1.18rem;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: #5a3a92;
  font-weight: 700;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.68rem;
  box-shadow: var(--shadow-soft);
  transition:
    border-color var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
  min-width: 0;
  max-width: 100%;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(66, 38, 120, 0.16);
  border-color: #bca4e8;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.45rem;
  font-family: var(--font-title);
  font-size: 1.02rem;
}

.card h4 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 0.95rem;
}

.section-description {
  margin: 0 0 0.35rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}

.metric-tag {
  border: 1px solid var(--line);
  background: #f4ecff;
  border-radius: 999px;
  padding: 0.32rem 0.56rem;
  font-size: 0.78rem;
  color: #48287f;
}

.panel-module {
  background: linear-gradient(180deg, #ffffff, #f8fbf8);
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.75rem;
}

.kpi-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem;
  background: #f7fcf9;
}

.kpi-card p {
  margin: 0;
  color: #496255;
  font-size: 0.78rem;
}

.kpi-card strong {
  display: block;
  margin-top: 0.3rem;
  font-size: 1.28rem;
  font-family: var(--font-title);
}

.kpi-card.highlight {
  border-color: #8dc2a8;
  background: linear-gradient(145deg, #e6f6ea, #d4eddd);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.75rem;
}

.pipeline-head {
  align-items: center;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.pipeline-head h3 {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: clamp(1.45rem, 2.4vw, 2.2rem);
  margin: 0;
}

.pipeline-head p {
  color: var(--color-text-muted);
  font-size: 0.98rem;
  font-weight: 750;
  margin: 0.2rem 0 0;
}

.pipeline-actions,
.pipeline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
}

.pipeline-actions button,
.pipeline-tabs button,
.pipeline-card-footer button {
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 850;
}

.pipeline-kpis {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.8rem;
}

.pipeline-kpis article {
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
  display: grid;
  gap: 0.18rem;
  padding: 0.78rem;
}

.pipeline-kpis span {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--text-xs);
  font-weight: 900;
  text-transform: uppercase;
}

.pipeline-kpis strong {
  color: var(--color-primary-900);
  display: block;
  font-family: var(--font-title);
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1;
  margin-top: 0.2rem;
}

.pipeline-tabs {
  justify-content: flex-start;
  margin-top: 0.85rem;
}

.pipeline-tabs button {
  align-items: center;
  background: #fff;
  border-color: var(--color-border);
  color: var(--color-primary-800);
  display: inline-flex;
  gap: 0.48rem;
  justify-content: space-between;
  min-height: 42px;
  padding: 0.52rem 0.72rem;
}

.pipeline-tabs button b {
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  display: inline-flex;
  font-size: 0.82rem;
  justify-content: center;
  min-width: 1.7rem;
  padding: 0.08rem 0.42rem;
}

.pipeline-tabs button.is-active {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  border-color: #7c3aed;
  color: #fff;
}

.pipeline-tabs .pipeline-tab--pilotos { border-color: #7c3aed; background: #f3e8ff; color: #4c1d95; }
.pipeline-tabs .pipeline-tab--proceso { border-color: #818cf8; background: #eef2ff; color: #3730a3; }
.pipeline-tabs .pipeline-tab--proximas { border-color: #c4b5fd; background: #f5f3ff; color: #5b21b6; }
.pipeline-tabs .pipeline-tab--pendientes { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
.pipeline-tabs .pipeline-tab--campana { border-color: #38bdf8; background: #f0f9ff; color: #075985; }
.pipeline-tabs .pipeline-tab--desarrollo { border-color: #f472b6; background: #fdf2f8; color: #9d174d; }
.pipeline-tabs .pipeline-tab--bloqueadas { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }
.pipeline-tabs .pipeline-tab--archivadas { border-color: #cbd5e1; background: #f8fafc; color: #475569; }
.pipeline-tabs .pipeline-tab--costear { border-color: #86efac; background: #f0fdf4; color: #166534; }
.pipeline-tabs .pipeline-tab--vender { border-color: #34d399; background: #ecfdf5; color: #065f46; }
.pipeline-tabs .pipeline-tab--todo { border-color: #94a3b8; background: #f8fafc; color: #334155; }

.pipeline-tabs .pipeline-tab--pilotos.is-active { background: linear-gradient(135deg, #5b21b6, #7c3aed); }
.pipeline-tabs .pipeline-tab--proceso.is-active { background: linear-gradient(135deg, #3730a3, #6366f1); }
.pipeline-tabs .pipeline-tab--proximas.is-active { background: linear-gradient(135deg, #4c1d95, #8b5cf6); }
.pipeline-tabs .pipeline-tab--pendientes.is-active { background: linear-gradient(135deg, #92400e, #f59e0b); }
.pipeline-tabs .pipeline-tab--campana.is-active { background: linear-gradient(135deg, #075985, #0ea5e9); }
.pipeline-tabs .pipeline-tab--desarrollo.is-active { background: linear-gradient(135deg, #9d174d, #ec4899); }
.pipeline-tabs .pipeline-tab--bloqueadas.is-active { background: linear-gradient(135deg, #991b1b, #ef4444); }
.pipeline-tabs .pipeline-tab--archivadas.is-active { background: linear-gradient(135deg, #334155, #64748b); }
.pipeline-tabs .pipeline-tab--costear.is-active { background: linear-gradient(135deg, #166534, #22c55e); }
.pipeline-tabs .pipeline-tab--vender.is-active { background: linear-gradient(135deg, #065f46, #10b981); }
.pipeline-tabs .pipeline-tab--todo.is-active { background: linear-gradient(135deg, #1e293b, #475569); }

.pipeline-board {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 0.85rem;
}

.pipeline-card {
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  overflow: hidden;
}

.pipeline-card-media {
  background: linear-gradient(180deg, var(--color-primary-050), #fff);
  border-right: 1px solid var(--color-border);
  min-height: 150px;
}

.pipeline-card-media img,
.pipeline-image-fallback {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.pipeline-image-fallback {
  align-items: center;
  color: var(--color-text-muted);
  display: flex;
  font-size: 0.86rem;
  font-weight: 850;
  justify-content: center;
  text-align: center;
}

.pipeline-card-body {
  display: grid;
  gap: 0.38rem;
  padding: 0.72rem;
}

.pipeline-code {
  color: var(--color-primary-700);
  font-size: 0.78rem;
  font-weight: 900;
  margin: 0;
  text-transform: uppercase;
}

.pipeline-card h4 {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: 1.08rem;
  line-height: 1.12;
  margin: 0;
}

.pipeline-state {
  align-items: center;
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-primary-800);
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.25;
  padding: 0.18rem 0.48rem;
  text-transform: uppercase;
  width: fit-content;
}

.pipeline-badges,
.pipeline-finance {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
}

.pipeline-badges span,
.pipeline-finance span {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: var(--radius-pill);
  color: var(--color-primary-800);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.16rem 0.44rem;
}

.pipeline-finance span {
  background: #ecfdf5;
  border-color: #86efac;
  color: #065f46;
}

.pipeline-progress-line {
  align-items: center;
  display: grid;
  gap: 0.42rem;
  grid-template-columns: auto minmax(0, 1fr);
}

.pipeline-progress-line strong {
  color: var(--color-primary-900);
  font-size: 1.25rem;
}

.pipeline-blocker,
.pipeline-next {
  font-size: 0.88rem;
  font-weight: 850;
  line-height: 1.28;
  margin: 0;
}

.pipeline-blocker {
  color: var(--color-warning);
}

.pipeline-next {
  color: var(--color-text-muted);
}

.pipeline-owner {
  color: var(--color-primary-800);
  font-size: 0.82rem;
  font-weight: 850;
  margin: 0;
}

.pipeline-card-footer {
  align-items: center;
  border-top: 1px solid rgba(221, 214, 254, 0.72);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-top: 0.28rem;
  padding-top: 0.5rem;
}

.card-quick-actions,
.actions-mini {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.card-quick-actions button,
.actions-mini button,
.card-more-actions summary {
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 850;
  min-height: 34px;
  padding: 0.34rem 0.5rem;
}

.card-action-primary {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  border-color: #7c3aed;
  color: #fff;
}

.card-more-actions {
  position: relative;
}

.card-more-actions summary {
  border: 1px solid var(--color-border);
  cursor: pointer;
  list-style: none;
}

.card-more-actions summary::-webkit-details-marker {
  display: none;
}

.card-more-actions div {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 28px rgba(46, 16, 101, 0.14);
  display: grid;
  gap: 0.28rem;
  min-width: 120px;
  padding: 0.38rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.28rem);
  z-index: 20;
}

.card-more-trigger[aria-expanded="true"],
.catalog-card.is-menu-open .card-more-trigger {
  border-color: var(--color-primary-400);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.catalog-card.is-menu-open {
  position: relative;
  z-index: 25;
}

.catalog-card-more-menu {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.62);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
  display: grid;
  gap: 0.3rem;
  min-width: 144px;
  padding: 0.38rem;
  position: fixed;
  z-index: 9999;
}

.catalog-card-more-menu button {
  justify-content: flex-start;
  min-height: 34px;
  width: 100%;
}

.catalog-card-more-menu .btn-danger {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #be123c;
}

.catalog-card-more-menu .btn-danger:hover {
  background: #ffe4e6;
}

.pipeline-card-footer small {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.pipeline-card--bloqueadas {
  border-color: rgba(185, 28, 28, 0.34);
}

.pipeline-card--costear,
.pipeline-card--vender {
  border-color: rgba(4, 120, 87, 0.28);
}

.pipeline-empty {
  grid-column: 1 / -1;
}

.pipeline-quick-modal {
  align-items: center;
  background: rgba(31, 22, 51, 0.42);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 1rem;
  position: fixed;
  z-index: 60;
}

.pipeline-quick-dialog {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(31, 22, 51, 0.24);
  max-width: 560px;
  padding: 0.85rem;
  width: min(100%, 560px);
}

.finance-access-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.48);
}

.finance-access-modal[hidden] {
  display: none;
}

.finance-access-dialog {
  width: min(420px, calc(100vw - 2rem));
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(31, 22, 51, 0.24);
  padding: 1.25rem;
}

.finance-access-dialog h3 {
  margin: 0.2rem 0 0.35rem;
}

.finance-access-dialog label {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.85rem;
  font-weight: 700;
}

.finance-access-dialog input {
  width: 100%;
}

.finance-access-error {
  min-height: 1.2rem;
  margin: 0.55rem 0 0;
  color: var(--color-danger);
  font-weight: 700;
}

.finance-locked-panel {
  border: 1px dashed var(--color-border-strong);
  border-radius: 8px;
  padding: 1rem;
  background: #f8fafc;
}

.finance-locked-panel h4 {
  margin: 0 0 0.35rem;
}

.finance-locked-panel p {
  margin: 0 0 0.8rem;
}

.finance-lock-button {
  margin-top: 0.65rem;
}

.closing-costing-admin-panel {
  display: grid;
  gap: 1rem;
}

.technical-admin-action {
  display: flex;
  justify-content: flex-start;
  margin-top: 0.75rem;
}

.closing-cost-process-list {
  display: grid;
  gap: 0.75rem;
}

.closing-cost-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) repeat(4, minmax(120px, 1fr));
  gap: 0.75rem;
  align-items: end;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}

.closing-cost-row p {
  margin: 0;
}

.closing-cost-row p span {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

@media (max-width: 900px) {
  .closing-cost-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .closing-cost-row {
    grid-template-columns: 1fr;
  }
}

.nav-admin-item {
  margin-top: 0.55rem;
  border-color: #d7dce5;
  background: #f8fafc;
  color: #334155;
}

.nav-admin-item:hover {
  background: #eef2f7;
  border-color: #cbd5e1;
}

.nav-admin-item.is-admin-active {
  border-color: #8b5cf6;
  background: #f4f0ff;
  color: #4c1d95;
}

.pipeline-quick-head,
.pipeline-quick-actions {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}

.pipeline-quick-head h3 {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  margin: 0;
}

.pipeline-quick-form {
  display: grid;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.pipeline-quick-form label {
  color: var(--color-text-muted);
  display: grid;
  font-size: 0.82rem;
  font-weight: 850;
  gap: 0.25rem;
}

.pipeline-quick-form input,
.pipeline-quick-form select,
.pipeline-quick-form textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  min-height: 40px;
  padding: 0.42rem 0.5rem;
}

.pipeline-quick-actions {
  justify-content: flex-end;
  margin-top: 0.2rem;
}

.tile {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 0.78rem;
}

.tile-main {
  grid-column: span 5;
}

.tile-warning {
  grid-column: span 4;
  border-color: #d9b4a5;
  background: #fff8f5;
}

.tile-next {
  grid-column: span 3;
  border-color: #b9cfbf;
}

.tile h3 {
  margin: 0 0 0.42rem;
  font-size: 0.92rem;
}

.tile p,
.tile li {
  margin: 0.24rem 0;
  font-size: 0.84rem;
}

.tile ol,
.tile ul {
  margin: 0;
  padding-left: 1rem;
}

.sub-panel {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 0.75rem;
  margin-top: 0.8rem;
  background: var(--surface-soft);
  min-width: 0;
  max-width: 100%;
}

.sub-panel h3,
.sub-panel h4 {
  margin-top: 0;
  margin-bottom: 0.55rem;
}

.settings-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 0.9rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.settings-main {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  max-width: 100%;
}

.domain-card {
  background: linear-gradient(180deg, #ffffff, #f8f3ff);
}

.financial-domain {
  border-color: #c5afe9;
}

.settings-rail {
  position: sticky;
  top: 1rem;
}

.settings-rail ul {
  margin: 0 0 0.7rem;
  padding-left: 1rem;
}

.settings-rail li {
  margin: 0.32rem 0;
  font-size: 0.84rem;
}

.costing-workbench {
  display: grid;
  gap: 0.48rem;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

@media (min-width: 980px) {
  #view-costing .costing-workbench {
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    grid-auto-flow: row dense;
  }

  #view-costing .costing-summary-top {
    grid-column: 2;
    grid-row: 1;
  }

  #view-costing .costing-capture-top {
    grid-column: 1;
    grid-row: 1;
  }

  #view-costing .costing-secondary-panel {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

.costing-summary-top,
.costing-capture-top {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
  box-shadow: var(--shadow-low);
}

.costing-summary-top h4,
.costing-capture-top h4 {
  margin: 0 0 0.18rem;
  color: #4b2386;
}

.costing-secondary-panel {
  border: 1px solid #d0bced;
  border-radius: 10px;
  background: #f8f1ff;
}

.costing-secondary-panel > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.36rem 0.46rem;
  font-size: 0.79rem;
  color: #482782;
  font-weight: 700;
}

.costing-secondary-panel > summary::-webkit-details-marker {
  display: none;
}

.costing-secondary-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1fr);
  gap: 0.46rem;
  padding: 0 0.44rem 0.44rem;
  min-width: 0;
  max-width: 100%;
}

.costing-main {
  background: linear-gradient(180deg, #ffffff, #f8fcf9);
}

.costing-rail {
  position: relative;
}

.sticky-card {
  position: sticky;
  top: 1rem;
}

#view-costing .module-intro {
  border-color: #ccb8f0;
  background: linear-gradient(130deg, #f6f1ff, #ebe4fb);
}

#view-costing .module-intro h3,
#view-costing .costing-main h3 {
  color: #452186;
}

#view-costing .costing-main {
  border-color: #c8b4ef;
  background: linear-gradient(180deg, #ffffff, #f7f2ff);
  box-shadow: 0 12px 24px rgba(82, 39, 140, 0.1);
  padding: 0.56rem;
}

#view-costing .costing-main h3 {
  margin-bottom: 0.14rem;
}

#view-costing .module-intro {
  align-items: center;
  border-radius: 10px;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.38rem 0.5rem;
}

#view-costing .module-intro .section-description {
  margin: 0.08rem 0 0;
  max-width: 58ch;
}

#view-costing .costing-main .section-description {
  margin-bottom: 0.22rem;
  color: #5f4b8a;
}

#view-costing .costing-selector-panel,
#view-costing .costing-empty-state,
#view-costing .costing-selected-header,
#view-costing .costing-missing-panel,
#view-costing .costing-simple-summary {
  margin-bottom: 0.55rem;
  padding: 0.65rem;
}

#view-costing .costing-selector-head,
#view-costing .costing-selected-title,
#view-costing .costing-missing-head,
#view-costing .costing-simple-head,
#view-costing .costing-ready-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
}

#view-costing .costing-selector-head h4,
#view-costing .costing-selected-title h4,
#view-costing .costing-missing-head h4,
#view-costing .costing-simple-head h4 {
  margin: 0.1rem 0 0;
  font-size: 1rem;
  line-height: 1.15;
}

#view-costing .costing-mode-pill,
#view-costing .costing-status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7faf7;
  color: var(--ink-soft);
  font-weight: 800;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
}

#view-costing .costing-selector-controls {
  align-items: end;
  background: #f8faf8;
  border: 1px solid rgba(221, 214, 254, 0.82);
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(230px, 1.4fr) minmax(150px, 0.7fr) minmax(170px, 0.8fr) auto;
  margin: 0.52rem 0 0.58rem;
  padding: 0.5rem;
}

#view-costing .costing-selector-controls label {
  margin: 0;
  min-width: 0;
}

#view-costing .costing-reference-count {
  align-self: stretch;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  display: grid;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.25;
  max-width: 260px;
  min-width: 160px;
  padding: 0.48rem 0.55rem;
  place-items: center start;
}

#view-costing .costing-reference-list {
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  justify-content: stretch;
}

#view-costing .costing-reference-card {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  gap: 0.48rem;
  grid-template-columns: 44px minmax(0, 1fr);
  min-height: 0;
  padding: 0.56rem;
}

#view-costing .costing-reference-card.is-selected {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 2px rgba(35, 106, 74, 0.12);
}

#view-costing .costing-reference-thumb {
  align-self: start;
  aspect-ratio: 1;
  background: linear-gradient(145deg, #eff6ff, #f5f3ff);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--color-primary-800);
  display: grid;
  font-family: var(--font-title);
  font-size: 0.92rem;
  font-weight: 900;
  overflow: hidden;
  place-items: center;
  width: 44px;
}

#view-costing .costing-reference-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

#view-costing .costing-reference-main {
  min-width: 0;
}

#view-costing .costing-reference-title-row {
  align-items: center;
  display: flex;
  gap: 0.35rem;
  justify-content: space-between;
}

#view-costing .costing-reference-card h4,
#view-costing .costing-reference-card p {
  margin: 0;
}

#view-costing .costing-reference-card h4 {
  font-size: 0.94rem;
  line-height: 1.15;
  margin-top: 0.18rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#view-costing .costing-reference-alert {
  color: var(--color-warning);
  font-size: 0.73rem;
  font-weight: 820;
  line-height: 1.2;
  margin-top: 0.26rem !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#view-costing .costing-reference-card-side,
#view-costing .costing-selected-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  grid-column: 1 / -1;
  justify-content: space-between;
  min-width: 0;
}

#view-costing .costing-reference-card-side .btn {
  flex: 1 1 132px;
  min-height: 34px;
}

#view-costing .costing-snapshot-chip,
#view-costing .costing-status-badge {
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1;
  padding: 0.25rem 0.42rem;
  white-space: nowrap;
}

#view-costing .costing-snapshot-chip {
  background: var(--color-neutral-bg);
  border: 1px solid #dbe3ee;
  color: var(--color-neutral);
}

#view-costing .costing-status-badge {
  background: var(--color-neutral-bg);
  border: 1px solid #cbd5e1;
  color: var(--color-neutral);
}

#view-costing .costing-status-badge.status-pendiente-costos {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.24);
  color: var(--color-warning);
}

#view-costing .costing-status-badge.status-costeable {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.22);
  color: var(--color-success);
}

#view-costing .costing-status-badge.status-cotizada {
  background: var(--color-info-bg);
  border-color: rgba(37, 99, 235, 0.22);
  color: var(--color-info);
}

#view-costing .costing-status-badge.status-bloqueada {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.22);
  color: var(--color-danger);
}

#view-costing .costing-missing-grid,
#view-costing .costing-simple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.48rem;
  margin-top: 0.52rem;
}

#view-costing .costing-missing-grid article,
#view-costing .costing-simple-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 0.55rem;
}

#view-costing .costing-missing-grid h5,
#view-costing .costing-missing-grid p,
#view-costing .costing-missing-grid small {
  display: block;
  margin: 0 0 0.4rem;
}

#view-costing .costing-simple-grid span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
}

#view-costing .costing-simple-grid b {
  display: block;
  margin-top: 0.18rem;
  font-size: 1.02rem;
}

#view-costing .costing-simple-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.58rem;
}

#view-costing .costing-selected-workflow {
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1.04fr) minmax(280px, 0.96fr);
}

#view-costing .costing-selected-header {
  grid-column: 1 / -1;
}

#view-costing .costing-missing-panel {
  margin-right: 0.55rem;
}

#view-costing .costing-simple-actions button[disabled] {
  cursor: not-allowed;
  opacity: 0.58;
}

#view-costing .costing-advanced-shell {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin-top: 0.85rem;
  padding: 0.75rem;
}

#view-costing .costing-advanced-shell > summary {
  cursor: pointer;
  font-weight: 900;
}

#view-costing .reference-quick-form {
  margin: 0;
}

#view-costing .reference-quick-station {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  padding: 0.52rem;
}

#view-costing .reference-quick-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem;
}

#view-costing .reference-quick-grid .field-label {
  border-color: #ddcef7;
  padding: 0.18rem;
}

#view-costing .reference-quick-grid .field-label[data-field-key="referenceName"] {
  grid-column: 1 / -1;
}

#view-costing .reference-quick-grid input,
#view-costing .reference-quick-grid select,
#view-costing .reference-quick-grid textarea {
  border-color: var(--color-border);
  font-size: var(--text-sm);
  min-height: 40px;
  padding: 0.52rem 0.62rem;
}

#view-costing .costing-secondary-summary-card,
#view-costing .costing-advanced-card,
#view-costing .cost-motor-card {
  border-color: var(--color-border);
  background: linear-gradient(180deg, #fcf8ff, #f4edff);
}

#view-costing .costing-secondary-summary-card h4,
#view-costing .costing-advanced-card h4,
#view-costing .cost-motor-card h4 {
  margin: 0 0 0.2rem;
  color: #4b2386;
}

#view-costing .costing-advanced-card,
#view-costing .costing-secondary-summary-card {
  padding: 0.44rem;
}

#view-costing .costing-summary-top,
#view-costing .costing-capture-top {
  padding: 0.72rem;
}

#view-costing .costing-summary-top {
  background: linear-gradient(180deg, #fff, var(--color-info-bg));
}

#view-costing .costing-capture-top {
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
}

#view-costing .costing-summary-top > h4,
#view-costing .costing-capture-top > h4 {
  align-items: center;
  border-bottom: 1px solid rgba(221, 214, 254, 0.72);
  color: var(--color-primary-900);
  display: flex;
  font-size: 1rem;
  justify-content: space-between;
  margin: 0 0 0.62rem;
  padding-bottom: 0.42rem;
}

#view-costing .reference-advanced-section {
  margin-bottom: 0;
  border-color: #d7c8f6;
  background: #fcfaff;
  padding: 0.44rem;
}

#view-costing .reference-advanced-section summary {
  margin: -0.06rem -0.06rem 0.22rem;
  padding: 0.08rem 0.08rem 0.2rem;
  border-bottom: 1px dashed #ceb8f2;
}

#view-costing .reference-advanced-section .form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.36rem;
}

#view-costing .reference-advanced-section .field-label {
  border-color: #ddcef7;
  padding: 0.26rem;
}

#view-costing .reference-advanced-section textarea {
  min-height: 66px;
}

#view-costing .action-panel {
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fff, var(--color-primary-050));
  padding: 0.48rem;
  margin-top: 0.5rem;
}

#view-costing .action-panel .inline-fields {
  margin-top: 0;
  gap: 0.26rem;
}

#view-costing .calc-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 0.42rem;
}

#view-costing .calc-toolbar > .calc-more-actions {
  grid-column: 1 / -1;
}

#view-costing .formal-quote-panel {
  margin-top: 0.58rem;
}

#view-costing .formal-quote-controls,
#view-costing .formal-quote-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#view-costing .formal-quote-notes label {
  min-width: 0;
}

#view-costing .formal-quote-tiers {
  margin-top: 0.58rem;
}

#view-costing .formal-tier-card {
  min-width: 0;
}

#view-costing .calc-more-actions {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-primary-050);
  padding: 0.34rem 0.44rem;
  transition: border-color var(--motion-base) var(--ease-standard), box-shadow var(--motion-base) var(--ease-standard);
}

#view-costing .calc-more-actions:hover {
  border-color: var(--color-primary-600);
  box-shadow: var(--shadow-focus);
}

#view-costing .calc-more-actions summary {
  cursor: pointer;
  color: #4c278a;
  font-size: 0.76rem;
  font-weight: 600;
  list-style: none;
}

#view-costing .calc-more-actions summary::-webkit-details-marker {
  display: none;
}

#view-costing .calc-more-actions-body {
  margin-top: 0.16rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.18rem;
}

#view-costing .action-panel label {
  font-size: var(--text-sm);
  gap: 0.22rem;
}

#view-costing .action-panel select,
#view-costing .action-panel button {
  font-size: var(--text-sm);
  min-height: 40px;
  padding: 0.54rem 0.72rem;
}

#view-costing #calculate-reference {
  border-color: var(--color-primary-700);
  background: linear-gradient(135deg, var(--color-primary-800), var(--color-primary-600));
  color: #fff;
}

#view-costing #calculate-reference:hover {
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
}

#view-costing .costing-rail .sticky-card {
  border-color: #bda5ec;
  background: linear-gradient(180deg, #faf8ff, #f2ebff);
}

#view-technical .module-intro {
  border-color: #b8d5c3;
  background: linear-gradient(130deg, #f4fbf7, #e8f5ef);
}

#view-technical .module-intro h3 {
  color: #255740;
}

.technical-session-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 0.8rem;
  align-items: start;
  min-width: 0;
}

.technical-session-main {
  border-color: #b9d8c5;
  background: linear-gradient(180deg, #ffffff, #f3fbf6);
}

.technical-session-main h4,
.technical-session-rail h4 {
  color: #245a41;
  margin-bottom: 0.4rem;
}

.technical-session-controls {
  margin-top: 0;
  margin-bottom: 0.75rem;
  min-width: 0;
}

.technical-session-controls > label {
  flex: 1 1 300px;
  min-width: 0;
}

.technical-session-controls button {
  flex: 0 0 auto;
}

.technical-session-controls select,
.technical-session-controls input {
  width: 100%;
  min-width: 0;
}

#technical-session-form {
  display: grid;
  gap: 0.7rem;
}

.technical-top-summary {
  border-color: #c4dfcf;
  background: #f8fdf9;
}

.technical-summary-top-grid {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.7rem;
  align-items: center;
}

.technical-summary-thumb {
  width: 92px;
  height: 92px;
  border-radius: 10px;
  border: 1px solid #c4dfcf;
  background: #eef8f2;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.technical-summary-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.technical-summary-thumb-fallback {
  font-size: 0.72rem;
  color: #3a6a50;
  text-align: center;
  padding: 0.35rem;
}

.technical-summary-code {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  color: #3f6b54;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.technical-summary-head h4 {
  margin: 0.12rem 0 0.3rem;
  overflow-wrap: anywhere;
}

.technical-summary-head {
  min-width: 0;
}

.technical-save-toolbar {
  border: 1px solid #c4dfcf;
  border-radius: 10px;
  background: #f8fdf9;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0.35rem;
  z-index: 3;
}

.technical-save-status {
  font-size: 0.78rem;
  color: #2f5d46;
}

.technical-save-actions {
  margin-top: 0;
}

.technical-tab-helper {
  margin: 0 0 0.45rem;
  font-size: 0.76rem;
  color: #2f5f48;
}

.technical-inline-alert {
  border: 1px solid #e0c28f;
  background: #fff9ee;
  border-radius: 8px;
  padding: 0.42rem 0.5rem;
  margin-bottom: 0.55rem;
}

.technical-inline-alert b {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
}

.technical-inline-alert ul {
  margin: 0;
  padding-left: 1rem;
}

.technical-inline-summary {
  border: 1px solid #c4dfcf;
  background: #eef8f2;
  border-radius: 8px;
  padding: 0.42rem 0.5rem;
  margin-bottom: 0.55rem;
}

.technical-inline-summary p {
  margin: 0.18rem 0;
  font-size: 0.78rem;
}

#technical-summary-panel p {
  margin: 0.32rem 0;
}

#technical-image-preview {
  min-height: 120px;
}

.image-gallery-panel {
  display: grid;
  gap: 0.72rem;
}

.image-gallery-panel--compact {
  gap: 0.52rem;
}

.image-gallery-compact-summary {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-low);
  display: grid;
  gap: 0.62rem;
  padding: 0.62rem;
}

.image-gallery-compact-primary {
  align-items: center;
  display: grid;
  gap: 0.58rem;
  grid-template-columns: 76px minmax(0, 1fr);
  min-width: 0;
}

.image-gallery-compact-primary .image-gallery-primary-thumb,
.image-gallery-compact-primary .image-gallery-empty {
  min-height: 64px;
  width: 76px;
}

.image-gallery-compact-primary strong,
.image-gallery-compact-primary span {
  display: block;
  overflow-wrap: anywhere;
}

.image-gallery-compact-primary strong {
  color: var(--color-primary-900);
  font-size: 0.86rem;
}

.image-gallery-compact-primary span {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 800;
  margin-top: 0.12rem;
}

.image-gallery-counts {
  display: grid;
  gap: 0.32rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-gallery-counts span {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 850;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 0.34rem 0.42rem;
}

.image-gallery-counts b {
  color: var(--color-primary-900);
}

.image-gallery-compact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
}

.image-manager-shell {
  inset: 0;
  position: fixed;
  z-index: 150;
}

/* Simple reference version history */
#view-technical .technical-current-version {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(34, 91, 82, 0.16);
  border-radius: 8px;
  background: rgba(232, 246, 241, 0.72);
  color: #263b37;
  font-size: 0.92rem;
}

#view-technical .technical-current-version span {
  color: #66756f;
  font-weight: 700;
}

#view-technical .technical-current-version strong {
  color: #163d35;
  font-size: 0.94rem;
}

#view-technical .technical-change-version-field {
  max-width: 18rem;
}

#view-technical .technical-change-route-field,
#view-technical .technical-change-field-block {
  grid-column: 1 / -1;
}

#view-technical .technical-change-field-block {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

#view-technical .technical-change-field-block > span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

#view-technical .technical-change-search-row {
  display: grid;
  gap: 0.35rem;
  margin: 0.9rem 0 0.7rem;
}

#view-technical .technical-change-search-row span {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

#view-technical .technical-change-table-wrap {
  display: none;
}

#view-technical .technical-change-list.technical-change-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}

#view-technical .technical-version-card {
  border: 1px solid rgba(27, 40, 51, 0.12);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(21, 31, 44, 0.07);
}

#view-technical .technical-version-card.is-current-version {
  border-color: rgba(34, 91, 82, 0.38);
  box-shadow: 0 12px 28px rgba(34, 91, 82, 0.12);
}

#view-technical .technical-change-main-line {
  display: block;
  color: #172330;
  font-size: 1rem;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

#view-technical .technical-change-date {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

#view-technical .technical-change-subtext,
#view-technical .technical-change-meta,
#view-technical .technical-change-folder {
  color: #4d5b66;
  font-size: 0.88rem;
  line-height: 1.35;
  margin: 0.35rem 0 0;
  overflow-wrap: anywhere;
}

#view-technical .technical-change-folder span {
  color: #6a7680;
  font-weight: 800;
}

#view-technical .technical-change-folder-copy {
  appearance: none;
  border: 0;
  background: transparent;
  color: #225b52;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 0;
  text-align: left;
  overflow-wrap: anywhere;
}

#view-technical .technical-change-main-edit-grid {
  margin: 0.75rem 0;
}

#view-technical .technical-change-actions {
  flex-wrap: wrap;
}

#view-technical .technical-change-actions .btn {
  min-height: 2.25rem;
}

@media (min-width: 900px) {
  #view-technical .technical-change-core-grid {
    grid-template-columns: minmax(8rem, 0.7fr) minmax(16rem, 1.3fr) minmax(18rem, 1.6fr);
  }
}

@media (max-width: 760px) {
  #view-technical .technical-current-version {
    align-items: flex-start;
    flex-direction: column;
  }

  #view-technical .technical-change-list.technical-change-card-list {
    grid-template-columns: 1fr;
  }

  #view-technical .technical-version-card {
    padding: 0.85rem;
  }

  #view-technical .technical-change-actions .btn {
    flex: 1 1 9.5rem;
  }
}

/* Image manager: stable action panel replaces floating "Mas" popovers. */
.image-gallery-menu-layer,
.image-gallery-more-popover,
.image-gallery-menu-scrim,
.image-gallery-more-trigger {
  display: none !important;
}

.image-manager-dialog {
  height: min(88dvh, 820px);
  max-width: min(96vw, 1220px);
}

.image-manager-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.image-manager-body {
  gap: 0.62rem;
  overflow: hidden;
  padding: 0.78rem;
}

.image-manager-workspace {
  display: grid;
  gap: 0.82rem;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  min-height: 0;
}

.image-manager-gallery-pane {
  display: grid;
  gap: 0.62rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.08rem;
}

.image-manager-tab-panel {
  min-height: 0;
}

.image-manager-body .image-gallery-grid {
  gap: 0.52rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.image-manager-body .image-gallery-card {
  border-color: rgba(148, 163, 184, 0.58);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  cursor: default;
  max-width: none;
}

.image-manager-body .image-gallery-card.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14), 0 8px 20px rgba(15, 23, 42, 0.08);
}

.image-gallery-select-trigger {
  justify-content: center;
}

.image-gallery-mobile-action-trigger {
  display: none !important;
}

.image-gallery-badge--primary {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.image-manager-action-panel {
  align-self: stretch;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.54);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.62rem;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: auto;
  padding: 0.72rem;
}

.image-manager-action-panel-head {
  display: grid;
  gap: 0.14rem;
}

.image-manager-action-panel-head span,
.image-gallery-action-sheet header span {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.image-manager-action-panel-head strong {
  color: var(--color-primary-900);
  font-size: 0.94rem;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.image-manager-selected-preview {
  aspect-ratio: 4 / 3;
  background: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.64);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.image-manager-selected-preview img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.image-manager-selected-meta {
  display: grid;
  gap: 0.24rem;
  min-width: 0;
}

.image-manager-selected-meta > span {
  color: var(--color-primary-900);
  font-size: 0.82rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.image-manager-selected-meta > small {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.image-manager-selected-actions.image-gallery-more-menu,
.image-gallery-action-sheet .image-gallery-more-menu {
  background: transparent;
  gap: 0.18rem;
  padding: 0;
}

.image-manager-selected-actions button,
.image-manager-selected-actions a,
.image-gallery-action-sheet .image-gallery-more-menu button,
.image-gallery-action-sheet .image-gallery-more-menu a {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.64);
  color: var(--color-primary-900);
  display: flex;
  justify-content: space-between;
  min-height: 36px;
  padding: 0.42rem 0.54rem;
  width: 100%;
}

.image-manager-selected-actions button:hover,
.image-manager-selected-actions a:hover,
.image-gallery-action-sheet .image-gallery-more-menu button:hover,
.image-gallery-action-sheet .image-gallery-more-menu a:hover {
  background: #eef6ff;
  border-color: #bfdbfe;
}

.image-manager-selected-actions .danger-lite,
.image-gallery-action-sheet .image-gallery-more-menu .danger-lite {
  border-color: #fecaca;
  color: #b91c1c;
}

.image-manager-empty-panel {
  align-content: center;
  display: grid;
  min-height: 240px;
  text-align: center;
}

.image-manager-empty-panel strong {
  color: var(--color-primary-900);
  font-size: 0.94rem;
}

.image-manager-empty-panel p {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 750;
  margin: 0.22rem 0 0;
}

.image-gallery-sheet-layer {
  display: none;
}

.image-gallery-sheet-preview {
  align-items: center;
  display: grid;
  gap: 0.62rem;
  grid-template-columns: 72px minmax(0, 1fr);
}

.image-gallery-sheet-preview img {
  aspect-ratio: 1 / 1;
  background: #e5e7eb;
  border: 1px solid rgba(148, 163, 184, 0.58);
  border-radius: var(--radius-sm);
  display: block;
  object-fit: cover;
  width: 72px;
}

.image-gallery-sheet-preview strong {
  color: var(--color-primary-900);
  display: block;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .image-manager-dialog {
    height: 100dvh;
    max-height: none;
  }

  .image-manager-header {
    align-items: center;
    flex-direction: row;
    padding: 0.68rem 0.72rem;
  }

  .image-manager-header > button {
    flex: 0 0 auto;
    width: auto;
  }

  .image-manager-body {
    overflow: auto;
    padding: 0.68rem;
  }

  .image-manager-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-manager-gallery-pane {
    overflow: visible;
    padding-right: 0;
  }

  .image-manager-action-panel {
    display: none;
  }

  .image-manager-body .image-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-manager-body .image-gallery-card {
    gap: 0.4rem;
    padding: 0.44rem;
  }

  .image-gallery-select-trigger {
    display: none !important;
  }

  .image-gallery-mobile-action-trigger {
    display: inline-flex !important;
    justify-content: center;
    width: 100%;
  }

  .image-gallery-actions {
    grid-template-columns: 1fr;
  }

  .image-gallery-sheet-layer {
    display: block;
    inset: 0;
    position: fixed;
    z-index: 176;
  }

  .image-gallery-sheet-scrim {
    background: rgba(15, 23, 42, 0.42);
    border: 0;
    inset: 0;
    position: fixed;
  }

  .image-gallery-action-sheet {
    border-radius: 18px 18px 0 0;
    bottom: 0;
    left: 0;
    max-height: min(82dvh, 620px);
    overflow: auto;
    position: fixed;
    right: 0;
    z-index: 177;
  }
}

@media (max-width: 380px) {
  .image-manager-body .image-gallery-grid {
    grid-template-columns: 1fr;
  }

  .image-manager-header h4 {
    font-size: 1rem;
  }
}

.image-manager-backdrop {
  background: rgba(15, 23, 42, 0.54);
  inset: 0;
  position: absolute;
}

.image-manager-dialog {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  left: 50%;
  max-height: min(88vh, 820px);
  max-width: min(94vw, 1180px);
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.image-manager-header {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  padding: 0.86rem 1rem;
}

.image-manager-header span {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.image-manager-header h4 {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: 1.15rem;
  margin: 0.06rem 0;
}

.image-manager-header p {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 750;
  margin: 0;
}

.image-manager-body {
  display: grid;
  gap: 0.82rem;
  overflow: auto;
  padding: 0.9rem 1rem 1rem;
}

.image-manager-tabs {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 0.36rem;
  margin: -0.1rem 0 0.12rem;
  overflow-x: auto;
  padding-bottom: 0.48rem;
  scrollbar-width: thin;
}

.image-manager-tab {
  align-items: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 900;
  gap: 0.34rem;
  min-height: 38px;
  padding: 0.38rem 0.62rem;
}

.image-manager-tab b {
  background: var(--color-surface-soft);
  border-radius: var(--radius-pill);
  color: var(--color-primary-900);
  font-size: 0.68rem;
  min-width: 1.35rem;
  padding: 0.1rem 0.32rem;
  text-align: center;
}

.image-manager-tab.is-active {
  background: var(--color-primary-900);
  border-color: var(--color-primary-900);
  color: #fff;
}

.image-manager-tab.is-active b {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.image-manager-tab-panel {
  display: grid;
  min-height: 0;
}

.image-manager-body .image-gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.image-manager-body .image-gallery-card {
  max-width: none;
}

.image-gallery-section,
.image-gallery-primary-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.62rem;
  padding: 0.68rem;
}

.image-gallery-section--discreet {
  background: #fafafa;
  border-style: dashed;
}

.image-gallery-section--discreet .image-gallery-section-head h5 {
  color: var(--color-text);
}

.image-gallery-section-head {
  align-items: start;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}

.image-gallery-section-head h5 {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: 0.94rem;
  margin: 0;
}

.image-gallery-section-head p {
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 750;
  margin: 0.12rem 0 0;
}

.image-gallery-head {
  align-items: start;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}

.image-gallery-head h5 {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: 0.96rem;
  margin: 0;
}

.image-gallery-head p,
.image-gallery-add-panel p {
  color: var(--color-text-muted);
  font-size: 0.76rem;
  font-weight: 750;
  margin: 0.16rem 0 0;
}

.image-gallery-grid {
  display: grid;
  gap: 0.62rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 176px));
  justify-content: start;
}

.image-gallery-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-low);
  display: grid;
  gap: 0.46rem;
  max-width: 176px;
  min-width: 0;
  padding: 0.5rem;
  width: 100%;
}

.image-gallery-card.is-primary {
  background: linear-gradient(180deg, #fff, var(--color-primary-050));
  border-color: rgba(124, 58, 237, 0.42);
}

.image-gallery-primary-card {
  align-items: center;
  display: grid;
  gap: 0.72rem;
  grid-template-columns: 112px minmax(0, 1fr);
}

.image-gallery-primary-card > div {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.image-gallery-primary-card strong,
.image-gallery-primary-card span {
  overflow-wrap: anywhere;
}

.image-gallery-primary-thumb {
  aspect-ratio: 4 / 3;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.image-gallery-primary-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.image-gallery-thumb {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  height: auto;
  overflow: hidden;
  padding: 0;
  width: 100%;
}

.image-gallery-thumb img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.image-gallery-fallback,
.image-gallery-empty {
  align-items: center;
  background: #f8fafc;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  display: flex;
  font-size: 0.82rem;
  font-weight: 800;
  justify-content: center;
  min-height: 118px;
  padding: 0.8rem;
  text-align: center;
}

.image-gallery-card-meta {
  display: grid;
  gap: 0.1rem;
  min-width: 0;
}

.image-gallery-card-meta span,
.image-gallery-primary-note {
  color: var(--color-primary-900);
  font-size: 0.76rem;
  font-weight: 900;
}

.image-gallery-primary-note {
  align-items: center;
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  display: inline-flex;
  margin-top: 0.2rem;
  padding: 0.22rem 0.58rem;
  width: fit-content;
}

.image-gallery-internal-meta {
  align-items: center;
  color: var(--color-text-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.68rem;
  font-weight: 650;
  gap: 0.25rem 0.45rem;
  line-height: 1.35;
  margin-top: 0.12rem;
  overflow-wrap: anywhere;
}

.gallery-meta-link {
  background: transparent;
  border: 0;
  color: var(--color-primary-700);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.image-gallery-card-meta small {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-gallery-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  min-height: 0;
}

.image-gallery-badge {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  color: var(--color-text-muted);
  font-size: 0.64rem;
  font-weight: 850;
  padding: 0.12rem 0.28rem;
}

.image-gallery-badge--ai {
  background: #eef6ff;
  border-color: #b7d4ff;
  color: #164a7a;
}

.image-gallery-actions,
.image-gallery-links,
.image-gallery-add-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.image-gallery-more-menu {
  background: #fff;
  display: grid;
  gap: 0.08rem;
  padding: 0.28rem;
  width: 100%;
}

.image-gallery-more-menu button,
.image-gallery-more-menu a {
  background: transparent;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--color-primary-900);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 820;
  min-height: 32px;
  padding: 0.36rem 0.46rem;
  text-align: left;
  text-decoration: none;
}

.image-gallery-more-menu button:hover,
.image-gallery-more-menu a:hover {
  background: var(--color-surface-soft);
}

.image-gallery-more-menu button:disabled {
  color: var(--color-text-muted);
  cursor: not-allowed;
  opacity: 0.62;
}

.image-gallery-more-menu .danger-lite {
  color: var(--color-danger);
}

.image-gallery-more-trigger {
  min-width: 54px;
}

.image-gallery-menu-layer {
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: 170;
}

.image-gallery-menu-scrim {
  background: transparent;
  border: 0;
  cursor: default;
  inset: 0;
  pointer-events: auto;
  position: fixed;
}

.image-gallery-more-popover {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: var(--radius-sm);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.2);
  display: grid;
  gap: 0.18rem;
  max-height: min(68vh, 380px);
  overflow: auto;
  padding: 0.38rem;
  pointer-events: auto;
  position: fixed;
  width: min(260px, calc(100vw - 24px));
}

.image-gallery-more-popover > strong {
  color: var(--color-primary-900);
  display: block;
  font-size: 0.76rem;
  font-weight: 900;
  overflow: hidden;
  padding: 0.2rem 0.36rem 0.1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-gallery-action-sheet {
  background: #fff;
  border-radius: 18px 18px 0 0;
  bottom: 0;
  box-shadow: 0 -18px 50px rgba(15, 23, 42, 0.24);
  display: grid;
  gap: 0.36rem;
  left: 0;
  max-height: min(78vh, 560px);
  overflow: auto;
  padding: 0.72rem;
  pointer-events: auto;
  position: fixed;
  right: 0;
}

.image-gallery-action-sheet header {
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding-bottom: 0.44rem;
}

.image-gallery-action-sheet header strong {
  color: var(--color-primary-900);
  font-size: 0.86rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-gallery-delete-confirm {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-sm);
  color: #7c2d12;
  display: grid;
  gap: 0.36rem;
  padding: 0.44rem;
}

.image-gallery-delete-confirm span {
  font-size: 0.74rem;
  font-weight: 900;
}

.image-gallery-delete-confirm div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

.image-gallery-upload-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.image-gallery-upload-block input[type="file"] {
  font-size: 0.78rem;
}

.image-gallery-upload-trigger {
  display: inline-flex;
  position: relative;
}

.image-gallery-upload-trigger .image-gallery-file-input {
  cursor: pointer;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.image-gallery-upload-hint {
  font-size: 0.72rem;
  color: var(--color-muted, #555);
  margin: 0;
}

.image-gallery-upload-note {
  font-size: 0.78rem;
  color: var(--color-primary-800, #2a3340);
  margin: 0;
}

.image-gallery-upload-error {
  font-size: 0.78rem;
  color: #b3261e;
  margin: 0;
}

.image-gallery-divider {
  border: 0;
  border-top: 1px dashed var(--color-border, #d9dde2);
  margin: 0.4rem 0;
}

.image-gallery-actions button,
.image-gallery-actions a,
.image-gallery-links button,
.image-gallery-links a {
  align-items: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary-800);
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 850;
  min-height: 32px;
  padding: 0.26rem 0.44rem;
  text-decoration: none;
}

.image-gallery-actions .danger-lite {
  color: var(--color-danger);
}

.image-gallery-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.image-gallery-add-panel {
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.5rem;
  padding: 0.6rem;
}

.image-gallery-add-panel textarea {
  min-height: 92px;
  width: 100%;
}

.image-lightbox {
  inset: 0;
  position: fixed;
  z-index: 180;
}

.image-lightbox-backdrop {
  background: rgba(15, 23, 42, 0.76);
  inset: 0;
  position: absolute;
}

.image-lightbox-dialog {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
  display: grid;
  gap: 0.7rem;
  left: 50%;
  max-height: min(88vh, 760px);
  max-width: min(92vw, 980px);
  padding: 0.75rem;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  animation: lightboxDialogEnter var(--motion-slow) var(--ease-out);
}

.image-lightbox-dialog header,
.image-lightbox-dialog footer {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

.image-lightbox-dialog header div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.image-lightbox-dialog img {
  background: #0f172a;
  border-radius: var(--radius-sm);
  display: block;
  max-height: 68vh;
  object-fit: contain;
  width: 100%;
}

@keyframes lightboxDialogEnter {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 4px)) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.technical-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: 0.35rem;
}

.technical-chip {
  border: 1px solid #b7d6c2;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  background: #eef8f2;
  color: #2d6148;
  max-width: 100%;
  overflow-wrap: anywhere;
}

#view-technical {
  overflow-x: hidden;
}

#view-costing .reference-advanced-section h3 {
  color: #51278d;
}

#view-costing .executive-summary {
  border-color: #c3acef;
  background: linear-gradient(180deg, #ffffff, #f8f3ff);
}

#view-costing .executive-head {
  border-bottom-color: #d7c7f3;
}

#view-costing .executive-main-number strong {
  color: #4c218f;
}

#view-costing .commercial-kpi-grid .kpi-main {
  border-color: #d6c4f5;
  background: #fff;
}

#view-costing .commercial-kpi-grid .kpi-main b {
  color: #4d218f;
}

#view-costing .layer-row {
  border-color: #d5c2f3;
}

#view-costing .layer-row summary {
  padding: 0.32rem 0.46rem;
}

#view-costing .negotiation-strip {
  border-color: #c8b2ef;
  background: #f4edff;
}

.action-panel {
  border-color: #bbd4c3;
  background: linear-gradient(180deg, #f8fcf9, #f0f8f3);
}

.catalog-module {
  background: #fff;
}

.catalog-search-bar {
  color: var(--color-primary-900);
  display: grid;
  font-size: 0.84rem;
  font-weight: 850;
  gap: 0.28rem;
  margin-bottom: 0.58rem;
}

.catalog-search-bar input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  min-height: 42px;
  padding: 0.46rem 0.58rem;
  width: 100%;
}

.catalog-header-actions {
  margin-top: 0.85rem;
}

.catalog-visibility-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.85rem 0 0.58rem;
}

.catalog-visibility-tab {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(91, 33, 182, 0.18);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0.42rem 0.78rem;
}

.catalog-visibility-tab.is-active {
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
  box-shadow: 0 8px 20px rgba(91, 33, 182, 0.18);
  color: #fff;
}

.catalog-filters-collapse {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  margin-bottom: 0.58rem;
}

.catalog-filters-collapse > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.48rem 0.62rem;
  color: #4c1d95;
  font-weight: 850;
}

.catalog-filters {
  margin-top: 0;
  margin-bottom: 0.2rem;
  padding: 0.55rem;
}

.catalog-filter-actions {
  margin-top: 0;
}

.catalog-quick-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.72rem;
}

.catalog-status-filter-chip {
  cursor: pointer;
}

.catalog-status-filter-chip.is-active {
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
  color: #fff;
}

.catalog-list {
  display: grid;
  align-items: start;
  gap: 0.72rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 340px));
  justify-content: center;
  max-width: 100%;
  min-width: 0;
}

.catalog-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0;
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
  box-shadow: var(--shadow-low);
  overflow: visible;
}

.catalog-card header {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: flex-start;
}

.visual-card {
  align-items: start;
  display: grid;
  gap: 0.5rem 0.66rem;
  grid-template-columns: 88px minmax(0, 1fr);
  padding: 0.62rem 0.66rem 0.66rem 0.76rem;
}

.visual-card-media {
  aspect-ratio: 4 / 5;
  height: auto;
  width: 88px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-primary-050);
  display: grid;
  place-items: center;
}

.visual-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual-image-fallback {
  font-size: 0.75rem;
  color: var(--color-primary-800);
  text-align: center;
  padding: 0.36rem;
}

.visual-card-head {
  grid-column: 2;
  min-width: 0;
}

.visual-select {
  white-space: nowrap;
}

.visual-badges {
  grid-column: 2;
}

.visual-progress-row {
  grid-column: 2;
  display: grid;
  gap: 0.28rem;
}

.visual-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.45rem;
  align-items: center;
}

.visual-progress-meta strong {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: 1.14rem;
  line-height: 1;
}

.visual-progress-meta b {
  color: var(--color-warning);
  font-size: 0.78rem;
  line-height: 1.2;
  text-align: right;
  word-break: normal;
}

.visual-progress-bar {
  height: 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-primary-050);
}

.visual-progress-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-700), var(--color-primary-500));
}

.visual-card-meta {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.visual-card-meta small {
  font-size: 0.72rem;
  color: #5b7a69;
}

.visual-card .actions-mini {
  border-top: 1px solid rgba(221, 214, 254, 0.72);
  grid-column: 1 / -1;
  justify-content: flex-start;
  margin-top: 0.05rem;
  padding-top: 0.42rem;
}

.catalog-card-next,
.catalog-card-owner {
  grid-column: 2;
  margin: 0;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.22;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.catalog-card-next {
  color: var(--color-text-muted);
  -webkit-line-clamp: 2;
}

.catalog-card-next.status-warning {
  color: var(--color-warning);
}

.catalog-card-owner {
  color: var(--color-primary-800);
  -webkit-line-clamp: 1;
}

.catalog-alerts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  grid-column: 2;
}

.catalog-alerts span {
  background: var(--color-warning-bg);
  border: 1px solid rgba(180, 83, 9, 0.2);
  border-radius: var(--radius-pill);
  color: var(--color-warning);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.15;
  max-width: 100%;
  padding: 0.18rem 0.4rem;
}

.catalog-card h4 {
  margin: 0.14rem 0 0;
  font-size: 0.96rem;
  line-height: 1.1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-code {
  margin: 0;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: #3d6350;
  text-transform: uppercase;
}

.catalog-meta {
  margin: 0.22rem 0 0;
  color: var(--ink-soft);
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-select {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.catalog-tags {
  margin-top: 0.58rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#view-catalog .visual-card .actions-mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

#view-catalog .visual-card .actions-mini > button,
#view-catalog .visual-card .actions-mini > details {
  min-width: 0;
}

#view-catalog .visual-card .actions-mini > button {
  width: 100%;
}

#view-catalog .card-more-actions summary {
  white-space: nowrap;
}

.history-module {
  background: linear-gradient(180deg, #ffffff, #f8faff);
}

.quote-commercial-start,
.commercial-quote-form-shell,
.quote-admin-advanced {
  margin-bottom: 1rem;
}

.quote-commercial-start {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  background: #ffffff;
  border-left: 4px solid #16a34a;
}

.quote-section-head,
.commercial-quote-form-head,
.commercial-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.commercial-quote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.commercial-quote-grid label,
.commercial-price-panel label,
.commercial-color-row label {
  min-width: 0;
}

.commercial-quote-status {
  margin: 0.9rem 0;
}

.commercial-colors-panel,
.commercial-price-panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-top: 0.9rem;
  background: #fbfcf7;
}

.commercial-color-list {
  display: grid;
  gap: 0.55rem;
}

.commercial-color-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(120px, 0.6fr) auto;
  gap: 0.55rem;
  align-items: end;
}

.commercial-color-total {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
  font-size: 0.9rem;
}

.commercial-color-total .is-ok {
  color: #15803d;
  font-weight: 700;
}

.commercial-color-total .is-warning,
.metric-tag-warning {
  color: #9a3412;
  font-weight: 700;
}

.commercial-quote-notes {
  margin-top: 0.9rem;
}

.commercial-price-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px);
  gap: 0.9rem;
  align-items: start;
  background: #fffdf7;
}

.commercial-price-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}

.commercial-price-summary article {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0.6rem;
  background: #ffffff;
}

.commercial-price-summary span {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.commercial-price-summary b {
  display: block;
  margin-top: 0.25rem;
}

.commercial-price-summary p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-muted);
}

.commercial-quote-actions {
  margin-top: 0.9rem;
}

.commercial-preview-root {
  margin-top: 0.9rem;
}

.commercial-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
}

.commercial-preview-card,
.commercial-save-result,
.commercial-preview-hint {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  background: #ffffff;
}

.commercial-preview-card-client {
  background: #f8fcfb;
}

.quote-admin-advanced summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  font-weight: 800;
}

.quote-admin-advanced summary small {
  color: var(--text-muted);
  font-weight: 600;
}

.quote-admin-advanced-body {
  display: grid;
  gap: 0.8rem;
  padding-top: 0.9rem;
}

.toggle-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}

.quote-board-module {
  margin-bottom: 1rem;
}

.quote-board-header {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.quote-board-controls {
  margin-top: 0;
  min-width: min(100%, 360px);
}

.quote-board-list {
  margin-top: 0.75rem;
}

.quote-board-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.quote-board-thumb {
  width: 72px;
  aspect-ratio: 1;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--color-surface-soft);
  color: var(--color-primary-800);
  font-weight: 800;
}

.quote-board-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quote-board-main {
  min-width: 0;
}

.quote-board-actions {
  margin-top: 0.45rem;
}

.owner-focus-pulse {
  outline: 2px solid var(--color-primary-400);
  outline-offset: 3px;
}

@media (max-width: 560px) {
  .quote-commercial-start {
    align-items: stretch;
    flex-direction: column;
  }

  .commercial-quote-grid,
  .commercial-price-summary,
  .commercial-price-panel,
  .commercial-preview-grid,
  .commercial-color-row {
    grid-template-columns: 1fr;
  }

  .quote-board-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 0.55rem;
  }

  .quote-board-thumb {
    width: 56px;
  }
}

@media (min-width: 561px) and (max-width: 980px) {
  .commercial-quote-grid,
  .commercial-price-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commercial-price-panel,
  .commercial-preview-grid {
    grid-template-columns: 1fr;
  }
}

.history-filters {
  margin-top: 0;
  margin-bottom: 0.8rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.history-detail-card {
  background: linear-gradient(180deg, #ffffff, #f9fbff);
}

.history-detail {
  display: grid;
  gap: 0.65rem;
}

.simulator-module {
  background: linear-gradient(180deg, #ffffff, #f7fbf8);
}

.sim-input-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin-bottom: 0.8rem;
}

.simulator-layout {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  max-width: 100%;
}

.sim-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.55rem;
}

.sim-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0.62rem;
}

.sim-card h4 {
  margin: 0;
  font-size: 0.81rem;
  color: var(--ink-soft);
}

.sim-card strong {
  display: block;
  margin-top: 0.22rem;
  font-family: var(--font-title);
  font-size: 1.1rem;
}

.sim-card p {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
}

.quote-document-card {
  background: linear-gradient(180deg, #ffffff, #f9fcf9);
}

.quote-header {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.8rem;
  padding-bottom: 0.7rem;
  min-width: 0;
  max-width: 100%;
}

.document-preview-root {
  position: fixed;
  inset: 0;
  z-index: 80;
  overflow: auto;
  background: rgba(15, 23, 42, 0.54);
  padding: 1.2rem;
}

.document-preview-shell {
  max-width: 980px;
  margin: 0 auto;
}

.document-preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  margin-bottom: 0.85rem;
  padding: 0.8rem;
}

.document-preview-toolbar h3,
.document-preview-toolbar p {
  margin: 0;
}

.snapshot-document {
  color: #172018;
  background: #fff;
  border: 1px solid #dfe7dd;
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  padding: clamp(1rem, 3vw, 2rem);
}

.snapshot-document-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 2px solid #1f6f49;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
}

.snapshot-document-hero h1 {
  margin: 0.15rem 0;
  font-family: var(--font-title);
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.snapshot-document-hero p {
  margin: 0;
}

.snapshot-document-number {
  align-self: flex-start;
  border: 1px solid #b7c8b8;
  border-radius: 8px;
  background: #f7fbf7;
  color: #234d35;
  font-weight: 800;
  padding: 0.65rem 0.8rem;
  white-space: nowrap;
}

.snapshot-public-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 280px);
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.snapshot-public-grid h2 {
  margin: 0.2rem 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.snapshot-label {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.snapshot-reference-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid #dce7de;
  border-radius: 8px;
  background: #f4f7f5;
}

.snapshot-reference-placeholder {
  display: grid;
  place-items: center;
  color: #355d42;
  font-family: var(--font-title);
  font-size: 4rem;
}

.snapshot-section {
  break-inside: avoid;
  border-top: 1px solid #e1e9e3;
  padding: 1rem 0 0;
  margin-top: 1rem;
}

.snapshot-section h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.snapshot-key-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.snapshot-key-values p {
  border: 1px solid #e2e8e2;
  border-radius: 8px;
  background: #fbfdfb;
  margin: 0;
  padding: 0.65rem;
}

.snapshot-key-values span {
  display: block;
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.snapshot-key-values b {
  display: block;
  margin-top: 0.18rem;
}

.snapshot-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.55rem;
}

.snapshot-tier-grid article {
  border: 1px solid #dfe7dd;
  border-radius: 8px;
  background: #fff;
  padding: 0.7rem;
}

.snapshot-tier-grid span,
.snapshot-tier-grid b,
.snapshot-tier-grid em {
  display: block;
}

.snapshot-tier-grid span {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.snapshot-tier-grid b {
  margin-top: 0.2rem;
}

.snapshot-tier-grid em {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-style: normal;
}

.snapshot-total-box {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 8px;
  background: #1f6f49;
  color: #fff;
  margin-top: 0.8rem;
  padding: 0.85rem;
}

.snapshot-total-box b {
  font-size: 1.25rem;
}

.snapshot-document-footer {
  border-top: 1px solid #e1e9e3;
  color: var(--ink-muted);
  margin-top: 1.2rem;
  padding-top: 0.8rem;
}

.internal-support-document .snapshot-document-hero {
  border-bottom-color: #8b5e34;
}

.backup-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 0.8rem;
  min-width: 0;
  max-width: 100%;
}

.backup-card {
  background: linear-gradient(180deg, #ffffff, #f8faf9);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.62rem;
}

.form-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  margin-bottom: 0.8rem;
  padding: 0.7rem;
}

.form-section summary {
  list-style: none;
  cursor: pointer;
  margin: -0.2rem -0.2rem 0.55rem;
  padding: 0.25rem 0.25rem 0.35rem;
  border-bottom: 1px dashed #d4c4f2;
  transition: color var(--motion-fast) var(--ease-standard);
}

.form-section summary::-webkit-details-marker {
  display: none;
}

.form-section summary h3::after {
  content: "▼";
  float: right;
  font-size: 0.7rem;
  color: #6b48a9;
}

.form-section:not([open]) summary h3::after {
  content: "►";
}

.form-section h3 {
  margin: 0 0 0.6rem;
  font-size: 0.92rem;
  color: #4b2f82;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: 720;
}

.field-label {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem;
  transition:
    border-color var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.field-label:hover {
  border-color: var(--color-border-strong);
  transform: translateY(-1px);
}

.field-label-row {
  align-items: flex-start;
  display: flex;
  gap: 0.45rem;
  justify-content: space-between;
  min-width: 0;
}

.field-title {
  color: var(--color-text);
  line-height: 1.25;
  min-width: 0;
}

.field-status-pill {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  padding: 0.22rem 0.42rem;
  text-transform: uppercase;
}

.field-status-pill.is-required {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.2);
  color: var(--color-warning);
}

.field-status-pill.is-calculated {
  background: var(--color-info-bg);
  border-color: rgba(2, 132, 199, 0.18);
  color: var(--color-info);
}

.field-status-pill.is-classification {
  background: var(--color-primary-050);
  border-color: var(--color-border);
  color: var(--color-primary-800);
}

.field-status-pill.is-advanced {
  background: var(--color-neutral-bg);
  border-color: rgba(75, 85, 99, 0.16);
  color: var(--color-neutral);
}

.field-status-pill.is-check {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.16);
  color: var(--color-success);
}

.field-status-pill.is-optional {
  background: var(--color-primary-050);
  border-color: var(--color-border);
  color: var(--color-primary-800);
  display: none;
}

.field-control-wrap {
  display: block;
  min-width: 0;
  position: relative;
}

.field-control-wrap > input,
.field-control-wrap > select,
.field-control-wrap > textarea {
  width: 100%;
}

.field-control-wrap[data-unit] > input {
  padding-right: 3.1rem;
}

.field-control-wrap[data-unit]::after {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-muted);
  content: attr(data-unit);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 900;
  inset: 50% 0.45rem auto auto;
  min-height: 1.35rem;
  padding: 0 0.4rem;
  pointer-events: none;
  position: absolute;
  transform: translateY(-50%);
}

.field-hint {
  margin-top: 0.2rem;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 650;
}

.field-warning,
.field-error,
.field-success {
  border-radius: var(--radius-sm);
  display: block;
  font-size: var(--text-xs);
  font-weight: 800;
  line-height: 1.35;
  margin-top: 0.08rem;
  padding: 0.38rem 0.48rem;
}

.field-warning {
  background: var(--color-warning-bg);
  border: 1px solid rgba(180, 83, 9, 0.2);
  color: var(--color-warning);
}

.field-error {
  background: var(--color-danger-bg);
  border: 1px solid rgba(185, 28, 28, 0.18);
  color: var(--color-danger);
}

.field-success {
  background: var(--color-success-bg);
  border: 1px solid rgba(4, 120, 87, 0.16);
  color: var(--color-success);
}

.field-hint.provisional {
  color: #8c4325;
}

.field--readonly,
.computed-field {
  background: linear-gradient(180deg, #ffffff, var(--color-primary-050));
}

.field--readonly input,
.field--readonly select,
.field--readonly textarea,
.computed-field input,
.computed-field select,
.computed-field textarea {
  background: var(--color-surface-soft);
  border-style: dashed;
  color: var(--color-muted);
  cursor: not-allowed;
}

.field--checkbox {
  cursor: pointer;
  display: grid;
  gap: 0.5rem;
}

.field--checkbox .field-control-wrap {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  min-height: 40px;
  padding: 0.45rem 0.55rem;
}

.field--checkbox:has(input:checked) {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.22);
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.58rem 0.68rem;
  color: var(--ink);
  background: #fff;
  min-height: 40px;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard);
  min-width: 0;
  max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary-600);
  box-shadow: var(--shadow-focus);
  background: #fffaff;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

input[type="checkbox"] {
  accent-color: var(--color-primary-700);
  width: 19px;
  height: 19px;
  margin-top: 0.16rem;
}

button {
  align-items: center;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-primary-100);
  color: var(--color-primary-900);
  cursor: pointer;
  display: inline-flex;
  gap: 0.38rem;
  justify-content: center;
  min-height: 38px;
  padding: 0.58rem 0.82rem;
  font-weight: 760;
  line-height: 1.12;
  text-decoration: none;
  transition:
    transform var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    background-color var(--motion-base) var(--ease-standard),
    border-color var(--motion-base) var(--ease-standard),
    color var(--motion-base) var(--ease-standard);
}

button:hover {
  background: var(--color-primary-050);
  border-color: var(--color-primary-600);
  box-shadow: var(--shadow-low);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
a:focus-visible,
summary:focus-visible,
.btn:focus-visible,
.file-input-label:focus-within {
  outline: none;
  border-color: var(--color-primary-600);
  box-shadow: var(--shadow-focus);
}

button:disabled,
.btn:disabled,
button[aria-disabled="true"],
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  filter: grayscale(0.18);
  opacity: 0.58;
  transform: none;
}

.btn,
a.btn {
  align-items: center;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  display: inline-flex;
  gap: 0.38rem;
  justify-content: center;
  min-height: 40px;
  padding: 0.58rem 0.88rem;
  font-weight: 820;
  line-height: 1.12;
  text-decoration: none;
}

.btn-primary,
button.btn-primary {
  background: linear-gradient(135deg, var(--color-primary-800), var(--color-primary-600));
  border-color: var(--color-primary-700);
  color: #fff;
  box-shadow: 0 10px 22px rgba(76, 29, 149, 0.2);
}

.btn-primary:hover,
button.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
  color: #fff;
}

.btn-secondary,
button.btn-secondary {
  background: #fff;
  border-color: var(--color-primary-600);
  color: var(--color-primary-800);
}

.btn-soft,
button.btn-soft {
  background: var(--color-primary-050);
  border-color: var(--color-border);
  color: var(--color-primary-800);
}

.btn-ghost,
button.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--color-primary-800);
}

.btn-ghost:hover,
button.btn-ghost:hover {
  background: var(--color-primary-050);
  border-color: var(--color-border);
}

.btn-danger,
button.btn-danger,
button.danger-lite {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.24);
  color: var(--color-danger);
}

.btn-icon,
button.btn-icon {
  min-height: 40px;
  min-width: 40px;
  padding: 0.5rem;
}

.btn-compact,
button.btn-compact {
  min-height: 34px;
  padding: 0.42rem 0.62rem;
  font-size: var(--text-sm);
}

.btn-full {
  width: 100%;
}

.badge,
.state-pill,
.metric-pill,
.metric-tag,
.technical-chip,
.technical-section-meta,
.technical-section-chip-count,
.technical-hero-context-pill,
.header-status-pill {
  align-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  display: inline-flex;
  gap: 0.28rem;
  justify-content: center;
  min-height: 26px;
  padding: 0.24rem 0.58rem;
  font-size: var(--text-xs);
  font-weight: 850;
  line-height: 1.12;
  white-space: nowrap;
}

.badge-success,
.state-pill.success,
.metric-pill.success,
.technical-chip.success,
.technical-hero-context-pill.success {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.18);
  color: var(--color-success);
}

.badge-warning,
.state-pill.warning,
.metric-pill.warning,
.technical-chip.warning,
.technical-hero-context-pill.warning {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.2);
  color: var(--color-warning);
}

.badge-danger,
.state-pill.danger,
.metric-pill.danger,
.technical-hero-context-pill.danger {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.2);
  color: var(--color-danger);
}

.badge-info,
.state-pill.info,
.metric-pill.info,
.badge-primary,
.technical-hero-context-pill.info {
  background: var(--color-primary-050);
  border-color: var(--color-border);
  color: var(--color-primary-800);
}

.badge-neutral,
.state-pill.neutral,
.metric-pill.neutral {
  background: var(--color-neutral-bg);
  border-color: #e2e8f0;
  color: var(--color-neutral);
}

.badge-compact {
  min-height: 22px;
  padding: 0.18rem 0.48rem;
}

.card,
.sub-panel,
.pipeline-card,
.catalog-card,
.technical-section-card,
.image-gallery-card,
.finishing-process-row {
  transition:
    border-color var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard),
    background-color var(--motion-base) var(--ease-standard);
}

.pipeline-card:hover,
.catalog-card:hover,
.image-gallery-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-medium);
  transform: translateY(-1px);
}

.surface,
.surface-soft,
.panel,
.data-card,
.status-card,
.metric-card,
.action-card,
.technical-summary-card,
.empty-state-card,
.section-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  min-width: 0;
}

.surface,
.panel,
.data-card,
.section-card {
  background: var(--color-surface);
}

.surface-soft,
.action-card,
.technical-summary-card {
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
}

.panel,
.surface {
  box-shadow: var(--shadow-low);
}

.panel-header {
  align-items: flex-start;
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
}

.panel-title {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: var(--text-lg);
  line-height: 1.12;
  margin: 0;
}

.panel-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.35;
  margin: 0.22rem 0 0;
}

.metric-card {
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  padding: 0.64rem;
}

.metric-card span,
.data-card span {
  color: var(--color-text-muted);
  display: block;
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
}

.metric-card strong,
.data-card strong {
  color: var(--color-primary-900);
  display: block;
  font-family: var(--font-title);
  font-size: 1.22rem;
  line-height: 1.05;
  margin-top: 0.2rem;
}

.status-card,
.decision-card,
.blocker-card,
.missing-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.72rem;
}

.status-card-success,
.status-card.success,
.reference-card-ready {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.22);
}

.status-card-warning,
.status-card.warning {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.24);
}

.status-card-danger,
.status-card.danger,
.reference-card-blocked {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.24);
}

.status-card-info,
.status-card.info {
  background: var(--color-info-bg);
  border-color: rgba(37, 99, 235, 0.2);
}

.reference-card,
.catalog-card,
.pipeline-card {
  position: relative;
}

.reference-card::before,
.catalog-card::before,
.pipeline-card::before {
  background: linear-gradient(180deg, var(--color-primary-600), rgba(124, 58, 237, 0));
  border-radius: var(--radius-pill);
  content: "";
  inset: 0 auto 0 0;
  opacity: 0.22;
  position: absolute;
  width: 3px;
}

.empty-state-card,
.empty-state {
  background: linear-gradient(180deg, #fff, var(--color-neutral-bg));
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius-md);
  color: var(--color-text);
  padding: 0.95rem;
}

.empty-state::before {
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  color: var(--color-primary-800);
  content: "Sin datos";
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 850;
  margin-bottom: 0.42rem;
  padding: 0.18rem 0.52rem;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.actions-row,
.inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: flex-end;
  margin-top: 0.75rem;
}

.file-input-label {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 0.4rem 0.54rem;
  background: #fff;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.file-input-label input {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 0.35rem;
}

input[type="file"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.table-wrap > table {
  width: max-content;
  min-width: 100%;
}

.category-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.25rem 0 0.6rem;
}

.category-chip {
  border: 1px solid #ceb8f2;
  border-radius: 999px;
  padding: 0.23rem 0.5rem;
  font-size: 0.76rem;
  background: #f7f0ff;
  color: #4d2b8a;
}

.inline-warnings {
  margin: 0 0 0.5rem;
  padding-left: 1.1rem;
  color: #8a4026;
  font-size: 0.79rem;
}

.editable-lines-table td input,
.editable-lines-table td select,
.editable-lines-table td textarea {
  min-width: 88px;
}

.editable-lines-table td textarea {
  min-height: 46px;
}

.row-inactive {
  opacity: 0.6;
  background: #f4f0fb;
}

table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin-top: 0.45rem;
  font-size: 0.82rem;
}

th,
td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.4rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f2eaff;
  color: #4d2f82;
}

.actions-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.summary-grid {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

.compact-precalc-summary {
  padding: 0.36rem;
}

.compact-precalc-head {
  margin-bottom: 0.2rem;
  padding-bottom: 0.2rem;
}

.commercial-precalc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.24rem;
}

.commercial-precalc-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fefefe;
  padding: 0.2rem 0.26rem;
}

.commercial-precalc-grid article span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.66rem;
}

.commercial-precalc-grid article b {
  display: block;
  margin-top: 0.06rem;
  font-size: 0.8rem;
}

.compact-main-kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.commercial-primary-meta {
  margin-top: 0.14rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
}

.commercial-detail-fold .commercial-secondary-grid {
  padding: 0.16rem 0.34rem 0.34rem;
}

#view-costing .costing-summary-top .compact-postcalc-summary {
  padding: 0.3rem;
}

#view-costing .costing-summary-top .compact-postcalc-summary .executive-head {
  margin-bottom: 0.18rem;
  padding-bottom: 0.18rem;
}

#view-costing .costing-summary-top .compact-postcalc-summary .eyebrow {
  font-size: 0.62rem;
}

#view-costing .costing-summary-top .compact-postcalc-summary h4 {
  font-size: 0.84rem;
}

#view-costing .costing-summary-top .compact-postcalc-summary .executive-ref-line {
  font-size: 0.7rem;
  margin-top: 0.04rem;
}

#view-costing .costing-summary-top .compact-main-kpi-grid {
  gap: 0.14rem;
}

#view-costing .costing-summary-top .compact-main-kpi-grid .kpi-main {
  padding: 0.14rem 0.18rem;
  border-radius: 8px;
}

#view-costing .costing-summary-top .compact-main-kpi-grid .kpi-main span {
  font-size: 0.61rem;
}

#view-costing .costing-summary-top .compact-main-kpi-grid .kpi-main b {
  margin-top: 0.04rem;
  font-size: 0.84rem;
}

#view-costing .costing-summary-top .commercial-primary-meta {
  margin-top: 0.08rem;
  gap: 0.18rem;
}

#view-costing .costing-summary-top .commercial-primary-meta .metric-tag {
  font-size: 0.68rem;
  padding: 0.2rem 0.42rem;
}

.executive-summary {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.44rem;
  background: linear-gradient(180deg, #ffffff, #f6f0ff);
}

.executive-head {
  display: flex;
  justify-content: space-between;
  gap: 0.38rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.32rem;
  margin-bottom: 0.32rem;
}

.executive-head h4 {
  margin: 0.1rem 0 0;
  font-size: 0.91rem;
}

.executive-ref-line {
  margin: 0.06rem 0 0;
}

.executive-main-number {
  text-align: right;
}

.executive-main-number small {
  display: block;
  color: var(--ink-soft);
  font-size: 0.73rem;
}

.executive-main-number strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.1rem;
  font-family: var(--font-title);
}

.commercial-kpi-stack {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 0.24rem;
}

.commercial-kpi-primary,
.commercial-kpi-secondary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.24rem;
}

.commercial-kpi-primary .kpi-main,
.commercial-kpi-secondary .kpi-main {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.22rem 0.28rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.commercial-kpi-primary .kpi-main {
  border-color: #8f62da;
  background: linear-gradient(180deg, #f0ddff, #e7d1ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 8px 16px rgba(76, 34, 148, 0.2);
}

.commercial-kpi-secondary .kpi-main {
  border-color: #d8c8f3;
  background: linear-gradient(180deg, #fcf8ff, #f6efff);
}

.commercial-kpi-primary .kpi-main span,
.commercial-kpi-secondary .kpi-main span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.66rem;
  line-height: 1.1;
}

.commercial-kpi-primary .kpi-main b,
.commercial-kpi-secondary .kpi-main b {
  display: block;
  margin-top: 0.08rem;
  line-height: 1.12;
}

.commercial-kpi-primary .kpi-main b {
  font-size: 1rem;
  font-weight: 800;
  color: #341067;
}

.commercial-kpi-secondary .kpi-main b {
  font-size: 0.84rem;
  font-weight: 650;
  color: #5d4789;
}

.commercial-secondary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.24rem;
}

.commercial-secondary-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fefefe;
  padding: 0.24rem 0.28rem;
  min-width: 0;
}

.commercial-secondary-grid article span {
  display: block;
  color: var(--ink-soft);
  font-size: 0.67rem;
}

.commercial-secondary-grid article b {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.summary-secondary-stack {
  display: grid;
  gap: 0.34rem;
}

.summary-fold {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.summary-fold > summary {
  cursor: pointer;
  list-style: none;
  padding: 0.34rem 0.44rem;
  font-size: 0.79rem;
  font-weight: 700;
  color: #4c2e84;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    color var(--motion-fast) var(--ease-standard);
}

.summary-fold > summary:hover {
  background: #f6f0ff;
  color: #3f206f;
}

.summary-fold > summary::-webkit-details-marker {
  display: none;
}

.layers-compact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.28rem;
  padding: 0 0.34rem 0.36rem;
}

.layer-row {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.layer-row summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
  padding: 0.3rem 0.42rem;
}

.layer-row summary::-webkit-details-marker {
  display: none;
}

.layer-row summary span {
  font-size: 0.77rem;
  color: #4a2d80;
}

.layer-row summary b {
  font-size: 0.82rem;
}

.layer-detail-list {
  border-top: 1px solid var(--line);
  padding: 0.35rem 0.48rem 0.38rem;
}

.layer-detail-list p {
  display: flex;
  justify-content: space-between;
  margin: 0.2rem 0;
  font-size: 0.8rem;
}

.layer-detail-list small {
  display: block;
  margin-top: 0.28rem;
  color: #685990;
  font-size: 0.74rem;
}

.negotiation-strip {
  margin: 0;
  border: 1px solid #c8b0ef;
  background: #f3ebff;
  border-radius: 10px;
  padding: 0.3rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}

.negotiation-strip span {
  display: block;
  color: #5f4d88;
  font-size: 0.72rem;
}

.negotiation-strip b {
  display: block;
  margin-top: 0.14rem;
  font-size: 0.82rem;
}

.technical-detail {
  margin-top: 0;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #fbf8ff;
}

.technical-detail summary {
  cursor: pointer;
  padding: 0.45rem 0.55rem;
  font-size: 0.79rem;
  color: #4c2f84;
}

.technical-grid {
  border-top: 1px dashed var(--line-strong);
  padding: 0.45rem 0.55rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.35rem;
  min-width: 0;
}

.technical-grid p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
}

.technical-grid span {
  color: #62578a;
  font-size: 0.72rem;
}

.technical-grid b {
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.52rem;
  background: #ffffff;
}

.warning-stack {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.warning-stack summary {
  cursor: pointer;
  padding: 0.34rem 0.42rem;
  color: #2f4f41;
  font-size: 0.79rem;
  font-weight: 700;
}

.warning-groups {
  border-top: 1px solid var(--line);
  padding: 0.42rem 0.52rem 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.warning-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 0.4rem 0.48rem;
}

.warning-group h5 {
  margin: 0 0 0.22rem;
  font-size: 0.77rem;
}

.warning-group ul {
  margin: 0;
  padding-left: 1rem;
}

.warning-group li {
  margin: 0.2rem 0;
  font-size: 0.78rem;
}

.warning-group.severity-critical {
  border-color: #d3a2a0;
  background: #fff5f5;
}

.warning-group.severity-review {
  border-color: #d7c395;
  background: #fffaf1;
}

.warning-group.severity-info {
  border-color: #b9cfbf;
  background: #f5fbf6;
}

.summary-item b {
  display: block;
  color: var(--ink-soft);
  font-size: 0.76rem;
}

.summary-item span {
  display: block;
  margin-top: 0.2rem;
  font-weight: 700;
}

.status-completo {
  border-left: 4px solid #2f7f57;
}

.status-provisional {
  border-left: 4px solid #b4732f;
  background: #fffaf2;
}

.status-no-disponible {
  border-left: 4px solid #8c2d25;
  background: #fff5f4;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  background: #f9fbf8;
  padding: 0.8rem;
}

.empty-state h4 {
  margin: 0 0 0.4rem;
}

.empty-state p {
  margin: 0;
  color: var(--ink-soft);
}

.warn-text {
  color: var(--warn);
  font-weight: 700;
}

.live-updated {
  animation: livePulse 260ms ease-out;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(35, 106, 74, 0.28);
  }
  100% {
    box-shadow: 0 0 0 8px rgba(35, 106, 74, 0);
  }
}

@media (max-width: 640px) {
  #view-costing .module-intro {
    align-items: stretch;
    display: block;
  }

  #view-costing .costing-selector-controls {
    grid-template-columns: 1fr;
    padding: 0.45rem;
  }

  #view-costing .costing-reference-list {
    grid-template-columns: 1fr;
  }

  #view-costing .costing-reference-card {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 0.5rem;
  }

  #view-costing .costing-reference-thumb {
    width: 40px;
  }

  #view-costing .costing-selector-head,
  #view-costing .costing-selected-title,
  #view-costing .costing-missing-head,
  #view-costing .costing-simple-head {
    flex-direction: column;
    align-items: stretch;
  }

  #view-costing .costing-reference-card-side,
  #view-costing .costing-selected-actions {
    align-items: stretch;
  }

  #view-costing .costing-reference-card-side button,
  #view-costing .costing-selected-actions button,
  #view-costing .costing-simple-actions button {
    width: 100%;
  }

  .document-preview-root {
    padding: 0.55rem;
  }

  .document-preview-toolbar,
  .snapshot-document-hero,
  .snapshot-total-box {
    flex-direction: column;
    align-items: stretch;
  }

  .snapshot-public-grid,
  .snapshot-key-values {
    grid-template-columns: 1fr;
  }

  .snapshot-document-number {
    width: 100%;
    text-align: center;
  }
}

@media print {
  body.document-preview-open,
  body.document-preview-open .document-preview-root {
    background: #fff !important;
  }

  body.document-preview-open .app-shell,
  body.document-preview-open .sidebar-backdrop,
  body.document-preview-open .finance-access-modal,
  body.document-preview-open .document-preview-toolbar {
    display: none !important;
  }

  body.document-preview-open .document-preview-root {
    position: static;
    display: block !important;
    overflow: visible;
    padding: 0;
  }

  body.document-preview-open .document-preview-shell {
    max-width: none;
    margin: 0;
  }

  body.document-preview-open .snapshot-document {
    border: none;
    box-shadow: none;
    padding: 0;
  }

  body,
  .workspace {
    background: #fff;
  }

  .sidebar,
  .workspace-header,
  .actions-row,
  .inline-fields,
  #view-dashboard,
  #view-settings,
  #view-catalog,
  #view-simulator,
  #view-backups,
  .module-intro {
    display: none !important;
  }

  #view-quote {
    display: block !important;
  }

  .card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}

@media (max-width: 1220px) {
  .settings-workbench {
    grid-template-columns: 1fr;
  }

  .costing-secondary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-rail,
  .sticky-card {
    position: static;
  }

  .technical-session-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  #view-costing .costing-selected-workflow {
    grid-template-columns: 1fr;
  }

  #view-costing .costing-missing-panel {
    margin-right: 0;
  }

  #view-costing .costing-selector-controls {
    grid-template-columns: minmax(220px, 1fr) minmax(150px, 0.7fr);
  }

  #view-costing .costing-reference-count {
    max-width: none;
  }

  #view-costing .commercial-kpi-primary,
  #view-costing .commercial-kpi-secondary,
  #view-costing .commercial-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-costing .reference-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #view-costing .costing-selector-controls,
  #view-costing .costing-selected-workflow,
  #view-costing .costing-missing-grid,
  #view-costing .costing-simple-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(78vw, 280px);
    max-width: min(78vw, 280px);
    height: 100vh;
    border-right: 1px solid var(--line);
    border-bottom: none;
    transform: translateX(-105%);
    transition: transform var(--motion-base) var(--ease-standard);
    box-shadow: 0 22px 34px rgba(17, 12, 34, 0.26);
    z-index: 60;
  }

  .nav-close,
  .nav-toggle,
  .sidebar-backdrop {
    display: block;
  }

  .nav-close {
    position: absolute;
    top: 0.45rem;
    right: 0.45rem;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 999px;
    border-color: #a694cb;
    background: #f4eeff;
    color: #4f2a8c;
    font-size: 1rem;
    line-height: 1;
  }

  .nav-toggle {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 9px;
    border-color: #9f82d7;
    background: linear-gradient(145deg, #ede2ff, #ddcbff);
    color: #4e218f;
    font-size: 1rem;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    border: none;
    background: rgba(12, 7, 24, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--motion-base) var(--ease-standard);
    z-index: 50;
    padding: 0;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .main-nav {
    display: flex;
    grid-template-columns: none;
  }

  .workspace-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "toggle title"
      "status status";
    align-items: center;
    gap: 0.35rem 0.48rem;
    padding: 0.42rem 0.5rem;
  }

  .nav-toggle {
    grid-area: toggle;
  }

  .workspace-header .header-main {
    grid-area: title;
    width: 100%;
  }

  .header-status-pill {
    grid-area: status;
    width: 100%;
    white-space: nowrap;
  }

  .brand {
    padding: 0.64rem;
  }

  .brand h1 {
    font-size: 1.04rem;
  }

  .brand p {
    font-size: 0.76rem;
    margin-top: 0.2rem;
  }

  .main-nav {
    gap: 0.3rem;
  }

  .nav-item {
    min-height: 40px;
    padding: 0.36rem 0.48rem;
  }

  .workspace {
    padding: 0.56rem 0.56rem 0.92rem;
  }

  .costing-main,
  .sticky-card,
  .module-intro,
  .card {
    padding: 0.62rem;
  }

  #view-costing .reference-advanced-section .form-grid {
    grid-template-columns: 1fr;
  }

  #view-costing .calc-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 0.18rem;
  }

  #view-costing .calc-toolbar > label,
  #view-costing .calc-toolbar > button,
  #view-costing .calc-toolbar select {
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  #view-costing .calc-toolbar > .calc-more-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  #view-costing .reference-advanced-section h3 {
    font-size: 0.86rem;
  }

  #view-costing .section-description {
    font-size: 0.78rem;
  }

  .executive-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .executive-main-number {
    text-align: left;
  }

  .costing-secondary-row {
    grid-template-columns: 1fr;
  }

  .negotiation-strip,
  .technical-grid,
  .layers-compact {
    grid-template-columns: 1fr;
  }

  .tile-main,
  .tile-warning,
  .tile-next {
    grid-column: span 12;
  }
}

@media (max-width: 768px) {
  .workspace {
    padding: 0.5rem;
  }

  #view-costing .commercial-kpi-primary,
  #view-costing .commercial-kpi-secondary,
  #view-costing .commercial-secondary-grid,
  .sim-summary,
  .form-grid,
  .backup-grid,
  .commercial-kpi-primary,
  .commercial-kpi-secondary,
  .commercial-secondary-grid,
  .technical-grid,
  .negotiation-strip,
  .layers-compact {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-costing .reference-quick-grid,
  #view-costing .commercial-precalc-grid,
  #view-costing .commercial-kpi-primary.compact-main-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-header {
    flex-wrap: wrap;
  }

  .settings-main,
  .settings-workbench,
  .costing-workbench,
  .costing-secondary-row {
    min-width: 0;
    max-width: 100%;
  }

  .technical-summary-top-grid,
  .visual-card {
    grid-template-columns: 1fr;
  }

  .visual-card-head,
  .visual-badges,
  .visual-progress-row,
  .visual-card-meta,
  .visual-card .actions-mini {
    grid-column: 1;
  }

  .visual-card-media {
    width: 100%;
    height: 180px;
  }

  #view-catalog .visual-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  #view-catalog .visual-card-media {
    aspect-ratio: 4 / 5;
    height: auto;
    width: 88px;
  }

  #view-catalog .visual-card-head,
  #view-catalog .visual-progress-row,
  #view-catalog .visual-card-meta {
    grid-column: 2;
  }

  #view-catalog .visual-card .actions-mini {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .workspace-header h2 {
    font-size: 1.06rem;
  }

  .workspace-header .crumb {
    display: none;
  }

  .header-status-pill {
    font-size: 0.66rem;
    padding: 0.22rem 0.34rem;
    width: 100%;
  }

  .commercial-kpi-primary,
  .commercial-kpi-secondary,
  .commercial-secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-costing .reference-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-costing .calc-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-costing .reference-quick-station,
  #view-costing .reference-advanced-section {
    padding: 0.36rem;
  }

  #view-costing .reference-advanced-section summary {
    margin-bottom: 0.3rem;
  }

  .layers-compact,
  .warning-groups {
    gap: 0.36rem;
  }

  .editable-lines-table td input,
  .editable-lines-table td select,
  .editable-lines-table td textarea {
    min-width: 76px;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 0.45rem;
  }

  .module-intro,
  .card,
  .sub-panel {
    padding: 0.5rem;
  }

  .actions-row > button,
  .actions-row > .file-input-label,
  .calc-toolbar > button,
  .calc-toolbar > details,
  .calc-toolbar > label,
  .inline-fields > label {
    width: 100%;
  }

  .technical-session-controls > button,
  .technical-session-controls > label {
    width: 100%;
  }

  .technical-save-toolbar {
    position: static;
  }

  .technical-save-status {
    width: 100%;
  }

  .editable-lines-table td input,
  .editable-lines-table td select,
  .editable-lines-table td textarea {
    min-width: 72px;
  }
}

@media (max-width: 760px) {
  .image-manager-dialog {
    border-radius: 0;
    bottom: 0;
    height: 100dvh;
    left: 0;
    max-height: none;
    max-width: none;
    position: fixed;
    right: 0;
    top: 0;
    transform: none;
    width: 100vw;
  }
}

#view-dashboard .pipeline-board {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 0.62rem;
}

#view-dashboard {
  gap: 0.52rem;
}

#view-dashboard .hero-card {
  align-items: center;
  gap: 0.5rem;
  padding: 0.52rem 0.62rem;
}

#view-dashboard .hero-card h3 {
  font-size: 1.02rem;
  margin: 0.04rem 0 0.08rem;
}

#view-dashboard .hero-card .eyebrow {
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

#view-dashboard .hero-card .section-description {
  display: -webkit-box;
  font-size: 0.74rem;
  line-height: 1.2;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

#view-dashboard .hero-meta {
  gap: 0.24rem;
}

#view-dashboard .hero-meta .metric-tag {
  font-size: 0.68rem;
  padding: 0.18rem 0.38rem;
}

#view-dashboard .panel-module {
  padding: 0.5rem;
}

#view-dashboard .pipeline-head {
  gap: 0.42rem;
}

#view-dashboard .pipeline-head h3 {
  font-size: 1.12rem;
  line-height: 1.08;
}

#view-dashboard .pipeline-head p {
  font-size: 0.78rem;
  line-height: 1.22;
  margin-top: 0.08rem;
}

#view-dashboard .pipeline-actions {
  gap: 0.32rem;
}

#view-dashboard .pipeline-actions button {
  font-size: 0.78rem;
  min-height: 36px;
  padding: 0.34rem 0.52rem;
}

#view-dashboard #pipeline-new-reference {
  min-height: 38px;
  padding-inline: 0.7rem;
}

#view-dashboard .pipeline-kpis {
  gap: 0.35rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.46rem;
}

#view-dashboard .pipeline-kpis article {
  align-items: center;
  border-radius: 8px;
  display: flex;
  gap: 0.24rem;
  justify-content: space-between;
  min-width: 0;
  padding: 0.38rem 0.46rem;
}

#view-dashboard .pipeline-kpis span {
  font-size: 0.62rem;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-dashboard .pipeline-kpis strong {
  flex: 0 0 auto;
  font-size: 1.05rem;
  margin-top: 0;
}

#view-dashboard .pipeline-tabs {
  flex-wrap: nowrap;
  gap: 0.32rem;
  margin-top: 0.48rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding-bottom: 0.14rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

#view-dashboard .pipeline-tabs button {
  flex: 0 0 auto;
  font-size: 0.76rem;
  min-height: 38px;
  padding: 0.34rem 0.52rem;
}

#view-dashboard .pipeline-tabs .pipeline-tab--activas { border-color: #94a3b8; background: #f8fafc; color: #334155; }
#view-dashboard .pipeline-tabs .pipeline-tab--incompletas { border-color: #f59e0b; background: #fffbeb; color: #92400e; }
#view-dashboard .pipeline-tabs .pipeline-tab--falta_imagen { border-color: #38bdf8; background: #f0f9ff; color: #075985; }
#view-dashboard .pipeline-tabs .pipeline-tab--completas { border-color: #86efac; background: #f0fdf4; color: #166534; }
#view-dashboard .pipeline-tabs .pipeline-tab--costeables { border-color: #34d399; background: #ecfdf5; color: #065f46; }
#view-dashboard .pipeline-tabs .pipeline-tab--cotizadas { border-color: #818cf8; background: #eef2ff; color: #3730a3; }
#view-dashboard .pipeline-tabs .pipeline-tab--bloqueadas { border-color: #fca5a5; background: #fef2f2; color: #991b1b; }

#view-dashboard .pipeline-tabs button:hover,
#view-dashboard .pipeline-tabs button:focus-visible {
  border-color: #a78bfa;
  box-shadow: var(--shadow-focus);
  transform: translateY(-1px);
}

#view-dashboard .pipeline-tabs button.is-empty:not(.is-active) {
  background: #fbfafc;
  border-color: #e5e7eb;
  color: #64748b;
}

#view-dashboard .pipeline-tabs button.is-empty:not(.is-active) b {
  background: #f1f5f9;
  color: #64748b;
}

#view-dashboard .pipeline-tabs button.is-active {
  border-color: #a78bfa;
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(76, 29, 149, 0.16);
}

#view-dashboard .pipeline-tabs button.is-active b {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

#view-dashboard .pipeline-tabs .pipeline-tab--activas.is-active { background: linear-gradient(135deg, #6d28d9, #8b5cf6); }
#view-dashboard .pipeline-tabs .pipeline-tab--incompletas.is-active { background: linear-gradient(135deg, #92400e, #f59e0b); }
#view-dashboard .pipeline-tabs .pipeline-tab--falta_imagen.is-active { background: linear-gradient(135deg, #075985, #0ea5e9); }
#view-dashboard .pipeline-tabs .pipeline-tab--completas.is-active { background: linear-gradient(135deg, #166534, #22c55e); }
#view-dashboard .pipeline-tabs .pipeline-tab--costeables.is-active { background: linear-gradient(135deg, #065f46, #10b981); }
#view-dashboard .pipeline-tabs .pipeline-tab--cotizadas.is-active { background: linear-gradient(135deg, #3730a3, #6366f1); }
#view-dashboard .pipeline-tabs .pipeline-tab--bloqueadas.is-active { background: linear-gradient(135deg, #991b1b, #ef4444); }

.main-nav .nav-item[data-view="dashboard"] { order: 1; }
.main-nav .nav-item[data-view="technical"] { order: 2; }
.main-nav .nav-item[data-view="catalog"] { order: 3; }
.main-nav .nav-admin-item { order: 40; }
.main-nav .nav-item[data-view="costing"] { order: 41; }
.main-nav .nav-item[data-view="history"] { order: 42; }
.main-nav .nav-item[data-view="settings"] { order: 43; }
.main-nav .nav-item[data-view="simulator"],
.main-nav .nav-item[data-view="quote"],
.main-nav .nav-item[data-view="backups"] { order: 44; }

.nav-admin-item {
  border-color: #c4b5fd;
  background: #f5f3ff;
  color: #4c1d95;
}

.nav-admin-item:hover,
.nav-admin-item:focus-visible {
  background: #ede9fe;
  border-color: #a78bfa;
  box-shadow: var(--shadow-focus);
}

.nav-admin-item.is-admin-active {
  background: linear-gradient(135deg, #6d28d9, #8b5cf6);
  border-color: #7c3aed;
  color: #ffffff;
}

.nav-item[data-view="costing"],
.nav-item[data-view="history"],
.nav-item[data-view="settings"] {
  margin-left: 0.32rem;
  padding-left: 0.56rem;
}

@media (min-width: 1180px) {
  #view-dashboard .pipeline-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

#view-dashboard .pipeline-card {
  background: #fff;
  align-items: start;
  gap: 0;
  grid-template-columns: 96px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  padding: 0;
}

#view-dashboard .pipeline-card-media {
  align-self: start;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  border-right: 1px solid var(--color-border);
  height: 84px;
  margin: 0.5rem 0 0.5rem 0.5rem;
  min-height: 0;
  overflow: hidden;
  width: 84px;
}

#view-dashboard .pipeline-card-media img,
#view-dashboard .pipeline-card-media .pipeline-image-fallback {
  aspect-ratio: 1 / 1;
  height: 100%;
  object-fit: cover;
  object-position: center;
  width: 100%;
}

#view-dashboard .pipeline-card-media .pipeline-image-fallback {
  font-size: 0.68rem;
  line-height: 1.05;
  padding: 0.28rem;
}

#view-dashboard .pipeline-card-body {
  align-content: start;
  gap: 0.22rem;
  min-width: 0;
  padding: 0.5rem 0.56rem 0.5rem 0;
}

#view-dashboard .pipeline-card-body > .pipeline-state {
  display: none;
}

#view-dashboard .pipeline-card-topline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  justify-content: space-between;
  min-width: 0;
}

#view-dashboard .pipeline-state,
#view-dashboard .pipeline-score {
  border-radius: var(--radius-pill);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.15;
  padding: 0.14rem 0.36rem;
  white-space: nowrap;
}

#view-dashboard .pipeline-state {
  max-width: 68%;
  overflow: hidden;
  text-overflow: ellipsis;
}

#view-dashboard .pipeline-score {
  background: var(--color-neutral-bg);
  border: 1px solid #e2e8f0;
  color: var(--color-text-muted);
  flex: 0 0 auto;
}

#view-dashboard .pipeline-card h4 {
  display: -webkit-box;
  font-size: 0.94rem;
  line-height: 1.12;
  margin-top: -0.08rem;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#view-dashboard .pipeline-code {
  font-size: 0.68rem;
  line-height: 1.1;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-dashboard .pipeline-progress-line {
  gap: 0.34rem;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  width: 100%;
}

#view-dashboard .pipeline-progress-line strong {
  font-size: 0.76rem;
  white-space: nowrap;
}

#view-dashboard .pipeline-blocker {
  color: var(--color-warning);
  font-size: 0.78rem;
  line-height: 1.18;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-dashboard .pipeline-next,
#view-dashboard .pipeline-owner {
  display: none;
}

#view-dashboard .pipeline-badges,
#view-dashboard .pipeline-finance {
  gap: 0.2rem;
}

#view-dashboard .pipeline-badges span,
#view-dashboard .pipeline-finance span {
  font-size: 0.64rem;
  padding: 0.12rem 0.32rem;
}

#view-dashboard .pipeline-card-footer {
  align-items: center;
  display: grid;
  gap: 0.32rem;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 0.12rem;
  padding-top: 0.32rem;
}

#view-dashboard .pipeline-card-footer small {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-dashboard .card-quick-actions {
  display: grid;
  gap: 0.3rem;
  grid-template-columns: minmax(0, 1fr) auto;
  justify-content: flex-end;
  min-width: 0;
}

#view-dashboard .card-action-primary {
  min-width: 0;
  white-space: normal;
}

#view-dashboard .card-more-actions {
  position: relative;
}

#view-dashboard .card-more-actions summary {
  cursor: pointer;
  list-style: none;
  min-width: 42px;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

#view-dashboard .card-more-actions summary::-webkit-details-marker {
  display: none;
}

#view-dashboard .card-more-menu {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-medium);
  display: grid;
  gap: 0.18rem;
  min-width: 8.5rem;
  padding: 0.32rem;
  position: absolute;
  right: 0;
  top: calc(100% + 0.28rem);
  z-index: 20;
}

#view-dashboard .card-more-menu button {
  justify-content: flex-start;
  width: 100%;
}

@media (max-width: 760px) {
  #view-dashboard {
    gap: 0.4rem;
  }

  #view-dashboard .hero-card {
    align-items: flex-start;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.44rem 0.5rem;
  }

  #view-dashboard .hero-meta {
    display: none;
  }

  #view-dashboard .panel-module {
    padding: 0.42rem;
  }

  #view-dashboard .pipeline-head {
    gap: 0.34rem;
  }

  #view-dashboard .pipeline-head h3 {
    font-size: 1.02rem;
  }

  #view-dashboard .pipeline-head p {
    display: none;
  }

  #view-dashboard .pipeline-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  #view-dashboard #pipeline-new-reference {
    grid-column: 1 / -1;
  }

  #view-dashboard .pipeline-actions button {
    min-height: 40px;
    width: 100%;
  }

  #view-dashboard .pipeline-kpis {
    gap: 0.24rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0.36rem;
  }

  #view-dashboard .pipeline-kpis article {
    display: grid;
    gap: 0.08rem;
    justify-items: center;
    padding: 0.3rem 0.24rem;
    text-align: center;
  }

  #view-dashboard .pipeline-kpis span {
    max-width: 100%;
  }

  #view-dashboard .pipeline-kpis strong {
    font-size: 1rem;
  }

  #view-dashboard .pipeline-tabs {
    margin-left: -0.1rem;
    margin-right: -0.1rem;
    margin-top: 0.34rem;
    padding-inline: 0.1rem;
  }

  #view-dashboard .pipeline-tabs button {
    min-height: 40px;
    padding: 0.34rem 0.56rem;
  }

  #view-dashboard .pipeline-board {
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1fr);
    margin-top: 0.42rem;
  }

  #view-dashboard .pipeline-card {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  #view-dashboard .pipeline-card-media {
    height: 72px;
    margin: 0.5rem 0 0.5rem 0.5rem;
    width: 72px;
  }

  #view-dashboard .pipeline-card-footer {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 0.04rem;
  }

  #view-dashboard .card-quick-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-dashboard .card-action-primary {
    min-width: 0;
  }

  #view-dashboard .card-more-menu {
    max-width: calc(100vw - 2rem);
    min-width: 8rem;
  }
}

@media (max-width: 360px) {
  .workspace-header {
    gap: 0.35rem;
  }

  .workspace-header h2 {
    font-size: 0.98rem;
  }

  .header-status-pill {
    font-size: 0.62rem;
    padding: 0.18rem 0.26rem;
  }

  #view-costing .reference-quick-grid,
  #view-costing .calc-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .commercial-kpi-primary,
  .commercial-kpi-secondary,
  .commercial-secondary-grid {
    grid-template-columns: 1fr;
  }

  #view-costing .commercial-kpi-primary.compact-main-kpi-grid,
  #view-costing .commercial-precalc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 340px) {
  #view-costing .commercial-kpi-primary.compact-main-kpi-grid,
  #view-costing .commercial-precalc-grid {
    grid-template-columns: 1fr;
  }
}

/* Technical ficha 2.0 visual shell */

#view-technical {
  gap: 0.75rem;
  overflow-x: clip;
}

#view-technical,
#view-technical * {
  min-width: 0;
}

.technical-hero {
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 10%, rgba(255, 255, 255, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(46, 16, 101, 0.98), rgba(91, 33, 182, 0.96)),
    var(--color-primary-800);
  box-shadow: 0 18px 42px rgba(46, 16, 101, 0.24);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.82rem 0.92rem;
}

.technical-hero .eyebrow,
.technical-hero .section-description {
  display: none;
}

.technical-hero h3 {
  color: #fff;
  font-family: var(--font-title);
  font-size: clamp(1.28rem, 1.8vw, 1.7rem);
  margin: 0;
}

.technical-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
}

.technical-save-status {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  gap: 0.42rem;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.25;
  max-width: 320px;
  overflow-wrap: anywhere;
  padding: 0.38rem 0.62rem;
  transition:
    background-color var(--motion-base) var(--ease-standard),
    border-color var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    color var(--motion-base) var(--ease-standard);
}

.technical-save-status::before {
  align-items: center;
  background: currentColor;
  border-radius: var(--radius-pill);
  content: "";
  display: inline-flex;
  flex: 0 0 auto;
  height: 0.5rem;
  opacity: 0.72;
  width: 0.5rem;
}

.technical-save-status[data-state="saved"] {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.26);
  color: var(--color-success);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.08);
}

.technical-save-status[data-state="dirty"],
.technical-save-status[data-state="local_pending"],
.technical-save-status[data-state="saving_local"],
.technical-save-status[data-state="saving_remote"] {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.24);
  color: var(--color-warning);
}

.technical-save-status[data-state="saving_local"]::before,
.technical-save-status[data-state="saving_remote"]::before {
  animation: saveStatusPulse 900ms var(--ease-standard) infinite;
  background: transparent;
  border: 2px solid currentColor;
  border-right-color: transparent;
  height: 0.62rem;
  opacity: 1;
  width: 0.62rem;
}

.technical-save-status[data-state="error"],
.technical-save-status[data-state="offline"] {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.24);
  color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.08);
}

@keyframes saveStatusPulse {
  to {
    transform: rotate(360deg);
  }
}

.primary-action,
#view-technical .primary-action {
  background: linear-gradient(135deg, var(--color-primary-800), var(--color-primary-600));
  border-color: var(--color-primary-700);
  color: #fff;
  box-shadow: 0 10px 22px rgba(76, 29, 149, 0.18);
  font-weight: 900;
  min-height: 42px;
}

#view-technical .technical-hero .primary-action {
  background: linear-gradient(135deg, #ffffff, #f0e7ff);
  border-color: rgba(255, 255, 255, 0.72);
  color: var(--color-primary-900);
  box-shadow: 0 12px 28px rgba(31, 22, 51, 0.18);
}

.secondary-action,
#view-technical .secondary-action {
  background: #fff;
  border-color: var(--color-primary-600);
  color: var(--color-primary-800);
}

#view-technical .technical-hero .secondary-action {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.34);
  color: #fff;
}

.technical-session-layout {
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 1024px) {
  .technical-session-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  }
}

.technical-session-main,
.technical-session-rail {
  border-color: var(--color-border);
  background: linear-gradient(180deg, #ffffff, var(--color-surface-soft));
}

.technical-session-main h4,
.technical-session-rail h4 {
  color: var(--color-primary-900);
}

.technical-reference-bar {
  align-items: end;
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  display: grid;
  gap: 0.6rem;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 0.65rem;
  padding: 0.62rem;
}

.technical-reference-picker span {
  color: var(--color-text-muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.technical-reference-picker select {
  border-color: var(--color-border-strong);
  font-weight: 700;
  width: 100%;
}

.technical-more-actions {
  justify-self: end;
  position: relative;
}

.technical-more-actions > summary {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-primary-800);
  cursor: pointer;
  font-weight: 800;
  list-style: none;
  padding: 0.42rem 0.58rem;
}

.technical-more-actions > summary::-webkit-details-marker {
  display: none;
}

.technical-more-actions-menu {
  align-items: stretch;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(76, 29, 149, 0.16);
  display: grid;
  gap: 0.4rem;
  margin-top: 0.42rem;
  min-width: 220px;
  padding: 0.48rem;
  position: absolute;
  right: 0;
  z-index: 8;
}

.technical-more-actions-menu button {
  justify-content: flex-start;
  text-align: left;
  width: 100%;
}

.technical-danger-zone {
  background: rgba(185, 28, 28, 0.06);
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: var(--radius-md);
  margin-top: 24px;
  padding: 14px 16px;
}

.technical-danger-zone summary {
  color: #7f1d1d;
  cursor: pointer;
  font-weight: 700;
}

.technical-danger-zone[open] {
  display: grid;
  gap: 12px;
}

.technical-danger-zone strong {
  color: #7f1d1d;
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.technical-danger-zone p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

.technical-session-controls {
  align-items: end;
  margin: 0;
}

.technical-session-controls > label {
  flex: 1 1 280px;
}

.technical-session-controls button {
  background: #fff;
  border-color: var(--color-border);
  color: var(--color-primary-800);
  padding: 0.38rem 0.52rem;
}

.technical-top-summary {
  background: #fff;
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
  margin-top: 0;
}

.technical-summary-top-grid {
  align-items: center;
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
  display: grid;
  gap: 0.72rem;
  grid-template-columns: 76px minmax(0, 1fr);
  padding: 0.68rem;
}

.technical-summary-thumb {
  background: var(--color-primary-050);
  border-color: var(--color-border);
  border-radius: var(--radius-md);
  height: 76px;
  width: 76px;
}

.technical-summary-code {
  color: var(--color-primary-700);
  font-weight: 800;
}

.technical-hero-context {
  align-items: center;
  color: rgba(255, 255, 255, 0.9);
  display: block;
  font-size: 0.98rem;
  font-weight: 800;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

.technical-reference-line {
  color: var(--color-warning);
  font-size: 1rem;
  font-weight: 900;
  margin: 0.25rem 0 0;
}

.technical-decision-grid {
  display: grid;
  gap: 0.62rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0.58rem;
}

.technical-decision-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-low);
  min-height: 0;
  overflow: hidden;
  padding: 0.82rem;
  position: relative;
}

.technical-decision-block::before {
  border-radius: var(--radius-pill);
  content: "";
  inset: 0 auto 0 0;
  opacity: 0.4;
  position: absolute;
  width: 3px;
}

.technical-decision-block span,
.alert-card span {
  display: block;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1.15;
  margin-bottom: 0.22rem;
  text-transform: uppercase;
}

.technical-decision-block strong {
  color: var(--color-primary-900);
  display: -webkit-box;
  font-family: var(--font-title);
  font-size: clamp(1rem, 1.55vw, 1.24rem);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.08;
  overflow-wrap: anywhere;
  overflow: hidden;
}

.technical-decision-block--primary {
  background: linear-gradient(135deg, #3b0764, #6d28d9);
  border-color: #7c3aed;
  color: #fff;
}

.technical-decision-block--primary strong,
.technical-decision-block--primary p {
  color: #fff;
}

.technical-decision-block--primary strong {
  display: block;
  font-size: clamp(1.82rem, 2.6vw, 2.18rem);
}

.technical-decision-block p {
  display: -webkit-box;
  font-size: 0.74rem;
  font-weight: 850;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-height: 1.22;
  margin: 0.3rem 0 0;
  overflow: hidden;
}

.technical-decision-block.success {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.36);
}

.technical-decision-block.success::before {
  background: var(--color-success);
}

.technical-decision-block.warning {
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.42);
}

.technical-decision-block.warning::before {
  background: var(--color-warning);
}

.technical-decision-block.danger {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.42);
}

.technical-decision-block.danger::before {
  background: var(--color-danger);
}

.technical-decision-block.info {
  background: #f5f3ff;
  border-color: rgba(109, 40, 217, 0.28);
}

.technical-decision-block.info::before {
  background: var(--color-primary-700);
}

.technical-decision-block.technical-decision-block--primary.success,
.technical-decision-block.technical-decision-block--primary.warning,
.technical-decision-block.technical-decision-block--primary.danger,
.technical-decision-block.technical-decision-block--primary.info {
  background: linear-gradient(135deg, #3b0764, #6d28d9);
  border-color: #7c3aed;
  color: #fff;
}

.technical-decision-block.technical-decision-block--primary.success strong,
.technical-decision-block.technical-decision-block--primary.warning strong,
.technical-decision-block.technical-decision-block--primary.danger strong,
.technical-decision-block.technical-decision-block--primary.info strong,
.technical-decision-block.technical-decision-block--primary.success p,
.technical-decision-block.technical-decision-block--primary.warning p,
.technical-decision-block.technical-decision-block--primary.danger p,
.technical-decision-block.technical-decision-block--primary.info p {
  color: #fff;
}

.technical-hero-context-pill {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 900;
  line-height: 1.2;
  max-width: 100%;
  padding: 0.18rem 0.44rem;
}

.technical-hero-context-pill.success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.technical-hero-context-pill.warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.technical-hero-context-pill.danger {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.technical-hero-context-pill.info {
  background: var(--color-primary-050);
  color: var(--color-primary-800);
}

.technical-quick-signal {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  font-weight: 900;
  margin-top: 0.4rem;
  padding: 0.36rem 0.48rem;
}

.technical-quick-signal.success {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.22);
  color: var(--color-success);
}

.technical-quick-signal.warning {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.28);
  color: var(--color-warning);
}

.technical-quick-signal.danger {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.28);
  color: var(--color-danger);
}

.technical-quick-signal.info {
  background: var(--color-primary-050);
  color: var(--color-primary-800);
}

.technical-kpi-grid {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 0.8rem;
}

.technical-kpi-card {
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: 0 14px 26px rgba(46, 16, 101, 0.1);
  min-height: 124px;
  padding: 0.72rem;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.technical-kpi-card:hover {
  box-shadow: 0 18px 34px rgba(46, 16, 101, 0.14);
  transform: translateY(-1px);
}

.technical-kpi-card span {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.technical-kpi-card strong {
  color: var(--color-primary-900);
  display: block;
  font-family: var(--font-title);
  font-size: clamp(1.42rem, 2.6vw, 2.3rem);
  line-height: 1.02;
  margin-top: 0.18rem;
  overflow-wrap: anywhere;
}

.technical-kpi-card small {
  font-size: 0.48em;
}

.technical-kpi-card p {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0.32rem 0 0;
}

.technical-kpi-card.success {
  border-color: rgba(4, 120, 87, 0.25);
  background: linear-gradient(180deg, #ffffff, var(--color-success-bg));
}

.technical-kpi-card.warning {
  border-color: rgba(180, 83, 9, 0.28);
  background: linear-gradient(180deg, #ffffff, var(--color-warning-bg));
}

.technical-kpi-card.danger {
  border-color: rgba(185, 28, 28, 0.28);
  background: linear-gradient(180deg, #ffffff, var(--color-danger-bg));
}

.technical-kpi-card.info {
  border-color: var(--color-border);
  background: linear-gradient(180deg, #ffffff, var(--color-primary-050));
}

.technical-progress {
  background: #eee7fb;
  border-radius: 999px;
  height: 8px;
  margin-top: 0.32rem;
  overflow: hidden;
}

.technical-progress i {
  background: linear-gradient(90deg, var(--color-primary-700), var(--color-primary-600));
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width var(--motion-base) var(--ease-standard);
}

.technical-progress--large {
  background: rgba(255, 255, 255, 0.22);
  height: 8px;
}

.technical-progress--large i {
  background: #ffffff;
}

.technical-chip {
  background: var(--color-primary-050);
  border-color: var(--color-border);
  color: var(--color-primary-800);
  font-size: 0.72rem;
}

.technical-chip.success {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.22);
  color: var(--color-success);
}

.technical-chip.warning {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.22);
  color: var(--color-warning);
}

.technical-chip-list.compact {
  gap: 0.32rem;
}

#technical-session-form {
  display: grid;
  gap: 1.1rem;
  margin-top: 0.7rem;
}

.technical-active-section-shell {
  background:
    linear-gradient(180deg, rgba(250, 245, 255, 0.96), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-radius: calc(var(--radius-md) + 4px);
  box-shadow: 0 18px 36px rgba(76, 29, 149, 0.11);
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
  padding: 0.68rem;
}

.technical-section-nav {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.42rem;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  padding: 0.48rem;
  position: sticky;
  top: 0.4rem;
  z-index: 8;
}

.technical-active-section-shell .technical-section-nav {
  position: static;
  top: auto;
}

.technical-section-mobile-select {
  display: none;
}

.technical-section-chip {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(124, 58, 237, 0.16);
  border-radius: var(--radius-sm);
  color: var(--color-primary-900);
  cursor: pointer;
  display: grid;
  gap: 0.12rem;
  grid-template-columns: 1fr auto;
  min-height: 50px;
  padding: 0.42rem 0.52rem;
  text-align: left;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

.technical-section-chip:hover,
.technical-section-chip:focus-visible {
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
  outline: none;
}

.technical-section-chip.is-active {
  background: var(--color-primary-050);
  border-color: var(--color-primary-600);
  box-shadow: 0 10px 20px rgba(76, 29, 149, 0.11);
}

.technical-section-chip-group {
  color: var(--color-text-muted);
  font-size: 0.62rem;
  font-weight: 900;
  grid-column: 1 / -1;
  letter-spacing: 0;
  text-transform: uppercase;
}

.technical-section-chip-main {
  font-size: 0.86rem;
  font-weight: 900;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technical-section-chip-count {
  align-self: center;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
  padding: 0.18rem 0.42rem;
  white-space: nowrap;
}

.technical-section-chip.is-complete .technical-section-chip-count {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.technical-section-chip.is-partial .technical-section-chip-count {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.technical-section-chip.is-pending .technical-section-chip-count {
  background: #f3f4f6;
  color: #4b5563;
}

.technical-section-chip.is-alert .technical-section-chip-count {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.technical-section-card {
  background: #fff;
  border: 1px solid rgba(124, 58, 237, 0.18);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 24px rgba(76, 29, 149, 0.075);
  margin: 0;
  padding: 0.72rem;
  transition:
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

.technical-section-card[open],
.technical-section-card.is-active {
  border-color: var(--color-border-strong);
  box-shadow: none;
}

.technical-section-card + .technical-section-card {
  margin-top: 0.55rem;
}

.technical-section-summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  list-style: none;
}

.technical-section-summary::-webkit-details-marker {
  display: none;
}

.technical-section-title {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: 0.98rem;
  font-weight: 800;
}

.technical-section-panel-head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.technical-section-panel-head h5 {
  color: var(--color-primary-900);
  font-family: var(--font-title);
  font-size: 1.04rem;
  margin: 0.08rem 0 0;
}

.technical-section-panel-group {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.technical-section-meta {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  min-width: 48px;
  padding: 0.26rem 0.52rem;
  text-align: center;
  white-space: nowrap;
}

.technical-section-signal {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
  margin: 0.48rem 0 0;
}

.technical-section-signal span {
  background: var(--color-warning-bg);
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-radius: 999px;
  color: var(--color-warning);
  font-size: 0.72rem;
  font-weight: 850;
  padding: 0.18rem 0.42rem;
}

.technical-section-meta.is-complete {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.technical-section-meta.is-partial {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.technical-section-meta.is-pending {
  background: #f3f4f6;
  color: #4b5563;
}

.technical-section-meta.is-alert {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.technical-section-card .section-description {
  margin: 0.5rem 0 0.55rem;
}

.technical-form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field-group,
.form-stack {
  display: grid;
  gap: var(--space-3);
}

.field-group-header {
  display: grid;
  gap: 0.18rem;
}

.field-group-title {
  color: var(--color-text);
  font-family: var(--font-title);
  font-size: var(--text-md);
  font-weight: 900;
}

.field-group-subtitle {
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.form-grid-2 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid-3 {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.technical-form-grid--datos_basicos {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.technical-form-grid--datos_basicos .field-label[data-field-key="referenceName"],
.technical-form-grid--datos_basicos .field-label[data-field-key="imageUrl"] {
  grid-column: span 2;
}

.technical-primary-image-summary {
  display: grid;
  grid-template-columns: minmax(92px, 132px) 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.technical-primary-image-preview {
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
}

.technical-primary-image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.technical-primary-image-empty,
.technical-primary-image-fallback {
  padding: 8px;
  color: var(--muted);
  text-align: center;
  font-size: var(--text-sm);
}

.technical-primary-image-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.technical-primary-image-copy p {
  margin: 0;
  color: var(--muted);
}

.technical-form-grid--datos_costear {
  align-items: start;
  grid-template-columns: repeat(2, minmax(190px, 1fr));
}

.technical-form-grid--datos_costear .field-label[data-field-key="recommendedYarn"] {
  grid-column: span 2;
}

.technical-form-grid--evidencia_minima,
.technical-form-grid--checklist,
.technical-form-grid--dificultad_simple {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.technical-form-grid--evidencia_minima .field-label[data-field-key="technicalObservation"],
.technical-form-grid--dificultad_simple .field-label[data-field-key="generalObservation"],
.technical-form-grid--historial .field-label,
.technical-form-grid--observaciones .field-label {
  grid-column: 1 / -1;
}

.technical-form-grid--avanzado {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.technical-form-grid--avanzado .field-label[data-field-key="driveUrl"],
.technical-form-grid--avanzado .field-label[data-field-key="suggestedMachine"] {
  grid-column: span 2;
}

#view-technical .field-label {
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.58rem;
}

#view-technical input,
#view-technical select,
#view-technical textarea {
  border-color: var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  min-height: 42px;
}

#view-technical input[type="checkbox"] {
  border-radius: 5px;
  height: 20px;
  min-height: 20px;
  width: 20px;
}

#view-technical input:focus,
#view-technical select:focus,
#view-technical textarea:focus {
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.17);
}

.technical-section-panel.is-active {
  animation: panelEnter var(--motion-slow) var(--ease-out);
}

@keyframes panelEnter {
  from {
    opacity: 0.78;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.technical-inline-summary {
  background: var(--color-primary-050);
  border-color: var(--color-border);
}

.technical-inline-alert {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.28);
}

.decision-card,
.alert-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-bottom: 0.65rem;
  overflow: hidden;
  padding: 0.72rem;
  position: relative;
}

.decision-card::before,
.alert-card::before {
  border-radius: var(--radius-pill);
  content: "";
  inset: 0 auto 0 0;
  opacity: 0.36;
  position: absolute;
  width: 3px;
}

.decision-card span {
  color: var(--color-text-muted);
  display: block;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.decision-card strong {
  color: var(--color-primary-900);
  display: block;
  font-family: var(--font-title);
  font-size: 1.15rem;
  margin-top: 0.18rem;
}

.decision-card p,
.alert-card p,
.alert-card li {
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
}

.decision-card.success,
.alert-card--success {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.22);
  color: var(--color-success);
}

.decision-card.success::before,
.alert-card--success::before {
  background: var(--color-success);
}

.decision-card.warning,
.alert-card--warning {
  background: var(--color-warning-bg);
  border-color: rgba(180, 83, 9, 0.24);
  color: var(--color-warning);
}

.decision-card.warning::before,
.alert-card--warning::before {
  background: var(--color-warning);
}

.alert-card--danger {
  background: var(--color-danger-bg);
  border-color: rgba(185, 28, 28, 0.24);
  color: var(--color-danger);
}

.alert-card--danger::before {
  background: var(--color-danger);
}

.alert-card--info {
  background: var(--color-primary-050);
  border-color: var(--color-border);
  color: var(--color-primary-800);
}

.alert-card--info::before {
  background: var(--color-primary-700);
}

.alert-card ul,
.action-list {
  margin: 0;
  padding-left: 1.05rem;
}

.action-list {
  background: var(--color-warning-bg);
  border: 1px solid rgba(180, 83, 9, 0.24);
  border-radius: var(--radius-md);
  color: var(--color-warning);
  display: grid;
  gap: 0.32rem;
  font-size: 0.86rem;
  font-weight: 900;
  margin-bottom: 0.7rem;
  padding-bottom: 0.62rem;
  padding-top: 0.62rem;
}

.technical-session-rail {
  position: sticky;
  top: 0.75rem;
}

#view-technical .technical-session-rail {
  align-self: start;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.92));
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  margin-top: 0.9rem;
  opacity: 0.94;
}

#view-technical .technical-session-rail h4 {
  color: var(--color-text-muted);
  font-size: 0.94rem;
}

@media (max-width: 1200px) {
  .technical-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .pipeline-head {
    grid-template-columns: 1fr;
  }

  .pipeline-actions {
    justify-content: flex-start;
  }

  .pipeline-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .technical-hero {
    grid-template-columns: 1fr;
  }

  .technical-hero-actions {
    justify-content: stretch;
  }

  .technical-hero-actions > * {
    flex: 1 1 100%;
  }

  .technical-reference-bar {
    grid-template-columns: 1fr;
  }

  .technical-more-actions {
    justify-self: stretch;
  }

  .technical-more-actions-menu {
    position: static;
    min-width: 0;
  }

  .technical-danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .technical-session-rail {
    position: static;
  }

  .technical-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .technical-decision-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 0.46rem 0.42rem 0.82rem;
  }

  .workspace-header {
    border-radius: var(--radius-md);
    margin-bottom: 0.45rem;
    padding: 0.36rem 0.42rem;
  }

  .workspace-header h2 {
    font-size: 0.98rem;
    margin-top: 0;
  }

  .nav-toggle {
    height: 36px;
    width: 36px;
  }

  .header-status-pill {
    font-size: 0.64rem;
    justify-self: start;
    padding: 0.18rem 0.36rem;
    width: auto;
  }

  .catalog-module {
    padding: 0.5rem;
  }

  .catalog-search-bar {
    gap: 0.2rem;
    margin-bottom: 0.42rem;
  }

  .catalog-search-bar input {
    min-height: 40px;
  }

  .catalog-filters-collapse {
    margin-bottom: 0.48rem;
  }

  .catalog-filters-collapse > summary {
    padding: 0.4rem 0.5rem;
  }

  .pipeline-kpis,
  .pipeline-board {
    grid-template-columns: 1fr;
  }

  .pipeline-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .visual-card {
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 0.58rem;
    padding: 0.62rem 0.62rem 0.62rem 0.72rem;
  }

  .visual-card-media {
    height: 116px;
    width: 92px;
  }

  .visual-card-head,
  .visual-progress-row,
  .visual-card-meta,
  .visual-card .actions-mini {
    grid-column: 2;
  }

  .visual-card .actions-mini {
    align-items: stretch;
  }

  .visual-card .actions-mini > button,
  .visual-card .actions-mini > details {
    flex: 1 1 auto;
  }

  #view-catalog .catalog-list {
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 0.56rem;
  }

  #view-catalog .visual-card {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 0.46rem 0.56rem;
    padding: 0.52rem 0.5rem 0.58rem 0.6rem;
  }

  #view-catalog .visual-card-media {
    height: auto;
    width: 76px;
  }

  #view-catalog .visual-card .actions-mini {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }

  #view-catalog .visual-card .actions-mini > button,
  #view-catalog .visual-card .actions-mini > details {
    flex: initial;
  }

  .pipeline-actions button,
  .pipeline-tabs button {
    flex: 1 1 auto;
  }

  .pipeline-quick-head,
  .pipeline-quick-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .technical-hero,
  .technical-session-main,
  .technical-session-rail,
  .technical-section-card {
    border-radius: var(--radius-md);
  }

  .technical-hero {
    gap: 0.48rem;
    padding: 0.56rem;
  }

  .technical-hero-actions {
    gap: 0.38rem;
  }

  .technical-hero-actions > * {
    flex: 1 1 auto;
  }

  .technical-save-status {
    flex: 1 1 100%;
    font-size: 0.68rem;
    min-height: 0;
    padding: 0.28rem 0.44rem;
  }

  #view-technical .technical-hero .primary-action,
  #view-technical .technical-hero .secondary-action {
    flex: 1 1 calc(50% - 0.25rem);
    min-height: 38px;
    padding-inline: 0.45rem;
  }

  .technical-save-status,
  #view-technical .primary-action {
    min-height: 38px;
  }

  .technical-top-summary {
    padding: 0.5rem;
  }

  .technical-summary-top-grid {
    align-items: start;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.52rem;
  }

  .technical-summary-thumb {
    height: 72px;
    width: 72px;
  }

  .technical-summary-head h4 {
    font-size: 1rem;
    margin-bottom: 0.18rem;
  }

  .technical-decision-grid {
    gap: 0.4rem;
  }

  .technical-decision-block {
    padding: 0.48rem 0.55rem;
  }

  .technical-decision-block span {
    font-size: 0.58rem;
  }

  .technical-decision-block strong {
    font-size: 1rem;
  }

  .technical-decision-block p {
    font-size: 0.72rem;
    line-height: 1.22;
    margin-top: 0.18rem;
  }

  .technical-decision-block--primary strong {
    font-size: 1.45rem;
  }

  .technical-progress--large {
    height: 8px;
  }

  .image-gallery-head {
    align-items: stretch;
    flex-direction: column;
  }

  .image-gallery-compact-primary {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .image-gallery-compact-primary .image-gallery-primary-thumb,
  .image-gallery-compact-primary .image-gallery-empty {
    min-height: 58px;
    width: 68px;
  }

  .image-gallery-counts {
    grid-template-columns: 1fr;
  }

  .image-gallery-compact-actions > button,
  .image-gallery-compact-actions .image-gallery-upload-trigger,
  .image-gallery-compact-actions .image-gallery-upload-trigger > button {
    width: 100%;
  }

  .image-manager-dialog {
    border-radius: 0;
    inset: 0;
    max-height: none;
    max-width: none;
    top: 0;
    transform: none;
    width: 100%;
  }

  .image-manager-header {
    align-items: stretch;
    flex-direction: column;
    padding: 0.78rem;
  }

  .image-manager-header > button {
    width: 100%;
  }

  .image-manager-body {
    align-content: start;
    padding: 0.72rem;
  }

  .image-manager-tabs {
    margin-left: -0.72rem;
    margin-right: -0.72rem;
    padding: 0 0.72rem 0.5rem;
  }

  .image-manager-tab {
    font-size: 0.76rem;
    min-height: 42px;
    padding: 0.42rem 0.58rem;
  }

  .image-gallery-section-head,
  .image-gallery-primary-card {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .image-gallery-section-head {
    flex-direction: column;
  }

  .image-gallery-primary-thumb {
    max-width: 220px;
  }

  .image-gallery-grid,
  .image-manager-body .image-gallery-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .image-gallery-thumb {
    aspect-ratio: 1 / 1;
    height: auto;
  }

  .image-gallery-actions button,
  .image-gallery-actions a,
  .image-gallery-links button,
  .image-gallery-links a {
    min-height: 36px;
  }

  .image-gallery-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .image-gallery-more-menu {
    max-width: calc(100vw - 1.4rem);
    min-width: 0;
  }

  .image-gallery-more-trigger {
    justify-content: center;
    width: 100%;
  }

  .image-lightbox-dialog {
    max-height: 92vh;
    max-width: 94vw;
    padding: 0.55rem;
  }

  .image-lightbox-dialog img {
    max-height: 64vh;
  }

  .technical-form-grid,
  #view-costing .reference-quick-grid {
    grid-template-columns: 1fr;
  }

  .technical-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .technical-session-controls > button,
  .technical-session-controls > label {
    width: 100%;
  }

  .technical-section-nav {
    display: none;
  }

  .technical-section-mobile-select {
    background: rgba(250, 245, 255, 0.96);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    align-items: center;
    display: grid;
    gap: 0.38rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0.34rem 0.38rem;
    position: sticky;
    top: 0.25rem;
    z-index: 8;
  }

  .technical-section-mobile-select span {
    color: var(--color-text-muted);
    font-size: 0.62rem;
    white-space: nowrap;
    font-weight: 900;
    text-transform: uppercase;
  }

  .technical-section-mobile-select select {
    background: #fff;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-sm);
    color: var(--color-primary-900);
    font-size: 0.92rem;
    font-weight: 900;
    min-height: 40px;
    padding: 0.38rem 0.48rem;
    width: 100%;
  }

  .technical-active-section-shell {
    gap: 0.62rem;
    margin-bottom: 1rem;
    padding: 0.55rem;
  }

  .technical-section-panel-head {
    align-items: flex-start;
  }

  .technical-section-panel-head h5 {
    font-size: 0.98rem;
  }
}

@media (max-width: 360px) {
  #view-catalog .visual-card {
    grid-template-columns: 70px minmax(0, 1fr);
    padding-inline: 0.5rem;
  }

  #view-catalog .visual-card-media {
    width: 70px;
  }

  #view-catalog .visual-card .actions-mini {
    gap: 0.3rem;
  }

  #view-catalog .visual-card .actions-mini > button,
  #view-catalog .card-more-actions summary {
    font-size: 0.72rem;
    padding-inline: 0.34rem;
  }

  .field-status-pill.is-check,
  .field-status-pill.is-advanced {
    display: none;
  }

  .image-gallery-grid {
    grid-template-columns: minmax(136px, 156px);
    justify-content: center;
  }

  .technical-kpi-card {
    padding: 0.5rem;
  }
}

.finishing-process-editor,
.technical-calculated-signals {
  border-top: 1px solid var(--border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
}

.finishing-process-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.finishing-process-head span {
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-primary-900);
  font-size: 0.82rem;
  font-weight: 900;
  padding: 0.25rem 0.55rem;
}

.finishing-process-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.6rem;
  min-width: 0;
  width: 100%;
}

.finishing-process-row {
  align-items: end;
  background: linear-gradient(180deg, #fff, var(--color-surface-soft));
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 1fr) minmax(76px, 96px) minmax(180px, 1.2fr) auto;
  min-width: 0;
  padding: 0.6rem;
}

.finishing-process-field--other[hidden] {
  display: none;
}

.finishing-process-row.is-draft {
  border-color: rgba(180, 83, 9, 0.22);
}

.finishing-process-draft-note {
  grid-column: 1 / -1;
  margin-top: -0.1rem;
}

.finishing-process-field {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
}

.finishing-process-field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1;
}

.finishing-process-field input,
.finishing-process-field select {
  min-height: 40px;
  min-width: 0;
  width: 100%;
}

.finishing-process-actions {
  align-items: end;
  display: flex;
}

.finishing-process-actions button {
  min-height: 40px;
  white-space: nowrap;
}

.finishing-process-empty {
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-primary-900);
  font-weight: 850;
  padding: 0.65rem 0.75rem;
}

@media (max-width: 640px) {
  .field-label {
    padding: 0.58rem;
  }

  .field-label-row {
    align-items: flex-start;
    gap: 0.35rem;
  }

  .field-status-pill {
    font-size: 0.58rem;
    padding: 0.2rem 0.34rem;
  }

  .form-grid-2,
  .form-grid-3,
  .technical-form-grid,
  .technical-form-grid--datos_basicos,
  .technical-form-grid--datos_costear,
  .technical-form-grid--evidencia_minima,
  .technical-form-grid--checklist,
  .technical-form-grid--dificultad_simple,
  .technical-form-grid--avanzado {
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-form-grid--datos_basicos .field-label[data-field-key="referenceName"],
  .technical-form-grid--datos_basicos .field-label[data-field-key="imageUrl"],
  .technical-form-grid--datos_costear .field-label[data-field-key="recommendedYarn"],
  .technical-form-grid--avanzado .field-label[data-field-key="driveUrl"],
  .technical-form-grid--avanzado .field-label[data-field-key="suggestedMachine"] {
    grid-column: 1 / -1;
  }

  .finishing-process-head {
    align-items: stretch;
  }

  .finishing-process-head button {
    width: 100%;
  }

  .finishing-process-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .finishing-process-actions {
    grid-column: 1 / -1;
  }

  .finishing-process-actions button {
    width: 100%;
  }
}

.technical-calculated-signals div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.technical-calculated-signals span {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  padding: 0.25rem 0.5rem;
}

.technical-changes-editor {
  display: grid;
  gap: 0.75rem;
}

.technical-changes-head {
  align-items: center;
  background: var(--color-primary-050);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.72rem;
}

.technical-changes-head p {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 750;
  margin: 0.18rem 0 0;
}

.technical-change-quick-form {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.7rem;
  padding: 0.72rem;
}

.technical-change-quick-form[hidden] {
  display: none;
}

.technical-change-core-grid {
  display: grid;
  gap: 0.62rem;
  grid-template-columns: minmax(220px, 1.5fr) minmax(190px, 1fr) minmax(190px, 1fr) minmax(150px, 0.8fr);
}

.technical-change-optional-grid {
  margin-top: 0.65rem;
}

.technical-change-history {
  display: grid;
  gap: 0.65rem;
}

.technical-change-history[hidden] {
  display: none;
}

.technical-change-history-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
}

.technical-change-history-head span {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.technical-change-filters {
  margin: 0;
}

.technical-change-filter-grid {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  margin-top: 0.6rem;
}

.technical-change-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.technical-change-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  min-width: 760px;
  width: 100%;
}

.technical-change-table th,
.technical-change-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 0.46rem 0.42rem;
  text-align: left;
  vertical-align: top;
}

.technical-change-table th {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.technical-change-table td strong,
.technical-change-table td small {
  display: block;
}

.technical-change-table td small {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 760;
  margin-top: 0.16rem;
}

.technical-change-status-pill {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0.18rem 0.36rem;
  white-space: nowrap;
}

.technical-change-evidence-pill {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: inline-flex;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 900;
  max-width: 9.5rem;
  padding: 0.18rem 0.36rem;
}

.technical-change-evidence-pill.is-empty {
  color: var(--color-text-muted);
}

.technical-change-evidence-pill img {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  height: 1.45rem;
  object-fit: cover;
  width: 1.45rem;
}

.technical-change-part-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.24rem;
}

.technical-change-part-chip {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
  padding: 0.18rem 0.36rem;
}

.technical-change-variable-chip {
  background: #eef6ff;
  border: 1px solid #b7d4ff;
  border-radius: var(--radius-xs);
  color: #1d4ed8;
  display: inline-flex;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
  padding: 0.18rem 0.36rem;
}

.technical-change-variable-chip.is-empty {
  color: var(--color-text-muted);
}

.technical-change-part-chip.is-empty {
  color: var(--color-text-muted);
}

.technical-change-part-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  margin-top: 0.35rem;
}

.technical-change-part-picker label {
  align-items: center;
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: inline-flex;
  gap: 0.32rem;
  margin: 0;
  padding: 0.28rem 0.42rem;
}

.technical-change-custom-part {
  flex: 1 1 13rem;
}

.technical-change-custom-part span {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.technical-change-adjustments {
  display: grid;
  gap: 0.52rem;
  margin: 0.6rem 0;
}

.technical-change-adjustment-row {
  align-items: end;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.46rem;
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto;
  padding: 0.52rem;
}

.technical-change-adjustment-row .btn {
  align-self: stretch;
}

.technical-change-adjustment-row label {
  display: grid;
  font-size: 0.7rem;
  font-weight: 850;
  gap: 0.2rem;
  margin: 0;
}

.technical-change-adjustment-row .textarea {
  min-height: 2.35rem;
}

.technical-change-adjustment-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: grid;
  gap: 0.48rem;
  padding: 0.55rem;
}

.technical-change-adjustment-summary > span {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.technical-change-adjustment-summary article {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  display: grid;
  gap: 0.16rem;
  padding: 0.45rem;
}

.technical-change-adjustment-summary p {
  border: 0;
  padding: 0;
}

.technical-change-actions {
  min-width: 7rem;
}

.technical-change-actions .btn {
  margin: 0 0.25rem 0.25rem 0;
}

.technical-change-detail-row > td {
  background: var(--color-surface-soft);
  padding: 0.6rem;
}

.technical-change-empty-cell {
  color: var(--color-text-muted);
  font-weight: 800;
  text-align: center;
}

.technical-change-list.technical-change-card-list {
  display: none;
}

.technical-change-gallery-empty {
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0.6rem 0;
}

.technical-change-gallery-grid {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin: 0.65rem 0;
}

.technical-change-gallery-option {
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.45rem;
  grid-template-columns: 3rem minmax(0, 1fr);
  padding: 0.48rem;
}

.technical-change-gallery-option img {
  aspect-ratio: 1;
  border-radius: var(--radius-xs);
  height: 3rem;
  object-fit: cover;
  width: 3rem;
}

.technical-change-gallery-option div {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

.technical-change-gallery-option strong,
.technical-change-gallery-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.technical-change-gallery-option span {
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 850;
}

.technical-change-gallery-option .btn {
  grid-column: 1 / -1;
  justify-content: center;
}

.technical-change-list {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.technical-change-item {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.55rem;
  padding: 0.7rem;
}

.technical-change-item span,
.technical-change-item small {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 850;
}

.technical-change-item[hidden] {
  display: none;
}

.technical-change-item-head,
.technical-change-people,
.technical-change-detail-grid p,
.technical-change-audit p {
  align-items: start;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
}

.technical-change-item-head {
  flex-wrap: wrap;
}

.technical-change-item-head > div {
  display: grid;
  gap: 0.2rem;
  min-width: min(100%, 18rem);
}

.technical-change-people {
  flex-wrap: wrap;
  justify-content: flex-start;
}

.technical-change-people span {
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  padding: 0.22rem 0.42rem;
}

.technical-change-detail {
  border-top: 1px dashed var(--color-border);
  padding-top: 0.45rem;
}

.technical-change-detail-grid {
  display: grid;
  gap: 0.38rem;
  margin-top: 0.55rem;
}

.technical-change-detail-grid p,
.technical-change-audit p {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xs);
  margin: 0;
  padding: 0.45rem 0.55rem;
}

.technical-change-detail-grid .technical-change-adjustment-summary p {
  background: transparent;
  border: 0;
  display: block;
  padding: 0;
}

.technical-change-detail-grid p b,
.technical-change-audit p b {
  font-weight: 760;
  overflow-wrap: anywhere;
  text-align: right;
}

.technical-change-detail-grid p.is-empty b,
.technical-change-id b {
  color: var(--color-text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.72rem;
}

@media (max-width: 760px) {
  .technical-changes-head {
    align-items: stretch;
  }

  .technical-changes-head > div,
  .technical-changes-head .actions-row {
    width: 100%;
  }

  .technical-change-core-grid,
  .technical-change-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-change-table-wrap {
    display: none;
  }

  .technical-change-list.technical-change-card-list {
    display: grid;
  }

  .technical-change-detail-grid p,
  .technical-change-audit p {
    display: grid;
    gap: 0.18rem;
  }

  .technical-change-adjustment-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-change-detail-grid p b,
  .technical-change-audit p b {
    text-align: left;
  }
}

@media (max-width: 390px) {
  .technical-change-part-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-change-part-picker label {
    width: 100%;
  }

  .technical-change-core-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .technical-change-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

#view-technical .technical-decision-grid,
#view-technical .technical-summary-thumb {
  display: none;
}

#view-technical .technical-summary-top-grid {
  grid-template-columns: 1fr;
}

.technical-control-summary {
  display: grid;
  gap: 0.9rem;
}

.technical-control-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.technical-control-grid article {
  background: var(--color-surface-muted, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  padding: 0.75rem;
}

.technical-control-grid span,
.technical-control-list strong {
  color: var(--color-text-muted, #64748b);
  display: block;
  font-size: 0.76rem;
}

.technical-control-grid b {
  display: block;
  font-size: 0.95rem;
  margin-top: 0.2rem;
}

.technical-control-list ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.technical-control-note {
  color: var(--color-text-muted, #64748b);
  font-size: 0.82rem;
  margin: -0.25rem 0 0;
}

.technical-missing-summary {
  background: rgba(248, 250, 252, 0.82);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius-sm, 6px);
  padding: 0.72rem;
}

.technical-missing-summary > summary {
  color: var(--color-primary-800, #5b21b6);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 900;
}

.technical-missing-summary-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 0.75rem;
}

.technical-missing-group {
  background: #fff;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-sm, 6px);
  padding: 0.68rem;
}

.technical-missing-group h6 {
  color: var(--color-primary-900, #4c1d95);
  font-size: 0.8rem;
  margin: 0 0 0.45rem;
}

.technical-missing-group ul {
  margin: 0;
  padding-left: 1rem;
}

.technical-missing-group li,
.technical-missing-empty {
  color: var(--color-text-muted, #64748b);
  font-size: 0.82rem;
}

.commercial-approval-simple,
.technical-advanced-traceability {
  margin-top: 1rem;
}

.technical-advanced-traceability .technical-form-grid--advanced {
  margin-top: 0.8rem;
}

.finishing-process-traceability {
  grid-column: 1 / -1;
}

.finishing-process-traceability > summary {
  color: var(--color-text-muted, #64748b);
  cursor: pointer;
  font-size: 0.78rem;
}

.finishing-process-traceability-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-top: 0.65rem;
}

/* Fase 5E: densidad operativa visual sin tocar logica. */
body {
  background: linear-gradient(165deg, #f7faf8 0%, #eef4f1 48%, #f5f3ff 100%);
}

.app-shell {
  grid-template-columns: 188px minmax(0, 1fr);
}

.sidebar {
  background: linear-gradient(180deg, #ffffff, #f4f7f5);
  padding: 0.56rem;
}

.brand {
  border-radius: 10px;
  padding: 0.58rem;
}

.brand h1 {
  font-size: 1.03rem;
}

.brand p {
  font-size: 0.74rem;
  line-height: 1.25;
  margin-top: 0.18rem;
}

.main-nav {
  gap: 0.24rem;
  margin-top: 0.48rem;
}

.nav-item {
  border-radius: 7px;
  font-size: 0.78rem;
  min-height: 34px;
  padding: 0.32rem 0.46rem;
}

.nav-item-secondary {
  margin-left: 0.18rem;
  min-height: 30px;
}

.workspace {
  padding: 0.48rem 0.58rem 0.8rem;
}

.workspace-header {
  border-radius: 10px;
  margin-bottom: 0.42rem;
  padding: 0.32rem 0.46rem;
}

.workspace-header h2 {
  font-size: 1rem;
  line-height: 1.15;
}

.header-status-pill {
  min-height: 24px;
  padding: 0.2rem 0.44rem;
}

.view {
  gap: 0.62rem;
}

.hero-card,
.module-intro,
.card {
  border-radius: 10px;
  padding: 0.56rem;
}

.module-intro {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
}

.module-intro h3,
.hero-card h3 {
  font-size: 1.04rem;
  margin: 0 0 0.12rem;
}

.section-description {
  font-size: 0.74rem;
  line-height: 1.3;
  margin-bottom: 0.22rem;
}

.btn,
button,
input,
select,
textarea {
  border-radius: 7px;
}

.btn,
button {
  min-height: 36px;
}

input,
select {
  min-height: 38px;
}

textarea {
  min-height: 58px;
}

.metric-tag,
.badge,
.state-pill,
.metric-pill,
.technical-chip,
.field-status-pill,
.costing-status-badge,
.costing-snapshot-chip {
  font-size: 0.67rem;
  min-height: 23px;
  padding: 0.18rem 0.44rem;
}

.sub-panel {
  border-radius: 8px;
  padding: 0.54rem;
}

.inline-fields,
.actions-row,
.actions-mini,
.card-quick-actions {
  gap: 0.34rem;
}

.catalog-list,
.pipeline-board,
#view-costing .costing-reference-list,
.quote-board-list {
  gap: 0.52rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 282px), 1fr));
  justify-content: stretch;
}

@media (min-width: 1180px) {
  .catalog-list,
  .pipeline-board,
  #view-costing .costing-reference-list,
  .quote-board-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.catalog-module,
.quote-board-module,
#view-costing .costing-selector-panel,
#view-costing .costing-empty-state,
#view-costing .costing-selected-header,
#view-costing .costing-missing-panel,
#view-costing .costing-simple-summary {
  padding: 0.54rem;
}

.catalog-search-bar {
  margin-bottom: 0.42rem;
}

.catalog-search-bar input {
  min-height: 38px;
}

.catalog-visibility-tabs,
.catalog-quick-kpis {
  gap: 0.28rem;
  margin: 0.42rem 0;
}

.catalog-filters-collapse {
  border-radius: 8px;
  margin-bottom: 0.46rem;
}

.catalog-filters-collapse > summary {
  padding: 0.36rem 0.5rem;
}

.catalog-filters {
  display: grid;
  gap: 0.4rem;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  padding: 0.44rem;
}

.visual-card {
  gap: 0.36rem 0.52rem;
  grid-template-columns: 70px minmax(0, 1fr);
  padding: 0.5rem;
}

.visual-card-media {
  width: 70px;
}

.visual-card h4,
.catalog-card h4,
.pipeline-card h4,
.quote-board-card h4 {
  font-size: 0.92rem;
  line-height: 1.12;
}

.catalog-code {
  font-size: 0.66rem;
}

.catalog-meta {
  font-size: 0.74rem;
  margin-top: 0.14rem;
}

.visual-progress-row {
  gap: 0.18rem;
}

.visual-progress-meta strong {
  font-size: 0.98rem;
}

.visual-progress-bar {
  height: 7px;
}

.catalog-alerts,
.catalog-tags {
  gap: 0.24rem;
  margin-top: 0.36rem;
}

.visual-card .actions-mini {
  gap: 0.28rem;
  padding-top: 0.32rem;
}

.card-quick-actions button,
.actions-mini button,
.card-more-actions summary,
.btn-compact,
button.btn-compact {
  font-size: 0.74rem;
  min-height: 30px;
  padding: 0.25rem 0.42rem;
}

.pipeline-head {
  gap: 0.52rem;
}

.pipeline-head h3 {
  font-size: 1.24rem;
}

.pipeline-head p {
  font-size: 0.82rem;
  margin-top: 0.1rem;
}

.pipeline-kpis {
  gap: 0.42rem;
  margin-top: 0.5rem;
}

.pipeline-kpis article {
  border-radius: 9px;
  padding: 0.52rem;
}

.pipeline-tabs {
  gap: 0.32rem;
  margin-top: 0.48rem;
}

.pipeline-tabs button {
  min-height: 34px;
  padding: 0.28rem 0.5rem;
}

.pipeline-board {
  margin-top: 0.52rem;
}

.pipeline-card {
  grid-template-columns: 74px minmax(0, 1fr);
}

.pipeline-card-media {
  min-height: 118px;
}

.pipeline-card-body {
  gap: 0.24rem;
  padding: 0.5rem;
}

.pipeline-state,
.pipeline-badges span,
.pipeline-finance span {
  font-size: 0.64rem;
  padding: 0.14rem 0.38rem;
}

.pipeline-progress-line strong {
  font-size: 1rem;
}

.pipeline-blocker,
.pipeline-next,
.pipeline-owner {
  font-size: 0.74rem;
  line-height: 1.22;
}

.pipeline-card-footer {
  gap: 0.34rem;
  margin-top: 0.18rem;
  padding-top: 0.34rem;
}

.technical-hero {
  border-radius: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.56rem 0.66rem;
}

.technical-hero h3 {
  font-size: 1.08rem;
}

.technical-hero-actions {
  gap: 0.34rem;
}

.technical-save-status {
  font-size: 0.7rem;
  max-width: 260px;
  padding: 0.26rem 0.46rem;
}

.technical-session-layout {
  gap: 0.58rem;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
}

.technical-session-main,
.technical-session-rail {
  padding: 0.56rem;
}

#technical-session-form {
  gap: 0.48rem;
}

.technical-reference-bar {
  gap: 0.42rem;
  margin-bottom: 0.46rem;
}

.technical-top-summary {
  padding: 0.48rem;
}

.technical-control-grid,
.technical-missing-summary-grid,
.technical-form-grid,
.form-grid {
  gap: 0.46rem;
}

.field-label {
  padding: 0.4rem;
}

.field-label-row {
  gap: 0.34rem;
}

#view-technical .field-label {
  padding: 0.42rem;
}

.technical-section-card {
  border-radius: 9px;
}

.technical-section-summary,
.technical-section-panel-head {
  padding-block: 0.4rem;
}

.technical-section-card .section-description {
  margin-bottom: 0.36rem;
}

.technical-section-nav,
.technical-chip-list {
  gap: 0.28rem;
}

.settings-workbench {
  gap: 0.62rem;
  grid-template-columns: minmax(0, 1fr) 248px;
}

.settings-main {
  gap: 0.56rem;
}

.domain-card,
.settings-rail {
  padding: 0.56rem;
}

.domain-card h4,
.settings-rail h4 {
  font-size: 0.9rem;
}

#view-costing .module-intro,
.quote-board-header {
  align-items: center;
  gap: 0.52rem;
}

#view-costing .costing-selector-controls,
.quote-board-controls {
  border-radius: 8px;
  gap: 0.38rem;
  grid-template-columns: minmax(220px, 1.2fr) minmax(138px, 0.7fr) minmax(150px, 0.7fr) auto;
  margin: 0.42rem 0;
  padding: 0.42rem;
}

#view-costing .costing-reference-count {
  font-size: 0.68rem;
  min-width: 128px;
  padding: 0.36rem 0.44rem;
}

#view-costing .costing-reference-card {
  gap: 0.34rem;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 0.46rem;
}

#view-costing .costing-reference-thumb {
  width: 40px;
}

#view-costing .costing-reference-card h4 {
  font-size: 0.86rem;
  margin-top: 0.12rem;
}

#view-costing .costing-reference-alert {
  font-size: 0.68rem;
  -webkit-line-clamp: 1;
}

#view-costing .costing-reference-card-side {
  gap: 0.28rem;
}

#view-costing .costing-reference-card-side .btn {
  flex: 1 1 118px;
  min-height: 30px;
}

#view-costing .costing-selected-workflow {
  gap: 0;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
}

#view-costing .costing-selected-title,
#view-costing .costing-missing-head,
#view-costing .costing-simple-head,
#view-costing .costing-ready-row {
  align-items: center;
}

#view-costing .costing-missing-grid,
#view-costing .costing-simple-grid {
  gap: 0.38rem;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  margin-top: 0.42rem;
}

#view-costing .costing-missing-grid article,
#view-costing .costing-simple-grid article {
  padding: 0.46rem;
}

#view-costing .costing-simple-actions {
  gap: 0.32rem;
  margin-top: 0.46rem;
}

#view-costing .costing-advanced-shell {
  margin-top: 0.58rem;
  padding: 0.52rem;
}

.quote-board-module {
  margin-bottom: 0.62rem;
}

.quote-board-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
}

.quote-board-controls {
  display: grid;
  min-width: 0;
}

.quote-board-list {
  margin-top: 0.48rem;
}

.quote-board-card {
  border-radius: 9px;
  gap: 0.5rem;
  grid-template-columns: 54px minmax(0, 1fr);
  padding: 0.5rem;
}

.quote-board-thumb {
  width: 54px;
}

.quote-board-main header {
  align-items: flex-start;
}

.quote-board-card .catalog-tags {
  margin-top: 0.28rem;
}

.quote-board-actions {
  align-items: center;
  gap: 0.28rem;
  margin-top: 0.34rem;
}

.quote-board-actions > .btn,
.quote-board-actions > button,
.quote-board-more-actions {
  flex: 1 1 auto;
}

.quote-board-more-actions {
  min-width: 58px;
}

.quote-board-more-actions div {
  min-width: 190px;
}

.history-filters,
.document-preview-toolbar,
.quote-header {
  gap: 0.5rem;
  margin-bottom: 0.55rem;
  padding-bottom: 0.5rem;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 176px minmax(0, 1fr);
  }

  .catalog-list,
  .pipeline-board,
  #view-costing .costing-reference-list,
  .quote-board-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .settings-workbench,
  .technical-session-layout,
  #view-costing .costing-selected-workflow {
    grid-template-columns: 1fr;
  }

  #view-costing .costing-missing-panel {
    margin-right: 0;
  }

  .quote-board-header {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    display: block;
  }

  .workspace-header,
  .module-intro,
  .hero-card,
  .technical-hero,
  #view-costing .module-intro,
  .quote-board-header {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .catalog-list,
  .pipeline-board,
  #view-costing .costing-reference-list,
  .quote-board-list {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-costing .costing-selector-controls,
  .quote-board-controls,
  .catalog-filters {
    grid-template-columns: 1fr;
  }

  #view-costing .costing-reference-count {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .workspace {
    padding: 0.42rem 0.36rem 0.72rem;
  }

  .workspace-header {
    gap: 0.38rem;
  }

  .card,
  .module-intro,
  .hero-card,
  .catalog-module,
  .quote-board-module,
  #view-costing .costing-selector-panel,
  #view-costing .costing-empty-state,
  #view-costing .costing-selected-header,
  #view-costing .costing-missing-panel,
  #view-costing .costing-simple-summary {
    padding: 0.46rem;
  }

  .visual-card,
  #view-catalog .visual-card {
    grid-template-columns: 66px minmax(0, 1fr);
    padding: 0.46rem;
  }

  .visual-card-media,
  #view-catalog .visual-card-media {
    width: 66px;
  }

  .pipeline-card {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .pipeline-card-media {
    min-height: 108px;
  }

  .quote-board-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .quote-board-thumb {
    width: 48px;
  }

  .quote-board-actions,
  #view-costing .costing-simple-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .quote-board-actions > *,
  #view-costing .costing-simple-actions > * {
    width: 100%;
  }

  .technical-save-status {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 760px) {
  .image-manager-dialog {
    border-radius: 0;
    bottom: 0;
    height: 100dvh;
    left: 0;
    max-height: none;
    max-width: none;
    position: fixed;
    right: 0;
    top: 0;
    transform: none;
    width: 100vw;
  }
}

/* Fase 1A final: ajustes base que deben ganar la cascada. */
body {
  background: linear-gradient(165deg, #f8fbf9 0%, #eef4f1 50%, #f7f4ff 100%);
  color: var(--color-text);
  font-size: 0.98rem;
  line-height: 1.5;
}

.app-shell {
  grid-template-columns: 196px minmax(0, 1fr);
}

.workspace {
  padding: 0.72rem 0.82rem 1rem;
}

.sidebar {
  background: linear-gradient(180deg, #ffffff, #f7faf8);
  border-right-color: rgba(183, 194, 208, 0.72);
  padding: 0.68rem;
}

.workspace-header,
.brand,
.card,
.sub-panel,
.hero-card,
.module-intro,
.catalog-module,
.quote-board-module,
.technical-session-main,
.technical-session-rail,
.technical-section-card,
.image-gallery-compact-summary,
.image-gallery-card,
.catalog-card,
.pipeline-card,
.quote-board-card,
.domain-card,
.settings-rail {
  border-color: rgba(183, 194, 208, 0.72);
  box-shadow: 0 4px 14px rgba(23, 32, 51, 0.045);
}

.workspace-header,
.card,
.hero-card,
.module-intro,
.technical-session-main,
.technical-session-rail,
.catalog-module,
.quote-board-module,
.domain-card,
.settings-rail {
  padding: 0.72rem;
}

.sub-panel {
  background: rgba(255, 255, 255, 0.82);
  padding: 0.68rem;
}

.workspace-header h2 {
  font-size: 1.12rem;
}

.module-intro h3,
.hero-card h3 {
  font-size: 1.16rem;
  line-height: 1.2;
}

.workspace-header h2,
.module-intro h3,
.hero-card h3,
.technical-hero h3,
.pipeline-head h3 {
  letter-spacing: 0;
}

.section-description,
.technical-tab-helper,
.technical-inline-summary p,
.technical-inline-alert,
.catalog-meta,
.pipeline-blocker,
.pipeline-next,
.pipeline-owner,
#technical-summary-panel p {
  font-size: var(--text-sm);
  line-height: 1.45;
}

.nav-item {
  border-radius: 9px;
  font-size: 0.88rem;
  min-height: 40px;
  padding: 0.46rem 0.58rem;
}

.nav-item-secondary {
  min-height: 38px;
}

button,
.btn,
a.btn {
  border-radius: 9px;
  min-height: 42px;
  padding: 0.64rem 0.96rem;
}

.btn-primary,
button.btn-primary,
.primary-action,
#view-technical .primary-action {
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
  border-color: var(--color-primary-800);
  box-shadow: 0 8px 18px rgba(76, 29, 149, 0.16);
}

.btn-secondary,
button.btn-secondary {
  background: #fff;
  border-color: rgba(109, 40, 217, 0.52);
}

.btn-soft,
button.btn-soft {
  background: #f8fafc;
  border-color: rgba(183, 194, 208, 0.9);
}

.card-quick-actions button,
.actions-mini button,
.card-more-actions summary,
.btn-compact,
button.btn-compact,
.image-manager-tab,
.catalog-visibility-tab,
.pipeline-tabs button {
  font-size: 0.82rem;
  min-height: 38px;
  padding: 0.42rem 0.58rem;
}

input,
select,
textarea {
  border-color: rgba(183, 194, 208, 0.88);
  border-radius: 9px;
  font-size: 0.98rem;
  min-height: 42px;
  padding: 0.68rem 0.78rem;
}

textarea {
  min-height: 78px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
.btn:focus-visible,
.file-input-label:focus-within {
  border-color: var(--color-primary-700);
  box-shadow: var(--shadow-focus);
}

.field-label,
#view-technical .field-label {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(183, 194, 208, 0.64);
  box-shadow: none;
  padding: 0.6rem;
}

.field-label-row span,
.field-label > span,
label {
  color: var(--color-text);
  font-size: var(--text-sm);
}

.field-help,
.field-label small {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.metric-tag,
.badge,
.state-pill,
.metric-pill,
.technical-chip,
.field-status-pill,
.costing-status-badge,
.costing-snapshot-chip,
.pipeline-state,
.pipeline-badges span,
.pipeline-finance span,
.catalog-alerts span,
.catalog-tags span,
.technical-change-status-pill,
.technical-change-evidence-pill,
.technical-change-part-chip,
.technical-change-variable-chip {
  border-color: rgba(183, 194, 208, 0.78);
  font-size: 0.76rem;
  min-height: 28px;
  padding: 0.26rem 0.52rem;
}

.technical-save-status {
  border-radius: var(--radius-pill);
  font-size: 0.84rem;
  font-weight: 900;
  max-width: 340px;
  min-height: 40px;
  padding: 0.46rem 0.72rem;
}

.technical-save-status[data-state="saved"] {
  background: #e8f8ef;
  border-color: rgba(4, 120, 87, 0.38);
  color: #05603a;
  box-shadow: 0 0 0 3px rgba(4, 120, 87, 0.08);
}

.technical-save-status[data-state="dirty"],
.technical-save-status[data-state="local_pending"],
.technical-save-status[data-state="saving_local"],
.technical-save-status[data-state="saving_remote"] {
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.36);
  color: #92400e;
}

.technical-save-status[data-state="error"],
.technical-save-status[data-state="offline"] {
  background: #fff1f2;
  border-color: rgba(185, 28, 28, 0.38);
  color: #9f1239;
  box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.09);
}

.technical-save-status[data-state="idle"] {
  background: #f8fafc;
  border-color: rgba(183, 194, 208, 0.9);
  color: var(--color-text-muted);
}

.technical-hero {
  box-shadow: 0 10px 24px rgba(46, 16, 101, 0.12);
  padding: 0.76rem 0.88rem;
}

#technical-session-form,
.technical-control-grid,
.technical-missing-summary-grid,
.technical-form-grid,
.form-grid,
.inline-fields,
.actions-row,
.actions-mini,
.card-quick-actions,
.technical-hero-actions,
.technical-session-layout {
  gap: 0.6rem;
}

@media (max-width: 720px) {
  .workspace {
    padding: 0.62rem 0.56rem 0.9rem;
  }

  .workspace-header,
  .card,
  .module-intro,
  .hero-card,
  .technical-hero,
  .catalog-module,
  .quote-board-module {
    padding: 0.68rem;
  }

  button,
  .btn,
  a.btn,
  .primary-action,
  #view-technical .primary-action,
  #view-technical .secondary-action {
    min-height: 44px;
  }

  .btn-compact,
  button.btn-compact,
  .card-quick-actions button,
  .actions-mini button,
  .card-more-actions summary,
  .image-manager-tab,
  .catalog-visibility-tab,
  .pipeline-tabs button {
    min-height: 40px;
  }

  input,
  select {
    min-height: 44px;
  }

  textarea {
    min-height: 88px;
  }

  .technical-save-status {
    font-size: 0.86rem;
    min-height: 44px;
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 430px) {
  body {
    font-size: 1rem;
  }

  .workspace {
    padding: 0.56rem 0.46rem 0.86rem;
  }

  .workspace-header h2,
  .module-intro h3,
  .hero-card h3,
  .technical-hero h3 {
    font-size: 1.12rem;
  }

  .section-description,
  .catalog-meta,
  .pipeline-blocker,
  .pipeline-next,
  .pipeline-owner {
    font-size: 0.9rem;
  }

  .metric-tag,
  .badge,
  .state-pill,
  .metric-pill,
  .technical-chip,
  .field-status-pill,
  .costing-status-badge,
  .costing-snapshot-chip,
  .pipeline-state,
  .pipeline-badges span,
  .pipeline-finance span,
  .catalog-alerts span,
  .catalog-tags span {
    font-size: 0.8rem;
    min-height: 30px;
  }
}

/* Fase 2A: estados visuales por campo en ficha tecnica. */
#view-technical .field-label {
  border-left-width: 4px;
  position: relative;
}

#view-technical .field-label[data-field-state="ok"] {
  background: linear-gradient(180deg, #ffffff 0%, #fbfefc 100%);
  border-color: rgba(22, 163, 74, 0.22);
  border-left-color: #16a34a;
}

#view-technical .field-label[data-field-state="critical"] {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf4 100%);
  border-color: rgba(234, 88, 12, 0.34);
  border-left-color: #ea580c;
}

#view-technical .field-label[data-field-state="recommended"] {
  background: linear-gradient(180deg, #ffffff 0%, #fffdf5 100%);
  border-color: rgba(217, 119, 6, 0.22);
  border-left-color: #d97706;
}

#view-technical .field-label[data-field-state="optional"] {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.5);
  border-left-color: #cbd5e1;
}

#view-technical .field-label[data-field-state="no-validated"] {
  background: linear-gradient(180deg, #ffffff 0%, #fffdf7 100%);
  border-color: rgba(245, 158, 11, 0.24);
  border-left-color: #f59e0b;
}

#view-technical .field-label[data-field-state="calculated"] {
  background: linear-gradient(180deg, #ffffff 0%, #f0f9ff 100%);
  border-left-color: #0284c7;
}

#view-technical .field-status-pill.is-ok {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.32);
  color: #166534;
}

#view-technical .field-status-pill.is-critical {
  background: #ffedd5;
  border-color: rgba(234, 88, 12, 0.38);
  color: #9a3412;
}

#view-technical .field-status-pill.is-recommended {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.32);
  color: #92400e;
}

#view-technical .field-status-pill.is-no-validated {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.26);
  color: #854d0e;
}

#view-technical .field-status-pill.is-optional,
#view-technical .field-status-pill.is-advanced,
#view-technical .field-status-pill.is-check {
  background: #f8fafc;
  border-color: rgba(174, 185, 199, 0.72);
  color: #64748b;
}

#view-technical .field-status-pill.is-optional {
  display: none;
}

#view-technical .field-label[data-field-key="technicalObservation"] .field-status-pill.is-optional,
#view-technical .field-label[data-field-key="knittingNotes"] .field-status-pill.is-optional,
#view-technical .field-label[data-field-key="generalObservation"] .field-status-pill.is-optional,
#view-technical .field-label[data-field-key="closingRouteNotes"] .field-status-pill.is-optional {
  display: none;
}

#view-technical .field-visual-note {
  border-radius: 10px;
  display: block;
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1.35;
  margin-top: 0.05rem;
  padding: 0.38rem 0.52rem;
}

#view-technical .field-visual-note.is-critical {
  background: #fff7ed;
  border: 1px solid rgba(234, 88, 12, 0.24);
  color: #9a3412;
}

#view-technical .field-visual-note.is-recommended {
  background: #fffbeb;
  border: 1px solid rgba(217, 119, 6, 0.18);
  color: #92400e;
}

#view-technical .field-visual-note.is-no-validated {
  background: transparent;
  border: 0;
  color: #854d0e;
  font-weight: 750;
  padding: 0.08rem 0;
}

#view-technical .field-compound-control {
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(203, 213, 225, 0.8);
  border-radius: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.46rem 0.58rem;
  margin-top: 0.18rem;
  padding: 0.46rem;
}

#view-technical .field-compound-head {
  align-items: center;
  display: inline-flex;
  flex: 1 1 145px;
  gap: 0.4rem;
  min-width: 0;
}

#view-technical .field-compound-label {
  color: #475569;
  flex: 0 0 auto;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

#view-technical .field-compound-status {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.74rem;
  font-weight: 900;
  min-height: 26px;
  padding: 0.18rem 0.48rem;
  white-space: nowrap;
}

#view-technical .field-compound-status.is-ok {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.32);
  color: #166534;
}

#view-technical .field-compound-status.is-no-validated,
#view-technical .field-compound-status.is-recommended {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.24);
  color: #854d0e;
}

#view-technical .field-compound-select {
  flex: 1 1 190px;
  font-size: 0.9rem;
  min-width: min(100%, 180px);
  min-height: 40px;
  padding: 0.52rem 0.68rem;
}

#view-technical .technical-section-signal {
  align-items: stretch;
}

#view-technical .technical-section-signal span {
  border-left: 4px solid #d97706;
  font-size: 0.88rem;
  line-height: 1.32;
  padding: 0.48rem 0.62rem;
}

#view-technical .technical-section-signal span:first-child {
  border-left-color: #ea580c;
  font-weight: 950;
}

#view-technical .technical-control-grid article:first-child,
#view-technical .technical-control-list:first-child .technical-control-grid article:nth-child(2),
#view-technical .technical-control-list:first-child .technical-control-grid article:nth-child(3) {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.28);
  border-left: 4px solid #ea580c;
}

#view-technical .technical-control-grid article:first-child span,
#view-technical .technical-control-list:first-child .technical-control-grid article:nth-child(2) span,
#view-technical .technical-control-list:first-child .technical-control-grid article:nth-child(3) span {
  color: #9a3412;
}

#view-technical .technical-control-grid article:first-child b,
#view-technical .technical-control-list:first-child .technical-control-grid article:nth-child(2) b,
#view-technical .technical-control-list:first-child .technical-control-grid article:nth-child(3) b {
  color: #7c2d12;
}

#view-technical .finishing-process-head {
  align-items: center;
  gap: 0.55rem;
}

#view-technical .finishing-process-status {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.82rem;
  font-weight: 950;
  min-height: 30px;
  padding: 0.28rem 0.62rem;
  text-transform: uppercase;
}

#view-technical .finishing-process-status.is-ok {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.32);
  color: #166534;
}

#view-technical .finishing-process-status.is-critical,
#view-technical .finishing-process-empty.is-critical {
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.3);
  color: #9a3412;
}

#view-technical .finishing-process-row {
  border-left-width: 4px;
}

#view-technical .finishing-process-row.field--state-ok {
  border-color: rgba(22, 163, 74, 0.22);
  border-left-color: #16a34a;
}

#view-technical .finishing-process-row.field--state-critical {
  background: linear-gradient(180deg, #ffffff 0%, #fffaf4 100%);
  border-color: rgba(234, 88, 12, 0.34);
  border-left-color: #ea580c;
}

@media (max-width: 720px) {
  #view-technical .field-label-row {
    align-items: flex-start;
    gap: 0.5rem;
  }

  #view-technical .field-status-pill,
  #view-technical .finishing-process-status {
    font-size: 0.78rem;
    min-height: 30px;
  }

  #view-technical .field-visual-note {
    font-size: 0.84rem;
  }

  #view-technical .field-compound-control {
    grid-template-columns: 1fr;
  }

  #view-technical .field-compound-status {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  #view-technical .technical-hero .primary-action,
  #view-technical .technical-hero .secondary-action,
  #view-technical .primary-action,
  #view-technical .secondary-action {
    min-height: 44px;
    padding-block: 0.62rem;
  }

  #view-technical input,
  #view-technical select,
  #view-technical textarea {
    min-height: 44px;
  }
}

#view-technical .technical-hero #save-reference-now,
#save-reference-now.primary-action,
#save-reference-now.btn-primary {
  background: linear-gradient(135deg, #ffffff, #f4efff);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
  color: var(--color-primary-900);
  font-size: 1.02rem;
  min-height: 48px;
  padding: 0.78rem 1.14rem;
}

#view-technical .technical-hero #save-reference-now:hover,
#save-reference-now.primary-action:hover,
#save-reference-now.btn-primary:hover {
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.28);
  color: var(--color-primary-950);
}

@media (max-width: 720px) {
  #view-technical .technical-hero #save-reference-now,
  #save-reference-now.primary-action,
  #save-reference-now.btn-primary {
    min-height: 48px;
    width: 100%;
  }
}

/* Fase 1B: impacto visual visible, solo CSS. */
:root {
  --color-bg: #f8faf9;
  --color-bg-strong: #edf3ef;
  --color-surface: #ffffff;
  --color-surface-soft: #f8fafc;
  --color-surface-warm: #ffffff;
  --color-border: #d3dbe6;
  --color-border-strong: #aeb9c7;
  --color-text: #111827;
  --color-text-muted: #4b5563;
  --color-primary-050: #f7f4ff;
  --color-primary-100: #eee8ff;
  --shadow-low: 0 4px 12px rgba(17, 24, 39, 0.045);
  --shadow-medium: 0 14px 34px rgba(17, 24, 39, 0.12);
  --shadow-focus: 0 0 0 4px rgba(109, 40, 217, 0.2);
  --text-xs: 0.82rem;
  --text-sm: 0.94rem;
  --text-base: 1.02rem;
  --text-md: 1.12rem;
  --text-lg: 1.34rem;
  --text-xl: 1.68rem;
  --bg-a: var(--color-bg);
  --bg-b: var(--color-bg-strong);
  --surface: var(--color-surface);
  --surface-soft: var(--color-surface-soft);
  --ink: var(--color-text);
  --ink-soft: var(--color-text-muted);
  --line: var(--color-border);
  --line-strong: var(--color-border-strong);
  --border: var(--color-border);
  --muted: var(--color-text-muted);
  --shadow-soft: var(--shadow-low);
  --shadow-hard: var(--shadow-medium);
}

html {
  font-size: 16px;
}

body {
  background: linear-gradient(165deg, #fbfdfc 0%, #eef4f1 58%, #f7f4ff 100%);
  color: var(--color-text);
  font-size: var(--text-base);
  line-height: 1.56;
}

.app-shell {
  grid-template-columns: 212px minmax(0, 1fr);
}

.workspace {
  padding: 1rem 1.1rem 1.35rem;
}

.workspace-header {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(174, 185, 199, 0.78);
  border-radius: 14px;
  box-shadow: 0 5px 16px rgba(17, 24, 39, 0.055);
  margin-bottom: 0.9rem;
  padding: 0.78rem 0.95rem;
}

.workspace-header h2 {
  font-size: 1.28rem;
  line-height: 1.16;
}

.crumb,
.header-status-pill {
  font-size: 0.84rem;
}

.header-status-pill {
  background: #f8fafc;
  border-color: rgba(174, 185, 199, 0.9);
  color: var(--color-text-muted);
  min-height: 34px;
  padding: 0.36rem 0.7rem;
}

.sidebar {
  background: #ffffff;
  border-right-color: rgba(174, 185, 199, 0.78);
  padding: 0.9rem 0.72rem;
}

.brand {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.72);
  border-radius: 14px;
  padding: 0.82rem;
}

.brand h1 {
  color: var(--color-primary-900);
  font-size: 1.18rem;
}

.brand p {
  color: var(--color-text-muted);
  font-size: 0.88rem;
}

.main-nav {
  gap: 0.46rem;
  margin-top: 0.8rem;
}

.nav-item {
  background: #ffffff;
  border-color: transparent;
  border-radius: 12px;
  color: var(--color-text);
  font-size: 0.98rem;
  font-weight: 850;
  min-height: 48px;
  padding: 0.62rem 0.72rem;
}

.nav-item:hover {
  background: #f8fafc;
  border-color: rgba(174, 185, 199, 0.86);
  box-shadow: 0 5px 14px rgba(17, 24, 39, 0.06);
}

.nav-item.is-active {
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
  border-color: var(--color-primary-800);
  box-shadow: 0 9px 20px rgba(76, 29, 149, 0.2);
  color: #ffffff;
}

.nav-admin-item {
  margin-top: 0.4rem;
  border-color: rgba(180, 83, 9, 0.28);
}

.card,
.hero-card,
.module-intro,
.catalog-module,
.quote-board-module,
.technical-session-main,
.technical-session-rail,
.technical-section-card,
.image-gallery-compact-summary,
.image-gallery-card,
.catalog-card,
.pipeline-card,
.quote-board-card,
.domain-card,
.settings-rail {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.68);
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(17, 24, 39, 0.045);
}

.card,
.hero-card,
.module-intro,
.catalog-module,
.quote-board-module,
.technical-session-main,
.technical-session-rail,
.domain-card,
.settings-rail {
  padding: 1rem;
}

.module-intro h3,
.hero-card h3,
.pipeline-head h3 {
  color: var(--color-text);
  font-size: 1.34rem;
  line-height: 1.18;
}

.section-description,
.technical-tab-helper,
.technical-inline-summary p,
.technical-inline-alert,
.catalog-meta,
.pipeline-blocker,
.pipeline-next,
.pipeline-owner,
#technical-summary-panel p,
.image-manager-header p,
.image-gallery-head p,
.image-gallery-section-head p {
  color: var(--color-text-muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.eyebrow,
.catalog-code,
.technical-section-mobile-select span {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

button,
.btn,
a.btn,
.file-input-label {
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 900;
  min-height: 46px;
  padding: 0.78rem 1.08rem;
}

.btn-primary,
button.btn-primary,
.primary-action,
#view-technical .primary-action,
.card-action-primary {
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
  border-color: var(--color-primary-900);
  box-shadow: 0 10px 24px rgba(76, 29, 149, 0.22);
  color: #ffffff;
}

.btn-primary:hover,
button.btn-primary:hover,
.primary-action:hover,
#view-technical .primary-action:hover,
.card-action-primary:hover {
  background: linear-gradient(135deg, #240b55, var(--color-primary-800));
  box-shadow: 0 12px 28px rgba(76, 29, 149, 0.26);
}

.btn-secondary,
button.btn-secondary,
.secondary-action {
  background: #ffffff;
  border-color: rgba(109, 40, 217, 0.62);
  color: var(--color-primary-900);
}

.btn-soft,
button.btn-soft {
  background: #f8fafc;
  border-color: rgba(174, 185, 199, 0.95);
  color: var(--color-text);
}

.btn-ghost,
button.btn-ghost {
  color: var(--color-text);
}

.card-quick-actions button,
.actions-mini button,
.card-more-actions summary,
.btn-compact,
button.btn-compact,
.image-manager-tab,
.catalog-visibility-tab,
.pipeline-tabs button,
.technical-section-chip {
  font-size: 0.92rem;
  min-height: 42px;
  padding: 0.54rem 0.76rem;
}

input,
select,
textarea {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.9);
  border-radius: 12px;
  color: var(--color-text);
  font-size: 1rem;
  min-height: 48px;
  padding: 0.82rem 0.9rem;
}

textarea {
  min-height: 104px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
.btn:focus-visible,
.file-input-label:focus-within {
  border-color: var(--color-primary-700);
  box-shadow: var(--shadow-focus);
  outline: none;
}

.field-label,
#view-technical .field-label {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.5);
  border-radius: 12px;
  box-shadow: none;
  padding: 0.78rem;
}

.field-label:hover {
  background: #fbfcfd;
  border-color: rgba(109, 40, 217, 0.34);
}

.field-label-row span,
.field-label > span,
label {
  color: var(--color-text);
  font-size: 0.96rem;
  font-weight: 850;
}

.field-help,
.field-label small {
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.sub-panel {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.5);
  border-radius: 12px;
  box-shadow: none;
  padding: 0.9rem;
}

.metric-tag,
.badge,
.state-pill,
.metric-pill,
.technical-chip,
.field-status-pill,
.costing-status-badge,
.costing-snapshot-chip,
.pipeline-state,
.pipeline-badges span,
.pipeline-finance span,
.catalog-alerts span,
.catalog-tags span,
.technical-change-status-pill,
.technical-change-evidence-pill,
.technical-change-part-chip,
.technical-change-variable-chip,
.image-gallery-badge {
  background: #f8fafc;
  border-color: rgba(174, 185, 199, 0.76);
  color: var(--color-text-muted);
  font-size: 0.84rem;
  font-weight: 850;
  min-height: 32px;
  padding: 0.34rem 0.62rem;
}

.catalog-alerts span,
.technical-inline-alert,
.technical-section-meta.is-alert,
.technical-section-signal span {
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.36);
  color: #92400e;
}

.technical-hero {
  background: linear-gradient(135deg, #2e1065, #5b21b6);
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(46, 16, 101, 0.2);
  padding: 1rem 1.12rem;
}

.technical-hero h3 {
  font-size: 1.44rem;
}

.technical-hero-context {
  font-size: 0.96rem;
}

.technical-hero-actions {
  gap: 0.7rem;
}

.technical-save-status {
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 950;
  min-height: 46px;
  padding: 0.62rem 0.9rem;
}

.technical-save-status::before {
  height: 0.68rem;
  opacity: 0.95;
  width: 0.68rem;
}

.technical-save-status[data-state="idle"] {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.92);
  color: #374151;
}

.technical-save-status[data-state="saved"] {
  background: #dcfce7;
  border-color: rgba(4, 120, 87, 0.46);
  color: #065f46;
  box-shadow: 0 0 0 4px rgba(4, 120, 87, 0.1);
}

.technical-save-status[data-state="dirty"],
.technical-save-status[data-state="local_pending"],
.technical-save-status[data-state="saving_local"],
.technical-save-status[data-state="saving_remote"] {
  background: #ffedd5;
  border-color: rgba(180, 83, 9, 0.5);
  color: #7c2d12;
  box-shadow: 0 0 0 4px rgba(180, 83, 9, 0.11);
}

.technical-save-status[data-state="error"],
.technical-save-status[data-state="offline"] {
  background: #ffe4e6;
  border-color: rgba(185, 28, 28, 0.5);
  color: #9f1239;
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.11);
}

#technical-session-form,
.technical-control-grid,
.technical-missing-summary-grid,
.technical-form-grid,
.form-grid,
.inline-fields,
.actions-row,
.actions-mini,
.card-quick-actions,
.technical-session-layout,
.technical-section-nav,
.technical-chip-list,
.pipeline-board,
.catalog-list,
.quote-board-list {
  gap: 0.82rem;
}

.technical-reference-bar,
.technical-top-summary {
  margin-bottom: 0.8rem;
}

.technical-section-card {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.55);
  border-radius: 14px;
}

.technical-section-card[open],
.technical-section-card.is-active {
  border-color: rgba(109, 40, 217, 0.62);
  box-shadow: 0 8px 22px rgba(109, 40, 217, 0.11);
}

.technical-section-summary,
.technical-section-panel-head {
  padding-block: 0.78rem;
}

.technical-section-title,
.technical-section-panel-head h5 {
  color: var(--color-text);
  font-size: 1.08rem;
}

.technical-section-chip {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.86);
  color: var(--color-text);
}

.technical-section-chip.is-active {
  background: #f7f4ff;
  border-color: var(--color-primary-700);
  box-shadow: 0 4px 14px rgba(109, 40, 217, 0.12);
  color: var(--color-primary-900);
}

.technical-section-chip-count {
  font-size: 0.82rem;
  min-width: 1.65rem;
}

.technical-session-rail h4 {
  color: var(--color-text);
  font-size: 1.05rem;
}

.image-gallery-compact-actions > button,
.image-gallery-compact-actions .image-gallery-upload-trigger,
.image-gallery-compact-actions .image-gallery-upload-trigger > button {
  min-height: 46px;
}

.image-gallery-counts span {
  background: #f8fafc;
  font-size: 0.86rem;
  min-height: 36px;
}

.pipeline-card,
#view-dashboard .pipeline-card,
.catalog-card,
.visual-card {
  border-radius: 16px;
  padding: 0.82rem;
}

.pipeline-card h4,
.catalog-card h4,
.visual-card h4,
.quote-board-card h4 {
  color: var(--color-text);
  font-size: 1.08rem;
  line-height: 1.22;
}

.pipeline-card-footer button,
.visual-card .actions-mini button,
.catalog-card .actions-mini button {
  min-height: 44px;
}

.pipeline-progress-line strong,
.visual-progress-meta strong {
  font-size: 1.16rem;
}

#view-dashboard .pipeline-card {
  padding: 0;
}

#view-dashboard .pipeline-progress-line strong {
  font-size: 0.76rem;
}

.catalog-search-bar input {
  min-height: 48px;
}

.catalog-filters-collapse,
.technical-missing-summary,
.technical-control-grid article,
.technical-change-quick-form,
.technical-change-adjustment-row,
.technical-change-detail-grid p,
.technical-change-audit p {
  background: #ffffff;
  border-color: rgba(174, 185, 199, 0.55);
  box-shadow: none;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 196px minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  body {
    font-size: 1.03rem;
  }

  .workspace {
    padding: 0.82rem 0.62rem 1rem;
  }

  .workspace-header,
  .card,
  .module-intro,
  .hero-card,
  .technical-hero,
  .catalog-module,
  .quote-board-module,
  .technical-session-main,
  .technical-session-rail {
    padding: 0.9rem;
  }

  button,
  .btn,
  a.btn,
  .file-input-label,
  .primary-action,
  #view-technical .primary-action,
  #view-technical .secondary-action {
    min-height: 48px;
    padding: 0.78rem 1rem;
  }

  .btn-compact,
  button.btn-compact,
  .card-quick-actions button,
  .actions-mini button,
  .card-more-actions summary,
  .image-manager-tab,
  .catalog-visibility-tab,
  .pipeline-tabs button,
  .technical-section-chip {
    min-height: 44px;
  }

  input,
  select,
  #view-technical input,
  #view-technical select {
    min-height: 48px;
  }

  textarea,
  #view-technical textarea {
    min-height: 108px;
  }

  .technical-save-status {
    font-size: 0.98rem;
    min-height: 48px;
    max-width: none;
    width: 100%;
  }

  .technical-hero h3 {
    font-size: 1.36rem;
  }
}

@media (max-width: 430px) {
  .workspace {
    padding: 0.7rem 0.5rem 0.95rem;
  }

  .workspace-header h2,
  .module-intro h3,
  .hero-card h3,
  .technical-hero h3 {
    font-size: 1.24rem;
  }

  .section-description,
  .catalog-meta,
  .pipeline-blocker,
  .pipeline-next,
  .pipeline-owner,
  #technical-summary-panel p {
    font-size: 0.96rem;
  }

  .metric-tag,
  .badge,
  .state-pill,
  .metric-pill,
  .technical-chip,
  .field-status-pill,
  .costing-status-badge,
  .costing-snapshot-chip,
  .pipeline-state,
  .pipeline-badges span,
  .pipeline-finance span,
  .catalog-alerts span,
  .catalog-tags span,
  .image-gallery-badge {
    font-size: 0.86rem;
    min-height: 34px;
  }

  .field-label,
#view-technical .field-label {
    padding: 0.72rem;
  }
}

/* Fase 2B.2: barra sticky de guardado manual en ficha tecnica. */
#view-technical .technical-hero {
  position: sticky;
  top: 0;
  z-index: 45;
}

#view-technical .technical-hero-actions {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(203, 213, 225, 0.82);
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  gap: 0.58rem;
  padding: 0.52rem;
}

#view-technical .technical-save-status {
  max-width: 360px;
}

#view-technical .technical-save-status[data-state="dirty"],
#view-technical .technical-save-status[data-state="local_pending"],
#view-technical .technical-save-status[data-state="saving_local"],
#view-technical .technical-save-status[data-state="saving_remote"] {
  background: #fff7ed;
  border-color: rgba(245, 158, 11, 0.42);
  color: #7c2d12;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

#view-technical .technical-save-status[data-state="idle"],
#view-technical .technical-save-status[data-state="saved"] {
  background: #ecfdf5;
  border-color: rgba(5, 150, 105, 0.34);
  color: #065f46;
  box-shadow: none;
}

#view-technical #save-reference-now {
  min-height: 46px;
  white-space: nowrap;
}

#view-technical #discard-reference-changes {
  min-height: 44px;
  white-space: nowrap;
}

@media (max-width: 720px) {
  #view-technical {
    padding-bottom: 4.95rem;
  }

  #view-technical .technical-hero {
    position: relative;
    top: auto;
    z-index: auto;
  }

  #view-technical .technical-hero-actions {
    border-radius: 18px 18px 0 0;
    bottom: 0;
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.16);
    display: grid;
    gap: 0.34rem 0.44rem;
    grid-template-columns: minmax(0, 1fr) auto auto;
    left: 0;
    padding: 0.42rem max(0.58rem, env(safe-area-inset-left)) max(0.52rem, env(safe-area-inset-bottom)) max(0.58rem, env(safe-area-inset-right));
    position: fixed;
    right: 0;
    z-index: 80;
  }

  #view-technical .technical-save-status {
    font-size: 0.82rem;
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    justify-content: flex-start;
    max-width: none;
    min-height: 36px;
    padding: 0.34rem 0.56rem;
    width: 100%;
  }

  #view-technical #save-reference-now,
  #view-technical #discard-reference-changes {
    min-height: 40px;
    padding-block: 0.42rem;
    padding-inline: 0.68rem;
  }

  #view-technical #save-reference-now {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
  }

  #view-technical #discard-reference-changes {
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    color: #7c2d12;
    font-size: 0.82rem;
    grid-column: 3 / 4;
    grid-row: 1 / 2;
    justify-self: end;
    min-height: 28px;
    padding: 0.1rem 0.18rem;
  }

  #view-technical #discard-reference-changes[hidden],
  #view-technical #retry-reference-sync[hidden] {
    display: none;
  }

  #view-technical .technical-section-mobile-select {
    border-radius: 12px;
    gap: 0.22rem;
    padding: 0.18rem 0.26rem;
    top: 0.16rem;
  }

  #view-technical .technical-section-mobile-select span {
    font-size: 0.56rem;
    letter-spacing: 0;
  }

  #view-technical .technical-section-mobile-select select {
    font-size: 0.88rem;
    min-height: 32px;
    padding: 0.2rem 0.36rem;
  }

  #view-technical .field-label {
    gap: 0.42rem;
  }

  #view-technical .field-compound-control {
    gap: 0.26rem 0.38rem;
    margin-top: 0.08rem;
    padding: 0.3rem;
  }

  #view-technical .field-compound-head {
    flex: 1 1 128px;
  }

  #view-technical .field-compound-label {
    font-size: 0.78rem;
  }

  #view-technical .field-compound-status {
    font-size: 0.7rem;
    min-height: 24px;
    padding: 0.12rem 0.4rem;
  }

  #view-technical .field-compound-select {
    flex-basis: 160px;
    font-size: 0.86rem;
    min-height: 36px;
    padding: 0.38rem 0.52rem;
  }

  #view-technical .field-visual-note.is-no-validated {
    font-size: 0.78rem;
    line-height: 1.22;
    margin-top: -0.06rem;
  }
}

@media (max-width: 380px) {
  #view-technical .technical-hero-actions {
    grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  }

  #view-technical #save-reference-now {
    padding-inline: 0.58rem;
  }
}

/* Admin mobile cierre preproduccion: contener codigos largos sin scroll global. */
#view-costing,
#view-history {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

#view-costing *,
#view-history * {
  box-sizing: border-box;
  min-width: 0;
}

#view-costing .costing-reference-title-row,
#view-costing .costing-selected-title,
#view-history .quote-board-main header,
#view-history .history-list header,
#view-history #history-list article header {
  flex-wrap: wrap;
}

#view-costing .costing-reference-card h4,
#view-costing .costing-reference-alert,
#view-costing .costing-selected-title h4,
#view-costing .costing-simple-grid b,
#view-costing .costing-simple-grid span,
#view-history .quote-board-card h4,
#view-history .catalog-code,
#view-history .catalog-meta,
#view-history .catalog-tags,
#view-history .history-detail,
#view-history .history-detail b,
#view-history .history-detail span,
#view-history #history-list article h4 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#view-costing .costing-mode-pill,
#view-costing .costing-status-pill,
#view-costing .costing-status-badge,
#view-costing .costing-snapshot-chip,
#view-history .costing-status-badge,
#view-history .metric-tag,
#view-history .catalog-select {
  line-height: 1.18;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

#view-costing .costing-selector-controls,
#view-costing .formal-quote-controls,
#view-costing .formal-quote-notes,
#view-history .quote-board-controls,
#view-history .history-filters {
  max-width: 100%;
}

#view-costing .costing-reference-card,
#view-history .quote-board-card,
#view-history #history-list > article {
  max-width: 100%;
}

#view-history .quote-board-more-actions {
  min-width: 0;
}

#view-history .quote-board-more-actions div {
  max-width: calc(100vw - 1.5rem);
  min-width: min(190px, calc(100vw - 1.5rem));
}

@media (max-width: 430px) {
  #view-costing .costing-reference-card,
  #view-history .quote-board-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  #view-costing .costing-reference-thumb,
  #view-history .quote-board-thumb {
    width: 42px;
  }

  #view-costing .costing-reference-card-side,
  #view-costing .costing-selected-actions,
  #view-costing .costing-simple-actions,
  #view-history .quote-board-actions,
  #view-history #history-list .actions-mini,
  #view-history .history-detail .actions-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  #view-costing .costing-reference-card-side > *,
  #view-costing .costing-selected-actions > *,
  #view-costing .costing-simple-actions > *,
  #view-history .quote-board-actions > *,
  #view-history #history-list .actions-mini > *,
  #view-history .history-detail .actions-row > * {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 390px) {
  #view-costing .costing-selector-head,
  #view-costing .costing-selected-title,
  #view-costing .costing-missing-head,
  #view-costing .costing-simple-head,
  #view-history .quote-board-header {
    gap: 0.42rem;
  }

  #view-costing .costing-reference-card,
  #view-history .quote-board-card {
    gap: 0.38rem;
    padding: 0.52rem;
  }
}

@media (max-width: 360px) {
  #view-costing .costing-reference-card,
  #view-history .quote-board-card {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-costing .costing-reference-thumb,
  #view-history .quote-board-thumb {
    width: 40px;
  }

  #view-costing .costing-reference-thumb,
  #view-history .quote-board-thumb {
    justify-self: start;
  }
}

/* Fase 2D: ficha tecnica responsive para cambios tecnicos y vistas densas. */
#view-technical {
  max-width: 100%;
  overflow-x: clip;
}

#view-technical .technical-session-layout,
#view-technical .technical-session-main,
#view-technical .technical-session-rail,
#view-technical .technical-active-section-shell,
#view-technical .technical-section-card,
#view-technical .technical-section-panel,
#view-technical .technical-changes-editor,
#view-technical .technical-change-quick-form,
#view-technical .technical-change-history,
#view-technical .technical-change-detail,
#view-technical .technical-change-table-wrap,
#view-technical .technical-change-card-list,
#view-technical .technical-change-item,
#view-technical .technical-change-detail-grid,
#view-technical .technical-change-adjustment-summary,
#view-technical .technical-change-gallery-grid,
#view-technical .technical-primary-image-summary {
  min-width: 0;
  max-width: 100%;
}

#view-technical .technical-session-main,
#view-technical .technical-session-rail,
#view-technical .technical-section-card,
#view-technical .field-label,
#view-technical .technical-change-quick-form,
#view-technical .technical-change-adjustment-row {
  overflow-wrap: anywhere;
}

#view-technical .technical-section-card,
#view-technical .technical-section-panel {
  scroll-margin-top: 7rem;
}

#view-technical .technical-change-core-grid {
  grid-template-columns: minmax(220px, 1.3fr) repeat(2, minmax(210px, 1fr)) minmax(150px, 0.7fr);
}

#view-technical .technical-change-core-grid > .field-label:first-child {
  grid-column: span 2;
}

#view-technical .technical-change-optional-grid,
#view-technical .technical-change-filter-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr));
}

#view-technical .technical-change-part-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
}

#view-technical .technical-change-part-picker label {
  min-height: 42px;
  width: 100%;
}

#view-technical .technical-change-custom-part {
  grid-column: span 2;
}

#view-technical .technical-change-custom-part span {
  white-space: normal;
}

#view-technical .technical-change-custom-part input,
#view-technical .technical-change-adjustment-row input,
#view-technical .technical-change-adjustment-row textarea,
#view-technical .technical-change-optional-grid input,
#view-technical .technical-change-optional-grid select,
#view-technical .technical-change-optional-grid textarea,
#view-technical .technical-change-filter-grid select {
  width: 100%;
}

#view-technical .technical-change-adjustment-row {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 155px), 1fr));
}

#view-technical .technical-change-adjustment-row .btn {
  grid-column: 1 / -1;
  justify-content: center;
}

#view-technical .technical-change-table-wrap {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
}

#view-technical .technical-change-table {
  min-width: 820px;
  table-layout: fixed;
}

#view-technical .technical-change-table th:nth-child(1),
#view-technical .technical-change-table td:nth-child(1) {
  width: 8.4rem;
}

#view-technical .technical-change-table th:nth-child(2),
#view-technical .technical-change-table td:nth-child(2),
#view-technical .technical-change-table th:nth-child(6),
#view-technical .technical-change-table td:nth-child(6) {
  width: 7rem;
}

#view-technical .technical-change-table th:nth-child(7),
#view-technical .technical-change-table td:nth-child(7) {
  width: 9rem;
}

#view-technical .technical-change-table td,
#view-technical .technical-change-table td strong,
#view-technical .technical-change-table td small,
#view-technical .technical-change-detail-grid p b,
#view-technical .technical-change-audit p b,
#view-technical .technical-change-item strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

#view-technical .technical-change-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  min-width: 0;
}

#view-technical .technical-change-actions .btn {
  flex: 1 1 4.8rem;
  justify-content: center;
  margin: 0;
}

#view-technical .technical-change-status-pill,
#view-technical .technical-change-evidence-pill,
#view-technical .technical-change-part-chip,
#view-technical .technical-change-variable-chip {
  max-width: 100%;
  white-space: normal;
}

#view-technical .technical-change-evidence-pill {
  line-height: 1.18;
}

#view-technical .technical-change-detail-grid p,
#view-technical .technical-change-audit p {
  min-width: 0;
}

@media (max-width: 1180px) {
  #view-technical .technical-session-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-session-rail {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
    position: static;
  }

  #view-technical .technical-session-rail h4 {
    margin: 0;
  }

  #view-technical .technical-session-rail h4,
  #view-technical .technical-session-rail .sub-panel {
    min-width: 0;
  }

  #view-technical .technical-session-rail h4:nth-of-type(1),
  #view-technical #technical-summary-panel {
    grid-column: 1;
  }

  #view-technical .technical-session-rail h4:nth-of-type(2),
  #view-technical #technical-image-preview {
    grid-column: 2;
  }

  #view-technical .technical-change-core-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-technical .technical-change-core-grid > .field-label:first-child,
  #view-technical .technical-change-core-grid > .field-label:nth-child(2),
  #view-technical .technical-change-core-grid > .field-label:nth-child(3) {
    grid-column: 1 / -1;
  }

  #view-technical .technical-change-table-wrap {
    display: none;
  }

  #view-technical .technical-change-list.technical-change-card-list {
    display: grid;
  }
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .workspace {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 900px) {
  #view-technical .technical-session-rail {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-session-rail h4:nth-of-type(1),
  #view-technical #technical-summary-panel,
  #view-technical .technical-session-rail h4:nth-of-type(2),
  #view-technical #technical-image-preview {
    grid-column: 1;
  }

  #view-technical .technical-change-core-grid,
  #view-technical .technical-change-optional-grid,
  #view-technical .technical-change-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-change-custom-part {
    grid-column: 1;
  }

  #view-technical .technical-change-history-head,
  #view-technical .technical-change-item-head,
  #view-technical .technical-change-people {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-change-detail-grid p,
  #view-technical .technical-change-audit p {
    display: grid;
    gap: 0.18rem;
  }

  #view-technical .technical-change-detail-grid p b,
  #view-technical .technical-change-audit p b {
    text-align: left;
  }
}

@media (max-width: 430px) {
  #view-technical .technical-active-section-shell,
  #view-technical .technical-section-card,
  #view-technical .technical-change-quick-form,
  #view-technical .technical-change-item,
  #view-technical .technical-change-adjustment-row,
  #view-technical .technical-change-adjustment-summary {
    padding: 0.58rem;
  }

  #view-technical .technical-changes-head {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-changes-head .actions-row,
  #view-technical .technical-change-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  #view-technical .technical-change-actions .btn,
  #view-technical .technical-changes-head .actions-row .btn {
    width: 100%;
  }

  #view-technical .technical-change-part-picker {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-primary-image-summary,
  #view-technical .technical-change-gallery-option {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-change-gallery-option img {
    height: auto;
    width: min(100%, 9rem);
  }
}

@media (max-width: 380px) {
  #view-technical {
    padding-bottom: 6.2rem;
  }

  #view-technical .technical-hero-actions {
    grid-template-columns: minmax(0, 1fr) minmax(86px, auto);
  }

  #view-technical #discard-reference-changes {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
    justify-self: stretch;
    text-align: center;
  }

  #view-technical #discard-reference-changes[hidden] {
    display: none;
  }
}

/* Mobile polish: historial de cambios tecnico sin tocar persistencia. */
#view-technical .technical-change-mode-tabs {
  display: none;
}

#view-technical .technical-change-history.is-empty {
  display: none;
}

@media (max-width: 760px) {
  #view-technical .technical-changes-editor--audit {
    gap: 0.62rem;
  }

  #view-technical .technical-changes-head {
    background: linear-gradient(180deg, #f8fafc 0%, #eef6ff 100%);
    border-color: #cbd5e1;
    gap: 0.52rem;
    padding: 0.66rem;
  }

  #view-technical .technical-changes-head strong {
    color: #0f172a;
    display: block;
    font-size: 0.95rem;
    line-height: 1.18;
  }

  #view-technical .technical-changes-head p {
    font-size: 0.75rem;
    line-height: 1.28;
  }

  #view-technical .technical-changes-head .actions-row {
    display: none;
  }

  #view-technical .technical-change-mode-tabs {
    background: #e2e8f0;
    border: 1px solid #cbd5e1;
    border-radius: var(--radius-sm);
    display: grid;
    gap: 0.24rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0.22rem;
  }

  #view-technical .technical-change-mode-tabs button {
    background: transparent;
    border: 0;
    border-radius: var(--radius-xs);
    color: #334155;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 900;
    min-height: 42px;
    padding: 0.46rem 0.5rem;
  }

  #view-technical .technical-change-mode-tabs button.is-active {
    background: #0f172a;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
    color: #fff;
  }

  #view-technical .technical-change-history.is-empty {
    display: grid;
  }

  #view-technical .technical-changes-editor--audit[data-change-mobile-mode="form"] .technical-change-history {
    display: none;
  }

  #view-technical .technical-changes-editor--audit[data-change-mobile-mode="history"] .technical-change-quick-form {
    display: none;
  }

  #view-technical .technical-change-quick-form:not([hidden]) {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 0.72rem;
  }

  #view-technical .technical-change-core-grid {
    gap: 0.64rem;
  }

  #view-technical .technical-change-core-grid > .field-label:first-child,
  #view-technical .technical-change-core-grid > .field-label:nth-child(2),
  #view-technical .technical-change-core-grid > .field-label:nth-child(3),
  #view-technical .technical-change-core-grid > .field-label:nth-child(4) {
    grid-column: 1 / -1;
  }

  #view-technical .technical-change-part-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.38rem;
    margin-top: 0.44rem;
  }

  #view-technical .technical-change-part-picker label:not(.technical-change-custom-part) {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #334155;
    cursor: pointer;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 900;
    gap: 0;
    min-height: 40px;
    padding: 0.42rem 0.68rem;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
    width: auto;
  }

  #view-technical .technical-change-part-picker label:not(.technical-change-custom-part):has(input:checked) {
    background: #0f766e;
    border-color: #0f766e;
    box-shadow: 0 5px 14px rgba(15, 118, 110, 0.2);
    color: #fff;
  }

  #view-technical .technical-change-part-picker label.technical-change-picker-chip.is-selected {
    background: #0f766e;
    border-color: #0f766e;
    box-shadow: 0 5px 14px rgba(15, 118, 110, 0.2);
    color: #fff;
  }

  #view-technical .technical-change-part-picker input[type="checkbox"] {
    height: 1px;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    width: 1px;
  }

  #view-technical .technical-change-custom-part {
    display: grid;
    flex: 1 1 100%;
    gap: 0.26rem;
    min-height: 0;
    padding: 0;
  }

  #view-technical .technical-change-custom-part input {
    min-height: 42px;
  }

  #view-technical .technical-change-optional-grid {
    gap: 0.56rem;
  }

  #view-technical .technical-change-quick-form > .actions-row {
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  }

  #view-technical .technical-change-quick-form > .actions-row .btn {
    min-height: 44px;
    width: 100%;
  }

  #view-technical .technical-change-save-button {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 8px 18px rgba(4, 120, 87, 0.22);
    color: #fff;
  }

  #view-technical .technical-change-filters {
    background: #f8fafc;
    border-color: #dbe3ed;
  }

  #view-technical .technical-change-filters summary {
    align-items: center;
    color: #0f172a;
    display: flex;
    font-size: 0.84rem;
    font-weight: 900;
    min-height: 42px;
  }

  #view-technical .technical-change-filter-grid {
    gap: 0.52rem;
    padding-top: 0.46rem;
  }

  #view-technical .technical-change-filter-grid label {
    font-size: 0.76rem;
    font-weight: 850;
  }

  #view-technical .technical-change-history-head {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    display: grid;
    gap: 0.16rem;
    padding: 0.62rem;
  }

  #view-technical .technical-change-history-head strong {
    color: #0f172a;
    font-size: 0.92rem;
  }

  #view-technical .technical-change-history-head span {
    color: #64748b;
    font-size: 0.72rem;
    line-height: 1.3;
  }

  #view-technical .technical-change-card-list {
    gap: 0.62rem;
    margin-top: 0.45rem;
  }

  #view-technical .technical-change-item {
    background: #fff;
    border-color: #dbe3ed;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
    gap: 0.52rem;
    padding: 0.64rem;
  }

  #view-technical .technical-change-item-head > div {
    gap: 0.34rem;
    min-width: 0;
  }

  #view-technical .technical-change-item-head strong {
    color: #0f172a;
    font-size: 0.94rem;
    line-height: 1.22;
  }

  #view-technical .technical-change-item-head small,
  #view-technical .technical-change-item-head span {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  #view-technical .technical-change-card-list .technical-change-people {
    display: none;
  }

  #view-technical .technical-change-actions {
    display: grid;
    gap: 0.42rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-technical .technical-change-actions .btn {
    border-color: #cbd5e1;
    font-size: 0.76rem;
    min-height: 42px;
    padding-inline: 0.36rem;
  }

  #view-technical .technical-change-part-list {
    gap: 0.25rem;
  }

  #view-technical .technical-change-part-chip,
  #view-technical .technical-change-variable-chip,
  #view-technical .technical-change-status-pill,
  #view-technical .technical-change-evidence-pill {
    border-radius: 999px;
    font-size: 0.67rem;
    padding: 0.2rem 0.42rem;
  }

  #view-technical .technical-change-detail {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
  }

  #view-technical .technical-change-detail > summary {
    font-size: 0.8rem;
    font-weight: 900;
    min-height: 38px;
  }
}

@media (max-width: 390px) {
  #view-technical .technical-change-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-change-quick-form > .actions-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-change-mode-tabs button {
    font-size: 0.78rem;
    padding-inline: 0.34rem;
  }
}

/* Prevencion de duplicados visuales: origen servidor vs borrador local. */
.origin-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

.origin-badge--server {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
  color: #166534;
}

.origin-badge--local,
.origin-badge--warning {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.38);
  color: #92400e;
}

.origin-badge--missing-server {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.34);
  color: #991b1b;
}

.pipeline-local-drafts {
  margin-top: 18px;
  padding: 16px;
  border: 1px dashed rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.06);
}

.pipeline-local-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pipeline-local-head h4,
.pipeline-local-head p {
  margin: 0;
}

.pipeline-local-head p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.pipeline-board--local {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pipeline-local-card,
.catalog-card.is-local-only {
  border-style: dashed;
  border-color: rgba(245, 158, 11, 0.45);
}

.pipeline-stale-server-card {
  border-color: rgba(239, 68, 68, 0.42);
}

/* Cotizaciones UX refresh: compact commercial workflow, no business-logic changes. */
#view-history {
  --quote-green: #047857;
  --quote-green-soft: #ecfdf5;
  --quote-blue: #2563eb;
  --quote-blue-soft: #eff6ff;
  --quote-amber: #b45309;
  --quote-amber-soft: #fffbeb;
  gap: 0.72rem;
}

#view-history .module-intro {
  margin-bottom: 0.16rem;
}

#view-history .module-intro h3 {
  margin-bottom: 0.2rem;
}

#view-history .card,
#view-history .commercial-colors-panel,
#view-history .commercial-price-panel,
#view-history .commercial-preview-card,
#view-history .commercial-save-result,
#view-history .commercial-preview-hint {
  border-radius: var(--radius-sm);
}

#view-history .quote-commercial-start {
  align-items: center;
  background: linear-gradient(135deg, #ffffff, #f0fdf4);
  border: 1px solid rgba(4, 120, 87, 0.24);
  border-left: 4px solid var(--quote-green);
  box-shadow: 0 10px 22px rgba(4, 120, 87, 0.08);
  margin-bottom: 0.5rem;
  padding: 0.72rem 0.82rem;
}

#view-history .quote-commercial-start .section-description {
  margin-bottom: 0;
}

#view-history #new-commercial-quote {
  min-height: 38px;
  padding-inline: 1rem;
}

#view-history .commercial-quote-form-shell {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-color: rgba(37, 99, 235, 0.22);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  margin-bottom: 0.72rem;
  padding: 0.82rem;
}

#view-history .commercial-quote-form-head {
  align-items: center;
  background: linear-gradient(90deg, #f8fafc, #ffffff);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-left: 4px solid var(--quote-blue);
  border-radius: var(--radius-sm);
  margin-bottom: 0.66rem;
  padding: 0.6rem 0.68rem;
}

#view-history .commercial-quote-form-head h4 {
  color: #172554;
  font-size: 1rem;
}

#view-history #commercial-quote-close {
  min-height: 32px;
  padding: 0.34rem 0.58rem;
}

#view-history .commercial-quote-grid {
  gap: 0.56rem;
}

#view-history .commercial-quote-grid label,
#view-history .commercial-price-panel > label,
#view-history .commercial-color-row label {
  color: #475569;
  font-size: 0.74rem;
  font-weight: 850;
  gap: 0.24rem;
}

#view-history .commercial-quote-grid input,
#view-history .commercial-quote-grid select,
#view-history .commercial-quote-grid textarea,
#view-history .commercial-color-row input,
#view-history .commercial-price-panel input {
  min-height: 34px;
  padding: 0.42rem 0.54rem;
}

#view-history .commercial-quote-notes {
  margin-top: 0.62rem;
}

#view-history .commercial-quote-notes textarea {
  min-height: 58px;
}

#view-history .commercial-quote-status {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0.56rem 0;
  padding: 0;
}

.commercial-status-chips,
.history-status-chips,
.quote-board-status-chips {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.commercial-status-chip,
.history-status-chips span,
.quote-board-status-chips span {
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: var(--radius-pill);
  color: #334155;
  display: inline-flex;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.18;
  min-height: 28px;
  padding: 0.22rem 0.55rem;
}

.commercial-status-chip.is-ready,
.history-status-chips span:first-child {
  background: var(--quote-green-soft);
  border-color: rgba(4, 120, 87, 0.22);
  color: #065f46;
}

.commercial-status-chip.is-warning {
  background: var(--quote-amber-soft);
  border-color: rgba(180, 83, 9, 0.22);
  color: #92400e;
}

.commercial-status-chip.is-muted {
  background: var(--quote-blue-soft);
  border-color: rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
}

#view-history .commercial-colors-panel {
  background: #ffffff;
  border-color: rgba(4, 120, 87, 0.2);
  margin-top: 0.62rem;
  padding: 0.62rem;
}

#view-history .commercial-panel-head {
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  margin-bottom: 0.5rem;
  padding-bottom: 0.44rem;
}

#view-history .commercial-panel-head h5 {
  color: #064e3b;
  font-family: var(--font-title);
  font-size: 0.9rem;
  margin: 0;
}

#view-history #commercial-quote-add-color {
  min-height: 32px;
  padding: 0.32rem 0.56rem;
}

#view-history .commercial-color-list {
  gap: 0.28rem;
}

.commercial-color-table-head,
#view-history .commercial-color-row {
  display: grid;
  gap: 0.38rem;
  grid-template-columns: minmax(0, 1.25fr) minmax(92px, 0.55fr) minmax(74px, auto);
}

.commercial-color-table-head {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  padding: 0 0.28rem;
  text-transform: uppercase;
}

#view-history .commercial-color-row {
  align-items: end;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-sm);
  padding: 0.34rem;
}

#view-history .commercial-color-row label > span {
  display: none;
}

#view-history .commercial-color-row button {
  min-height: 34px;
  padding-inline: 0.46rem;
}

#view-history .commercial-color-total {
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: var(--radius-sm);
  color: #334155;
  font-size: 0.82rem;
  gap: 0.42rem;
  margin-top: 0.48rem;
  padding: 0.4rem 0.54rem;
}

#view-history .commercial-price-panel {
  align-items: stretch;
  background: linear-gradient(135deg, #f8fafc, #ffffff 42%, #fffbeb);
  border: 1px solid rgba(180, 83, 9, 0.22);
  border-left: 4px solid var(--quote-amber);
  box-shadow: 0 12px 28px rgba(180, 83, 9, 0.08);
  gap: 0.72rem;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 260px);
  margin-top: 0.68rem;
  padding: 0.68rem;
}

#view-history .commercial-price-summary {
  display: grid;
  gap: 0.42rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.commercial-price-summary-head {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: var(--radius-sm);
  display: flex;
  gap: 0.5rem;
  grid-column: 1 / -1;
  justify-content: space-between;
  padding: 0.42rem 0.54rem;
}

#view-history .commercial-price-summary-head span {
  color: #0f172a;
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: none;
}

#view-history .commercial-price-summary-head b {
  background: var(--quote-blue-soft);
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: var(--radius-pill);
  color: #1d4ed8;
  font-size: 0.74rem;
  font-family: var(--font-main);
  margin-top: 0;
  padding: 0.2rem 0.5rem;
}

#view-history .commercial-price-kpi {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: var(--radius-sm);
  min-height: 64px;
  padding: 0.48rem 0.54rem;
}

#view-history .commercial-price-kpi-primary {
  background: linear-gradient(135deg, #064e3b, #047857);
  border-color: rgba(4, 120, 87, 0.5);
  color: #ffffff;
  grid-column: span 2;
}

#view-history .commercial-price-summary span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-history .commercial-price-summary b {
  color: #0f172a;
  font-family: var(--font-title);
  font-size: 1.03rem;
  margin-top: 0.12rem;
}

#view-history .commercial-price-summary .commercial-price-summary-head span {
  color: #0f172a;
  font-family: var(--font-title);
  font-size: 0.9rem;
  text-transform: none;
}

#view-history .commercial-price-summary .commercial-price-summary-head b {
  color: #1d4ed8;
  font-family: var(--font-main);
  font-size: 0.74rem;
  margin-top: 0;
}

#view-history .commercial-price-kpi-primary span,
#view-history .commercial-price-kpi-primary b {
  color: #ffffff;
}

#view-history .commercial-price-kpi-primary b {
  font-size: 1.28rem;
}

#view-history .commercial-price-panel > label {
  background: #ffffff;
  border: 1px solid rgba(4, 120, 87, 0.24);
  border-radius: var(--radius-sm);
  justify-content: center;
  padding: 0.58rem;
}

#view-history .commercial-price-panel > label input {
  border-color: rgba(4, 120, 87, 0.38);
  color: #065f46;
  font-family: var(--font-title);
  font-size: 1.32rem;
  font-weight: 900;
  min-height: 48px;
  text-align: right;
}

#view-history .commercial-quote-actions {
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-sm);
  justify-content: flex-end;
  margin-top: 0.62rem;
  padding: 0.48rem;
}

#view-history #commercial-quote-save {
  font-weight: 900;
  min-width: min(100%, 230px);
}

#view-history #commercial-quote-preview {
  background: #ffffff;
}

#view-history .commercial-preview-root {
  margin-top: 0.62rem;
}

#view-history .commercial-preview-hint {
  background: #f8fafc;
  color: #64748b;
  padding: 0.5rem 0.58rem;
}

#view-history .commercial-preview-hint p {
  margin: 0;
}

#view-history .history-module {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  margin-bottom: 0.72rem;
  padding: 0.74rem;
}

#view-history .quote-section-head {
  align-items: center;
  margin-bottom: 0.55rem;
}

#view-history .quote-section-head h4,
#view-history .quote-board-header h4 {
  color: #0f172a;
}

#view-history .history-filters {
  align-items: end;
  border-bottom: 0;
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(220px, 1.25fr) minmax(150px, 0.55fr);
  margin-bottom: 0.5rem;
  padding-bottom: 0;
}

#view-history #history-status,
#view-history #quote-board-status {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0 0 0.5rem;
  padding: 0;
}

#view-history #history-list {
  display: grid;
  gap: 0.5rem;
}

#view-history .history-quote-card {
  box-shadow: none;
  display: grid;
  gap: 0.45rem;
  padding: 0.62rem;
}

#view-history .history-quote-card header {
  align-items: center;
}

#view-history .history-quote-card .catalog-tags {
  gap: 0.28rem;
  margin-top: 0;
}

#view-history .history-quote-card .actions-mini {
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  padding-top: 0.42rem;
}

#view-history .quote-board-module {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: none;
  margin-bottom: 0.72rem;
  padding: 0.72rem;
}

#view-history .quote-board-header {
  align-items: center;
  margin-bottom: 0.48rem;
}

#view-history .quote-board-list {
  display: grid;
  gap: 0.48rem;
  margin-top: 0.5rem;
}

#view-history .quote-board-card {
  background: #ffffff;
  box-shadow: none;
  gap: 0.58rem;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 0.55rem;
}

#view-history .quote-board-thumb {
  border-radius: var(--radius-sm);
  width: 48px;
}

#view-history .quote-board-main header {
  align-items: flex-start;
  gap: 0.48rem;
}

#view-history .quote-board-main .catalog-tags {
  gap: 0.28rem;
  margin-top: 0.34rem;
}

#view-history .quote-board-actions {
  margin-top: 0.4rem;
}

#view-history .quote-admin-advanced {
  background: #f8fafc;
  border-style: dashed;
  box-shadow: none;
  color: #475569;
  margin-bottom: 0.72rem;
  padding: 0.62rem 0.72rem;
}

#view-history .quote-admin-advanced summary {
  min-height: 30px;
}

#view-history .quote-admin-advanced-body {
  gap: 0.56rem;
  padding-top: 0.62rem;
}

#view-history .history-detail-card {
  background: #ffffff;
  box-shadow: none;
}

@media (max-width: 1100px) {
  #view-history .commercial-price-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-history .commercial-price-kpi-primary {
    grid-column: span 1;
  }
}

@media (max-width: 900px) {
  #view-history .commercial-quote-grid,
  #view-history .commercial-quote-notes,
  #view-history .history-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .commercial-price-panel,
  #view-history .commercial-preview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  #view-history {
    gap: 0.58rem;
  }

  #view-history .quote-commercial-start,
  #view-history .commercial-quote-form-head,
  #view-history .commercial-panel-head,
  #view-history .quote-section-head,
  #view-history .quote-board-header {
    align-items: stretch;
    flex-direction: column;
  }

  #view-history .commercial-quote-grid,
  #view-history .commercial-quote-notes,
  #view-history .history-filters,
  #view-history .commercial-price-summary,
  .commercial-color-table-head,
  #view-history .commercial-color-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .commercial-color-table-head {
    display: none;
  }

  #view-history .commercial-color-row label > span {
    display: inline;
  }

  #view-history .commercial-price-panel > label input {
    text-align: left;
  }

  #view-history .commercial-quote-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #view-history .commercial-quote-actions > *,
  #view-history #commercial-quote-save {
    width: 100%;
  }
}

@media (max-width: 430px) {
  #view-history .commercial-quote-form-shell,
  #view-history .history-module,
  #view-history .quote-board-module,
  #view-history .quote-admin-advanced {
    padding: 0.56rem;
  }

  #view-history .commercial-price-kpi {
    min-height: 56px;
  }

  #view-history .history-quote-card .actions-mini,
  #view-history .quote-board-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  #view-history .commercial-status-chip,
  #view-history .history-status-chips span,
  #view-history .quote-board-status-chips span,
  #view-history .metric-tag {
    font-size: 0.7rem;
    padding-inline: 0.42rem;
  }

  #view-history .quote-board-card {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Cotizaciones UX controls: dates, predefined colors, margin and optional layer 3. */
#view-history .commercial-date-field {
  gap: 0.38rem;
}

#view-history .date-preset-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
}

#view-history .field-inline-option,
#view-history .commercial-layer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-height: 34px;
  color: #475569;
  font-size: 0.82rem;
}

#view-history .field-inline-option input,
#view-history .commercial-layer-toggle input {
  width: auto;
  min-height: auto;
}

#view-history .commercial-color-row {
  grid-template-columns: minmax(124px, 1.25fr) minmax(90px, 0.7fr) auto;
}

#view-history .commercial-color-table-head {
  grid-template-columns: minmax(124px, 1.25fr) minmax(90px, 0.7fr) auto;
}

#view-history .commercial-color-row.has-custom,
#view-history .commercial-color-table-head.has-custom {
  grid-template-columns: minmax(124px, 1.25fr) minmax(132px, 1.1fr) minmax(90px, 0.7fr) auto;
}

#view-history .commercial-color-row .is-hidden {
  display: none;
}

#view-history .commercial-color-row select {
  min-height: 38px;
}

#view-history .commercial-decision-grid {
  display: grid;
  grid-template-columns: minmax(112px, 0.75fr) minmax(220px, 1.4fr) minmax(180px, 1fr) minmax(150px, 0.9fr);
  gap: 0.68rem;
  align-items: end;
  margin-bottom: 0.75rem;
}

#view-history .commercial-margin-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-content: end;
  min-height: 38px;
}

#view-history .commercial-margin-presets .btn {
  min-height: 32px;
  padding-inline: 0.55rem;
}

#view-history .commercial-layer-toggle {
  min-height: 42px;
  padding: 0.55rem 0.65rem;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 8px;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
}

#view-history .commercial-final-price-field {
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(180px, 0.45fr);
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.72rem;
  padding: 0.78rem;
  border: 1px solid rgba(4, 120, 87, 0.24);
  border-radius: 8px;
  background: #ecfdf5;
  color: #064e3b;
}

#view-history .commercial-final-price-field input {
  font-size: 1.2rem;
  font-weight: 800;
  color: #065f46;
}

#view-history .commercial-optional-panel {
  border: 1px solid rgba(174, 185, 199, 0.6);
  border-radius: 8px;
  background: #ffffff;
}

#view-history .commercial-optional-panel summary {
  cursor: pointer;
  padding: 0.68rem 0.78rem;
  color: #334155;
  font-weight: 800;
}

#view-history .commercial-optional-panel .commercial-quote-notes {
  padding: 0 0.78rem 0.78rem;
}

#view-history .history-quote-card .actions-mini .btn-primary {
  box-shadow: 0 10px 22px rgba(36, 11, 85, 0.16);
}

@media (max-width: 1100px) {
  #view-history .commercial-decision-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #view-history .commercial-color-row {
    grid-template-columns: minmax(0, 1fr) minmax(88px, 0.55fr) auto;
  }

  #view-history .commercial-color-row.has-custom,
  #view-history .commercial-color-table-head.has-custom {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(88px, 0.55fr) auto;
  }

  #view-history .commercial-final-price-field {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  #view-history .date-preset-field,
  #view-history .commercial-decision-grid,
  #view-history .commercial-color-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-history .commercial-layer-toggle,
  #view-history .field-inline-option {
    width: 100%;
  }

  #view-history .commercial-color-row .is-hidden {
    display: none;
  }

  #view-history .commercial-margin-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 390px) {
  #view-history .commercial-margin-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Cotizaciones: desktop balance, selected-reference summary and lightning quote. */
#view-history .quote-commercial-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

#view-history .quote-commercial-actions .btn {
  min-height: 38px;
  white-space: nowrap;
}

#view-history .commercial-quote-layout,
#view-history .lightning-quote-layout {
  align-items: start;
  display: grid;
  gap: 0.95rem;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
}

#view-history .commercial-quote-main,
#view-history .lightning-quote-main {
  min-width: 0;
}

#view-history .commercial-quote-side,
#view-history .lightning-quote-side {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

#view-history .commercial-reference-picker-field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  position: relative;
}

#view-history .commercial-reference-picker-label {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 900;
}

#view-history .commercial-reference-native-select {
  display: none;
}

#view-history .commercial-reference-picker-root,
#view-history .commercial-reference-picker {
  min-width: 0;
  position: relative;
}

#view-history .commercial-reference-picker-control {
  align-items: center;
  display: grid;
  gap: 0.42rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

#view-history .commercial-reference-picker-control input {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.26);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.07);
  color: #0f172a;
  cursor: pointer;
  font-weight: 850;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#view-history .commercial-reference-picker-control input:focus {
  border-color: rgba(37, 99, 235, 0.58);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
  outline: none;
}

#view-history .commercial-reference-picker-current {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
}

#view-history .commercial-reference-sheet-backdrop {
  display: none;
}

#view-history .commercial-reference-picker-panel {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.18);
  left: 0;
  margin-top: 0.38rem;
  max-height: min(470px, 62vh);
  min-width: min(560px, calc(100vw - 2rem));
  overflow: hidden;
  padding: 0.58rem;
  position: absolute;
  top: 100%;
  width: 100%;
  z-index: 80;
}

#view-history .commercial-reference-sheet-head {
  align-items: center;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

#view-history .commercial-reference-sheet-head span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-history .commercial-reference-sheet-head h5 {
  color: #0f172a;
  font-family: var(--font-title);
  font-size: 0.98rem;
  margin: 0.05rem 0 0;
}

#view-history .commercial-reference-search-box {
  display: grid;
  gap: 0.25rem;
  margin-bottom: 0.52rem;
}

#view-history .commercial-reference-search-box span {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 900;
}

#view-history .commercial-reference-search-box input {
  border-color: rgba(37, 99, 235, 0.32);
  min-height: 42px;
}

#view-history .commercial-reference-results {
  display: grid;
  gap: 0.4rem;
  max-height: 330px;
  overflow-y: auto;
  padding-right: 0.1rem;
}

#view-history .commercial-reference-option {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-sm);
  color: #0f172a;
  cursor: pointer;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-width: 0;
  padding: 0.48rem;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  width: 100%;
}

#view-history .commercial-reference-option:hover,
#view-history .commercial-reference-option.is-active {
  border-color: rgba(37, 99, 235, 0.48);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

#view-history .commercial-reference-option.is-selected {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.5);
}

#view-history .commercial-reference-option-thumb {
  align-items: center;
  background: #eef2ff;
  border-radius: 8px;
  color: #1d4ed8;
  display: grid;
  font-weight: 900;
  height: 46px;
  justify-content: center;
  overflow: hidden;
  width: 46px;
}

#view-history .commercial-reference-option-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

#view-history .commercial-reference-option-copy {
  display: grid;
  gap: 0.12rem;
  min-width: 0;
}

#view-history .commercial-reference-option-copy b {
  color: #0f172a;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

#view-history .commercial-reference-option-copy small {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

#view-history .commercial-reference-option-copy em {
  color: #92400e;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

#view-history .commercial-reference-option-status {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: var(--radius-pill);
  color: #475569;
  font-size: 0.7rem;
  font-weight: 900;
  padding: 0.2rem 0.46rem;
  white-space: nowrap;
}

#view-history .commercial-reference-option-status.is-ready {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.24);
  color: #065f46;
}

#view-history .commercial-reference-option-status.is-costable {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.24);
  color: #1d4ed8;
}

#view-history .commercial-reference-option-status.is-pending {
  background: #fffbeb;
  border-color: rgba(180, 83, 9, 0.22);
  color: #92400e;
}

#view-history .commercial-reference-option-status.is-blocked {
  background: #fef2f2;
  border-color: rgba(185, 28, 28, 0.22);
  color: #991b1b;
}

#view-history .commercial-reference-picker-empty {
  background: #f8fafc;
  border: 1px dashed rgba(148, 163, 184, 0.34);
  border-radius: var(--radius-sm);
  color: #64748b;
  font-size: 0.86rem;
  font-weight: 800;
  margin: 0;
  padding: 0.8rem;
  text-align: center;
}

@media (min-width: 1201px) {
  #view-history .commercial-quote-side,
  #view-history .lightning-quote-side {
    position: sticky;
    top: 0.75rem;
  }
}

#view-history .commercial-reference-highlight {
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-left: 4px solid var(--quote-blue);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  margin-top: 0.52rem;
  padding: 0.62rem;
}

#view-history .commercial-reference-highlight.is-ready {
  border-left-color: var(--quote-green);
}

#view-history .commercial-reference-highlight.is-blocked {
  border-left-color: var(--quote-amber);
}

#view-history .commercial-reference-highlight-head {
  align-items: center;
  display: flex;
  gap: 0.65rem;
  justify-content: space-between;
  margin-bottom: 0.52rem;
}

#view-history .commercial-reference-highlight-head span,
#view-history .lightning-result-head span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

#view-history .commercial-reference-highlight-head h5 {
  color: #0f172a;
  font-family: var(--font-title);
  font-size: 0.98rem;
  margin: 0.08rem 0 0;
}

#view-history .commercial-reference-highlight-head b,
#view-history .lightning-result-head b {
  background: #ecfdf5;
  border: 1px solid rgba(4, 120, 87, 0.2);
  border-radius: var(--radius-pill);
  color: #065f46;
  font-size: 0.72rem;
  padding: 0.22rem 0.5rem;
  white-space: nowrap;
}

#view-history .commercial-reference-highlight.is-blocked .commercial-reference-highlight-head b {
  background: #fffbeb;
  border-color: rgba(180, 83, 9, 0.24);
  color: #92400e;
}

#view-history .commercial-reference-metrics,
#view-history .lightning-result-grid {
  display: grid;
  gap: 0.42rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-history .commercial-reference-metrics p,
#view-history .lightning-result-grid p {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.12rem;
  margin: 0;
  min-width: 0;
  padding: 0.42rem 0.5rem;
}

#view-history .commercial-reference-metrics span,
#view-history .lightning-result-grid span {
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-history .commercial-reference-metrics b,
#view-history .lightning-result-grid b {
  color: #0f172a;
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

#view-history .commercial-quote-side .commercial-price-panel {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
  min-width: 0;
}

#view-history .commercial-quote-side .commercial-decision-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-bottom: 0;
}

#view-history .commercial-quote-side .commercial-margin-presets {
  grid-column: 1 / -1;
}

#view-history .commercial-quote-side .commercial-layer-toggle {
  align-self: stretch;
}

#view-history .commercial-quote-side .commercial-price-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-history .commercial-quote-side .commercial-price-kpi-primary {
  grid-column: 1 / -1;
}

#view-history .commercial-quote-side .commercial-price-kpi {
  min-height: 58px;
}

#view-history .commercial-quote-side .commercial-final-price-field {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

#view-history .commercial-quote-side .commercial-final-price-field input {
  text-align: left;
}

#view-history .commercial-quote-side .commercial-quote-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
}

#view-history .commercial-quote-side .commercial-quote-actions .btn {
  width: 100%;
}

#view-history .lightning-quote-shell {
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border-color: rgba(4, 120, 87, 0.22);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
  margin-bottom: 0.72rem;
  padding: 0.82rem;
}

#view-history .lightning-quote-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-history .lightning-quote-grid .commercial-final-price-field {
  box-sizing: border-box;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 0;
  min-width: 0;
  padding: 0.58rem;
}

#view-history .lightning-quote-grid .commercial-final-price-field input {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  width: 100%;
}

#view-history .lightning-advanced-panel {
  margin-top: 0.72rem;
}

#view-history .lightning-advanced-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-history .lightning-quote-result {
  background: linear-gradient(135deg, #f8fafc, #ffffff 48%, #ecfdf5);
  border: 1px solid rgba(4, 120, 87, 0.22);
  border-left: 4px solid var(--quote-green);
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 28px rgba(4, 120, 87, 0.08);
  padding: 0.72rem;
}

#view-history .lightning-result-head {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-bottom: 0.58rem;
}

#view-history .lightning-kpi-primary {
  background: linear-gradient(135deg, #064e3b, #047857);
  border-radius: var(--radius-sm);
  color: #ffffff;
  display: grid;
  gap: 0.18rem;
  margin-bottom: 0.5rem;
  padding: 0.7rem;
}

#view-history .lightning-kpi-primary span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-history .lightning-kpi-primary b {
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1.55rem;
}

#view-history .lightning-note {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 0.55rem 0 0;
}

#view-history .lightning-quote-actions {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.45rem;
  padding: 0.5rem;
}

#view-history .lightning-quote-actions .btn {
  width: 100%;
}

@media (max-width: 1200px) {
  #view-history .commercial-quote-layout,
  #view-history .lightning-quote-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-history .commercial-quote-side .commercial-price-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-history .commercial-quote-side .commercial-price-kpi-primary {
    grid-column: span 1;
  }

  #view-history .commercial-quote-side .commercial-quote-actions,
  #view-history .lightning-quote-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #view-history .commercial-reference-metrics,
  #view-history .lightning-result-grid,
  #view-history .lightning-quote-grid,
  #view-history .lightning-advanced-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-history .commercial-quote-side .commercial-price-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .commercial-quote-side .commercial-quote-actions,
  #view-history .lightning-quote-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  #view-history .quote-commercial-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  #view-history .quote-commercial-actions .btn,
  #view-history .quote-commercial-start #new-commercial-quote {
    width: 100%;
  }

  #view-history .commercial-reference-highlight-head,
  #view-history .lightning-result-head {
    align-items: stretch;
    flex-direction: column;
  }

  #view-history .commercial-quote-side .commercial-decision-grid,
  #view-history .commercial-quote-side .commercial-price-summary {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Cotizaciones final polish: stronger cost/price hierarchy and compact commercial PDF. */
#view-history .commercial-form-details,
#view-history .lightning-advanced-panel {
  margin-top: 0.62rem;
}

#view-history .commercial-form-details .commercial-quote-notes,
#view-history .lightning-advanced-panel .lightning-advanced-grid {
  margin-top: 0;
  padding: 0 0.78rem 0.78rem;
}

#view-history .commercial-quote-side .commercial-decision-grid {
  align-items: stretch;
}

#view-history .commercial-quote-side .commercial-decision-grid > label:first-child {
  background: #ffffff;
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.58rem;
}

#view-history .commercial-reference-metric-cost,
#view-history .commercial-reference-metric-price,
#view-history .commercial-reference-metric-total {
  border-color: rgba(15, 23, 42, 0.18);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.03);
}

#view-history .commercial-reference-metric-cost b,
#view-history .commercial-reference-metric-price b,
#view-history .commercial-reference-metric-total b {
  font-family: var(--font-title);
  font-size: 1rem;
}

#view-history .commercial-price-kpi-cost {
  background: linear-gradient(135deg, #172554, #1d4ed8);
  border-color: rgba(29, 78, 216, 0.42);
  color: #ffffff;
  grid-column: 1 / -1;
}

#view-history .commercial-price-kpi-total {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.24);
}

#view-history .commercial-price-kpi-margin {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.2);
}

#view-history .commercial-price-kpi-cost span,
#view-history .commercial-price-kpi-cost b {
  color: #ffffff;
}

#view-history .commercial-price-kpi-cost b,
#view-history .commercial-price-kpi-primary b {
  font-size: clamp(1.18rem, 2.1vw, 1.48rem);
}

#view-history .lightning-kpi-row {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  margin-bottom: 0.5rem;
}

#view-history .lightning-kpi-primary,
#view-history .lightning-kpi-cost {
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.7rem;
}

#view-history .lightning-kpi-primary {
  margin-bottom: 0;
}

#view-history .lightning-kpi-cost {
  background: linear-gradient(135deg, #172554, #1d4ed8);
  color: #ffffff;
}

#view-history .lightning-kpi-cost span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-history .lightning-kpi-cost b {
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

#view-history .lightning-result-emphasis {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.24);
}

.snapshot-public-grid--no-image {
  grid-template-columns: minmax(0, 1fr);
}

.snapshot-reference-figure {
  margin: 0;
  min-width: 0;
}

.snapshot-current-tier {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.snapshot-current-tier article {
  background: #fbfdfb;
  border: 1px solid #dfe7dd;
  border-radius: 8px;
  padding: 0.85rem;
}

.snapshot-current-tier span,
.snapshot-current-tier b {
  display: block;
}

.snapshot-current-tier span {
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.snapshot-current-tier b {
  color: #172018;
  font-family: var(--font-title);
  font-size: 1.18rem;
  margin-top: 0.22rem;
}

@media (max-width: 560px) {
  #view-history .commercial-quote-form-shell,
  #view-history .lightning-quote-shell {
    padding: 0.48rem;
  }

  #view-history .commercial-quote-form-head .section-description,
  #view-history .quote-commercial-start .section-description {
    display: none;
  }

  #view-history .commercial-quote-form-head {
    margin-bottom: 0.48rem;
    padding: 0.48rem;
  }

  #view-history .commercial-colors-panel,
  #view-history .commercial-price-panel,
  #view-history .lightning-quote-result {
    padding: 0.5rem;
  }

  #view-history .commercial-quote-side .commercial-price-summary,
  #view-history .lightning-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .commercial-quote-side .commercial-price-kpi-primary,
  #view-history .commercial-quote-side .commercial-price-kpi-cost {
    grid-column: 1 / -1;
  }

  #view-history .commercial-price-kpi,
  #view-history .lightning-result-grid p {
    min-height: 52px;
    padding: 0.42rem 0.46rem;
  }

  #view-history .commercial-price-summary-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.32rem;
  }

  #view-history .lightning-kpi-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .snapshot-public-grid,
  .snapshot-current-tier {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  #view-history .commercial-quote-side .commercial-price-summary,
  #view-history .lightning-result-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Cotizaciones mobile mode split: formal vs lightning. */
#view-history .quote-mode-switch {
  align-items: stretch;
  display: grid;
  gap: 0.42rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: min(100%, 520px);
}

#view-history .quote-mode-tab {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-sm);
  color: #334155;
  cursor: pointer;
  display: grid;
  gap: 0.12rem;
  min-height: 54px;
  min-width: 0;
  padding: 0.5rem 0.65rem;
  text-align: left;
}

#view-history .quote-mode-tab span {
  color: #0f172a;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 850;
}

#view-history .quote-mode-tab small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
}

#view-history .quote-mode-tab.is-active {
  background: linear-gradient(135deg, #f0fdf4, #ffffff);
  border-color: rgba(4, 120, 87, 0.42);
  box-shadow: inset 0 0 0 1px rgba(4, 120, 87, 0.08);
}

#view-history .quote-mode-tab.is-active span {
  color: #065f46;
}

#view-history .quote-secondary-area {
  display: grid;
  gap: 0.56rem;
  margin-top: 0.55rem;
}

#view-history .quote-secondary-area[hidden] {
  display: none;
}

#view-history .quote-secondary-panel {
  margin-bottom: 0;
  padding: 0;
}

#view-history .quote-secondary-panel > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  list-style: none;
  padding: 0.68rem 0.78rem;
}

#view-history .quote-secondary-panel > summary::-webkit-details-marker {
  display: none;
}

#view-history .quote-secondary-panel > summary span {
  color: #172554;
  font-family: var(--font-title);
  font-size: 0.98rem;
  font-weight: 850;
}

#view-history .quote-secondary-panel > summary small {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
  text-align: right;
}

#view-history .quote-secondary-panel > summary::after {
  color: #64748b;
  content: "Abrir";
  font-size: 0.72rem;
  font-weight: 850;
}

#view-history .quote-secondary-panel[open] > summary::after {
  content: "Cerrar";
}

#view-history .quote-secondary-body {
  display: grid;
  gap: 0.62rem;
  padding: 0 0.78rem 0.78rem;
}

#view-history .quote-secondary-module {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: var(--radius-sm);
  min-width: 0;
  padding: 0.68rem;
}

#view-history[data-quote-mode="lightning"] .quote-secondary-area {
  display: none;
}

#view-history .commercial-reference-title {
  align-items: center;
  display: flex;
  gap: 0.58rem;
  min-width: 0;
}

#view-history .commercial-reference-title > div {
  min-width: 0;
}

#view-history .commercial-reference-thumb {
  aspect-ratio: 1;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-sm);
  flex: 0 0 50px;
  height: 50px;
  object-fit: cover;
  width: 50px;
}

#view-history .lightning-quote-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-history #lightning-quote-calculate {
  grid-column: 1 / -1;
}

@media (max-width: 560px) {
  #view-history .module-intro {
    margin-bottom: 0;
  }

  #view-history .module-intro .section-description {
    display: none;
  }

  #view-history .quote-commercial-start {
    align-items: stretch;
    display: grid;
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.56rem;
  }

  #view-history .quote-commercial-start h4 {
    margin-bottom: 0.08rem;
  }

  #view-history .quote-mode-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: stretch;
    min-width: 0;
    width: 100%;
  }

  #view-history .quote-mode-tab {
    min-height: 48px;
    padding: 0.42rem 0.48rem;
  }

  #view-history .quote-mode-tab small {
    display: none;
  }

  #view-history .commercial-quote-form-shell,
  #view-history .lightning-quote-shell {
    margin-bottom: 0.52rem;
  }

  #view-history .commercial-quote-layout {
    display: flex;
    flex-direction: column;
  }

  #view-history .commercial-quote-main,
  #view-history .commercial-quote-side {
    display: contents;
  }

  #view-history .commercial-quote-main > .commercial-quote-grid {
    order: 1;
  }

  #view-history .commercial-price-panel {
    order: 2;
  }

  #view-history .commercial-quote-status {
    order: 3;
  }

  #view-history .commercial-colors-panel {
    order: 4;
  }

  #view-history .commercial-quote-side .commercial-quote-actions {
    order: 5;
  }

  #view-history .commercial-reference-highlight,
  #view-history .commercial-colors-panel,
  #view-history .commercial-price-panel {
    margin-top: 0.46rem;
  }

  #view-history .commercial-reference-metrics {
    display: none;
  }

  #view-history .commercial-reference-thumb {
    flex-basis: 42px;
    height: 42px;
    width: 42px;
  }

  #view-history .lightning-quote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .lightning-quote-grid > label:first-child,
  #view-history .lightning-quote-grid .commercial-final-price-field {
    grid-column: 1 / -1;
  }

  #view-history .lightning-kpi-row,
  #view-history .lightning-result-grid,
  #view-history .lightning-quote-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .lightning-kpi-primary,
  #view-history #lightning-quote-calculate {
    grid-column: 1 / -1;
  }

  #view-history .lightning-quote-actions .btn {
    min-width: 0;
    white-space: normal;
  }

  #view-history .quote-secondary-panel > summary {
    padding: 0.58rem 0.62rem;
  }

  #view-history .quote-secondary-panel > summary small {
    display: none;
  }

  #view-history .quote-secondary-body {
    padding: 0 0.56rem 0.56rem;
  }
}

@media (max-width: 390px) {
  #view-history .commercial-reference-metrics,
  #view-history .lightning-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .lightning-result-grid p,
  #view-history .commercial-reference-metrics p {
    padding: 0.38rem 0.4rem;
  }
}

.header-status-group {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  justify-content: flex-end;
  min-width: 0;
}

.header-status-group .header-status-pill {
  flex: 0 1 auto;
}

.admin-status-chip {
  align-items: center;
  background: var(--color-success-bg);
  border: 1px solid rgba(4, 120, 87, 0.22);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 18px rgba(4, 120, 87, 0.08);
  color: var(--color-success);
  display: inline-flex;
  font-size: var(--text-xs);
  font-weight: 900;
  gap: 0.32rem;
  line-height: 1.1;
  min-height: 28px;
  padding: 0.28rem 0.64rem;
  white-space: nowrap;
}

.admin-status-chip::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 0.42rem;
  width: 0.42rem;
}

.toast-region {
  display: grid;
  gap: 0.58rem;
  max-width: min(380px, calc(100vw - 2rem));
  pointer-events: none;
  position: fixed;
  right: 1rem;
  top: 1rem;
  width: min(380px, calc(100vw - 2rem));
  z-index: 120;
}

.toast {
  align-items: flex-start;
  animation: toast-in var(--motion-slow) var(--ease-out);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-info);
  border-radius: var(--radius-sm);
  box-shadow: 0 16px 38px rgba(31, 22, 51, 0.16);
  color: var(--color-text);
  display: grid;
  gap: 0.52rem;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  padding: 0.72rem 0.72rem 0.72rem 0.82rem;
  pointer-events: auto;
}

.toast.is-leaving {
  animation: toast-out var(--motion-base) var(--ease-standard) forwards;
}

.toast-success {
  border-left-color: var(--color-success);
}

.toast-error {
  border-left-color: var(--color-danger);
}

.toast-warning {
  border-left-color: var(--color-warning);
}

.toast-info {
  border-left-color: var(--color-info);
}

.toast-copy {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}

.toast-copy strong {
  color: var(--color-primary-900);
  font-size: 0.9rem;
  line-height: 1.16;
}

.toast-copy p {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 750;
  line-height: 1.3;
  margin: 0;
}

.toast-close {
  align-items: center;
  background: var(--color-neutral-bg);
  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 50%;
  color: var(--color-text-muted);
  cursor: pointer;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  height: 1.45rem;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 1.45rem;
}

.toast-close:hover,
.toast-close:focus-visible {
  background: var(--color-primary-050);
  border-color: var(--color-border-strong);
  color: var(--color-primary-900);
  outline: none;
}

.finance-access-error {
  background: var(--color-danger-bg);
  border: 1px solid rgba(185, 28, 28, 0.16);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  display: none;
  line-height: 1.32;
  padding: 0.42rem 0.5rem;
}

.finance-access-error:not(:empty) {
  display: block;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}

@media (max-width: 760px) {
  .workspace-header {
    grid-template-areas:
      "toggle title"
      "status status";
  }

  .header-status-group {
    grid-area: status;
    justify-content: stretch;
    width: 100%;
  }

  .header-status-group .header-status-pill {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
  }

  .admin-status-chip {
    flex: 0 0 auto;
  }

  .toast-region {
    bottom: 0.82rem;
    left: 0.82rem;
    max-width: calc(100vw - 1.64rem);
    right: 0.82rem;
    top: auto;
    width: auto;
  }

  .toast {
    padding: 0.68rem;
  }
}

@media (max-width: 390px) {
  .header-status-group {
    align-items: stretch;
    flex-direction: column;
    gap: 0.3rem;
  }

  .header-status-group .header-status-pill,
  .admin-status-chip {
    justify-content: center;
    width: 100%;
  }

  .toast-region {
    bottom: 0.55rem;
    left: 0.55rem;
    right: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.is-leaving {
    animation: none;
  }
}

.permanent-delete-modal {
  align-items: center;
  background: rgba(15, 23, 42, 0.54);
  display: grid;
  inset: 0;
  padding: 1rem;
  position: fixed;
  z-index: 110;
}

.permanent-delete-modal[hidden] {
  display: none;
}

.permanent-delete-dialog {
  background: #fff;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  max-width: 460px;
  padding: 1.1rem;
  width: min(100%, 460px);
}

.permanent-delete-dialog h3 {
  margin: 0.18rem 0 0.3rem;
}

.permanent-delete-dialog label {
  display: grid;
  gap: 0.32rem;
  margin-top: 0.82rem;
  font-weight: 850;
}

.permanent-delete-dialog input {
  width: 100%;
}

.delete-warning-box {
  background: var(--color-danger-bg);
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  font-size: var(--text-sm);
  font-weight: 850;
  line-height: 1.34;
  margin-top: 0.72rem;
  padding: 0.62rem 0.68rem;
}

.field-help {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 750;
}

.permanent-delete-error {
  background: var(--color-danger-bg);
  border: 1px solid rgba(185, 28, 28, 0.16);
  border-radius: var(--radius-sm);
  color: var(--color-danger);
  display: none;
  font-weight: 800;
  line-height: 1.32;
  margin: 0.55rem 0 0;
  padding: 0.42rem 0.5rem;
}

.permanent-delete-error:not(:empty) {
  display: block;
}

#view-dashboard .card-more-trigger {
  min-width: 42px;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

.catalog-card-more-menu {
  max-width: min(240px, calc(100vw - 1rem));
}

@media (max-width: 760px) {
  .permanent-delete-modal {
    align-items: end;
    padding: 0.72rem;
  }

  .permanent-delete-dialog {
    border-radius: var(--radius-md);
    max-width: none;
    padding: 0.9rem;
    width: 100%;
  }

  .catalog-card-more-menu {
    min-width: 176px;
  }
}

.commercial-decision-grid-compact {
  display: grid;
  gap: 0.65rem;
}

.commercial-margin-control {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 0.25rem;
}

.commercial-margin-control summary {
  align-items: center;
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  font-weight: 750;
  list-style: none;
  padding: 0.55rem 0.7rem;
}

.commercial-margin-control summary small {
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.18);
  border-radius: 999px;
  color: #0369a1;
  font-size: 0.72rem;
  font-weight: 850;
  padding: 0.16rem 0.46rem;
}

.commercial-margin-control summary::-webkit-details-marker {
  display: none;
}

.commercial-margin-control[open] summary {
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  margin-bottom: 0.45rem;
}

.commercial-margin-control label {
  display: grid;
  gap: 0.35rem;
  padding: 0 0.55rem 0.55rem;
}

.commercial-margin-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.55rem 0.55rem;
}

.commercial-margin-help,
.commercial-save-note,
.commercial-cost-note {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: 1.35;
}

.commercial-colors-panel.is-compact {
  padding-bottom: 0.65rem;
}

.commercial-colors-panel.is-compact .section-description {
  display: none;
}

.commercial-color-details {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 0.2rem 0.65rem 0.65rem;
}

.commercial-color-details summary {
  background: rgba(15, 23, 42, 0.04);
  border-radius: 999px;
  color: var(--color-text);
  cursor: pointer;
  font-weight: 700;
  justify-self: start;
  padding: 0.34rem 0.62rem;
}

.commercial-cost-breakdown {
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  grid-column: 1 / -1;
  padding: 0.35rem 0.7rem;
}

.commercial-cost-breakdown-head {
  display: grid;
  gap: 0.16rem;
  padding: 0.5rem 0 0.36rem;
}

.commercial-cost-breakdown-head span {
  color: var(--color-text);
  font-weight: 850;
}

.commercial-cost-breakdown-head small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.commercial-cost-essentials {
  display: grid;
  gap: 0.45rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.35rem 0 0.55rem;
}

.commercial-cost-essentials article {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 8px;
  display: grid;
  gap: 0.12rem;
  min-width: 0;
  padding: 0.5rem 0.55rem;
}

.commercial-cost-essentials article.is-strong {
  background: rgba(16, 185, 129, 0.09);
  border-color: rgba(16, 185, 129, 0.22);
}

.commercial-cost-essentials article.is-muted {
  background: rgba(226, 232, 240, 0.46);
}

.commercial-cost-essentials span,
.commercial-cost-essentials small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.commercial-cost-essentials b {
  color: var(--color-text);
  font-size: 0.96rem;
}

.commercial-admin-support {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  margin-top: 0.5rem;
  padding-top: 0.4rem;
}

.commercial-admin-support summary {
  color: #334155;
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 850;
  padding: 0.35rem 0;
}

.commercial-admin-support-grid {
  display: grid;
  gap: 0.65rem;
  padding-top: 0.4rem;
}

.commercial-admin-support-grid section {
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  padding-top: 0.52rem;
}

.commercial-admin-support-launch {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  display: flex;
  justify-content: flex-start;
  margin-top: 0.5rem;
  padding-top: 0.55rem;
}

.commercial-admin-support-modal {
  align-items: center;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  inset: 0;
  padding: 1rem;
  position: fixed;
  z-index: 125;
}

.commercial-admin-support-modal[hidden] {
  display: none;
}

body.commercial-admin-support-open {
  overflow: hidden;
}

.commercial-admin-support-dialog {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: var(--radius-md);
  box-shadow: 0 26px 80px rgba(15, 23, 42, 0.32);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: 90vh;
  max-width: 1080px;
  min-height: min(680px, 90vh);
  overflow: hidden;
  width: min(100%, 1080px);
}

.commercial-admin-support-header {
  align-items: start;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  display: flex;
  gap: 0.85rem;
  justify-content: space-between;
  padding: 1rem 1.1rem 0.9rem;
}

.commercial-admin-support-header h3 {
  margin: 0.15rem 0 0.2rem;
}

.commercial-admin-support-body {
  display: grid;
  gap: 0.85rem;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.25rem 1.25rem;
}

.commercial-admin-modal-section {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

.commercial-admin-modal-section > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-weight: 850;
  justify-content: space-between;
  list-style: none;
  padding: 0.95rem 1.05rem;
}

.commercial-admin-modal-section > summary::-webkit-details-marker {
  display: none;
}

.commercial-admin-modal-section[open] > summary {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.commercial-admin-modal-section > summary::after {
  color: var(--color-text-muted);
  content: "Abrir";
  font-size: 0.72rem;
  font-weight: 850;
}

.commercial-admin-modal-section[open] > summary::after {
  content: "Cerrar";
}

.commercial-admin-modal-section > .commercial-cost-note,
.commercial-admin-modal-section > .commercial-admin-cost-table,
.commercial-admin-modal-section > .commercial-admin-summary-grid,
.commercial-admin-modal-section > .commercial-admin-pending-group {
  margin: 0.95rem 1.05rem;
}

.commercial-admin-summary-grid {
  display: grid;
  gap: 0.62rem;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.commercial-admin-summary-grid article {
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  display: grid;
  gap: 0.16rem;
  min-width: 0;
  padding: 0.72rem 0.8rem;
}

.commercial-admin-summary-grid span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 800;
}

.commercial-admin-summary-grid b {
  color: var(--color-text);
  overflow-wrap: anywhere;
}

.commercial-admin-cost-table {
  display: grid;
  gap: 0.44rem;
}

.commercial-admin-cost-head,
.commercial-admin-cost-row {
  display: grid;
  gap: 0.68rem;
  min-width: 0;
}

.commercial-admin-cost-table.is-direct .commercial-admin-cost-head,
.commercial-admin-cost-table.is-direct .commercial-admin-cost-row {
  grid-template-columns: minmax(150px, 1.1fr) minmax(220px, 1.35fr) minmax(116px, 0.8fr) minmax(116px, 0.8fr) minmax(100px, 0.65fr);
}

.commercial-admin-cost-table.is-layer .commercial-admin-cost-head,
.commercial-admin-cost-table.is-layer .commercial-admin-cost-row {
  grid-template-columns: minmax(200px, 1.25fr) minmax(126px, 0.75fr) minmax(126px, 0.75fr) minmax(124px, 0.75fr) minmax(160px, 0.95fr);
}

.commercial-admin-cost-head {
  align-items: center;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  color: var(--color-text-muted);
  font-size: 0.68rem;
  font-weight: 850;
  padding: 0 0.78rem 0.42rem;
  text-transform: uppercase;
}

.commercial-admin-cost-row {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.09);
  border-radius: 8px;
  align-items: center;
  padding: 0.78rem;
}

.commercial-admin-cost-cell {
  min-width: 0;
}

.commercial-admin-cost-cell > span {
  display: none;
}

.commercial-admin-cost-cell.is-name {
  display: grid;
  gap: 0.08rem;
}

.commercial-admin-cost-row h6 {
  font-size: 0.88rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.commercial-admin-cost-row small {
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.commercial-admin-cost-cell p,
.commercial-admin-cost-row p {
  margin: 0;
}

.commercial-admin-cost-cell b {
  color: var(--color-text);
  display: block;
  font-size: 0.86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.commercial-admin-cost-cell.is-absorption b,
.commercial-admin-cost-table.is-direct .commercial-admin-cost-cell.is-value b {
  color: #047857;
  font-size: 0.98rem;
  font-weight: 900;
}

.commercial-admin-cost-cell.is-status b {
  background: rgba(15, 23, 42, 0.06);
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.1;
  padding: 0.18rem 0.48rem;
}

.commercial-admin-cost-row.is-pending {
  background: #fffaf0;
  border-color: rgba(217, 119, 6, 0.22);
}

.commercial-admin-cost-note {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  grid-column: 1 / -1;
  margin: 0.1rem 0 0;
}

.commercial-admin-cost-note summary {
  cursor: pointer;
  font-weight: 850;
}

.commercial-admin-cost-note p {
  margin-top: 0.3rem;
}

.commercial-admin-pending-group {
  display: grid;
  gap: 0.35rem;
}

.commercial-admin-pending-group h5 {
  font-size: 0.82rem;
  margin: 0;
}

.quote-empty-line {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 750;
  margin: 0;
  padding: 0.28rem 0;
}

.commercial-cost-breakdown summary {
  cursor: pointer;
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0;
}

.commercial-cost-breakdown summary span {
  color: var(--color-text);
  font-weight: 800;
}

.commercial-cost-breakdown summary small {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.commercial-cost-overview {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.55rem 0;
}

.commercial-cost-overview article {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  padding: 0.6rem;
}

.commercial-cost-overview span,
.commercial-cost-layer-list p span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.commercial-cost-overview b,
.commercial-cost-layer-list p b {
  color: var(--color-text);
}

.commercial-cost-layer-list {
  display: grid;
  gap: 0.7rem;
}

.commercial-cost-layer-list section {
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  padding-top: 0.65rem;
}

.commercial-cost-layer-list h5 {
  font-size: 0.9rem;
  margin: 0 0 0.45rem;
}

.commercial-cost-layer-list p {
  align-items: start;
  display: grid;
  gap: 0.4rem;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0;
  padding: 0.38rem 0;
}

.commercial-cost-layer-list p small {
  color: var(--color-text-muted);
  font-size: 0.75rem;
  grid-column: 1 / -1;
}

.commercial-cost-layer-list .is-pending {
  opacity: 0.82;
}

.commercial-pending-costs {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  margin: 0.25rem 0 0;
  padding-left: 1rem;
}

.compact-cost-grid {
  margin-top: 0.35rem;
}

.quote-secondary-area .quote-secondary-panel {
  box-shadow: none;
}

.quote-secondary-area .quote-secondary-panel > summary {
  min-height: 42px;
}

.commercial-cost-breakdown .commercial-admin-support summary {
  display: block;
  gap: 0;
  padding: 0.35rem 0;
}

@media (max-width: 520px) {
  .commercial-admin-support-modal {
    align-items: stretch;
    padding: 0;
  }

  .commercial-admin-support-dialog {
    border-radius: 0;
    max-height: 100vh;
    min-height: 100vh;
    width: 100%;
  }

  .commercial-admin-support-header {
    padding: 0.82rem;
  }

  .commercial-admin-support-body {
    padding: 0.72rem;
  }

  .commercial-admin-summary-grid {
    grid-template-columns: 1fr;
  }

  .commercial-admin-cost-head {
    display: none;
  }

  .commercial-admin-cost-table.is-direct .commercial-admin-cost-row,
  .commercial-admin-cost-table.is-layer .commercial-admin-cost-row {
    align-items: stretch;
    gap: 0.42rem;
    grid-template-columns: 1fr;
    padding: 0.82rem;
  }

  .commercial-admin-cost-cell > span {
    color: var(--color-text-muted);
    display: block;
    font-size: 0.68rem;
    font-weight: 850;
    margin-bottom: 0.08rem;
  }

  .commercial-admin-cost-cell.is-name {
    order: 1;
  }

  .commercial-admin-cost-cell.is-absorption {
    order: 2;
  }

  .commercial-admin-cost-table.is-direct .commercial-admin-cost-cell.is-value {
    order: 2;
  }

  .commercial-admin-cost-cell.is-basis {
    order: 3;
  }

  .commercial-admin-cost-table.is-layer .commercial-admin-cost-cell.is-value {
    order: 3;
  }

  .commercial-admin-cost-cell.is-method,
  .commercial-admin-cost-cell.is-status {
    order: 4;
  }

  .commercial-admin-cost-table.is-direct .commercial-admin-cost-cell.is-absorption {
    order: 5;
  }

  .commercial-admin-cost-note {
    order: 6;
  }

  .commercial-cost-overview,
  .commercial-cost-essentials {
    grid-template-columns: 1fr;
  }

  .commercial-cost-layer-list p {
    grid-template-columns: 1fr;
  }
}

/* Cotizaciones desktop final: KPI horizontal, acciones cortas y modal Admin lateral. */
#view-history .commercial-side-head {
  display: grid;
  gap: 0.1rem;
}

#view-history .commercial-side-head span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 850;
  text-transform: uppercase;
}

#view-history .commercial-side-head b {
  color: var(--color-text);
  font-family: var(--font-title);
  font-size: 1rem;
}

#view-history .commercial-kpi-strip {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

#view-history .commercial-admin-support-action {
  display: grid;
  gap: 0.42rem;
}

#view-history .commercial-admin-support-action .btn {
  width: 100%;
}

@media (min-width: 1024px) {
  #view-history .commercial-quote-form-shell {
    padding: 0.82rem;
  }

  #view-history .commercial-quote-layout {
    align-items: start;
    display: grid;
    gap: 0.8rem;
    grid-template-columns: minmax(0, 1fr) minmax(250px, 300px);
  }

  #view-history .commercial-price-summary {
    background: linear-gradient(135deg, #ffffff, #f8fafc 62%, #ecfdf5);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-left: 4px solid var(--quote-green);
    border-radius: var(--radius-sm);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 0.62rem;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    padding: 0.68rem;
  }

  #view-history .commercial-price-summary-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 0;
  }

  #view-history .commercial-price-summary-head b {
    white-space: nowrap;
  }

  #view-history .commercial-price-kpi {
    min-height: 74px;
    padding: 0.58rem 0.62rem;
  }

  #view-history .commercial-price-kpi-primary,
  #view-history .commercial-price-kpi-cost {
    grid-column: auto;
  }

  #view-history .commercial-price-kpi-primary {
    background: linear-gradient(135deg, #064e3b, #047857);
    border-color: rgba(4, 120, 87, 0.38);
    color: #ffffff;
  }

  #view-history .commercial-price-kpi-primary span,
  #view-history .commercial-price-kpi-primary b {
    color: #ffffff;
  }

  #view-history .commercial-price-kpi-primary b,
  #view-history .commercial-price-kpi-cost b {
    font-size: clamp(1.02rem, 1.15vw, 1.28rem);
  }

  #view-history .commercial-cost-breakdown {
    padding: 0.5rem 0.58rem 0.58rem;
  }

  #view-history .commercial-cost-breakdown-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 0 0 0.4rem;
  }

  #view-history .commercial-cost-breakdown-head small {
    max-width: 58%;
    text-align: right;
  }

  #view-history .commercial-cost-essentials {
    gap: 0.42rem;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin: 0;
  }

  #view-history .commercial-cost-essentials article {
    min-height: 68px;
    padding: 0.42rem 0.48rem;
  }

  #view-history .commercial-quote-main {
    display: grid;
    gap: 0.7rem;
    grid-column: 1;
    min-width: 0;
  }

  #view-history .commercial-quote-main > .commercial-quote-grid {
    grid-template-columns: minmax(230px, 1.2fr) minmax(210px, 1fr) minmax(120px, 0.55fr);
  }

  #view-history .commercial-quote-status,
  #view-history .commercial-colors-panel {
    margin-top: 0;
  }

  #view-history .commercial-quote-side {
    grid-column: 2;
    min-width: 0;
  }

  #view-history .commercial-quote-side .commercial-price-panel {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    display: grid;
    gap: 0.58rem;
    padding: 0.68rem;
  }

  #view-history .commercial-quote-side .commercial-side-head {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    padding-bottom: 0.42rem;
  }

  #view-history .commercial-quote-side .commercial-decision-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-history .commercial-final-price-field {
    grid-template-columns: minmax(0, 1fr);
    padding: 0.58rem;
  }

  #view-history .commercial-final-price-field input {
    font-size: 1.08rem;
    text-align: left;
  }

  #view-history .commercial-quote-side .commercial-quote-actions {
    background: transparent;
    border: 0;
    display: grid;
    gap: 0.4rem;
    grid-template-columns: minmax(0, 1fr);
    padding: 0;
  }

  #view-history .commercial-quote-side .commercial-quote-actions .btn {
    min-height: 40px;
    width: 100%;
  }

  #view-history .commercial-save-note {
    background: rgba(37, 99, 235, 0.08);
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: var(--radius-sm);
    color: #1d4ed8;
    padding: 0.42rem 0.5rem;
  }
}

@media (min-width: 1024px) and (max-width: 1320px) {
  #view-history .commercial-kpi-strip,
  #view-history .commercial-cost-essentials {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1023px) {
  #view-history .commercial-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #view-history .commercial-price-summary {
    order: 2;
  }

  #view-history .commercial-price-panel {
    order: 5;
  }

  #view-history .commercial-quote-side .commercial-price-panel {
    display: grid;
    gap: 0.55rem;
  }
}

@media (max-width: 390px) {
  #view-history .commercial-kpi-strip {
    grid-template-columns: minmax(0, 1fr);
  }
}

.commercial-admin-support-dialog {
  max-width: min(1200px, 92vw);
  width: min(1200px, 92vw);
}

.commercial-admin-support-body {
  gap: 0;
  overflow: hidden;
  padding: 0;
}

.commercial-admin-support-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

.commercial-admin-support-nav {
  background: #ffffff;
  border-right: 1px solid rgba(15, 23, 42, 0.1);
  display: grid;
  gap: 0.35rem;
  overflow: auto;
  padding: 0.9rem;
}

.commercial-admin-support-nav button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #475569;
  cursor: pointer;
  font-weight: 850;
  min-height: 38px;
  padding: 0.48rem 0.55rem;
  text-align: left;
}

.commercial-admin-support-nav button.is-active {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.22);
  color: #065f46;
}

.commercial-admin-support-content {
  min-width: 0;
  overflow: auto;
  padding: 1rem 1.1rem 1.15rem;
}

.commercial-admin-modal-panel[hidden] {
  display: none;
}

.commercial-admin-modal-panel {
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.commercial-admin-panel-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.commercial-admin-panel-head h4 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  margin: 0;
}

.commercial-admin-cost-table {
  overflow-x: auto;
  padding-bottom: 0.15rem;
}

@media (min-width: 761px) {
  .commercial-admin-cost-table.is-direct .commercial-admin-cost-head,
  .commercial-admin-cost-table.is-direct .commercial-admin-cost-row {
    grid-template-columns: minmax(150px, 1.05fr) minmax(220px, 1.35fr) minmax(120px, 0.75fr) minmax(120px, 0.75fr) minmax(100px, 0.55fr);
    min-width: 850px;
  }

  .commercial-admin-cost-table.is-layer .commercial-admin-cost-head,
  .commercial-admin-cost-table.is-layer .commercial-admin-cost-row {
    grid-template-columns: minmax(210px, 1.35fr) minmax(132px, 0.75fr) minmax(132px, 0.75fr) minmax(120px, 0.7fr) minmax(130px, 0.75fr) minmax(92px, 0.5fr);
    min-width: 960px;
  }
}

.commercial-admin-cost-cell.is-note {
  min-width: 0;
}

.commercial-admin-cost-cell.is-note > b {
  color: var(--color-text-muted);
  font-weight: 800;
}

.commercial-admin-cost-cell.is-note .commercial-admin-cost-note {
  margin: 0;
}

@media (max-width: 760px) {
  .commercial-admin-support-modal {
    align-items: stretch;
    padding: 0;
  }

  .commercial-admin-support-dialog {
    border-radius: 0;
    max-height: 100vh;
    max-width: none;
    min-height: 100vh;
    width: 100%;
  }

  .commercial-admin-support-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .commercial-admin-support-nav {
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    border-right: 0;
    display: flex;
    gap: 0.38rem;
    overflow-x: auto;
    padding: 0.62rem;
  }

  .commercial-admin-support-nav button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .commercial-admin-support-content {
    padding: 0.75rem;
  }

  .commercial-admin-cost-head {
    display: none;
  }

  .commercial-admin-cost-table.is-direct .commercial-admin-cost-row,
  .commercial-admin-cost-table.is-layer .commercial-admin-cost-row {
    align-items: stretch;
    gap: 0.42rem;
    grid-template-columns: 1fr;
    padding: 0.82rem;
  }

  .commercial-admin-cost-cell > span {
    color: var(--color-text-muted);
    display: block;
    font-size: 0.68rem;
    font-weight: 850;
    margin-bottom: 0.08rem;
  }

  .commercial-admin-cost-cell.is-name {
    order: 1;
  }

  .commercial-admin-cost-cell.is-absorption,
  .commercial-admin-cost-table.is-direct .commercial-admin-cost-cell.is-value {
    order: 2;
  }

  .commercial-admin-cost-cell.is-basis,
  .commercial-admin-cost-table.is-layer .commercial-admin-cost-cell.is-value {
    order: 3;
  }

  .commercial-admin-cost-cell.is-method,
  .commercial-admin-cost-cell.is-status,
  .commercial-admin-cost-cell.is-note {
    order: 4;
  }
}

/* Cotizaciones controlled contrast: collapsed audit details and clearer button hierarchy. */
.btn-tertiary,
button.btn-tertiary,
a.btn-tertiary {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.46);
  box-shadow: none;
  color: #475569;
}

.btn-tertiary:hover,
button.btn-tertiary:hover,
a.btn-tertiary:hover {
  background: #eef2f7;
  border-color: rgba(100, 116, 139, 0.44);
  color: #334155;
}

#view-history .btn-secondary-strong,
#view-history button.btn-secondary-strong {
  background: #eff6ff;
  border-color: rgba(29, 78, 216, 0.68);
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.11);
  color: #1e3a8a;
}

#view-history .btn-secondary-strong:hover,
#view-history button.btn-secondary-strong:hover {
  background: #dbeafe;
  border-color: rgba(29, 78, 216, 0.82);
  color: #172554;
}

#view-history #commercial-quote-save:not(:disabled) {
  background: linear-gradient(135deg, #065f46, #047857);
  border-color: #047857;
  box-shadow: 0 12px 26px rgba(4, 120, 87, 0.22);
  color: #ffffff;
}

#view-history #commercial-quote-save:not(:disabled):hover {
  background: linear-gradient(135deg, #064e3b, #065f46);
}

#view-history button:disabled,
#view-history .btn:disabled,
#view-history button[aria-disabled="true"],
#view-history .btn[aria-disabled="true"] {
  background: #e5e7eb !important;
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  color: #64748b !important;
  filter: grayscale(0.08);
  opacity: 1;
}

#view-history .commercial-price-summary {
  border-left-color: #047857;
}

#view-history .commercial-price-kpi {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.02);
  overflow: hidden;
}

#view-history .commercial-price-kpi b {
  line-height: 1.08;
  overflow-wrap: anywhere;
}

#view-history .commercial-price-kpi-primary {
  background: linear-gradient(135deg, #064e3b, #047857);
  border-color: rgba(4, 120, 87, 0.52);
  box-shadow: 0 12px 24px rgba(4, 120, 87, 0.18);
  color: #ffffff;
}

#view-history .commercial-price-kpi-cost {
  background: linear-gradient(135deg, #172554, #1d4ed8);
  border-color: rgba(29, 78, 216, 0.52);
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.15);
  color: #ffffff;
}

#view-history .commercial-price-kpi-primary span,
#view-history .commercial-price-kpi-primary b,
#view-history .commercial-price-kpi-cost span,
#view-history .commercial-price-kpi-cost b {
  color: #ffffff;
}

#view-history .commercial-price-kpi-total,
#view-history .commercial-price-kpi-profit {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.24);
}

#view-history .commercial-price-kpi-total b,
#view-history .commercial-price-kpi-profit b {
  color: #065f46;
}

#view-history .commercial-price-kpi-margin {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.2);
}

#view-history .commercial-price-kpi-margin b {
  color: #1e3a8a;
}

#view-history .commercial-price-kpi-applied {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.25);
}

#view-history .commercial-price-kpi-applied b {
  color: #475569;
  font-family: var(--font-main);
  font-size: 0.9rem;
}

#view-history .commercial-cost-breakdown {
  background: #fbfdff;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

#view-history .commercial-cost-breakdown > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 0.62rem;
  justify-content: space-between;
  list-style: none;
  min-height: 42px;
  padding: 0.48rem 0.58rem;
}

#view-history .commercial-cost-breakdown > summary::-webkit-details-marker {
  display: none;
}

#view-history .commercial-cost-summary-line {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

#view-history .commercial-cost-toggle-chip {
  background: #eef2f7;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-pill);
  color: #475569;
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 850;
  padding: 0.22rem 0.52rem;
  white-space: nowrap;
}

#view-history .commercial-cost-breakdown[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

#view-history .commercial-cost-breakdown[open] .commercial-cost-toggle-chip {
  background: #e0f2fe;
  border-color: rgba(37, 99, 235, 0.2);
  color: #1d4ed8;
}

#view-history .commercial-cost-breakdown[open] .commercial-cost-essentials {
  padding: 0.55rem;
}

#view-history .commercial-cost-essentials {
  margin: 0;
}

#view-history .commercial-cost-essentials article {
  min-height: 60px;
}

#view-history .commercial-colors-panel.is-compact {
  padding: 0.5rem 0.56rem;
}

#view-history .commercial-colors-panel.is-compact .commercial-panel-head {
  border-bottom: 0;
  margin-bottom: 0.24rem;
  padding-bottom: 0;
}

#view-history .commercial-colors-panel.is-compact .commercial-panel-head h5 {
  color: #0f172a;
  font-size: 0.84rem;
}

#view-history .commercial-colors-panel.is-compact .commercial-color-total {
  display: none;
}

#view-history .commercial-colors-panel.is-compact #commercial-quote-add-color {
  display: none;
}

#view-history .commercial-color-details {
  background: transparent;
  border: 0;
  padding: 0;
}

#view-history .commercial-color-details > summary {
  align-items: center;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.46);
  border-radius: var(--radius-pill);
  color: #475569;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 850;
  min-height: 30px;
  padding: 0.26rem 0.58rem;
}

#view-history .commercial-color-details[open] {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: var(--radius-sm);
  padding: 0.48rem;
}

#view-history .commercial-color-details[open] > summary {
  margin-bottom: 0.44rem;
}

#view-history .commercial-optional-panel {
  background: #fbfdff;
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: none;
}

#view-history .commercial-optional-panel summary {
  color: #475569;
  min-height: 38px;
  padding: 0.48rem 0.62rem;
}

#view-history .commercial-optional-panel:not([open]) summary {
  font-size: 0.86rem;
}

#view-history .quote-secondary-area {
  gap: 0.42rem;
}

#view-history .quote-secondary-panel,
#view-history .quote-admin-advanced {
  background: #fbfdff;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: none;
}

#view-history .quote-secondary-panel > summary {
  min-height: 38px;
  padding: 0.48rem 0.62rem;
}

#view-history .quote-secondary-panel > summary span {
  color: #334155;
  font-size: 0.9rem;
}

#view-history .quote-secondary-panel > summary small {
  color: #94a3b8;
  font-size: 0.7rem;
}

#view-history .quote-secondary-panel > summary::after {
  background: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: var(--radius-pill);
  color: #64748b;
  padding: 0.18rem 0.48rem;
}

#view-history .quote-secondary-body {
  gap: 0.48rem;
  padding: 0 0.62rem 0.62rem;
}

#view-history .quote-secondary-module {
  border-color: rgba(148, 163, 184, 0.18);
  padding: 0.56rem;
}

#view-history .quote-empty-line {
  color: #64748b;
  padding: 0.18rem 0;
}

#view-history .commercial-mobile-price-brief {
  display: none;
}

#view-history .commercial-mobile-secondary-tools {
  display: none;
}

#view-history .commercial-reference-mobile-meta-clean,
#view-history .commercial-reference-mobile-color,
#view-history .quote-secondary-mobile-label,
#view-history .commercial-reference-thumb-placeholder {
  display: none;
}

@media (min-width: 1024px) {
  #view-history .commercial-cost-breakdown {
    padding: 0;
  }

  #view-history .commercial-cost-essentials {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  #view-history .commercial-cost-breakdown > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.36rem;
  }

  #view-history .commercial-cost-toggle-chip {
    white-space: normal;
  }

  #view-history .commercial-price-kpi b {
    font-size: 1rem;
  }

  #view-history .commercial-price-kpi-primary b,
  #view-history .commercial-price-kpi-cost b {
    font-size: 1.18rem;
  }

  #view-history .quote-secondary-panel > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.32rem;
  }
}

@media (max-width: 768px) {
  #view-history.is-visible {
    padding-bottom: 5.9rem;
  }

  #view-history .module-intro {
    margin-bottom: 0.62rem;
  }

  #view-history .quote-commercial-start {
    border-radius: var(--radius-sm);
    gap: 0.58rem;
    padding: 0.62rem;
  }

  #view-history .quote-commercial-start > div:first-child {
    display: none;
  }

  #view-history .quote-mode-switch {
    display: grid;
    gap: 0.36rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  #view-history .quote-mode-tab {
    min-height: 48px;
    padding: 0.44rem 0.5rem;
  }

  #view-history .quote-mode-tab small {
    display: none;
  }

  #view-history .commercial-quote-form-shell {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  #view-history .commercial-quote-form-head {
    display: none;
  }

  #view-history .commercial-quote-layout,
  #view-history .commercial-quote-main,
  #view-history .commercial-quote-side {
    display: contents;
  }

  #view-history .commercial-price-summary {
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    margin-bottom: 0.42rem;
    padding: 0.26rem;
    position: sticky;
    top: 0.22rem;
    z-index: 28;
  }

  #view-history .commercial-mobile-price-brief {
    display: grid;
    gap: 0;
  }

  #view-history .commercial-mobile-decision-grid {
    display: grid;
    gap: 0.24rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .commercial-mobile-kpi,
  #view-history .commercial-mobile-margin-field {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 8px;
    display: grid;
    gap: 0.04rem;
    margin: 0;
    min-height: 40px;
    min-width: 0;
    padding: 0.28rem 0.34rem;
  }

  #view-history .commercial-mobile-kpi span,
  #view-history .commercial-mobile-margin-head > span:first-child {
    color: #64748b;
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.05;
    text-transform: none;
  }

  #view-history .commercial-mobile-kpi b {
    color: #0f172a;
    font-family: var(--font-title);
    font-size: 0.9rem;
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  #view-history .commercial-mobile-kpi.is-price {
    background: linear-gradient(135deg, #065f46, #059669);
    border-color: rgba(4, 120, 87, 0.5);
  }

  #view-history .commercial-mobile-kpi.is-cost {
    background: linear-gradient(135deg, #172554, #2563eb);
    border-color: rgba(37, 99, 235, 0.46);
  }

  #view-history .commercial-mobile-kpi.is-price span,
  #view-history .commercial-mobile-kpi.is-price b,
  #view-history .commercial-mobile-kpi.is-cost span,
  #view-history .commercial-mobile-kpi.is-cost b {
    color: #ffffff;
  }

  #view-history .commercial-mobile-kpi.is-price b,
  #view-history .commercial-mobile-kpi.is-cost b {
    font-size: 0.98rem;
  }

  #view-history .commercial-mobile-kpi.is-total {
    background: #ecfdf5;
    border-color: rgba(4, 120, 87, 0.22);
  }

  #view-history .commercial-mobile-margin-field {
    background: #fffbeb;
    border-color: rgba(180, 83, 9, 0.24);
  }

  #view-history .commercial-mobile-margin-head {
    align-items: center;
    display: flex;
    gap: 0.16rem;
    justify-content: space-between;
    min-width: 0;
  }

  #view-history .commercial-mobile-margin-chip-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.14rem;
    justify-content: flex-end;
    min-width: 0;
  }

  #view-history .commercial-mobile-margin-input-wrap {
    align-items: center;
    display: grid;
    gap: 0.18rem;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-history .commercial-mobile-margin-input-wrap input {
    background: #ffffff;
    border: 1px solid rgba(180, 83, 9, 0.34);
    border-radius: 7px;
    color: #92400e;
    font-family: var(--font-title);
    font-size: 0.9rem;
    font-weight: 900;
    height: 24px;
    min-height: 0;
    min-width: 0;
    padding: 0.06rem 0.22rem;
    text-align: center;
    width: 100%;
  }

  #view-history .commercial-mobile-margin-input-wrap input.is-invalid,
  #view-history .commercial-mobile-margin-input-wrap input[aria-invalid="true"] {
    border-color: rgba(220, 38, 38, 0.66);
    color: #991b1b;
  }

  #view-history .commercial-mobile-margin-input-wrap em {
    color: #92400e;
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
  }

  #view-history .commercial-mobile-margin-mode-chip {
    align-self: center;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(180, 83, 9, 0.22);
    border-radius: var(--radius-pill);
    color: #92400e;
    font-size: 0.5rem;
    font-weight: 900;
    justify-self: start;
    line-height: 1;
    padding: 0.12rem 0.26rem;
    text-transform: none !important;
  }

  #view-history .commercial-mobile-margin-mode-chip.is-tramo {
    background: rgba(14, 165, 233, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
    color: #1d4ed8;
  }

  #view-history .commercial-mobile-margin-mode-chip.is-warning {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(180, 83, 9, 0.28);
    color: #92400e;
  }

  #view-history .commercial-mobile-margin-warning {
    color: #92400e;
    font-size: 0.72rem;
    font-weight: 800;
    margin: 0;
  }

  #view-history .commercial-mobile-secondary-tools {
    display: grid;
    gap: 0.34rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 0.56rem;
  }

  #view-history .commercial-mobile-tools {
    display: grid;
    gap: 0.34rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-history .commercial-mobile-margin-quick,
  #view-history .commercial-mobile-cost-drawer {
    min-width: 0;
    position: relative;
  }

  #view-history .commercial-mobile-margin-quick[open],
  #view-history .commercial-mobile-cost-drawer[open] {
    grid-column: 1 / -1;
  }

  #view-history .commercial-mobile-margin-quick > summary,
  #view-history .commercial-mobile-cost-drawer > summary {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: var(--radius-pill);
    color: #334155;
    cursor: pointer;
    display: flex;
    font-size: 0.74rem;
    font-weight: 900;
    justify-content: center;
    list-style: none;
    min-height: 30px;
    padding: 0.22rem 0.48rem;
    text-align: center;
  }

  #view-history .commercial-mobile-cost-drawer > summary {
    background: #eff6ff;
    border-color: rgba(37, 99, 235, 0.24);
    color: #1d4ed8;
  }

  #view-history .commercial-mobile-margin-quick > summary::-webkit-details-marker,
  #view-history .commercial-mobile-cost-drawer > summary::-webkit-details-marker {
    display: none;
  }

  #view-history .commercial-mobile-margin-presets {
    display: grid;
    gap: 0.28rem;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding-top: 0.34rem;
  }

  #view-history .commercial-mobile-margin-quick:not([open]) > .commercial-mobile-margin-presets,
  #view-history .commercial-mobile-cost-drawer:not([open]) > .commercial-mobile-cost-grid {
    display: none;
  }

  #view-history .commercial-mobile-margin-presets .btn {
    min-height: 30px;
    padding: 0.2rem 0.28rem;
  }

  #view-history .commercial-mobile-margin-presets [data-commercial-mobile-margin-reset] {
    grid-column: span 2;
  }

  #view-history .commercial-mobile-cost-grid {
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    display: grid;
    gap: 0.28rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0.34rem;
  }

  #view-history .commercial-mobile-cost-grid p {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    grid-column: auto;
    margin: 0;
    min-width: 0;
    padding: 0.3rem 0.36rem;
  }

  #view-history .commercial-mobile-cost-grid span {
    color: #64748b;
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
  }

  #view-history .commercial-mobile-cost-grid b {
    color: #0f172a;
    display: block;
    font-size: 0.78rem;
    overflow-wrap: anywhere;
  }

  #view-history .commercial-price-summary-head,
  #view-history .commercial-kpi-strip,
  #view-history .commercial-cost-breakdown {
    display: none;
  }

  #view-history .commercial-price-summary > .field-warning {
    display: none;
  }

  #view-history .commercial-quote-grid {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-sm);
    gap: 0.52rem;
    grid-template-columns: 1fr;
    margin-bottom: 0.56rem;
    padding: 0.62rem;
  }

  #view-history .commercial-quote-grid label {
    gap: 0.24rem;
  }

  #view-history .commercial-quote-grid input,
  #view-history .commercial-quote-grid select {
    min-height: 40px;
  }

  #view-history .commercial-reference-picker-field {
    gap: 0.28rem;
  }

  #view-history .commercial-reference-picker-control {
    gap: 0.34rem;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-history .commercial-reference-picker-control input {
    min-height: 40px;
  }

  #view-history .commercial-reference-picker-control .btn {
    min-height: 40px;
    padding-inline: 0.58rem;
  }

  #view-history .commercial-reference-picker-current {
    font-size: 0.72rem;
  }

  #view-history .commercial-reference-sheet-backdrop {
    background: rgba(15, 23, 42, 0.36);
    display: block;
    inset: 0;
    position: fixed;
    z-index: 82;
  }

  #view-history .commercial-reference-picker-panel {
    border-radius: 18px 18px 0 0;
    bottom: 0;
    box-shadow: 0 -18px 44px rgba(15, 23, 42, 0.22);
    box-sizing: border-box;
    left: 0;
    margin: 0;
    max-height: min(78dvh, 620px);
    min-width: 0;
    padding: 0.72rem;
    position: fixed;
    right: 0;
    top: auto;
    width: 100%;
    z-index: 84;
  }

  #view-history .commercial-reference-sheet-head {
    margin-bottom: 0.58rem;
  }

  #view-history .commercial-reference-sheet-head h5 {
    font-size: 1rem;
  }

  #view-history .commercial-reference-search-box input {
    font-size: 0.95rem;
    min-height: 46px;
  }

  #view-history .commercial-reference-results {
    max-height: calc(min(78dvh, 620px) - 142px);
    overflow-x: hidden;
  }

  #view-history .commercial-reference-option {
    gap: 0.45rem;
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 0.46rem;
  }

  #view-history .commercial-reference-option-thumb {
    height: 42px;
    width: 42px;
  }

  #view-history .commercial-reference-option-status {
    grid-column: 2;
    justify-self: start;
    max-width: 100%;
    white-space: normal;
  }

  #view-history .commercial-reference-option-copy b {
    font-size: 0.88rem;
    line-height: 1.14;
  }

  #view-history .commercial-reference-option-copy small,
  #view-history .commercial-reference-option-copy em {
    font-size: 0.72rem;
    line-height: 1.18;
  }

  #view-history .commercial-quote-status {
    background: transparent;
    border: 0;
    box-shadow: none;
    margin-bottom: 0.56rem;
    padding: 0;
  }

  #view-history .commercial-status-chips {
    display: none;
  }

  #view-history .commercial-reference-highlight {
    border-radius: var(--radius-sm);
    box-shadow: none;
    padding: 0.58rem;
  }

  #view-history .commercial-reference-highlight-head {
    align-items: center;
    flex-direction: row;
    gap: 0.5rem;
    margin-bottom: 0.34rem;
  }

  #view-history .commercial-reference-title {
    align-items: center;
    display: flex;
    gap: 0.48rem;
    min-width: 0;
  }

  #view-history .commercial-reference-thumb {
    border-radius: 8px;
    flex: 0 0 42px;
    height: 42px;
    width: 42px;
  }

  #view-history .commercial-reference-thumb-placeholder {
    align-items: center;
    background: #eff6ff;
    color: #1d4ed8;
    display: grid;
    font-size: 0.84rem;
    font-weight: 900;
    justify-content: center;
  }

  #view-history .commercial-reference-title span {
    display: none;
  }

  #view-history .commercial-reference-title h5 {
    font-size: 0.98rem;
    line-height: 1.12;
    margin: 0;
  }

  #view-history .commercial-reference-mobile-meta-clean {
    color: #64748b;
    display: block;
    font-size: 0.74rem;
    font-weight: 800;
    margin: 0.12rem 0 0;
  }

  #view-history .commercial-reference-highlight-head b {
    align-self: center;
    font-size: 0.68rem;
    padding: 0.18rem 0.42rem;
    white-space: nowrap;
  }

  #view-history .commercial-reference-mobile-color {
    align-items: center;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 8px;
    display: grid;
    gap: 0.36rem;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0.36rem 0.42rem;
  }

  #view-history .commercial-reference-mobile-color span {
    color: #334155;
    font-size: 0.8rem;
    font-weight: 850;
    line-height: 1.2;
    min-width: 0;
  }

  #view-history .commercial-reference-mobile-color .btn {
    min-height: 28px;
    padding: 0.18rem 0.42rem;
    white-space: nowrap;
  }

  #view-history .commercial-reference-metrics {
    display: none;
  }

  #view-history .commercial-reference-blocked-actions {
    margin-top: 0.48rem;
  }

  #view-history .commercial-colors-panel {
    border-radius: var(--radius-sm);
    margin-bottom: 0.56rem;
  }

  #view-history .commercial-colors-panel.is-compact {
    display: none;
    padding: 0.48rem 0.58rem;
  }

  #view-history .commercial-colors-panel.is-compact .commercial-panel-head {
    display: none;
  }

  #view-history .commercial-color-details > summary {
    min-height: 28px;
    padding: 0.22rem 0.54rem;
  }

  #view-history .commercial-color-summary {
    font-size: 0.82rem;
    line-height: 1.25;
  }

  #view-history .commercial-price-panel {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  #view-history .commercial-side-head,
  #view-history .commercial-decision-grid,
  #view-history .commercial-final-price-field,
  #view-history .commercial-save-note {
    display: none;
  }

  #view-history .commercial-admin-support-action {
    margin: 0.2rem 0 0.58rem;
  }

  #view-history .commercial-admin-support-action .btn {
    min-height: 32px;
    width: 100%;
  }

  #view-history .commercial-quote-actions {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    bottom: 0;
    box-shadow: 0 -14px 30px rgba(15, 23, 42, 0.14);
    display: grid;
    gap: 0.5rem;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    left: 0;
    margin: 0;
    padding: 0.62rem max(0.75rem, env(safe-area-inset-left)) calc(0.62rem + env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-right));
    position: fixed;
    right: 0;
    z-index: 60;
  }

  #view-history .commercial-quote-actions .btn {
    min-height: 44px;
    width: 100%;
  }

  #view-history .commercial-quote-actions .btn[data-mobile-label] {
    font-size: 0;
  }

  #view-history .commercial-quote-actions .btn[data-mobile-label]::after {
    content: attr(data-mobile-label);
    font-size: 0.88rem;
  }

  #view-history .commercial-optional-panel,
  #view-history .quote-secondary-panel,
  #view-history .quote-admin-advanced {
    border-radius: var(--radius-sm);
    margin-bottom: 0.42rem;
  }

  #view-history .commercial-optional-panel summary,
  #view-history .quote-secondary-panel > summary {
    min-height: 36px;
    padding: 0.44rem 0.56rem;
  }

  #view-history .commercial-preview-root {
    margin-bottom: 0.7rem;
  }

  #view-history .quote-secondary-area {
    gap: 0.36rem;
  }

  #view-history .quote-secondary-mobile-label {
    color: #475569;
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    margin: 0.2rem 0 0.1rem;
    text-transform: uppercase;
  }

  #view-history .history-module h4,
  #view-history .quote-board-module h4 {
    font-size: 0.95rem;
  }

  #view-history .quote-empty-line {
    white-space: nowrap;
  }

  @media (max-width: 380px) {
    #view-history .commercial-mobile-margin-presets {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #view-history .commercial-mobile-kpi b {
      font-size: 0.88rem;
    }
  }

  .commercial-admin-support-open #view-history .commercial-quote-actions {
    display: none;
  }

  .commercial-reference-picker-open #view-history .commercial-quote-actions {
    display: none;
  }

  .commercial-admin-support-modal {
    padding: 0;
  }

  .commercial-admin-support-dialog {
    border-radius: 0;
    height: 100dvh;
    max-height: none;
    max-width: none;
    width: 100%;
  }

  .commercial-admin-support-header {
    gap: 0.5rem;
    padding: 0.72rem;
  }

  .commercial-admin-support-header .section-description {
    display: none;
  }

  .commercial-admin-support-body {
    overflow-x: hidden;
    padding: 0.62rem;
  }
}

/* Final image manager overrides kept last so the stable panel wins the cascade. */
.image-gallery-menu-layer,
.image-gallery-more-popover,
.image-gallery-menu-scrim,
.image-gallery-more-trigger {
  display: none !important;
}

.image-manager-dialog {
  height: min(88dvh, 820px);
  max-width: min(96vw, 1220px);
}

.image-manager-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 2;
}

.image-manager-body {
  gap: 0.62rem;
  overflow: hidden;
  padding: 0.78rem;
}

.image-manager-workspace {
  display: grid;
  gap: 0.82rem;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
  min-height: 0;
}

.image-manager-gallery-pane {
  display: grid;
  gap: 0.62rem;
  min-height: 0;
  overflow: auto;
  padding-right: 0.08rem;
}

.image-manager-body .image-gallery-grid {
  gap: 0.52rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.image-manager-body .image-gallery-card {
  max-width: none;
}

.image-manager-body .image-gallery-card.is-selected {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14), 0 8px 20px rgba(15, 23, 42, 0.08);
}

.image-gallery-mobile-action-trigger {
  display: none !important;
}

@media (max-width: 760px) {
  .image-manager-dialog {
    height: 100dvh;
    max-height: none;
  }

  .image-manager-body {
    overflow: auto;
    padding: 0.68rem;
  }

  .image-manager-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .image-manager-gallery-pane {
    overflow: visible;
    padding-right: 0;
  }

  .image-manager-action-panel {
    display: none;
  }

  .image-manager-body .image-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-gallery-select-trigger {
    display: none !important;
  }

  .image-gallery-mobile-action-trigger {
    display: inline-flex !important;
    justify-content: center;
    width: 100%;
  }

  .image-gallery-sheet-layer {
    display: block;
    inset: 0;
    position: fixed;
    z-index: 176;
  }

  .image-gallery-action-sheet {
    border-radius: 18px 18px 0 0;
    bottom: 0;
    left: 0;
    max-height: min(82dvh, 620px);
    overflow: auto;
    position: fixed;
    right: 0;
    z-index: 177;
  }
}

@media (max-width: 380px) {
  .image-manager-body .image-gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile image manager: full-screen with an internal detail panel, no nested sheet. */
body.image-manager-open {
  overflow: hidden;
}

.image-manager-mobile-detail {
  display: none;
}

@media (min-width: 769px) {
  .image-manager-mobile-detail {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .image-manager-shell {
    background: #fff;
    z-index: 190;
  }

  .image-manager-backdrop,
  .image-gallery-sheet-layer,
  .image-gallery-sheet-scrim,
  .image-gallery-action-sheet {
    display: none !important;
  }

  .image-manager-dialog {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    height: 100dvh;
    inset: 0;
    left: 0;
    max-height: none;
    max-width: none;
    position: fixed;
    top: 0;
    transform: none;
    width: 100vw;
  }

  .image-manager-header {
    align-items: center;
    min-height: 64px;
    padding: 0.62rem 0.72rem;
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .image-manager-header h4 {
    font-size: 1rem;
    line-height: 1.08;
  }

  .image-manager-header p {
    font-size: 0.68rem;
    line-height: 1.2;
  }

  .image-manager-header > button {
    flex: 0 0 auto;
    min-height: 36px;
    width: auto;
  }

  .image-manager-body {
    min-height: 0;
    overflow: auto;
    padding: 0.58rem 0.62rem 0.9rem;
    -webkit-overflow-scrolling: touch;
  }

  .image-manager-workspace {
    display: block;
    min-height: 0;
  }

  .image-manager-gallery-pane {
    display: grid;
    gap: 0.58rem;
    overflow: visible;
    padding-right: 0;
  }

  .image-manager-workspace.is-mobile-detail-open .image-manager-gallery-pane {
    display: none;
  }

  .image-manager-tabs {
    background: #fff;
    margin: 0;
    padding: 0.08rem 0 0.48rem;
    position: sticky;
    top: 0;
    z-index: 4;
  }

  .image-manager-tab {
    min-height: 34px;
    padding: 0.32rem 0.5rem;
  }

  .image-manager-action-panel {
    display: none !important;
  }

  .image-manager-mobile-detail {
    align-content: start;
    display: grid;
    gap: 0.62rem;
    min-height: 0;
  }

  .image-manager-mobile-detail-header {
    align-items: start;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    display: grid;
    gap: 0.42rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding-bottom: 0.54rem;
  }

  .image-manager-mobile-detail-header span {
    color: var(--color-text-muted);
    display: block;
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  .image-manager-mobile-detail-header strong {
    color: var(--color-primary-900);
    display: block;
    font-size: 0.92rem;
    font-weight: 950;
    overflow-wrap: anywhere;
  }

  .image-manager-mobile-detail-preview {
    aspect-ratio: 4 / 3;
    background: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.62);
    border-radius: var(--radius-sm);
    cursor: zoom-in;
    overflow: hidden;
    padding: 0;
    width: 100%;
  }

  .image-manager-mobile-detail-preview img {
    display: block;
    height: 100%;
    object-fit: contain;
    width: 100%;
  }

  .image-manager-mobile-detail-actions.image-gallery-more-menu {
    background: transparent;
    gap: 0.22rem;
    padding: 0;
  }

  .image-manager-mobile-detail-actions button,
  .image-manager-mobile-detail-actions a {
    align-items: center;
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.62);
    border-radius: var(--radius-sm);
    color: var(--color-primary-900);
    display: flex;
    font-size: 0.8rem;
    font-weight: 850;
    justify-content: space-between;
    min-height: 40px;
    padding: 0.5rem 0.58rem;
    width: 100%;
  }

  .image-manager-mobile-detail-actions .danger-lite {
    border-color: #fecaca;
    color: #b91c1c;
  }

  .image-manager-body .image-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .image-manager-body .image-gallery-card {
    gap: 0.38rem;
    padding: 0.42rem;
  }

  .image-gallery-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  .image-manager-mobile-detail-header {
    grid-template-columns: 1fr;
  }

  .image-manager-body .image-gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile image manager polish: clearer hierarchy and touch targets. */
.image-manager-notices:empty {
  display: none;
}

@media (max-width: 768px) {
  .image-manager-shell {
    color: var(--color-text);
  }

  .image-manager-header {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.34);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 76px;
    padding: 0.82rem 0.86rem 0.72rem;
  }

  .image-manager-kicker {
    display: none !important;
  }

  .image-manager-header h4 {
    color: #0f172a;
    font-size: 1.22rem;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1.08;
    margin: 0 0 0.18rem;
  }

  .image-manager-header p {
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 820;
    line-height: 1.25;
  }

  .image-manager-close-button {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.72);
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 900;
    height: 44px;
    min-height: 44px;
    padding: 0.5rem 0.76rem;
  }

  .image-manager-body {
    background: #f8fafc;
    gap: 0.7rem;
    padding: 0.68rem 0.72rem 1rem;
  }

  .image-manager-notices {
    display: grid;
    gap: 0.36rem;
  }

  .image-manager-notices .image-gallery-upload-note,
  .image-manager-notices .image-gallery-upload-error {
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    line-height: 1.3;
    margin: 0;
    max-height: 4.4rem;
    overflow: auto;
    padding: 0.48rem 0.58rem;
  }

  .image-manager-tabs {
    background: #eef2f7;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
    gap: 0.28rem;
    margin: 0;
    overflow-x: auto;
    padding: 0.28rem;
    scrollbar-width: none;
  }

  .image-manager-tabs::-webkit-scrollbar {
    display: none;
  }

  .image-manager-tab {
    background: transparent;
    border: 0;
    border-radius: var(--radius-xs);
    color: #475569;
    flex: 0 0 auto;
    font-size: 0.8rem;
    font-weight: 900;
    gap: 0.28rem;
    min-height: 44px;
    padding: 0.48rem 0.62rem;
  }

  .image-manager-tab b {
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    font-size: 0.68rem;
    min-width: 1.45rem;
  }

  .image-manager-tab.is-active {
    background: #0f172a;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.16);
    color: #ffffff;
  }

  .image-manager-tab.is-active b {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
  }

  .image-gallery-section,
  .image-gallery-primary-block {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.42);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    gap: 0.7rem;
    padding: 0.72rem;
  }

  .image-gallery-section-head {
    gap: 0.44rem;
  }

  .image-gallery-section-head h5 {
    font-size: 0.94rem;
  }

  .image-gallery-section-head p {
    font-size: 0.74rem;
    line-height: 1.3;
  }

  .image-manager-body .image-gallery-grid {
    gap: 0.68rem;
  }

  .image-manager-body .image-gallery-card {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.46);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07);
    gap: 0.52rem;
    padding: 0.52rem;
  }

  .image-gallery-thumb,
  .image-gallery-primary-thumb {
    border-color: rgba(148, 163, 184, 0.44);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  }

  .image-gallery-card-meta {
    gap: 0.28rem;
  }

  .image-gallery-card-title,
  .image-gallery-card-meta > span {
    color: #0f172a;
    font-size: 0.84rem;
    font-weight: 950;
    line-height: 1.2;
  }

  .image-gallery-card-meta small {
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 780;
  }

  .image-gallery-badges {
    gap: 0.26rem;
  }

  .image-gallery-badge {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.38);
    color: #334155;
    font-size: 0.66rem;
    font-weight: 900;
    padding: 0.12rem 0.36rem;
  }

  .image-gallery-badge--primary,
  .image-gallery-card.is-primary .image-gallery-badge:first-child {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
  }

  .image-manager-body .image-gallery-actions [data-gallery-action="open"] {
    display: none !important;
  }

  .image-gallery-mobile-action-trigger {
    background: #eef6ff;
    border: 1px solid #bfdbfe;
    color: #164a7a;
    font-size: 0.8rem;
    font-weight: 920;
    min-height: 42px;
  }

  .image-gallery-primary-card {
    grid-template-columns: 94px minmax(0, 1fr);
  }

  .image-gallery-primary-card strong {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 950;
  }

  .image-manager-mobile-detail {
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    gap: 0.78rem;
    padding: 0.72rem;
  }

  .image-manager-mobile-detail-header {
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.28);
    gap: 0.58rem;
    grid-template-columns: auto minmax(0, 1fr);
    padding-bottom: 0.64rem;
  }

  .image-manager-mobile-back {
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.58);
    color: #0f172a;
    min-height: 40px;
    padding: 0.46rem 0.58rem;
  }

  .image-manager-mobile-detail-header span {
    color: #64748b;
  }

  .image-manager-mobile-detail-header strong {
    color: #0f172a;
    font-size: 1rem;
  }

  .image-manager-mobile-detail-preview {
    background: #f8fafc;
    border-color: rgba(148, 163, 184, 0.42);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.56);
  }

  .image-manager-mobile-detail-actions.image-gallery-more-menu {
    display: grid;
    gap: 0.66rem;
  }

  .image-manager-mobile-action-group {
    display: grid;
    gap: 0.34rem;
  }

  .image-manager-mobile-action-group h5 {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 950;
    letter-spacing: 0;
    margin: 0;
    text-transform: uppercase;
  }

  .image-manager-mobile-action-group > div {
    display: grid;
    gap: 0.3rem;
  }

  .image-manager-mobile-detail-actions button,
  .image-manager-mobile-detail-actions a {
    background: #ffffff;
    border-color: rgba(148, 163, 184, 0.56);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
    font-size: 0.84rem;
    min-height: 44px;
    padding: 0.56rem 0.66rem;
  }

  .image-manager-mobile-detail-actions button:hover,
  .image-manager-mobile-detail-actions a:hover {
    background: #eef6ff;
    border-color: #bfdbfe;
  }

  .image-manager-mobile-action-group--danger {
    border-top: 1px solid rgba(248, 113, 113, 0.22);
    padding-top: 0.28rem;
  }

  .image-manager-mobile-action-group--danger button,
  .image-manager-mobile-detail-actions .danger-lite {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #be123c;
  }

  .image-manager-mobile-detail-actions button:disabled {
    background: #f8fafc;
    color: #94a3b8;
    opacity: 1;
  }

  .image-gallery-delete-confirm {
    border-color: #fed7aa;
    font-size: 0.8rem;
  }

  .image-gallery-delete-confirm button {
    min-height: 40px;
  }
}

@media (max-width: 380px) {
  .image-manager-header {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .image-manager-header h4 {
    font-size: 1.12rem;
  }

  .image-manager-close-button {
    padding-left: 0.62rem;
    padding-right: 0.62rem;
  }

  .image-manager-tab {
    font-size: 0.76rem;
    min-height: 44px;
    padding-left: 0.52rem;
    padding-right: 0.52rem;
  }
}

/* Technical ficha desktop workbench */
#view-technical .technical-hero {
  align-items: center;
  background: linear-gradient(135deg, #24104f 0%, #4c1d95 56%, #0f766e 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  display: grid;
  gap: 0.82rem;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.72rem 0.82rem;
}

#view-technical .technical-hero h3 {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  margin: 0 0 0.32rem;
  text-transform: uppercase;
}

#view-technical .technical-reference-header {
  align-items: center;
  display: grid;
  gap: 0.62rem;
  grid-template-columns: minmax(0, 1fr);
}

#view-technical .technical-reference-header-thumb {
  aspect-ratio: 4 / 5;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
  place-items: center;
}

#view-technical .technical-reference-header-thumb img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

#view-technical .technical-reference-header-body {
  display: grid;
  gap: 0.24rem;
}

#view-technical .technical-reference-header-body strong {
  color: #ffffff;
  font-family: var(--font-title);
  font-size: 1.12rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

#view-technical .technical-reference-header-body > span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.84rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

#view-technical .technical-reference-header-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

#view-technical .technical-hero-context {
  margin: 0;
}

#view-technical .technical-hero-context-pill {
  border-color: rgba(255, 255, 255, 0.32);
  min-height: 26px;
}

#view-technical .technical-hero-actions {
  gap: 0.42rem;
}

#view-technical .technical-hero-actions .btn {
  min-height: 38px;
  padding: 0.5rem 0.72rem;
}

#view-technical .technical-save-status {
  font-size: 0.78rem;
  min-height: 38px;
  padding: 0.42rem 0.62rem;
}

#view-technical .technical-reference-bar {
  align-items: end;
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.34);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 0.56rem;
  padding: 0.5rem;
}

#view-technical .technical-reference-picker span {
  color: #64748b;
  font-size: 0.68rem;
}

#view-technical .technical-reference-picker select {
  min-height: 38px;
}

#view-technical .technical-more-actions > summary {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.46);
  min-height: 38px;
}

#view-technical .technical-more-actions-menu {
  max-width: calc(100vw - 1.25rem);
  min-width: min(220px, calc(100vw - 1.25rem));
  width: min(260px, calc(100vw - 1.25rem));
}

#view-technical .technical-top-summary {
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 0 0 0.62rem;
  padding: 0;
}

#view-technical .technical-workbench-strip {
  display: grid;
  gap: 0.54rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#view-technical .technical-workbench-card {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  display: grid;
  gap: 0.22rem;
  min-height: 76px;
  padding: 0.56rem 0.62rem;
}

#view-technical .technical-workbench-card span,
#view-technical .technical-inspector-status span,
#view-technical .technical-inspector-next span {
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 950;
  text-transform: uppercase;
}

#view-technical .technical-workbench-card strong {
  color: #0f172a;
  display: -webkit-box;
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1.08;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

#view-technical .technical-workbench-card p {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.22;
  margin: 0;
}

#view-technical .technical-workbench-card.success {
  border-color: rgba(4, 120, 87, 0.3);
  background: linear-gradient(180deg, #ffffff, #ecfdf5);
}

#view-technical .technical-workbench-card.warning,
#view-technical .technical-workbench-card.partial {
  border-color: rgba(180, 83, 9, 0.34);
  background: linear-gradient(180deg, #ffffff, #fff7ed);
}

#view-technical .technical-workbench-card.danger,
#view-technical .technical-workbench-card.alert {
  border-color: rgba(185, 28, 28, 0.3);
  background: linear-gradient(180deg, #ffffff, #fff1f2);
}

#view-technical .technical-section-nav {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
  gap: 0.46rem;
}

#view-technical .technical-section-chip {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.5);
  color: #334155;
  min-height: 54px;
}

#view-technical .technical-section-chip.is-active {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  border-color: #4c1d95;
  box-shadow: 0 10px 20px rgba(76, 29, 149, 0.22);
  color: #ffffff;
}

#view-technical .technical-section-chip.is-complete:not(.is-active) {
  background: #ecfdf5;
  border-color: rgba(4, 120, 87, 0.32);
  color: #065f46;
}

#view-technical .technical-section-chip.is-partial:not(.is-active),
#view-technical .technical-section-chip.is-pending:not(.is-active) {
  background: #fff7ed;
  border-color: rgba(180, 83, 9, 0.34);
  color: #7c2d12;
}

#view-technical .technical-section-chip.is-alert:not(.is-active) {
  background: #fff1f2;
  border-color: rgba(185, 28, 28, 0.34);
  color: #9f1239;
}

#view-technical .technical-section-chip.is-active .technical-section-chip-group,
#view-technical .technical-section-chip.is-active .technical-section-chip-main {
  color: #ffffff;
}

#view-technical .technical-section-chip.is-active .technical-section-chip-count {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

#view-technical .technical-section-chip-count {
  background: rgba(15, 23, 42, 0.08);
}

#view-technical .technical-active-section-shell {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.24);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
  padding: 0.62rem;
}

#view-technical .technical-section-card {
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: none;
  padding: 0.82rem;
}

#view-technical .technical-section-panel-head {
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  padding-block: 0 0.56rem;
}

#view-technical .technical-session-rail {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.07);
  display: grid;
  gap: 0.58rem;
  margin-top: 0;
  opacity: 1;
}

#view-technical .technical-session-rail h4 {
  color: #0f172a;
  font-size: 0.9rem;
  margin: 0;
}

#view-technical .technical-inspector-details {
  display: block;
  min-width: 0;
}

#view-technical .technical-inspector-details > summary {
  display: none;
}

#view-technical .technical-inspector-details:not([open]) .technical-inspector-body {
  display: none;
}

#view-technical .technical-inspector-body {
  display: grid;
  gap: 0.58rem;
}

#view-technical #technical-summary-panel {
  background: transparent;
  border: 0;
  display: grid;
  gap: 0.58rem;
  padding: 0;
}

#view-technical .technical-inspector-status {
  align-items: start;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(0, 1fr);
  padding: 0.62rem;
}

#view-technical .technical-inspector-image-block {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  display: grid;
  gap: 0.34rem;
  padding: 0.62rem;
}

#view-technical .technical-inspector-image {
  aspect-ratio: 4 / 5;
  background: #eef2ff;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
  place-items: center;
}

#view-technical .technical-inspector-image-block .technical-inspector-image {
  min-height: 260px;
  width: 100%;
}

#view-technical .technical-inspector-image img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

#view-technical .technical-inspector-image-fallback {
  color: #475569;
  font-size: 0.7rem;
  font-weight: 850;
  padding: 0.4rem;
  text-align: center;
}

#view-technical .technical-inspector-status strong,
#view-technical .technical-inspector-image-block strong {
  color: #0f172a;
  display: block;
  font-family: var(--font-title);
  font-size: 0.98rem;
  line-height: 1.12;
}

#view-technical .technical-inspector-image-block > span {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 850;
}

#view-technical .technical-inspector-status p,
#view-technical .technical-inspector-next p {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 800;
  margin: 0.18rem 0 0;
}

#view-technical .technical-inspector-state-chips,
#view-technical .technical-primary-image-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

#view-technical .technical-inspector-state-chips span,
#view-technical .technical-primary-image-chips span {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.34);
  border-radius: 999px;
  color: #334155;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 900;
  gap: 0.25rem;
  min-height: 28px;
  padding: 0.24rem 0.52rem;
}

#view-technical .technical-inspector-actions {
  display: grid;
  gap: 0.38rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-technical .technical-inspector-actions .btn {
  justify-content: center;
  min-height: 38px;
  padding: 0.46rem 0.5rem;
  width: 100%;
}

#view-technical .technical-session-rail .action-list {
  margin-bottom: 0;
}

#view-technical #technical-image-preview {
  background: transparent;
  border: 0;
  padding: 0;
}

#view-technical #technical-image-preview .image-gallery-panel--compact {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 10px;
  padding: 0.62rem;
}

#view-technical #technical-image-preview .image-gallery-compact-summary {
  gap: 0.52rem;
}

#view-technical #technical-image-preview .image-gallery-compact-primary {
  grid-template-columns: minmax(0, 1fr);
}

#view-technical #technical-image-preview .image-gallery-compact-primary .image-gallery-primary-thumb,
#view-technical #technical-image-preview .image-gallery-compact-primary .image-gallery-empty {
  display: none;
}

#view-technical .technical-primary-image-summary--compact {
  align-items: center;
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.34);
  grid-template-columns: minmax(0, 1fr) auto;
}

#view-technical .technical-primary-image-summary--compact .btn {
  justify-content: center;
  white-space: nowrap;
}

#view-technical .technical-danger-zone {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.3);
  margin-top: 1rem;
  padding: 0.64rem 0.76rem;
}

#view-technical .technical-danger-zone summary {
  color: #475569;
}

#view-technical .technical-danger-zone[open] {
  background: #fff1f2;
  border-color: rgba(185, 28, 28, 0.28);
}

#view-technical .technical-danger-zone[open] summary,
#view-technical .technical-danger-zone[open] strong {
  color: #9f1239;
}

@media (min-width: 1181px) {
  #view-technical .technical-session-layout {
    gap: 0.92rem;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 400px);
  }

  #view-technical .technical-session-rail {
    position: sticky;
    top: 0.72rem;
  }

  #view-technical .technical-form-grid--identificacion {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  #view-technical .technical-form-grid--identificacion .field-label[data-field-key="generalObservation"] {
    grid-column: 1 / -1;
  }

  #view-technical .technical-form-grid--material_tejido {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #view-technical .technical-form-grid--material_tejido .field-label[data-field-key="technicalObservation"],
  #view-technical .technical-form-grid--material_tejido .field-label[data-field-key="knittingNotes"] {
    grid-column: span 3;
  }

  #view-technical .technical-form-grid--terminacion {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-technical .technical-form-grid--terminacion .field-label[data-field-key="closingRouteNotes"] {
    grid-column: 1 / -1;
  }

  #view-technical .finishing-process-row {
    grid-template-columns: minmax(180px, 1.1fr) minmax(140px, 0.75fr) minmax(220px, 1.2fr) auto;
  }
}

@media (min-width: 1500px) {
  #view-technical .technical-session-layout {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 420px);
  }
}

@media (max-width: 1180px) {
  #view-technical .technical-workbench-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #view-technical .technical-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-workbench-strip,
  #view-technical .technical-inspector-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-inspector-details {
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 10px;
    overflow: hidden;
  }

  #view-technical .technical-inspector-details > summary {
    align-items: center;
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    font-weight: 950;
    justify-content: space-between;
    min-height: 46px;
    padding: 0.68rem 0.78rem;
  }

  #view-technical .technical-inspector-details > summary::after {
    content: "+";
    font-size: 1rem;
  }

  #view-technical .technical-inspector-details[open] > summary::after {
    content: "-";
  }

  #view-technical .technical-inspector-body {
    padding: 0.62rem;
  }

  #view-technical .technical-inspector-image-block .technical-inspector-image {
    min-height: 220px;
  }

  #view-technical .technical-primary-image-summary--compact {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-section-chip {
    min-height: 48px;
  }
}

@media (max-width: 430px) {
  #view-technical .technical-reference-header-thumb {
    display: none;
  }

  #view-technical .technical-reference-header {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-reference-header-body strong {
    font-size: 1rem;
  }

  #view-technical .technical-reference-header-body > span {
    font-size: 0.78rem;
  }
}

.global-search-entry {
  align-items: center;
  display: flex;
  flex: 0 1 390px;
  min-width: 220px;
}

.global-search-trigger,
.global-search-mobile-trigger {
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.74);
  color: var(--color-text-muted);
  cursor: pointer;
  gap: 0.5rem;
  justify-content: flex-start;
  transition:
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard),
    box-shadow var(--motion-fast) var(--ease-standard);
}

.global-search-trigger {
  background: #ffffff;
  border-radius: var(--radius-sm);
  display: inline-flex;
  font-size: 0.86rem;
  font-weight: 800;
  min-height: 38px;
  min-width: 0;
  padding: 0.42rem 0.68rem;
  text-align: left;
  width: 100%;
}

.global-search-mobile-trigger {
  background: #ffffff;
  border-radius: 10px;
  display: none;
  height: 36px;
  justify-content: center;
  padding: 0;
  width: 36px;
}

.global-search-trigger:hover,
.global-search-trigger:focus-visible,
.global-search-mobile-trigger:hover,
.global-search-mobile-trigger:focus-visible {
  background: var(--color-primary-050);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-focus);
  color: var(--color-primary-900);
  outline: none;
}

.global-search-lens {
  border: 2px solid currentColor;
  border-radius: 50%;
  flex: 0 0 auto;
  height: 0.86rem;
  position: relative;
  width: 0.86rem;
}

.global-search-lens::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 0.38rem;
  position: absolute;
  right: -0.26rem;
  top: 0.58rem;
  transform: rotate(45deg);
  width: 2px;
}

.global-search-placeholder {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-overlay {
  align-items: flex-start;
  background: rgba(15, 23, 42, 0.24);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: clamp(3rem, 11vh, 7rem) 1rem 1rem;
  position: fixed;
  z-index: 10000;
}

.global-search-open {
  overflow: hidden;
}

.global-search-dialog {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.55);
  border-radius: var(--radius-sm);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  display: grid;
  gap: 0.74rem;
  max-height: min(720px, calc(100vh - 5rem));
  overflow: hidden;
  padding: 0.82rem;
  width: min(780px, calc(100vw - 2rem));
}

.global-search-head {
  align-items: end;
  display: grid;
  gap: 0.62rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.global-search-field {
  display: grid;
  gap: 0.34rem;
  min-width: 0;
}

.global-search-field span {
  color: var(--color-primary-900);
  font-size: var(--text-xs);
  font-weight: 950;
  text-transform: uppercase;
}

.global-search-field input {
  border: 1px solid rgba(148, 163, 184, 0.72);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  min-height: 44px;
  min-width: 0;
  outline: none;
  padding: 0.62rem 0.72rem;
  width: 100%;
}

.global-search-field input:focus {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-focus);
}

.global-search-results {
  display: grid;
  gap: 0.5rem;
  max-height: min(560px, calc(100vh - 12rem));
  overflow-y: auto;
  padding-right: 0.16rem;
}

.global-search-result {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: var(--radius-sm);
  display: grid;
  gap: 0.72rem;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  padding: 0.72rem;
}

.global-search-result.is-active {
  background: #f8f5ff;
  border-color: var(--color-border-strong);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.global-search-result-main {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.global-search-match {
  color: var(--color-primary-700);
  font-size: var(--text-xs);
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.global-search-result-main strong {
  color: var(--color-text);
  font-size: 0.98rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.global-search-result-main p,
.global-search-result-main small {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.32;
  margin: 0;
  overflow-wrap: anywhere;
}

.global-search-result-main small {
  color: var(--color-warning);
}

.global-search-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.36rem;
  justify-content: flex-end;
  min-width: 0;
}

.global-search-empty {
  background: var(--color-neutral-bg);
  border: 1px dashed rgba(148, 163, 184, 0.6);
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  display: grid;
  gap: 0.22rem;
  padding: 1rem;
  text-align: center;
}

.global-search-empty strong {
  color: var(--color-text);
}

@media (min-width: 761px) {
  .workspace-header .header-main {
    flex: 1 1 auto;
  }
}

@media (max-width: 760px) {
  .workspace-header {
    grid-template-areas:
      "toggle search title"
      "status status status";
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  .global-search-entry {
    flex: 0 0 auto;
    grid-area: search;
    min-width: 0;
  }

  .global-search-trigger {
    display: none;
  }

  .global-search-mobile-trigger {
    display: inline-flex;
  }

  .global-search-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .global-search-dialog {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    padding: 0.86rem;
    width: 100%;
  }

  .global-search-head {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .global-search-results {
    max-height: calc(92vh - 7rem);
  }

  .global-search-result {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .global-search-result-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .global-search-result-actions .btn {
    justify-content: center;
    min-height: 42px;
    width: 100%;
  }
}

@media (max-width: 390px) {
  .global-search-dialog {
    padding: 0.72rem;
  }

  .global-search-head {
    gap: 0.46rem;
  }

  .global-search-field input {
    font-size: 0.94rem;
  }

  .global-search-result {
    padding: 0.62rem;
  }
}

/* Production visual polish: global UI refresh without data or persistence changes. */
:root {
  --color-primary-950: #1b1026;
  --color-primary-900: #2c183f;
  --color-primary-800: #3f2559;
  --color-primary-700: #563178;
  --color-primary-600: #6f4294;
  --color-primary-500: #8a63aa;
  --color-primary-400: #a78bc1;
  --color-primary-100: #eadff1;
  --color-primary-050: #f6f1f8;
  --color-bg: #eef2f5;
  --color-bg-strong: #dde4eb;
  --color-surface: #ffffff;
  --color-surface-soft: #f7f9fb;
  --color-surface-warm: #fbfaf8;
  --color-border: #cbd5e1;
  --color-border-strong: #718096;
  --color-text: #172033;
  --color-text-muted: #566174;
  --color-success: #047857;
  --color-success-bg: #e9f7ef;
  --color-warning: #a16207;
  --color-warning-bg: #fff7e6;
  --color-danger: #b4232c;
  --color-danger-bg: #fff0f1;
  --color-info: #2563eb;
  --color-info-bg: #eef5ff;
  --color-neutral: #475569;
  --color-neutral-bg: #f3f6f8;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --shadow-low: 0 6px 16px rgba(15, 23, 42, 0.08);
  --shadow-medium: 0 14px 32px rgba(15, 23, 42, 0.13);
  --shadow-focus: 0 0 0 3px rgba(111, 66, 148, 0.22);
  --text-xs: 0.7rem;
  --text-sm: 0.8rem;
  --text-base: 0.9rem;
  --text-md: 0.98rem;
  --text-lg: 1.12rem;
  --text-xl: 1.36rem;
}

body {
  background:
    linear-gradient(180deg, #eef2f5 0%, #f8fafc 44%, #eef3f6 100%);
  color: var(--color-text);
}

.app-shell {
  grid-template-columns: 208px minmax(0, 1fr);
}

.sidebar {
  background: #ffffff;
  border-right-color: rgba(100, 116, 139, 0.28);
  box-shadow: 4px 0 20px rgba(15, 23, 42, 0.04);
}

.brand,
.workspace-header,
.hero-card,
.module-intro,
.card,
.sub-panel,
.panel,
.surface,
.data-card,
.status-card,
.metric-card,
.action-card,
.technical-summary-card,
.empty-state-card,
.section-card {
  border-color: rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
}

.brand,
.workspace-header,
.hero-card,
.module-intro {
  background: #ffffff;
}

.workspace-header {
  min-height: 56px;
  padding: 0.44rem 0.62rem;
}

.workspace-header h2,
.hero-card h3,
.module-intro h3,
.card h3,
.card h4,
.panel-title {
  color: var(--color-primary-950);
  letter-spacing: 0;
}

.workspace-header h2 {
  font-size: 1.08rem;
  font-weight: 850;
}

.eyebrow {
  color: #506070;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.section-description,
.field-hint,
.technical-tab-helper,
.panel-subtitle {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: 1.35;
}

.card {
  background: #ffffff;
  padding: 0.72rem;
}

.card:hover {
  border-color: rgba(100, 116, 139, 0.34);
  box-shadow: var(--shadow-low);
  transform: none;
}

.pipeline-card:hover,
.catalog-card:hover,
.image-gallery-card:hover,
.global-search-result:hover,
.quote-board-card:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-medium);
  transform: translateY(-1px);
}

.card .card,
.card .sub-panel,
.sub-panel .sub-panel,
.technical-section-card,
.commercial-colors-panel,
.commercial-price-panel,
.image-gallery-section,
.image-gallery-primary-block {
  box-shadow: none;
}

.sub-panel,
.technical-active-section-shell,
.technical-section-card,
.technical-section-panel,
.image-gallery-compact-summary,
.image-gallery-card,
.catalog-card,
.pipeline-card,
.quote-board-card {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-md);
}

.metric-tag,
.badge,
.state-pill,
.metric-pill,
.technical-chip,
.technical-section-meta,
.technical-section-chip-count,
.technical-hero-context-pill,
.header-status-pill,
.category-chip,
.pipeline-state,
.pipeline-badges span,
.pipeline-finance span,
.catalog-alerts span,
.field-status-pill {
  border-radius: var(--radius-pill);
  min-height: 24px;
  padding: 0.2rem 0.5rem;
  font-size: var(--text-xs);
  font-weight: 900;
}

.header-status-pill,
.metric-tag,
.badge-info,
.state-pill.info,
.metric-pill.info,
.badge-primary {
  background: var(--color-primary-050);
  border-color: rgba(86, 49, 120, 0.22);
  color: var(--color-primary-800);
}

input,
select,
textarea {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.42);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  min-height: 40px;
  padding: 0.54rem 0.64rem;
}

input:hover,
select:hover,
textarea:hover {
  border-color: rgba(86, 49, 120, 0.5);
}

input:focus,
select:focus,
textarea:focus {
  background: #ffffff;
  border-color: var(--color-primary-600);
  box-shadow: var(--shadow-focus);
}

button,
.btn,
a.btn {
  border-radius: var(--radius-sm);
  font-weight: 850;
  letter-spacing: 0;
  min-height: 40px;
}

.btn-primary,
button.btn-primary,
.card-action-primary,
#view-history #commercial-quote-save,
#view-costing #calculate-reference,
#pipeline-new-reference,
#catalog-new-reference,
#save-reference-now {
  background: linear-gradient(135deg, var(--color-primary-900), var(--color-primary-700));
  border-color: var(--color-primary-900);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(44, 24, 63, 0.22);
}

.btn-primary:hover,
button.btn-primary:hover,
.card-action-primary:hover,
#view-history #commercial-quote-save:hover,
#view-costing #calculate-reference:hover,
#pipeline-new-reference:hover,
#catalog-new-reference:hover,
#save-reference-now:hover {
  background: linear-gradient(135deg, var(--color-primary-950), var(--color-primary-800));
  border-color: var(--color-primary-950);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(44, 24, 63, 0.28);
}

.btn-secondary,
button.btn-secondary,
.btn-secondary-strong,
button.btn-secondary-strong {
  background: #f8fafc;
  border-color: #64748b;
  color: #1e293b;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.btn-secondary:hover,
button.btn-secondary:hover,
.btn-secondary-strong:hover,
button.btn-secondary-strong:hover {
  background: #eef2f6;
  border-color: var(--color-primary-700);
  color: var(--color-primary-900);
}

.btn-soft,
button.btn-soft,
.btn-tertiary,
button.btn-tertiary,
a.btn-tertiary {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.46);
  color: #334155;
  box-shadow: none;
}

.btn-soft:hover,
button.btn-soft:hover,
.btn-tertiary:hover,
button.btn-tertiary:hover,
a.btn-tertiary:hover {
  background: #f1f5f9;
  border-color: var(--color-border-strong);
  color: #172033;
}

.btn-ghost,
button.btn-ghost,
.card-more-actions summary,
.quote-board-more-actions summary {
  background: transparent;
  border-color: transparent;
  color: #475569;
  box-shadow: none;
}

.btn-ghost:hover,
button.btn-ghost:hover,
.card-more-actions summary:hover,
.quote-board-more-actions summary:hover {
  background: #eef2f6;
  border-color: rgba(100, 116, 139, 0.32);
  color: var(--color-primary-900);
}

.btn-danger,
button.btn-danger,
button.danger-lite,
.catalog-card-more-menu .btn-danger {
  background: var(--color-danger-bg);
  border-color: rgba(180, 35, 44, 0.38);
  color: var(--color-danger);
}

.btn-danger:hover,
button.btn-danger:hover,
button.danger-lite:hover,
.catalog-card-more-menu .btn-danger:hover {
  background: #ffe2e5;
  border-color: var(--color-danger);
  color: #8f1d25;
}

button:disabled,
.btn:disabled,
button[aria-disabled="true"],
.btn[aria-disabled="true"] {
  background: #eef2f6;
  border-color: #cbd5e1;
  color: #7b8794;
  opacity: 0.72;
}

.btn-icon,
button.btn-icon {
  border-radius: var(--radius-sm);
  min-height: 40px;
  min-width: 40px;
}

.btn-compact,
button.btn-compact {
  min-height: 34px;
  padding: 0.38rem 0.58rem;
}

.main-nav {
  gap: 0.28rem;
}

.nav-item {
  border-radius: var(--radius-sm);
  color: #334155;
  min-height: 38px;
  padding: 0.42rem 0.54rem;
}

.nav-item:hover {
  background: #f1f5f9;
  border-color: rgba(100, 116, 139, 0.28);
}

.nav-item.is-active,
.nav-admin-item.is-admin-active {
  background: #172033;
  border-color: #172033;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  color: #ffffff;
}

.hero-card,
.module-intro {
  padding: 0.66rem 0.78rem;
}

.panel-module,
.costing-main,
.simulator-module,
.history-module,
.quote-document-card,
.catalog-module,
.technical-session-main {
  background: #ffffff;
}

.dashboard-kpis,
.pipeline-kpis,
.summary-grid,
.commercial-price-summary,
.sim-summary,
.technical-control-grid,
.technical-workbench-strip {
  gap: 0.52rem;
}

.kpi-card,
.pipeline-kpis article,
.metric-card,
.commercial-price-summary article,
.summary-item,
.sim-card,
.technical-kpi-card,
.technical-decision-block {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-md);
  box-shadow: none;
}

.pipeline-tabs button,
.catalog-visibility-tab,
.quote-mode-tab,
.image-manager-tab,
.technical-change-mode-tabs button,
.technical-section-chip {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.38);
  border-radius: var(--radius-sm);
  color: #334155;
  min-height: 40px;
}

.pipeline-tabs button.is-active,
.catalog-visibility-tab.is-active,
.quote-mode-tab.is-active,
.image-manager-tab.is-active,
.technical-change-mode-tabs button.is-active,
#view-technical .technical-section-chip.is-active {
  background: #172033;
  border-color: #172033;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.18);
  color: #ffffff;
}

#view-technical .technical-section-chip.is-complete:not(.is-active),
.badge-success,
.state-pill.success,
.metric-pill.success,
.technical-chip.success,
.technical-hero-context-pill.success,
.status-card-success,
.status-card.success {
  background: var(--color-success-bg);
  border-color: rgba(4, 120, 87, 0.26);
  color: var(--color-success);
}

#view-technical .technical-section-chip.is-partial:not(.is-active),
#view-technical .technical-section-chip.is-pending:not(.is-active),
.badge-warning,
.state-pill.warning,
.metric-pill.warning,
.technical-chip.warning,
.technical-hero-context-pill.warning,
.status-card-warning,
.status-card.warning {
  background: var(--color-warning-bg);
  border-color: rgba(161, 98, 7, 0.28);
  color: var(--color-warning);
}

#view-technical .technical-section-chip.is-alert:not(.is-active),
.badge-danger,
.state-pill.danger,
.metric-pill.danger,
.technical-hero-context-pill.danger,
.status-card-danger,
.status-card.danger {
  background: var(--color-danger-bg);
  border-color: rgba(180, 35, 44, 0.3);
  color: var(--color-danger);
}

.catalog-list {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  justify-content: stretch;
}

.catalog-card,
.pipeline-card,
.quote-board-card {
  overflow: hidden;
}

.visual-card,
.pipeline-card-body {
  gap: 0.42rem 0.58rem;
}

.visual-card .actions-mini,
.pipeline-card-footer,
.quote-board-actions,
.technical-change-actions {
  border-top-color: rgba(100, 116, 139, 0.22);
}

.catalog-card-next,
.catalog-card-owner,
.pipeline-next,
.pipeline-owner {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.catalog-alerts span {
  border-radius: var(--radius-sm);
}

.catalog-filters-collapse,
.costing-secondary-panel,
.commercial-optional-panel,
.quote-secondary-panel,
.quote-admin-advanced,
.technical-secondary-details,
.technical-danger-zone,
.calc-more-actions {
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-md);
}

.catalog-filters-collapse > summary,
.costing-secondary-panel > summary,
.commercial-optional-panel > summary,
.quote-secondary-panel > summary,
.quote-admin-advanced summary,
.technical-secondary-details > summary,
.technical-danger-zone summary,
.calc-more-actions summary {
  color: #334155;
  font-weight: 900;
}

.quote-commercial-start,
.commercial-quote-form-shell,
.commercial-colors-panel,
.commercial-price-panel,
.lightning-quote-shell,
#view-history .commercial-quote-main,
#view-history .commercial-quote-side,
#view-history .lightning-quote-main,
#view-history .lightning-quote-side {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-md);
}

.commercial-price-kpi-primary,
.commercial-kpi-primary .kpi-main,
#view-history .commercial-price-kpi-primary,
#view-history .commercial-price-summary-head {
  background: #172033;
  border-color: #172033;
  color: #ffffff;
}

.commercial-price-kpi-primary span,
.commercial-price-kpi-primary b,
.commercial-kpi-primary .kpi-main span,
.commercial-kpi-primary .kpi-main b,
#view-history .commercial-price-kpi-primary span,
#view-history .commercial-price-kpi-primary b,
#view-history .commercial-price-summary-head span,
#view-history .commercial-price-summary-head b {
  color: #ffffff;
}

.technical-session-layout {
  gap: 0.86rem;
}

.technical-hero,
.technical-reference-header,
.technical-save-toolbar,
.technical-top-summary,
.technical-inspector-status,
.technical-inspector-image-block,
#view-technical #technical-image-preview .image-gallery-panel--compact {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-md);
  box-shadow: none;
}

#view-technical .technical-session-rail {
  border-color: rgba(100, 116, 139, 0.32);
  box-shadow: var(--shadow-low);
}

#view-technical .technical-inspector-actions {
  grid-template-columns: 1fr 1fr;
}

#view-technical .technical-inspector-image {
  background: #f1f5f9;
  border-radius: var(--radius-sm);
}

.technical-danger-zone:not([open]) {
  background: #ffffff;
  border-style: solid;
}

.technical-danger-zone:not([open]) summary {
  color: var(--color-text-muted);
}

.image-manager-dialog,
.image-lightbox-dialog,
.finance-access-dialog,
.permanent-delete-dialog,
.commercial-admin-support-dialog,
.pipeline-quick-dialog,
.global-search-dialog,
.document-preview-toolbar,
.snapshot-document {
  border-color: rgba(100, 116, 139, 0.32);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.2);
}

.global-search-overlay,
.finance-access-modal,
.permanent-delete-modal,
.commercial-admin-support-modal,
.document-preview-root,
.image-manager-backdrop,
.image-lightbox-backdrop,
.pipeline-quick-modal {
  background: rgba(15, 23, 42, 0.58);
}

.global-search-trigger,
.global-search-mobile-trigger {
  background: #ffffff;
  border-color: rgba(100, 116, 139, 0.5);
  border-radius: var(--radius-sm);
  color: #475569;
}

.global-search-result {
  border-radius: var(--radius-md);
}

.global-search-result.is-active {
  background: #f6f1f8;
  border-color: var(--color-primary-600);
  box-shadow: var(--shadow-focus);
}

.toast {
  border-radius: var(--radius-md);
  border-width: 1px;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.18);
}

.toast-success {
  border-color: rgba(4, 120, 87, 0.36);
}

.toast-warning {
  border-color: rgba(161, 98, 7, 0.36);
}

.toast-error {
  border-color: rgba(180, 35, 44, 0.36);
}

.empty-state,
.empty-state-card,
.global-search-empty,
.image-manager-empty-panel {
  background: #f8fafc;
  border-color: rgba(100, 116, 139, 0.42);
  border-radius: var(--radius-md);
}

.table-wrap,
table,
th,
td {
  border-color: rgba(100, 116, 139, 0.3);
}

th {
  background: #eef2f6;
  color: #172033;
  font-weight: 900;
}

@media (min-width: 1181px) {
  .workspace {
    padding: 0.72rem 0.86rem 1rem;
  }

  #view-technical .technical-session-layout {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 410px);
  }

  .catalog-list {
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  }

  #view-history .commercial-quote-layout,
  #view-history .lightning-quote-layout {
    gap: 1rem;
  }
}

@media (min-width: 1500px) {
  #view-technical .technical-session-layout {
    grid-template-columns: minmax(0, 1fr) minmax(390px, 430px);
  }

  .workspace {
    padding-inline: 1rem;
  }
}

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

  .sidebar {
    box-shadow: 10px 0 32px rgba(15, 23, 42, 0.18);
  }

  .workspace-header {
    border-radius: var(--radius-md);
  }

  .nav-close {
    border-radius: var(--radius-sm);
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 0.5rem;
  }

  .workspace-header {
    gap: 0.38rem 0.5rem;
    min-height: 54px;
  }

  .hero-card,
  .module-intro,
  .card,
  .sub-panel {
    padding: 0.58rem;
  }

  button,
  .btn,
  a.btn,
  input,
  select {
    min-height: 44px;
  }

  .btn-compact,
  button.btn-compact {
    min-height: 38px;
  }

  .global-search-dialog,
  .image-gallery-action-sheet {
    border-radius: 14px 14px 0 0;
  }

  .technical-section-chip,
  .quote-mode-tab,
  .image-manager-tab,
  .catalog-visibility-tab {
    min-height: 44px;
  }

  .catalog-list,
  #view-dashboard .pipeline-board {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-catalog .visual-card .actions-mini {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-catalog .visual-card .actions-mini > button:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .workspace {
    padding: 0.42rem;
  }

  .workspace-header h2 {
    font-size: 0.98rem;
  }

  .section-description,
  .field-hint,
  .technical-tab-helper {
    font-size: 0.68rem;
  }

  .catalog-card h4,
  .pipeline-card h4,
  .quote-board-main h4 {
    font-size: 0.96rem;
  }

  #view-technical .technical-inspector-actions,
  .global-search-result-actions,
  #view-catalog .visual-card .actions-mini {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Final viewport corrections discovered during visual QA. */
.nav-close,
.nav-toggle,
.sidebar-backdrop {
  display: none;
}

#view-catalog .catalog-card-next {
  display: none;
}

#view-technical .technical-hero {
  align-items: center;
  background: #ffffff;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-left: 4px solid var(--color-primary-700);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-low);
  display: grid;
  gap: 0.72rem;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  padding: 0.62rem 0.74rem;
}

#view-technical .technical-hero-copy {
  display: grid;
  gap: 0.34rem;
  min-width: 0;
}

#view-technical .technical-reference-header {
  background: transparent;
  border: 0;
  box-shadow: none;
  min-height: 0;
  padding: 0;
}

#view-technical .technical-reference-header-body {
  gap: 0.18rem;
}

#view-technical .technical-reference-header-body strong {
  color: var(--color-primary-950);
  font-size: 1rem;
  line-height: 1.15;
}

#view-technical .technical-reference-header-body > span {
  color: var(--color-text-muted);
  font-size: 0.78rem;
}

#view-technical .technical-reference-header-chips {
  margin-top: 0.28rem;
}

#view-technical .technical-reference-header-miniature {
  display: none;
  margin: 0;
}

#view-technical .technical-reference-header-miniature img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

#view-technical .technical-reference-header-placeholder {
  color: #64748b;
  display: grid;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1.05;
  padding: 0.22rem;
  place-items: center;
  text-align: center;
  text-transform: uppercase;
}

#view-technical .technical-hero-actions {
  background: #f8fafc;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: var(--radius-md);
  display: flex;
  gap: 0.48rem;
  justify-content: flex-end;
  padding: 0.42rem;
}

@media (max-width: 980px) {
  .nav-close,
  .nav-toggle {
    display: inline-flex;
  }

  .sidebar-backdrop {
    display: block;
  }

  #view-technical .technical-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-hero-actions {
    justify-content: stretch;
  }
}

@media (max-width: 760px) {
  #view-technical .technical-reference-header {
    align-items: center;
    display: grid;
    gap: 0.54rem;
    grid-template-columns: minmax(0, 1fr) 58px;
  }

  #view-technical .technical-reference-header-body {
    min-width: 0;
  }

  #view-technical .technical-reference-header-miniature {
    align-self: start;
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    border: 1px solid rgba(100, 116, 139, 0.34);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
    display: grid;
    height: 58px;
    overflow: hidden;
    place-items: center;
    width: 58px;
  }

  #view-technical .technical-reference-header-miniature.is-empty {
    background: linear-gradient(135deg, #ffffff, #eef2ff);
  }

  #view-technical .technical-hero {
    padding: 0.56rem;
  }

  #view-technical .technical-hero-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  #view-technical .technical-reference-header {
    grid-template-columns: minmax(0, 1fr) 52px;
  }

  #view-technical .technical-reference-header-miniature {
    height: 52px;
    width: 52px;
  }
}

/* Cotizaciones operational landing: visible work queue without changing calculations. */
.quote-ops-landing {
  display: grid;
  gap: 14px;
  margin: 14px 0 18px;
}

.quote-ops-command {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: end;
  border-radius: 8px;
  border: 1px solid #b9c2d6;
  background: #f8fafc;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.quote-ops-command label {
  display: grid;
  gap: 6px;
  margin: 0;
  color: #172033;
  font-size: 0.82rem;
  font-weight: 800;
}

.quote-ops-command input {
  min-height: 44px;
  border-radius: 7px;
  border: 1px solid #8d99ae;
  background: #ffffff;
  color: #101828;
  font-size: 0.98rem;
  font-weight: 700;
}

.quote-landing-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quote-landing-summary span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid #c5cede;
  background: #ffffff;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 800;
}

.quote-landing-summary b {
  margin-right: 4px;
  color: #111827;
}

.quote-ops-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quote-ops-panel {
  min-width: 0;
  border-radius: 8px;
  border: 1px solid #c5cede;
  background: #ffffff;
  box-shadow: none;
}

.quote-ops-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid #e2e8f0;
}

.quote-ops-panel-head h4 {
  margin: 0;
  color: #101828;
  font-size: 1rem;
  letter-spacing: 0;
}

.quote-ops-list {
  display: grid;
  gap: 9px;
}

.quote-ops-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid #d6dce8;
  border-radius: 8px;
  background: #fbfdff;
}

.quote-ops-item.is-ready {
  border-left: 4px solid #0f8a5f;
}

.quote-ops-item.is-pending {
  border-left: 4px solid #c47a09;
}

.quote-ops-thumb {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid #cbd5e1;
  background: #e9eef6;
  color: #334155;
  font-weight: 900;
}

.quote-ops-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quote-ops-copy {
  min-width: 0;
}

.quote-ops-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.quote-ops-line h5 {
  margin: 0;
  min-width: 0;
  color: #101828;
  font-size: 0.93rem;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.quote-ops-line span {
  flex: 0 0 auto;
  max-width: 145px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.quote-ops-copy p,
.quote-ops-copy small {
  display: block;
  margin: 3px 0 0;
  color: #475569;
  font-size: 0.8rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.quote-ops-copy small {
  color: #667085;
}

.quote-ops-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 210px;
}

.quote-ops-empty {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
}

.quote-ops-empty b {
  color: #172033;
}

.commercial-reference-snapshot-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 9px;
  border: 1px solid #d6dce8;
  border-radius: 8px;
  background: #ffffff;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 800;
}

.commercial-reference-snapshot-strip > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

@media (max-width: 980px) {
  .quote-ops-command,
  .quote-ops-grid {
    grid-template-columns: 1fr;
  }

  .quote-landing-summary {
    justify-content: flex-start;
  }

  .quote-ops-panel {
    padding: 14px;
  }
}

@media (max-width: 640px) {
  .quote-ops-landing {
    gap: 10px;
    margin-top: 10px;
  }

  .quote-ops-command {
    padding: 12px;
  }

  .quote-landing-summary {
    gap: 6px;
  }

  .quote-landing-summary span {
    min-height: 30px;
    font-size: 0.72rem;
  }

  .quote-ops-panel-head {
    margin-bottom: 8px;
  }

  .quote-ops-item {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 9px;
    padding: 8px;
  }

  .quote-ops-thumb {
    width: 48px;
    height: 48px;
  }

  .quote-ops-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
    max-width: none;
  }

  .quote-ops-actions .btn {
    flex: 1 1 120px;
    min-height: 42px;
  }

  .quote-ops-line {
    display: grid;
    gap: 4px;
  }

  .quote-ops-line span {
    justify-self: start;
    max-width: 100%;
  }

  .commercial-reference-snapshot-strip {
    display: grid;
    gap: 8px;
  }

  .commercial-reference-snapshot-strip > div {
    justify-content: stretch;
  }

  .commercial-reference-snapshot-strip .btn {
    flex: 1 1 110px;
    min-height: 40px;
  }
}

/* Final overrides for simple version history cards */
#view-technical .technical-change-table-wrap {
  display: none !important;
}

#view-technical .technical-change-list.technical-change-card-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 21rem), 1fr));
  gap: 0.85rem;
}

#view-technical .technical-change-quick-form {
  overflow-x: hidden;
}

/* Simple technical version adjustments */
#view-technical .technical-version-adjustments-editor {
  min-width: 0;
}

#view-technical .technical-version-core-grid {
  grid-template-columns: minmax(8rem, 0.7fr) minmax(8rem, 0.7fr) minmax(16rem, 1.4fr);
}

#view-technical .technical-version-summary-field,
#view-technical .technical-version-core-grid .technical-change-route-field {
  grid-column: span 2;
}

#view-technical .technical-version-adjustments-panel {
  background: #f8fafc;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.8rem;
}

#view-technical .technical-version-adjustments-title {
  align-items: start;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
}

#view-technical .technical-version-adjustments-title strong {
  color: #13202b;
  font-size: 0.95rem;
}

#view-technical .technical-version-adjustments-title span {
  color: #60707f;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1.3;
  text-align: right;
}

#view-technical .technical-version-adjustments {
  display: grid;
  gap: 0.65rem;
  min-width: 0;
}

#view-technical .technical-version-adjustment-row {
  align-items: end;
  background: #fff;
  border: 1px solid #dfe7ee;
  border-radius: 8px;
  display: grid;
  gap: 0.55rem;
  grid-template-columns: minmax(15rem, 1.35fr) repeat(5, minmax(5.7rem, 0.68fr));
  min-width: 0;
  padding: 0.68rem;
}

#view-technical .technical-version-adjustment-row label,
#view-technical .technical-adjustment-components-field {
  color: #51606d;
  display: grid;
  font-size: 0.74rem;
  font-weight: 850;
  gap: 0.28rem;
  min-width: 0;
  text-transform: uppercase;
}

#view-technical .technical-version-adjustment-row .input {
  min-width: 0;
}

#view-technical .technical-adjustment-note-field,
#view-technical .technical-adjustment-row-actions,
#view-technical .technical-adjustment-hint {
  grid-column: 1 / -1;
}

#view-technical .technical-adjustment-component-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

#view-technical .technical-adjustment-component-picker .technical-change-picker-chip {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.73rem;
  font-weight: 900;
  min-height: 34px;
  padding: 0.32rem 0.55rem;
}

#view-technical .technical-adjustment-component-picker .technical-change-picker-chip.is-selected,
#view-technical .technical-adjustment-component-picker .technical-change-picker-chip:has(input:checked) {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

#view-technical .technical-adjustment-component-picker input[type="checkbox"] {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

#view-technical .technical-adjustment-custom-component {
  flex: 1 1 12rem;
  min-width: min(100%, 12rem);
}

#view-technical .technical-adjustment-hint {
  color: #0f766e;
  font-size: 0.75rem;
  font-weight: 850;
}

#view-technical .technical-adjustment-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

#view-technical .technical-version-adjustment-lines {
  display: grid;
  gap: 0.28rem;
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}

#view-technical .technical-version-adjustment-lines li {
  color: #43515e;
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-adjustment-lines li span {
  color: #172330;
  font-weight: 850;
}

@media (max-width: 980px) {
  #view-technical .technical-version-core-grid,
  #view-technical .technical-version-adjustment-row {
    grid-template-columns: 1fr;
  }

  #view-technical .technical-version-summary-field,
  #view-technical .technical-version-core-grid .technical-change-route-field {
    grid-column: 1 / -1;
  }

  #view-technical .technical-version-adjustments-title {
    display: grid;
  }

  #view-technical .technical-version-adjustments-title span {
    text-align: left;
  }
}

@media (max-width: 760px) {
  #view-technical .technical-version-adjustments-panel {
    gap: 0.62rem;
    padding: 0.62rem;
  }

  #view-technical .technical-version-adjustment-row {
    gap: 0.5rem;
    padding: 0.58rem;
  }

  #view-technical .technical-adjustment-component-picker .technical-change-picker-chip {
    min-height: 40px;
    padding: 0.42rem 0.62rem;
  }
}

/* Versiones tecnicas: timeline + detalle seleccionado */
#view-technical .technical-versions-shell {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
}

#view-technical .technical-versions-head {
  background: #ffffff;
  border-color: rgba(37, 99, 235, 0.2);
}

#view-technical .technical-versions-head strong {
  color: #0f172a;
  font-size: 1.08rem;
}

#view-technical .technical-versions-head .actions-row {
  display: flex;
}

#view-technical .technical-current-version-card {
  background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 100%);
  border: 1px solid rgba(13, 148, 136, 0.26);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 118, 110, 0.08);
  display: grid;
  min-width: 0;
  overflow: hidden;
}

#view-technical .technical-current-version-card.is-empty {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: none;
}

#view-technical .technical-current-version-card > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 0.42rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  list-style: none;
  padding: 0.78rem 0.9rem;
}

#view-technical .technical-current-version-card > summary::-webkit-details-marker {
  display: none;
}

#view-technical .technical-current-version-card > summary span,
#view-technical .technical-version-kicker {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-technical .technical-current-version-card > summary strong {
  color: #064e3b;
  font-size: 1.18rem;
  line-height: 1.12;
}

#view-technical .technical-current-version-card > summary small {
  background: #ffffff;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 999px;
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 0.22rem 0.52rem;
}

#view-technical .technical-current-version-body {
  border-top: 1px solid rgba(13, 148, 136, 0.16);
  display: grid;
  gap: 0.62rem;
  min-width: 0;
  padding: 0 0.9rem 0.9rem;
}

#view-technical .technical-current-version-body h5 {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.25;
  margin: 0.1rem 0 0;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-toolbar {
  align-items: end;
  display: grid;
  gap: 0.7rem;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 0.9fr);
  min-width: 0;
}

#view-technical .technical-version-toolbar .technical-change-search-row {
  margin: 0;
}

#view-technical .technical-version-filters {
  margin: 0;
}

#view-technical .technical-version-filters .technical-change-filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#view-technical .technical-version-workspace {
  display: grid;
  gap: 0.85rem;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  min-width: 0;
}

#view-technical .technical-change-history.is-empty {
  display: grid;
}

#view-technical .technical-version-timeline,
#view-technical .technical-version-detail-panel {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.055);
  min-width: 0;
}

#view-technical .technical-version-timeline {
  align-self: start;
  display: grid;
  gap: 0.62rem;
  padding: 0.72rem;
}

#view-technical .technical-version-timeline-list {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

#view-technical .technical-version-timeline-item {
  align-items: start;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 8px;
  color: #0f172a;
  cursor: pointer;
  display: grid;
  gap: 0.56rem;
  grid-template-columns: 0.7rem minmax(0, 1fr);
  min-height: 86px;
  padding: 0.72rem;
  text-align: left;
  width: 100%;
}

#view-technical .technical-version-timeline-item:hover {
  border-color: rgba(37, 99, 235, 0.38);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.08);
}

#view-technical .technical-version-timeline-item.is-selected {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.62);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

#view-technical .technical-version-timeline-item.is-current-version {
  border-color: rgba(15, 118, 110, 0.45);
}

#view-technical .technical-version-timeline-marker {
  background: #94a3b8;
  border-radius: 999px;
  height: 0.68rem;
  margin-top: 0.18rem;
  width: 0.68rem;
}

#view-technical .technical-version-timeline-item.is-current-version .technical-version-timeline-marker {
  background: #0f766e;
}

#view-technical .technical-version-timeline-copy {
  display: grid;
  gap: 0.22rem;
  min-width: 0;
}

#view-technical .technical-version-timeline-top {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

#view-technical .technical-version-timeline-top strong {
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1.1;
}

#view-technical .technical-version-timeline-top em,
#view-technical .technical-version-timeline-top small {
  border-radius: 999px;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  padding: 0.16rem 0.42rem;
}

#view-technical .technical-version-timeline-top em {
  background: #f1f5f9;
  color: #475569;
}

#view-technical .technical-version-timeline-top small {
  background: #ccfbf1;
  color: #115e59;
}

#view-technical .technical-version-timeline-summary {
  color: #172033;
  font-size: 0.9rem;
  font-weight: 850;
  line-height: 1.24;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-timeline-meta {
  color: #64748b;
  font-size: 0.74rem;
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-detail-host {
  min-width: 0;
}

#view-technical .technical-version-detail-panel {
  display: grid;
  gap: 0.78rem;
  padding: 0.86rem;
}

#view-technical .technical-version-detail-panel.is-current-version {
  border-color: rgba(15, 118, 110, 0.42);
}

#view-technical .technical-version-detail-head {
  align-items: start;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

#view-technical .technical-version-detail-head h5 {
  color: #0f172a;
  font-size: 1.16rem;
  line-height: 1.18;
  margin: 0.14rem 0 0;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-detail-close {
  display: none;
}

#view-technical .technical-version-detail-meta {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-technical .technical-version-detail-meta p,
#view-technical .technical-version-legacy-summary,
#view-technical .technical-version-current-note {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  margin: 0;
  min-width: 0;
  padding: 0.55rem 0.62rem;
}

#view-technical .technical-version-detail-section {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}

#view-technical .technical-version-detail-section > strong {
  color: #0f172a;
  font-size: 0.92rem;
}

#view-technical .technical-version-adjustment-cards {
  display: grid;
  gap: 0.5rem;
  min-width: 0;
}

#view-technical .technical-version-adjustment-cards--detail {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#view-technical .technical-version-adjustment-card {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0.62rem 0.68rem;
}

#view-technical .technical-version-adjustment-card span {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-adjustment-card strong {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-adjustment-card small,
#view-technical .technical-version-adjustment-extra,
#view-technical .technical-version-current-note {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 750;
}

#view-technical .technical-version-current-note {
  background: #fff7ed;
  border-color: rgba(245, 158, 11, 0.26);
  color: #92400e;
}

#view-technical .technical-version-detail-actions {
  gap: 0.42rem;
}

#view-technical .technical-version-full-detail {
  margin: 0;
}

#view-technical .technical-version-modal {
  align-items: center;
  display: grid;
  inset: 0;
  padding: 1rem;
  position: fixed;
  z-index: 155;
}

#view-technical .technical-version-modal[hidden] {
  display: none;
}

.technical-version-modal-open {
  overflow: hidden;
}

#view-technical .technical-version-modal-backdrop {
  background: rgba(15, 23, 42, 0.54);
  inset: 0;
  position: absolute;
}

#view-technical .technical-version-dialog {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.48);
  border-radius: 10px;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.34);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  justify-self: center;
  max-height: 90dvh;
  max-width: 1080px;
  min-width: 0;
  overflow: hidden;
  position: relative;
  width: min(100%, 1080px);
}

#view-technical .technical-version-dialog-head {
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.86rem 1rem;
}

#view-technical .technical-version-dialog-head div {
  display: grid;
  gap: 0.12rem;
}

#view-technical .technical-version-dialog-head span {
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-technical .technical-version-dialog-head strong {
  color: #0f172a;
  font-size: 1.08rem;
}

#view-technical .technical-version-step-tabs {
  background: #f8fafc;
  border-bottom: 1px solid rgba(148, 163, 184, 0.24);
  display: grid;
  gap: 0.35rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 0.54rem;
}

#view-technical .technical-version-step-tabs button {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  color: #334155;
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 900;
  min-height: 42px;
  padding: 0.48rem 0.62rem;
}

#view-technical .technical-version-step-tabs button.is-active {
  background: #172554;
  border-color: #172554;
  color: #ffffff;
}

#view-technical .technical-version-dialog .technical-version-form {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  max-height: none;
  overflow: auto;
  padding: 0.9rem 1rem;
}

#view-technical .technical-version-step-panel[hidden] {
  display: none;
}

#view-technical .technical-adjustment-rule {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.35;
  margin: 0;
  padding: 0.54rem 0.62rem;
}

#view-technical .technical-version-adjustment-builder {
  display: grid;
  gap: 0.72rem;
  grid-template-columns: minmax(230px, 0.42fr) minmax(0, 1fr);
  min-width: 0;
}

#view-technical .technical-adjustment-master-list,
#view-technical .technical-adjustment-editor-shell {
  min-width: 0;
}

#view-technical .technical-adjustment-master-list {
  align-self: start;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  display: grid;
  gap: 0.5rem;
  padding: 0.58rem;
}

#view-technical .technical-adjustment-master-head {
  align-items: center;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
}

#view-technical .technical-adjustment-master-head strong {
  color: #0f172a;
  font-size: 0.9rem;
}

#view-technical .technical-adjustment-master-head span {
  align-items: center;
  background: #e0f2fe;
  border-radius: 999px;
  color: #075985;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 950;
  min-height: 1.55rem;
  min-width: 1.55rem;
  justify-content: center;
  padding: 0 0.42rem;
}

#view-technical .technical-adjustment-master-items {
  display: grid;
  gap: 0.42rem;
  min-width: 0;
}

#view-technical .technical-adjustment-master-item {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  display: grid;
  gap: 0.38rem;
  min-width: 0;
  padding: 0.46rem;
}

#view-technical .technical-adjustment-master-item.is-selected {
  background: #eff6ff;
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: inset 3px 0 0 #2563eb;
}

#view-technical .technical-adjustment-master-button {
  background: transparent;
  border: 0;
  color: #0f172a;
  cursor: pointer;
  display: grid;
  gap: 0.18rem;
  min-width: 0;
  padding: 0;
  text-align: left;
}

#view-technical .technical-adjustment-master-button span {
  display: grid;
  gap: 0.08rem;
  min-width: 0;
}

#view-technical .technical-adjustment-master-button strong,
#view-technical .technical-adjustment-master-button b,
#view-technical .technical-adjustment-master-button small,
#view-technical .technical-adjustment-master-button em {
  overflow-wrap: anywhere;
}

#view-technical .technical-adjustment-master-button strong {
  font-size: 0.9rem;
  line-height: 1.18;
}

#view-technical .technical-adjustment-master-button small,
#view-technical .technical-adjustment-master-button em,
#view-technical .technical-adjustment-master-note {
  color: #64748b;
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

#view-technical .technical-adjustment-master-button b {
  color: #0f766e;
  font-size: 0.86rem;
  line-height: 1.18;
}

#view-technical .technical-adjustment-master-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.32rem;
}

#view-technical .technical-adjustment-editor-shell {
  display: grid;
  gap: 0.58rem;
}

#view-technical .technical-adjustment-hidden-rows {
  display: none;
}

#view-technical .technical-adjustment-detail-editor {
  align-items: stretch;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.38);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
  display: grid;
  gap: 0.62rem;
  grid-template-columns: minmax(0, 1fr);
  padding: 0.72rem;
}

#view-technical .technical-adjustment-editor-head {
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  padding-bottom: 0.44rem;
}

#view-technical .technical-adjustment-editor-head div {
  display: grid;
  gap: 0.08rem;
}

#view-technical .technical-adjustment-editor-head span,
#view-technical .technical-adjustment-editor-head small {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-technical .technical-adjustment-editor-head strong {
  color: #0f172a;
  font-size: 1rem;
}

#view-technical .technical-adjustment-editor-grid {
  display: grid;
  gap: 0.56rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
}

#view-technical .technical-adjustment-detail-editor .field {
  min-width: 0;
}

#view-technical .technical-adjustment-detail-editor .field-title,
#view-technical .technical-adjustment-formula label,
#view-technical .technical-adjustment-note-field {
  color: #475569;
  font-size: 0.74rem;
  font-weight: 880;
  letter-spacing: 0;
  text-transform: uppercase;
}

#view-technical .technical-adjustment-custom-field[hidden] {
  display: none;
}

#view-technical .technical-adjustment-formula {
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  display: grid;
  gap: 0.52rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  padding: 0.58rem;
}

#view-technical .technical-adjustment-formula label,
#view-technical .technical-adjustment-note-field {
  display: grid;
  gap: 0.26rem;
  min-width: 0;
}

#view-technical .technical-adjustment-formula .input,
#view-technical .technical-adjustment-note-field .input {
  min-width: 0;
}

#view-technical .technical-adjustment-flow-summary {
  background: #f0fdfa;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 0.28rem;
  min-width: 0;
  padding: 0.58rem 0.68rem;
}

#view-technical .technical-adjustment-flow-summary span {
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

#view-technical .technical-adjustment-flow-summary strong {
  color: #0f172a;
  font-size: 0.92rem;
}

#view-technical .technical-adjustment-flow-summary ul {
  display: grid;
  gap: 0.18rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

#view-technical .technical-adjustment-flow-summary li,
#view-technical .technical-adjustment-flow-summary p {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 760;
  line-height: 1.28;
  margin: 0;
  overflow-wrap: anywhere;
}

#view-technical .technical-version-dialog-actions {
  align-items: center;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
  display: flex;
  gap: 0.55rem;
  justify-content: flex-end;
  padding: 0.72rem 1rem;
}

@media (min-width: 1180px) {
  #view-technical .technical-version-dialog .technical-version-core-grid {
    grid-template-columns: minmax(8rem, 0.7fr) minmax(8rem, 0.7fr) minmax(18rem, 1.4fr) minmax(10rem, 0.75fr);
  }
}

@media (max-width: 1080px) {
  #view-technical .technical-version-toolbar,
  #view-technical .technical-version-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-version-adjustment-builder {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-version-timeline {
    order: 1;
  }

  #view-technical .technical-version-detail-host {
    order: 2;
  }
}

@media (max-width: 760px) {
  #view-technical .technical-versions-head .actions-row {
    display: flex !important;
    width: 100%;
  }

  #view-technical .technical-versions-head .actions-row .btn {
    width: 100%;
  }

  #view-technical .technical-current-version-card > summary {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #view-technical .technical-current-version-card > summary span {
    grid-column: 1 / -1;
  }

  #view-technical .technical-current-version-card > summary strong {
    font-size: 1.04rem;
  }

  #view-technical .technical-version-filters .technical-change-filter-grid,
  #view-technical .technical-version-detail-meta,
  #view-technical .technical-version-adjustment-cards--detail {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-version-detail-host {
    display: none;
  }

  #view-technical .technical-version-adjustments-panel {
    overflow-x: hidden;
  }

  #view-technical .technical-changes-editor.is-mobile-detail-open .technical-version-detail-host {
    background: rgba(15, 23, 42, 0.44);
    display: grid;
    inset: 0;
    padding: 3.5rem 0.62rem 0.62rem;
    position: fixed;
    z-index: 145;
  }

  #view-technical .technical-changes-editor.is-mobile-detail-open .technical-version-detail-panel {
    align-self: end;
    border-radius: 12px 12px 8px 8px;
    max-height: 84dvh;
    overflow: auto;
  }

  #view-technical .technical-version-detail-head {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-version-detail-close {
    display: inline-flex;
    justify-self: end;
    min-height: 44px;
  }

  #view-technical .technical-version-timeline-item {
    min-height: 78px;
    padding: 0.66rem;
  }

  #view-technical .technical-version-modal {
    align-items: end;
    padding: 0;
  }

  #view-technical .technical-version-dialog {
    border-radius: 14px 14px 0 0;
    max-height: 94dvh;
    width: 100%;
  }

  #view-technical .technical-version-dialog-head,
  #view-technical .technical-version-dialog .technical-version-form,
  #view-technical .technical-version-dialog-actions {
    padding-inline: 0.78rem;
  }

  #view-technical .technical-version-step-tabs {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-adjustment-editor-grid,
  #view-technical .technical-adjustment-formula {
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-adjustment-master-actions .btn,
  #view-technical .technical-adjustment-master-list > .btn {
    min-height: 44px;
  }

  #view-technical .technical-version-dialog-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-version-dialog-actions .btn {
    min-height: 44px;
    width: 100%;
  }
}

@media (max-width: 390px) {
  #view-technical .technical-version-timeline-item {
    grid-template-columns: 0.5rem minmax(0, 1fr);
  }

  #view-technical .technical-version-timeline-top strong {
    font-size: 0.98rem;
  }
}

/* Visual polish for Versiones tecnicas */
#view-technical .technical-versions-shell,
#view-technical .technical-version-modal {
  --tv-primary: #1d4ed8;
  --tv-primary-strong: #1e3a8a;
  --tv-primary-soft: #eff6ff;
  --tv-accent: #0f766e;
  --tv-accent-soft: #ecfdf5;
  --tv-warning: #a16207;
  --tv-warning-soft: #fffbeb;
  --tv-danger: #b42318;
  --tv-danger-soft: #fff1f2;
  --tv-ink: #102033;
  --tv-muted: #5b6b7d;
  --tv-line: #d7e2ec;
  --tv-line-strong: #9bb4cc;
  --tv-panel: #f6f9fc;
  --tv-panel-strong: #edf4fb;
  --tv-shadow: 0 16px 34px rgba(15, 23, 42, 0.1);
  --tv-shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.07);
  --tv-shadow-lift: 0 16px 30px rgba(29, 78, 216, 0.14);
}

#view-technical .technical-versions-shell .btn,
#view-technical .technical-version-dialog .btn,
#view-technical .technical-version-timeline-item,
#view-technical .technical-current-version-card,
#view-technical .technical-version-detail-panel,
#view-technical .technical-adjustment-master-item,
#view-technical .technical-version-adjustment-card,
#view-technical .technical-adjustment-detail-editor,
#view-technical .technical-secondary-details > summary,
#view-technical .technical-change-folder-copy,
#view-technical .technical-version-step-tabs button {
  transition:
    background-color var(--motion-base) var(--ease-standard),
    border-color var(--motion-base) var(--ease-standard),
    box-shadow var(--motion-base) var(--ease-standard),
    color var(--motion-base) var(--ease-standard),
    transform var(--motion-fast) var(--ease-standard);
}

#view-technical .technical-versions-shell .btn:focus-visible,
#view-technical .technical-version-dialog .btn:focus-visible,
#view-technical .technical-version-timeline-item:focus-visible,
#view-technical .technical-adjustment-master-button:focus-visible,
#view-technical .technical-secondary-details > summary:focus-visible,
#view-technical .technical-change-folder-copy:focus-visible,
#view-technical .technical-version-step-tabs button:focus-visible,
#view-technical .technical-versions-shell .btn:focus,
#view-technical .technical-version-dialog .btn:focus,
#view-technical .technical-version-timeline-item:focus,
#view-technical .technical-adjustment-master-button:focus,
#view-technical .technical-secondary-details > summary:focus,
#view-technical .technical-change-folder-copy:focus,
#view-technical .technical-version-step-tabs button:focus {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.22), 0 0 0 1px rgba(29, 78, 216, 0.45);
}

#view-technical .technical-versions-shell .btn-primary,
#view-technical .technical-version-dialog .btn-primary {
  background: var(--tv-primary);
  border-color: var(--tv-primary);
  color: #ffffff;
  box-shadow: 0 10px 18px rgba(29, 78, 216, 0.24);
}

#view-technical .technical-versions-shell .btn-primary:hover,
#view-technical .technical-version-dialog .btn-primary:hover {
  background: var(--tv-primary-strong);
  border-color: var(--tv-primary-strong);
  box-shadow: var(--tv-shadow-lift);
  color: #ffffff;
  transform: translateY(-1px);
}

#view-technical .technical-versions-shell .btn-primary:active,
#view-technical .technical-version-dialog .btn-primary:active,
#view-technical .technical-versions-shell .btn-soft:active,
#view-technical .technical-version-dialog .btn-soft:active,
#view-technical .technical-versions-shell .btn-ghost:active,
#view-technical .technical-version-dialog .btn-ghost:active,
#view-technical .technical-versions-shell .btn-danger:active,
#view-technical .technical-version-dialog .btn-danger:active {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
  transform: translateY(0);
}

#view-technical .technical-versions-shell .btn-soft,
#view-technical .technical-version-dialog .btn-soft {
  background: #eef6ff;
  border-color: #bfd7f2;
  color: #1e3a8a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

#view-technical .technical-versions-shell .btn-soft:hover,
#view-technical .technical-version-dialog .btn-soft:hover {
  background: #dbeafe;
  border-color: #8bb8ef;
  color: #172554;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.12);
  transform: translateY(-1px);
}

#view-technical .technical-versions-shell .btn-ghost,
#view-technical .technical-version-dialog .btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.28);
  color: #475569;
}

#view-technical .technical-versions-shell .btn-ghost:hover,
#view-technical .technical-version-dialog .btn-ghost:hover {
  background: #f2f6fa;
  border-color: #bfd0df;
  color: var(--tv-ink);
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.07);
}

#view-technical .technical-versions-shell .btn-danger,
#view-technical .technical-version-dialog .btn-danger,
#view-technical .technical-adjustment-action-delete {
  background: var(--tv-danger-soft);
  border-color: rgba(180, 35, 24, 0.32);
  color: var(--tv-danger);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

#view-technical .technical-versions-shell .btn-danger:hover,
#view-technical .technical-version-dialog .btn-danger:hover,
#view-technical .technical-adjustment-action-delete:hover {
  background: #fee2e2;
  border-color: rgba(180, 35, 24, 0.62);
  box-shadow: 0 8px 18px rgba(180, 35, 24, 0.12);
  color: #8f1f16;
  transform: translateY(-1px);
}

#view-technical .technical-versions-shell .btn:disabled,
#view-technical .technical-version-dialog .btn:disabled {
  background: #eef2f6;
  border-color: #d6dee7;
  box-shadow: none;
  color: #7b8794;
  cursor: not-allowed;
  transform: none;
}

#view-technical .technical-versions-head {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 255, 0.86)),
    #ffffff;
  border-color: rgba(29, 78, 216, 0.2);
  box-shadow: var(--tv-shadow-soft);
}

#view-technical .technical-versions-head strong {
  color: var(--tv-ink);
  font-size: 1.14rem;
}

#view-technical .technical-versions-head p {
  color: var(--tv-muted);
  font-weight: 720;
}

#view-technical .technical-current-version-card {
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.98), rgba(255, 255, 255, 0.96) 58%, rgba(239, 246, 255, 0.72)),
    #ffffff;
  border-color: rgba(15, 118, 110, 0.34);
  box-shadow: 0 16px 36px rgba(15, 118, 110, 0.11);
  position: relative;
}

#view-technical .technical-current-version-card::before {
  background: linear-gradient(180deg, var(--tv-accent), #14b8a6);
  border-radius: 8px 0 0 8px;
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 5px;
}

#view-technical .technical-current-version-card:hover {
  border-color: rgba(15, 118, 110, 0.52);
  box-shadow: 0 18px 42px rgba(15, 118, 110, 0.14);
}

#view-technical .technical-current-version-card > summary {
  padding-left: 1.05rem;
}

#view-technical .technical-current-version-card > summary strong {
  color: #064e3b;
  font-size: 1.24rem;
}

#view-technical .technical-current-version-card.is-empty {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.48);
  box-shadow: none;
}

#view-technical .technical-current-version-card.is-empty::before {
  background: #94a3b8;
}

#view-technical .technical-current-version-body {
  gap: 0.7rem;
  padding-left: 1.05rem;
}

#view-technical .technical-current-version-body h5 {
  color: var(--tv-ink);
  font-weight: 900;
}

#view-technical .technical-change-folder {
  background: #ffffff;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 8px;
  padding: 0.58rem 0.65rem;
}

#view-technical .technical-change-folder-copy {
  background: transparent;
  border-radius: 6px;
  color: #0f766e;
  padding: 0.12rem 0.2rem;
}

#view-technical .technical-change-folder-copy:hover {
  background: #ccfbf1;
  color: #064e3b;
}

#view-technical .technical-version-toolbar {
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  padding: 0.72rem;
}

#view-technical .technical-version-toolbar .input,
#view-technical .technical-version-toolbar .select,
#view-technical .technical-version-dialog .input,
#view-technical .technical-version-dialog .select,
#view-technical .technical-version-dialog .textarea {
  background: #ffffff;
  border-color: #cbd8e5;
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.02);
}

#view-technical .technical-version-toolbar .input:hover,
#view-technical .technical-version-toolbar .select:hover,
#view-technical .technical-version-dialog .input:hover,
#view-technical .technical-version-dialog .select:hover,
#view-technical .technical-version-dialog .textarea:hover {
  border-color: #9bb4cc;
}

#view-technical .technical-version-toolbar .input:focus,
#view-technical .technical-version-toolbar .select:focus,
#view-technical .technical-version-dialog .input:focus,
#view-technical .technical-version-dialog .select:focus,
#view-technical .technical-version-dialog .textarea:focus {
  border-color: var(--tv-primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.16);
}

#view-technical .technical-version-timeline,
#view-technical .technical-version-detail-panel {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-color: var(--tv-line);
  box-shadow: var(--tv-shadow-soft);
}

#view-technical .technical-version-timeline {
  padding: 0.8rem;
}

#view-technical .technical-version-timeline-item {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: #dbe5ee;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  position: relative;
}

#view-technical .technical-version-timeline-item:hover {
  background: #f8fbff;
  border-color: rgba(29, 78, 216, 0.44);
  box-shadow: 0 12px 24px rgba(29, 78, 216, 0.11);
  transform: translateY(-1px);
}

#view-technical .technical-version-timeline-item.is-selected {
  background: var(--tv-primary-soft);
  border-color: rgba(29, 78, 216, 0.62);
  box-shadow: inset 4px 0 0 var(--tv-primary), 0 10px 24px rgba(29, 78, 216, 0.14);
}

#view-technical .technical-version-timeline-item.is-current-version {
  background: linear-gradient(180deg, #f0fdfa, #ffffff);
  border-color: rgba(15, 118, 110, 0.52);
}

#view-technical .technical-version-timeline-item.is-current-version.is-selected {
  box-shadow: inset 4px 0 0 var(--tv-accent), 0 10px 26px rgba(15, 118, 110, 0.15);
}

#view-technical .technical-version-timeline-marker {
  background: #9fb1c3;
  box-shadow: 0 0 0 4px #f1f5f9;
}

#view-technical .technical-version-timeline-item.is-selected .technical-version-timeline-marker {
  background: var(--tv-primary);
  box-shadow: 0 0 0 4px #dbeafe;
}

#view-technical .technical-version-timeline-item.is-current-version .technical-version-timeline-marker {
  background: var(--tv-accent);
  box-shadow: 0 0 0 4px #ccfbf1;
}

#view-technical .technical-version-timeline-summary,
#view-technical .technical-version-detail-head h5 {
  color: var(--tv-ink);
}

#view-technical .technical-version-timeline-meta,
#view-technical .technical-version-kicker {
  color: var(--tv-muted);
}

#view-technical .technical-version-state,
#view-technical .technical-change-status-pill.technical-version-state,
#view-technical .technical-version-timeline-top small {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 950;
  gap: 0.25rem;
  line-height: 1;
  min-height: 1.35rem;
  padding: 0.22rem 0.52rem;
}

#view-technical .technical-version-state.status-validado {
  background: #dcfce7;
  border-color: rgba(22, 163, 74, 0.24);
  color: #166534;
}

#view-technical .technical-version-state.status-aplicado {
  background: #dbeafe;
  border-color: rgba(37, 99, 235, 0.24);
  color: #1e40af;
}

#view-technical .technical-version-state.status-pendiente {
  background: #fef3c7;
  border-color: rgba(217, 119, 6, 0.24);
  color: #92400e;
}

#view-technical .technical-version-state.status-descartado {
  background: #fee2e2;
  border-color: rgba(180, 35, 24, 0.24);
  color: #991b1b;
}

#view-technical .technical-version-state.status-neutral {
  background: #eef2f7;
  border-color: rgba(100, 116, 139, 0.22);
  color: #475569;
}

#view-technical .technical-version-timeline-top small {
  background: #ccfbf1;
  border-color: rgba(15, 118, 110, 0.22);
  color: #115e59;
}

#view-technical .technical-version-detail-panel {
  gap: 0.9rem;
  padding: 1rem;
}

#view-technical .technical-version-detail-panel.is-current-version {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: inset 4px 0 0 var(--tv-accent), var(--tv-shadow-soft);
}

#view-technical .technical-version-detail-meta p,
#view-technical .technical-version-legacy-summary {
  background: #f8fbff;
  border-color: #dce7f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76);
}

#view-technical .technical-version-current-note {
  background: #fffbeb;
  border-color: rgba(245, 158, 11, 0.32);
  color: #92400e;
}

#view-technical .technical-version-adjustment-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border-color: #dce7f2;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.045);
}

#view-technical .technical-version-adjustment-card:hover {
  border-color: rgba(29, 78, 216, 0.34);
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.09);
  transform: translateY(-1px);
}

#view-technical .technical-version-adjustment-card strong {
  color: #0f766e;
}

#view-technical .technical-version-detail-actions {
  align-items: center;
  background: #f8fbff;
  border: 1px solid #dce7f2;
  border-radius: 8px;
  padding: 0.55rem;
}

#view-technical .technical-version-current-action {
  background: #ecfdf5;
  border-color: rgba(15, 118, 110, 0.32);
  color: #0f766e;
}

#view-technical .technical-version-current-action:hover {
  background: #ccfbf1;
  border-color: rgba(15, 118, 110, 0.52);
  color: #064e3b;
}

#view-technical .technical-secondary-details {
  border-color: #dce7f2;
  box-shadow: none;
}

#view-technical .technical-secondary-details > summary {
  border-radius: 8px;
  color: var(--tv-ink);
}

#view-technical .technical-secondary-details > summary:hover {
  background: #eef6ff;
  color: #1e3a8a;
}

#view-technical .technical-version-modal-backdrop {
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(3px);
}

#view-technical .technical-version-dialog {
  background: #ffffff;
  border-color: rgba(215, 226, 236, 0.9);
  border-radius: 14px;
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.36);
}

#view-technical .technical-version-dialog::before {
  background: linear-gradient(90deg, var(--tv-primary), var(--tv-accent));
  content: "";
  height: 4px;
  inset: 0 0 auto;
  position: absolute;
}

#view-technical .technical-version-dialog-head {
  background: linear-gradient(135deg, #ffffff, #f4f8fc);
  border-bottom-color: #dce7f2;
  padding-top: 1rem;
}

#view-technical .technical-version-dialog-head span {
  color: #47627c;
}

#view-technical .technical-version-dialog-head strong {
  color: var(--tv-ink);
  font-size: 1.16rem;
}

#view-technical .technical-version-step-tabs {
  background: #f5f8fb;
  border-bottom-color: #dce7f2;
  gap: 0.45rem;
}

#view-technical .technical-version-step-tabs button {
  background: #ffffff;
  border-color: #d5e1ec;
  color: #405368;
  position: relative;
  text-align: center;
}

#view-technical .technical-version-step-tabs button:hover {
  background: #eef6ff;
  border-color: #a9c7e8;
  color: #1e3a8a;
  transform: translateY(-1px);
}

#view-technical .technical-version-step-tabs button.is-complete {
  background: #ecfdf5;
  border-color: rgba(15, 118, 110, 0.3);
  color: #0f766e;
}

#view-technical .technical-version-step-tabs button.is-active {
  background: var(--tv-primary);
  border-color: var(--tv-primary);
  box-shadow: 0 10px 18px rgba(29, 78, 216, 0.2);
  color: #ffffff;
}

#view-technical .technical-version-dialog .technical-version-form {
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.72), rgba(255, 255, 255, 0.9)),
    #ffffff;
}

#view-technical .field-status-pill {
  background: #eef6ff;
  border: 1px solid rgba(29, 78, 216, 0.18);
  color: #1e3a8a;
}

#view-technical .field-status-pill.is-required {
  background: #ecfdf5;
  border-color: rgba(15, 118, 110, 0.24);
  color: #0f766e;
}

#view-technical .technical-version-adjustments-panel {
  background: linear-gradient(180deg, #ffffff, #f6f9fc);
  border-color: #dce7f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

#view-technical .technical-version-adjustments-title strong {
  color: var(--tv-ink);
  font-size: 1rem;
}

#view-technical .technical-version-adjustments-title span {
  background: #eef6ff;
  border: 1px solid rgba(29, 78, 216, 0.16);
  border-radius: 999px;
  color: #1e3a8a;
  padding: 0.24rem 0.55rem;
}

#view-technical .technical-adjustment-rule {
  background: #f0fdfa;
  border-color: rgba(15, 118, 110, 0.22);
  color: #0f766e;
}

#view-technical .technical-adjustment-master-list {
  background: #fbfdff;
  border-color: #dce7f2;
  box-shadow: var(--tv-shadow-soft);
}

#view-technical .technical-adjustment-master-head strong {
  color: var(--tv-ink);
}

#view-technical .technical-adjustment-master-head span {
  background: var(--tv-primary);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(29, 78, 216, 0.18);
}

#view-technical .technical-adjustment-master-item {
  background: #ffffff;
  border-color: #dce7f2;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.045);
}

#view-technical .technical-adjustment-master-item:hover {
  border-color: rgba(29, 78, 216, 0.3);
  box-shadow: 0 10px 20px rgba(29, 78, 216, 0.08);
  transform: translateY(-1px);
}

#view-technical .technical-adjustment-master-item.is-selected {
  background: #eef6ff;
  border-color: rgba(29, 78, 216, 0.55);
  box-shadow: inset 4px 0 0 var(--tv-primary), 0 10px 22px rgba(29, 78, 216, 0.12);
}

#view-technical .technical-adjustment-master-button strong {
  color: var(--tv-ink);
}

#view-technical .technical-adjustment-master-button b {
  color: var(--tv-accent);
  font-size: 0.9rem;
}

#view-technical .technical-adjustment-master-actions .btn {
  min-height: 34px;
  padding-inline: 0.62rem;
}

#view-technical .technical-adjustment-detail-editor {
  background: #ffffff;
  border-color: #dce7f2;
  box-shadow: var(--tv-shadow-soft);
}

#view-technical .technical-adjustment-editor-head {
  background: linear-gradient(135deg, #f8fbff, #ffffff);
  border: 1px solid #e0e9f2;
  border-radius: 8px;
  padding: 0.58rem 0.66rem;
}

#view-technical .technical-adjustment-editor-head strong {
  color: var(--tv-ink);
}

#view-technical .technical-adjustment-editor-head small {
  background: #ecfdf5;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  color: #0f766e;
  padding: 0.2rem 0.48rem;
}

#view-technical .technical-adjustment-formula {
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
  border-color: #c8dcf2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

#view-technical .technical-adjustment-hint {
  background: #f8fbff;
  border: 1px dashed #bfd0df;
  border-radius: 8px;
  color: #64748b;
  padding: 0.42rem 0.55rem;
}

#view-technical .technical-adjustment-flow-summary {
  background: linear-gradient(135deg, #f0fdfa, #ffffff);
  border-color: rgba(15, 118, 110, 0.28);
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.06);
}

#view-technical .technical-adjustment-flow-summary span {
  color: #0f766e;
}

#view-technical .technical-adjustment-flow-summary li {
  background: #ffffff;
  border: 1px solid rgba(15, 118, 110, 0.12);
  border-radius: 7px;
  padding: 0.34rem 0.46rem;
}

#view-technical .technical-version-dialog-actions {
  background: #ffffff;
  border-top-color: #dce7f2;
  box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.04);
}

@media (max-width: 760px) {
  #view-technical .technical-version-toolbar {
    padding: 0.62rem;
  }

  #view-technical .technical-version-detail-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  #view-technical .technical-version-detail-actions .btn,
  #view-technical .technical-current-version-body .btn,
  #view-technical .technical-adjustment-master-actions .btn,
  #view-technical .technical-adjustment-master-list > .btn {
    min-height: 44px;
  }

  #view-technical .technical-adjustment-master-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-technical .technical-adjustment-master-actions .btn {
    width: 100%;
  }

  #view-technical .technical-version-dialog {
    border-radius: 16px 16px 0 0;
  }

  #view-technical .technical-version-step-tabs button {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #view-technical .technical-versions-shell *,
  #view-technical .technical-version-modal * {
    transition-duration: 1ms !important;
  }
}
