/* /workspace.css */
/* Sistema Metro (ver DESIGN.md): señal blanca, texto negro y un color de línea por área.
   --line / --line-ink / --line-wash los fija cada área en .workspace-shell (workspace.js · LINES). */
:root {
  font-family: "Segoe UI Variable Text", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-feature-settings: "tnum" 1;
  color: var(--ink);
  background: var(--surface-1);
  font-synthesis: none;
  --ink: #1b1b1d;
  --ink-2: #4a4a50;
  --ink-3: #6e6e74;
  --surface-0: #ffffff;
  --surface-1: #f2f2f3;
  --surface-2: #f8f8f9;
  --rule: #dddde0;
  --rule-strong: #b8b8bd;
  /* Marca FricZero: azul marino de la barra y azul eléctrico del logotipo. */
  --shell: #0a1a36;
  --shell-2: #102449;
  --brand: #0066ff;
  --brand-ink: #0052cc;
  --brand-wash: #e6efff;
  /* Línea del sistema (Inicio y ajustes): azul de la marca. */
  --line: #0066ff;
  --line-ink: #0052cc;
  --line-wash: #e6efff;
  --line-fg: #ffffff;
  --accent: var(--line-ink);
  --accent-soft: color-mix(in srgb, var(--line) 40%, white);
  --wash: var(--line-wash);
  --ok: #12804a;
  --warn: #9a5b00;
  --bad: #c62828;
  --info: #24589c;
  --r-1: 4px;
  --r-2: 6px;
  --shadow: 0 6px 24px rgb(20 20 22 / 10%);
  /* Compatibilidad con estilos anteriores. */
  --blue: var(--accent);
  --navy: var(--ink);
  --muted: var(--ink-3);
  --soft: var(--surface-2);
  font-size: 14px;
}
::selection { background: color-mix(in srgb, var(--line) 28%, white); color: var(--ink); }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 320px;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button,
a,
input,
select,
textarea,
summary {
  outline-offset: 4px;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--accent-soft);
}
button {
  border: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 36px;
  letter-spacing: -1.25px;
  font-weight: 700;
  line-height: 1.16;
}
h2 {
  font-size: 22px;
  letter-spacing: -0.65px;
  line-height: 1.3;
}
h3 {
  font-size: 17px;
  line-height: 1.4;
}
p {
  color: var(--muted);
  line-height: 1.65;
}
small {
  font-size: 12px;
  color: var(--muted);
}
strong {
  font-weight: 600;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}
legend {
  padding: 0;
}
.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  vertical-align: middle;
}
button .icon {
  pointer-events: none;
}
/* Marcas de terceros (r21): relleno en su proporción; el contenedor pone el color de la marca. */
.icon.icon-brand {
  stroke: none;
}
.icon-brand .brand-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linejoin: round;
}
:root {
  --brand-whatsapp: #25d366;
  --brand-instagram: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  --brand-messenger: radial-gradient(circle at 20% 100%, #0099ff 0%, #a033ff 60%, #ff5280 90%, #ff7061 100%);
  --brand-meta: #0866ff;
}
.button {
  border-radius: var(--r-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 19px;
  font-weight: 600;
  font-size: 13px;
  min-height: 44px;
  /* r22: sin «levantar» al pasar el cursor (cientos de veces al día); la respuesta es al presionar (motion.css). */
  transition:
    background-color var(--fz-dur-fast, 160ms) var(--fz-ease-hover, ease),
    border-color var(--fz-dur-fast, 160ms) var(--fz-ease-hover, ease),
    color var(--fz-dur-fast, 160ms) var(--fz-ease-hover, ease),
    box-shadow var(--fz-dur-fast, 160ms) var(--fz-ease-hover, ease),
    transform var(--fz-dur-press, 120ms) var(--fz-ease-out, ease-out);
}
.primary {
  background: var(--blue);
  color: white;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 13%, transparent);
}
.primary:hover {
  background: var(--accent);
}
.secondary {
  background: var(--wash);
  color: var(--accent);
  border: 1px solid var(--rule);
}
.ghost {
  background: transparent;
  color: var(--ink-2);
}
.text-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 0;
}
.text-button .icon {
  width: 16px;
  height: 16px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-1);
  background: transparent;
  color: inherit;
  font-size: 23px;
}
.icon-button:hover {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
  color: #fff;
}
.brand > span {
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -1.4px;
  display: inline-flex;
  align-items: baseline;
}
.brand > span > span {
  color: var(--accent);
}
.brand small {
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-3);
  border: 1px solid var(--ink-2);
  padding: 3px 5px;
  margin-left: 8px;
  border-radius: 4px;
}
.brand img {
  object-fit: contain;
}
.eyebrow {
  display: block;
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 11px;
}
.eyebrow.light {
  color: var(--accent-soft);
}
.help {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.65;
  margin: 12px 0 20px;
}
.intro {
  font-size: 15px;
  margin: 14px 0 28px;
}
.spaced {
  margin-top: 28px;
  margin-bottom: 14px;
}
.full {
  grid-column: 1/-1;
}
.badge {
  display: inline-flex;
  align-items: center;
  white-space: nowrap; /* «1 impuesto» se partía en tres renglones en columnas angostas (E2E 2026-10-09) */
  gap: 5px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 600;
  margin: 2px;
  white-space: normal;
}
.badge.ready {
  background: #e9f7f2;
  color: #16856c;
}
.surface {
  background: var(--surface-0);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 27px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.surface > p {
  margin: 8px 0 18px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
}
.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
  min-width: 0;
}
.field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  line-height: 1.4;
}
.field input,
.field select,
.field textarea {
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 11px 12px;
  min-height: 43px;
  width: 100%;
  min-width: 0;
  background: var(--surface-0);
  color: var(--ink);
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--accent-soft);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 4%, transparent);
}
.field input[type="file"] {
  font-size: 11px;
  padding: 8px;
}
.field input::file-selector-button {
  border: 0;
  padding: 7px 9px;
  border-radius: 5px;
  background: var(--wash);
  color: var(--accent);
  margin-right: 8px;
  font: inherit;
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
}
.field-help {
  padding: 24px 0 16px;
  font-size: 13px;
  color: var(--accent);
}
.field-help small {
  display: block;
  margin-top: 5px;
}
.check-line {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
  color: var(--ink-2);
}
.check-line input {
  width: 17px;
  height: 17px;
  accent-color: var(--blue);
  flex: 0 0 auto;
}
.check-line small {
  margin-left: auto;
}
.roles-row {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.form-section {
  border: 1px solid var(--rule);
  padding: 20px;
  border-radius: var(--r-2);
  margin: 20px 0;
}
.form-section legend,
.form-section summary {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  padding: 0 5px;
}
.form-section summary {
  cursor: pointer;
  padding: 0 0 16px;
}
.form-section:not([open]) summary {
  padding-bottom: 0;
}
.form-section > .form-grid:last-child .field:nth-last-child(-n + 2) {
  margin-bottom: 4px;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.notice {
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--rule);
  background: var(--wash);
  padding: 20px 24px;
  border-radius: var(--r-2);
  margin: 22px 0;
}
.notice > .icon {
  color: var(--accent);
}
.notice > div {
  flex: 1;
}
.notice strong {
  font-size: 13px;
}
.notice p {
  font-size: 12px;
  margin-top: 4px;
}
.notice.compact {
  font-size: 12px;
  line-height: 1.6;
}
.success-note {
  padding: 14px;
  background: #eef8f3;
  color: #16856c;
  border-radius: var(--r-2);
  font-size: 12px;
}
.license-summary,
.csd-note {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  border: 1px solid var(--rule);
  margin: 24px 0;
}
.license-summary > .icon,
.csd-note > .icon {
  width: 26px;
  height: 26px;
  color: var(--accent);
}
.license-summary > div {
  flex: 1;
}
.license-summary span,
.license-summary strong {
  display: block;
}
.license-summary strong {
  font-size: 13px;
  margin-bottom: 5px;
}
.license-summary div > span {
  color: var(--ink-2);
  font-size: 12px;
}
.csd-note p {
  font-size: 12px;
  margin-top: 5px;
}
.review-box {
  display: grid;
  gap: 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 20px;
  background: var(--surface-2);
  margin-top: 24px;
}
.review-box span {
  font-size: 13px;
  color: var(--ink-2);
}
.review-box .icon {
  width: 15px;
  color: #16856c;
}
.onboarding {
  display: grid;
  grid-template-columns: minmax(350px, 0.85fr) minmax(0, 1.4fr);
  min-height: 100vh;
  background: var(--surface-0);
}
.welcome-story {
  background: var(--ink);
  position: relative;
  padding: 48px 48px 32px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.welcome-story:before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent), transparent 65%);
  bottom: -180px;
  left: -170px;
  pointer-events: none;
}
.welcome-story > .brand {
  position: relative;
  z-index: 1;
}
.welcome-copy {
  margin-top: 80px;
  z-index: 1;
}
.welcome-copy h1 {
  font-size: clamp(38px, 4.1vw, 60px);
  line-height: 1.1;
  letter-spacing: -2.5px;
  color: white;
}
.welcome-copy em {
  font-style: normal;
  color: var(--accent);
}
.welcome-copy p {
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1.8;
  margin-top: 25px;
}
.welcome-story .connection-art {
  margin: 15px -25px 15px;
  max-width: 460px;
  opacity: 0.93;
}
.welcome-story .art-label {
  display: none;
}
.story-footer {
  font-size: 10px;
  color: var(--ink-2);
  letter-spacing: 0.5px;
  margin-top: auto;
  z-index: 1;
}
.wizard-panel {
  padding: 42px clamp(24px, 5vw, 80px) 28px;
  min-width: 0;
}
.wizard-top {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font-size: 10px;
  letter-spacing: 1.4px;
  font-weight: 650;
  color: var(--ink-2);
}
.stepper {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0;
  margin: 36px 0 46px;
  gap: 8px;
}
.stepper li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-3);
  font-size: 11px;
  flex: 1;
  position: relative;
}
.stepper li:not(:last-child):after {
  content: "";
  width: 16px;
  min-width: 4px;
  flex: 1;
  height: 1px;
  background: var(--rule);
  margin-right: 7px;
}
.stepper i {
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  width: 25px;
  height: 25px;
  font-size: 10px;
  font-style: normal;
  flex: 0 0 auto;
}
.stepper .current {
  color: var(--accent);
  font-weight: 700;
}
.stepper .current i {
  color: white;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 4%, transparent);
}
.stepper .done {
  color: #16856c;
}
.stepper .done i {
  background: #eaf7f2;
  border-color: #c9eadd;
}
.wizard-content h2 {
  font-size: 30px;
  letter-spacing: -1px;
}
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  margin-top: 24px;
  gap: 16px;
}
.selection-count {
  display: flex;
  gap: 15px;
  justify-content: space-between;
  font-size: 12px;
  padding-bottom: 20px;
}
.selection-count strong {
  color: var(--ink-2);
  font-size: 10px;
}
.module-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.module-choice {
  border: 1px solid var(--rule);
  position: relative;
  border-radius: var(--r-2);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  transition:
    border-color var(--fz-dur-fast, 160ms) var(--fz-ease-hover, ease),
    background-color var(--fz-dur-fast, 160ms) var(--fz-ease-hover, ease),
    box-shadow var(--fz-dur-fast, 160ms) var(--fz-ease-hover, ease);
}
.module-choice input {
  position: absolute;
  top: 16px;
  right: 16px;
  accent-color: var(--accent);
}
.module-choice > strong {
  font-size: 15px;
}
.module-choice small {
  line-height: 1.5;
}
.module-choice.selected {
  border-color: var(--accent);
  background: var(--surface-2);
  box-shadow: 0 0 0 1px var(--accent);
}
.choice-check {
  display: none;
}
.module-order {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 25px 0;
}
.module-order > div {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 10px;
}
.module-order strong {
  flex: 1;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.module-order .icon {
  width: 17px;
  color: var(--accent);
}
.module-order .icon-button {
  font-size: 17px;
  width: 25px;
  height: 29px;
  flex: 0 0 auto;
}
.order-number {
  font-size: 11px;
  color: var(--ink-3);
}
.workspace-header {
  min-height: 80px;
  padding: 17px max(28px, calc((100vw - 1280px) / 2));
  background: var(--navy);
  display: flex;
  align-items: center;
  gap: 24px;
  color: white;
}
.brand-button {
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
}
.workspace-header .brand > span {
  font-size: 25px;
}
.workspace-header .brand img {
  width: 40px;
  height: 28px;
}
.header-divider {
  height: 30px;
  width: 1px;
  background: var(--ink);
  flex: 0 0 auto;
}
.company-switch {
  min-width: 0;
  max-width: 330px;
}
.company-switch > span {
  display: block;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 1.4px;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.company-switch select {
  border: 0;
  background: transparent;
  color: var(--surface-2);
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  min-width: 100px;
  max-width: 320px;
  text-overflow: ellipsis;
  padding: 1px 20px 1px 0;
}
.company-switch select option {
  color: var(--ink);
  background: var(--surface-0);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 17px;
  margin-left: auto;
}
.environment-dot {
  font-size: 10px;
  color: var(--ink-3);
  white-space: nowrap;
}
.environment-dot:before {
  content: "";
  width: 5px;
  height: 5px;
  background: #52cca1;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
}
.user-menu {
  background: var(--accent);
  color: var(--accent-soft);
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
}
.logout {
  color: var(--ink-3);
  font-size: 10px;
}
.nav-bar {
  padding: 0 max(28px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-0);
  border-bottom: 1px solid var(--rule);
  gap: 12px;
}
.nav-bar nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nav-bar nav > button {
  display: flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  color: var(--ink-2);
  padding: 20px 19px;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
}
.nav-bar nav > button:first-child {
  padding-left: 0;
  padding-right: 24px;
}
.nav-bar nav > button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.nav-bar nav > button:hover {
  color: var(--accent);
}
.nav-bar .icon {
  width: 17px;
  height: 17px;
}
.company-link {
  font-size: 11px;
}
.module-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 1336px;
  padding: 20px 28px 0;
  margin: auto;
}
.module-jump button {
  font-size: 11px;
  padding: 8px 12px;
  background: var(--surface-0);
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  color: var(--ink-2);
}
.module-jump .active {
  background: var(--wash);
  border-color: var(--accent-soft);
  color: var(--accent);
}
.workspace-main {
  max-width: 1336px;
  padding: 30px 28px 45px;
  margin: auto;
  min-height: calc(100vh - 225px);
  /* Navigation updates replace markup synchronously; replaying an entrance animation
     on every edit made the whole workspace appear to blink. */
}
.dashboard-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
  gap: 30px;
  padding: 25px 44px;
  background: linear-gradient(110deg, #fff 25%, var(--wash));
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  position: relative;
  overflow: hidden;
  min-height: 295px;
}
.dashboard-hero h1 {
  font-size: 47px;
  letter-spacing: -1.8px;
  margin-bottom: 14px;
}
.dashboard-hero h1 > span {
  color: var(--accent);
}
.dashboard-hero p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 22px;
}
.dashboard-hero .eyebrow {
  font-size: 9px;
  letter-spacing: 2.1px;
}
.connection-art {
  position: relative;
  max-width: 430px;
  width: 100%;
  margin: auto;
}
.connection-art > svg {
  display: block;
  width: 100%;
  height: auto;
}
.art-label {
  display: block;
  text-align: center;
  font-size: 10px;
  letter-spacing: 0.6px;
  color: var(--ink-2);
  margin-top: -4px;
}
.art-center {
  animation: levitate 5s ease-in-out infinite;
}
.art-node {
  animation: levitate 6s ease-in-out infinite;
}
.node-two {
  animation-delay: -1.5s;
}
.node-three {
  animation-delay: -3s;
}
.node-four {
  animation-delay: -4.5s;
}
.art-lines {
  animation: dash-flow 12s linear infinite;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 17px;
  margin: 24px 0 38px;
}
.stat-grid article {
  position: relative;
  background: var(--surface-0);
  border: 1px solid var(--rule);
  padding: 21px 22px;
  border-radius: var(--r-2);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.stat-grid article > .icon {
  position: absolute;
  right: 20px;
  top: 21px;
  color: var(--ink-3);
  width: 19px;
}
.stat-grid span {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 500;
  padding-right: 25px;
}
.stat-grid strong {
  font-size: 30px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.2;
}
.stat-grid small {
  font-size: 10px;
  color: var(--ink-3);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 0 20px;
}
.surface > .section-heading:first-child {
  margin-top: 0;
}
.section-heading h2 {
  font-size: 22px;
}
.section-heading p {
  font-size: 12px;
  margin-top: 5px;
}
.section-heading .eyebrow {
  font-size: 9px;
  margin-bottom: 7px;
}
.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.module-card {
  position: relative;
  cursor: pointer;
  text-align: left;
  background: var(--surface-0);
  border: 1px solid var(--rule);
  border-radius: 15px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition:
    transform var(--fz-dur-base, 200ms) var(--fz-ease-out, ease-out),
    box-shadow var(--fz-dur-base, 200ms) var(--fz-ease-hover, ease),
    border-color var(--fz-dur-base, 200ms) var(--fz-ease-hover, ease);
  overflow: hidden;
  color: var(--ink);
}
.module-card:after {
  content: "";
  width: 120px;
  height: 120px;
  border: 1px solid color-mix(in srgb, var(--accent) 2%, transparent);
  border-radius: 30px;
  position: absolute;
  right: -65px;
  top: 20px;
  transform: rotate(28deg);
  pointer-events: none;
}
.module-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  box-shadow: 0 15px 30px color-mix(in srgb, var(--ink) 6%, transparent);
}
.module-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
}
.module-card-top > .icon {
  width: 16px;
  color: var(--ink-3);
  transition: transform 0.2s;
}
.module-card:hover .module-card-top > .icon {
  transform: translateX(4px);
  color: var(--accent);
}
.module-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-2);
  background: var(--wash);
  color: var(--accent);
  flex: 0 0 auto;
}
.module-symbol .icon {
  width: 23px;
  height: 23px;
}
.module-card h3 {
  font-size: 17px;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.module-card p {
  font-size: 11px;
  line-height: 1.6;
  min-height: 35px;
  max-width: 260px;
}
.module-card-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-top: 19px;
  margin-top: 16px;
  border-top: 1px solid var(--rule);
  font-size: 10px;
  color: var(--ink-3);
}
.module-card-footer > span:first-child {
  color: var(--ink-2);
  font-weight: 600;
}
.tone-accounting .module-symbol,
.tone-accounting.module-symbol {
  background: var(--wash);
  color: var(--accent);
}
.tone-management .module-symbol,
.tone-management.module-symbol {
  background: #e9f7f4;
  color: #1a9e8b;
}
.tone-purchasing .module-symbol,
.tone-purchasing.module-symbol {
  background: #f0edff;
  color: #8970d9;
}
.tone-people .module-symbol,
.tone-people.module-symbol {
  background: #fff1ed;
  color: #d48069;
}
.tone-inventory .module-symbol,
.tone-inventory.module-symbol {
  background: var(--wash);
  color: var(--ink-2);
}
.tone-fiscal .module-symbol,
.tone-fiscal.module-symbol {
  background: #ecf8f3;
  color: #269a77;
}
.tone-logistics .module-symbol,
.tone-logistics.module-symbol {
  background: #fff6e9;
  color: #c29445;
}
.connection-panel {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 40px;
  padding: 35px 40px;
  margin-top: 32px;
  background: var(--wash);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
}
.connection-copy h2 {
  margin: 15px 0 10px;
}
.connection-copy p {
  font-size: 12px;
  max-width: 320px;
}
.connection-path {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  align-items: center;
  gap: 13px;
}
.connection-path > span {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  background: var(--surface-0);
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  font-size: 10px;
  font-weight: 600;
  min-width: 105px;
}
.connection-path > span > .icon {
  color: var(--accent);
  width: 26px;
  height: 26px;
}
.connection-path i {
  color: var(--ink-3);
  font-style: normal;
}
.connection-path > small {
  flex-basis: 100%;
  text-align: center;
  font-size: 9px;
  margin-top: 5px;
}
.page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 13px 0 29px;
}
.page-title p {
  font-size: 13px;
  margin-top: 11px;
}
.page-title h1 {
  font-size: 31px;
  letter-spacing: -1px;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 13px;
}
.shortcut-grid button {
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 15px;
  color: var(--ink);
}
.shortcut-grid button:hover {
  border-color: var(--accent-soft);
  background: var(--surface-2);
}
.shortcut-grid strong {
  font-size: 12px;
}
.shortcut-grid small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
}
.shortcut-grid small .icon {
  width: 14px;
}
.operation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}
.operation-card {
  display: flex;
  gap: 17px;
  align-items: center;
  text-align: left;
  background: var(--surface-0);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 22px;
  color: var(--ink);
}
.operation-card > div {
  flex: 1;
}
.operation-card strong {
  font-size: 13px;
  display: block;
}
.operation-card div > span {
  font-size: 11px;
  color: var(--ink-2);
  display: block;
  margin-top: 6px;
}
.operation-card > .icon {
  color: var(--ink-3);
}
.operation-card:hover {
  border-color: var(--accent-soft);
}
.catalog-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.catalog-tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--rule);
  background: var(--surface-0);
  border-radius: var(--r-2);
  padding: 11px 13px;
  font-size: 11px;
  color: var(--ink-2);
}
.catalog-tabs button > .icon {
  width: 16px;
  height: 16px;
}
.catalog-tabs button > span {
  font-size: 9px;
  background: var(--surface-2);
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 4px;
}
.catalog-tabs button.active {
  background: var(--wash);
  border-color: var(--accent-soft);
  color: var(--accent);
}
.catalog-surface {
  padding: 0;
  overflow: hidden;
}
.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  align-items: center;
  padding: 23px 26px;
  border-bottom: 1px solid var(--rule);
}
.catalog-toolbar h2 {
  font-size: 19px;
}
.catalog-toolbar div > span {
  font-size: 11px;
  color: var(--ink-2);
  display: block;
  margin-top: 6px;
}
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 9px 12px;
  background: var(--surface-2);
  min-width: 0;
  max-width: 350px;
  flex: 1;
}
.search-field > .icon {
  color: var(--ink-2);
  width: 16px;
  height: 16px;
}
.search-field input {
  border: 0;
  background: none;
  outline: none;
  font-size: 11px;
  min-width: 0;
  width: 100%;
  color: var(--ink-2);
}
.table-wrap {
  overflow: auto;
  max-width: 100%;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 600;
  padding: 15px 24px;
  background: var(--surface-2);
}
td {
  padding: 18px 24px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  overflow-wrap: anywhere;
}
td strong {
  display: block;
  font-size: 12px;
}
td small {
  display: block;
  font-size: 10px;
  margin-top: 5px;
}
tbody tr:hover {
  background: var(--surface-2);
}
.record-name {
  display: flex;
  align-items: center;
  gap: 12px;
}
.record-avatar {
  width: 37px;
  height: 37px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--wash);
  color: var(--ink-2);
  border-radius: var(--r-2);
  font-size: 11px;
  font-weight: 700;
  flex: 0 0 auto;
}
.empty-state {
  padding: 54px 25px;
  text-align: center;
}
.empty-state > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: 22px;
  margin-bottom: 20px;
}
.empty-state > span > .icon {
  width: 30px;
  height: 30px;
  color: var(--accent-soft);
}
.empty-state h3 {
  font-size: 16px;
  margin-bottom: 9px;
}
.empty-state p {
  font-size: 12px;
  max-width: 390px;
  margin: auto;
}
.two-column {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 22px;
  align-items: start;
}
.record-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.record-list article {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
}
.record-list article > div {
  flex: 1;
}
.record-list strong {
  font-size: 13px;
  display: block;
}
.record-list small {
  display: block;
  font-size: 11px;
  margin-top: 5px;
}
.record-list .text-button {
  font-size: 11px;
}
.record-dialog {
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 0;
  width: min(880px, calc(100vw - 32px));
  max-height: 90vh;
  box-shadow: 0 30px 100px color-mix(in srgb, var(--ink) 25%, transparent);
  color: var(--ink);
}
/* Sin desenfoque detrás del diálogo (r22-motion): con la CPU limitada 4× el desenfoque de toda la pantalla hacía perder ~11 de los
   14 cuadros de la entrada del diálogo; el fondo oscuro (metro.css) ya separa el diálogo. Plano, como el resto del sistema. */
.record-dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 60%, transparent);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 30px;
  border-bottom: 1px solid var(--rule);
}
.dialog-heading h2 {
  font-size: 24px;
}
.dialog-heading .eyebrow {
  margin-bottom: 5px;
  font-size: 9px;
}
.dialog-body {
  padding: 5px 30px 20px;
  max-height: calc(90vh - 180px);
  overflow: auto;
}
.dialog-footer {
  display: flex;
  align-items: center;
  gap: 15px;
  border-top: 1px solid var(--rule);
  padding: 17px 30px;
  background: var(--surface-2);
}
.dialog-footer > span {
  flex: 1;
  color: var(--ink-3);
  font-size: 10px;
}
.tax-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tax-options .check-line {
  background: var(--surface-2);
  border-radius: var(--r-1);
  padding: 12px;
  margin: 0;
}
.tax-options small {
  font-size: 9px;
}
.flow-step-editor {
  display: grid;
  grid-template-columns: 24px 1.5fr 1fr 1fr 28px;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 11px;
  background: var(--surface-2);
  margin: 10px 0;
}
.flow-step-editor .field {
  margin: 0;
}
.flow-step-editor .field > span {
  font-size: 10px;
}
.flow-step-editor .field input,
.flow-step-editor .field select {
  font-size: 12px;
}
.flows-list {
  display: grid;
  gap: 20px;
}
.workflow-track {
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin: 25px 0 30px;
}
.workflow-track li {
  position: relative;
  flex: 1;
  min-width: 145px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 20px;
}
.workflow-track li:after {
  content: "";
  position: absolute;
  top: 16px;
  left: 42px;
  right: 0;
  height: 1px;
  background: var(--surface-2);
}
.workflow-track li:last-child:after {
  display: none;
}
.step-node {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  color: var(--ink-3);
  font-size: 11px;
  margin-bottom: 8px;
}
.workflow-track strong {
  font-size: 12px;
}
.workflow-track small {
  font-size: 10px;
  line-height: 1.5;
}
.workflow-track .current .step-node {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 4%, transparent);
  border-color: var(--accent);
}
.workflow-track .completed .step-node {
  background: #e9f8f1;
  color: #1d9f77;
  border-color: #c7eddf;
}
.step-node > .icon {
  width: 15px;
}
.audit {
  margin-top: 22px;
  border-top: 1px solid var(--rule);
  padding-top: 17px;
  color: var(--ink-2);
}
.audit summary {
  font-size: 11px;
  cursor: pointer;
}
.audit p {
  font-size: 10px;
  margin-top: 10px;
}
.quote-row {
  padding: 16px 14px;
  text-align: left;
  border: 1px solid var(--rule);
  background: var(--surface-0);
  border-radius: var(--r-2);
  margin: 6px 0;
  color: var(--ink-2);
}
.quote-row.active {
  border-color: var(--accent-soft);
  background: var(--surface-2);
}
.quote-row strong {
  font-size: 11px;
}
.quote-row small {
  font-size: 11px;
  display: block;
  margin: 5px 0;
}
.quote-total {
  text-align: right;
}
.quote-total strong {
  font-size: 23px;
  display: block;
}
.quote-total small {
  font-size: 10px;
}
.quotes-layout {
  grid-template-columns: 0.75fr 1.4fr;
}
.planned-surface {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 30px;
}
.planned-surface h2 {
  margin: 15px 0;
}
.planned-surface p {
  font-size: 13px;
  margin-bottom: 22px;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  border-top: 1px solid var(--rule);
  padding: 24px max(28px, calc((100vw - 1280px) / 2));
  font-size: 9px;
  color: var(--ink-3);
}
footer i {
  font-style: normal;
  margin: 0 7px;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 8px);
  background: var(--ink);
  color: white;
  padding: 15px 22px;
  border-radius: var(--r-2);
  font-size: 13px;
  box-shadow: 0 10px 40px color-mix(in srgb, var(--ink) 19%, transparent);
  z-index: 1000;
  max-width: 90vw;
  opacity: 0;
  pointer-events: none;
  /* r22: sube 8 px y aparece (200 ms); se va más rápido (140 ms). Transiciones: un aviso nuevo retoma desde donde va. */
  transition:
    opacity var(--fz-dur-exit, 140ms) var(--fz-ease-out, ease-out),
    transform var(--fz-dur-exit, 140ms) var(--fz-ease-out, ease-out);
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
  transition-duration: var(--fz-dur-base, 200ms);
}
#toast.error {
  background: #983b42;
}
.loading,
.fatal {
  padding: 100px 30px;
  text-align: center;
}
.loading .icon {
  color: var(--accent);
  margin-right: 12px;
}
.fatal p {
  margin-top: 20px;
}
@keyframes levitate {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-7px);
  }
}
@keyframes dash-flow {
  to {
    stroke-dashoffset: -110;
  }
}
@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (min-width: 1600px) {
  .welcome-copy {
    margin-top: 105px;
  }
  .welcome-story .connection-art {
    margin: 25px auto;
  }
  .welcome-story {
    padding: 55px 65px;
  }
  .wizard-panel {
    padding-top: 55px;
  }
}
@media (max-width: 1100px) {
  .onboarding {
    grid-template-columns: 0.75fr 1.3fr;
  }
  .welcome-story {
    padding: 35px 28px;
  }
  .welcome-copy {
    margin-top: 65px;
  }
  .welcome-copy h1 {
    font-size: 43px;
  }
  .wizard-panel {
    padding: 32px;
  }
  .stepper li {
    flex-direction: column;
    align-items: flex-start;
  }
  .stepper li:after {
    display: none;
  }
  .module-order {
    grid-template-columns: 1fr;
  }
  .workspace-header {
    padding: 18px 25px;
    gap: 18px;
  }
  .environment-dot {
    display: none;
  }
  .nav-bar {
    padding: 0 25px;
  }
  .dashboard-hero {
    padding: 24px 30px;
    gap: 10px;
  }
  .dashboard-hero h1 {
    font-size: 40px;
  }
  .module-grid {
    gap: 13px;
  }
  .module-card {
    padding: 20px;
  }
  .connection-panel {
    padding: 28px;
  }
  .connection-path > span {
    padding: 16px 12px;
    min-width: 82px;
  }
  .flow-step-editor {
    grid-template-columns: 20px 1fr 1fr 28px;
  }
  .flow-step-editor .field:nth-of-type(1) {
    grid-column: 2/4;
  }
  .flow-step-editor > .icon-button {
    grid-column: 4;
    grid-row: 1/3;
  }
  .flow-step-editor > .order-number {
    grid-row: 1/3;
  }
  .flow-step-editor .field:nth-of-type(2) {
    grid-column: 2;
  }
}
@media (max-width: 800px) {
  .onboarding {
    display: block;
  }
  .welcome-story {
    min-height: 0;
    padding: 26px 28px;
  }
  .welcome-story .brand > span {
    font-size: 26px;
  }
  .welcome-copy {
    margin: 25px 0 0;
    max-width: 70%;
  }
  .welcome-copy h1 {
    font-size: 35px;
    letter-spacing: -1px;
  }
  .welcome-copy h1 br {
    display: none;
  }
  .welcome-copy p,
  .welcome-story .story-footer,
  .welcome-story .eyebrow {
    display: none;
  }
  .welcome-story .connection-art {
    position: absolute;
    right: 8px;
    bottom: 0;
    width: 190px;
    opacity: 0.4;
    margin: 0;
  }
  .wizard-panel {
    padding: 30px 25px;
  }
  .stepper {
    margin: 28px 0;
  }
  .wizard-content h2 {
    font-size: 26px;
  }
  .module-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dashboard-hero h1 {
    font-size: 36px;
  }
  .dashboard-hero .connection-art {
    max-width: 280px;
  }
  .dashboard-hero p {
    font-size: 12px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .workspace-main {
    padding: 23px 20px;
  }
  .workspace-header {
    gap: 14px;
    padding: 17px 20px;
  }
  .header-divider {
    display: none;
  }
  .workspace-header .brand > span {
    font-size: 21px;
  }
  .workspace-header .brand img {
    width: 32px;
  }
  .workspace-header .brand small {
    display: none;
  }
  .company-switch {
    max-width: 240px;
  }
  .header-actions {
    gap: 8px;
  }
  .header-actions > .icon-button,
  .logout {
    display: none;
  }
  .nav-bar {
    padding: 0 20px;
  }
  .nav-bar nav {
    gap: 0;
  }
  .nav-bar nav > button {
    padding: 18px 15px;
    font-size: 11px;
  }
  .nav-bar nav > button:first-child {
    padding-right: 20px;
  }
  .company-link {
    display: none;
  }
  .connection-panel,
  .two-column,
  .quotes-layout {
    grid-template-columns: 1fr;
  }
  .connection-panel {
    gap: 25px;
  }
  .connection-copy h2 br {
    display: none;
  }
  .connection-copy p {
    max-width: none;
  }
  .connection-path {
    justify-content: flex-start;
  }
  .page-title h1 {
    font-size: 27px;
  }
  .operation-grid {
    grid-template-columns: 1fr;
  }
  .catalog-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .search-field {
    width: 100%;
    max-width: none;
  }
  .form-grid.three {
    grid-template-columns: 1fr;
  }
  .planned-surface {
    grid-template-columns: 1fr;
  }
  .planned-surface .connection-art {
    max-width: 300px;
  }
  .record-dialog {
    max-height: 94vh;
  }
  .dialog-body {
    max-height: calc(94vh - 185px);
  }
}
@media (max-width: 520px) {
  .brand {
    gap: 8px;
  }
  .company-switch {
    max-width: 145px;
  }
  .company-switch > span {
    font-size: 6px;
    letter-spacing: 0.8px;
  }
  .company-switch select {
    font-size: 10px;
  }
  .workspace-header {
    gap: 14px;
    padding: 15px;
  }
  .workspace-header .brand > span {
    font-size: 20px;
  }
  .workspace-header .brand img {
    width: 28px;
  }
  .header-actions .user-menu {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
  .nav-bar {
    padding: 0 15px;
  }
  .nav-bar nav {
    width: 100%;
    justify-content: space-between;
  }
  .nav-bar nav > button,
  .nav-bar nav > button:first-child {
    padding: 16px 5px;
    font-size: 10px;
    gap: 6px;
  }
  .nav-bar .icon {
    width: 15px;
  }
  .workspace-main {
    padding: 18px 15px 30px;
  }
  .dashboard-hero {
    display: block;
    padding: 28px;
  }
  .dashboard-hero .connection-art {
    max-width: 250px;
    margin: 10px auto 0;
  }
  .dashboard-hero h1 {
    font-size: 37px;
  }
  .dashboard-hero .art-label {
    display: none;
  }
  .stat-grid {
    margin: 18px 0 28px;
  }
  .stat-grid article {
    padding: 17px 15px;
  }
  .stat-grid article > .icon {
    right: 14px;
    top: 17px;
    width: 16px;
  }
  .stat-grid span {
    font-size: 10px;
  }
  .stat-grid small {
    font-size: 9px;
  }
  .module-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .module-card {
    padding: 17px 14px;
  }
  .module-card h3 {
    font-size: 15px;
  }
  .module-card p {
    font-size: 10px;
    min-height: 48px;
  }
  .module-card-footer {
    font-size: 9px;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 13px;
    margin-top: 12px;
  }
  .module-card-top {
    margin-bottom: 13px;
  }
  .module-symbol {
    width: 37px;
    height: 37px;
    border-radius: var(--r-2);
  }
  .module-symbol .icon {
    width: 20px;
  }
  .section-heading h2 {
    font-size: 21px;
  }
  .section-heading .eyebrow {
    font-size: 8px;
  }
  .connection-panel {
    padding: 25px;
  }
  .connection-path > span {
    min-width: 0;
    padding: 16px 11px;
    font-size: 9px;
  }
  .connection-path {
    gap: 8px;
  }
  .connection-path > small {
    font-size: 8px;
  }
  .page-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
  }
  .page-title p {
    font-size: 12px;
  }
  .page-title .button {
    font-size: 11px;
  }
  .surface {
    padding: 20px;
  }
  .catalog-surface {
    padding: 0;
  }
  .catalog-tabs {
    gap: 6px;
  }
  .catalog-tabs button {
    padding: 9px 10px;
    font-size: 10px;
  }
  .catalog-tabs button > span {
    display: none;
  }
  .catalog-tabs button > .icon {
    width: 14px;
  }
  .catalog-toolbar {
    padding: 20px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-grid.three {
    grid-template-columns: 1fr;
  }
  .field-help {
    padding: 0 0 18px;
  }
  .form-section {
    padding: 17px;
  }
  .form-section > .form-grid:last-child .field:nth-last-child(-n + 2) {
    margin-bottom: 18px;
  }
  .roles-row {
    gap: 16px;
  }
  .dialog-heading {
    padding: 20px;
  }
  .dialog-body {
    padding: 0 16px 15px;
  }
  .dialog-footer {
    padding: 15px;
  }
  .dialog-footer > span {
    display: none;
  }
  .dialog-footer .button {
    flex: 1;
  }
  .tax-options {
    grid-template-columns: 1fr;
  }
  .workflow-track {
    flex-direction: column;
    gap: 15px;
  }
  .workflow-track li {
    padding: 0 0 15px 45px;
    min-height: 50px;
    max-width: none;
    min-width: 0;
  }
  .workflow-track .step-node {
    position: absolute;
    left: 0;
    top: 0;
  }
  .workflow-track li:after {
    left: 16px;
    top: 39px;
    width: 1px;
    height: calc(100% - 26px);
  }
  .workflow-track strong {
    margin-top: 5px;
  }
  .flow-step-editor {
    padding: 13px;
    gap: 10px;
    grid-template-columns: 15px 1fr 1fr 24px;
  }
  .flow-step-editor .field select {
    padding: 8px;
    font-size: 11px;
  }
  .notice {
    flex-wrap: wrap;
    padding: 18px;
  }
  .notice .button {
    margin-left: 36px;
  }
  .module-picker {
    grid-template-columns: 1fr;
  }
  .module-choice {
    padding: 18px;
  }
  .selection-count {
    flex-direction: column;
    gap: 7px;
  }
  .license-summary {
    flex-wrap: wrap;
    padding: 16px;
    gap: 12px;
  }
  .license-summary > div > span {
    font-size: 10px;
  }
  .stepper li {
    font-size: 9px;
    gap: 7px;
  }
  .stepper {
    gap: 5px;
  }
  .wizard-panel {
    padding: 26px 20px;
  }
  .wizard-top {
    font-size: 8px;
  }
  .welcome-copy h1 {
    font-size: 30px;
  }
  .welcome-copy {
    max-width: 80%;
  }
  .wizard-actions .button {
    font-size: 12px;
  }
  .wizard-content h2 {
    font-size: 25px;
  }
  .intro {
    font-size: 13px;
  }
  .csd-note {
    padding: 16px;
    align-items: flex-start;
  }
  footer {
    padding: 20px 15px;
    flex-direction: column;
    font-size: 8px;
    gap: 8px;
  }
}
.inline-error {
  padding: 14px 18px;
  margin: 0 0 18px;
  border: 1px solid #f2bcc4;
  border-radius: var(--r-2);
  background: #fff0f2;
  color: #91253b;
  font-size: 13px;
  line-height: 1.5;
}
.inline-error[hidden] {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Autorización de supervisor: aviso de PIN incorrecto dentro del mismo diálogo (E2E 2026-10-09). */
.fz-authorize .authorize-error { padding: 8px 10px; border-radius: 4px; font-size: 12px; margin: 8px 0 0; }

/* Conector MCP: misma superficie de trabajo en IA y Desarrolladores. */
.ai-connectors { scroll-margin-top:calc(var(--workspace-topbar-height,88px) + 16px); min-width:0; max-width:100%; padding:20px; margin:14px 0; border:1px solid var(--rule); border-radius:6px; background:var(--surface-0); color:var(--ink); }
.ai-connectors *, .ai-connectors *::before, .ai-connectors *::after { box-sizing:border-box; }
.ai-connectors p { max-width:75ch; margin:8px 0; line-height:1.5; overflow-wrap:anywhere; }
.ai-connect-head, .ai-connect-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; }
.ai-connect-head h2 { margin:0; font-size:17px; line-height:1.3; }
.ai-connect-head p { color:var(--ink-2); margin:6px 0 12px; }
.ai-connect-pilot { color:var(--info); background:var(--surface-2); border:1px solid var(--rule); padding:3px 8px; border-radius:4px; font-size:12px; white-space:nowrap; }
.ai-connect-url { display:flex; align-items:flex-end; gap:8px; margin:16px 0; }
.ai-connect-url label { min-width:0; flex:1; display:grid; gap:6px; font-weight:600; }
.ai-connect-url input, .ai-connect-client select { width:100%; min-width:0; padding:9px 10px; border:1px solid var(--rule-strong); border-radius:4px; background:var(--surface-0); color:var(--ink); font:inherit; }
.ai-connect-url input { font-family:ui-monospace,monospace; font-weight:400; }
.ai-connectors .button { min-height:40px; }
.ai-connect-guide { margin:16px 0; border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); padding:14px 0; }
.ai-connect-guide summary { cursor:pointer; font-weight:700; padding:4px 0; }
.ai-connect-client { display:grid; gap:6px; max-width:340px; margin:16px 0; font-weight:600; }
.ai-connect-guide ol { margin:12px 0; padding-left:24px; max-width:75ch; }
.ai-connect-guide li { margin:8px 0; line-height:1.5; }
.ai-connect-code { white-space:pre-wrap; overflow-wrap:anywhere; margin:10px 0; padding:12px; background:var(--surface-2); border:1px solid var(--rule); border-radius:4px; line-height:1.5; user-select:all; }
.ai-connect-boundary { margin:20px 0; }
.ai-connectors h3 { font-size:14px; margin:0 0 8px; }
.ai-connect-heading { align-items:center; margin-top:24px; }
.ai-connect-heading h3 { margin:0; }
.ai-connect-list { list-style:none; padding:0; margin:8px 0 16px; }
.ai-connect-list li { display:flex; gap:16px; justify-content:space-between; align-items:center; padding:14px 0; border-top:1px solid var(--rule); }
.ai-connect-list li>div { min-width:0; overflow-wrap:anywhere; }
.ai-connect-list p, .ai-connect-list small, .ai-connect-muted { color:var(--ink-2); }
.ai-connect-list p { margin:4px 0; }
.ai-connect-list .button { flex:none; }
.ai-connect-empty { padding:12px 0; }
.ai-connect-meter { border-top:1px solid var(--rule); padding-top:16px; font-variant-numeric:tabular-nums; }
.ai-connect-feedback:empty { display:none; }
.ai-connectors :focus-visible { outline:2px solid var(--line-ink,var(--brand)); outline-offset:3px; }
@media (max-width:600px) { .ai-connectors { padding:16px; } .ai-connect-url { flex-direction:column; align-items:stretch; } .ai-connect-list li { flex-direction:column; align-items:stretch; gap:8px; } .ai-connectors .button, .ai-connect-guide summary, .ai-connect-client select { min-height:44px; } }

.ai-connect-profile-entry { margin:0 0 16px; }
.ai-connect-profile-entry .button { min-height:44px; }

.ai-connect-drafts { margin-top:24px; }
.ai-connect-drafts details { border-top:1px solid var(--rule); padding:12px 0; }
.ai-connect-drafts summary { cursor:pointer; min-height:32px; overflow-wrap:anywhere; font-weight:600; }
.ai-connect-drafts pre { white-space:pre-wrap; overflow-wrap:anywhere; font:inherit; line-height:1.5; margin:12px 0; max-width:75ch; }
@media (max-width:600px) { .ai-connect-drafts summary { min-height:44px; } }

.ai-connectors [aria-label="Acciones desde tu IA"] .ai-connect-heading { flex-wrap:wrap; }

/* Conectar mi IA r34: se integra al sistema r33 sin modificar marcas ni navegación. */
.ai-connectors .ai-connect-current { margin:16px 0 24px; }
.ai-connect-provider-choices { display:flex; flex-wrap:wrap; gap:8px; margin:8px 0; max-width:640px; }
.ai-connectors .ai-connect-provider-choices .button { flex:1; min-width:140px; min-height:64px; display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:4px; font-size:16px; text-align:left; }
.ai-connect-provider-choices .button span { font-size:12px; font-weight:400; }
.ai-connectors .ai-connect-provider-choices [aria-pressed="true"] { color:var(--brand-ink); background:var(--brand-wash); border-color:var(--brand-ink); }
.ai-connect-others { margin:12px 0 24px; }
.ai-connectors summary { cursor:pointer; min-height:40px; padding:8px 0; }
.ai-connect-setup { border-top:1px solid var(--rule); padding-top:20px; }
.ai-connect-setup ol { max-width:75ch; padding-left:24px; }
.ai-connect-setup li { margin:10px 0; line-height:1.55; }
.ai-connect-open { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.ai-connect-open span { color:var(--ink-2); font-size:13px; }
.ai-connect-test { margin:24px 0; padding-top:20px; border-top:1px solid var(--rule); }
.ai-connect-test textarea { display:block; width:100%; max-width:75ch; min-height:120px; margin:12px 0; padding:12px; border:1px solid var(--rule-strong); border-radius:8px; background:var(--surface-2); color:var(--ink); font:inherit; line-height:1.5; resize:vertical; }
.ai-connect-company-row { margin:12px 0; padding:8px 0; }
.ai-connect-list .ai-connect-read-ok { color:var(--ok); font-weight:600; }
.ai-connect-revoke { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; flex:none; }
.ai-connect-advanced { margin-top:24px; border-top:1px solid var(--rule); }
.ai-connect-advanced>summary { font-weight:600; }
@media(max-width:600px) { .ai-connect-provider-choices { max-width:none; } .ai-connectors summary { min-height:44px; } .ai-connect-revoke { justify-content:flex-start; } .ai-connect-open { align-items:stretch; flex-direction:column; } }

/* Cuenta personal: una tarea por sección. */
.profile-page { max-width:1160px; margin:0; }
.profile-page .page-title { margin-bottom:20px; }
.profile-layout { display:grid; grid-template-columns:208px minmax(0,1fr); gap:24px; align-items:start; }
.profile-navigation { display:grid; gap:4px; }
.profile-navigation button { display:flex; align-items:center; gap:10px; min-height:44px; padding:10px 12px; border:0; border-radius:8px; background:transparent; color:var(--ink-2); text-align:left; font:inherit; font-weight:600; cursor:pointer; }
.profile-navigation button .icon { width:18px; height:18px; flex:0 0 auto; }
.profile-navigation button:hover { background:var(--surface-2); color:var(--ink); }
.profile-navigation button[aria-current="page"] { background:var(--line-wash); color:var(--line-text,var(--ink)); }
.profile-navigation button:focus-visible,.profile-avatar-trigger:focus-visible { outline:2px solid var(--line); outline-offset:3px; }
.profile-content { display:grid; gap:20px; min-width:0; }
.profile-content > .profile-panel { margin:0; max-width:none; }
.profile-content h2 { margin:0 0 16px; font-size:18px; }
.profile-content .profile-identity h2 { margin:0; font-size:22px; }
.profile-content form { display:grid; gap:16px; }
.profile-content .form-actions { margin:0; }
.profile-content .profile-identity { display:flex; align-items:center; gap:20px; margin:0 0 8px; }
.profile-avatar-controls { display:grid; gap:8px; justify-items:center; flex:0 0 auto; }
.profile-avatar-trigger { position:relative; width:88px; height:88px; padding:0; border:1px solid var(--rule-strong); border-radius:50%; background:var(--surface-2); color:var(--ink); cursor:pointer; }
.profile-avatar-picture { display:grid; place-items:center; width:100%; height:100%; border-radius:inherit; overflow:hidden; font-size:32px; font-weight:600; }
.profile-avatar-picture img { width:100%; height:100%; object-fit:cover; }
.profile-avatar-pencil { position:absolute; right:-2px; bottom:-2px; display:grid; place-items:center; width:30px; height:30px; background:var(--surface-0); border:1px solid var(--rule-strong); border-radius:50%; color:var(--ink); opacity:0; transition:opacity 140ms cubic-bezier(.16,1,.3,1); }
.profile-avatar-pencil .icon { width:15px; height:15px; }
.profile-avatar-trigger:hover .profile-avatar-pencil,.profile-avatar-trigger:focus-visible .profile-avatar-pencil { opacity:1; }
.profile-photo-help { margin:8px 0 0; color:var(--ink-2); font-size:12px; line-height:1.5; }
.profile-page .ai-connectors { margin:0; }
.profile-page .ai-connect-head h2 { margin-bottom:4px; }
@media(max-width:760px) {
 .profile-layout { grid-template-columns:minmax(0,1fr); gap:16px; }
 .profile-navigation { grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px 8px; border-bottom:1px solid var(--rule); padding-bottom:12px; }
 .profile-navigation button { padding:8px; font-size:13px; }
 .profile-content .profile-identity { align-items:flex-start; gap:16px; }
 .profile-avatar-trigger { width:72px; height:72px; }
 .profile-content .profile-identity h2 { font-size:20px; }
}
@media(hover:none) { .profile-avatar-pencil { opacity:1; } }
@media(prefers-reduced-motion:reduce) { .profile-avatar-pencil { transition:none; } }


/* /workbench.css */
.work-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  padding: 12px 4%;
  background: var(--surface-0);
  border-bottom: 1px solid var(--rule);
  min-height: 64px;
  overflow-x: visible;
  scrollbar-width: thin;
}
.workspace-topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--ink) 7%, transparent);
}
.page-title-heading { display: flex; align-items: center; gap: 10px; }
.section-favorite {
  width: 33px;
  height: 33px;
  flex: 0 0 33px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface-0);
  color: var(--ink-2);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}
.section-favorite[aria-pressed="true"] { color: #e9a726; background: #fff9e8; }
.section-favorite:hover, .section-favorite:focus-visible { border-color: var(--accent-soft); outline: 2px solid var(--rule); }
.work-tab-group {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  max-width: 100%;
  background: var(--surface-2);
}
.work-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 11px 12px;
  color: var(--ink-2);
  font-size: 12px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.work-tab .icon {
  width: 16px;
  min-width: 16px;
}
.work-tab-label {
  display: grid;
  gap: 1px;
  text-align: left;
}
.work-tab-label small {
  color: var(--ink-2);
  font-size: 10px;
  font-weight: 400;
  line-height: 1.15;
}
.work-tab.selected,
.work-tab-group.selected {
  background: var(--wash);
  color: var(--accent);
  border-color: var(--rule);
}
.work-tab-group.selected > .work-tab {
  color: var(--accent);
  font-weight: 700;
}
.tab-close {
  border: 0;
  background: transparent;
  font-size: 17px;
  color: var(--ink-2);
  padding: 6px 10px;
  border-radius: var(--r-1);
}
.tab-close:hover {
  background: var(--wash);
  color: var(--ink);
}
.launch-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  isolation: isolate;
  overflow: hidden;
  align-items: center;
  min-height: 260px;
  padding: 38px 48px;
  background: var(--ink);
  color: white;
  border-radius: 28px 8px 56px 8px;
  margin-bottom: 32px;
}
.launch-hero:before {
  content: "";
  position: absolute;
  z-index: -1;
  right: -60px;
  top: -130px;
  width: 480px;
  height: 500px;
  transform: rotate(34deg);
  background: linear-gradient(150deg, var(--ink), var(--accent));
  border-radius: 52px;
}
.launch-hero:after {
  content: "";
  position: absolute;
  z-index: -1;
  right: 20%;
  bottom: -210px;
  width: 350px;
  height: 350px;
  border: 1px solid color-mix(in srgb, var(--accent-soft) 27%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 45px color-mix(in srgb, var(--accent) 4%, transparent),
    0 0 0 90px color-mix(in srgb, var(--accent) 3%, transparent);
}
.launch-hero h1 {
  font-size: 45px;
  line-height: 1.1;
  margin: 18px 0 12px;
  letter-spacing: -1.7px;
}
.launch-hero h1 span {
  color: var(--accent-soft);
}
.launch-hero p {
  color: var(--ink-3);
  font-size: 15px;
}
.launch-company {
  margin-top: 25px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--rule);
  font-size: 12px;
}
.launch-company .icon {
  width: 16px;
}
.launch-art .connection-art {
  max-width: 340px;
  margin: auto;
}
.launch-art .art-label {
  color: var(--rule);
}
.favorites-section {
  margin: 30px 0 38px;
}
.quick-empty {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border: 1px dashed var(--rule);
  border-radius: var(--r-2);
  background: linear-gradient(110deg, var(--surface-2), var(--surface-2));
}
.quick-empty > .icon {
  background: var(--surface-0);
  color: var(--accent);
  padding: 12px;
  box-sizing: content-box;
  border-radius: 15px;
}
.quick-empty strong {
  font-size: 16px;
}
.quick-empty p {
  font-size: 12px;
  color: var(--ink-2);
  margin-bottom: 0;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 12px;
}
.quick-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--rule);
  background: var(--surface-0);
  border-radius: var(--r-2);
  overflow: hidden;
}
.quick-card > button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  text-align: left;
  padding: 18px;
  border: 0;
  background: none;
  flex: 1;
  color: var(--ink);
}
.quick-card > button > .icon {
  color: var(--accent);
  margin-bottom: 7px;
}
.quick-card small {
  color: var(--ink-2);
}
.quick-card > div {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--rule);
  padding: 3px 8px;
}
.quick-card > div > button {
  background: none;
  border: 0;
  padding: 6px;
  color: var(--ink-2);
}
.favorite-picker {
  margin-top: 18px;
}
.favorite-picker details {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}
.favorite-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}
.favorite-options button {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  border: 1px solid var(--rule);
  background: var(--surface-0);
  border-radius: var(--r-2);
  padding: 12px;
  color: var(--ink-2);
  font-size: 12px;
}
.favorite-options button[aria-pressed="true"] {
  border-color: var(--accent-soft);
  background: var(--surface-2);
}
.favorite-options span {
  font-size: 19px;
  color: var(--accent);
}
.settings-launch {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 23px 28px;
  text-align: left;
  color: var(--ink);
  background: var(--wash);
  margin-top: 28px;
}
.settings-launch > span {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}
.settings-launch small {
  color: var(--ink-2);
}
.module-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: -10px 0 25px;
  font-size: 12px;
  color: var(--ink-2);
}
.module-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.module-index a {
  font-size: 12px;
  text-decoration: none;
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-1);
  background: var(--surface-0);
  padding: 10px 16px;
}
.module-group {
  margin: 30px 0;
  scroll-margin-top: 18px;
}
.section-card {
  position: relative;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface-0);
  min-width: 0;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}
.section-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 22px color-mix(in srgb, var(--ink) 4%, transparent);
}
.section-open {
  padding: 22px;
  width: 100%;
  height: 100%;
  background: none;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  color: var(--ink);
}
.section-open strong {
  font-size: 16px;
  padding-right: 18px;
}
.section-open p {
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
  min-height: 40px;
  margin: 0 0 5px;
}
.section-open .badge {
  margin-top: auto;
}
.favorite-star {
  position: absolute;
  right: 14px;
  top: 15px;
  border: 0;
  background: none;
  font-size: 24px;
  color: var(--ink-3);
}
.favorite-star[aria-pressed="true"] {
  color: var(--accent);
}
.scope-sheet {
  max-width: 900px;
}
.scope-sheet h2 {
  margin: 22px 0;
}
.scope-list {
  list-style: none;
  padding: 0;
  margin: 20px 0 30px;
}
.scope-list li {
  display: flex;
  gap: 15px;
  align-items: center;
  padding: 17px 0;
  border-bottom: 1px solid var(--rule);
}
.scope-list li > .icon {
  color: var(--ink-3);
  width: 18px;
}
.scope-list li > span {
  flex: 1;
}
.scope-list small {
  color: var(--ink-3);
}
.inventory-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.brand-settings {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: center;
  gap: 40px;
}
.company-logo-preview {
  max-width: 220px;
  max-height: 180px;
  object-fit: contain;
  background: var(--surface-2);
  padding: 15px;
  border-radius: var(--r-2);
}
.company-logo-placeholder {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  height: 160px;
  background: var(--surface-2);
  border-radius: var(--r-2);
  color: var(--ink-2);
  font-size: 12px;
}
.template-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 22px;
}
.template-list {
  align-self: start;
  padding: 18px;
  max-height: 850px;
  overflow: auto;
}
.template-list > .button {
  width: 100%;
  margin-bottom: 15px;
}
.template-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  text-align: left;
  padding: 13px;
  border: 1px solid var(--rule);
  background: var(--surface-0);
  border-radius: var(--r-2);
  margin-bottom: 7px;
  color: var(--ink);
}
.template-row.selected {
  border-color: var(--accent);
  background: var(--surface-2);
}
.template-row small {
  color: var(--ink-2);
}
.token-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.token-list button {
  font:
    11px Consolas,
    monospace;
  padding: 8px;
  text-align: left;
  border: 0;
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: 6px;
  overflow-wrap: anywhere;
}
.template-code {
  font:
    12px/1.65 Consolas,
    monospace !important;
  min-height: 370px;
  resize: vertical;
  tab-size: 2;
  background: var(--surface-2) !important;
}
.preview-controls {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 25px 0;
  flex-wrap: wrap;
}
.preview-controls .field {
  flex: 1;
  min-width: 170px;
  margin: 0;
}
.document-preview {
  display: block;
  width: 100%;
  height: 620px;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface-0);
}
.version-list {
  padding: 12px;
  background: var(--surface-2);
  border-radius: var(--r-2);
  margin-bottom: 20px;
}
.version-list button {
  display: block;
  background: none;
  border: 0;
  color: var(--accent);
  padding: 9px;
}
.template-layout details {
  margin-bottom: 20px;
}
@media (max-width: 1000px) {
  .template-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .favorite-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .launch-hero {
    padding: 30px;
  }
  .launch-hero h1 {
    font-size: 36px;
  }
  .launch-art .connection-art {
    max-width: 290px;
  }
}
@media (max-width: 650px) {
  .work-tabs {
    padding: 10px 15px;
    gap: 6px;
  }
  .work-tab {
    font-size: 10px;
    padding: 9px 8px;
  }
  .work-tab .icon {
    width: 13px;
    min-width: 13px;
  }
  .tab-close {
    padding: 5px 7px;
  }
  .launch-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 30px;
    border-radius: 22px 6px 40px 6px;
  }
  .launch-hero:before {
    right: -230px;
  }
  .launch-hero h1 {
    font-size: 35px;
  }
  .launch-art {
    display: none;
  }
  .quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .quick-card > button {
    padding: 15px;
  }
  .quick-card strong {
    font-size: 13px;
  }
  .favorites-section .section-heading {
    flex-wrap: wrap;
    gap: 16px;
  }
  .favorites-section .section-heading > .button {
    font-size: 11px;
    padding: 10px;
  }
  .favorite-options {
    grid-template-columns: 1fr;
  }
  .module-summary {
    gap: 8px;
    font-size: 10px;
  }
  .module-index a {
    font-size: 11px;
    padding: 8px;
  }
  .section-open {
    padding: 19px;
  }
  .brand-settings {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .template-layout {
    grid-template-columns: 1fr;
  }
  .template-list {
    max-height: 280px;
  }
  .scope-list li {
    align-items: flex-start;
    font-size: 12px;
  }
  .document-preview {
    height: 500px;
  }
  .quick-empty {
    padding: 20px;
    gap: 12px;
  }
  .quick-empty strong {
    font-size: 14px;
  }
  .settings-launch {
    padding: 20px;
    gap: 13px;
  }
  .settings-launch small {
    font-size: 10px;
  }
  .inventory-actions .button {
    font-size: 11px;
    padding: 10px;
  }
  .module-card-footer {
    font-size: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .section-card {
    transition: none;
  }
  .section-card:hover {
    transform: none;
  }
}

/* Workbench refinement: trees, focused favorites, separate design/preview. */
[hidden] {
  display: none !important;
}
.page-title {
  flex-wrap: wrap;
  gap: 16px;
}
.page-title > div:first-child {
  flex: 1;
  min-width: 240px;
}
.section-favorite {
  white-space: nowrap;
}
.favorite-empty-star {
  font-size: 36px;
  color: var(--accent);
}
.module-tree {
  display: grid;
  gap: 22px;
  max-width: 1200px;
}
.tree-branch {
  background: var(--surface-0);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  overflow: hidden;
}
.tree-branch > summary {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  cursor: pointer;
  list-style: none;
  background: var(--surface-2);
}
.tree-branch > summary:after {
  content: "⌄";
  margin-left: auto;
}
.tree-branch:not([open]) > summary:after {
  content: "›";
}
.tree-branch > summary > span:last-of-type {
  font-size: 12px;
  color: var(--ink-2);
}
.tree-folder {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-2);
  background: var(--wash);
  color: var(--accent);
}
.tree-leaves {
  margin: 6px 24px 22px 42px;
  border-left: 2px solid var(--rule);
  padding-left: 22px;
}
.tree-leaf {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 16px;
  text-align: left;
  padding: 18px 12px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  color: var(--ink);
  border-radius: var(--r-1);
}
.tree-leaf:before {
  content: "";
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--wash);
  left: -22px;
}
.tree-leaf:hover {
  background: var(--surface-2);
}
.tree-leaf > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.tree-leaf strong {
  display: block;
  font-size: 15px;
}
.tree-leaf small {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
  font-size: 12px;
}
.leaf-icon {
  color: var(--accent);
}
.tree-leaf > .icon {
  width: 16px;
}
.tree-leaf .badge {
  white-space: nowrap;
}
.relation-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  max-height: 240px;
  overflow: auto;
}
/* Ajustes > Formatos: formato que se usa por documento (formatos base y propios). */
.studio-defaults {
  padding: 22px 28px;
  margin-bottom: 24px;
}
.studio-defaults h2 {
  font-size: 16px;
}
.studio-defaults select {
  min-width: 240px;
  max-width: 100%;
}
.studio-defaults .row-actions {
  white-space: nowrap;
}
.studio-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.studio-library {
  /* Oct 2026: antes era fija (sticky) con 75vh y barra propia; con muchos formatos atrapaba la rueda. Ahora fluye
     con la página. */
  padding: 22px;
}
.studio-library h2 {
  font-size: 16px;
}
.studio-canvas {
  min-width: 0;
  padding: 28px;
}
.studio-toolbar,
.rich-toolbar,
.studio-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 20px 0;
}
.studio-actions {
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.mode-switch {
  display: flex;
  background: var(--surface-2);
  border-radius: var(--r-2);
  padding: 4px;
}
.mode-switch button {
  padding: 9px 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.mode-switch button.selected {
  background: var(--surface-0);
  color: var(--accent);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--ink) 7%, transparent);
}
.rich-toolbar {
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  padding: 8px;
}
.rich-toolbar button {
  background: var(--surface-0);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 8px 11px;
  cursor: pointer;
}
.visual-paper {
  background: var(--surface-0);
  min-height: 650px;
  padding: 42px;
  border: 1px solid var(--rule);
  box-shadow: 0 10px 25px color-mix(in srgb, var(--ink) 4%, transparent);
  line-height: 1.6;
  overflow-wrap: anywhere;
  outline-color: var(--accent);
}
.visual-paper table {
  border-collapse: collapse;
  width: 100%;
}
.visual-paper td,
.visual-paper th {
  border: 1px dashed var(--rule-strong);
  min-width: 50px;
  padding: 10px;
}
.visual-paper img[data-logo] {
  display: block;
  width: 150px;
  height: 60px;
  background: var(--surface-2);
  border: 1px dashed var(--accent);
}
.template-code {
  min-height: 520px;
  font-family: Consolas, monospace !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
}
.preview-panel {
  margin-top: 30px;
  border-top: 1px solid var(--rule);
  padding-top: 24px;
}
.tags-dialog {
  border: 0;
  border-radius: var(--r-2);
  width: min(800px, 92vw);
  max-height: 85vh;
  box-shadow: 0 24px 90px color-mix(in srgb, var(--ink) 25%, transparent);
}
.tags-dialog::backdrop {
  background: color-mix(in srgb, var(--ink) 44%, transparent);
}
.tags-dialog .dialog-body {
  max-height: 65vh;
  overflow: auto;
}
.tags-dialog .token-list {
  /* Sin caja propia: el cuerpo del diálogo es el único que se desplaza (oct 2026). */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.tags-dialog .token-list button {
  text-align: left;
  font-family: monospace;
  padding: 12px;
}
.import-label {
  cursor: pointer;
}
.notification-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}
.notification-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}
.notification-item h3 {
  margin: 10px 0;
}
.notification-item small {
  color: var(--ink-2);
}
.rule-list article {
  display: flex;
  gap: 10px;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}
.rule-list article > div {
  flex: 1;
}
.rule-list small {
  display: block;
  margin-top: 5px;
  color: var(--ink-2);
}
.notification-layout form {
  margin-top: 30px;
}
@media (max-width: 900px) {
  .studio-layout,
  .notification-layout {
    grid-template-columns: 1fr;
  }
  .studio-library {
    position: static;
  }
  .studio-canvas {
    padding: 18px;
  }
  .visual-paper {
    padding: 22px;
  }
  .tree-leaf .badge {
    font-size: 10px;
  }
  .tree-leaves {
    margin-left: 24px;
    padding-left: 16px;
  }
  .tree-leaf {
    gap: 10px;
  }
  .tree-leaf small {
    font-size: 11px;
  }
}
.report-studio {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.report-library article {
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 8px;
}
.report-library small {
  color: var(--ink-2);
}
.report-schema {
  margin: 24px 0;
  padding: 20px;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
}
.report-schema summary {
  cursor: pointer;
  font-weight: 700;
}
.report-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 12px;
  max-height: 340px;
  overflow: auto;
  padding: 8px;
}
.report-source-grid > div {
  padding: 12px;
  border-radius: var(--r-2);
  background: var(--surface-2);
  min-width: 0;
}
.report-source-grid label {
  overflow-wrap: anywhere;
}
.report-columns {
  display: grid;
  gap: 5px;
  padding: 12px 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.report-param-row {
  display: grid;
  grid-template-columns: 1fr 1fr 120px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
}
.report-result {
  margin-top: 24px;
  min-width: 0;
}
.report-result td {
  max-width: 400px;
  overflow-wrap: anywhere;
  white-space: normal;
}
@media (max-width: 900px) {
  .report-studio {
    grid-template-columns: 1fr;
  }
  .report-param-row {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 540px) {
  .report-param-row {
    grid-template-columns: 1fr;
  }
}

.module-card-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.module-card-open .module-card-footer { display: flex; }
.drag-grip {
  margin-left: auto;
  color: var(--ink-3);
  cursor: grab;
  font-size: 20px;
  line-height: 1;
  user-select: none;
}
.card-order-actions { display: flex; justify-content: flex-end; gap: 4px; margin-top: 12px; }
.card-order-actions button {
  width: 31px; height: 28px; border: 1px solid var(--rule); border-radius: var(--r-1);
  background: var(--surface-2); color: var(--accent); cursor: pointer;
}
.dragging { opacity: .48; }
.drop-target { outline: 2px dashed var(--accent); outline-offset: 3px; }
.workspace-main.area-workspace {
  max-width: 1600px;
  display: grid;
  grid-template-columns: minmax(242px, 286px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.area-content { min-width: 0; }
.area-sidebar {
  position: sticky;
  top: calc(var(--workspace-topbar-height, 144px) + 12px);
  max-height: calc(100vh - var(--workspace-topbar-height, 144px) - 24px);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--r-2);
  background: var(--surface-0);
  box-shadow: 0 14px 36px color-mix(in srgb, var(--ink) 6%, transparent);
}
.area-sidebar-head { padding: 18px 18px 15px; border-bottom: 1px solid var(--rule); }
.area-back {
  border: 0; padding: 0 0 15px; background: transparent; color: var(--ink-2);
  font-size: 12px; font-weight: 700; cursor: pointer;
}
.area-sidebar-title { display: flex; gap: 11px; align-items: center; }
.area-sidebar-title .module-symbol { width: 39px; height: 39px; }
.area-sidebar-title small { display: block; color: var(--ink-3); font-size: 9px; letter-spacing: 1.4px; font-weight: 800; }
.area-sidebar-title strong { display: block; color: var(--ink); font-size: 18px; }
.area-nav { overflow: auto; padding: 12px 10px 22px; scrollbar-width: thin; }
.area-overview, .area-nav-row > button, .area-add {
  width: 100%; display: flex; align-items: center; gap: 9px;
  padding: 10px 11px; border: 0; border-radius: var(--r-2);
  background: transparent; color: var(--ink); text-align: left; cursor: pointer;
  font-size: 12px; font-weight: 650;
}
.area-overview:hover, .area-nav-row:hover, .area-add:hover { background: var(--surface-2); }
.area-overview.selected, .area-nav-row.selected { background: var(--wash); color: var(--accent); }
.area-overview .icon, .area-nav-row .icon, .area-add .icon { width: 17px; height: 17px; flex: 0 0 auto; }
.area-nav-group { border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 9px; }
.area-nav-group > summary {
  display: flex; align-items: center; gap: 8px; padding: 10px 8px;
  color: var(--ink-2); cursor: pointer; list-style: none; text-transform: uppercase;
  font-size: 10px; font-weight: 850; letter-spacing: .9px;
}
.area-nav-group > summary::-webkit-details-marker { display: none; }
.area-nav-group > summary .icon { width: 15px; height: 15px; color: var(--accent); }
.area-nav-group > summary small { margin-left: auto; font-size: 10px; color: var(--ink-3); }
.area-nav-list { padding-left: 8px; }
.area-nav-row { display: flex; align-items: center; border-radius: var(--r-2); }
.area-nav-row > button { min-width: 0; flex: 1; }
.area-nav-row > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-nav-row > .drag-grip { padding: 6px 7px 6px 0; font-size: 16px; }
.area-nav-row > .drag-grip:hover, .module-card .drag-grip:hover { color: var(--accent); }
.profile-panel { max-width: 860px; margin: 0 auto; padding: 32px; }
.profile-identity { display: flex; align-items: center; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.profile-identity h2 { margin: 0 0 4px; }
.profile-identity p { margin: 0 0 10px; color: var(--ink-2); }
.profile-avatar-large { width: 74px; height: 74px; flex: 0 0 74px; display: grid; place-items: center; border-radius: 22px; background: var(--wash); color: var(--accent); font-size: 30px; font-weight: 800; overflow: hidden; }
.profile-avatar-large img, .user-menu img { width: 100%; height: 100%; object-fit: cover; }
.profile-panel .form-section { border-top: 1px solid var(--rule); margin-top: 24px; padding-top: 20px; }
.header-settings .icon { width: 21px; height: 21px; }
.commercial-layout { display: grid; grid-template-columns: minmax(280px, 34%) minmax(0,1fr); gap: 18px; align-items: start; }
.commercial-editor-layout { display: block; }
.commercial-editor-layout:not(.commercial-new-layout) > .commercial-list,
.commercial-new-layout > .commercial-detail { display: none; }
.commercial-new-layout .commercial-list > :not(.commercial-create) { display: none; }
.commercial-editor-layout > .surface { width: 100%; }
.commercial-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 16px; }
.commercial-toolbar .button { min-height: 38px; }
.quote-commandbar { position: sticky; top: var(--workspace-topbar-height,110px); z-index: 30; padding: 12px; background: var(--surface,#fff); border: 1px solid var(--rule); border-radius: var(--r-2); box-shadow: 0 4px 16px color-mix(in srgb, var(--ink) 4%, transparent); }
.quote-workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(265px,290px); gap: 18px; align-items: start; }
.quote-workspace > .surface { min-width: 0; padding: 24px; }
/* Oct 2026: el panel lateral del documento ya no es una caja fija con su propia barra (medía ~80 % de la pantalla y se
   tragaba la rueda): fluye con la página, que es la que se desplaza. La barra de comandos sigue fija arriba. */
.quote-context { position: static; max-height: none; overflow: visible; }
.quote-context h2 { font-size: 19px; margin: 8px 0 16px; }
.quote-context form, .quote-context fieldset { display: grid; gap: 14px; }
.quote-context fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.quote-context .field { margin: 0; }
.quote-context-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.quote-context-actions .button { flex: 1; padding: 9px; }
.quote-context-summary { border-top: 1px solid var(--rule); margin-top: 22px; padding-top: 16px; }
.quote-context-summary div { margin-bottom: 14px; }
.quote-context dt { font-size: 11px; color: var(--ink-2); }
.quote-context dd { margin: 4px 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.quote-context dd small { display: block; margin-top: 4px; }
.quote-context-preview { padding: 14px; border: 1px solid var(--accent-soft); border-radius: var(--r-2); background: var(--surface-2); margin-bottom: 18px; }
.quote-context-preview[hidden] { display: none; }
.quote-context-preview > .icon-button { float: right; }
.quote-lines-panel .commercial-line-form { margin-top: 14px; padding: 18px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-2); }
.quote-lines-panel .commercial-line-form h3 { margin-top: 0; }
.quote-lines-panel td:last-child { white-space: nowrap; }
.quote-lines-panel td .icon-button { width: 28px; height: 30px; padding: 5px; display: inline-flex; }
.quote-lines-panel table { min-width: 480px; }
.quote-lines-panel .commercial-line-form .form-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
.quote-lines-panel .commercial-line-form .field:nth-child(1), .quote-lines-panel .commercial-line-form .field:nth-child(2) { grid-column: span 3; }
.quote-lines-panel .commercial-line-form .field:nth-child(n+3) { grid-column: span 2; }
.quote-picker { width: min(720px,calc(100vw - 32px)); }
@media (max-width:1100px) { .quote-workspace { grid-template-columns: 1fr; } .quote-context { position: static; max-height: none; } }
@media (max-width:620px) { .quote-workspace > .surface { padding: 16px; } .quote-lines-panel .commercial-line-form .form-grid { grid-template-columns: 1fr; } .quote-lines-panel .commercial-line-form .field:nth-child(n) { grid-column: auto; } }
@media print { .quote-workspace { display: block; } .quote-context { position: static; max-height: none; overflow: visible; } .quote-context form, .quote-context-actions, .quote-context-preview { display: none !important; } }
.commercial-selection-count { margin-left: auto; color: var(--ink-2); font-size: 12px; }
.commercial-grid-surface { padding: 0; overflow: hidden; }
.commercial-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 22px; border-bottom: 1px solid var(--rule); }
.commercial-filterbar > strong { margin-right: auto; color: var(--ink); }
.commercial-filterbar .field { margin: 0; min-width: 190px; }
.commercial-filterbar input, .commercial-filterbar select { min-height: 38px; }
.commercial-grid tr[data-commercial-row] { cursor: pointer; }
.commercial-grid tr[data-commercial-row].selected { background: var(--wash); }
.commercial-grid tr[data-commercial-row]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.commercial-grid th:first-child, .commercial-grid td:first-child { width: 46px; padding-right: 0; }
.commercial-grid input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.commercial-layout > .surface { min-width: 0; padding: 25px; }
.commercial-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; margin: 0 0 20px; }
.commercial-stats > div { padding: 16px 19px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); }
.commercial-stats small { display: block; color: var(--ink-2); font-weight: 700; }
.commercial-stats strong { display: block; margin-top: 6px; font-size: 26px; color: var(--ink); }
/* Va dentro del diálogo «Abrir cotización»: solo el cuerpo del diálogo se desplaza (sin una segunda caja anidada). */
.commercial-records { display: grid; gap: 7px; margin-top: 16px; }
.commercial-record { display: flex; justify-content: space-between; gap: 14px; width: 100%; border: 1px solid var(--rule); border-radius: 11px; background: var(--surface-0); padding: 13px 14px; color: var(--ink); text-align: left; cursor: pointer; }
.commercial-record[hidden] { display: none; }
.commercial-report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-top: 18px; }
.commercial-report-grid .surface { padding: 24px; }
.commercial-report-wide { grid-column: 1 / -1; }
.commercial-bar-row { display: grid; grid-template-columns: 125px 1fr 28px; align-items: center; gap: 12px; margin: 14px 0; font-size: 13px; }
.commercial-bar-track { height: 12px; background: var(--wash); border-radius: 99px; overflow: hidden; }
.commercial-bar { height: 100%; border-radius: inherit; background: linear-gradient(90deg,var(--accent),var(--accent)); min-width: 2px; }
.commercial-bar-lost { background: #aa4652; }
.commercial-bar-won { background: #1b9d80; }
.commercial-status-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.commercial-status-grid div { display: flex; justify-content: space-between; gap: 12px; padding: 12px; border-radius: var(--r-2); background: var(--surface-2); color: var(--ink-2); }
.commercial-status-grid strong { color: var(--ink); }
.commercial-report-note { margin: 18px 0 0; }
@media (max-width: 900px) { .commercial-report-grid { grid-template-columns: 1fr; } }
.commercial-record:hover, .commercial-record.selected { background: var(--surface-2); border-color: var(--accent-soft); }
.commercial-record strong, .commercial-record small { display: block; }
.commercial-record small { margin-top: 4px; color: var(--ink-2); }
.commercial-record-side { text-align: right; white-space: nowrap; }
.commercial-detail .form-grid { margin: 16px 0; }
.commercial-detail .section-heading h2 small { display: block; margin-top: 5px; font-size: 12px; color: var(--ink-2); }
.commercial-linked, .commercial-line-form, .commercial-history, .commercial-edit { border-top: 1px solid var(--rule); margin-top: 24px; padding-top: 20px; }
.commercial-link { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px; margin: 7px 0; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-2); text-align: left; color: var(--accent); cursor: pointer; }
.commercial-link .icon { margin-left: auto; width: 15px; }
.commercial-create { border-bottom: 1px solid var(--rule); padding-bottom: 17px; margin-bottom: 21px; }
.commercial-create > summary, .commercial-edit > summary, .commercial-history > summary { cursor: pointer; color: var(--accent); font-weight: 750; }
.commercial-create form { display: grid; gap: 12px; margin-top: 15px; }
.commercial-create form > .button { justify-self: start; }
.commercial-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 9px; margin: 17px 0; }
.commercial-meta span { padding: 12px; background: var(--surface-2); border-radius: var(--r-2); color: var(--ink-2); font-size: 12px; }
.commercial-meta strong { display: block; margin-bottom: 5px; color: var(--ink); }
.commercial-lines-title { margin-top: 25px; }
.commercial-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }
.commercial-history p { margin: 9px 0; color: var(--ink-2); font-size: 12px; }
.commercial-note { white-space: pre-wrap; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-1); background: var(--surface-2); }
@media (max-width: 1050px) { .commercial-layout { grid-template-columns: 1fr; } }
@media print {
  .workspace-topbar, .area-sidebar, .commercial-toolbar, .page-title .section-favorite, .commercial-actions, .commercial-line-form, .commercial-edit, footer { display: none !important; }
  .workspace-main.area-workspace { display: block; max-width: none; padding: 0; }
  .commercial-detail { border: 0; box-shadow: none; padding: 0; }
}
@media (max-width: 620px) { .commercial-stats { grid-template-columns: repeat(2,minmax(0,1fr)); } .commercial-meta { grid-template-columns: 1fr; } }
.parameter-dialog { width: min(780px, calc(100vw - 28px)); }
.parameter-tabs { display: flex; gap: 6px; padding: 13px 26px 0; overflow-x: auto; border-bottom: 1px solid var(--rule); }
.parameter-tabs button { border: 0; background: transparent; padding: 11px 14px; color: var(--ink-2); font-weight: 700; cursor: pointer; white-space: nowrap; }
.parameter-tabs button[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -3px var(--accent); }
.parameter-dialog .dialog-body { padding-top: 22px; }
.parameter-note { padding: 16px; margin: 0 0 18px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-2); color: var(--ink-2); line-height: 1.6; }
.parameter-list { display: grid; gap: 8px; margin: 16px 0 22px; max-height: 200px; overflow: auto; }
.parameter-list button { display: flex; justify-content: space-between; gap: 12px; text-align: left; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); color: var(--ink); cursor: pointer; }
.parameter-list button:hover { border-color: var(--accent); background: var(--surface-2); }
.parameter-list small { color: var(--ink-2); }
.parameter-dialog h3 { margin: 0 0 13px; color: var(--ink); }
.area-folder { margin: 4px 0; border-left: 2px solid var(--rule); padding-left: 7px; }
.area-folder > summary { display: flex; align-items: center; gap: 7px; padding: 10px 7px; cursor: pointer; color: var(--ink); font-size: 12px; list-style: none; }
.area-folder > summary .icon { width: 16px; height: 16px; color: var(--accent); }
.area-folder > summary .drag-grip { font-size: 15px; }
.area-folder-children { margin-left: 7px; border-left: 1px solid var(--rule); padding-left: 5px; }
.area-add { color: var(--accent); font-size: 11px; }
.area-sidebar-foot { padding: 12px 18px; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: 10px; }
.area-welcome { position: relative; overflow: hidden; min-height: 360px; padding: 48px; background: linear-gradient(125deg,#fff 55%,var(--wash)); }
.area-welcome h2 { margin: 10px 0 12px; color: var(--ink); font-size: clamp(32px,4vw,49px); }
.area-welcome p { max-width: 540px; color: var(--ink-2); line-height: 1.65; }
.area-welcome-symbol { position: absolute; right: -16px; bottom: -25px; color: color-mix(in srgb, var(--accent) 7%, transparent); }
.area-welcome-symbol .icon { width: 260px; height: 260px; }
.area-welcome-count { display: flex; align-items: center; gap: 10px; margin: 22px 0 26px; color: var(--ink-2); font-size: 11px; }
.area-welcome-count strong { color: var(--accent); font-size: 24px; }
.custom-catalog .table-wrap { margin: 20px 0 32px; }
.custom-catalog-form { border-top: 1px solid var(--rule); padding-top: 26px; }
@media (max-width: 900px) {
  .workspace-main.area-workspace { display: block; }
  /* Apilado sobre el contenido: sin altura máxima ni barra propia (ver «Desplazamiento» al final de metro.css). */
  .area-sidebar { position: relative; top: auto; max-height: none; margin-bottom: 22px; }
  .area-welcome { min-height: 300px; padding: 30px; }
}


/* /commercial.css */
/* Área Comercial: barra de comandos, fichas de documento y captura de conceptos. */

/* ---- barra de comandos ---- */
.area-content { container-type: inline-size; container-name: area; }
.cmd-group { display: inline-flex; flex-wrap: nowrap; align-items: center; gap: 4px; }
@container area (max-width: 860px) {
  .cmdbar .cmd:not(.cmd-primary) > span { display: none; }
  .cmdbar .cmd:not(.cmd-primary) { padding: 0 10px; }
  .cmdbar .cmd-more > summary > span { display: inline; }
  .cmdbar .commercial-selection-count { display: none; }
}
@container area (max-width: 640px) {
  .cmdbar .cmd-primary > span { display: none; }
}
.cmdbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 8px 10px; }
.cmd { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px; border-radius: var(--r-2); background: transparent; color: var(--ink); font-weight: 600; font-size: 13px; border: 1px solid transparent; transition: background .15s, color .15s, border-color .15s, transform .15s, box-shadow .15s; white-space: nowrap; }
.cmd .icon { width: 18px; height: 18px; color: var(--accent); transition: transform .2s; }
.cmd:hover:not(:disabled) { background: var(--surface-2); border-color: var(--rule); color: var(--accent); }
.cmd:hover:not(:disabled) .icon { transform: scale(1.12); }
.cmd[data-commercial-share="whatsapp"] .icon { color: #1fa855; }
.cmd .icon { display: block; }
.cmd-primary { background: linear-gradient(180deg,var(--accent),var(--accent)); color: #fff; box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 20%, transparent); }
.cmd-primary .icon { color: #fff; }
.cmd-primary:hover:not(:disabled) { background: linear-gradient(180deg,var(--accent),var(--accent)); color: #fff; border-color: transparent; box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 25%, transparent); }
.cmd-danger, .cmd-danger .icon { color: #c62828; }
.cmd-danger:hover:not(:disabled) { background: #fdecec; border-color: #f6caca; color: #a61b1b; }
.cmd:disabled { opacity: .38; }
.cmd-sep { width: 1px; align-self: stretch; margin: 4px 6px; background: var(--surface-2); }
.cmdbar .commercial-selection-count { margin-left: auto; color: var(--ink-2); font-size: 12px; padding-right: 4px; }
.cmd-more { position: relative; margin-left: auto; }
.cmd-more > summary { list-style: none; cursor: pointer; }
.cmd-more > summary::-webkit-details-marker { display: none; }
.cmd-more[open] > summary { background: var(--surface-2); border-color: var(--rule); }
.cmd-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 230px; padding: 6px; background: var(--surface-0); border: 1px solid var(--rule); border-radius: var(--r-2); box-shadow: 0 16px 40px color-mix(in srgb, var(--ink) 15%, transparent); animation: fz-pop .14s ease-out; }
.cmd-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: var(--r-1); background: none; color: var(--ink); font-weight: 500; text-align: left; }
.cmd-menu button .icon { width: 18px; height: 18px; color: var(--accent); }
.cmd-menu button:hover { background: var(--surface-2); }
.cmd-menu button.danger, .cmd-menu button.danger .icon { color: #c62828; }
@keyframes fz-pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---- estados ---- */
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-draft { background: var(--surface-2); color: var(--ink-2); }
.st-info { background: var(--wash); color: var(--accent); }
.st-warn { background: #fff4e0; color: #b26a00; }
.st-ok { background: #e6f7ee; color: #12804a; }
.st-bad { background: #fdecec; color: #c62828; }

/* ---- listas ---- */
.commercial-filterbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 18px; }
.commercial-filterbar > strong { align-self: center; color: var(--ink-2); font-size: 13px; }
.commercial-filterbar .search-field { flex: 1 1 260px; max-width: 420px; }
.field.compact { margin: 0; min-width: 160px; }
.commercial-grid td small { display: block; color: var(--ink-2); }
.commercial-grid th, .commercial-grid td { white-space: nowrap; }
.commercial-grid td:nth-child(3) { white-space: normal; min-width: 180px; }
.commercial-grid tbody tr { cursor: pointer; transition: background .12s; }
.commercial-grid tbody tr:hover { background: var(--surface-2); }
.commercial-grid tbody tr.selected { background: var(--wash); }
.commercial-grid .col-check { width: 40px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
.mini-progress { display: inline-block; width: 64px; height: 6px; margin-left: 8px; vertical-align: middle; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.mini-progress i { display: block; height: 100%; background: linear-gradient(90deg,#20b26b,#12804a); border-radius: 4px; }

/* ---- ficha de documento ---- */
.doc-layout { display: grid; grid-template-columns: minmax(0,1fr) minmax(260px,300px); gap: 18px; align-items: start; }
.doc-main { min-width: 0; padding: 24px; }
.doc-side { padding: 20px; display: grid; gap: 14px; align-content: start; }
.doc-side h3 { margin: 6px 0 0; font-size: 15px; }
.doc-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.doc-header h2 { margin: 4px 0 6px; font-size: 22px; }
.doc-header p { margin: 0; }
.doc-total { display: grid; justify-items: end; gap: 6px; text-align: right; }
.doc-total small { color: var(--ink-2); }
.doc-total strong { font-size: 26px; letter-spacing: -.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.link-button { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: none; color: var(--accent); font-weight: 600; }
.link-button .icon { width: 16px; height: 16px; }
.link-button:hover { text-decoration: underline; }
.doc-flow { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.doc-flow-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.doc-steps { display: flex; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.doc-steps li { position: relative; padding: 6px 14px 6px 26px; font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); margin-right: -6px; }
.doc-steps li:first-child { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%); padding-left: 14px; }
.doc-steps li.done { background: #dff3e8; color: #12804a; }
.doc-steps li.current { background: var(--accent); color: #fff; }
.related-docs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 0; }
.related-docs > span { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 12px; font-weight: 600; }
.related-docs .icon { width: 16px; height: 16px; }
.related-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--rule); color: var(--accent); font-size: 12px; font-weight: 600; transition: background .15s, transform .15s; }
.related-chip:hover { background: var(--wash); transform: translateY(-1px); }
.related-chip .icon { width: 15px; height: 15px; color: var(--accent); }
.doc-totals { display: grid; justify-content: end; gap: 6px; margin-top: 14px; }
.doc-totals div { display: flex; justify-content: space-between; gap: 40px; min-width: 300px; color: var(--ink-2); }
.doc-totals strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.doc-totals .grand { padding-top: 8px; border-top: 2px solid var(--ink); font-size: 16px; color: var(--ink); }
.doc-totals .grand strong { font-size: 18px; }

/* ---- tarjetas de cliente / empresa ---- */
.party-card { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r-2); background: linear-gradient(180deg,var(--surface-2),var(--surface-2)); }
.party-card-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.party-card-top > div { min-width: 0; }
.party-card strong { display: block; color: var(--ink); line-height: 1.3; }
.party-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.party-card-actions { display: flex; gap: 4px; border-top: 1px solid var(--rule); padding-top: 6px; }
.party-card-actions .cmd { min-height: 30px; padding: 0 8px; font-size: 12px; }
.record-avatar.company { color: var(--accent); }
.linked-list { display: grid; gap: 8px; }
.linked-item { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; text-align: left; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); }
.linked-item:hover { border-color: var(--accent-soft); background: var(--surface-2); }
.linked-item small { display: block; }
.linked-item > span:last-child { display: grid; justify-items: end; gap: 4px; }

/* ---- captura de conceptos ---- */
.doc-main { container-type: inline-size; }
.quote-lines-panel .commercial-line-form.line-entry .line-entry-grid > * { grid-column: auto; }
@container (max-width: 860px) {
  .quote-lines-panel .commercial-line-form.line-entry .line-entry-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .quote-lines-panel .commercial-line-form.line-entry .line-entry-grid > .line-concept,
  .quote-lines-panel .commercial-line-form.line-entry .line-entry-grid > .line-entry-actions { grid-column: 1 / -1; }
  .line-entry-actions { justify-content: flex-end; }
}
@container (max-width: 480px) { .quote-lines-panel .commercial-line-form.line-entry .line-entry-grid { grid-template-columns: 1fr 1fr; } }
.line-entry { margin: 16px 0 6px; padding: 16px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-2); }
.line-entry-grid { display: grid; grid-template-columns: minmax(240px,3fr) minmax(80px,.8fr) minmax(90px,1fr) minmax(110px,1.1fr) minmax(80px,.7fr) auto; gap: 10px; align-items: end; }
.line-entry .field { margin: 0; }
.line-entry-actions { display: flex; gap: 6px; }
.line-entry-actions .button { min-height: 42px; }
.line-entry input[readonly] { background: var(--surface-2); color: var(--ink-2); }
.line-link { display: flex; align-items: center; gap: 4px; min-height: 16px; margin-top: 4px; color: var(--ink-2); }
.line-link .icon { width: 14px; height: 14px; color: #12804a; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 60; left: 0; right: 0; top: calc(100% + 4px); max-height: min(320px, 50vh); overflow-y: auto; overscroll-behavior: contain; padding: 6px; background: var(--surface-0); border: 1px solid var(--rule); border-radius: var(--r-2); box-shadow: 0 18px 40px color-mix(in srgb, var(--ink) 16%, transparent); animation: fz-drop .12s ease-out; }
.combo-list[hidden] { display: none; }
.combo-option { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 10px; border-radius: var(--r-1); background: none; color: var(--ink); text-align: left; }
.combo-option small { display: block; color: var(--ink-2); }
.combo-option b { font-variant-numeric: tabular-nums; color: var(--ink); }
.combo-option.active, .combo-option:hover { background: var(--wash); }
.combo-option .icon { width: 16px; height: 16px; color: var(--accent); }
.combo-free, .combo-create { justify-content: flex-start; border-top: 1px dashed var(--rule); border-radius: 0 0 8px 8px; color: var(--accent); font-weight: 600; }
.combo-empty { margin: 6px 8px; font-size: 12px; }
.lines-grid td small { display: block; color: var(--ink-2); }
.lines-grid th, .lines-grid td { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
/* Solo la descripción se ensancha: el importe (num con <strong>) medía 200 px y la columna salía cortada a 1366 px (E2E 2026-10-09). */
.lines-grid td:not(.num):has(> strong) { white-space: normal; min-width: 200px; }
.lines-grid tr.editing { background: #fff8e6; }
.lines-grid .pending { color: #b26a00; font-weight: 600; }
.tag-free { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #fff4e0; color: #9a5b00; font-size: 11px; font-weight: 700; white-space: nowrap; }
.row-actions { white-space: nowrap; }
.icon-button.danger:hover { color: #c62828; background: #fdecec; }
.qty-input { width: 110px; text-align: right; }
.field-with-action { display: flex; align-items: end; gap: 6px; }
.field-with-action .field { flex: 1; margin: 0; }
.field-with-action .icon-button { height: 44px; width: 44px; flex: 0 0 auto; border: 1px solid var(--rule); background: var(--wash); color: var(--accent); }

/* ---- botones y diálogos ---- */
.button.danger { background: var(--bad); color: #fff; box-shadow: none; }
.button.danger:hover { background: #b71c1c; }
.fz-confirm { max-width: 480px; }
.fz-confirm .dialog-body h2 { margin-bottom: 8px; }
.fz-confirm .dialog-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dialog-heading-actions { display: flex; align-items: center; gap: 8px; }
.record-view .dialog-body h4 { margin: 18px 0 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.record-summary-head { display: flex; align-items: center; gap: 14px; padding-bottom: 6px; }
.record-summary-head h3 { margin: 0 0 2px; font-size: 19px; }
.record-summary-head .badge { margin: 6px 6px 0 0; }
.record-summary-head .record-avatar { width: 52px; height: 52px; font-size: 18px; }
.record-price { margin-left: auto; font-size: 20px; color: var(--ink); }
.record-summary { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 12px 20px; margin: 0; padding: 14px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-2); }
.record-summary dt { font-size: 11px; color: var(--ink-2); }
.record-summary dd { margin: 3px 0 0; color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
.record-summary .wide { grid-column: 1 / -1; }
.record-notes { white-space: pre-wrap; }
.sat-hint { display: block; margin-top: 4px; color: #12804a; font-size: 12px; min-height: 14px; }
.sat-hint.warning { color: #b26a00; }
.sat-suggest { top: calc(100% + 2px); min-width: 320px; }

/* ---- edición directa en la tabla ---- */
.cell-input { width: 100%; min-width: 64px; max-width: 120px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; background: var(--surface-2); text-align: right; font: inherit; color: var(--ink); transition: border-color .15s, background .15s; }
.cell-input:hover { border-color: var(--rule); }
.cell-input:focus { border-color: var(--accent); background: var(--surface-0); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent); }
.line-desc { cursor: zoom-in; }
.line-desc:hover strong { color: var(--accent); text-decoration: underline dotted; }
.saved-flash { animation: fz-saved 1.2s ease-out; }
@keyframes fz-saved { from { background: #e6f7ee; } to { background: transparent; } }
.muted-row { color: var(--ink-2); font-size: 12px; }
.lock-notice { display: flex; gap: 12px; align-items: flex-start; margin: 16px 0 6px; padding: 14px 16px; border: 1px solid #f3dca8; border-radius: var(--r-2); background: #fff9ec; }
.lock-notice > .icon { color: #b26a00; width: 22px; height: 22px; margin-top: 2px; }
.lock-notice strong { color: #6b4300; }
.lock-notice p { margin: 4px 0 8px; color: #7a5a1f; }
.lock-notice .button { min-height: 36px; padding: 8px 14px; }

/* ---- facturación y cartera ---- */
.pac-banner { display: flex; gap: 12px; align-items: flex-start; margin: 0 0 14px; padding: 12px 16px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--rule); color: var(--ink); }
.pac-banner .icon { color: var(--accent); width: 22px; height: 22px; }
.lock-notice.info { background: var(--surface-2); border-color: var(--rule); }
.lock-notice.info > .icon { color: var(--accent); }
.lock-notice.info strong { color: var(--ink); }
.lock-notice.info p { color: var(--ink-2); }
.source-picker { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 10px; margin: 16px 0; }
.source-picker.compact { grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); }
.source-option { position: relative; display: grid; gap: 4px; padding: 14px 16px; border: 1.5px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; }
.source-option:hover { border-color: var(--accent-soft); transform: translateY(-1px); }
.source-option.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent); background: var(--surface-2); }
.source-option input { position: absolute; opacity: 0; pointer-events: none; }
.source-option .icon { color: var(--accent); }
.source-option small { color: var(--ink-2); }
.receiver-box { display: grid; gap: 3px; padding: 12px; border: 1px dashed var(--rule); border-radius: var(--r-2); background: var(--surface-2); }
.receiver-box small { color: var(--ink-2); }
.receiver-box span { font-size: 12px; color: var(--ink-2); }
.checklist { padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-2); }
.checklist h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 14px; }
.checklist h3 .icon { width: 18px; height: 18px; color: var(--accent); }
.checklist ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.checklist li { display: flex; gap: 6px; align-items: flex-start; font-size: 12px; line-height: 1.35; }
.checklist li .icon { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 1px; }
.check-ok { color: #2f6f4e; } .check-ok .icon { color: #12804a; }
.check-error { color: #a61b1b; font-weight: 600; } .check-error .icon { color: #c62828; }
.check-warning { color: #8a5600; } .check-warning .icon { color: #b26a00; }
.check-good { color: #12804a; font-weight: 600; margin: 0; }
.check-bad { color: #c62828; font-weight: 600; margin: 0; }
.fiscal-missing { color: #c62828 !important; font-weight: 600; }
.balance-box { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-2); }
.balance-box > div { display: flex; justify-content: space-between; color: var(--ink-2); }
.balance-box .grand { border-top: 2px solid var(--ink); padding-top: 6px; color: var(--ink); font-weight: 700; }
.balance-box ul { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--ink-2); }
.amount-words { margin: 10px 0 0; text-align: right; font-size: 12px; font-weight: 600; color: var(--ink-2); letter-spacing: .02em; }
.ar-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--rule); }
.ar-tabs button { padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--ink-2); font-weight: 600; }
.ar-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); }
.ar-tabs button:hover { color: var(--accent); }
.aging-grid tbody tr { cursor: pointer; }
.aging-grid tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }
.late-1 { color: #b26a00; } .late-2 { color: #c25400; } .late-3, .late-4 { color: #c62828; font-weight: 600; }
.text-bad { color: #c62828; }

/* ---- vista previa ---- */
.doc-preview { width: min(1100px, 96vw); max-width: 96vw; height: 94vh; max-height: 94vh; display: none; }
.doc-preview[open] { display: flex; flex-direction: column; }
.doc-preview .dialog-heading { flex-wrap: wrap; gap: 12px; }
.preview-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.preview-tools .field.compact { min-width: 220px; }
.preview-stage { flex: 1; min-height: 0; margin: 0 20px; padding: 18px; overflow: auto; background: var(--surface-2); border-radius: var(--r-2); }
.preview-stage iframe { display: block; width: 100%; max-width: 860px; height: 100%; min-height: 900px; margin: 0 auto; border: 0; background: var(--surface-0); box-shadow: 0 10px 34px color-mix(in srgb, var(--ink) 20%, transparent); }
.preview-help { margin: 10px 20px 16px; }

@media (max-width: 1100px) {
  .doc-layout { grid-template-columns: 1fr; }
  .line-entry-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .line-entry-grid .line-concept { grid-column: 1 / -1; }
  .line-entry-actions { grid-column: 1 / -1; justify-content: flex-end; }
}
@media (max-width: 700px) {
  .cmd span { display: none; }
  .cmd { padding: 0 10px; }
  .cmd-primary span, .cmd-more summary span { display: inline; }
  .doc-header { flex-direction: column; }
  .doc-total { justify-items: start; text-align: left; }
  .line-entry-grid { grid-template-columns: 1fr 1fr; }
  .doc-totals div { min-width: 0; }
}
@media print {
  .cmdbar, .line-entry, .doc-flow-actions, .related-docs, .party-card .icon-button { display: none !important; }
}

/* ---- todo el ancho de la pantalla (27" a 13", tableta y celular) ---- */
.workspace-main, .workspace-main.area-workspace, .module-jump { max-width: none; }
.workspace-main { padding: 22px clamp(10px, 1.6vw, 32px) 40px; }
.workspace-main.area-workspace { grid-template-columns: minmax(220px, 260px) minmax(0, 1fr); gap: clamp(12px, 1.4vw, 24px); }
.doc-layout { grid-template-columns: minmax(0, 1fr) clamp(260px, 22vw, 360px); }
@media (min-width: 2000px) { .workspace-main { font-size: 15px; } .doc-layout { grid-template-columns: minmax(0, 1fr) 380px; } }
@media (max-width: 1280px) { .doc-layout { grid-template-columns: 1fr; } .doc-side { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); } }
@media (max-width: 640px) {
  .workspace-main { padding: 12px 8px 30px; }
  .doc-main, .doc-side { padding: 14px; }
  .commercial-grid th, .commercial-grid td { padding: 8px; }
}

/* ---- captura de conceptos (cantidad primero, clave separada) ---- */
.line-entry-v2 { position: relative; margin: 14px 0 6px; padding: 14px; background: var(--surface-2); border: 1px solid var(--rule); border-radius: var(--r-2); container-type: inline-size; }
.line-entry-row { display: grid; grid-template-columns: 90px 140px minmax(200px, 1fr) 110px 130px 76px 116px 116px auto; gap: 8px; align-items: end; }
.line-entry-v2 .field { margin: 0; min-width: 0; }
.line-entry-v2 .field > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line-entry-v2 input { width: 100%; }
.line-entry-v2 .le-qty input, .line-entry-v2 .le-price input, .line-entry-v2 .le-disc input, .line-entry-v2 .le-amount input, .line-entry-v2 .le-total input { text-align: right; font-variant-numeric: tabular-nums; }
/* Cálculo inverso: Importe y Total también se escriben; el que manda se resalta y el precio queda marcado como «calculado». */
.line-entry-v2 .le-amount input, .line-entry-v2 .le-total input { background: var(--surface-0); }
.line-entry-v2 .le-total input { font-weight: 700; }
.line-entry-v2[data-price-driver="total"] .le-total input, .line-entry-v2[data-price-driver="subtotal"] .le-amount input { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.line-entry-v2 .le-price input.is-calculated { border-style: dashed; border-color: var(--accent); color: var(--accent); }
/* «Precio calculado»: la etiqueta del propio campo cambia (mismo ancho que «Precio unitario»), sin placa encimada en el campo vecino. */
.line-entry-v2 .le-price > .le-calc { color: var(--accent); font-weight: 700; text-decoration: underline dotted; text-decoration-thickness: 1px; text-underline-offset: 3px; cursor: help; }
.line-calc-note { display: block; margin-top: 6px; padding-left: 8px; border-left: 3px solid var(--warn); color: var(--ink-2); font-size: 12px; }
.line-calc-note:empty { display: none; }
.lines-v2 .price-calc { display: block; color: var(--accent); font-size: 11px; font-weight: 600; cursor: help; }
.line-entry-v2 .le-qty input { font-weight: 700; }
.line-entry-v2 .le-amount output { display: flex; align-items: center; justify-content: flex-end; min-height: 44px; padding: 0 10px; border-radius: var(--r-2); background: var(--surface-0); border: 1px dashed var(--rule); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.le-actions { display: flex; gap: 6px; }
.le-actions .button { min-height: 44px; white-space: nowrap; }
.line-suggest { left: 14px; right: 14px; top: auto; margin-top: 4px; }
.line-entry-v2 .line-suggest { position: absolute; }
.combo-option .opt-sku { flex: 0 0 auto; min-width: 82px; padding: 3px 8px; border-radius: 6px; background: var(--wash); color: var(--ink); font: 600 12px/1.4 ui-monospace, Consolas, monospace; text-align: center; }
.combo-option > span:nth-child(2) { flex: 1; min-width: 0; }
.le-qty { grid-area: qty; } .le-sku { grid-area: sku; } .le-concept { grid-area: concept; } .le-unit { grid-area: unit; }
.le-price { grid-area: price; } .le-disc { grid-area: disc; } .le-amount { grid-area: amount; } .le-total { grid-area: total; } .le-actions { grid-area: actions; }
.line-entry-row { grid-template-areas: "qty sku concept unit price disc amount total actions"; }
@container (max-width: 1100px) {
  .line-entry-row { grid-template-columns: 90px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "qty sku concept concept concept concept" "unit price disc amount total actions"; }
}
@container (max-width: 560px) {
  .line-entry-row { grid-template-columns: 1fr 1fr; grid-template-areas: "qty sku" "concept concept" "price disc" "amount total" "unit actions"; }
  .le-actions .button { width: 100%; justify-content: center; }
}
.lines-v2 .col-n { width: 36px; color: var(--ink-2); }
.lines-v2 .col-qty { width: 90px; font-weight: 700; }
.lines-v2 .col-sku { width: 110px; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.lines-v2 .col-unit { width: 110px; }
.lines-v2 .col-disc { width: 70px; }
.lines-v2 .col-actions { width: 1%; }
.lines-v2 td.line-desc { white-space: normal; min-width: 240px; }
/* Tablas anchas (pendientes E2E 9 oct 2026): en consulta el importe queda fijo a la derecha cuando la tabla no cabe, y en pantallas
   medianas o en el celular se acortan clave, unidad y descripción para que quepa lo importante. */
.lines-pin-amount .col-amount { position: sticky; right: 0; z-index: 1; background: var(--surface-0, #fff); }
.lines-pin-amount thead .col-amount { background: var(--surface-2, var(--surface-0, #fff)); }
/* Prueba en producción 10 oct (tableta o panel de ~750 px): «Clave», «Unidad» y «Libre» se partían letra por letra porque
   overflow-wrap:anywhere dejaba la columna en el ancho de una letra. Encabezados y etiquetas nunca se parten; clave y unidad tienen
   ancho mínimo y solo cortan entre palabras; si no cabe, la tabla se desplaza a los lados (con el importe fijo en la consulta). */
.lines-v2 thead th { white-space: nowrap; }
@media (max-width: 1500px) {
  .lines-v2 td.col-sku, .lines-v2 td.col-unit { width: auto; min-width: 72px; max-width: 132px; overflow-wrap: break-word; white-space: normal; }
  .lines-v2 td.line-desc { min-width: 180px; }
}
@media (max-width: 700px) {
  .lines-v2 .col-n, .lines-v2 .col-sku, .lines-v2 .col-unit { display: none; }
  .lines-v2 td.line-desc { min-width: 140px; }
}
.lines-v2 .cell-input { max-width: 110px; }
.cell-input.wide { max-width: none; text-align: left; margin-bottom: 4px; }

/* ---- buscadores (sustituyen listas desplegables) ---- */
.picker { display: flex; align-items: center; }
.picker .picker-icon { position: absolute; left: 12px; display: flex; color: var(--ink-3); pointer-events: none; }
.picker .picker-icon .icon { width: 16px; height: 16px; }
.picker .picker-input { width: 100%; padding-left: 36px; padding-right: 34px; }
.picker .picker-input:read-only { background: var(--surface-2); }
.picker-clear { position: absolute; right: 6px; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; background: none; color: var(--ink-2); }
.picker-clear:hover { background: var(--surface-2); color: #c62828; }
.picker-clear .icon { width: 14px; height: 14px; }
.picker-field .combo-list { min-width: 280px; }
.picker-input:invalid:not(:placeholder-shown) { border-color: #e2a0a0; }
.picker.multi { display: block; }
.picker-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 6px 8px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); }
.picker-chips .picker-input { flex: 1 1 160px; min-width: 140px; border: 0; padding: 6px; background: transparent; outline: none; }
.picker-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 10px; border-radius: 999px; background: var(--wash); color: var(--accent); font-size: 13px; font-weight: 600; }
.picker-chip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: none; color: var(--ink-2); }
.picker-chip button:hover { background: var(--rule); }
.picker-chip .icon { width: 12px; height: 12px; }
.fixed-kind strong { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: var(--r-2); background: var(--surface-2); color: var(--ink); }
.fixed-kind .icon { width: 18px; height: 18px; color: var(--accent); }

/* ---- documentos de venta ---- */
.sdoc-header { margin-top: 14px; }
.sdoc-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.side-hint { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px dashed var(--rule); border-radius: var(--r-2); color: var(--ink-2); }
.side-hint .icon { color: var(--accent); flex: 0 0 auto; }
.side-hint p { margin: 0; }
.pending-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; margin: 10px 0 14px; }
.pending-doc { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); cursor: pointer; }
.pending-doc:has(input:checked) { border-color: var(--accent); background: var(--surface-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.pending-doc > span { flex: 1; min-width: 0; }
.pending-doc small { display: block; color: var(--ink-2); }
.pending-doc .icon { color: var(--accent); }
.stop-add { margin-top: 14px; max-width: 520px; }
.stops-grid td { vertical-align: top; }
.stops-grid td small { display: block; }
.stops-grid .cmd { min-height: 32px; }
.statement-bar .statement-client { flex: 1 1 320px; max-width: 460px; }

/* ---- enlace público ---- */
.share-status { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: var(--r-2); background: #eef7f1; border: 1px solid #cdebd8; }
.share-status .icon { color: #12804a; flex: 0 0 auto; }
.share-status strong { display: block; color: #12573a; }
.share-status small { display: block; color: var(--ink-2); }
.share-url { width: 100%; margin: 10px 0 4px; padding: 10px; border: 1px solid var(--rule); border-radius: var(--r-1); font: 13px ui-monospace, Consolas, monospace; }

/* ---- punto de venta ---- */
.pos-setup { max-width: 760px; }
.pos-setup h2 { display: flex; align-items: center; gap: 10px; }
.pos-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 8px 12px; border-radius: var(--r-2); background: var(--ink); color: var(--wash); }
.pos-bar strong { color: #fff; }
.pos-bar .icon { width: 18px; height: 18px; color: var(--accent-soft); vertical-align: -3px; }
.pos-bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.pos-bar .cmd { color: var(--wash); } .pos-bar .cmd:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.pos-bar .cmd-danger .icon { color: #ff8a8a; }
.pos-bar .field.compact { min-width: 180px; } .pos-bar .field.compact span { color: var(--ink-3); }
.pos-layout { display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 26vw, 380px); gap: 14px; align-items: start; }
.pos-cart { padding: 14px; min-height: 60vh; }
#pos-scan-form { position: relative; }
.pos-scan { display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 2px solid var(--accent); border-radius: var(--r-2); background: var(--surface-0); }
.pos-scan .icon { width: 22px; height: 22px; color: var(--accent); }
.pos-scan input { flex: 1; min-height: 56px; border: 0; outline: none; font-size: 18px; background: transparent; }
.pos-suggest { top: calc(100% + 4px); }
.pos-lines { margin-top: 12px; font-size: 15px; }
.pos-qty { white-space: nowrap; }
.pos-qty .icon-button { width: 30px; height: 30px; font-size: 18px; font-weight: 700; }
.pos-qty .cell-input { width: 64px; text-align: center; }
.pos-empty { display: grid; justify-items: center; gap: 6px; padding: 60px 10px; color: var(--ink-2); }
.pos-empty .icon { width: 44px; height: 44px; }
.pos-side { position: sticky; top: calc(var(--workspace-topbar-height, 160px) + 8px); display: grid; gap: 12px; padding: 16px; }
.pos-total { display: grid; justify-items: end; padding: 16px; border-radius: var(--r-2); background: linear-gradient(180deg, var(--ink), var(--ink)); color: #fff; }
.pos-total small { color: var(--ink-3); }
.pos-total strong { font-size: clamp(30px, 3.2vw, 46px); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.pos-total span { color: var(--ink-3); font-size: 13px; }
/* Descuento en caja: el renglón y el total dicen cuánto se descontó (pendientes E2E 9 oct 2026). */
.pos-lines .pos-disc { color: var(--line-ink, var(--ink)); font-weight: 600; }
.pos-total .pos-disc { color: #fff; opacity: .85; }
.pos-lines .row-actions .icon-button { font-weight: 700; }
.pos-pay { min-height: 58px; font-size: 18px; justify-content: center; }
.pos-pay kbd, .pos-pay-dialog kbd { padding: 1px 6px; border-radius: 5px; background: color-mix(in srgb, var(--surface-2) 20%, transparent); font-size: 12px; }
.pos-last { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border-radius: var(--r-2); background: var(--surface-2); font-size: 13px; }
.pos-pay-dialog { width: min(560px, 96vw); }
.pos-pay-dialog h2 { font-size: 30px; }
.pos-pay-grid { display: grid; gap: 10px; margin-bottom: 12px; }
.pos-pay-method { display: grid; grid-template-columns: 26px 120px 1fr; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--rule); border-radius: var(--r-2); font-weight: 600; }
.pos-pay-method .icon { color: var(--accent); }
.pos-pay-method input { min-height: 46px; font-size: 20px; text-align: right; }
.pos-change { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: var(--r-2); background: #e6f7ee; font-size: 16px; }
.pos-change strong { font-size: 26px; }
.shift-report .lines-grid { max-width: 560px; margin: 12px 0; }
.shift-report tr.grand td { border-top: 2px solid var(--ink); }
ul.plain { margin: 6px 0; padding-left: 18px; }
@media (max-width: 900px) { .pos-layout { grid-template-columns: 1fr; } .pos-side { position: static; } }

/* ---- tesorería ---- */
.bank-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
.bank-card { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 10px; padding: 14px; border: 1.5px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); text-align: left; }
.bank-card .icon { grid-row: span 2; width: 26px; height: 26px; color: var(--accent); }
.bank-card small { display: block; color: var(--ink-2); } .bank-card strong { display: block; color: var(--ink); }
.bank-card b { grid-column: 2; font-size: 20px; color: var(--ink); font-variant-numeric: tabular-nums; }
.bank-card em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 11px; color: #b26a00; }
.bank-card.active { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 10%, transparent); }
.bank-card.total { background: var(--ink); border-color: var(--ink); } .bank-card.total small { color: #d4d4d8; } .bank-card.total strong { color: #fff; } .bank-card.total b { grid-column: 1 / -1; color: #fff; }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }

/* ---- importación ---- */
.import-dialog { width: min(1100px, 96vw); max-width: 96vw; }
.drop-zone { display: grid; justify-items: center; gap: 6px; padding: 34px 20px; border: 2px dashed var(--accent-soft); border-radius: var(--r-2); background: var(--surface-2); color: var(--ink-2); text-align: center; cursor: pointer; transition: background .15s, border-color .15s; }
.drop-zone .icon { width: 34px; height: 34px; color: var(--accent); }
.drop-zone.over, .drop-zone:hover { background: var(--wash); border-color: var(--accent); }
.drop-zone.compact { margin: 14px 0 4px; padding: 16px; grid-template-columns: auto 1fr; justify-items: start; text-align: left; }
.drop-zone.compact .icon { grid-row: span 2; width: 28px; height: 28px; }
.paste-area { width: 100%; font: 12px/1.4 ui-monospace, Consolas, monospace; }
.import-help .badge { margin: 2px; }
.import-help .badge.required { background: var(--wash); color: var(--accent); }
.import-preview th { vertical-align: bottom; }
.import-preview th small { display: block; color: var(--ink-2); font-weight: 500; text-transform: none; }
.import-preview th select { min-width: 140px; font-size: 12px; padding: 4px 6px; }
.import-result { margin-top: 14px; padding: 14px 16px; border-radius: var(--r-2); }
.import-result.good { background: #e6f7ee; color: #12573a; }
.import-result.bad { background: #fdecec; color: #8e1b1b; }
.import-result ul { margin: 8px 0 0; padding-left: 18px; max-height: 220px; overflow: auto; font-size: 13px; }
.import-changes { max-height: 260px; overflow: auto; display: grid; gap: 8px; font-size: 13px; margin-top: 8px; }
.import-changes ul { margin: 4px 0 0; padding-left: 18px; }
.import-changes del { color: var(--ink-3); }
.import-dialog .check-line { margin-top: 12px; }

/* ---- migración y histórico ---- */
.mig-steps { margin: 0 0 14px; }
.mig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 14px; }
.mig-grid h2, .surface > h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; }
a.button { text-decoration: none; }
.mig-howto { margin: 12px 0; padding-left: 20px; line-height: 1.6; }
.mig-howto code { padding: 1px 5px; border-radius: 5px; background: var(--surface-2); }
.mig-progress { height: 12px; margin: 10px 0; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.mig-progress > div { height: 100%; border-radius: 999px; background: var(--line); }
.mig-owned { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.mig-owned .module-choice { grid-template-columns: auto 1fr; align-items: start; }
.mig-owned .module-choice small { grid-column: 2; }
.mig-modules select { min-width: 150px; }
.mig-modules tr.mig-family td { padding-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); background: transparent; }
.mig-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 12px; }
.mig-counts div { padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r-2); }
.mig-counts strong { display: block; font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.mig-counts small { color: var(--ink-2); }
.pill-soft { display: inline-block; width: auto; margin-top: 2px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 11px; }
.compact-select { min-width: 0; }
.compact-select select, .compact-select input { min-height: 38px; }
.hist-filters { flex-wrap: wrap; gap: 10px; }
.acc-tree tr.acc-major td { background: var(--surface-2); font-weight: 600; }
.acc-tree tr.muted td { color: var(--ink-2); }
.acc-tree tr[data-acc-ledger], tr[data-pay-period], tr[data-pay-receipt], tr[data-acc-entry] { cursor: pointer; }
.commercial-grid tfoot th { border-top: 2px solid var(--rule); }
.hist-pager { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 4px 4px; color: var(--ink-2); }
.record-dialog.wide { width: min(1100px, 96vw); max-width: 96vw; }
/* Captura de póliza: la tabla cabe en el cuadro (antes medía 1,284 px y el Abono quedaba fuera a 1440 y 1920 px). */
#acc-dialog .lines-grid { table-layout: fixed; width: 100%; min-width: 760px; }
#acc-dialog .lines-grid th, #acc-dialog .lines-grid td { padding-left: 4px; padding-right: 4px; }
#acc-dialog .lines-grid input, #acc-dialog .lines-grid select { width: 100%; min-width: 0; box-sizing: border-box; }
#acc-dialog .lines-grid .acc-c-acct { width: 26%; }
#acc-dialog .lines-grid .acc-c-cc { width: 90px; }
#acc-dialog .lines-grid .acc-c-uuid { width: 15%; }
#acc-dialog .lines-grid .acc-c-rfc { width: 112px; }
#acc-dialog .lines-grid .acc-c-amt { width: 112px; }
ul.plain.small { max-height: 260px; overflow: auto; font-size: 13px; }

/* ---- Auditoría comercial 2026-10 ---- */
/* Listas de sugerencias: aparecen opacas desde el primer cuadro (sin fundido encima de los campos de abajo). */
@keyframes fz-drop { from { transform: translateY(-4px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .combo-list { animation: none; } }
/* Prospecto (cliente sin datos fiscales todavía). */
.badge-prospect { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: var(--r-1, 4px); background: #fdf3e1; color: var(--warn, #9a5b00); font-size: 11px; font-weight: 700; vertical-align: middle; }
/* Impuesto por omisión de un concepto libre: resaltado hasta que se confirma. */
.tax-default-notice { display: flex; align-items: flex-start; gap: 8px; margin: 8px 0 12px; padding: 9px 12px; border-radius: var(--r-1, 4px); background: #fdf3e1; color: var(--ink); border: 1px solid color-mix(in srgb, var(--warn, #9a5b00) 35%, transparent); }
.tax-default-notice .icon { flex: 0 0 auto; width: 18px; height: 18px; color: var(--warn, #9a5b00); }
.tax-default-notice.is-missing { background: #fbe9e9; border-color: color-mix(in srgb, var(--bad, #c62828) 35%, transparent); }
.tax-default-notice.is-missing .icon { color: var(--bad, #c62828); }
.tax-default-flag { display: inline-block; margin-top: 3px; padding: 1px 6px; border-radius: var(--r-1, 4px); background: #fdf3e1; color: var(--warn, #9a5b00); font-weight: 700; }
/* Autorización de supervisor. */
.fz-authorize h2 { display: flex; align-items: center; gap: 8px; }
.fz-authorize h2 .icon { width: 20px; height: 20px; color: var(--warn, #9a5b00); }
.authorize-reasons { margin: 6px 0 14px; padding-left: 20px; color: var(--ink); }
.authorize-reasons li { margin: 3px 0; }
.fz-authorize .field { margin-bottom: 10px; }
/* Surtido parcial desde pedido. */
.sdoc-fulfill { width: min(860px, calc(100vw - 32px)); }
.fulfill-grid td small { display: block; color: var(--ink-2); }
.fulfill-grid td.short { color: var(--warn, #9a5b00); font-weight: 700; }
.fulfill-grid input.cell-input { width: 96px; text-align: right; }
.sdoc-fulfill .dialog-footer > span { display: inline-flex; gap: 6px; margin-right: auto; }
.sdoc-from-order { margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--rule); border-radius: var(--r-2, 6px); background: var(--surface-2); }
.sdoc-from-order .field { margin: 0; max-width: 520px; }
/* Pendiente por facturar (importe de lo pendiente, no el total del documento). */
.pending-amount { display: grid; justify-items: end; margin-left: auto; text-align: right; }
.pending-amount small { color: var(--ink-2); font-size: 11px; }
/* CRM: actividades y bandeja del vendedor. */
.crm-inbox { margin-bottom: 14px; }
.crm-activity-list { list-style: none; margin: 0 0 10px; padding: 0; }
.crm-activity { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); }
.crm-activity:first-child { border-top: 0; }
.crm-kind { flex: 0 0 auto; min-width: 70px; padding: 2px 8px; border-radius: var(--r-1, 4px); background: var(--wash); color: var(--accent); font-size: 11px; font-weight: 700; text-align: center; }
.crm-activity-body { flex: 1; min-width: 0; }
.crm-activity-body strong { display: block; overflow-wrap: anywhere; }
.crm-activity-body small { display: block; color: var(--ink-2); overflow-wrap: anywhere; }
.crm-activity.is-overdue .crm-activity-body small:last-child { color: var(--bad, #c62828); font-weight: 600; }
.crm-activity.is-done { opacity: .72; }
.crm-activity.is-done strong { text-decoration: line-through; }
.crm-activity-actions { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.crm-activity-form { display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--rule); }
.crm-activity-form .field { margin: 0; }
.crm-activity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 520px) { .crm-activity-grid { grid-template-columns: 1fr; } .crm-activity { flex-wrap: wrap; } }
:root[data-theme="dark"] .badge-prospect, :root[data-theme="dark"] .tax-default-flag, :root[data-theme="dark"] .tax-default-notice { background: color-mix(in srgb, var(--warn, #9a5b00) 22%, var(--surface-0)); color: var(--ink); }
:root[data-theme="dark"] .tax-default-notice.is-missing { background: color-mix(in srgb, var(--bad, #c62828) 22%, var(--surface-0)); }

/* Caja en teléfono (375 px): el importe de cada renglón quedaba fuera de la vista y las teclas F2… no sirven en pantalla táctil
   (E2E ventas y caja 2026-10-09). Se oculta el precio unitario (el importe basta) y la columna del producto ya no exige 200 px. */
@media (max-width: 560px) {
  .pos-lines th:nth-child(3), .pos-lines td:nth-child(3) { display: none; }
  .pos-lines td:not(.num):has(> strong) { min-width: 0; }
  .pos-lines th, .pos-lines td { padding-left: 4px; padding-right: 4px; }
  .pos-lines .pos-qty .cell-input { min-width: 44px; width: 48px; }
  .pos-cart .till-keys { display: none; }
}


/* /metro.css */
/* Metro: capa de componentes de FZ ERP. Se carga al final y define el mundo visual
   (ver DESIGN.md): barra negra de señal, un color de línea por área, menú del área como
   línea con estaciones, flujo de documentos como estaciones y listas densas. */

* { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
body { background: var(--surface-1); color: var(--ink); }
:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--line); outline-offset: 2px; }
a { color: var(--line-ink); text-underline-offset: 3px; }
h1 { letter-spacing: -0.02em; }

/* ---------- Disco de la línea ---------- */
.line-disk {
  display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--line); color: var(--line-fg, #fff);
  font-size: 11px; font-weight: 800; line-height: 1; letter-spacing: -0.02em;
}
.line-disk .icon { width: 62%; height: 62%; stroke-width: 2; }

/* ---------- Barra superior: negro de señal ---------- */
.workspace-topbar { box-shadow: none; }
.workspace-header {
  min-height: 48px; padding: 0 clamp(12px, 1.6vw, 24px); gap: 16px;
  background: var(--shell); border-bottom: 1px solid #050d1f;
}
.workspace-header .brand { gap: 8px; }
.workspace-header .brand img { width: 30px; height: 21px; }
.workspace-header .brand > span { font-size: 18px; letter-spacing: -0.02em; }
.workspace-header .brand small { font-size: 9px; padding: 1px 4px; border-radius: 3px; }
.header-divider { height: 22px; width: 1px; background: rgb(255 255 255 / 18%); }
.company-switch { display: flex; align-items: center; gap: 8px; }
.company-switch > span { display: inline; font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: rgb(255 255 255 / 55%); margin: 0; }
.company-switch select { font-size: 13px; font-weight: 600; padding: 4px 26px 4px 0; min-height: 0; }
.header-actions { gap: 12px; }
.environment-dot { font-size: 11px; color: rgb(255 255 255 / 60%); }
.user-menu { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-0); color: var(--ink); font-weight: 700; }
.workspace-header .icon-button { width: 32px; height: 32px; color: #fff; }
.workspace-header .logout { color: rgb(255 255 255 / 75%); font-size: 12px; }

/* ---------- Pestañas de trabajo ---------- */
.work-tabs { min-height: 40px; padding: 0 clamp(12px, 1.6vw, 24px); gap: 2px; background: var(--surface-0); border-bottom: 1px solid var(--rule); }
.work-tab-group { border: 0; background: none; border-radius: 0; box-shadow: none; padding: 0; }
.work-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px;
  border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--ink-2); font-weight: 600; font-size: 13px;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.work-tab:hover { color: var(--ink); background: var(--surface-2); }
.work-tab.selected, .work-tab-group.selected .work-tab { color: var(--ink); border-bottom-color: var(--ink); background: none; }
.work-tab .icon { width: 16px; height: 16px; }
/* «Inicio» no se encoge ni se parte letra por letra cuando hay muchas pestañas (se veía «i c»); la tira se desplaza. */
.work-tabs > .work-tab { flex: 0 0 auto; white-space: nowrap; overflow-wrap: normal; }
.work-tab-label { display: inline-flex; align-items: baseline; gap: 6px; }
.work-tab-label small { display: inline; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.work-tab-label small::before { content: "·"; margin-right: 6px; }
.tab-close { width: 22px; height: 22px; border-radius: 3px; color: var(--ink-3); background: none; }
.tab-close:hover { background: var(--surface-1); color: var(--ink); }

/* ---------- Área de trabajo ---------- */
.workspace-main { box-sizing: border-box; width: 100%; min-width: 0; margin-inline: 0; padding: 14px clamp(10px, 1.4vw, 24px) 32px; max-width: none; }
.workspace-main.area-workspace { grid-template-columns: minmax(0, clamp(212px, 18vw, 280px)) minmax(0, 1fr); gap: clamp(10px, 1.2vw, 22px); }
.workspace-main.area-workspace > *, .area-content, .app-main, .app-body, .app-content { min-width: 0; }
.surface { box-shadow: none; padding: 16px; border-radius: var(--r-2); border-color: var(--rule); }
footer { font-size: 11px; color: var(--ink-3); }

/* ---------- Menú del área: la línea con sus estaciones ---------- */
.area-sidebar { background: var(--surface-0); border: 1px solid var(--rule); border-radius: var(--r-2); box-shadow: none; top: calc(var(--workspace-topbar-height, 88px) + 14px); }
.area-sidebar-head { padding: 10px 12px 12px; border-bottom: 1px solid var(--rule); background: none; }
.area-back { font-size: 12px; font-weight: 500; color: var(--ink-3); padding: 0; background: none; }
.area-back:hover { color: var(--ink); }
.area-sidebar-title { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.area-sidebar-title .line-disk { width: 32px; height: 32px; font-size: 15px; }
.area-sidebar-title strong { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.area-nav { padding: 6px 0 10px; }
.area-overview { display: flex; align-items: center; gap: 8px; width: calc(100% - 12px); margin: 0 6px 2px; padding: 7px 10px; border-radius: var(--r-1); background: none; color: var(--ink-2); font-weight: 600; font-size: 13px; }
.area-overview:hover { background: var(--surface-2); color: var(--ink); }
.area-overview.selected { background: var(--line-wash); color: var(--ink); }
.area-overview .icon { width: 16px; height: 16px; }
.area-nav-group { border: 0; margin: 0; }
.area-nav-group > summary {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink-3); background: none;
}
.area-nav-group > summary .icon { display: none; }
.area-nav-group > summary small { margin-left: auto; font-weight: 600; color: var(--ink-3); background: none; }
.area-nav-list { position: relative; padding: 2px 0 4px; gap: 0; }
/* La línea: una banda del color del área que une las estaciones. */
.area-nav-list::before {
  content: ""; position: absolute; left: 21px; top: 6px; bottom: 6px; width: 5px; border-radius: 3px;
  background: var(--line);
}
.area-nav-row { position: relative; display: flex; align-items: center; margin: 0; padding: 0 6px 0 0; border: 0; border-radius: 0; background: none; }
.area-nav-row::before {
  content: ""; position: absolute; left: 17px; top: 50%; z-index: 1; box-sizing: border-box;
  width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%;
  background: var(--surface-0); border: 3px solid var(--line);
  transition: transform var(--fz-dur-fast, 160ms) var(--fz-ease-out, ease-out);
}
.area-nav-row > button {
  flex: 1; min-width: 0; display: flex; align-items: center; min-height: 31px; padding: 5px 8px 5px 38px;
  border-radius: var(--r-1); background: none; color: var(--ink-2); font-size: 13px; font-weight: 500; text-align: left;
}
.area-nav-row > button .icon { display: none; }
.area-nav-row > button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.area-nav-row:hover > button { color: var(--ink); background: var(--surface-2); }
/* Estación actual: el anillo crece como el andén donde estás. */
.area-nav-row.selected::before { transform: scale(1.35); border-width: 3.5px; }
.area-nav-row.selected > button { color: var(--ink); font-weight: 700; background: var(--line-wash); }
.area-nav-row > .drag-grip { opacity: 0; color: var(--ink-3); width: 16px; }
.area-nav-row:hover > .drag-grip { opacity: 1; }
/* «Agregar sección» solo existe en el modo «Editar accesos» (navigation-ui.js) y queda fuera de la línea:
   sin estación ni banda, texto tenue de 12 px con «+» y contorno punteado, para que no parezca una sección. */
.area-add {
  display: flex; align-items: center; gap: 6px; width: auto; min-height: 28px; margin: 4px 10px 6px 34px; padding: 4px 8px;
  border: 1px dashed var(--rule-strong); border-radius: var(--r-1); background: none;
  color: var(--ink-3); font-size: 12px; font-weight: 500; text-align: left; position: static;
}
.area-add .icon { position: static; width: 14px; height: 14px; }
.area-add:hover, .area-add:focus-visible { color: var(--line-ink); border-color: var(--line); background: var(--surface-2); }
.area-nav-group.is-empty > summary { color: var(--ink-3); font-weight: 600; }
.area-nav-group.is-empty > summary small { display: none; }
.area-sidebar.is-editing .area-nav-row > .drag-grip { opacity: 0.55; }
.area-sidebar-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px 8px 12px; font-size: 11px; color: var(--ink-3); border-top: 1px solid var(--rule); background: none;
}
.area-edit-toggle {
  display: inline-flex; align-items: center; gap: 5px; flex: none; min-height: 26px; padding: 3px 8px;
  border: 1px solid var(--rule); border-radius: var(--r-1); background: var(--surface-0);
  color: var(--ink-2); font-size: 12px; font-weight: 600;
}
.area-edit-toggle .icon { width: 14px; height: 14px; }
.area-edit-toggle:hover { color: var(--ink); border-color: var(--rule-strong); }
.area-edit-toggle[aria-pressed="true"] { color: var(--line-ink); border-color: var(--line); background: var(--line-wash); }
.area-folder > summary { padding-left: 38px; font-size: 13px; }

/* ---------- Título de página ---------- */
.page-title { margin: 2px 0 12px; align-items: flex-end; }
@media (min-width: 761px) and (max-height: 820px) {
  .workspace-main { padding-top: 8px; }
  .page-title { margin-bottom: 8px; }
  .page-title h1 { font-size: 22px; }
  .commercial-toolbar { margin-bottom: 8px; }
  .commercial-grid-surface { padding-top: 8px; }
}
.page-title-heading { gap: 10px; }
.page-title-heading .line-disk { width: 30px; height: 30px; font-size: 14px; }
.page-title h1 { font-size: 24px; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.page-title p { margin-top: 3px; font-size: 13px; color: var(--ink-3); max-width: 75ch; }
.section-favorite { width: 26px; height: 26px; border-radius: var(--r-1); border: 1px solid var(--rule); background: var(--surface-0); color: var(--ink-3); font-size: 14px; }
.section-favorite[aria-pressed="true"] { color: var(--ink); border-color: var(--rule-strong); }

/* ---------- Barra de comandos ---------- */
.cmdbar, .quote-commandbar { padding: 5px 6px; border-radius: var(--r-2); box-shadow: none; border-color: var(--rule); background: var(--surface-0); }
.cmd { min-height: 32px; padding: 0 10px; border-radius: var(--r-1); font-size: 13px; gap: 6px; }
.cmd .icon { width: 17px; height: 17px; color: var(--ink-2); }
.cmd:hover:not(:disabled) { background: var(--surface-1); border-color: transparent; color: var(--ink); }
.cmd:hover:not(:disabled) .icon { transform: none; color: var(--ink); }
.cmd-primary, .cmd-primary:hover:not(:disabled) { background: var(--line-ink); color: #fff; box-shadow: none; }
.cmd-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--line-ink) 86%, black); }
.cmd-primary .icon, .cmd-primary:hover:not(:disabled) .icon { color: #fff; }
.cmd-sep { background: var(--rule); margin: 6px 4px; }
.cmd-menu { box-shadow: var(--shadow); border-radius: var(--r-2); }

/* ---------- Botones y campos ---------- */
.button { padding: 8px 14px; min-height: 34px; border-radius: var(--r-1); font-size: 13px; gap: 8px; box-shadow: none; }
.button.primary { background: var(--line-ink); color: #fff; border: 1px solid transparent; box-shadow: none; }
.button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--line-ink) 86%, black); }
.button.secondary { background: var(--surface-0); color: var(--ink); border: 1px solid var(--rule-strong); }
.button.secondary:hover:not(:disabled) { border-color: var(--ink-3); background: var(--surface-2); }
.button.ghost { background: transparent; color: var(--ink-2); border: 1px solid transparent; }
.button.ghost:hover:not(:disabled) { background: var(--surface-1); color: var(--ink); }
.button.danger, .button.primary.danger { background: var(--bad); color: #fff; }
.text-button, .link-button { color: var(--line-ink); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select, textarea {
  border-color: var(--rule-strong); border-radius: var(--r-1);
}
input:not([type="checkbox"]):not([type="radio"]):focus, select:focus, textarea:focus {
  border-color: var(--line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--line) 22%, transparent); outline: none;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--line-ink); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }

/* ---------- Listas densas ---------- */
th { font-size: 11px; font-weight: 700; letter-spacing: 0.01em; text-transform: none; color: var(--ink-3); padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--rule); }
td { padding: 8px 12px; font-size: 13px; }
td strong { font-size: 13px; }
.commercial-grid th, .commercial-grid td { padding: 7px 12px; }
.commercial-grid tbody tr:hover { background: var(--surface-2); }
.commercial-grid tbody tr.selected { background: var(--line-wash); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.commercial-filterbar { gap: 10px; padding: 10px 12px; }
.search-field { border-radius: var(--r-1); border-color: var(--rule-strong); min-height: 34px; }

/* ---------- Estados: placas de señal, no píldoras ---------- */
.status-pill { border-radius: 3px; padding: 2px 8px; font-size: 12px; font-weight: 600; gap: 6px; }
.status-pill::before { width: 7px; height: 7px; }
.st-draft { background: var(--surface-1); color: var(--ink-2); }
.st-info { background: #e8eef7; color: var(--info); }
.st-warn { background: #fdf3e1; color: var(--warn); }
.st-ok { background: #e4f3ea; color: color-mix(in srgb, var(--ok) 86%, #000); }
.st-bad { background: #fbe9e9; color: var(--bad); }

/* ---------- Flujo del documento: estaciones ---------- */
.doc-steps { display: flex; align-items: flex-start; gap: 0; margin: 0; padding: 0; }
.doc-steps li {
  position: relative; flex: 0 1 auto; min-width: 92px; margin: 0; padding: 24px 10px 0;
  background: none; clip-path: none; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-3);
}
.doc-steps li:first-child { padding-left: 10px; clip-path: none; }
.doc-steps li::before {
  content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 5px; background: var(--rule);
}
.doc-steps li:first-child::before { left: 50%; }
.doc-steps li:last-child::before { right: 50%; }
.doc-steps li::after {
  content: ""; position: absolute; top: 2px; left: 50%; box-sizing: border-box;
  width: 15px; height: 15px; margin-left: -7.5px; border-radius: 50%; background: var(--surface-0); border: 3px solid var(--rule-strong);
}
.doc-steps li.done { color: var(--ink-2); background: none; }
.doc-steps li.done::before { background: var(--line); }
.doc-steps li.done::after { border-color: var(--line); }
.doc-steps li.current { color: var(--ink); font-weight: 700; background: none; }
.doc-steps li.current::before { background: linear-gradient(90deg, var(--line) 50%, var(--rule) 50%); }
.doc-steps li.current:first-child::before { background: var(--rule); }
.doc-steps li.current::after { width: 21px; height: 21px; margin-left: -10.5px; top: -1px; border: 6px solid var(--line); }

/* ---------- Inicio: tus áreas como líneas ---------- */
.home-head { padding: 6px 0 16px; }
.home-head h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.home-head p { margin-top: 4px; color: var(--ink-3); font-size: 13px; }
.home-head p::first-letter { text-transform: uppercase; }
.lines-section { margin-bottom: 22px; }
.section-heading { margin-bottom: 12px; align-items: flex-end; }
.section-heading h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.section-heading p { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.module-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.module-card.line-card { padding: 14px 14px 12px; border-radius: var(--r-2); border: 1px solid var(--rule); background: var(--surface-0); box-shadow: none; transform: none; }
.module-card.line-card::after, .module-card.line-card::before { content: none; display: none; }
.module-card.line-card:hover { border-color: var(--line); box-shadow: 0 4px 16px rgb(20 20 22 / 7%); transform: none; }
.line-card .module-card-top { margin: 0 0 10px; }
.line-card .module-card-top .line-disk { width: 38px; height: 38px; font-size: 17px; }
.line-card .module-card-open h3 { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); }
.line-card .module-card-open p { margin-top: 3px; font-size: 12.5px; line-height: 1.4; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.line-strip { position: relative; display: flex; align-items: center; height: 14px; margin: 12px 0 8px; }
.line-strip::before { content: ""; position: absolute; left: 4px; right: 4px; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; background: var(--line); }
.line-strip i { position: relative; flex: 1; display: flex; justify-content: center; }
.line-strip i::after { content: ""; box-sizing: border-box; width: 11px; height: 11px; border-radius: 50%; background: var(--surface-0); border: 3px solid var(--line); }
.line-strip i:first-child { justify-content: flex-start; }
.line-strip i:last-child { justify-content: flex-end; }
.line-card .module-card-footer { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); border: 0; padding: 0; margin: 0; }
.line-card .module-card-footer span:first-child { color: var(--line-ink); font-weight: 600; }
.line-card .drag-grip { color: var(--ink-3); opacity: 0.5; }
.line-card:hover .drag-grip { opacity: 1; }
.favorites-section { margin: 0 0 18px; }
.quick-empty { margin: 0; padding: 0; font-size: 13px; color: var(--ink-3); background: none; border: 0; }
.quick-card { border-radius: var(--r-2); box-shadow: none; }
.settings-launch { border-radius: var(--r-2); box-shadow: none; background: var(--surface-0); border: 1px solid var(--rule); padding: 12px 14px; }
.notice { border-radius: var(--r-2); box-shadow: none; }
.notice p, .notice.compact { color: var(--ink-2); }

/* ---------- Diálogos ---------- */
.record-dialog { border-radius: var(--r-2); box-shadow: 0 24px 64px rgb(20 20 22 / 24%); }
.record-dialog::backdrop { background: rgb(20 20 22 / 45%); }
.dialog-heading { padding: 14px 18px; border-bottom: 1px solid var(--rule); }
.dialog-heading h2 { font-size: 18px; letter-spacing: -0.01em; }
.dialog-footer { padding: 12px 18px; border-top: 1px solid var(--rule); background: var(--surface-2); }

/* ---------- Teléfono ---------- */
/* Árbol del área plegable (navigation-ui.js): el botón «Secciones» solo aparece en el teléfono. */
.area-tree-toggle { display: none; }
@media (max-width: 600px) {
  .area-sidebar-title { flex-wrap: wrap; }
  .area-tree-toggle { display: inline-flex; margin-left: auto; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); color: var(--ink); font-size: 13px; font-weight: 600; }
  .area-sidebar.mobile-folded .area-nav, .area-sidebar.mobile-folded .area-sidebar-foot { display: none; }
  .area-sidebar.mobile-folded { max-height: none; margin-bottom: 10px; }
}
@media (max-width: 760px) {
  .workspace-header { gap: 10px; }
  .company-switch > span, .environment-dot { display: none; }
  .workspace-main.area-workspace { grid-template-columns: minmax(0, 1fr); }
  /* Oct 2026: antes 46vh con barra propia a media página (atrapaba el dedo). Ahora fluye; se pliega al abrir una sección. */
  .area-sidebar { position: static; max-height: none; top: auto; }
  .area-sidebar-foot:not(:has(.area-edit-toggle)) { display: none; }
  .area-sidebar-foot > span { display: none; }
  .area-sidebar-foot { justify-content: flex-end; }
  .page-title h1 { font-size: 21px; }
  .home-head h1 { font-size: 24px; }
  .module-grid { grid-template-columns: minmax(0, 1fr); }
  .doc-steps li { min-width: 72px; padding-inline: 4px; }
}

/* ---------- Ajustes de la primera revisión ---------- */
/* Logotipo sobre negro. */
.brand > span { color: #fff; }
.brand > span > span { color: #fff; font-weight: 400; }
.brand small { color: rgb(255 255 255 / 70%); border-color: rgb(255 255 255 / 35%); }
/* Metadatos (folio, módulo): texto de apoyo, no etiqueta en mayúsculas espaciadas. */
.eyebrow { color: var(--ink-3); font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; margin-bottom: 4px; }
.eyebrow.light { color: rgb(255 255 255 / 70%); }
/* Estación seleccionada sin bloques extra. */
.area-nav-row, .area-nav-row.selected, .area-nav-row:hover { background: none; box-shadow: none; }
/* La pestaña activa se subraya completa, con su botón de cerrar. */
.work-tab-group { display: inline-flex; align-items: center; border-bottom: 3px solid transparent; margin-bottom: -1px; height: 40px; }
.work-tab-group .work-tab { border-bottom: 0; margin: 0; height: 37px; }
.work-tab-group.selected { border-bottom-color: var(--ink); }
.work-tab-group.selected .work-tab { border-bottom: 0; }
/* Campos de formulario a la medida de una herramienta de trabajo. */
.field { gap: 5px; margin-bottom: 12px; }
.field > span { font-size: 12px; color: var(--ink-2); }
.field input, .field select, .field textarea { min-height: 34px; padding: 6px 10px; font-size: 13px; border-color: var(--rule-strong); border-radius: var(--r-1); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--ink-3); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--line) 22%, transparent); }
/* Barra de filtros compacta: la etiqueta va al lado del control. */
.commercial-filterbar { padding: 8px 12px; gap: 10px; align-items: center; }
.commercial-filterbar .field { flex-direction: row; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.commercial-filterbar .field > span { white-space: nowrap; }
.commercial-filterbar input, .commercial-filterbar select { min-height: 32px; }
.commercial-filterbar .search-field { min-height: 32px; }
.commercial-filterbar .search-field input { min-height: 30px; }
/* Ordenar áreas: solo al pasar o con teclado. */
.line-card .card-order-actions { position: absolute; top: 12px; right: 36px; margin: 0; opacity: 0; transition: opacity 150ms; }
.line-card:hover .card-order-actions, .line-card:focus-within .card-order-actions { opacity: 1; }
.line-card .card-order-actions button { width: 26px; height: 26px; border-radius: var(--r-1); }
.line-card .drag-grip { position: absolute; top: 14px; right: 10px; }
.work-tab-group.selected, .work-tab-group:hover { background: none; box-shadow: none; }
/* Revisión final: pestaña con su cierre dentro, buscador a la altura de los demás controles. */
/* r22: el cierre ya no se encima 4 px sobre la pestaña (margen negativo); la pestaña cede ese espacio de su relleno. */
.tab-close { position: static; transform: none; margin: 0 4px 0 0; }
.work-tab-group > .work-tab { padding-right: 6px; }
@media (max-width: 650px) { .work-tab-group > .work-tab { padding-right: 4px; } }
.search-field { min-height: 34px; padding-block: 0; }
.search-field input { min-height: 32px; padding-block: 4px; font-size: 13px; }
.commercial-grid-surface > .commercial-filterbar:first-child { padding-top: 8px; }
.tab-close { display: inline-grid; place-items: center; padding: 0; font-size: 16px; line-height: 1; }
.search-field { background: var(--surface-0); border-color: var(--rule-strong); border-radius: var(--r-1); padding-inline: 10px; gap: 8px; }
.search-field:focus-within, .picker-chips:focus-within, .pos-scan:focus-within { border-color: var(--line); box-shadow: 0 0 0 3px color-mix(in srgb, var(--line) 22%, transparent); }
.search-field input, .search-field input:focus { border: 0; box-shadow: none; color: var(--ink); }

/* ---------- Kit de módulos: Excel, pestañas internas, indicadores, carga ---------- */
.xl-menu { position: relative; display: inline-block; }
.xl-menu > summary { list-style: none; cursor: pointer; }
.xl-menu > summary::-webkit-details-marker { display: none; }
.xl-menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 40; min-width: 250px; padding: 4px; background: var(--surface-0); border: 1px solid var(--rule); border-radius: var(--r-2); box-shadow: 0 6px 24px rgb(20 20 22 / 10%); display: grid; }
.xl-menu-list button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; text-align: left; font: inherit; font-size: 13px; color: var(--ink); border-radius: var(--r-1); cursor: pointer; }
.xl-menu-list button:hover, .xl-menu-list button:focus-visible { background: var(--line-wash); }
.xl-menu-list .icon { width: 16px; height: 16px; color: var(--line-ink); }
.fz-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0 0 14px; overflow-x: auto; }
.fz-tabs button { border: 0; background: none; padding: 9px 14px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.fz-tabs button:hover { color: var(--ink); }
.fz-tabs button.active { color: var(--ink); border-bottom-color: var(--line); }
.fz-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.fz-kpi { background: var(--surface-0); border: 1px solid var(--rule); border-radius: var(--r-2); padding: 12px 14px; display: grid; gap: 2px; }
.fz-kpi span { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.fz-kpi strong { font-size: 20px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.fz-kpi small { font-size: 12px; color: var(--ink-3); }
.fz-kpi.tone-bad strong { color: var(--bad); }
.fz-kpi.tone-ok strong { color: var(--ok); }
.fz-kpi.tone-warn strong { color: var(--warn); }
.fz-loading { display: flex; align-items: center; gap: 10px; color: var(--ink-2); min-height: 80px; }
.fz-spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--rule); border-top-color: var(--line); animation: fz-spin 0.8s linear infinite; }
@keyframes fz-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fz-spinner { animation: none; } }
/* Pie de las listas paginadas (data-layer.js): cargar más, fin de la lista o error. */
.fz-list-foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; color: var(--ink-3); font-size: 12px; min-height: 44px; }
.fz-list-foot.is-error { color: var(--bad); }
.fz-grid td.num, .fz-grid th.num { text-align: right; font-variant-numeric: tabular-nums; }
.fz-grid tbody tr[data-open], .fz-grid tbody tr[tabindex] { cursor: pointer; }
.fz-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-bottom: 12px; }
.fz-toolbar label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.fz-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
@media (max-width: 760px) { .fz-two { grid-template-columns: 1fr; } .xl-menu-list { right: auto; left: 0; } }

/* ---------- Tema oscuro (Ajustes → Colores y apariencia; por usuario) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #e6e9ef; --ink-2: #b3bac7; --ink-3: #8b93a3;
  --surface-0: #141b2b; --surface-1: #0b1120; --surface-2: #1a2235;
  --rule: #263049; --rule-strong: #3a4664;
  --shell: #060d1c; --shell-2: #0d1a33;
  --brand-wash: #13244a;
  --ok: #4cc38a; --warn: #e3a43c; --bad: #ff6b6b; --info: #7fa9ff;
  --shadow: 0 6px 24px rgb(0 0 0 / 45%);
}
:root[data-theme="dark"] body { background: var(--surface-1); color: var(--ink); }
:root[data-theme="dark"] a { color: color-mix(in srgb, var(--line) 70%, white); }
:root[data-theme="dark"] .st-draft { background: var(--surface-2); color: var(--ink-2); }
:root[data-theme="dark"] .st-info { background: #16284d; color: var(--info); }
:root[data-theme="dark"] .st-warn, :root[data-theme="dark"] .tag-free { background: #3a2a0c; color: var(--warn); }
:root[data-theme="dark"] .st-ok { background: #0f3324; color: var(--ok); }
:root[data-theme="dark"] .st-bad { background: #3d1717; color: var(--bad); }
:root[data-theme="dark"] .lock-notice { background: #2c220d; border-color: #5a4415; }
:root[data-theme="dark"] .import-result.good, :root[data-theme="dark"] .pos-change, :root[data-theme="dark"] .share-status { background: #0f3324; color: var(--ok); border-color: #1d5a3f; }
:root[data-theme="dark"] .import-result.bad { background: #3d1717; color: var(--bad); }
:root[data-theme="dark"] .lines-grid tr.editing { background: #2c220d; }
:root[data-theme="dark"] .cmd-danger:hover:not(:disabled), :root[data-theme="dark"] .icon-button.danger:hover { background: #3d1717; border-color: #6b2626; color: var(--bad); }
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background-color: var(--surface-0); color: var(--ink); border-color: var(--rule-strong); }
:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: var(--ink-3); }
:root[data-theme="dark"] dialog { background: var(--surface-0); color: var(--ink); }
:root[data-theme="dark"] .user-menu { background: var(--surface-2); color: var(--ink); }
:root[data-theme="dark"] .button.secondary, :root[data-theme="dark"] .button.ghost { color: var(--ink); }
:root[data-theme="dark"] img.company-logo, :root[data-theme="dark"] .doc-preview iframe { background: #fff; }
:root[data-theme="dark"] .notice { background: var(--brand-wash); border-color: #24407a; color: var(--ink); }
:root[data-theme="dark"] .notice strong { color: var(--ink); }
:root[data-theme="dark"] .notice p { color: var(--ink-2); }
:root[data-theme="dark"] .line-card .module-card-footer span:first-child,
:root[data-theme="dark"] .text-button { color: color-mix(in srgb, var(--line) 65%, white); }
:root[data-theme="dark"] .workspace-header select { background-color: transparent; border-color: transparent; color: #fff; }
:root[data-theme="dark"] .workspace-header select option { background: var(--surface-0); }
.mig-xl-group { margin: 18px 0 6px; font-size: 15px; }
:root[data-theme="dark"] .workspace-header .logout { color: rgb(255 255 255 / 75%); }
:root[data-theme="dark"] .record-avatar { background: var(--surface-2); color: var(--ink-2); }
/* Beta 2026-10-09: superficies que usaban var(--ink) de fondo con texto blanco quedaban ilegibles en oscuro (--ink es claro). */
:root[data-theme="dark"] #toast:not(.error) { background: var(--surface-2); color: var(--ink); border: 1px solid var(--rule-strong); box-shadow: var(--shadow); }
:root[data-theme="dark"] .pos-bar { background: var(--shell-2); color: var(--ink); }
:root[data-theme="dark"] .pos-bar .cmd { color: var(--ink); }
:root[data-theme="dark"] .pos-bar .cmd:hover { background: var(--surface-2); border-color: var(--rule-strong); color: #fff; }
:root[data-theme="dark"] .bank-card.total { background: var(--shell-2); border-color: var(--rule-strong); }
/* Selección del árbol del área en oscuro: lavado oscuro (también fuera de .workspace-shell, donde quedaba el #e6efff claro
   de :root) y texto blanco, para que el renglón elegido siempre se lea. */
:root[data-theme="dark"] { --line-wash: #13244a; }
:root[data-theme="dark"] .area-nav-row.selected > button, :root[data-theme="dark"] .area-overview.selected { color: #fff; background: color-mix(in srgb, var(--line) 30%, var(--surface-0)); }
.mig-choices { display: grid; gap: 8px; margin: 8px 0 12px; } .mig-choices .check-line span { display: grid; gap: 2px; } .mig-choices small { color: var(--ink-3); font-weight: 400; }

/* ---------- Armonía de controles (auditoría de diseño, 7 oct 2026) ----------
   Un solo tamaño para todo lo que se captura: 34 px de alto, 4 px de esquina, 13 px de texto, borde --rule-strong.
   Antes solo los campos dentro de .field tenían medida; los sueltos (barras de filtros de los módulos) medían 20–22 px
   y los botones 35–44 px, así que las filas se veían chuecas. Ver docs/quality/auditoria-2026-10/diseno-y-armonia.md. */
:root { --ctl-h: 34px; --ctl-h-compact: 32px; --ctl-px: 10px; --ctl-fs: 13px; --check: 16px; }
/* Base de todo campo de texto y lista, con o sin .field (especificidad de un elemento: cualquier clase la ajusta). */
:is(input, select):where(:not([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"])):where(:not(.search-field *, .picker-chips *, .workspace-header *, td *, .fz-field *)) {
  min-height: var(--ctl-h); padding: 6px var(--ctl-px); font-size: var(--ctl-fs); line-height: 1.35;
  border: 1px solid var(--rule-strong); border-radius: var(--r-1); background-color: var(--surface-0); color: var(--ink); max-width: 100%;
}
textarea:where(:not(.fz-field *)) {
  padding: 8px var(--ctl-px); font-size: var(--ctl-fs); line-height: 1.45;
  border: 1px solid var(--rule-strong); border-radius: var(--r-1); background-color: var(--surface-0); color: var(--ink); max-width: 100%;
}
.field input, .field select { height: auto; line-height: 1.35; }
.field textarea { padding: 8px var(--ctl-px); line-height: 1.45; }
/* Importes, cantidades y tasas: a la derecha y con cifras tabulares, como en las listas. */
input[inputmode="decimal"], input[type="number"] { text-align: right; font-variant-numeric: tabular-nums; }
/* Validación: el borde se pone rojo solo después de que la persona tocó el campo. */
:is(input, select, textarea):user-invalid { border-color: var(--bad); }
:is(input, select, textarea):user-invalid:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--bad) 20%, transparent); }
input:disabled, select:disabled, textarea:disabled, input:read-only:not([type="checkbox"], [type="radio"], .picker-input) { background-color: var(--surface-2); color: var(--ink-2); }
/* Botones: la misma altura que los campos; el ícono no estira el botón. */
.button { min-height: var(--ctl-h); padding: 6px 14px; line-height: 1.2; }
.button .icon { width: 16px; height: 16px; }
.icon-button { flex: none; }
/* En la barra de comandos todo mide como un comando (32 px), incluido el menú «Excel». */
.cmdbar .button, .cmdbar .xl-menu > summary.button, .quote-commandbar .button { min-height: var(--ctl-h-compact); padding: 4px 10px; }
/* Casillas y radios: 16 px, centradas con la primera línea del texto aunque la etiqueta ocupe varias líneas. */
/* r21: los interruptores (`role="switch"`, p. ej. `.cw-switch`) dibujan su propio tamaño; esta regla los dejaba en 16 px y el texto arriba. */
input[type="checkbox"]:not([role="switch"]), input[type="radio"] { width: var(--check); height: var(--check); margin: 0; flex: none; vertical-align: -3px; }
label:has(> input[type="checkbox"]:not([role="switch"]):first-child, > input[type="radio"]:first-child) { align-items: flex-start; }
label:has(> input[type="checkbox"]:not([role="switch"]):first-child, > input[type="radio"]:first-child) > input:first-child { margin-top: max(0px, calc((1lh - var(--check)) / 2)); }
.check-line { gap: 8px; line-height: 20px; margin: 10px 0; }
.check-line input { width: var(--check); height: var(--check); }
.check-line small { line-height: 1.4; }
.roles-row { gap: 6px 22px; }
.roles-row .check-line { margin: 6px 0; }
/* Barras de filtros de los módulos: etiqueta arriba como en los formularios, controles a la misma línea base. */
.fz-toolbar { align-items: flex-end; gap: 10px 12px; }
.fz-toolbar label { gap: 5px; color: var(--ink-2); }
.fz-toolbar label:has(> input[type="checkbox"], > input[type="radio"]) { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; min-height: var(--ctl-h); font-weight: 500; color: var(--ink); }
.fz-toolbar label:has(> input[type="checkbox"], > input[type="radio"]) > input { margin-top: 0; }
.fz-toolbar > :is(input, select) { flex: 0 1 auto; }
.fz-toolbar .field { margin: 0; }
.fz-toolbar > .button, .fz-toolbar > button, .fz-toolbar > .xl-menu { align-self: flex-end; }
/* Barra de filtros de las listas comerciales: compacta (32 px) pero exacta. */
.commercial-filterbar :is(input, select):not(.search-field input), .commercial-filterbar .search-field { min-height: var(--ctl-h-compact); height: var(--ctl-h-compact); padding-block: 0; }
.commercial-filterbar .search-field input { min-height: 0; height: 30px; }
/* Captura de conceptos: importe y botón a la altura de los campos (antes 44 px y el importe quedaba más arriba). */
.line-entry-v2 .le-amount output { min-height: var(--ctl-h); border-radius: var(--r-1); border-color: var(--rule-strong); }
.le-actions .button { min-height: var(--ctl-h); }
/* Mensajes de error del formulario: placa de estado, también en tema oscuro. */
.inline-error { padding: 9px 12px; margin: 0 0 12px; border-radius: var(--r-1); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 8%, var(--surface-0)); color: var(--bad); }
.dialog-body > .inline-error:last-child { margin: 12px 0 0; }
/* Diálogos: el cuerpo y el pie empiezan en el mismo borde que el título; las acciones van a la derecha. */
.dialog-body { padding: 14px 18px 16px; }
.dialog-footer { justify-content: flex-end; gap: 8px; }
/* Etiquetas largas que ocupan dos líneas («Tipo de cambio (vacío = FIX del día)») ya no bajan su campo:
   en cada fila de la cuadrícula los controles se alinean abajo. Solo en cuadrículas hechas únicamente de campos y sin
   textos de ayuda bajo el control (si hay otros bloques, se conserva la alineación arriba). */
.form-grid:not(:has(> :not(.field, input[type="hidden"]), > .field > .help, > .field > small)) > .field { justify-content: flex-end; }
/* La última fila de una sección conserva el mismo margen en todos sus campos (antes solo los dos últimos, y con un
   número impar de campos el par quedaba desfasado 8 px). */
.form-section > .form-grid:last-child .field:nth-last-child(-n + 2) { margin-bottom: 12px; }
.form-section > .form-grid:last-child { margin-bottom: -8px; }
/* Acciones dentro de la cuadrícula: a la altura de los controles de su fila. */
.form-grid > .form-actions { align-self: end; margin: 0 0 12px; }
/* Filas flexibles alineadas abajo: el campo no lleva margen inferior propio. */
.wk-timer .field, .sct-period .field { margin: 0; }
/* Campos dentro de celdas (hoja de impuestos, ajustes en tablas): compactos de 30 px pero con el mismo borde y esquina. */
td :is(input, select):where(:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"])) {
  min-height: 30px; padding: 4px 8px; font-size: var(--ctl-fs); line-height: 1.35;
  border: 1px solid var(--rule-strong); border-radius: var(--r-1); background-color: var(--surface-0); color: var(--ink); max-width: 100%;
}
/* Teléfono: en el pie de los diálogos los botones no se parten en dos líneas (se veían de alturas distintas). */
@media (max-width: 760px) {
  .dialog-footer { flex-wrap: wrap; }
  .dialog-footer .button { flex: 1 1 auto; white-space: nowrap; }
}
.dialog-body > :last-child:is(.help, p) { margin-bottom: 0; }

/* Beta 2026-10-09: dentro de tablas (renglones de requisiciones, órdenes, etc.) las reglas de inputs en celdas quitaban el
   espacio del ícono del buscador y el ícono quedaba encima del texto. */
.picker > .picker-input.picker-input.picker-input { padding-left: 34px; padding-right: 30px; }
td .picker .picker-icon { left: 10px; }

/* ==================================================================================================================
   Desplazamiento: la página es la que se desplaza (oct 2026)
   Regla única para toda la app (queja del propietario: «solo se desplazan los registros y ya no puedo subir o bajar la
   página»):
   1. La ventana es la que se desplaza. Dentro de la página no hay cajas con altura del tamaño de la pantalla
      (height/max-height en vh o px grandes) y overflow:auto que atrapen la rueda, el dedo o el teclado.
   2. Si una caja interna de verdad hace falta (vista de XML, lista corta de casillas, árbol lateral fijo), es chica
      respecto a la pantalla (≤ ~45vh) y conserva overscroll-behavior:auto: al llegar a su borde el gesto sigue con la
      página. Ningún script captura la rueda ni el dedo (wheel/touchmove con preventDefault).
   3. Excepciones que SÍ contienen el gesto (overscroll-behavior: contain): diálogos modales (solo su cuerpo se desplaza
      y la página de atrás queda quieta), menús, listas desplegables, popovers y capas de pantalla completa.
   Las listas de registros (data-grid.css) siguen la misma regla con su encabezado flotante.
   ================================================================================================================== */

/* Barra de la ventana siempre reservada: al bloquear la página con un diálogo abierto el contenido no brinca. */
html { scrollbar-gutter: stable; }
/* Con un diálogo modal abierto la página de atrás no se mueve (tampoco con la rueda sobre el fondo oscuro). */
html:has(dialog[open]:modal) { overflow: hidden; }
/* El diálogo y su cuerpo contienen el gesto: al llegar al final no empujan la página de atrás. */
dialog:modal, dialog .dialog-body { overscroll-behavior: contain; }

/* Árbol del área en escritorio: panel lateral fijo (sticky); su lista puede desplazarse, pero en sus bordes el gesto
   pasa a la página (nunca contain). */
.area-sidebar .area-nav { overscroll-behavior: auto; }

/* Árbol apilado sobre el contenido (≤ 900 px: tableta y teléfono): fluye con la página, sin caja propia. Para no
   empujar el contenido, al abrir una sección se pliega con el botón «Secciones» (navigation-ui.js), como ya pasaba
   en el teléfono. */
@media (max-width: 900px) {
  .workspace-main.area-workspace { grid-template-columns: minmax(0, 1fr); }
  .area-sidebar, .area-sidebar.mobile-folded { position: static; top: auto; max-height: none; }
  .area-sidebar .area-nav { overflow: visible; }
  .area-sidebar-title { flex-wrap: wrap; }
  .area-tree-toggle { display: inline-flex; margin-left: auto; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0); color: var(--ink); font-size: 13px; font-weight: 600; }
  .area-sidebar.mobile-folded .area-nav, .area-sidebar.mobile-folded .area-sidebar-foot { display: none; }
  .area-sidebar.mobile-folded { margin-bottom: 10px; }
}

/* Cajas internas chicas que se quedan (casillas de fuentes, XML, avisos de importación, recepciones): nunca más de
   ~45 % de la pantalla (en un teléfono acostado 340 px eran casi toda la vista). `html` sube la especificidad porque
   algunas hojas de módulo cargan después de esta. */
html .report-source-grid { max-height: min(340px, 45vh); }
html .fl-xml pre { max-height: min(320px, 45vh); }
html .import-changes, html .lc-receipts, html ul.plain.small { max-height: min(260px, 45vh); }
html .import-result ul, html .pkg-checks, html .wp-sample { max-height: min(220px, 45vh); }

/* ---------- Pestañas de trabajo: arrastrar, menú (duplicar, cambiar nombre, mover, cerrar) — ronda 12 oct 2026 ---------- */
/* Ronda 13: ordenar con eventos de puntero (navigation-ui.js). La pestaña sigue al mouse y una línea marca dónde queda. */
.work-tabs { position: relative; user-select: none; -webkit-user-select: none; }
.work-tabs .work-tab, .work-tabs .work-tab * { -webkit-user-drag: none; }
.work-tabs.is-sorting .work-tab-group:not(.is-lifted) { pointer-events: none; }
.work-tab-group.is-lifted { position: relative; z-index: 3; cursor: grabbing; background: var(--surface-0); box-shadow: 0 6px 18px color-mix(in srgb, var(--ink) 18%, transparent); border-radius: var(--r-1); opacity: 0.96; }
.tab-drop-marker { position: absolute; top: 6px; bottom: 6px; left: 0; width: 3px; border-radius: 2px; background: var(--accent); pointer-events: none; z-index: 4; }
body.fz-tab-sorting, body.fz-tab-sorting * { cursor: grabbing !important; }
@media (prefers-reduced-motion: no-preference) { .tab-drop-marker { transition: transform 90ms var(--fz-ease-out, ease-out); } }
.fz-tab-menu {
  position: fixed; z-index: 1000; display: flex; flex-direction: column; min-width: 210px; padding: 4px;
  border: 1px solid var(--rule); border-radius: var(--r-2); background: var(--surface-0);
  box-shadow: 0 12px 30px color-mix(in srgb, var(--ink) 18%, transparent);
}
.fz-tab-menu button {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; border-radius: 4px; background: none;
  color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.fz-tab-menu button:hover, .fz-tab-menu button:focus-visible { background: var(--surface-2); outline: none; }
.fz-tab-menu .icon { width: 16px; height: 16px; flex: 0 0 auto; color: var(--ink-2); }

