:root {
  --topbar-height: 86px;
  --navy-950: #0f2947;
  --navy-900: #173a63;
  --navy-800: #214f7e;
  --navy-700: #2d669b;
  --blue-500: #1583c7;
  --blue-100: #dceef9;
  --cyan-100: #e7f7fb;
  --orange-500: #ef742e;
  --orange-100: #fff0e7;
  --lime-500: #92d34e;
  --on-primary: #ffffff;
  --on-secondary: #ffffff;
  --on-accent: #111827;
  --lime-100: #eaf6dd;
  --purple-500: #7638a8;
  --purple-100: #f2e9f9;
  --red-500: #d94d5d;
  --red-100: #fdebed;
  --amber-500: #f1ad21;
  --amber-100: #fff6dd;
  --green-600: #1b8c62;
  --green-100: #e5f5ee;
  --ink: #142333;
  --muted: #687889;
  --line: #dbe4eb;
  --surface: #ffffff;
  --canvas: #f4f7f9;
  --shadow: 0 14px 35px rgba(28, 55, 79, 0.12);
  --radius: 16px;
}

/* Biblioteca personal y compartida de valores predefinidos */
.cost-values-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: end;
  gap: 24px;
  margin-bottom: 16px;
}
.cost-values-hero h2,
.cost-values-hero p { margin: 0; }
.cost-values-hero h2 { color: var(--ink); font-size: 23px; line-height: 1.15; }
.cost-values-hero > div > p:last-child { max-width: 760px; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.cost-values-hero label,
.cost-group-search,
.cost-group-create-form label,
.cost-group-settings label,
.cost-values-create label,
.cost-value-row label,
.cost-values-toolbar label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.cost-values-hero :is(select, input),
.cost-group-search input,
.cost-group-create-form :is(input, textarea),
.cost-group-settings :is(input, textarea),
.cost-values-create :is(select, input),
.cost-value-row :is(select, input),
.cost-values-toolbar input {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--theme-strong-line);
  border-radius: 9px;
  color: var(--ink);
  outline: 0;
  background: var(--theme-input-bg);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
}
.cost-group-create-form textarea,
.cost-group-settings textarea { min-height: 70px; resize: vertical; }
.cost-values-hero :is(select, input):focus,
.cost-group-search input:focus,
.cost-group-create-form :is(input, textarea):focus,
.cost-group-settings :is(input, textarea):focus,
.cost-values-create :is(select, input):focus,
.cost-value-row :is(select, input):focus,
.cost-values-toolbar input:focus {
  border-color: var(--blue-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent);
}
.cost-library-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.cost-group-sidebar { display: grid; gap: 13px; padding: 16px; }
.cost-group-sidebar-header,
.cost-group-detail-header,
.cost-group-card-top,
.cost-group-meta,
.cost-values-toolbar,
.cost-group-header-actions,
.cost-share-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.cost-group-sidebar-header h2 { margin: 1px 0 0; color: var(--ink); font-size: 18px; }
.cost-group-sidebar-header .button { min-height: 38px; padding-inline: 12px; white-space: nowrap; }
.cost-group-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 10px; background: var(--theme-subtle-bg); }
.cost-group-tabs button {
  min-height: 35px;
  padding: 5px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.cost-group-tabs button span { opacity: .72; }
.cost-group-tabs button:hover { color: var(--ink); }
.cost-group-tabs button.is-active { color: var(--ink); background: var(--theme-input-bg); box-shadow: 0 1px 4px color-mix(in srgb, var(--ink) 10%, transparent); }
.cost-group-create-form { display: grid; gap: 10px; padding: 12px; border: 1px solid color-mix(in srgb, var(--blue-500) 35%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--blue-100) 38%, var(--surface)); }
.cost-group-create-form > div { display: flex; justify-content: flex-end; gap: 7px; }
.cost-group-list { display: grid; gap: 8px; max-height: min(66vh, 720px); overflow-y: auto; padding: 1px 3px 3px 1px; }
.cost-group-card {
  display: grid;
  width: 100%;
  gap: 7px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--theme-input-bg);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.cost-group-card:hover { border-color: color-mix(in srgb, var(--blue-500) 55%, var(--line)); transform: translateY(-1px); }
.cost-group-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue-500) 24%, transparent); outline-offset: 2px; }
.cost-group-card.is-selected { border-color: var(--blue-500); background: color-mix(in srgb, var(--blue-100) 32%, var(--theme-input-bg)); box-shadow: 0 7px 18px color-mix(in srgb, var(--blue-500) 12%, transparent); }
.cost-group-card-top strong { overflow: hidden; color: var(--ink); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.cost-group-badge { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.cost-group-badge.is-owned { color: var(--blue-700); background: var(--blue-100); }
.cost-group-badge.is-shared { color: var(--green-700); background: var(--green-100); }
.cost-group-description { overflow: hidden; color: var(--muted); font-size: 11px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.cost-group-meta { justify-content: flex-start; flex-wrap: wrap; color: var(--ink); font-size: 10px; font-weight: 750; }
.cost-group-meta span + span::before { content: "·"; margin-right: 9px; color: var(--muted); }
.cost-group-card small { color: var(--muted); font-size: 9px; }
.cost-group-list-empty,
.cost-group-empty,
.cost-values-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  min-height: 170px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}
.cost-group-list-empty strong,
.cost-group-empty h2,
.cost-values-empty strong { margin: 0; color: var(--ink); font-size: 14px; }
.cost-group-list-empty span,
.cost-group-empty p,
.cost-values-empty span { margin: 0; max-width: 440px; font-size: 11px; line-height: 1.5; }
.cost-group-empty { min-height: 420px; border: 1px dashed var(--theme-strong-line); border-radius: 13px; background: var(--surface); }
.cost-group-empty-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--blue-600); background: var(--blue-100); font-size: 26px; }
.cost-group-detail { overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.cost-groups-back { display: none; }
.cost-group-detail-header { align-items: flex-start; padding: 20px; border-bottom: 1px solid var(--line); }
.cost-group-detail-header h2 { margin: 3px 0 5px; color: var(--ink); font-size: 21px; line-height: 1.18; }
.cost-group-detail-header p { max-width: 700px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.cost-group-kicker { color: var(--blue-600); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.cost-group-summary { display: inline-block; margin-top: 9px; color: var(--ink); font-size: 10px; font-weight: 800; }
.cost-group-header-actions { flex: 0 0 auto; flex-wrap: wrap; align-items: flex-start; }
.cost-group-delete-control { display: grid; justify-items: end; gap: 4px; }
.cost-group-delete-control small { max-width: 190px; color: var(--muted); font-size: 9px; line-height: 1.35; text-align: right; }
.cost-group-delete-control .button[aria-busy="true"] { cursor: wait; opacity: .72; }
.cost-group-delete-control .button:disabled { cursor: not-allowed; opacity: .58; }
.cost-group-readonly { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px 16px; padding: 12px 20px; color: var(--green-800); background: color-mix(in srgb, var(--green-100) 70%, var(--surface)); font-size: 11px; }
.cost-group-readonly span:last-child { color: var(--muted); }
.cost-share-panel { display: grid; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--blue-100) 38%, var(--surface)); }
.cost-share-panel-header { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 18px; }
.cost-share-panel h3,
.cost-share-accesses h4 { margin: 0; color: var(--ink); }
.cost-share-panel h3 { font-size: 15px; }
.cost-share-accesses h4 { font-size: 12px; }
.cost-share-panel p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.cost-share-effective-count { flex: 0 0 auto; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--green-500) 35%, var(--line)); border-radius: 999px; color: var(--green-800); background: color-mix(in srgb, var(--green-100) 72%, var(--surface)); font-size: 9px; font-weight: 800; white-space: nowrap; }
.cost-share-effective-count strong { margin-right: 3px; font-size: 12px; }
.cost-share-panel form { display: grid; min-width: 0; grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); align-items: start; gap: 16px; }
.cost-share-picker,
.cost-share-accesses { display: grid; min-width: 0; gap: 8px; }
.cost-share-picker > label { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cost-share-combobox { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 42px; padding: 0 11px; border: 1px solid var(--theme-input-border); border-radius: 9px; background: var(--theme-input-bg); }
.cost-share-combobox:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.cost-share-combobox > span { color: var(--blue-600); font-size: 17px; }
.cost-share-combobox input { width: 100%; min-width: 0; height: 40px; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font: inherit; font-size: 11px; }
.cost-share-options { display: grid; max-height: 250px; overflow-y: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--theme-input-bg); box-shadow: var(--shadow-sm); }
.cost-share-option { display: grid; width: 100%; min-width: 0; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 52px; padding: 8px 10px; border: 0; border-top: 1px solid var(--line); color: var(--ink); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.cost-share-option:first-child { border-top: 0; }
.cost-share-option:hover,
.cost-share-option:focus-visible { outline: 0; background: color-mix(in srgb, var(--blue-100) 54%, transparent); }
.cost-share-option > span:nth-child(2),
.cost-share-access-row td:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.cost-share-option strong,
.cost-share-access-row strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.cost-share-option small,
.cost-share-access-row small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.cost-share-option > b { color: var(--blue-600); font-size: 15px; }
.cost-share-type { display: inline-flex; width: fit-content; align-items: center; min-height: 22px; padding: 3px 7px; border-radius: 999px; font-size: 8px; font-weight: 850; white-space: nowrap; }
.cost-share-type.is-person { color: var(--blue-700); background: var(--blue-100); }
.cost-share-type.is-user-group { color: var(--green-800); background: var(--green-100); }
.cost-share-options-empty { margin: 0 !important; padding: 18px 12px; text-align: center; }
.cost-share-accesses-heading { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.cost-share-accesses-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 9px; font-weight: 800; }
.cost-share-table-wrap { min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--theme-input-bg); }
.cost-share-access-table { width: 100%; min-width: 470px; border-collapse: collapse; table-layout: fixed; }
.cost-share-access-table th,
.cost-share-access-table td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: left; vertical-align: middle; }
.cost-share-access-table thead th { border-top: 0; color: var(--muted); background: var(--theme-subtle-bg); font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cost-share-access-table thead th:first-child { width: 125px; }
.cost-share-access-table thead th:last-child { width: 78px; text-align: right; }
.cost-share-section-row th { padding-block: 6px; color: var(--ink); background: color-mix(in srgb, var(--blue-100) 36%, var(--surface)); font-size: 9px; font-weight: 850; }
.cost-share-section-row span { margin-left: 4px; color: var(--muted); }
.cost-share-access-row td:last-child { text-align: right; }
.cost-share-access-row .button { min-height: 32px; padding: 5px 8px; font-size: 8px; }
.cost-share-access-row.is-unavailable { background: color-mix(in srgb, var(--danger-100) 28%, transparent); }
.cost-share-access-row.is-unavailable .cost-share-type { opacity: .68; }
.cost-share-unavailable-note { color: var(--danger-700) !important; white-space: normal !important; }
.cost-share-section-empty td { padding: 13px 10px; color: var(--muted); font-size: 9px; text-align: center; }
.cost-share-inheritance-note { color: var(--muted); font-size: 9px; line-height: 1.45; }
.cost-share-actions { grid-column: 1 / -1; justify-content: flex-end; }
.cost-share-actions .button[aria-busy="true"] { cursor: wait; opacity: .72; }
.cost-group-settings { border-bottom: 1px solid var(--line); }
.cost-group-settings summary,
.cost-values-create summary { padding: 12px 20px; color: var(--blue-700); font-size: 11px; font-weight: 850; cursor: pointer; }
.cost-group-settings[open] summary,
.cost-values-create[open] summary { border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.cost-group-settings form { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 1.3fr) auto; align-items: end; gap: 10px; padding: 14px 20px; }
.cost-group-settings .button { min-height: 42px; }
.cost-group-detail .cost-values-bulk { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; margin: 0; padding: 16px 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.cost-group-detail .cost-values-bulk h3,
.cost-group-detail .cost-values-bulk p { margin: 0; }
.cost-group-detail .cost-values-bulk h3 { color: var(--ink); font-size: 14px; }
.cost-group-detail .cost-values-bulk p:last-child { margin-top: 4px; font-size: 10px; }
.cost-group-detail .cost-values-bulk-actions { display: grid; grid-template-columns: 1fr 1fr; min-width: 280px; gap: 7px; }
.cost-group-detail .cost-values-bulk-actions .button { min-height: 39px; }
.cost-values-import-status { grid-column: 1 / -1; }
.cost-group-detail .cost-values-list-panel { overflow: visible; padding: 0; }
.cost-group-detail .cost-values-toolbar { min-width: 0; padding: 14px 20px 9px; border: 0; background: transparent; }
.cost-group-detail .cost-values-toolbar label { min-width: min(100%, 360px); }
.cost-group-detail .cost-values-toolbar > span { color: var(--muted); font-size: 10px; font-weight: 800; white-space: nowrap; }
.cost-library-sections {
  display: grid;
  min-width: 0;
  gap: 14px;
  padding: 14px 20px 20px;
  background: var(--theme-subtle-bg);
}
.cost-library-section {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  box-shadow: 0 2px 7px color-mix(in srgb, var(--ink) 5%, transparent);
}
.cost-library-section-header {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--theme-quiet-bg);
}
.cost-library-section-number {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--navy-800);
  background: var(--blue-100);
  font-size: 9px;
  font-weight: 900;
  line-height: 1;
}
.cost-library-section-title { min-width: 0; }
.cost-library-section-header h3,
.cost-library-section-header p { margin: 0; }
.cost-library-section-header h3 { color: var(--navy-950); font-size: 13px; line-height: 1.25; }
.cost-library-section-header p {
  overflow: hidden;
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cost-library-section-count {
  min-width: max-content;
  padding: 5px 8px;
  border: 1px solid color-mix(in srgb, var(--blue-500) 22%, var(--line));
  border-radius: 999px;
  color: var(--blue-700);
  background: color-mix(in srgb, var(--blue-100) 55%, var(--surface));
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}
.cost-library-section-items { display: grid; min-width: 0; }
.cost-library-section-empty,
.cost-library-section-no-match {
  display: grid;
  min-height: 94px;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}
.cost-library-section-empty strong,
.cost-library-section-no-match strong { color: var(--ink); font-size: 11px; }
.cost-library-section-empty span,
.cost-library-section-no-match span { max-width: 480px; font-size: 9px; line-height: 1.45; }
.cost-library-section .cost-value-row { padding-inline: 16px; }
.cost-group-detail .cost-values-create { margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cost-group-detail .cost-values-create form { display: grid; min-width: 0; grid-template-columns: minmax(90px, .55fr) minmax(180px, 1.45fr) minmax(150px, 1fr) minmax(100px, .7fr) minmax(120px, .8fr) minmax(90px, .55fr) auto; align-items: end; gap: 8px; padding: 14px 20px; }
.cost-group-detail .cost-values-create .button { min-height: 42px; white-space: nowrap; }
.cost-group-detail .cost-values-list { display: grid; min-width: 0; }
.cost-group-detail .cost-value-row { display: grid; min-width: 0; grid-template-columns: minmax(90px, .55fr) minmax(180px, 1.45fr) minmax(150px, 1fr) minmax(100px, .7fr) minmax(120px, .8fr) minmax(90px, .55fr) minmax(125px, .75fr); align-items: end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
.cost-group-detail .cost-value-row:first-child { border-top: 1px solid var(--line); }
.cost-group-detail .cost-library-section-items > .cost-value-row:first-child { border-top: 0; }
.cost-group-detail .cost-value-row:hover { background: color-mix(in srgb, var(--blue-100) 24%, transparent); }
.cost-group-detail .cost-value-row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.cost-group-detail .cost-value-row-actions .button { min-height: 40px; padding-inline: 7px; font-size: 9px; }
.cost-group-detail .cost-value-row.is-readonly { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.cost-value-code { padding: 5px 7px; border-radius: 6px; color: var(--blue-800); background: var(--blue-100); font-size: 9px; font-weight: 900; }
.cost-value-main { display: grid; gap: 3px; min-width: 0; }
.cost-value-main strong { overflow: hidden; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.cost-value-main small { color: var(--muted); font-size: 10px; }
.cost-value-amount { color: var(--ink); font-size: 12px; white-space: nowrap; }
.cost-catalog-result em { overflow: hidden; color: var(--blue-600); font-size: 7px; font-style: normal; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.cost-values-loading,
.cost-values-error { min-height: 390px; }

@media (max-width: 1700px) {
  .cost-group-detail .cost-values-create form,
  .cost-group-detail .cost-value-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cost-group-detail .cost-value-description { grid-column: span 2; }
  .cost-group-detail .cost-value-row-actions { align-self: stretch; }
}

@media (max-width: 1180px) {
  .cost-library-layout { grid-template-columns: minmax(250px, 300px) minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .cost-share-panel form { grid-template-columns: 1fr; }
  .cost-share-actions { grid-column: auto; }
  .cost-share-options { max-height: 220px; }
  .cost-library-sections { padding: 12px 14px 16px; }
  .cost-library-section-header { padding-inline: 14px; }
}

@media (max-width: 860px) {
  .cost-values-hero,
  .cost-library-layout,
  .cost-share-panel,
  .cost-group-settings form,
  .cost-group-detail .cost-values-bulk { grid-template-columns: 1fr; }
  .cost-group-list { max-height: 360px; }
  .cost-library-layout:not(.is-detail-view) .cost-group-detail { display: none; }
  .cost-library-layout.is-detail-view .cost-group-sidebar { display: none; }
  .cost-groups-back {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    margin: 12px 14px 0;
    padding: 7px 10px;
    border: 0;
    border-radius: 8px;
    color: var(--blue-600);
    background: var(--blue-100);
    font: inherit;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
  }
  .cost-group-detail-header { flex-direction: column; }
  .cost-group-header-actions { width: 100%; justify-content: flex-start; }
  .cost-group-delete-control { justify-items: start; }
  .cost-group-delete-control small { text-align: left; }
  .cost-group-detail .cost-values-bulk-actions { min-width: 0; }
}

@media (max-width: 620px) {
  .cost-values-hero { padding: 15px; }
  .cost-values-hero h2 { font-size: 20px; }
  .cost-group-sidebar { padding: 13px; }
  .cost-group-sidebar-header { align-items: flex-start; }
  .cost-group-sidebar-header .button { min-height: 42px; }
  .cost-share-panel { padding-inline: 14px; }
  .cost-share-panel-header { align-items: stretch; flex-direction: column; gap: 10px; }
  .cost-share-effective-count { width: fit-content; white-space: normal; }
  .cost-share-access-table { min-width: 0; }
  .cost-share-access-table thead { display: none; }
  .cost-share-access-table tbody { display: block; }
  .cost-share-section-row,
  .cost-share-section-row th,
  .cost-share-section-empty,
  .cost-share-section-empty td { display: block; width: 100%; }
  .cost-share-access-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 10px; border-top: 1px solid var(--line); }
  .cost-share-access-row td { padding: 0; border: 0; }
  .cost-share-access-row td:first-child { grid-column: 1; grid-row: 1; }
  .cost-share-access-row td:nth-child(2) { grid-column: 1; grid-row: 2; }
  .cost-share-access-row td:last-child { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .cost-share-access-row strong,
  .cost-share-access-row small { white-space: normal; }
  .cost-share-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .cost-share-actions .button { width: 100%; }
  .cost-group-tabs { grid-template-columns: 1fr; }
  .cost-group-tabs button { text-align: left; padding-inline: 10px; }
  .cost-group-detail-header,
  .cost-group-detail .cost-values-toolbar,
  .cost-group-settings form,
  .cost-group-detail .cost-values-bulk,
  .cost-group-detail .cost-values-create form,
  .cost-group-detail .cost-value-row { padding-inline: 14px; }
  .cost-group-readonly { grid-template-columns: 1fr; padding-inline: 14px; }
  .cost-group-detail .cost-values-toolbar { align-items: stretch; flex-direction: column; }
  .cost-group-detail .cost-values-toolbar { grid-template-columns: minmax(0, 1fr); }
  .cost-group-detail .cost-values-toolbar label { min-width: 0; }
  .cost-library-sections { gap: 10px; padding: 10px 14px 14px; }
  .cost-library-section-header { grid-template-columns: auto minmax(0, 1fr); align-items: start; padding: 12px; }
  .cost-library-section-header p { overflow: visible; white-space: normal; }
  .cost-library-section-count { grid-column: 2; justify-self: start; min-width: 0; }
  .cost-library-section .cost-value-row { padding-inline: 12px; }
  .cost-library-section-empty,
  .cost-library-section-no-match { min-height: 82px; padding: 15px 12px; }
  .cost-group-detail .cost-values-create form,
  .cost-group-detail .cost-value-row { grid-template-columns: 1fr; }
  .cost-group-detail .cost-value-description { grid-column: auto; }
  .cost-group-detail .cost-value-row-actions { grid-template-columns: 1fr 1fr; }
  .cost-group-detail .cost-value-row.is-readonly { grid-template-columns: auto minmax(0, 1fr); }
  .cost-value-amount { grid-column: 2; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid #ffbf47;
  outline-offset: 3px;
}

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: 236px;
  overflow-y: auto;
  flex-direction: column;
  padding: 24px 16px 18px;
  color: var(--on-primary);
  background: var(--navy-900);
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  color: var(--on-accent);
  background: var(--lime-500);
  font-weight: 900;
  letter-spacing: -0.04em;
}
.brand strong { display: block; font-size: 15px; letter-spacing: .01em; }
.brand span { display: block; margin-top: 2px; color: var(--on-primary); font-size: 12px; opacity: .76; }
.brand-logo { width: 54px; height: 42px; flex: 0 0 auto; object-fit: contain; object-position: left center; }

.navigation { display: grid; gap: 6px; }
.nav-item {
  display: grid;
  width: 100%;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 12px;
  border: 0;
  border-radius: 11px;
  color: var(--on-primary);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: .18s ease;
}
.nav-item:hover { color: var(--on-primary); background: rgba(255,255,255,.12); opacity: 1; }
.nav-item.active { color: var(--on-primary); background: rgba(255,255,255,.18); box-shadow: inset 4px 0 var(--lime-500); opacity: 1; }
.nav-icon { font-size: 18px; line-height: 1; text-align: center; }
.nav-count { min-width: 24px; padding: 2px 6px; border-radius: 999px; color: var(--on-accent); background: var(--lime-500); font-size: 11px; font-weight: 800; text-align: center; }
.nav-group { display: grid; gap: 4px; }
.nav-parent.active { background: rgba(255,255,255,.12); box-shadow: inset 4px 0 var(--lime-500); }
.nav-chevron { display: grid; width: 22px; height: 22px; place-items: center; font-size: 15px; transition: transform .18s ease; }
.nav-parent[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }
.nav-submenu { display: grid; gap: 3px; padding: 0 0 2px 18px; }
.nav-submenu[hidden] { display: none; }
.nav-subitem { min-height: 38px; grid-template-columns: 14px minmax(0, 1fr); gap: 7px; padding: 7px 10px; border-radius: 9px; font-size: 11px; }
.nav-subitem-marker { width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; opacity: .72; }
.nav-subitem.active .nav-subitem-marker { border-color: var(--lime-500); background: var(--lime-500); opacity: 1; }
.nav-item.subtle { grid-template-columns: 26px 1fr; }
.sidebar-spacer { flex: 1; }
.sidebar-note { display: flex; gap: 10px; align-items: center; margin: 0 5px 14px; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 12px; background: rgba(255,255,255,.04); }
.sidebar-note .signal { width: 9px; height: 9px; border-radius: 50%; background: var(--lime-500); box-shadow: 0 0 0 5px rgba(146,211,78,.12); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 12px; }
.sidebar-note small { color: var(--on-primary); font-size: 10px; opacity: .72; }
.logout-form { margin: 0; }
.session-user { overflow: hidden; margin: 0 8px 7px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.1); }
.session-avatar-button { display: grid; width: 100%; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 9px; padding: 5px; border: 0; border-radius: 10px; color: inherit; background: transparent; cursor: pointer; text-align: left; }
.session-avatar-button:hover { background: rgba(255,255,255,.1); }
.session-avatar { display: grid; width: 34px; height: 34px; overflow: hidden; place-items: center; border: 2px solid rgba(255,255,255,.28); border-radius: 50%; color: var(--on-accent); background: var(--lime-500); font-size: 10px; font-weight: 900; }
.session-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.session-user-copy { min-width: 0; }
.session-user strong, .session-user small, .session-user-copy > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-user strong { color: var(--on-primary); font-size: 11px; }
.session-user small { color: var(--on-primary); font-size: 9px; opacity: .72; }
.session-user-copy > span { margin-top: 2px; color: var(--lime-500); font-size: 8px; font-weight: 750; }

.workspace { width: calc(100% - 236px); min-width: 0; margin-left: 236px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 86px;
  align-items: center;
  gap: 22px;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(219,228,235,.9);
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px);
  transition: transform .18s ease, opacity .18s ease;
}
html.pipeline-columns-active .topbar { opacity: 0; transform: translateY(-100%); pointer-events: none; }
.page-heading { min-width: 190px; }
.eyebrow { margin: 0 0 3px; color: var(--navy-700); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.page-heading h1, .modal-header h2 { margin: 0; color: var(--navy-950); font-size: 26px; line-height: 1.15; letter-spacing: -.035em; }
.top-actions { display: flex; align-items: center; margin-left: auto; gap: 8px; }
.environment-context { display: flex; align-items: flex-end; gap: 6px; padding: 4px 6px 4px 7px; border: 1px solid var(--line); border-radius: 10px; background: var(--theme-subtle-bg, #f8fafc); transition: opacity .16s ease, border-color .16s ease, box-shadow .16s ease; }
.environment-context[aria-busy="true"] { opacity: .58; pointer-events: none; }
.environment-context-control { display: grid; gap: 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.environment-context-control select { min-width: 122px; height: 28px; padding: 2px 26px 2px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-950); background: var(--theme-input-bg, #fff); font-size: 11px; font-weight: 800; text-transform: none; }
.environment-status-chip { display: inline-flex; height: 28px; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid #b9dfcc; border-radius: 999px; color: #176044; background: #e9f8f0; font-size: 9px; font-weight: 850; white-space: nowrap; }
.environment-status-dot { width: 6px; height: 6px; border-radius: 50%; background: #1b8c62; box-shadow: 0 0 0 3px rgba(27,140,98,.12); }
html[data-crm-environment="staging"] .topbar { border-bottom-color: #f0cf8b; box-shadow: inset 0 3px 0 #d68a00; }
html[data-crm-environment="staging"] .environment-context { border-color: #e8c675; background: #fff9e9; box-shadow: inset 0 0 0 1px rgba(214,138,0,.08); }
html[data-crm-environment="staging"] .environment-status-chip { border-color: #edce87; color: #765000; background: #fff3cc; }
html[data-crm-environment="staging"] .environment-status-dot { background: #d68a00; box-shadow: 0 0 0 3px rgba(214,138,0,.15); }
.quote-panel-toggle.is-active { border-color: var(--blue-500); color: var(--on-secondary); background: var(--blue-500); box-shadow: 0 6px 15px color-mix(in srgb, var(--blue-500) 20%, transparent); }
.staging-action { border-color: #e4bd60 !important; color: #765000 !important; background: #fff8df !important; }
.company-context { display: grid; gap: 2px; margin-right: 4px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.company-context select { min-width: 175px; height: 28px; padding: 2px 26px 2px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy-950); background: #fff; font-size: 11px; font-weight: 750; text-transform: none; }
.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .48; cursor: not-allowed; transform: none; }
.button.primary { color: var(--on-primary); background: var(--navy-900); box-shadow: 0 7px 16px rgba(23,58,99,.18); }
.button.primary:hover { filter: brightness(.9); }
.button.ghost { border-color: var(--line); color: var(--navy-900); background: #fff; }
.button.danger-ghost { border-color: #f1c6cb; color: #af3040; background: #fff; }
.button.full { width: 100%; }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 24px; cursor: pointer; }

.content { position: relative; padding: 22px 28px 36px; transition: opacity .16s ease; }
.content[aria-busy="true"] { opacity: .48; pointer-events: none; }
.content[aria-busy="true"]::before { position: absolute; z-index: 10; top: 10px; right: 28px; padding: 6px 10px; border-radius: 999px; color: var(--on-primary); background: var(--navy-900); box-shadow: var(--shadow); content: "Actualizando datos…"; font-size: 10px; font-weight: 800; }
.loading-state, .empty-state { display: grid; min-height: 360px; place-items: center; align-content: center; color: var(--muted); text-align: center; }
.loader { width: 28px; height: 28px; border: 3px solid var(--blue-100); border-top-color: var(--navy-700); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.view-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
}
.search-box { position: relative; flex: 1; max-width: 420px; }
.search-box::before { position: absolute; top: 50%; left: 13px; content: "⌕"; color: var(--muted); font-size: 19px; transform: translateY(-52%); }
.search-box input { width: 100%; min-height: 42px; padding: 9px 14px 9px 39px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #fff; }
.search-box input:focus, select:focus, input:focus, textarea:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(21,131,199,.12); }
.filter-select { min-height: 42px; min-width: 180px; padding: 8px 34px 8px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); outline: 0; background: #fff; }
.owner-filter-field { position: relative; display: block; min-width: 230px; flex: 0 0 230px; }
.owner-filter-field::before { position: absolute; z-index: 1; top: 50%; left: 12px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-100); content: ""; transform: translateY(-50%); pointer-events: none; }
.owner-filter-label { position: absolute; z-index: 1; top: 5px; left: 30px; color: var(--navy-700); font-size: 8px; font-weight: 850; letter-spacing: .08em; line-height: 1; text-transform: uppercase; pointer-events: none; }
.owner-filter-field .filter-select { width: 100%; min-height: 48px; padding: 18px 34px 4px 30px; border-color: color-mix(in srgb, var(--blue-500) 38%, var(--line)); color: var(--navy-950); background: color-mix(in srgb, var(--blue-100) 28%, #fff); font-size: 12px; font-weight: 750; box-shadow: 0 3px 10px rgba(21,131,199,.07); }
.owner-filter-field:hover .filter-select { border-color: var(--blue-500); }
.owner-filter-field.is-active::before { background: var(--green-600); box-shadow: 0 0 0 4px var(--green-100); }
.owner-filter-field.is-active .filter-select { border-color: var(--blue-500); box-shadow: 0 0 0 3px rgba(21,131,199,.1); }
.period-filter-control { position: relative; flex: 0 0 auto; }
.period-filter-button { display: grid; min-width: 224px; min-height: 48px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px 11px; border: 1px solid color-mix(in srgb, var(--secondary) 30%, var(--line)); border-radius: 11px; color: var(--ink); background: var(--theme-input-bg); text-align: left; cursor: pointer; box-shadow: 0 3px 10px rgba(21,131,199,.05); }
.period-filter-button:hover, .period-filter-button[aria-expanded="true"] { border-color: var(--secondary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 12%, transparent); }
.period-filter-control.is-active .period-filter-button { border-color: var(--secondary); background: color-mix(in srgb, var(--blue-100) 42%, var(--theme-input-bg)); }
.period-filter-icon { display: grid; width: 29px; height: 29px; place-items: center; border-radius: 8px; color: var(--on-secondary); background: var(--secondary); font-size: 14px; }
.period-filter-button > span:nth-child(2) { display: grid; min-width: 0; gap: 2px; }
.period-filter-button small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.period-filter-button strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.period-filter-button > b { color: var(--muted); font-size: 13px; }
.period-filter-panel { position: absolute; z-index: 80; top: calc(100% + 8px); right: 0; width: min(540px, calc(100vw - 56px)); overflow: hidden; border: 1px solid color-mix(in srgb, var(--secondary) 38%, var(--line)); border-radius: 16px; color: var(--ink); background: var(--theme-input-bg); box-shadow: 0 22px 55px rgba(11,39,65,.2); }
.period-filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px 17px 13px; border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.period-filter-heading > div { display: grid; min-width: 0; gap: 3px; }
.period-filter-heading span { color: var(--secondary); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.period-filter-heading strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.period-panel-close { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--theme-input-bg); font-size: 19px; cursor: pointer; }
.period-filter-step { display: flex; align-items: center; gap: 9px; padding: 13px 16px 8px; }
.period-step-number { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--on-secondary); background: var(--secondary); font-size: 9px; font-weight: 900; }
.period-filter-step > div { display: grid; gap: 1px; }
.period-filter-step strong { font-size: 11px; }
.period-filter-step small { color: var(--muted); font-size: 9px; }
.period-unit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 16px 7px; }
.period-unit-grid button { min-height: 34px; padding: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: var(--theme-input-bg); font-size: 10px; font-weight: 800; cursor: pointer; }
.period-unit-grid button:hover { border-color: var(--secondary); color: var(--ink); background: var(--theme-subtle-bg); }
.period-unit-grid button.selected { border-color: var(--secondary); color: var(--ink); background: color-mix(in srgb, var(--blue-100) 62%, var(--theme-input-bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--secondary) 18%, transparent); }
.period-year-list { display: grid; max-height: 310px; gap: 6px; padding: 0 16px 14px; overflow-y: auto; overscroll-behavior: contain; }
.period-year-section { overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-input-bg); }
.period-year-section.expanded { border-color: color-mix(in srgb, var(--secondary) 45%, var(--line)); }
.period-year-section.has-selection { box-shadow: inset 3px 0 0 var(--secondary); }
.period-year-toggle { display: flex; width: 100%; min-height: 39px; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; border: 0; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.period-year-toggle:hover { background: var(--theme-subtle-bg); }
.period-year-toggle > span { display: flex; min-width: 0; align-items: center; gap: 7px; }
.period-year-toggle strong { font-size: 12px; }
.period-year-toggle small { padding: 3px 6px; border-radius: 999px; color: var(--muted); background: var(--theme-soft-bg); font-size: 8px; font-weight: 800; }
.period-year-toggle .period-year-selected { overflow: hidden; color: var(--secondary); background: var(--blue-100); text-overflow: ellipsis; white-space: nowrap; }
.period-year-toggle > b { color: var(--secondary); font-size: 15px; }
.period-year-options { padding: 10px; border-top: 1px solid var(--line); background: var(--theme-subtle-bg); }
.period-choice-grid { display: grid; gap: 6px; }
.period-choice-month { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.period-choice-quarter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.period-choice-semester { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.period-choice-year { grid-template-columns: 1fr; }
.period-choice { display: grid; min-height: 37px; place-items: center; gap: 2px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--theme-input-bg); cursor: pointer; }
.period-choice:hover { border-color: var(--secondary); }
.period-choice.selected { border-color: var(--secondary); color: var(--on-secondary); background: var(--secondary); }
.period-choice strong { font-size: 9px; }
.period-choice span { color: inherit; font-size: 7px; opacity: .78; }
.period-date-field, .period-week-field { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; }
.period-date-field input, .period-week-field select { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--theme-input-bg); }
.period-filter-footer { display: flex; align-items: center; gap: 7px; padding: 11px 16px 14px; border-top: 1px solid var(--line); background: var(--theme-subtle-bg); }
.period-quick-nav { display: inline-flex; gap: 4px; }
.period-quick-nav button, .period-clear { min-height: 32px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--theme-input-bg); font-size: 8px; font-weight: 800; cursor: pointer; }
.period-quick-nav button:hover:not(:disabled), .period-clear:hover:not(:disabled) { border-color: var(--secondary); color: var(--ink); }
.period-quick-nav button:disabled, .period-clear:disabled { opacity: .45; cursor: not-allowed; }
.period-clear { margin-left: auto; }
.period-done { min-height: 32px; padding: 6px 11px; font-size: 9px; }
.toolbar-meta { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.base-management-bar { display: flex; align-items: center; gap: 12px; margin: -5px 0 12px; }
.archive-view-switch { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
.archive-view-button { display: inline-flex; min-height: 34px; align-items: center; gap: 7px; padding: 6px 11px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 800; cursor: pointer; }
.archive-view-button:hover { color: var(--navy-900); background: var(--blue-100); }
.archive-view-button.active { color: var(--on-primary); background: var(--navy-900); }
.archive-view-button span { display: inline-grid; min-width: 20px; height: 20px; place-items: center; padding: 0 5px; border-radius: 999px; color: inherit; background: rgba(255,255,255,.14); font-size: 9px; }
.bulk-action-bar { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--blue-500) 34%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--blue-100) 55%, #fff); }
.bulk-action-bar strong { color: var(--navy-950); font-size: 12px; }
.bulk-action-spacer { flex: 1; }

.metric-strip { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; margin-bottom: 17px; }
.metric-card { position: relative; overflow: hidden; padding: 16px 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.metric-card::after { position: absolute; right: -18px; bottom: -28px; width: 78px; height: 78px; border-radius: 50%; background: var(--metric-tint, var(--blue-100)); content: ""; opacity: .8; }
.metric-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { position: relative; z-index: 1; display: block; color: var(--navy-950); font-size: 22px; font-weight: 850; letter-spacing: -.035em; }
.metric-note { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }

.pipeline-context { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 13px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pipeline-context > div { min-width: 0; }
.pipeline-context p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.pipeline-axis-badge { display: inline-flex; padding: 4px 8px; border-radius: 999px; color: var(--navy-900); background: var(--blue-100); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.pipeline-context-actions { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pipeline-customize-button { flex: 0 0 auto; }
.urgency-legend { display: flex; align-items: center; gap: 10px 18px; margin: -4px 0 13px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; flex-wrap: wrap; }
.urgency-legend[hidden] { display: none; }
.urgency-legend > span { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.urgency-legend strong { color: var(--ink); font-size: 10px; }
.urgency-swatch { width: 24px; height: 17px; flex: 0 0 auto; border: 1px solid rgba(35, 52, 64, .18); border-radius: 5px; background-color: #fff; }
.urgency-swatch.urgency-overdue { background-color: #f8dadd; }
.urgency-swatch.urgency-today { background-color: #fff1b8; }
.urgency-swatch.urgency-scheduled { background-color: #dcefe3; }
.kanban-region { position: relative; }
.kanban-stage-sentinel { height: 1px; margin-bottom: -1px; pointer-events: none; }
.kanban-stage-nav, .kanban-shell { width: 100%; min-width: 0; overflow-y: hidden; }
.kanban-stage-nav { position: sticky; z-index: 15; top: var(--topbar-height); overflow-x: auto; padding: 7px 1px 0; background: linear-gradient(to bottom, var(--canvas) 76%, color-mix(in srgb, var(--canvas) 92%, transparent)); scrollbar-width: none; overscroll-behavior-inline: contain; transition: top .18s ease; }
html.pipeline-columns-active .kanban-stage-nav { top: 0; }
.kanban-stage-nav::-webkit-scrollbar { display: none; }
.kanban-stage-track, .kanban-board { display: grid; min-width: max(100%, var(--pipeline-min-width, 281px)); grid-template-columns: var(--pipeline-template, minmax(270px, 1fr)); gap: 11px; align-items: start; transition: grid-template-columns .18s ease, min-width .18s ease; }
.kanban-shell { overflow-x: auto; padding: 0 1px 15px; scrollbar-color: #8299aa transparent; scrollbar-gutter: auto; overscroll-behavior-inline: contain; transition: box-shadow .15s ease; }
.kanban-shell.is-drag-scrolling-left { box-shadow: inset 22px 0 20px -20px color-mix(in srgb, var(--secondary) 78%, transparent); }
.kanban-shell.is-drag-scrolling-right { box-shadow: inset -22px 0 20px -20px color-mix(in srgb, var(--secondary) 78%, transparent); }
.kanban-column { min-width: 0; min-height: 480px; padding: 10px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; background: #edf2f5; transition: min-height .18s ease, background .15s, border-color .15s; }
.kanban-column.drag-over { border-color: var(--stage-color); background: var(--stage-tint); }
.kanban-column.unmatched { border-style: dashed; background: #f4f7f9; }
.kanban-column.is-compact .column-cards { gap: 6px; }
.kanban-column.is-compact .pipeline-visible-closed { gap: 6px; }
.kanban-column.is-compact .opportunity-card { display: grid; overflow: hidden; width: 100%; min-width: 0; max-width: 100%; grid-template-columns: auto minmax(48px, auto) minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; padding: 9px 10px; border-radius: 10px; }
.kanban-column.is-compact .card-top { display: contents; }
.kanban-column.is-compact .card-top .stage-code { grid-row: 1; grid-column: 1; height: 21px; }
.kanban-column.is-compact .company-pill { overflow: hidden; min-width: 0; max-width: 92px; grid-row: 1; grid-column: 2; padding: 2px 5px; text-overflow: ellipsis; white-space: nowrap; }
.kanban-column.is-compact .card-client { overflow: hidden; min-width: 0; grid-row: 1; grid-column: 3; margin-bottom: 0; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.kanban-column.is-compact .attention-pill { overflow: hidden; max-width: 58px; grid-row: 1; grid-column: 4; margin-left: 0; padding: 2px 5px; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.kanban-column.is-compact .card-service { display: block; overflow: hidden; min-width: 0; min-height: 0; grid-row: 2; grid-column: 1 / -1; margin: 0; font-size: 10px; line-height: 1.3; text-overflow: ellipsis; white-space: nowrap; }
.kanban-column.is-compact .card-value-row { display: grid; min-width: 0; max-width: 100%; grid-row: 3; grid-column: 1 / -1; grid-template-columns: auto minmax(0, 1fr) minmax(0, 74px); align-items: center; gap: 5px; line-height: 1; }
.kanban-column.is-compact .card-money { display: contents; }
.kanban-column.is-compact .card-money strong { min-width: 0; grid-row: 1; grid-column: 1; align-self: center; margin: 0; font-size: 13px; line-height: 1.1; white-space: nowrap; }
.kanban-column.is-compact .progress { display: block; width: 100%; min-width: 0; grid-row: 1; grid-column: 2; align-self: center; margin: 0; transform: translateY(-1px); }
.kanban-column.is-compact .card-money span { overflow: hidden; min-width: 0; max-width: 74px; grid-row: 1; grid-column: 3; align-self: center; margin: 0; font-size: 9px; line-height: 1; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.kanban-column.is-compact .card-footer { min-width: 0; grid-row: 4; grid-column: 1 / -1; margin: 0; padding-top: 5px; }
.kanban-column.is-compact .card-activity-action > span { font-size: 9px; }
.kanban-column.is-compact .card-activity > small { display: none; }
.kanban-column.is-compact .activity-icon { width: 22px; height: 22px; font-size: 10px; }
.kanban-column.is-compact .avatar { width: 22px; height: 22px; font-size: 8px; }
.column-header { display: grid; min-width: 0; min-height: 66px; align-content: start; gap: 7px; padding: 11px 10px 9px; border: 1px solid var(--line); border-top: 3px solid var(--stage-color); border-bottom: 0; border-radius: 14px 14px 0 0; background: #edf2f5; box-shadow: 0 -7px 0 var(--canvas); }
.column-header-main { display: flex; min-width: 0; align-items: flex-start; gap: 8px; }
.column-volume-bar { display: flex; overflow: hidden; width: 100%; min-width: 0; height: 5px; border-radius: 999px; background: #d8e1e7; box-shadow: inset 0 0 0 1px rgba(35, 52, 64, .08); }
.column-volume-segment { width: var(--segment-size); height: 100%; flex: 0 0 var(--segment-size); }
.column-volume-segment.urgency-scheduled { background: #4e9c6b; }
.column-volume-segment.urgency-overdue { background: #d95765; }
.column-volume-segment.urgency-today { background: #e1ae2c; }
.column-volume-segment.urgency-none { background: #fff; box-shadow: inset 0 0 0 1px rgba(35, 52, 64, .24); }
.stage-dot { width: 9px; height: 9px; margin-top: 5px; border-radius: 50%; background: var(--stage-color); }
.column-title { min-width: 0; flex: 1; }
.column-title strong { display: block; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.column-title span { color: var(--muted); font-size: 11px; }
.column-count { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--stage-color); background: var(--stage-tint); font-size: 11px; font-weight: 850; }
.column-collapse { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; padding: 0; border: 1px solid color-mix(in srgb, var(--stage-color) 28%, var(--line)); border-radius: 8px; color: var(--stage-color); background: #fff; font-size: 16px; font-weight: 800; line-height: 1; cursor: pointer; }
.column-collapse:hover, .column-collapse.is-active { border-color: var(--stage-color); background: var(--stage-tint); }
.column-collapse.is-active { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stage-color) 22%, transparent); }
.column-collapse span { transform: translateY(-1px); }
.stage-code { display: inline-grid; min-width: 27px; height: 24px; place-items: center; padding: 0 5px; border: 1px solid var(--stage-color); border-radius: 7px; color: var(--stage-color); background: var(--stage-tint); font-size: 9px; font-weight: 900; letter-spacing: .04em; }
.card-top .stage-code { flex: 0 0 auto; }
.column-cards { display: grid; min-width: 0; gap: 9px; }
.column-empty { padding: 24px 12px; border: 1px dashed #cbd6df; border-radius: 11px; color: #94a1ad; font-size: 12px; text-align: center; }
.pipeline-visible-closed { display: grid; min-width: 0; gap: 9px; }
.pipeline-order-hint { margin: 0; padding: 2px 3px 0; color: var(--muted); font-size: 8px; line-height: 1.35; }
.opportunity-card.pipeline-reorder-over { border-color: var(--stage-color); box-shadow: 0 0 0 2px color-mix(in srgb, var(--stage-color) 22%, transparent); transform: translateY(2px); }
.pipeline-history { display: grid; min-width: 0; gap: 7px; margin-top: 3px; padding-top: 10px; border-top: 1px solid color-mix(in srgb, var(--stage-color) 22%, var(--line)); }
.pipeline-history-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 2px 2px; }
.pipeline-history-heading span { color: var(--ink); font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.pipeline-history-heading small { overflow: hidden; color: var(--muted); font-size: 8px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.history-folder { min-width: 0; border: 1px solid color-mix(in srgb, var(--stage-color) 20%, var(--line)); border-radius: 10px; background: color-mix(in srgb, var(--stage-tint) 45%, #fff); }
.history-folder > summary { display: grid; min-height: 46px; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 9px; border-radius: inherit; color: var(--ink); list-style: none; cursor: pointer; }
.history-folder > summary::-webkit-details-marker { display: none; }
.history-folder > summary:hover { background: color-mix(in srgb, var(--stage-tint) 72%, transparent); }
.history-folder[open] > summary { border-radius: 9px 9px 0 0; border-bottom: 1px solid color-mix(in srgb, var(--stage-color) 18%, var(--line)); }
.history-folder > summary > b { display: grid; min-width: 23px; height: 23px; place-items: center; padding: 0 4px; border-radius: 7px; color: var(--stage-color); background: color-mix(in srgb, var(--stage-tint) 72%, #fff); font-size: 9px; }
.history-folder > summary > i { color: var(--stage-color); font-size: 13px; font-style: normal; transition: transform .16s; }
.history-folder[open] > summary > i { transform: rotate(180deg); }
.history-folder-icon { position: relative; width: 25px; height: 17px; border: 1px solid color-mix(in srgb, var(--stage-color) 58%, var(--line)); border-radius: 4px; background: color-mix(in srgb, var(--stage-tint) 82%, #fff); }
.history-folder-icon::before { position: absolute; top: -5px; left: 2px; width: 10px; height: 5px; border: 1px solid color-mix(in srgb, var(--stage-color) 58%, var(--line)); border-bottom: 0; border-radius: 3px 3px 0 0; background: inherit; content: ""; }
.history-folder-title { overflow: hidden; min-width: 0; }
.history-folder-title strong, .history-folder-title small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-folder-title strong { font-size: 10px; }
.history-folder-title small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.history-folder-cards { display: grid; min-width: 0; gap: 7px; padding: 8px; }
.history-year-months { display: grid; gap: 6px; padding: 8px; }
.history-subfolder { background: color-mix(in srgb, var(--stage-tint) 28%, #fff); }
.history-subfolder > summary { min-height: 41px; }
.history-subfolder .history-folder-icon { width: 21px; height: 14px; }

.opportunity-card { padding: 13px; border: 1px solid #e0e7ec; border-radius: 12px; background-color: #fff; box-shadow: 0 3px 9px rgba(25,55,80,.06); cursor: grab; transition: transform .16s, box-shadow .16s, border-color .16s, background-color .16s; }
.opportunity-card.urgency-overdue { border-color: #edb3b9; background-color: #fbe3e5; }
.opportunity-card.urgency-today { border-color: #ead78a; background-color: #fff5cd; }
.opportunity-card.urgency-scheduled { border-color: #b9dbc6; background-color: #e4f3e9; }
.opportunity-card.urgency-none { background-color: #fff; }
html[data-colorblind-patterns="true"] :is(.opportunity-card, .urgency-swatch).urgency-overdue { background-image: repeating-linear-gradient(135deg, rgba(151, 30, 45, .16) 0 2px, transparent 2px 9px); }
html[data-colorblind-patterns="true"] :is(.opportunity-card, .urgency-swatch).urgency-today { background-image: radial-gradient(circle, rgba(132, 93, 8, .25) 1.25px, transparent 1.5px); background-size: 9px 9px; }
html[data-colorblind-patterns="true"] :is(.opportunity-card, .urgency-swatch).urgency-scheduled { background-image: repeating-linear-gradient(0deg, rgba(14, 104, 63, .12) 0 1px, transparent 1px 8px), repeating-linear-gradient(90deg, rgba(14, 104, 63, .1) 0 1px, transparent 1px 8px); }
.opportunity-card:hover { border-color: #b7c8d6; box-shadow: 0 9px 21px rgba(25,55,80,.1); transform: translateY(-2px); }
.opportunity-card.is-selected { border-color: var(--blue-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 22%, transparent), 0 9px 21px rgba(25,55,80,.1); }
.opportunity-card.dragging { opacity: .46; transform: rotate(1deg); }
.opportunity-card.read-only { cursor: pointer; }
.card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.company-pill { overflow: hidden; max-width: 142px; padding: 3px 7px; border-radius: 999px; color: var(--navy-800); background: var(--blue-100); font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.attention-pill { margin-left: auto; padding: 3px 6px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.attention-pill.overdue { color: #b92f40; background: var(--red-100); }
.attention-pill.today { color: #85620f; background: var(--amber-100); }
.attention-pill.missing { color: #99701b; background: var(--amber-100); }
.card-client { display: block; margin-bottom: 2px; color: var(--navy-950); font-size: 14px; }
.card-service { display: -webkit-box; overflow: hidden; min-height: 35px; margin: 0 0 11px; color: var(--muted); font-size: 12px; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.card-value-row { display: contents; }
.card-money { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 11px; }
.card-money strong { color: var(--ink); font-size: 15px; letter-spacing: -.02em; }
.card-money span { color: var(--muted); font-size: 10px; }
.progress { height: 4px; margin-top: 5px; overflow: hidden; border-radius: 999px; background: #e8edf1; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--stage-color); }
.card-footer { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid #edf1f4; }
.card-activity { overflow: hidden; min-width: 0; }
.card-activity-action { display: flex; min-width: 0; align-items: center; gap: 7px; }
.card-activity-action > span, .card-activity > small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-activity-action > span { min-width: 0; color: var(--ink); font-size: 10px; font-weight: 700; }
.card-activity > small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.activity-icon { display: inline-grid; width: 26px; height: 26px; flex: 0 0 auto; place-items: center; border: 1px solid color-mix(in srgb, var(--stage-color) 28%, var(--line)); border-radius: 8px; color: var(--stage-color); background: color-mix(in srgb, var(--stage-tint) 68%, #fff); font-size: 12px; font-style: normal; font-weight: 900; line-height: 1; }
.activity-icon-email, .activity-icon-proposal { font-size: 13px; }
.activity-icon-other { font-size: 8px; letter-spacing: -1px; }
.avatar { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; color: var(--on-secondary); background: var(--navy-700); font-size: 9px; font-weight: 850; }

.dashboard-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.dashboard-kpis { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.panel { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 4px 16px rgba(28,55,79,.04); }
.panel.wide { grid-column: span 7; }
.panel.narrow { grid-column: span 5; }
.panel.half { grid-column: span 6; }
.panel.full { grid-column: 1 / -1; }
.panel-header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-header h2 { margin: 0; color: var(--navy-950); font-size: 15px; letter-spacing: -.02em; }
.panel-header span { color: var(--muted); font-size: 11px; }
.bars { display: grid; gap: 13px; }
.bar-row { --chart-color: var(--navy-700); display: grid; grid-template-columns: 150px 1fr 86px; align-items: center; gap: 10px; }
.bar-label { display: flex; min-width: 0; align-items: center; gap: 7px; overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.bar-label::before { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: var(--chart-color); box-shadow: 0 0 0 3px color-mix(in srgb, var(--chart-color) 16%, transparent); content: ""; }
.bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: color-mix(in srgb, var(--chart-tint, #dceef9) 62%, #eef2f4); }
.bar-fill { height: 100%; min-width: 3px; border-radius: inherit; background: var(--chart-color); background: linear-gradient(90deg, color-mix(in srgb, var(--chart-color) 72%, #fff), var(--chart-color)); box-shadow: 0 1px 4px color-mix(in srgb, var(--chart-color) 24%, transparent); }
.bar-value { color: var(--muted); font-size: 10px; text-align: right; }
.attention-list, .ranking-list { display: grid; gap: 0; }
.attention-row, .ranking-row { display: grid; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #edf1f4; }
.attention-row { grid-template-columns: minmax(120px, 1.3fr) minmax(110px, 1fr) 92px 86px; cursor: pointer; }
.attention-row.is-selected { border-radius: 8px; background: color-mix(in srgb, var(--blue-100) 68%, transparent); box-shadow: inset 4px 0 var(--blue-500); }
.attention-row:last-child, .ranking-row:last-child { border-bottom: 0; }
.attention-row strong, .attention-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.attention-row span { color: var(--muted); }
.due-badge { justify-self: start; padding: 4px 7px; border-radius: 7px; color: #b42e3e !important; background: var(--red-100); font-size: 9px !important; font-weight: 800; }
.ranking-row { grid-template-columns: 28px 1fr auto; }
.rank { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--navy-800); background: var(--blue-100); font-size: 10px; font-weight: 800; }

.data-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 11px 13px; color: var(--on-secondary); background: var(--navy-800); font-size: 10px; letter-spacing: .03em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 12px 13px; border-bottom: 1px solid #edf1f4; font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f7fafb; }
.data-table tbody tr.selected { background: color-mix(in srgb, var(--blue-100) 72%, #fff); }
.data-table tbody tr.is-preview-selected { background: color-mix(in srgb, var(--blue-100) 88%, #fff); box-shadow: inset 4px 0 var(--blue-500); }
.data-table tbody tr.archived .cell-main { color: var(--muted); }
.data-table .selection-column { width: 34px; min-width: 34px; padding-left: 6px; padding-right: 3px; text-align: center; }
.data-table .selection-column input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy-800); cursor: pointer; }
.data-table .selection-column input:disabled { cursor: not-allowed; opacity: .4; }
.opportunity-data-table .opportunity-column { width: 138px; max-width: 138px; }
.opportunity-data-table .client-column { min-width: 160px; }
.opportunity-data-table .contact-column { min-width: 175px; }
.opportunity-data-table .opportunity-service { display: block; max-width: 128px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-table .table-message-row { cursor: default; }
.data-table .table-message-row:hover { background: transparent; }
.data-table .table-message-row td { padding: 34px 16px; color: var(--muted); text-align: center; }
.cell-main, .cell-sub { display: block; }
.cell-main { font-weight: 700; }
.cell-sub { margin-top: 2px; color: var(--muted); font-size: 10px; }
.stage-badge { display: inline-flex; padding: 5px 8px; border-radius: 8px; color: var(--badge-color); background: var(--badge-tint); font-size: 10px; font-weight: 800; }
.client-grid { display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 12px; }
.client-card { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.client-card.is-interactive { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.client-card.is-interactive:hover { border-color: var(--navy-300); box-shadow: 0 8px 22px rgba(29, 57, 82, .1); transform: translateY(-1px); }
.client-card.is-interactive:focus-visible { outline: 3px solid color-mix(in srgb, var(--navy-700) 35%, transparent); outline-offset: 2px; border-color: var(--navy-600); }
.client-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.client-card-top .button { min-height: 30px; padding: 5px 8px; font-size: 9px; }
.client-contacts { display: block; overflow: hidden; margin: -7px 0 14px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.client-card h3 { margin: 8px 0 2px; color: var(--navy-950); font-size: 15px; }
.client-card p { margin: 0 0 15px; color: var(--muted); font-size: 11px; }
.client-stats { display: flex; gap: 20px; padding-top: 12px; border-top: 1px solid #edf1f4; }
.client-stats strong, .client-stats span { display: block; }
.client-stats strong { font-size: 14px; }
.client-stats span { color: var(--muted); font-size: 9px; text-transform: uppercase; }

.clients-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.clients-actions div { display: grid; gap: 3px; }
.clients-actions strong { color: var(--navy-950); font-size: 13px; }
.clients-actions span { color: var(--muted); font-size: 9px; }
.client-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.client-editor-modal { width: min(780px, 100vw); }
.client-editor-help { margin: 10px 0 0; color: var(--muted); font-size: 9px; }
.client-contacts-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.client-contact-editor-list { display: grid; gap: 10px; margin-top: 12px; }
.client-contact-editor { padding: 13px; border: 1px solid #dbe5eb; border-radius: 11px; background: #f8fafb; }
.client-contact-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.client-contact-editor-head strong { overflow: hidden; color: var(--navy-900); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.client-contact-editor-head .button { min-height: 28px; padding: 5px 8px; font-size: 8px; }
.client-editor-modal select:disabled, .client-editor-modal input:read-only { color: #526476; background: #eef3f6; cursor: not-allowed; }
.services-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #fff, #f5f9fc); }
.services-intro h2 { margin: 1px 0 5px; color: var(--navy-950); font-size: 22px; letter-spacing: -.035em; }
.services-intro p:last-child { max-width: 700px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.services-total { display: grid; min-width: 132px; place-items: center; padding: 14px 18px; border-radius: 13px; color: var(--on-secondary); background: var(--navy-800); text-align: center; }
.services-total strong { font-size: 27px; line-height: 1; }
.services-total span { margin-top: 4px; font-size: 8px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.services-company-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.service-company-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 4px 16px rgba(28,55,79,.04); }
.service-card-header { display: flex; align-items: center; gap: 11px; margin-bottom: 17px; }
.service-company-mark { display: grid; width: 40px; height: 40px; flex: 0 0 auto; place-items: center; border-radius: 11px; color: #fff; background: var(--company-color, var(--navy-800)); font-size: 10px; font-weight: 900; }
.service-card-header h3, .service-card-header p { margin: 0; }
.service-card-header h3 { color: var(--navy-950); font-size: 16px; }
.service-card-header p { margin-top: 2px; color: var(--muted); font-size: 10px; }
.service-add-form { display: grid; gap: 6px; margin-bottom: 14px; padding: 12px; border: 1px solid #dce7ee; border-radius: 11px; background: #f7fafc; }
.service-add-form > label, .service-library-search > span { color: #46576a; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.service-add-form > div { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.service-add-form input, .service-library-search input { width: 100%; min-width: 0; min-height: 39px; padding: 8px 10px; border: 1px solid #ccd7df; border-radius: 9px; color: var(--ink); outline: 0; background: #fff; font-size: 11px; }
.service-add-form input:focus, .service-library-search input:focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.service-readonly-note { margin: 0 0 14px; padding: 10px 12px; border-radius: 9px; color: var(--muted); background: #f5f7f8; font-size: 10px; }
.service-library-search { display: grid; gap: 6px; }
.service-library-search > div { position: relative; }
.service-library-search > div > span { position: absolute; top: 50%; left: 12px; color: var(--muted); font-size: 17px; transform: translateY(-53%); pointer-events: none; }
.service-library-search input { padding-left: 35px; }
.service-library-list { display: grid; overflow-y: auto; max-height: 430px; margin-top: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; overscroll-behavior: contain; }
.service-library-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 47px; padding: 7px 9px; border-bottom: 1px solid #e9eef2; }
.service-library-row:last-child { border-bottom: 0; }
.service-library-row strong { min-width: 0; color: var(--ink); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
.service-library-index { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 7px; color: var(--navy-800); background: var(--blue-100); font-size: 8px; font-weight: 850; }
.service-library-row .button { min-height: 29px; padding: 5px 7px; font-size: 8px; }
.service-library-empty { padding: 28px 16px; color: var(--muted); font-size: 10px; text-align: center; }

.taxonomy-manager { margin-bottom: 14px; border: 1px solid #dce7ee; border-radius: 11px; background: #f7fafc; }
.taxonomy-manager > summary, .service-taxonomy-editor > summary { padding: 10px 12px; color: var(--navy-800); font-size: 9px; font-weight: 850; cursor: pointer; }
.taxonomy-manager-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 12px 12px; }
.taxonomy-manager-grid section { min-width: 0; padding: 10px; border-radius: 9px; background: #fff; }
.taxonomy-manager-grid h4 { margin: 0 0 8px; color: var(--navy-950); font-size: 10px; }
.taxonomy-collection { display: flex; min-height: 26px; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.taxonomy-collection small { color: var(--muted); font-size: 9px; }
.taxonomy-admin-chip, .taxonomy-chip { display: inline-flex; align-items: center; gap: 4px; width: fit-content; border: 1px solid color-mix(in srgb, var(--taxonomy-color) 45%, #fff); border-radius: 999px; color: color-mix(in srgb, var(--taxonomy-color) 75%, #142b40); background: color-mix(in srgb, var(--taxonomy-color) 12%, #fff); font-size: 8px; font-weight: 800; line-height: 1; }
.taxonomy-admin-chip { padding: 5px 6px 5px 8px; }
.taxonomy-chip { padding: 4px 7px; }
.taxonomy-chip.group { border-radius: 6px; }
.taxonomy-chip.ungrouped { --taxonomy-color: #7c8995; }
.taxonomy-admin-chip button { display: grid; width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%; color: inherit; background: transparent; place-items: center; cursor: pointer; }
.taxonomy-admin-chip button:hover { background: color-mix(in srgb, var(--taxonomy-color) 18%, #fff); }
.taxonomy-add-form { display: grid; grid-template-columns: minmax(0, 1fr) 32px auto; gap: 5px; }
.taxonomy-add-form input[type="text"], .taxonomy-add-form input:not([type]) { min-width: 0; }
.taxonomy-add-form input { height: 32px; padding: 6px 8px; border: 1px solid #ccd7df; border-radius: 7px; background: #fff; font-size: 9px; }
.taxonomy-add-form input[type="color"] { width: 32px; padding: 3px; cursor: pointer; }
.taxonomy-add-form .button { min-height: 32px; padding: 6px 8px; font-size: 8px; }
.service-library-filters { display: grid; grid-template-columns: minmax(170px, 1.5fr) minmax(110px, .8fr) minmax(110px, .8fr); gap: 7px; align-items: end; }
.service-library-filters > label { display: grid; gap: 6px; color: #46576a; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.service-library-filters select { width: 100%; min-height: 39px; padding: 7px 9px; border: 1px solid #ccd7df; border-radius: 9px; color: var(--ink); background: #fff; font-size: 10px; }
.service-library-list { display: block; }
.service-group-section + .service-group-section { border-top: 5px solid #eef3f6; }
.service-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-bottom: 1px solid var(--line); background: #f4f7f9; }
.service-group-heading > span:last-child { color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.service-library-row { grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; padding: 9px; }
.service-library-info { display: grid; min-width: 0; gap: 6px; padding-top: 3px; }
.service-row-tags { display: flex; min-height: 18px; flex-wrap: wrap; gap: 4px; }
.taxonomy-empty { color: var(--muted); font-size: 8px; font-style: italic; }
.service-row-actions { display: flex; align-items: flex-start; gap: 5px; }
.service-taxonomy-editor { position: relative; }
.service-taxonomy-editor > summary { min-width: 65px; padding: 7px 8px; border: 1px solid #ccd7df; border-radius: 8px; list-style: none; text-align: center; }
.service-taxonomy-editor > summary::-webkit-details-marker { display: none; }
.service-taxonomy-editor[open] > summary { border-color: var(--blue-500); background: var(--blue-100); }
.service-taxonomy-editor form { position: absolute; z-index: 8; top: 36px; right: 0; display: grid; width: min(310px, 78vw); gap: 10px; padding: 12px; border: 1px solid #bdccd7; border-radius: 11px; background: #fff; box-shadow: 0 14px 35px rgba(11,39,65,.18); }
.service-taxonomy-editor form > label { display: grid; gap: 5px; color: #46576a; font-size: 9px; font-weight: 800; }
.service-taxonomy-editor select { min-height: 36px; padding: 7px 9px; border: 1px solid #ccd7df; border-radius: 8px; background: #fff; }
.service-taxonomy-editor fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.service-taxonomy-editor legend { margin-bottom: 6px; color: #46576a; font-size: 9px; font-weight: 800; }
.service-tag-options { display: flex; max-height: 150px; flex-wrap: wrap; gap: 5px; overflow-y: auto; }
.tag-check input { position: absolute; opacity: 0; pointer-events: none; }
.tag-check span { display: inline-flex; padding: 5px 7px; border: 1px solid #d3dce3; border-radius: 999px; color: var(--muted); background: #fff; font-size: 8px; cursor: pointer; }
.tag-check input:checked + span { border-color: var(--taxonomy-color); color: color-mix(in srgb, var(--taxonomy-color) 78%, #142b40); background: color-mix(in srgb, var(--taxonomy-color) 14%, #fff); font-weight: 800; }
.tag-check input:focus-visible + span { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.taxonomy-save-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.taxonomy-save-status { min-height: 12px; color: var(--muted); font-size: 8px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; overflow: hidden; place-items: stretch end; background: rgba(8,25,42,.46); backdrop-filter: blur(3px); }
.modal-backdrop[hidden] { display: none; }
.opportunity-modal { display: flex; overflow: hidden; width: min(840px, 100vw); height: 100vh; height: 100dvh; min-height: 0; max-height: 100dvh; flex-direction: column; background: #fff; box-shadow: -20px 0 55px rgba(6,25,43,.22); animation: slide-in .2s ease-out; }
@keyframes slide-in { from { transform: translateX(35px); opacity: .6; } }
.modal-header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; padding: 19px 24px; border-bottom: 1px solid var(--line); }
.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 25px; cursor: pointer; }
.opportunity-modal form { display: flex; overflow: hidden; min-height: 0; flex: 1; flex-direction: column; }
.form-steps { display: flex; overflow-x: auto; flex: 0 0 auto; gap: 4px; padding: 8px 20px; border-bottom: 1px solid var(--line); background: #f8fafb; scrollbar-width: thin; }
.form-steps button { display: inline-flex; min-width: max-content; align-items: center; gap: 6px; padding: 7px 9px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 750; cursor: pointer; }
.form-steps button:hover { color: var(--navy-900); background: var(--blue-100); }
.form-steps button > span:first-child { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 7px; color: var(--navy-800); background: #fff; font-size: 8px; font-weight: 900; line-height: 1; box-shadow: inset 0 0 0 1px var(--line); }
.modal-body { overflow-y: auto; min-height: 0; flex: 1 1 auto; padding: 4px 24px 34px; overscroll-behavior: contain; scrollbar-gutter: stable; scroll-behavior: smooth; }
.form-section { padding: 22px 0; border-bottom: 1px solid #e9eef2; scroll-margin-top: 12px; }
.form-section:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-heading > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--navy-800); background: var(--blue-100); font-size: 10px; font-weight: 850; line-height: 1; }
.section-heading strong, .section-heading small { display: block; }
.section-heading strong { color: var(--navy-950); font-size: 13px; }
.section-heading small { color: var(--muted); font-size: 10px; }
.section-heading.danger > span { color: #aa2939; background: var(--red-100); }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid label, .login-card label { display: grid; align-content: start; gap: 6px; color: #46576a; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.form-grid input, .form-grid select, .form-grid textarea, .login-card input { width: 100%; min-height: 40px; padding: 9px 11px; border: 1px solid #ccd7df; border-radius: 9px; color: var(--ink); outline: 0; background: #fff; font-size: 12px; font-weight: 450; letter-spacing: 0; text-transform: none; }
.form-grid textarea { resize: vertical; }
.form-grid input[readonly] { color: var(--muted); background: #f5f7f8; }
.form-grid :is(input, select, textarea):disabled { color: #788795; background: #f1f4f6; cursor: not-allowed; }
.field-help { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; line-height: 1.35; text-transform: none; }
.span-two { grid-column: span 2; }
.compact-button { min-height: 32px; padding: 6px 10px; font-size: 10px; white-space: nowrap; }
.client-picker { position: relative; display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.client-picker[hidden] { display: none; }
#saved-contact-field[hidden] { display: none; }
.client-picker-heading, .client-data-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.client-picker-heading strong, .client-picker-heading small, .client-data-heading strong, .client-data-heading small { display: block; }
.client-picker-heading strong, .client-data-heading strong { color: var(--navy-950); font-size: 11px; }
.client-picker-heading small, .client-data-heading small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.client-search-wrap { position: relative; }
.form-grid .client-search-wrap input { padding-left: 37px; padding-right: 72px; background: #fff; }
.client-search-icon { position: absolute; top: 50%; left: 13px; z-index: 1; color: var(--muted); font-size: 18px; transform: translateY(-52%); pointer-events: none; }
.client-search-status { position: absolute; top: 50%; right: 12px; color: var(--muted); font-size: 9px; font-weight: 700; transform: translateY(-50%); }
.client-search-results { position: absolute; z-index: 8; top: calc(100% - 7px); right: 14px; left: 14px; overflow-y: auto; max-height: 304px; border: 1px solid #bdccd7; border-radius: 11px; background: #fff; box-shadow: 0 16px 38px rgba(11,39,65,.17); overscroll-behavior: contain; }
.client-search-results[hidden] { display: none; }
.client-result { display: grid; width: 100%; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 11px 13px; border: 0; border-bottom: 1px solid #edf1f4; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.client-result:last-child { border-bottom: 0; }
.client-result:hover, .client-result.active { background: var(--blue-100); }
.client-result strong, .client-result span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-result strong { font-size: 12px; }
.client-result span { color: var(--muted); font-size: 9px; }
.client-result .client-result-company { align-self: center; grid-row: span 2; padding: 4px 7px; border-radius: 999px; color: var(--navy-800); background: #eef4f8; font-size: 8px; font-weight: 800; }
.client-result.create-client-result { display: flex; align-items: center; gap: 8px; color: var(--navy-800); background: #f8fbfd; font-size: 11px; font-weight: 800; }
.client-result.create-client-result span { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--on-secondary); background: var(--blue-500); font-size: 15px; }
.client-result-message { padding: 17px 13px; color: var(--muted); font-size: 10px; text-align: center; }
.service-picker { position: relative; display: grid; gap: 6px; }
.service-picker > label { color: #46576a; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.service-search-wrap { position: relative; }
.form-grid .service-search-wrap input { padding-left: 37px; padding-right: 78px; }
.service-search-icon { position: absolute; top: 50%; left: 13px; z-index: 1; color: var(--muted); font-size: 18px; transform: translateY(-52%); pointer-events: none; }
.service-search-status { position: absolute; top: 50%; right: 12px; color: var(--muted); font-size: 9px; font-weight: 700; transform: translateY(-50%); }
.service-search-results { position: absolute; z-index: 9; top: 62px; right: 0; left: 0; overflow-y: auto; max-height: 290px; border: 1px solid #bdccd7; border-radius: 11px; background: #fff; box-shadow: 0 16px 38px rgba(11,39,65,.17); overscroll-behavior: contain; }
.service-search-results[hidden] { display: none; }
.service-result { display: grid; width: 100%; grid-template-columns: 26px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 12px; border: 0; border-bottom: 1px solid #edf1f4; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.service-result:last-child { border-bottom: 0; }
.service-result:hover, .service-result.active { background: var(--blue-100); }
.service-result > span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 7px; color: var(--navy-800); background: #eef4f8; font-size: 8px; }
.service-result strong { font-size: 11px; line-height: 1.35; }
.service-result > div { display: grid; gap: 3px; min-width: 0; }
.service-result small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.service-result-message { display: grid; gap: 4px; padding: 17px 13px; color: var(--muted); font-size: 10px; text-align: center; }
.service-result-message strong { color: var(--navy-900); font-size: 11px; }
.client-selected-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 11px; padding: 13px 14px; border: 1px solid #bfdccc; border-radius: 12px; background: #f2faf6; }
.client-selected-card[hidden], .client-data-panel[hidden] { display: none; }
.client-selected-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 9px; color: #fff; background: #1b8c62; }
.client-selected-icon svg { display: block; width: 17px; height: 17px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.client-selected-card small, .client-selected-card strong, .client-selected-card span { display: block; }
.client-selected-card small { color: #287557; font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.client-selected-card strong { overflow: hidden; margin: 2px 0; color: var(--navy-950); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.client-selected-card div > span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.client-data-panel { display: grid; gap: 13px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfd; }
.client-essential-fields { padding-top: 2px; }
.client-optional-details { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.client-optional-details summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; color: var(--navy-900); font-size: 10px; font-weight: 800; cursor: pointer; list-style-position: inside; }
.client-optional-details summary small { margin-left: auto; padding: 3px 6px; border-radius: 999px; color: var(--muted); background: #eef2f4; font-size: 8px; text-transform: uppercase; }
.client-optional-details[open] summary { border-bottom: 1px solid var(--line); }
.client-optional-details > .form-grid { padding: 13px; }
.read-only .client-picker button, .read-only .client-selected-card button, .read-only .client-data-panel button { display: none; }
.loss-section { border-radius: 12px; }
.loss-section.hidden { display: none; }
.modal-footer { display: flex; flex: 0 0 auto; align-items: center; gap: 9px; padding: 13px 24px; border-top: 1px solid var(--line); background: #fbfcfd; box-shadow: 0 -8px 24px rgba(23,58,99,.05); }
.footer-spacer { flex: 1; }
.form-status { overflow: hidden; max-width: 190px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.opportunity-modal.is-saving { cursor: progress; }
.opportunity-modal.is-saving button { pointer-events: none; }

/* Captura guiada de oportunidades */
.opportunity-composer { width: min(1120px, 100vw); }
.opportunity-composer-header { min-height: 90px; gap: 20px; padding: 17px 24px; background: var(--theme-input-bg); }
.modal-heading-copy { min-width: 0; }
.modal-heading-copy h2 { overflow: hidden; margin: 1px 0 2px; font-size: 21px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.modal-heading-copy > p:last-child { overflow: hidden; margin: 0; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.opportunity-form-progress { flex: 0 0 auto; padding: 10px 24px 0; border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.progress-copy { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 7px; }
.progress-copy > span { color: var(--blue-500); font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.progress-copy > strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.form-progress-track { display: block; overflow: hidden; width: 100%; height: 3px; border-radius: 99px; background: color-mix(in srgb, var(--line) 78%, transparent); }
.form-progress-track > span { display: block; width: 33.333%; height: 100%; border-radius: inherit; background: var(--blue-500); transition: width .2s ease; }
.opportunity-composer .form-steps { display: grid; overflow: visible; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 8px 0 10px; border: 0; background: transparent; }
.opportunity-composer .form-steps button { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid transparent; text-align: left; }
.opportunity-composer .form-steps button > span:first-child { width: 26px; height: 26px; color: var(--muted); background: var(--theme-input-bg); font-size: 9px; }
.opportunity-composer .form-steps button > span:last-child { display: grid; min-width: 0; width: auto; height: auto; place-items: initial; gap: 1px; border-radius: 0; color: inherit; background: transparent; box-shadow: none; }
.opportunity-composer .form-steps button strong,
.opportunity-composer .form-steps button small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opportunity-composer .form-steps button strong { color: var(--ink); font-size: 10px; }
.opportunity-composer .form-steps button small { color: var(--muted); font-size: 8px; font-weight: 550; }
.opportunity-composer .form-steps button.is-active { border-color: color-mix(in srgb, var(--blue-500) 28%, var(--line)); color: var(--ink); background: color-mix(in srgb, var(--blue-100) 72%, var(--theme-input-bg)); }
.opportunity-composer .form-steps button.is-active > span:first-child { color: var(--on-secondary); background: var(--blue-500); box-shadow: none; }
.opportunity-composer .form-steps button.is-complete:not(.is-active) > span:first-child { color: #fff; background: var(--green-600); box-shadow: none; }
.opportunity-composer .form-steps button.has-error { border-color: color-mix(in srgb, var(--red-500) 54%, var(--line)); background: var(--red-100); }
.opportunity-composer .form-steps button.has-error > span:first-child { color: #fff; background: var(--red-500); box-shadow: none; }
.opportunity-composer-layout { display: grid; overflow: hidden; min-height: 0; flex: 1 1 auto; grid-template-columns: minmax(0, 1fr) 300px; }
.opportunity-composer .modal-body { min-width: 0; padding: 24px 28px 38px; }
.opportunity-composer .form-step-panel { min-height: 100%; padding: 0; border: 0; }
.opportunity-composer .form-step-panel[hidden] { display: none; }
.step-panel-heading { margin-bottom: 20px; }
.section-heading > .required-pill,
.section-heading > .recommended-pill { display: inline-flex; width: auto; height: auto; margin-left: auto; place-items: initial; padding: 4px 8px; border-radius: 999px; font-size: 8px; font-weight: 850; letter-spacing: .03em; line-height: 1.2; text-transform: uppercase; box-shadow: none; }
.section-heading > .required-pill { color: var(--ink); background: var(--blue-100); }
.section-heading > .recommended-pill { color: var(--ink); background: var(--lime-100); }
.form-disclosure { overflow: hidden; margin-top: 17px; border: 1px solid var(--line); border-radius: 12px; background: var(--theme-input-bg); }
.form-disclosure > summary { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; cursor: pointer; list-style: none; }
.form-disclosure > summary::-webkit-details-marker { display: none; }
.form-disclosure > summary::before { content: "+"; display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 7px; color: var(--blue-500); background: var(--blue-100); font-size: 15px; font-weight: 700; }
.form-disclosure[open] > summary::before { content: "−"; }
.form-disclosure > summary > span:first-of-type { display: grid; min-width: 0; flex: 1; gap: 2px; }
.form-disclosure > summary strong { color: var(--ink); font-size: 11px; }
.form-disclosure > summary small { color: var(--muted); font-size: 9px; font-weight: 500; }
.form-disclosure > summary .optional-pill { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; color: var(--muted); background: var(--theme-soft-bg); font-size: 8px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.form-disclosure[open] > summary { border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.form-disclosure > .form-grid { padding: 14px; }
.input-affix { display: grid; min-height: 40px; grid-template-columns: auto minmax(0, 1fr); align-items: center; overflow: hidden; border: 1px solid var(--theme-strong-line); border-radius: 9px; background: var(--theme-input-bg); transition: border-color .15s ease, box-shadow .15s ease; }
.input-affix:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.input-affix > span { display: grid; height: 100%; min-width: 34px; place-items: center; color: var(--muted); background: var(--theme-subtle-bg); font-size: 11px; }
.form-grid .input-affix > input { min-width: 0; min-height: 38px; padding-inline: 10px; border: 0; border-radius: 0; outline: 0; background: transparent; box-shadow: none; }
.input-affix-suffix { grid-template-columns: minmax(0, 1fr) auto; }
.input-affix-suffix > span { order: 2; }
.inline-forecast { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 17px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--blue-500) 25%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--blue-100) 68%, var(--theme-input-bg)); }
.inline-forecast-icon { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: var(--on-secondary); background: var(--blue-500); font-size: 17px; }
.inline-forecast > div { display: grid; min-width: 125px; gap: 1px; }
.inline-forecast small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .04em; }
.inline-forecast strong { color: var(--ink); font-size: 16px; }
.inline-forecast p { margin: 0; color: var(--muted); font-size: 9px; text-align: right; }
.form-step-panel .loss-section { margin-top: 18px; padding: 16px; border: 1px solid color-mix(in srgb, var(--red-500) 32%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--red-100) 58%, var(--theme-input-bg)); }
.form-step-panel .loss-section .section-heading { margin-bottom: 13px; }
.followup-callout { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px; margin-bottom: 18px; padding: 13px 14px; border: 1px solid color-mix(in srgb, var(--green-600) 25%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--green-100) 70%, var(--theme-input-bg)); }
.followup-callout > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: #fff; background: var(--green-600); font-weight: 900; }
.followup-callout strong,
.followup-callout small { display: block; }
.followup-callout strong { color: var(--ink); font-size: 10px; }
.followup-callout small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.opportunity-live-summary { overflow-y: auto; padding: 22px 20px 28px; border-left: 1px solid var(--line); background: var(--theme-subtle-bg); scrollbar-width: thin; }
.summary-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 18px; }
.summary-kicker { color: var(--blue-500); font-size: 8px; font-weight: 900; letter-spacing: .08em; }
.summary-company { overflow: hidden; max-width: 145px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--theme-input-bg); font-size: 8px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.summary-identity { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 11px; padding-bottom: 17px; border-bottom: 1px solid var(--line); }
.summary-avatar { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 12px; color: var(--on-secondary); background: var(--blue-500); font-size: 12px; font-weight: 900; }
.summary-identity h3 { overflow: hidden; margin: 0; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.summary-identity p { display: -webkit-box; overflow: hidden; margin: 2px 0 0; color: var(--muted); font-size: 9px; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.summary-forecast-card { display: grid; gap: 2px; margin-top: 16px; padding: 15px; border: 1px solid color-mix(in srgb, var(--blue-500) 28%, var(--line)); border-radius: 13px; background: color-mix(in srgb, var(--blue-100) 70%, var(--theme-input-bg)); }
.summary-forecast-card small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.summary-forecast-card strong { color: var(--ink); font-size: 23px; line-height: 1.2; letter-spacing: -.035em; }
.summary-forecast-card span { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.summary-commercial-data { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; margin: 16px 0 0; }
.summary-commercial-data div:last-child { grid-column: span 2; }
.summary-commercial-data dt,
.summary-commercial-data dd { margin: 0; }
.summary-commercial-data dt { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.summary-commercial-data dd { overflow: hidden; margin-top: 2px; color: var(--ink); font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.summary-followup { display: grid; gap: 2px; margin-top: 17px; padding-top: 15px; border-top: 1px solid var(--line); }
.summary-followup small { color: var(--blue-500); font-size: 8px; font-weight: 900; letter-spacing: .06em; }
.summary-followup strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.summary-followup span { color: var(--muted); font-size: 8px; }
.summary-readiness { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.summary-readiness > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.summary-readiness > div:first-child strong { color: var(--ink); font-size: 9px; }
.summary-readiness > div:first-child span { color: var(--muted); font-size: 8px; font-weight: 800; }
.summary-readiness-track { display: block; overflow: hidden; height: 5px; margin: 8px 0 10px; border-radius: 99px; background: var(--theme-soft-bg); }
.summary-readiness-track > span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green-600); transition: width .2s ease; }
.summary-checklist { display: grid; gap: 4px; }
.summary-checklist button { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 5px 3px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 8px; text-align: left; cursor: pointer; }
.summary-checklist button:hover { color: var(--ink); background: var(--theme-soft-bg); }
.summary-checklist button > span { display: grid; width: 16px; height: 16px; place-items: center; border-radius: 50%; color: var(--muted); background: var(--theme-input-bg); font-size: 9px; font-weight: 900; box-shadow: inset 0 0 0 1px var(--line); }
.summary-checklist button small { font-size: 7px; }
.summary-checklist button.is-complete { color: var(--ink); }
.summary-checklist button.is-complete > span { color: #fff; background: var(--green-600); box-shadow: none; }
.opportunity-form-footer { min-height: 66px; padding: 11px 20px; }
.footer-record-actions,
.footer-navigation { display: flex; align-items: center; gap: 8px; }
.opportunity-form-footer .form-status { max-width: 230px; color: var(--red-500); }
.opportunity-form-footer .button { min-height: 38px; }
.opportunity-form-footer .footer-navigation .primary { min-width: 158px; justify-content: center; }
#opportunity-form.was-validated :is(input, select, textarea):invalid { border-color: var(--red-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-500) 12%, transparent); }
#opportunity-form.was-validated .input-affix:has(input:invalid) { border-color: var(--red-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red-500) 12%, transparent); }

@media (max-width: 900px) {
  .opportunity-composer-layout { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .opportunity-live-summary { order: -1; display: grid; overflow: visible; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); border-left: 0; }
  .summary-heading,
  .summary-commercial-data,
  .summary-followup,
  .summary-readiness { display: none; }
  .summary-identity { padding: 0; border: 0; }
  .summary-avatar { width: 34px; height: 34px; border-radius: 10px; }
  .summary-forecast-card { min-width: 190px; margin: 0; padding: 9px 11px; }
  .summary-forecast-card strong { font-size: 17px; }
  .opportunity-composer .modal-body { padding-top: 20px; }
}

.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: grid; gap: 8px; }
.toast { min-width: 260px; max-width: 380px; padding: 12px 14px; border: 1px solid #cfe1d8; border-radius: 10px; color: #145c41; background: #f1faf6; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { border-color: #f0c5ca; color: #9f2e3b; background: #fff5f6; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }
.contextual-tip-region { position: fixed; right: 20px; bottom: 74px; z-index: 79; display: grid; width: min(340px, calc(100vw - 40px)); pointer-events: none; }
.contextual-tip { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid color-mix(in srgb, var(--lime-500) 45%, transparent); border-radius: 11px; color: var(--on-primary); background: color-mix(in srgb, var(--navy-950) 94%, transparent); box-shadow: 0 10px 30px rgba(0,0,0,.16); animation: contextual-tip-in .18s ease; backdrop-filter: blur(8px); }
.contextual-tip.is-hiding { opacity: 0; transform: translateY(4px); transition: opacity .16s ease, transform .16s ease; }
.contextual-tip-icon { display: grid; min-width: 29px; height: 26px; place-items: center; padding: 0 6px; border: 1px solid color-mix(in srgb, var(--lime-500) 54%, transparent); border-radius: 7px; color: var(--on-accent); background: var(--lime-500); font-size: 13px; font-weight: 900; box-shadow: inset 0 -2px 0 rgba(0,0,0,.14); }
.contextual-tip > span:last-child { display: grid; min-width: 0; gap: 2px; }
.contextual-tip strong { font-size: 10px; }
.contextual-tip small { color: color-mix(in srgb, var(--on-primary) 82%, transparent); font-size: 9px; line-height: 1.35; }
@keyframes contextual-tip-in { from { opacity: 0; transform: translateY(5px); } }

/* Tutoriales guiados reutilizables */
@property --tutorial-border-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.tutorial-layer {
  position: fixed;
  z-index: 48;
  inset: 0;
  pointer-events: none;
}
.tutorial-layer:not(.is-open) { display: none; }
.tutorial-highlight {
  --tutorial-target-radius: 14px;
  position: fixed;
  border: 1px solid color-mix(in srgb, var(--lime-500) 64%, var(--blue-500));
  border-radius: calc(var(--tutorial-target-radius) + 5px);
  box-shadow: 0 0 0 200vmax rgba(7, 20, 34, .57), 0 0 32px color-mix(in srgb, var(--blue-500) 40%, transparent);
  opacity: 1;
  transition: top .24s ease, left .24s ease, width .24s ease, height .24s ease, opacity .16s ease;
  pointer-events: none;
}
.tutorial-layer.is-undimmed .tutorial-highlight {
  box-shadow: 0 0 34px color-mix(in srgb, var(--blue-500) 44%, transparent);
}
.tutorial-highlight::before {
  position: absolute;
  inset: -4px;
  padding: 3px;
  border-radius: inherit;
  background: conic-gradient(
    from var(--tutorial-border-angle),
    var(--blue-500),
    var(--lime-500),
    var(--orange-500),
    var(--purple-500),
    var(--blue-500)
  );
  content: "";
  animation: tutorial-border-cycle 3s linear infinite;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.tutorial-layer.is-waiting .tutorial-highlight { opacity: 0; }
.tutorial-popover {
  --tutorial-popover-bg: color-mix(in srgb, var(--theme-input-bg) 96%, var(--blue-100));
  position: fixed;
  width: min(390px, calc(100vw - 28px));
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--blue-500) 42%, var(--theme-strong-line));
  border-radius: 16px;
  color: var(--ink);
  outline: 0;
  background: var(--tutorial-popover-bg);
  box-shadow: 0 22px 60px rgba(5, 23, 39, .28), inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
  pointer-events: auto;
  backdrop-filter: blur(16px);
}
.tutorial-popover::before {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 1px solid color-mix(in srgb, var(--blue-500) 42%, var(--theme-strong-line));
  background: var(--tutorial-popover-bg);
  content: "";
  transform: rotate(45deg);
}
.tutorial-popover[data-placement="right"]::before {
  top: calc(50% - 7px);
  left: -7px;
  border-top: 0;
  border-right: 0;
}
.tutorial-popover[data-placement="left"]::before {
  top: calc(50% - 7px);
  right: -7px;
  border-bottom: 0;
  border-left: 0;
}
.tutorial-popover[data-placement="top"]::before {
  right: calc(50% - 7px);
  bottom: -7px;
  border-top: 0;
  border-left: 0;
}
.tutorial-popover[data-placement="bottom"]::before {
  top: -7px;
  right: calc(50% - 7px);
  border-right: 0;
  border-bottom: 0;
}
.tutorial-popover[data-placement="center"]::before,
.tutorial-popover[data-placement="mobile"]::before { display: none; }
.tutorial-popover:focus-visible { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 35%, transparent), 0 22px 60px rgba(5, 23, 39, .28); }
.tutorial-popover.is-entering { animation: tutorial-popover-in .2s ease both; }
.tutorial-popover-topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
}
.tutorial-eyebrow,
.tutorial-progress-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.tutorial-eyebrow { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.tutorial-progress-label { color: var(--muted); letter-spacing: .025em; white-space: nowrap; }
.tutorial-close {
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  background: var(--theme-subtle-bg);
  font: inherit;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.tutorial-close:hover { border-color: var(--blue-500); color: var(--ink); }
.tutorial-close:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue-500) 30%, transparent); outline-offset: 1px; }
.tutorial-progress {
  height: 4px;
  margin: 11px 0 15px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue-500) 13%, var(--theme-subtle-bg));
}
.tutorial-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue-500), var(--lime-500));
  transition: width .24s ease;
}
.tutorial-copy { display: grid; gap: 8px; }
.tutorial-copy h2 { margin: 0; color: var(--ink); font-size: 19px; line-height: 1.2; letter-spacing: -.015em; }
.tutorial-copy > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.tutorial-copy .tutorial-gate {
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--lime-500) 38%, var(--line));
  border-radius: 9px;
  color: var(--ink);
  background: color-mix(in srgb, var(--lime-500) 11%, var(--theme-subtle-bg));
  font-size: 9px;
  font-weight: 750;
  line-height: 1.45;
}
.tutorial-actions { display: flex; align-items: center; gap: 7px; margin-top: 17px; }
.tutorial-actions-spacer { flex: 1; }
.tutorial-actions .button { min-height: 36px; padding: 7px 11px; font-size: 9px; }
.tutorial-actions .tutorial-skip { padding-inline: 3px; border-color: transparent; color: var(--muted); background: transparent; box-shadow: none; }
.tutorial-actions .tutorial-skip:hover { color: var(--ink); }
.tutorial-back:disabled { opacity: .38; }
.cost-tutorial-trigger { width: fit-content; margin-top: 11px; gap: 6px; }
.cost-tutorial-trigger > span:first-child {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: var(--on-accent);
  background: var(--lime-500);
  font-size: 10px;
  font-weight: 950;
}
body.tutorial-is-active [data-tutorial] {
  scroll-margin-top: calc(var(--topbar-height) + 14px);
  scroll-margin-bottom: min(48vh, 390px);
}
body.tutorial-is-active .contextual-tip-region { opacity: 0; }

@keyframes tutorial-border-cycle { to { --tutorial-border-angle: 360deg; } }
@keyframes tutorial-popover-in {
  from { opacity: 0; filter: blur(1px); }
  to { opacity: 1; filter: blur(0); }
}

@media (max-width: 900px) {
  .tutorial-popover {
    width: auto;
    max-height: min(46vh, 390px);
    overflow-y: auto;
    padding: 15px;
    border-radius: 15px;
  }
  .tutorial-copy h2 { font-size: 17px; }
  .tutorial-actions { position: sticky; bottom: -15px; margin-right: -15px; margin-left: -15px; padding: 12px 15px 15px; background: linear-gradient(to bottom, transparent, var(--tutorial-popover-bg) 18%); }
  .tutorial-actions .button { flex: 0 0 auto; }
  .tutorial-layer.is-interacting .tutorial-popover {
    max-height: none;
    overflow: visible;
    padding: 9px 11px;
  }
  .tutorial-layer.is-interacting .tutorial-popover :is(.tutorial-progress, .tutorial-copy) { display: none; }
  .tutorial-layer.is-interacting .tutorial-actions {
    position: static;
    bottom: auto;
    margin: 8px 0 0;
    padding: 0;
    background: transparent;
  }
  .tutorial-layer.is-interacting .tutorial-back { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-highlight { transition: none; }
  .tutorial-highlight::before { background: var(--blue-500); animation: none; }
  .tutorial-popover.is-entering { animation: none; }
  .tutorial-progress > span { transition: none; }
}

@media (prefers-contrast: more) {
  .tutorial-highlight { border-width: 2px; }
  .tutorial-highlight::before { inset: -5px; padding: 4px; }
  .tutorial-popover { border-width: 2px; }
}

@media (forced-colors: active) {
  .tutorial-highlight { border-color: Highlight; outline: 3px solid Highlight; outline-offset: 2px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .68); }
  .tutorial-highlight::before { display: none; }
  .tutorial-popover { border: 2px solid CanvasText; color: CanvasText; background: Canvas; forced-color-adjust: auto; }
  .tutorial-popover::before { display: none; }
  .tutorial-progress > span { background: Highlight; }
}

.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: linear-gradient(145deg, var(--navy-950), var(--navy-800)); }
.login-card { width: min(390px, 100%); padding: 34px; border-radius: 20px; background: #fff; box-shadow: 0 25px 70px rgba(0,0,0,.26); }
.login-card .brand-mark { margin-bottom: 20px; }
.login-card h1 { margin: 0 0 6px; color: var(--navy-950); font-size: 28px; letter-spacing: -.04em; }
.login-card > p:not(.eyebrow):not(.form-error) { margin: 0 0 22px; color: var(--muted); }
.login-card label { margin-top: 13px; }
.login-card .button { margin-top: 10px; }
.form-error { min-height: 20px; margin: 8px 0 0; color: #b52f40; font-size: 11px; }
.auth-intro { margin: 8px 0 22px; color: var(--muted); }
.auth-card form + form { margin-top: 8px; }
.qr-panel { display: grid; place-items: center; margin: 18px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #f8fafb; text-align: center; }
.qr-panel img { max-width: 100%; border-radius: 9px; }
.qr-panel p { margin: 10px 0 6px; color: var(--muted); font-size: 11px; }
.qr-panel code { overflow-wrap: anywhere; color: var(--navy-900); font-size: 12px; font-weight: 800; }
.otp-input { font-size: 21px !important; font-weight: 800 !important; letter-spacing: .15em !important; text-align: center; }
.recovery-codes { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 18px 0; }
.recovery-codes code { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #f6f8fa; font-size: 12px; text-align: center; }
.security-note { color: var(--muted); font-size: 11px; }

.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.profile-avatar-layout { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(150px, auto); align-items: center; gap: 18px; }
.profile-avatar-visual .avatar { width: 92px; height: 92px; overflow: hidden; border: 4px solid var(--surface); background: var(--navy-800); font-size: 22px; box-shadow: 0 0 0 1px var(--line), 0 12px 25px rgba(15, 41, 71, .14); }
.profile-avatar-visual .avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-copy { display: grid; min-width: 0; gap: 3px; }
.profile-avatar-copy strong { overflow: hidden; color: var(--ink); font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar-copy > span { overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.profile-avatar-copy p { max-width: 560px; margin: 7px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.profile-avatar-actions { display: grid; min-width: 150px; gap: 8px; }
.profile-avatar-status { margin: 13px 0 0; color: var(--muted); font-size: 9px; }
.settings-card { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 4px 16px rgba(28,55,79,.04); container-type: inline-size; }
.settings-card.span-two { grid-column: 1 / -1; }
.accessibility-preference-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 15px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.accessibility-preference-row > div { max-width: 720px; }
.accessibility-preference-row strong { color: var(--navy-950); font-size: 13px; }
.accessibility-preference-row p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.preference-switch { display: inline-flex; min-width: 116px; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--theme-subtle-bg); cursor: pointer; }
.preference-switch span { position: relative; width: 32px; height: 18px; flex: 0 0 auto; border-radius: 999px; background: #a9b5be; transition: background .16s; }
.preference-switch span::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.22); content: ""; transition: transform .16s; }
.preference-switch[aria-checked="true"] { border-color: color-mix(in srgb, var(--secondary) 42%, var(--line)); color: var(--navy-900); background: var(--blue-100); }
.preference-switch[aria-checked="true"] span { background: var(--secondary); }
.preference-switch[aria-checked="true"] span::after { transform: translateX(14px); }
.preference-switch b { font-size: 9px; }
.accessibility-pattern-preview { margin-top: 14px; }
.accessibility-pattern-preview .urgency-legend { margin: 0; background: var(--theme-subtle-bg); }
.settings-checkbox-row { display: flex; align-items: flex-start; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg); cursor: pointer; }
.settings-checkbox-row:hover { border-color: color-mix(in srgb, var(--secondary) 38%, var(--line)); background: color-mix(in srgb, var(--blue-100) 44%, var(--theme-subtle-bg)); }
.settings-checkbox-row input { width: 18px; height: 18px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--secondary); }
.settings-checkbox-row > span { display: grid; gap: 4px; }
.settings-checkbox-row strong { color: var(--navy-950); font-size: 12px; }
.settings-checkbox-row small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.pipeline-history-preference-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.pipeline-history-preference { display: grid; min-width: 0; align-content: start; gap: 14px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg); }
.pipeline-history-preference.selected { border-color: var(--secondary); background: color-mix(in srgb, var(--blue-100) 48%, var(--theme-input-bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--secondary) 16%, transparent); }
.pipeline-history-preference-heading { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; cursor: pointer; }
.pipeline-history-preference-heading > input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--secondary); }
.pipeline-history-preference-heading > span { display: grid; min-width: 0; gap: 4px; }
.pipeline-history-preference-heading strong { color: var(--ink); font-size: 12px; }
.pipeline-history-preference-heading small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.pipeline-history-number-field { display: grid; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.pipeline-history-number-field input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--theme-strong-line); border-radius: 9px; color: var(--ink); background: var(--theme-input-bg); font-size: 12px; font-weight: 650; outline: 0; }
.pipeline-history-number-field input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(21,131,199,.12); }
.pipeline-history-number-field input:disabled { opacity: .55; cursor: not-allowed; }
.pipeline-history-preference-status { margin: 12px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.period-preference-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.period-preference-option { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg); cursor: pointer; }
.period-preference-option:hover { border-color: color-mix(in srgb, var(--secondary) 42%, var(--line)); }
.period-preference-option.selected { border-color: var(--secondary); background: color-mix(in srgb, var(--blue-100) 55%, var(--theme-input-bg)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--secondary) 18%, transparent); }
.period-preference-option input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--secondary); }
.period-preference-option > span { display: grid; gap: 4px; }
.period-preference-option strong { color: var(--ink); font-size: 11px; }
.period-preference-option small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.period-default-preference { display: grid; max-width: 420px; gap: 6px; margin-top: 13px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.period-default-preference[hidden] { display: none; }
.period-default-preference select { min-height: 40px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--theme-input-bg); font-size: 11px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.period-default-preference small { color: var(--muted); font-size: 9px; font-weight: 500; letter-spacing: 0; line-height: 1.4; text-transform: none; }
.settings-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.settings-heading h2, .consolidated-card h2 { margin: 0; color: var(--navy-950); font-size: 18px; letter-spacing: -.025em; }
.settings-heading > span { padding: 4px 8px; border-radius: 999px; color: var(--navy-800); background: var(--blue-100); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.theme-form, .logo-upload, .user-create-form { display: grid; gap: 14px; }
.theme-form > label, .logo-upload > label, .user-create-form > label { display: grid; gap: 6px; color: #46576a; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.theme-form input, .logo-upload input, .logo-upload select, .user-create-form input, .user-create-form select, .user-edit-grid input, .user-edit-grid select { min-height: 40px; padding: 8px 10px; border: 1px solid #ccd7df; border-radius: 9px; color: var(--ink); outline: 0; background: #fff; font-size: 12px; text-transform: none; }
.color-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.color-grid label { display: grid; grid-template-columns: 36px 1fr; align-items: center; gap: 8px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 9px; }
.color-grid input { grid-row: span 2; width: 36px; min-height: 36px; padding: 2px; border-radius: 8px; }
.color-grid code { color: var(--ink); font-size: 10px; }
.theme-preview { --preview-primary: var(--navy-900); --preview-secondary: var(--blue-500); --preview-accent: var(--lime-500); display: flex; overflow: hidden; align-items: center; gap: 10px; padding: 13px; border-radius: 11px; color: var(--on-primary); background: var(--preview-primary); }
.theme-preview > span { width: 12px; height: 12px; border-radius: 50%; background: var(--preview-accent); }
.theme-preview strong { flex: 1; font-size: 11px; }
.theme-preview button { padding: 6px 9px; border: 0; border-radius: 7px; color: var(--on-accent); background: var(--preview-accent); font-size: 9px; font-weight: 800; }
.file-drop { padding: 14px; border: 1px dashed #b9c8d3; border-radius: 11px; color: var(--muted) !important; background: #f8fafb; text-align: center; }
.file-drop input { margin-top: 8px; padding: 6px; background: #fff; }
.logo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.logo-card { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; }
.logo-canvas { display: grid; height: 86px; margin-bottom: 8px; place-items: center; border-radius: 8px; background: repeating-conic-gradient(#f2f4f6 0 25%, #fff 0 50%) 50% / 16px 16px; }
.logo-canvas img { max-width: 90%; max-height: 70px; object-fit: contain; }
.logo-card > strong, .logo-card > span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-card > strong { font-size: 11px; }
.logo-card > span { margin-bottom: 8px; color: var(--muted); font-size: 9px; }
.logo-card .button { min-height: 30px; padding: 5px 8px; font-size: 9px; }
.logo-mode-intro { margin: -7px 0 14px; }
.logo-mode-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.logo-mode-actions .delete-logo { grid-column: 1 / -1; }
.appearance-only { grid-template-columns: 1fr !important; }
.brand-permission-note { margin: 13px 0 0; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--theme-subtle-bg, #f8fafb); }
.user-create-form { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.user-create-form .span-all { grid-column: 1 / -1; }
.role-intro { margin: -7px 0 16px; }
.role-help { display: grid; grid-template-columns: auto 1fr auto 1fr; align-items: center; gap: 5px 9px; padding: 10px 12px; border-radius: 9px; background: var(--blue-100); color: var(--muted); font-size: 10px; }
.role-help strong { color: var(--navy-950); font-size: 10px; }
.commercial-company-access { display: grid; min-width: 0; grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: 4px 10px; }
.commercial-company-access[hidden] { display: none; }
.commercial-company-access > strong { display: block; color: var(--navy-950); font-size: 10px; }
.commercial-company-access :is(.membership-grid, .membership-error) { grid-column: 1 / -1; }
.required-marker { color: #b52f40; }
.membership-help { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.4; }
.membership-error { min-height: 14px; margin: 5px 0 0; color: #b52f40; font-size: 9px; font-weight: 700; }
.membership-error:empty { display: none; }
.membership-invalid .membership-row { border-color: #d97480; }
.check-control { display: flex !important; align-items: center; justify-content: center; gap: 8px !important; }
.check-control input { width: 16px; min-height: 16px; }
.membership-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 7px; }
.membership-row { display: grid; grid-template-columns: auto minmax(100px, 1fr) auto; align-items: center; gap: 7px; min-width: min(260px, 100%); padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fff; font-size: 10px; }
.membership-row input { min-height: auto; }
.membership-row small { margin: 0; white-space: nowrap; }
.user-list { display: grid; margin-top: 18px; }
.user-row { display: grid; grid-template-columns: 38px minmax(180px, 1fr) auto auto; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid #edf1f4; }
.user-avatar { display: grid; width: 36px; height: 36px; overflow: hidden; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--on-secondary); background: var(--navy-800); font-size: 10px; font-weight: 850; }
button.user-avatar { cursor: pointer; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
button.user-avatar:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--secondary); }
.user-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.new-user-avatar-picker { display: flex; grid-column: 1 / -1; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 11px; background: var(--surface); }
.new-user-avatar-picker .user-avatar { width: 48px; height: 48px; flex: 0 0 auto; font-size: 12px; }
.new-user-avatar-copy { display: grid; min-width: 0; gap: 2px; }
.new-user-avatar-copy strong { color: var(--ink); font-size: 11px; }
.new-user-avatar-copy span { color: var(--muted); font-size: 9px; }
.new-user-avatar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; margin-left: auto; }
.user-row > div:nth-child(2) > :is(strong, span, small) { display: block; }
.user-row > div:nth-child(2) { min-width: 0; }
.user-row strong { font-size: 12px; }
.user-row > div:nth-child(2) > span { overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.user-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.user-status { display: flex; flex-wrap: wrap; gap: 5px; }
.status-chip { padding: 4px 7px; border-radius: 999px; font-size: 8px; font-weight: 800; text-transform: uppercase; }
.status-chip.ok { color: #176a4e; background: var(--green-100); }
.status-chip.pending { color: #8c671a; background: var(--amber-100); }
.status-chip.off { color: #a32c3a; background: var(--red-100); }
.user-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.user-actions .button { min-height: 32px; padding: 6px 9px; font-size: 9px; }
.user-permissions { min-width: 0; grid-column: 2 / -1; }
.user-permissions summary { width: max-content; color: var(--navy-800); font-size: 10px; font-weight: 750; cursor: pointer; }
.permissions-form { display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr) max-content; align-items: end; gap: 12px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.permissions-form:not(.commercial-role) { grid-template-columns: minmax(0, 1fr) max-content; }
.permissions-form > * { min-width: 0; }
.user-edit-grid { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(140px, 180px); gap: 8px; }
.user-edit-grid label { display: grid; min-width: 0; gap: 5px; color: #46576a; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.user-edit-grid :is(input, select) { width: 100%; min-width: 0; }
.permissions-form .membership-grid { min-width: 0; }
.permissions-form .button { min-width: 140px; min-height: 34px; padding: 6px 10px; justify-self: end; font-size: 9px; white-space: nowrap; }
.catalog-card .security-note { margin: -8px 0 17px; }
.catalog-toolbar { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(320px, 1.3fr); gap: 13px; margin-bottom: 14px; }
.catalog-toolbar > label, .catalog-toolbar form label { display: grid; gap: 6px; color: #46576a; font-size: 10px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.catalog-toolbar select, .catalog-toolbar input { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #ccd7df; border-radius: 9px; color: var(--ink); outline: 0; background: #fff; font-size: 12px; text-transform: none; }
.catalog-toolbar form { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; }
.catalog-list { display: grid; overflow-y: auto; max-height: 310px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfd; overscroll-behavior: contain; }
.catalog-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 45px; padding: 7px 9px 7px 13px; border-bottom: 1px solid #e9eef2; }
.catalog-row:last-child { border-bottom: 0; }
.catalog-row span { min-width: 0; overflow-wrap: anywhere; font-size: 11px; }
.catalog-row .button { flex: 0 0 auto; min-height: 30px; padding: 5px 8px; font-size: 9px; }

.sr-only { position: absolute !important; overflow: hidden; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pipeline-settings-intro { margin: -7px 0 16px; color: var(--muted); font-size: 11px; }
.pipeline-sync-control { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 11px; margin-bottom: 18px; padding: 14px; border: 1px solid #b9d8eb; border-radius: 12px; color: var(--navy-950); background: #f2f9fd; cursor: pointer; }
.pipeline-sync-control input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--secondary); }
.pipeline-sync-control span, .pipeline-sync-control strong, .pipeline-sync-control small { display: block; }
.pipeline-sync-control strong { font-size: 12px; }
.pipeline-sync-control small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.pipeline-config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.pipeline-config-column { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f8fafb; }
.pipeline-config-column > header { display: flex; align-items: start; justify-content: space-between; gap: 10px; margin-bottom: 11px; }
.pipeline-config-column > header h3 { margin: 0; color: var(--navy-950); font-size: 14px; }
.pipeline-config-column > header p { margin: 3px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.pipeline-config-column > header > span { display: grid; min-width: 25px; height: 25px; place-items: center; border-radius: 8px; color: var(--navy-800); background: var(--blue-100); font-size: 10px; font-weight: 850; }
.pipeline-config-list { display: grid; overflow-y: auto; max-height: 390px; gap: 7px; padding-right: 3px; overscroll-behavior: contain; }
.pipeline-catalog-row { display: grid; grid-template-columns: auto minmax(140px, 1fr) auto auto auto; align-items: center; gap: 7px; padding: 8px; border: 1px solid #dfe7ec; border-radius: 9px; background: #fff; }
.pipeline-catalog-row input, .pipeline-add-form input { width: 100%; min-height: 35px; padding: 7px 9px; border: 1px solid #ccd7df; border-radius: 8px; color: var(--ink); background: #fff; font-size: 11px; outline: 0; }
.pipeline-catalog-row input:focus, .pipeline-add-form input:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(21,131,199,.12); }
.pipeline-catalog-row .button { min-height: 33px; padding: 5px 8px; font-size: 8px; }
.pipeline-order-controls { display: grid; grid-template-columns: repeat(2, 25px); gap: 3px; }
.pipeline-order-button { display: grid; width: 25px; height: 29px; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--navy-800); background: #f8fafb; cursor: pointer; }
.pipeline-order-button:hover:not(:disabled) { border-color: var(--secondary); color: var(--secondary); background: var(--blue-100); }
.pipeline-order-button:disabled { opacity: .35; cursor: not-allowed; }
.pipeline-semantic-badge { padding: 4px 7px; border-radius: 999px; color: var(--navy-800); background: var(--lime-100); font-size: 8px; font-weight: 850; white-space: nowrap; }
.pipeline-add-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 10px; }
.pipeline-add-form .button { min-height: 35px; }
.audit-list { display: grid; gap: 8px; margin-top: 15px; }
.audit-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafb; }
.audit-row div { min-width: 0; }
.audit-row strong, .audit-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audit-row strong { color: var(--ink); font-size: 11px; }
.audit-row span, .audit-row small { color: var(--muted); font-size: 9px; }
.access-policy-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; align-items: stretch; gap: 10px; margin-top: 15px; }
.access-policy-options > label { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 9px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: #f8fafb; cursor: pointer; }
.access-policy-options input { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--secondary); }
.access-policy-options span, .access-policy-options strong, .access-policy-options small { display: block; }
.access-policy-options strong { color: var(--navy-950); font-size: 11px; }
.access-policy-options small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.load-error-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.load-error-card h2 { margin: 2px 0 5px; color: var(--navy-950); font-size: 17px; }
.load-error-card p:last-child { margin: 0; color: var(--muted); font-size: 10px; }

.consolidated-card { padding-block: 42px; text-align: center; }
.consolidated-card p:last-child { max-width: 560px; margin: 10px auto 0; color: var(--muted); }

@container (max-width: 980px) {
  .user-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-row { grid-template-columns: 38px minmax(0, 1fr); }
  .user-status, .user-actions, .user-permissions { grid-column: 2; }
  .user-status, .user-actions { justify-content: flex-start; }
  .permissions-form, .permissions-form:not(.commercial-role), .access-policy-options { grid-template-columns: 1fr; }
  .permissions-form .button { justify-self: start; }
  .role-help { grid-template-columns: auto 1fr; }
  .catalog-toolbar, .pipeline-config-grid { grid-template-columns: 1fr; }
}

@container (max-width: 560px) {
  .settings-heading { align-items: flex-start; flex-wrap: wrap; }
  .theme-options-grid, .color-grid, .logo-grid, .user-create-form, .user-edit-grid { grid-template-columns: 1fr; }
  .user-create-form .span-all { grid-column: auto; }
  .membership-grid { display: grid; grid-template-columns: 1fr; }
  .membership-row { width: 100%; }
  .permissions-form .button, .user-create-form > .button { width: 100%; justify-self: stretch; }
  .audit-row { grid-template-columns: 1fr; }
  .audit-row strong, .audit-row span { white-space: normal; }
}

@media (max-width: 1100px) {
  .topbar { padding-inline: 20px; }
  .content { padding-inline: 20px; }
  .button.export-link { display: none; }
  .dashboard-kpis { grid-template-columns: repeat(2, 1fr); }
  .panel.wide, .panel.narrow, .panel.half { grid-column: 1 / -1; }
  .client-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
  .services-company-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .settings-card.span-two { grid-column: auto; }
  .user-row { grid-template-columns: 38px 1fr; }
  .permissions-form, .access-policy-options { grid-template-columns: 1fr; }
  .user-status, .user-actions { grid-column: 2; }
  .permissions-form { grid-template-columns: 1fr; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .pipeline-config-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .accessibility-preference-row { align-items: flex-start; flex-direction: column; }
  .costing-selector-controls { grid-template-columns: 1fr; }
  .cost-opportunity-result { grid-template-columns: minmax(68px, auto) minmax(0, 1fr); }
  .cost-opportunity-result-meta { display: none; }
  .sidebar { width: 236px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: translateX(0); }
  .workspace { width: 100%; margin-left: 0; }
  .mobile-menu { display: block; }
  .topbar { display: grid; min-height: 76px; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 12px 15px; }
  .page-heading { min-width: 0; }
  .page-heading h1 { font-size: 21px; }
  .top-actions { width: 100%; min-width: 0; grid-column: 1 / -1; margin-left: 0; }
  .top-actions .button.ghost { display: none; }
  .top-actions .button.primary { padding-inline: 11px; font-size: 12px; }
  .company-context { min-width: 0; flex: 1; margin-right: 0; }
  .company-context span { display: none; }
  .company-context select { width: 100%; min-width: 0; max-width: none; height: 40px; }
  .environment-context { min-width: 0; flex: 0 1 174px; align-items: stretch; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .environment-context-control { min-width: 0; flex: 1; }
  .environment-context-control > span { display: none; }
  .environment-context-control select { width: 100%; min-width: 0; height: 40px; }
  .environment-status-chip { height: 40px; padding-inline: 8px; }
  html[data-crm-environment="staging"] .environment-context { background: transparent; box-shadow: none; }
  .content { padding: 15px; }
  .view-toolbar { flex-wrap: wrap; }
  .base-management-bar, .bulk-action-bar { align-items: stretch; flex-wrap: wrap; }
  .base-management-bar .toolbar-meta { width: auto; margin-left: auto; align-self: center; }
  .bulk-action-bar strong { width: 100%; }
  .bulk-action-spacer { display: none; }
  .bulk-action-bar .button { flex: 1; justify-content: center; }
  .search-box { max-width: none; flex-basis: 100%; }
  .filter-select { min-width: 0; flex: 1; }
  .owner-filter-field { min-width: 190px; flex: 1; }
  .period-filter-control { min-width: 210px; flex: 1; }
  .period-filter-button { width: 100%; min-width: 0; }
  .period-filter-panel { position: fixed; top: auto; right: 15px; bottom: 15px; left: 15px; width: auto; max-height: calc(100vh - 30px); }
  .period-year-list { max-height: min(310px, calc(100vh - 330px)); }
  .period-preference-options, .pipeline-history-preference-grid { grid-template-columns: 1fr; }
  .toolbar-meta { width: 100%; margin-left: 0; }
  .metric-strip { grid-template-columns: repeat(2, 1fr); }
  .dashboard-kpis { grid-template-columns: 1fr 1fr; }
  .bar-row { grid-template-columns: 100px 1fr 70px; }
  .attention-row { grid-template-columns: 1fr 90px; }
  .attention-row > *:nth-child(2), .attention-row > *:nth-child(4) { display: none; }
  .client-grid { grid-template-columns: 1fr; }
  .clients-actions { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.clients-actions div { display: grid; gap: 3px; }
.clients-actions strong { color: var(--navy-950); font-size: 13px; }
.clients-actions span { color: var(--muted); font-size: 9px; }
.client-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.client-editor-modal { width: min(780px, 100vw); }
.client-editor-help { margin: 10px 0 0; color: var(--muted); font-size: 9px; }
.client-contacts-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.client-contact-editor-list { display: grid; gap: 10px; margin-top: 12px; }
.client-contact-editor { padding: 13px; border: 1px solid #dbe5eb; border-radius: 11px; background: #f8fafb; }
.client-contact-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.client-contact-editor-head strong { overflow: hidden; color: var(--navy-900); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.client-contact-editor-head .button { min-height: 28px; padding: 5px 8px; font-size: 8px; }
.client-editor-modal select:disabled, .client-editor-modal input:read-only { color: #526476; background: #eef3f6; cursor: not-allowed; }
.services-intro { align-items: stretch; flex-direction: column; padding: 18px; }
  .services-total { min-width: 0; grid-template-columns: auto auto; justify-content: center; gap: 8px; }
  .services-total span { margin-top: 0; }
  .data-card { overflow-x: auto; }
  .data-table { min-width: 880px; }
  .opportunity-data-table { min-width: 980px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-two { grid-column: span 1; }
  .client-picker-heading, .client-data-heading { align-items: flex-start; flex-direction: column; gap: 9px; }
  .client-picker-heading .button, .client-data-heading .button { width: 100%; }
  .client-selected-card { grid-template-columns: auto minmax(0, 1fr); }
  .client-selected-card .button { grid-column: span 2; width: 100%; }
  .client-search-results { right: 10px; left: 10px; }
  .opportunity-modal { width: 100vw; }
  .modal-header { padding-inline: 18px; }
  .form-steps { padding-inline: 14px; }
  .modal-body { padding-inline: 18px; }
  .opportunity-composer .modal-body { padding-inline: 18px; }
  .modal-footer { flex-wrap: wrap; padding-inline: 18px; }
  .opportunity-form-footer .footer-spacer { display: none; }
  .opportunity-form-footer .footer-navigation { width: 100%; }
  .opportunity-form-footer .footer-navigation .button { flex: 1; justify-content: center; }
  .opportunity-form-footer .footer-record-actions:has(.button:not([hidden])) { width: 100%; }
  .form-status { width: 100%; max-width: none; order: -1; }
  .color-grid, .user-create-form { grid-template-columns: 1fr; }
  .user-create-form .span-all { grid-column: auto; }
}

@media (max-width: 480px) {
  .top-actions .button.primary { width: 42px; overflow: hidden; gap: 0; padding: 0; font-size: 0; white-space: nowrap; }
  .top-actions .button.primary span { font-size: 19px; }
  .metric-strip, .dashboard-kpis { grid-template-columns: 1fr; }
  .metric-card { padding: 14px; }
  .base-management-bar { flex-direction: column; }
  .base-management-bar .toolbar-meta { width: 100%; margin-left: 0; }
  .archive-view-switch { width: 100%; }
  .archive-view-button { flex: 1; justify-content: center; }
  .company-context select { max-width: 125px; }
  .environment-context { flex-basis: 152px; gap: 4px; }
  .environment-status-chip { padding-inline: 6px; font-size: 8px; }
  .logo-grid { grid-template-columns: 1fr; }
  .recovery-codes { grid-template-columns: 1fr; }
  .modal-footer .save-another { display: none; }
  .modal-footer .button { flex: 1; justify-content: center; }
  .modal-footer .danger-ghost { flex: 0 0 auto; }
  .modal-footer .footer-spacer { display: none; }
  .catalog-toolbar form { grid-template-columns: 1fr; }
  .pipeline-context { align-items: stretch; flex-direction: column; }
  .pipeline-context-actions { justify-content: stretch; }
  .pipeline-context-actions .button { flex: 1 1 auto; justify-content: center; }
  .urgency-legend { align-items: stretch; flex-direction: column; }
  .owner-filter-field { width: 100%; flex-basis: 100%; }
  .period-filter-control { width: 100%; flex-basis: 100%; }
  .period-unit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-choice-month { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .period-filter-footer { flex-wrap: wrap; }
  .period-quick-nav { display: grid; width: 100%; grid-template-columns: 1fr 1fr; }
  .period-quick-nav button { width: 100%; }
  .period-clear { margin-left: 0; }
  .period-done { margin-left: auto; }
  .pipeline-customize-button { width: 100%; justify-content: center; }
  .pipeline-catalog-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .pipeline-semantic-badge { grid-column: 2 / -1; width: max-content; }
  .pipeline-catalog-row .danger-ghost { grid-column: 2 / -1; }
  .kanban-column.is-compact .opportunity-card { grid-template-columns: auto minmax(42px, 72px) minmax(0, 1fr) auto; gap: 3px 4px; padding: 8px; }
  .kanban-column.is-compact .company-pill { max-width: 72px; }
  .kanban-column.is-compact .attention-pill { max-width: 50px; }
  .kanban-column.is-compact .card-value-row { grid-template-columns: auto minmax(0, 1fr) minmax(0, 58px); gap: 4px; }
  .kanban-column.is-compact .card-money span { max-width: 58px; }
  .opportunity-composer-header { min-height: 72px; }
  .modal-heading-copy > p:last-child,
  .progress-copy > strong,
  .opportunity-composer .form-steps button small { display: none; }
  .opportunity-composer .form-steps button { padding-inline: 7px; }
  .opportunity-live-summary { grid-template-columns: minmax(0, 1fr) minmax(130px, auto); gap: 8px; padding-inline: 14px; }
  .summary-avatar { display: none; }
  .summary-identity { grid-template-columns: minmax(0, 1fr); }
  .summary-forecast-card { min-width: 130px; padding: 8px 9px; }
  .summary-forecast-card span { display: none; }
  .inline-forecast { grid-template-columns: auto minmax(0, 1fr); }
  .inline-forecast p { display: none; }
  .footer-navigation { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media (prefers-contrast: more) {
  :root { --line: #7b8792; --muted: #475569; }
  .opportunity-card, .panel, .metric-card, .data-card { border-width: 2px; }
  .stage-code, .attention-pill, .stage-badge, .status-chip { border: 2px solid currentColor; }
}

@media (forced-colors: active) {
  .stage-code, .attention-pill, .stage-badge, .status-chip, .company-pill { border: 1px solid CanvasText; }
  .progress span, .bar-fill { background: Highlight; }
  .opportunity-card.is-selected, .attention-row.is-selected, .data-table tbody tr.is-preview-selected { outline: 2px solid Highlight; outline-offset: -2px; }
}

@media (max-width: 700px) {
  .clients-actions, .client-contacts-heading { align-items: stretch; flex-direction: column; }
  .clients-actions .button, .client-contacts-heading .button { width: 100%; }
  .taxonomy-manager-grid { grid-template-columns: 1fr; }
  .service-library-filters { grid-template-columns: 1fr 1fr; }
  .service-library-search { grid-column: 1 / -1; }
  .service-library-row { grid-template-columns: 25px minmax(0, 1fr); }
  .service-row-actions { grid-column: 2; }
  .service-taxonomy-editor form { right: auto; left: 0; }
}

/* Cálculo de costos enlazado a oportunidades */
.costing-selector { display: grid; grid-template-columns: minmax(230px, .72fr) minmax(520px, 1.28fr); align-items: center; gap: 28px; margin-bottom: 16px; padding: 18px 20px; }
.costing-selector h2, .costing-selector p { margin: 0; }
.costing-selector h2 { color: var(--navy-950); font-size: 17px; }
.costing-selector p:last-child { max-width: 680px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.costing-selector-controls { display: grid; min-width: 0; grid-template-columns: minmax(310px, 1fr) minmax(170px, .42fr); align-items: end; gap: 10px; }
.costing-selector-controls > label, .cost-opportunity-field { display: grid; min-width: 0; gap: 6px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.cost-owner-filter select, .cost-assumptions :is(select, input), .cost-line :is(select, input), .cost-notes-panel textarea, .cost-section-actions select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--theme-strong-line); border-radius: 9px; color: var(--ink); outline: 0; background: var(--theme-input-bg); font-size: 11px; }
.cost-owner-filter select:focus, .costing-workspace :is(select, input, textarea):focus { border-color: var(--blue-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.cost-opportunity-field { position: relative; z-index: 8; }
.cost-opportunity-combobox { display: grid; min-height: 40px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 0 8px 0 10px; border: 1px solid var(--theme-strong-line); border-radius: 9px; background: var(--theme-input-bg); transition: border-color .15s ease, box-shadow .15s ease; }
.cost-opportunity-combobox:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.cost-opportunity-combobox > span { display: grid; width: 18px; height: 18px; place-items: center; color: var(--blue-500); }
.cost-opportunity-combobox svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cost-opportunity-combobox input { min-width: 0; width: 100%; height: 38px; padding: 0; border: 0; color: var(--ink); outline: 0; background: transparent; font: inherit; font-size: 11px; font-weight: 650; letter-spacing: normal; text-transform: none; }
.cost-opportunity-combobox input::-webkit-search-cancel-button { display: none; }
.cost-opportunity-combobox button { display: grid; width: 25px; height: 25px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.cost-opportunity-combobox button svg { width: 14px; height: 14px; stroke-width: 2.25; }
.cost-opportunity-combobox button:hover { color: var(--navy-950); background: var(--theme-subtle-bg); }
.cost-opportunity-results { position: absolute; z-index: 20; top: calc(100% + 5px); right: 0; left: 0; overflow-y: auto; max-height: min(390px, 58vh); padding: 5px; border: 1px solid var(--theme-strong-line); border-radius: 11px; background: var(--theme-input-bg); box-shadow: 0 18px 45px color-mix(in srgb, var(--navy-950) 20%, transparent); scrollbar-color: #8299aa transparent; }
.cost-opportunity-results[hidden] { display: none; }
.cost-opportunity-result { display: grid; width: 100%; grid-template-columns: minmax(72px, auto) minmax(150px, 1fr) minmax(110px, .55fr); align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; font: inherit; letter-spacing: normal; text-align: left; text-transform: none; cursor: pointer; }
.cost-opportunity-result:hover, .cost-opportunity-result.is-active { color: var(--ink); background: color-mix(in srgb, var(--blue-100) 72%, var(--theme-input-bg)); }
.cost-opportunity-result-code { justify-self: start; padding: 4px 6px; border-radius: 6px; color: var(--navy-800); background: var(--blue-100); font-size: 8px; font-weight: 900; letter-spacing: .04em; white-space: nowrap; }
.cost-opportunity-result-main, .cost-opportunity-result-meta { display: grid; min-width: 0; gap: 2px; }
.cost-opportunity-result-main strong, .cost-opportunity-result-main small, .cost-opportunity-result-meta strong, .cost-opportunity-result-meta small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-opportunity-result-main strong { color: var(--navy-950); font-size: 10px; }
.cost-opportunity-result-main small { color: var(--muted); font-size: 8px; }
.cost-opportunity-result-meta { text-align: right; }
.cost-opportunity-result-meta strong { color: var(--ink); font-size: 8px; }
.cost-opportunity-result-meta small { color: var(--muted); font-size: 7px; }
.cost-opportunity-no-results { display: grid; min-height: 94px; place-items: center; align-content: center; gap: 3px; padding: 15px; color: var(--muted); text-align: center; text-transform: none; }
.cost-opportunity-no-results strong { color: var(--navy-950); font-size: 11px; }
.cost-opportunity-no-results span, .cost-opportunity-more { font-size: 8px; line-height: 1.45; }
.cost-opportunity-more { padding: 8px 10px 5px; color: var(--muted); text-align: center; text-transform: none; }
.costing-empty { display: grid; min-height: 420px; place-items: center; align-content: center; padding: 48px; text-align: center; }
.costing-empty-icon { display: grid; width: 68px; height: 68px; place-items: center; margin-bottom: 18px; border-radius: 20px; color: var(--on-secondary); background: var(--navy-800); font-size: 31px; font-weight: 850; }
.costing-empty h2 { margin: 0; color: var(--navy-950); font-size: 22px; }
.costing-empty p { max-width: 550px; margin: 8px 0 18px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.costing-empty > div { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; }
.costing-empty > div span { padding: 6px 9px; border-radius: 999px; color: var(--navy-800); background: var(--blue-100); font-size: 9px; font-weight: 800; }
.costing-workspace { display: grid; gap: 14px; }
.cost-opportunity-banner { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 15px; padding: 16px 18px; }
.cost-opportunity-banner > div:first-child { display: flex; align-items: center; gap: 7px; }
.cost-opportunity-banner h2, .cost-opportunity-banner p { margin: 0; }
.cost-opportunity-banner h2 { color: var(--navy-950); font-size: 17px; }
.cost-opportunity-banner > div:nth-child(2) > p:last-child { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.cost-opportunity-value { display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 2px 10px; text-align: right; }
.cost-opportunity-value span { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.cost-opportunity-value strong { color: var(--navy-950); font-size: 17px; }
.cost-opportunity-value .button { min-height: 30px; grid-column: 1 / -1; justify-self: end; padding: 5px 9px; font-size: 9px; }
.costing-metrics { margin-bottom: 0; }
.costing-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; align-items: start; gap: 14px; }
.costing-main, .costing-aside { display: grid; min-width: 0; gap: 14px; }
.costing-aside { position: sticky; top: calc(var(--topbar-height) + 14px); }
.cost-assumptions .panel-header { align-items: flex-start; }
.cost-assumptions .panel-header > div { min-width: 0; }
.cost-assumptions .panel-header span { display: block; max-width: 760px; margin-top: 4px; line-height: 1.45; }
.cost-assumptions .panel-header > small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.cost-indicator-status { display: flex; align-items: center; gap: 9px; margin: -2px 0 12px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--blue-500) 30%, var(--line)); border-radius: 9px; color: var(--ink); background: color-mix(in srgb, var(--blue-100) 48%, var(--theme-input-bg)); }
.cost-indicator-status > span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--on-secondary); background: var(--blue-500); font-size: 13px; font-weight: 900; }
.cost-indicator-status > div { display: grid; min-width: 0; gap: 2px; }
.cost-indicator-status strong { color: var(--navy-950); font-size: 9px; }
.cost-indicator-status small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.cost-indicator-status.is-warning { border-color: color-mix(in srgb, var(--amber-500) 45%, var(--line)); background: color-mix(in srgb, var(--amber-100) 58%, var(--theme-input-bg)); }
.cost-indicator-status.is-warning > span { color: var(--navy-950); background: var(--amber-500); }
.cost-assumption-grid { display: grid; grid-template-columns: minmax(150px, .72fr) repeat(2, minmax(210px, 1fr)); gap: 10px; }
.cost-assumption-field { display: grid; min-width: 0; gap: 6px; }
.cost-indicator-reference { display: flex; min-height: 32px; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px 5px 9px; border: 1px solid color-mix(in srgb, var(--green-500) 32%, var(--line)); border-radius: 8px; background: color-mix(in srgb, var(--green-100) 52%, var(--theme-input-bg)); text-transform: none; }
.cost-indicator-reference > span { display: grid; min-width: 0; gap: 1px; }
.cost-indicator-reference strong { color: var(--navy-950); font-size: 9px; }
.cost-indicator-reference small { overflow: hidden; color: var(--muted); font-size: 7px; font-weight: 650; letter-spacing: 0; text-overflow: ellipsis; white-space: nowrap; }
.cost-indicator-reference .cost-indicator-updated { overflow: visible; color: var(--navy-700); font-size: 6.5px; font-weight: 750; line-height: 1.35; text-overflow: clip; white-space: normal; }
.cost-indicator-reference .button { min-height: 24px; flex: 0 0 auto; padding: 3px 7px; font-size: 7px; }
.cost-indicator-reference.is-stale { border-color: color-mix(in srgb, var(--amber-500) 40%, var(--line)); background: color-mix(in srgb, var(--amber-100) 45%, var(--theme-input-bg)); }
.cost-indicator-reference.is-stale .cost-indicator-updated { color: #805b09; }
.cost-indicator-reference.is-loading { justify-content: flex-start; border-style: dashed; background: var(--theme-quiet-bg); }
.cost-assumption-grid label, .cost-charge-grid label, .cost-section-actions label, .cost-notes-panel label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cost-template-panel { margin-top: 12px; border: 1px solid color-mix(in srgb, var(--blue-300) 60%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--blue-100) 36%, var(--theme-input-bg)); }
.cost-template-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; }
.cost-template-panel-heading > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.cost-template-panel-heading h3, .cost-template-panel-heading p { margin: 0; }
.cost-template-panel-heading h3 { color: var(--navy-950); font-size: 12px; }
.cost-template-panel-heading p { margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.45; }
.cost-template-icon { display: grid; width: 32px; height: 32px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--blue-600); background: color-mix(in srgb, var(--blue-200) 62%, white); }
.cost-template-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.cost-template-panel-content { position: relative; z-index: 12; padding: 13px 14px 14px; border-top: 1px solid color-mix(in srgb, var(--blue-300) 48%, var(--line)); background: color-mix(in srgb, var(--theme-input-bg) 85%, transparent); }
.cost-template-picker-body { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(280px, .9fr); align-items: start; gap: 12px; }
.cost-template-search-field { position: relative; z-index: 4; display: grid; gap: 5px; }
.cost-template-search-field > label { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cost-template-combobox { display: grid; min-height: 40px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 0 7px 0 10px; border: 1px solid var(--theme-strong-line); border-radius: 9px; background: var(--theme-input-bg); }
.cost-template-combobox:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.cost-template-combobox > span { display: grid; width: 17px; place-items: center; color: var(--blue-500); }
.cost-template-combobox > span svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.cost-assumptions .cost-template-combobox input { min-width: 0; min-height: 36px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; font-size: 10px; }
.cost-template-combobox button { display: grid; width: 28px; height: 28px; padding: 0; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.cost-template-combobox button:hover { color: var(--ink); background: var(--theme-quiet-bg); }
.cost-template-combobox button svg { width: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.cost-template-results { position: absolute; top: calc(100% + 4px); right: 0; left: 0; z-index: 30; max-height: 310px; overflow-y: auto; padding: 5px; border: 1px solid var(--theme-strong-line); border-radius: 10px; background: var(--theme-input-bg); box-shadow: 0 16px 35px rgba(26,52,76,.18); }
.cost-template-result { display: grid; width: 100%; grid-template-columns: 86px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 9px; border: 0; border-radius: 8px; color: var(--ink); text-align: left; background: transparent; cursor: pointer; }
.cost-template-result:hover, .cost-template-result.is-active { background: color-mix(in srgb, var(--blue-100) 72%, var(--theme-input-bg)); }
.cost-template-code { color: var(--blue-700); font-size: 8px; font-weight: 900; letter-spacing: .035em; }
.cost-template-main, .cost-template-meta { display: grid; min-width: 0; gap: 2px; }
.cost-template-main strong, .cost-template-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-template-main strong { font-size: 9px; }
.cost-template-main small, .cost-template-meta small { color: var(--muted); font-size: 7px; }
.cost-template-meta { justify-items: end; text-align: right; }
.cost-template-meta strong { color: var(--navy-950); font-size: 9px; }
.cost-template-no-results, .cost-template-more { display: grid; gap: 3px; padding: 12px; color: var(--muted); font-size: 8px; text-align: center; }
.cost-template-no-results strong { color: var(--ink); }
.cost-template-preview { min-height: 126px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--theme-input-bg); }
.cost-template-preview.is-empty { display: grid; place-content: center; gap: 4px; color: var(--muted); text-align: center; }
.cost-template-preview.is-empty strong { color: var(--ink); font-size: 10px; }
.cost-template-preview.is-empty span { font-size: 8px; }
.cost-template-preview-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cost-template-preview-heading h4, .cost-template-preview-heading p { margin: 0; }
.cost-template-preview-heading h4 { margin-top: 2px; color: var(--navy-950); font-size: 11px; }
.cost-template-preview-heading p { margin-top: 2px; color: var(--muted); font-size: 8px; }
.cost-template-date { flex: 0 0 auto; padding: 4px 6px; border-radius: 999px; color: var(--muted); background: var(--theme-quiet-bg); font-size: 7px; font-weight: 800; }
.cost-template-preview-metrics { display: grid; grid-template-columns: .55fr 1fr 1fr; gap: 6px; margin-top: 10px; }
.cost-template-preview-metrics > div { display: grid; gap: 2px; padding: 7px; border-radius: 7px; background: var(--theme-subtle-bg); }
.cost-template-preview-metrics span { color: var(--muted); font-size: 7px; }
.cost-template-preview-metrics strong { color: var(--navy-950); font-size: 9px; }
.cost-template-profit, .cost-template-warning { margin: 7px 0 0; color: var(--muted); font-size: 7px; line-height: 1.45; }
.cost-template-warning { color: color-mix(in srgb, var(--amber-700) 82%, var(--ink)); }
.cost-template-copy-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line); }
.cost-template-copy-actions p { max-width: 660px; margin: 0; color: var(--muted); font-size: 8px; line-height: 1.45; }
.cost-template-loading, .cost-template-error, .cost-template-empty { display: flex; min-height: 86px; align-items: center; justify-content: center; gap: 9px; color: var(--muted); font-size: 9px; text-align: center; }
.cost-template-loading p { margin: 0; }
.cost-template-error { flex-direction: column; }
.cost-template-empty { flex-direction: column; gap: 4px; }
.cost-template-empty strong { color: var(--ink); }
.cost-charge-panel { display: grid; grid-template-columns: minmax(210px, .8fr) minmax(360px, 1.2fr); align-items: end; gap: 18px; margin-top: 12px; padding: 14px; border: 1px solid color-mix(in srgb, var(--amber-300) 55%, var(--line)); border-radius: 11px; background: color-mix(in srgb, var(--amber-100) 52%, var(--theme-input-bg)); }
.cost-charge-panel h3, .cost-charge-panel p { margin: 0; }
.cost-charge-panel h3 { margin-top: 2px; color: var(--navy-950); font-size: 13px; }
.cost-charge-panel > div:first-child > p:last-child { margin-top: 4px; color: var(--muted); font-size: 8px; line-height: 1.5; }
.cost-charge-grid { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(190px, 1fr); gap: 9px; }
.cost-sections { display: grid; gap: 14px; }
.cost-section { overflow: visible; min-width: 0; padding: 0; }
.cost-section-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; border-bottom: 1px solid var(--line); background: var(--theme-quiet-bg); }
.cost-section-heading { display: flex; min-width: 0; align-items: center; gap: 10px; }
.cost-section-heading > span { display: grid; width: 30px; height: 30px; flex: 0 0 auto; place-items: center; border-radius: 9px; color: var(--navy-800); background: var(--blue-100); font-size: 9px; font-weight: 900; line-height: 1; }
.cost-section-heading h2, .cost-section-heading p { margin: 0; }
.cost-section-heading h2 { color: var(--navy-950); font-size: 13px; }
.cost-section-heading p { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.cost-section-total { display: grid; flex: 0 0 auto; justify-items: end; }
.cost-section-total > span { color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.cost-section-total > strong { margin-top: 1px; color: var(--navy-950); font-size: 14px; }
.cost-section-total small { color: var(--muted); font-size: 8px; }
.cost-section-total b { color: inherit; font-weight: 750; }
.cost-section-actions { position: relative; z-index: 6; display: grid; grid-template-columns: minmax(280px, 1fr) auto auto; align-items: end; gap: 8px; padding: 11px 17px; border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.cost-section-actions .button { min-height: 38px; padding: 7px 10px; font-size: 8px; }
.cost-catalog-field { position: relative; display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cost-catalog-combobox { display: grid; min-height: 38px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; padding: 0 7px 0 9px; border: 1px solid var(--theme-strong-line); border-radius: 9px; background: var(--theme-input-bg); }
.cost-catalog-combobox:focus-within { border-color: var(--blue-500); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.cost-catalog-combobox > span { display: grid; width: 17px; place-items: center; color: var(--blue-500); }
.cost-catalog-combobox svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cost-catalog-search { width: 100%; height: 36px; min-width: 0; padding: 0; border: 0; color: var(--ink); outline: 0; background: transparent; font: inherit; font-size: 10px; font-weight: 650; letter-spacing: normal; text-transform: none; }
.cost-catalog-search::-webkit-search-cancel-button { display: none; }
.cost-catalog-toggle { display: grid; width: 25px; height: 25px; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.cost-catalog-toggle:hover { color: var(--navy-950); background: var(--theme-subtle-bg); }
.cost-catalog-results { position: absolute; z-index: 30; top: calc(100% + 5px); right: 0; left: 0; overflow-y: auto; max-height: 310px; padding: 5px; border: 1px solid var(--theme-strong-line); border-radius: 10px; background: var(--theme-input-bg); box-shadow: 0 16px 38px color-mix(in srgb, var(--navy-950) 20%, transparent); text-transform: none; }
.cost-catalog-results[hidden] { display: none; }
.cost-catalog-result { display: grid; width: 100%; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px 9px; border: 0; border-radius: 7px; color: var(--ink); background: transparent; font: inherit; text-align: left; cursor: pointer; }
.cost-catalog-result:hover, .cost-catalog-result.is-active { background: color-mix(in srgb, var(--blue-100) 72%, var(--theme-input-bg)); }
.cost-catalog-result-code { padding: 3px 5px; border-radius: 5px; color: var(--navy-800); background: var(--blue-100); font-size: 7px; font-weight: 900; }
.cost-catalog-result > span:last-child { display: grid; min-width: 0; gap: 2px; }
.cost-catalog-result strong, .cost-catalog-result small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cost-catalog-result strong { color: var(--navy-950); font-size: 9px; }
.cost-catalog-result small { color: var(--muted); font-size: 7px; }
.cost-catalog-no-results { display: grid; min-height: 82px; place-items: center; align-content: center; gap: 3px; padding: 12px; color: var(--muted); text-align: center; }
.cost-catalog-no-results strong { color: var(--navy-950); font-size: 10px; }
.cost-catalog-no-results span { font-size: 8px; }
.cost-section-table-wrap { overflow-x: auto; scrollbar-color: #8299aa transparent; scrollbar-gutter: auto; }
.cost-section-table { width: 100%; min-width: 820px; border-collapse: collapse; table-layout: fixed; }
.cost-section-table th { padding: 8px 7px; border-bottom: 1px solid var(--line); color: var(--muted); background: var(--theme-subtle-bg); font-size: 7px; font-weight: 900; letter-spacing: .045em; text-align: left; text-transform: uppercase; }
.cost-section-table th:nth-child(1) { width: 33%; }
.cost-section-table th:nth-child(2) { width: 11%; }
.cost-section-table th:nth-child(3), .cost-section-table th:nth-child(4) { width: 7%; }
.cost-section-table th:nth-child(5) { width: 14%; }
.cost-section-table th:nth-child(6) { width: 7.5%; }
.cost-section-table th:nth-child(7) { width: 15%; }
.cost-section-table th:nth-child(8) { width: 36px; }
.cost-section-table td { padding: 7px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cost-section-table .cost-line td { vertical-align: bottom; }
.cost-section-table tbody tr:last-child td { border-bottom: 0; }
.cost-section-table tbody tr:hover:not(.cost-section-empty) { background: color-mix(in srgb, var(--blue-100) 28%, transparent); }
.cost-section-table :is(input, select) { width: 100%; min-width: 0; min-height: 36px; padding: 7px 8px; border: 1px solid var(--theme-strong-line); border-radius: 8px; color: var(--ink); outline: 0; background: var(--theme-input-bg); font-size: 9px; }
.cost-section-table :is(input, select):focus { border-color: var(--blue-500); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.cost-item-cell { display: grid; gap: 4px; }
.cost-code { width: max-content; max-width: 100%; overflow: hidden; padding: 2px 5px; border-radius: 5px; color: var(--navy-800); background: var(--blue-100); font-size: 7px; font-weight: 900; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.cost-line-result { display: grid; height: 36px; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 6px; padding: 6px 8px; border-radius: 8px; background: color-mix(in srgb, var(--blue-100) 65%, var(--theme-input-bg)); text-align: right; }
.cost-line-result span { color: var(--muted); font-size: 6px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.cost-line-result strong { overflow: hidden; color: var(--navy-950); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.cost-line-actions { text-align: center; }
.cost-remove-line { display: grid; width: 25px; height: 25px; place-items: center; margin: auto; padding: 0; border: 1px solid color-mix(in srgb, #d94d5d 35%, var(--line)); border-radius: 7px; color: #b42e3e; background: var(--theme-input-bg); cursor: pointer; }
.cost-remove-line svg { display: block; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.25; stroke-linecap: round; }
.cost-remove-line:hover { border-color: #d94d5d; background: var(--red-100); }
.cost-section-empty td { height: 105px; color: var(--muted); text-align: center; }
.cost-section-empty strong, .cost-section-empty span { display: block; }
.cost-section-empty strong { color: var(--navy-950); font-size: 10px; }
.cost-section-empty span { margin-top: 3px; font-size: 8px; }
.cost-section-table tfoot td { padding: 9px 7px; border-top: 1px solid var(--theme-strong-line); border-bottom: 0; color: var(--muted); background: var(--theme-quiet-bg); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.cost-section-table tfoot td:nth-last-child(2) { display: grid; gap: 2px; text-align: right; }
.cost-section-table tfoot span { font-size: 7px; font-weight: 700; text-transform: none; }
.cost-section-table tfoot strong { color: var(--navy-950); font-size: 10px; }
.cost-summary-panel { overflow: hidden; }
.cost-category-summary-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cost-category-summary-row span { overflow: hidden; color: var(--ink); font-size: 10px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.cost-category-summary-row strong { color: var(--navy-950); font-size: 10px; }
.cost-category-summary-row small { grid-column: 1 / -1; color: var(--muted); font-size: 8px; }
.cost-summary-empty { margin: 0; padding: 18px 0; color: var(--muted); font-size: 9px; text-align: center; }
.cost-price-breakdown { display: grid; gap: 7px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--theme-strong-line); }
.cost-price-breakdown > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 9px; }
.cost-price-breakdown strong { color: var(--navy-950); font-size: 10px; }
.cost-grand-total { display: grid; margin: 16px -18px -18px; padding: 17px 18px; color: var(--on-primary); background: var(--navy-900); }
.cost-grand-total span { font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .78; }
.cost-grand-total strong { margin: 3px 0; font-size: 23px; letter-spacing: -.04em; }
.cost-grand-total small { font-size: 9px; opacity: .8; }
.cost-notes-panel textarea { min-height: 122px; resize: vertical; line-height: 1.5; }
.cost-autosave-state { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 12px; }
.cost-autosave-state > span { width: 9px; height: 9px; flex: 0 0 auto; margin-top: 3px; border: 2px solid var(--theme-input-bg); border-radius: 50%; background: var(--green-500); box-shadow: 0 0 0 2px color-mix(in srgb, var(--green-500) 20%, transparent); }
.cost-autosave-state strong, .cost-autosave-state small { display: block; }
.cost-autosave-state strong { color: var(--navy-950); font-size: 10px; }
.cost-save-status { min-height: 13px; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.cost-save-panel > p { margin: 9px 0 0; color: var(--muted); font-size: 8px; line-height: 1.5; }
.cost-save-panel > p strong { color: var(--ink); }
.cost-readonly-note { color: var(--muted); font-size: 10px; line-height: 1.55; }
/* Valores predefinidos de costos por empresa */
.cost-values-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, .36fr); align-items: end; gap: 24px; margin-bottom: 14px; }
.cost-values-hero h2, .cost-values-hero p { margin: 0; }
.cost-values-hero h2 { color: var(--navy-950); font-size: 20px; }
.cost-values-hero > div > p:last-child { max-width: 720px; margin-top: 6px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.cost-values-hero label, .cost-values-create label, .cost-value-row label, .cost-values-toolbar label { display: grid; min-width: 0; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.cost-values-hero :is(select, input), .cost-values-create :is(select, input), .cost-value-row :is(select, input), .cost-values-toolbar :is(select, input) { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid var(--theme-strong-line); border-radius: 8px; color: var(--ink); outline: 0; background: var(--theme-input-bg); font-size: 9px; }
.cost-values-hero :is(select, input):focus, .cost-values-create :is(select, input):focus, .cost-value-row :is(select, input):focus, .cost-values-toolbar :is(select, input):focus { border-color: var(--blue-500); box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue-500) 14%, transparent); }
.cost-values-metrics { margin-bottom: 14px; }
.cost-values-bulk { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 20px; margin-bottom: 14px; border-color: color-mix(in srgb, var(--blue-500) 35%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--blue-100) 62%, var(--surface)) 0%, var(--surface) 72%); }
.cost-values-bulk h2, .cost-values-bulk p { margin: 0; }
.cost-values-bulk h2 { color: var(--navy-950); font-size: 16px; }
.cost-values-bulk p { max-width: 710px; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.cost-values-bulk-steps { display: flex; flex-wrap: wrap; gap: 7px 15px; margin-top: 11px; color: var(--ink); font-size: 8px; font-weight: 700; }
.cost-values-bulk-steps span { display: inline-flex; align-items: center; gap: 5px; }
.cost-values-bulk-steps b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: var(--on-primary); background: var(--blue-500); font-size: 8px; }
.cost-values-bulk-actions { display: grid; min-width: 205px; gap: 8px; }
.cost-values-bulk-actions .button { width: 100%; min-height: 39px; justify-content: center; font-size: 9px; }
.cost-values-import-status { min-height: 14px; color: var(--muted); font-size: 8px; text-align: center; }
.cost-values-import-status.error { color: var(--red-600); }
.cost-values-create { margin-bottom: 14px; }
.cost-values-create form { display: grid; grid-template-columns: 105px minmax(210px, 1.5fr) minmax(165px, .9fr) minmax(115px, .65fr) minmax(145px, .8fr) minmax(105px, .55fr) auto; align-items: end; gap: 8px; }
.cost-values-create .button { min-height: 38px; padding: 7px 10px; font-size: 8px; white-space: nowrap; }
.cost-values-list-panel { overflow-x: auto; padding: 0; }
.cost-values-list-panel > .panel-header { min-width: 1080px; padding: 15px 17px; }
.cost-values-list-panel > .panel-header > strong { color: var(--navy-950); font-size: 9px; white-space: nowrap; }
.cost-values-toolbar { display: grid; min-width: 1080px; grid-template-columns: minmax(260px, 1fr) minmax(210px, .35fr); gap: 9px; padding: 11px 17px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.cost-values-table-header, .cost-value-row { display: grid; min-width: 1080px; grid-template-columns: 105px minmax(220px, 1.6fr) minmax(165px, .9fr) minmax(115px, .65fr) minmax(145px, .8fr) minmax(105px, .55fr) 155px; align-items: end; gap: 8px; }
.cost-values-table-header { padding: 8px 17px; color: var(--muted); background: var(--theme-quiet-bg); font-size: 7px; font-weight: 900; letter-spacing: .045em; text-transform: uppercase; }
.cost-values-list { min-width: 1080px; }
.cost-value-row { padding: 9px 17px; border-top: 1px solid var(--line); }
.cost-value-row:first-child { border-top: 0; }
.cost-value-row:hover { background: color-mix(in srgb, var(--blue-100) 25%, transparent); }
.cost-value-row[hidden] { display: none; }
.cost-value-row-actions { display: flex; align-items: center; gap: 6px; }
.cost-value-row-actions .button { min-height: 36px; flex: 1; justify-content: center; padding: 6px 8px; font-size: 7px; }
.cost-values-empty { min-width: 1080px; margin: 0; padding: 38px 18px; color: var(--muted); font-size: 10px; text-align: center; }
.cost-values-loading { min-height: 260px; }
.cost-values-error { display: grid; min-height: 250px; place-items: center; align-content: center; gap: 7px; color: var(--muted); text-align: center; }
.cost-values-error strong { color: var(--navy-950); font-size: 14px; }
.cost-values-error span { font-size: 9px; }

@media (max-width: 1350px) {
  .cost-values-create form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cost-values-create .cost-value-description { grid-column: span 2; }
  .cost-values-create .button { justify-content: center; }
}

@media (max-width: 1460px) {
  .costing-grid { grid-template-columns: 1fr; }
  .costing-aside { position: static; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
  .cost-summary-panel { grid-row: span 2; }
}

@media (max-width: 900px) {
  .cost-assumption-grid { grid-template-columns: 1fr 1fr; }
  .cost-date-field { grid-column: 1 / -1; }
  .costing-selector { grid-template-columns: 1fr; align-items: stretch; gap: 14px; }
  .costing-selector-controls { grid-template-columns: minmax(0, 1fr) minmax(170px, .4fr); }
  .costing-aside { grid-template-columns: 1fr; }
  .cost-summary-panel { grid-row: auto; }
  .cost-values-bulk { grid-template-columns: 1fr; }
  .cost-values-bulk-actions { grid-template-columns: 1fr 1fr; }
  .cost-values-import-status { grid-column: 1 / -1; }
}

@media (max-width: 780px) {
  .cost-values-hero { grid-template-columns: 1fr; align-items: stretch; }
  .cost-values-bulk-actions { grid-template-columns: 1fr; }
  .cost-values-import-status { grid-column: auto; }
  .cost-values-create form { grid-template-columns: 1fr 1fr; }
  .cost-values-create .cost-value-description { grid-column: 1 / -1; }
  .cost-values-create .button { grid-column: 1 / -1; justify-content: center; }
  .cost-opportunity-banner { grid-template-columns: auto minmax(0, 1fr); }
  .cost-opportunity-value { grid-column: 1 / -1; grid-template-columns: 1fr auto; padding-top: 10px; border-top: 1px solid var(--line); text-align: left; }
  .cost-opportunity-value .button { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  .cost-assumption-grid { grid-template-columns: 1fr; }
  .cost-date-field { grid-column: auto; }
  .cost-template-panel-heading, .cost-template-copy-actions { align-items: stretch; flex-direction: column; }
  .cost-template-panel-heading .button, .cost-template-copy-actions .button { width: 100%; justify-content: center; }
  .cost-template-picker-body { grid-template-columns: 1fr; }
  .cost-template-result { grid-template-columns: 72px minmax(0, 1fr); }
  .cost-template-result .cost-template-meta { grid-column: 2; justify-items: start; text-align: left; }
  .cost-template-preview-heading { flex-direction: column; }
  .cost-template-preview-metrics { grid-template-columns: 1fr; }
  .cost-charge-panel { grid-template-columns: 1fr; align-items: stretch; }
  .cost-charge-grid { grid-template-columns: 1fr 1fr; }
  .cost-section-header { align-items: flex-start; flex-direction: column; }
  .cost-section-total { width: 100%; grid-template-columns: 1fr auto; align-items: baseline; justify-items: start; gap: 2px 10px; }
  .cost-section-total > strong { justify-self: end; }
  .cost-section-total small { grid-column: 1 / -1; }
  .cost-section-actions { grid-template-columns: 1fr; }
  .cost-section-actions .button { width: 100%; justify-content: center; }
  .costing-empty { min-height: 340px; padding: 30px 20px; }
}

@media (max-width: 480px) {
  .cost-charge-grid { grid-template-columns: 1fr; }
  .cost-opportunity-banner > div:first-child { display: none; }
  .cost-opportunity-banner { grid-template-columns: 1fr; }
  .cost-opportunity-value { grid-column: auto; }
  .costing-metrics { grid-template-columns: 1fr 1fr; }
}
/* Commercial roles and visibility */
.commercial-groups-card { overflow: visible; }
.commercial-groups-heading { align-items: center; }
.commercial-groups-heading-actions { display: flex; align-items: center; gap: 9px; }
.commercial-groups-heading-actions > span { padding: 5px 9px; border-radius: 999px; color: var(--navy-800); background: var(--blue-100); font-size: 8px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.commercial-groups-heading-actions .button { min-height: 36px; padding: 7px 12px; }
.commercial-groups-heading-actions .button b { display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; color: var(--navy-900); background: var(--accent); font-size: 15px; line-height: 1; }
.commercial-groups-intro { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: -5px 0 17px; }
.commercial-groups-intro p { margin: 0 auto 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.commercial-groups-intro span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: var(--theme-subtle-bg); font-size: 8px; font-weight: 750; white-space: nowrap; }
.commercial-groups-cost-access-note { display: flex; align-items: flex-start; gap: 8px; margin: -8px 0 17px; padding: 9px 11px; border: 1px solid color-mix(in srgb, var(--blue-500) 28%, var(--line)); border-radius: 10px; color: var(--blue-800); background: color-mix(in srgb, var(--blue-100) 58%, var(--surface)); font-size: 9px; line-height: 1.45; }
.commercial-groups-cost-access-note::before { display: grid; width: 17px; height: 17px; flex: 0 0 17px; place-items: center; border-radius: 50%; color: var(--blue-800); background: color-mix(in srgb, var(--blue-500) 18%, transparent); content: "i"; font-size: 9px; font-weight: 900; }
.commercial-groups-table { position: relative; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.commercial-groups-table-head, .commercial-group-row { display: grid; grid-template-columns: minmax(180px, .72fr) minmax(245px, 1fr) minmax(265px, 1.08fr) minmax(145px, .55fr); }
.commercial-groups-table-head { border-radius: 13px 13px 0 0; background: var(--theme-subtle-bg); }
.commercial-groups-table-head > div { display: grid; min-width: 0; gap: 2px; padding: 11px 13px; border-right: 1px solid var(--line); }
.commercial-groups-table-head > div:last-child { border-right: 0; }
.commercial-groups-table-head strong { color: var(--navy-950); font-size: 9px; }
.commercial-groups-table-head small { color: var(--muted); font-size: 7px; line-height: 1.35; }
.commercial-groups-table-body { position: relative; }
.commercial-group-row { position: relative; z-index: 1; align-items: stretch; border-top: 1px solid var(--line); background: var(--surface); transition: background-color .15s ease, box-shadow .15s ease; }
.commercial-group-row:hover { background: color-mix(in srgb, var(--blue-100) 22%, var(--surface)); }
.commercial-group-row.is-dirty { box-shadow: inset 3px 0 0 var(--accent); }
.commercial-group-row.is-new { background: color-mix(in srgb, var(--blue-100) 42%, var(--surface)); }
.commercial-group-row.is-picker-open { z-index: 30; }
.commercial-group-row[hidden], .commercial-groups-empty[hidden], .commercial-member-picker[hidden] { display: none; }
.commercial-group-row > * { min-width: 0; padding: 12px 13px; border-right: 1px solid var(--line); }
.commercial-group-row > *:last-child { border-right: 0; }
.commercial-group-name-cell { display: grid; align-content: center; gap: 4px; }
.commercial-group-name-cell input { width: 100%; min-width: 0; min-height: 37px; padding: 7px 9px; border: 1px solid transparent; border-radius: 8px; color: var(--ink); outline: 0; background: transparent; font-size: 11px; font-weight: 800; text-overflow: ellipsis; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.commercial-group-name-cell input:hover { border-color: var(--line); background: var(--theme-input-bg); }
.commercial-group-name-cell input:focus { border-color: var(--secondary); background: var(--theme-input-bg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 13%, transparent); }
.commercial-group-name-cell input::placeholder { color: var(--muted); font-weight: 650; opacity: 1; }
.commercial-group-name-cell small { padding-inline: 9px; color: var(--muted); font-size: 7px; }
.commercial-group-cell { display: flex; align-items: center; }
.commercial-member-field { position: relative; width: 100%; min-width: 0; }
.commercial-member-selection { display: flex; min-width: 0; min-height: 38px; align-items: center; gap: 6px; }
.commercial-member-inputs { display: none; }
.commercial-member-chips { display: flex; min-width: 0; flex: 1; flex-wrap: wrap; gap: 5px; }
.commercial-member-empty { align-self: center; color: var(--muted); font-size: 8px; font-style: italic; }
.commercial-member-chip { display: inline-flex; max-width: 100%; min-height: 29px; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border: 1px solid color-mix(in srgb, var(--secondary) 24%, var(--line)); border-radius: 999px; color: var(--ink); background: color-mix(in srgb, var(--blue-100) 45%, var(--theme-input-bg)); font-size: 8px; font-weight: 750; }
.commercial-member-chip > span:nth-child(2) { overflow: hidden; max-width: 145px; text-overflow: ellipsis; white-space: nowrap; }
.commercial-member-avatar { display: grid; width: 23px; height: 23px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--on-secondary); background: var(--secondary); font-size: 7px; font-weight: 900; }
.commercial-member-chip button { display: grid; width: 20px; height: 20px; flex: 0 0 auto; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 14px; line-height: 1; cursor: pointer; }
.commercial-member-chip button:hover { color: #a32c3a; background: var(--red-100); }
.commercial-member-add { display: grid; width: 31px; height: 31px; flex: 0 0 auto; padding: 0; place-items: center; border: 1px dashed color-mix(in srgb, var(--secondary) 58%, var(--line)); border-radius: 9px; color: var(--secondary); background: var(--theme-input-bg); cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform .15s ease; }
.commercial-member-add span { font-size: 19px; line-height: 1; transform: translateY(-1px); }
.commercial-member-add:hover, .commercial-member-add[aria-expanded="true"] { border-style: solid; border-color: var(--secondary); color: var(--on-secondary); background: var(--secondary); transform: translateY(-1px); }
.commercial-member-picker { position: absolute; z-index: 40; top: calc(100% + 7px); left: 0; width: min(410px, calc(100vw - 48px)); padding: 6px; border: 1px solid var(--theme-strong-line); border-radius: 12px; background: var(--theme-input-bg); box-shadow: 0 18px 45px rgba(14, 39, 58, .2); }
.commercial-group-row > .commercial-group-cell:nth-child(3) .commercial-member-picker { right: 0; left: auto; }
.commercial-member-field.opens-up .commercial-member-picker { top: auto; bottom: calc(100% + 7px); }
.commercial-member-combobox { display: grid; min-height: 38px; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 0 7px 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.commercial-member-combobox:focus-within { border-color: var(--secondary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--secondary) 12%, transparent); }
.commercial-member-combobox svg { width: 15px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.commercial-member-combobox input { width: 100%; min-width: 0; height: 36px; padding: 0; border: 0; color: var(--ink); outline: 0; background: transparent; font-size: 10px; }
.commercial-member-combobox input::placeholder { color: var(--muted); opacity: 1; }
.commercial-member-combobox > button { display: grid; width: 25px; height: 25px; padding: 0; place-items: center; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 17px; cursor: pointer; }
.commercial-member-combobox > button:hover { color: var(--ink); background: var(--theme-subtle-bg); }
.commercial-member-results { overflow-y: auto; max-height: 248px; margin-top: 5px; overscroll-behavior: contain; }
.commercial-member-option { display: grid; width: 100%; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.commercial-member-option:hover:not(:disabled), .commercial-member-option:focus-visible { outline: 0; background: color-mix(in srgb, var(--blue-100) 65%, var(--surface)); }
.commercial-member-option:disabled { opacity: .72; cursor: not-allowed; }
.commercial-member-option .commercial-member-avatar { width: 28px; height: 28px; }
.commercial-member-option-copy { display: grid; min-width: 0; gap: 2px; }
.commercial-member-option-copy strong, .commercial-member-option-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.commercial-member-option-copy strong { color: var(--ink); font-size: 9px; }
.commercial-member-option-copy small { color: var(--muted); font-size: 7px; }
.commercial-member-option-state { color: var(--secondary); font-size: 7px; font-weight: 850; white-space: nowrap; }
.commercial-member-option-state.is-assigned { max-width: 105px; overflow: hidden; padding: 3px 5px; border-radius: 999px; color: var(--muted); background: var(--theme-subtle-bg); text-overflow: ellipsis; }
.commercial-member-no-results { display: grid; gap: 3px; padding: 18px 12px; color: var(--muted); text-align: center; }
.commercial-member-no-results strong { color: var(--ink); font-size: 9px; }
.commercial-member-no-results span { font-size: 8px; }
.group-form-actions { display: grid; grid-template-columns: 1fr 1fr; align-content: center; gap: 6px; }
.group-form-actions .commercial-group-save-status { grid-column: 1 / -1; color: var(--muted); font-size: 7px; text-align: center; }
.commercial-group-row.is-dirty .commercial-group-save-status { color: color-mix(in srgb, var(--accent) 68%, var(--ink)); font-weight: 800; }
.group-form-actions .button { min-width: 0; min-height: 31px; justify-content: center; padding: 6px 8px; font-size: 8px; white-space: nowrap; }
.commercial-groups-empty { border-top: 1px solid var(--line); }
.commercial-groups-empty > div { padding: 28px 18px; color: var(--muted); font-size: 9px; text-align: center; }
.policy-person { overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.policy-person > summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; cursor: pointer; }
.policy-person > summary span { display: grid; gap: .2rem; }
.visibility-policy-list { display: grid; gap: .75rem; margin-top: 1rem; }
.policy-table-wrap { overflow-x: auto; padding: 0 1rem 1rem; }
.policy-table td:first-child { display: grid; gap: .15rem; }
.policy-table select { min-width: 190px; min-height: 40px; padding: 8px 10px; border: 1px solid var(--theme-strong-line); border-radius: 9px; color: var(--ink); background: var(--theme-input-bg); }
@media (max-width: 1100px) {
  .commercial-groups-table-head, .commercial-group-row { grid-template-columns: minmax(165px, .7fr) minmax(220px, 1fr) minmax(235px, 1.05fr) 130px; }
  .group-form-actions { grid-template-columns: 1fr; }
  .group-form-actions .commercial-group-save-status { grid-column: auto; }
}
@media (max-width: 880px) {
  .commercial-groups-table { border: 0; background: transparent; }
  .commercial-groups-table-head { display: none; }
  .commercial-groups-table-body { display: grid; gap: 12px; }
  .commercial-group-row { display: grid; grid-template-columns: 1fr; overflow: visible; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 6px 18px rgba(26, 52, 76, .05); }
  .commercial-group-row.is-dirty { box-shadow: inset 3px 0 0 var(--accent), 0 6px 18px rgba(26, 52, 76, .05); }
  .commercial-group-row > * { padding: 11px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .commercial-group-row > *:last-child { border-bottom: 0; }
  .commercial-group-row > [data-label]::before { display: block; margin-bottom: 7px; color: var(--muted); content: attr(data-label); font-size: 7px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
  .commercial-group-name-cell { align-content: start; }
  .commercial-group-name-cell input { padding-inline: 0; font-size: 13px; }
  .commercial-group-name-cell input:hover { padding-inline: 9px; }
  .commercial-group-name-cell small { padding-inline: 0; }
  .commercial-group-cell { display: block; }
  .group-form-actions { display: flex; flex-wrap: wrap; align-items: center; }
  .group-form-actions::before { width: 100%; }
  .group-form-actions .commercial-group-save-status { margin-right: auto; text-align: left; }
  .group-form-actions .button { min-width: 104px; }
  .commercial-member-picker, .commercial-group-row > .commercial-group-cell:nth-child(3) .commercial-member-picker { right: 0; left: 0; width: 100%; }
  .commercial-groups-empty { border: 1px dashed var(--line); border-radius: 12px; background: var(--surface); }
}
@media (max-width: 560px) {
  .commercial-groups-card { padding: 16px; }
  .commercial-groups-heading { align-items: stretch; flex-direction: column; }
  .commercial-groups-heading-actions { flex-wrap: wrap; justify-content: space-between; }
  .commercial-groups-heading-actions .button { width: 100%; flex: 1 1 100%; justify-content: center; }
  .commercial-groups-intro p { width: 100%; }
  .commercial-groups-intro span { flex: 1 1 100%; white-space: normal; text-align: center; }
  .commercial-groups-cost-access-note { margin-top: -6px; padding: 10px; }
  .commercial-member-chip > span:nth-child(2) { max-width: 180px; }
  .group-form-actions .commercial-group-save-status { width: 100%; }
  .group-form-actions .button { flex: 1; }
}


/* Espacio de trabajo de oportunidad */
.opportunity-workspace { width: 100%; margin: 0; }
.workspace-breadcrumb { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: var(--muted); font-size: 10px; font-weight: 750; }
.workspace-breadcrumb button { padding: 3px 0; border: 0; color: var(--navy-800); background: transparent; font-weight: 850; cursor: pointer; }
.workspace-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 28px; padding: 24px 26px; border: 1px solid color-mix(in srgb, var(--workspace-stage) 25%, var(--line)); border-top: 4px solid var(--workspace-stage); border-radius: 15px; background: #fff; box-shadow: 0 8px 28px rgba(29, 57, 82, .08); }
.workspace-hero-main { min-width: 0; }
.workspace-hero-title { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-bottom: 9px; }
.workspace-code { padding: 4px 7px; border-radius: 7px; color: var(--navy-900); background: var(--blue-100); font-size: 9px; font-weight: 900; letter-spacing: .05em; }
.workspace-archive-badge { padding: 4px 7px; border-radius: 999px; color: var(--muted); background: #edf1f4; font-size: 8px; font-weight: 850; text-transform: uppercase; }
.workspace-hero h1 { overflow-wrap: anywhere; margin: 0; color: var(--navy-950); font-size: clamp(25px, 3vw, 38px); line-height: 1.05; letter-spacing: -.045em; }
.workspace-hero-main > p { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.workspace-stage-path { display: flex; max-width: 620px; gap: 5px; margin-top: 18px; }
.workspace-stage-path span { height: 5px; flex: 1; border-radius: 999px; background: #e4e9ed; }
.workspace-stage-path span.done { background: color-mix(in srgb, var(--workspace-stage) 55%, #c9d6de); }
.workspace-stage-path span.current { background: var(--workspace-stage); box-shadow: 0 0 0 3px color-mix(in srgb, var(--workspace-stage) 12%, transparent); }
.workspace-stage-select { display: flex; width: max-content; align-items: center; gap: 8px; margin-top: 13px; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.workspace-stage-select select { max-width: 260px; height: 31px; padding: 3px 26px 3px 8px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; font-size: 10px; font-weight: 750; text-transform: none; }
.workspace-hero-value { display: flex; align-items: center; justify-content: flex-end; gap: 16px; text-align: right; }
.workspace-hero-value > div:last-child { display: grid; gap: 2px; }
.workspace-hero-value small { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.workspace-hero-value > div:last-child strong { color: var(--navy-950); font-size: 25px; letter-spacing: -.04em; }
.workspace-hero-value > div:last-child span { color: var(--green-600); font-size: 10px; font-weight: 800; }
.workspace-probability { display: grid; width: 76px; height: 76px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--workspace-stage) calc(var(--probability) * 1%), color-mix(in srgb, var(--workspace-stage) 10%, #e9eef1) 0); }
.workspace-probability::before { width: 61px; height: 61px; border-radius: 50%; background: #fff; content: ""; }
.workspace-probability span { position: absolute; display: grid; text-align: center; }
.workspace-probability strong { color: var(--navy-950); font-size: 16px; line-height: 1; }
.workspace-probability small { margin-top: 3px; font-size: 7px; letter-spacing: 0; text-transform: none; }
.workspace-hero-actions { display: flex; grid-column: 1 / -1; gap: 7px; padding-top: 13px; border-top: 1px solid var(--line); }
.workspace-hero-actions .button { min-height: 34px; padding: 7px 11px; font-size: 9px; }
.workspace-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(320px, .72fr); align-items: start; gap: 16px; margin-top: 16px; }
.workspace-main, .workspace-side { display: grid; min-width: 0; gap: 14px; }
.workspace-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 5px 18px rgba(29, 57, 82, .055); }
.workspace-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.workspace-section-heading h2 { margin: 2px 0 0; color: var(--navy-950); font-size: 16px; line-height: 1.2; letter-spacing: -.02em; }
.workspace-kicker { color: var(--workspace-stage, var(--navy-700)); font-size: 8px; font-weight: 900; letter-spacing: .12em; }
.workspace-next-action { border-left: 4px solid #8aa4b7; }
.workspace-next-action.urgency-overdue { border-left-color: var(--red-500); }
.workspace-next-action.urgency-today { border-left-color: var(--amber-500); }
.workspace-next-action.urgency-scheduled { border-left-color: var(--green-600); }
.workspace-urgency-pill { padding: 5px 8px; border-radius: 999px; color: #41576a; background: #edf3f6; font-size: 8px; font-weight: 850; }
.workspace-urgency-pill.overdue { color: #a52f3d; background: var(--red-100); }
.workspace-urgency-pill.today { color: #805b09; background: var(--amber-100); }
.workspace-urgency-pill.scheduled { color: #116846; background: var(--green-100); }
.workspace-next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 17px; }
.workspace-next-grid > div { min-width: 0; padding: 10px 12px; border-radius: 10px; background: #f5f8fa; }
.workspace-next-grid small, .workspace-contact-company small, .workspace-original-note small { display: block; color: var(--muted); font-size: 7px; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.workspace-next-grid strong { display: block; overflow: hidden; margin-top: 3px; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-next-actions { display: flex; gap: 7px; margin-top: 14px; }
.workspace-next-actions .button { min-height: 34px; padding: 7px 11px; font-size: 9px; }
.workspace-closed-banner { display: flex; align-items: center; gap: 15px; border-left: 4px solid var(--workspace-stage); }
.workspace-closed-banner > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; color: #fff; background: var(--workspace-stage); font-size: 20px; font-weight: 900; }
.workspace-closed-banner small, .workspace-closed-banner h2, .workspace-closed-banner p { margin: 0; }
.workspace-closed-banner small { color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .1em; }
.workspace-closed-banner h2 { color: var(--navy-950); font-size: 18px; }
.workspace-closed-banner p { color: var(--muted); font-size: 9px; }
.workspace-inline-form { margin-top: 15px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: #f7fafb; }
.workspace-form-heading { display: grid; gap: 2px; margin-bottom: 12px; }
.workspace-form-heading strong { color: var(--navy-950); font-size: 11px; }
.workspace-form-heading small { color: var(--muted); font-size: 8px; }
.workspace-form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.workspace-form-grid label, .workspace-composer-fields label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 800; }
.workspace-form-grid .span-two { grid-column: span 2; }
.workspace-form-grid input, .workspace-form-grid select, .workspace-form-grid textarea, .workspace-composer-fields input, .workspace-composer-fields select, .workspace-composer-fields textarea { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); outline: 0; background: #fff; font-size: 10px; resize: vertical; }
.workspace-form-grid input, .workspace-form-grid select { min-height: 36px; }
.workspace-form-divider { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 7px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.workspace-form-divider::after { height: 1px; flex: 1; background: var(--line); content: ""; }
.workspace-form-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 12px; }
.workspace-form-actions .button { min-height: 32px; padding: 6px 10px; font-size: 8px; }
.workspace-log-tools { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 7px; }
.workspace-log-stats { display: flex; gap: 6px; }
.workspace-log-stats span, .workspace-period { padding: 5px 7px; border-radius: 7px; color: var(--muted); background: #f0f4f6; font-size: 8px; }
.workspace-log-stats b { color: var(--navy-900); }
.workspace-correction-toggle { min-height: 29px; padding: 5px 9px; font-size: 8px; white-space: nowrap; }
.workspace-correction-toggle.is-active { border-color: var(--amber-500); color: var(--ink); background: var(--amber-100); box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber-500) 12%, transparent); }
.workspace-correction-notice { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 9px; margin-top: 14px; padding: 10px 11px; border: 1px solid color-mix(in srgb, var(--amber-500) 45%, var(--line)); border-radius: 10px; color: var(--ink); background: color-mix(in srgb, var(--amber-100) 78%, var(--surface)); }
.workspace-correction-notice::before { display: grid; width: 24px; height: 24px; grid-row: 1 / span 2; place-items: center; border-radius: 7px; color: #6d4b00; background: var(--amber-500); content: "!"; font-size: 12px; font-weight: 900; }
.workspace-correction-notice strong, .workspace-correction-notice span { display: block; }
.workspace-correction-notice strong { font-size: 10px; }
.workspace-correction-notice span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.workspace-composer { margin: 15px 0 20px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.workspace-composer-tabs { display: flex; padding: 5px 6px 0; gap: 4px; background: #f4f7f9; }
.workspace-composer-tabs label { cursor: pointer; }
.workspace-composer-tabs input { position: absolute; opacity: 0; }
.workspace-composer-tabs span { display: block; padding: 7px 9px; border-radius: 7px 7px 0 0; color: var(--muted); font-size: 8px; font-weight: 850; }
.workspace-composer-tabs input:checked + span { color: var(--navy-950); background: #fff; box-shadow: 0 -1px 0 var(--line), 1px 0 0 var(--line), -1px 0 0 var(--line); }
.workspace-composer-fields { display: grid; grid-template-columns: 150px minmax(0, 1fr) 180px; gap: 9px; padding: 12px; }
.workspace-composer-fields .workspace-event-body-field { grid-column: 1 / -1; }
.workspace-email-file-field { display: grid; grid-column: 1 / -1; gap: 6px; color: var(--muted); font-size: 8px; font-weight: 800; }
.workspace-email-file-field[hidden] { display: none; }
.workspace-email-file-field > small { font-size: 7px; font-weight: 500; line-height: 1.45; }
.workspace-email-upload { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px; border: 1px dashed var(--theme-strong-line); border-radius: 9px; background: var(--theme-subtle-bg); }
.workspace-email-upload .workspace-email-choose { display: inline-flex; min-height: 34px; align-items: center; justify-content: center; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--workspace-stage) 45%, var(--line)); border-radius: 8px; color: var(--navy-950); background: var(--surface); cursor: pointer; font-size: 8px; font-weight: 850; }
.workspace-email-upload .workspace-email-choose:hover { border-color: var(--workspace-stage); background: color-mix(in srgb, var(--workspace-stage) 7%, var(--surface)); }
.workspace-email-upload > div { min-width: 0; }
.workspace-email-upload strong, .workspace-email-upload small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-email-upload strong { color: var(--ink); font-size: 9px; }
.workspace-email-upload small { margin-top: 2px; color: var(--muted); font-size: 7px; font-weight: 500; }
.workspace-email-upload .button { min-height: 31px; padding: 6px 9px; font-size: 8px; }
.workspace-composer-fields textarea { min-height: 70px; border: 0; padding: 4px; font-size: 11px; box-shadow: none; }
.workspace-composer-footer { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--line); background: #fbfcfd; }
.workspace-composer-footer small { margin-right: auto; color: var(--muted); font-size: 8px; }
.workspace-composer-footer .button { min-height: 31px; padding: 6px 10px; font-size: 8px; }
.workspace-timeline { position: relative; display: grid; gap: 0; margin-top: 4px; }
.workspace-timeline::before { position: absolute; top: 14px; bottom: 14px; left: 14px; width: 1px; background: var(--line); content: ""; }
.workspace-event { position: relative; display: grid; grid-template-columns: 29px minmax(0, 1fr); gap: 11px; padding: 10px 0; }
.workspace-event-marker { z-index: 1; display: grid; width: 29px; height: 29px; place-items: center; border: 3px solid #fff; border-radius: 50%; color: var(--navy-900); background: var(--blue-100); font-size: 9px; font-weight: 900; }
.workspace-event-marker.contact { color: #9b4b14; background: var(--orange-100); }
.workspace-event-marker.completed { color: #116846; background: var(--green-100); }
.workspace-event-marker.scheduled { color: #73530e; background: var(--amber-100); }
.workspace-event-marker.stage { color: var(--workspace-stage); background: var(--workspace-stage-tint); }
.workspace-event-marker.created { color: #665073; background: var(--purple-100); }
.workspace-event-body { min-width: 0; padding: 1px 0 12px; border-bottom: 1px solid #edf1f3; }
.workspace-event:last-child .workspace-event-body { border-bottom: 0; }
.workspace-event-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--muted); font-size: 7px; }
.workspace-event-meta strong { color: var(--navy-800); font-size: 8px; text-transform: uppercase; letter-spacing: .04em; }
.workspace-event-meta time { margin-left: auto; }
.workspace-event-channel { padding: 2px 5px; border-radius: 999px; color: var(--muted); background: #eef3f5; font-weight: 750; }
.workspace-event-body h4 { margin: 5px 0 0; color: var(--ink); font-size: 11px; }
.workspace-event-body p { margin: 4px 0 0; color: #435565; font-size: 10px; line-height: 1.55; white-space: pre-wrap; }
.workspace-event-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 5px; }
.workspace-event-footer small { color: var(--muted); font-size: 7px; }
.workspace-event-correction { min-height: 29px; flex: 0 0 auto; padding: 5px 8px; font-size: 8px; }
.workspace-email-attachment { display: grid; min-width: 0; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; margin-top: 9px; padding: 9px 10px; border: 1px solid color-mix(in srgb, var(--workspace-stage) 32%, var(--line)); border-radius: 9px; background: color-mix(in srgb, var(--workspace-stage) 6%, var(--theme-subtle-bg)); }
.workspace-email-attachment-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--workspace-stage); background: color-mix(in srgb, var(--workspace-stage) 13%, var(--surface)); font-size: 13px; }
.workspace-email-attachment > div { min-width: 0; }
.workspace-email-attachment strong, .workspace-email-attachment small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-email-attachment strong { color: var(--ink); font-size: 9px; }
.workspace-email-attachment small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.workspace-email-attachment .button { min-height: 30px; padding: 6px 9px; font-size: 8px; }
.workspace-email-attachment-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.workspace-email-attachment.restricted { border-style: dashed; }
.workspace-email-restricted { color: var(--muted); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.workspace-activity-chart { display: grid; height: 175px; grid-template-columns: repeat(6, 1fr); align-items: end; gap: 11px; margin-top: 16px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); background: repeating-linear-gradient(to top, transparent 0 41px, #eef2f4 42px); }
.workspace-chart-column { display: grid; height: 100%; grid-template-rows: 18px 1fr 22px; align-items: end; text-align: center; }
.workspace-chart-value { color: var(--muted); font-size: 8px; font-weight: 800; }
.workspace-chart-track { position: relative; height: 100%; }
.workspace-chart-track i { position: absolute; right: 18%; bottom: 0; left: 18%; min-height: 2px; border-radius: 5px 5px 0 0; background: linear-gradient(to top, var(--workspace-stage), color-mix(in srgb, var(--workspace-stage) 52%, #fff)); }
.workspace-chart-column small { padding-top: 5px; color: var(--muted); font-size: 8px; text-transform: capitalize; }
.workspace-channel-section { margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.workspace-channel-section h3 { margin: 0 0 10px; color: var(--navy-950); font-size: 11px; }
.workspace-channel-table { width: 100%; border-collapse: collapse; font-size: 9px; }
.workspace-channel-table th { padding: 7px 6px; color: var(--muted); font-size: 7px; text-align: left; text-transform: uppercase; }
.workspace-channel-table td { padding: 8px 6px; border-top: 1px solid #edf1f3; }
.workspace-channel-table td:nth-child(2) { width: 70px; }
.workspace-channel-table td:last-child { display: grid; grid-template-columns: minmax(60px, 1fr) 34px; align-items: center; gap: 8px; }
.workspace-channel-table td > span { height: 5px; overflow: hidden; border-radius: 999px; background: #e8edef; }
.workspace-channel-table td > span i { display: block; height: 100%; border-radius: inherit; background: var(--workspace-stage); }
.workspace-channel-table b { color: var(--muted); font-size: 8px; text-align: right; }
.workspace-mini-empty { padding: 16px; border: 1px dashed var(--line); border-radius: 9px; color: var(--muted); background: #fafcfd; font-size: 9px; text-align: center; }
.workspace-health { overflow: hidden; }
.workspace-health-row { display: grid; grid-template-columns: 100px minmax(60px, 1fr) 34px; align-items: center; gap: 8px; margin-top: 14px; font-size: 8px; }
.workspace-health-row > span { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.workspace-health-row > div { height: 6px; overflow: hidden; border-radius: 999px; background: #e8edef; }
.workspace-health-row i { display: block; height: 100%; border-radius: inherit; background: var(--workspace-stage); }
.workspace-health-row b { color: var(--navy-900); font-size: 8px; text-align: right; }
.workspace-days-open { display: flex; align-items: baseline; gap: 7px; margin: 18px -20px -20px; padding: 13px 20px; background: color-mix(in srgb, var(--workspace-stage-tint) 45%, #f6f9fa); }
.workspace-days-open strong { color: var(--workspace-stage); font-size: 22px; line-height: 1; }
.workspace-days-open span { color: var(--muted); font-size: 8px; font-weight: 750; }
.workspace-contact ul { display: grid; gap: 7px; margin: 14px 0 0; padding: 0; list-style: none; }
.workspace-contact li { overflow-wrap: anywhere; padding-left: 15px; color: var(--ink); font-size: 9px; }
.workspace-contact li::before { margin-left: -15px; margin-right: 7px; color: var(--workspace-stage); content: "•"; }
.workspace-muted { color: var(--muted); font-size: 9px; }
.workspace-contact-company { display: grid; gap: 3px; margin: 15px -20px -20px; padding: 14px 20px; border-radius: 0 0 14px 14px; background: #f6f8fa; }
.workspace-contact-company strong { margin-top: 2px; color: var(--navy-950); font-size: 10px; }
.workspace-contact-company span { overflow-wrap: anywhere; color: var(--muted); font-size: 8px; }
.workspace-facts dl { display: grid; gap: 0; margin: 12px 0 0; }
.workspace-facts dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 9px 0; border-top: 1px solid #edf1f3; }
.workspace-facts dt { color: var(--muted); font-size: 8px; }
.workspace-facts dd { max-width: 60%; margin: 0; color: var(--ink); font-size: 8px; font-weight: 750; text-align: right; }
.workspace-original-note { margin-top: 12px; padding: 11px; border-radius: 9px; background: var(--amber-100); }
.workspace-original-note p { margin: 5px 0 0; color: var(--ink); font-size: 9px; line-height: 1.5; white-space: pre-wrap; }

@media (max-width: 1100px) {
  .workspace-layout { grid-template-columns: minmax(0, 1fr) 290px; }
  .workspace-hero { grid-template-columns: minmax(0, 1fr); }
  .workspace-hero-value { justify-content: flex-start; text-align: left; }
  .workspace-hero-actions { grid-column: auto; }
}
@media (max-width: 850px) {
  .workspace-layout { grid-template-columns: 1fr; }
  .workspace-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-facts { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .workspace-hero, .workspace-card { padding: 16px; }
  .workspace-hero { gap: 15px; }
  .workspace-hero-value { align-items: flex-start; flex-direction: column; }
  .workspace-hero-value > div:last-child { text-align: left; }
  .workspace-hero-actions { flex-wrap: wrap; }
  .workspace-hero-actions .button { flex: 1; }
  .workspace-next-grid, .workspace-form-grid, .workspace-side { grid-template-columns: 1fr; }
  .workspace-form-grid .span-two, .workspace-facts { grid-column: auto; }
  .workspace-section-heading { align-items: stretch; flex-direction: column; gap: 8px; }
  .workspace-log-tools, .workspace-event-footer { align-items: stretch; flex-direction: column; }
  .workspace-log-stats { flex-wrap: wrap; }
  .workspace-correction-toggle, .workspace-event-correction { width: 100%; min-height: 40px; }
  .workspace-composer-fields { grid-template-columns: 1fr; }
  .workspace-composer-fields .workspace-event-body-field { grid-column: auto; }
  .workspace-email-file-field { grid-column: auto; }
  .workspace-email-upload, .workspace-email-attachment { grid-template-columns: auto minmax(0, 1fr); }
  .workspace-email-upload .button, .workspace-email-attachment .button, .workspace-email-restricted { grid-column: 1 / -1; width: 100%; justify-content: center; text-align: center; }
  .workspace-email-attachment-actions { grid-column: 1 / -1; width: 100%; }
  .workspace-email-attachment-actions .button { flex: 1; }
  .workspace-composer-footer { align-items: stretch; flex-direction: column; }
  .workspace-composer-footer .button { width: 100%; }
  .workspace-event-meta time { width: 100%; margin-left: 0; }
  .workspace-next-actions, .workspace-form-actions { align-items: stretch; flex-direction: column; }
  .workspace-next-actions .button, .workspace-form-actions .button { width: 100%; }
  .workspace-activity-chart { gap: 5px; padding-inline: 0; }
  .workspace-chart-track i { right: 12%; left: 12%; }
}

.email-preview-dialog {
  position: fixed;
  inset: 0;
  width: min(820px, calc(100vw - 28px));
  max-width: none;
  max-height: min(780px, calc(100vh - 28px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 28px 80px rgba(8, 24, 38, .32);
}
.email-preview-dialog::backdrop { background: rgba(8, 20, 31, .68); backdrop-filter: blur(5px); }
.email-preview-dialog[open] { animation: confirmation-dialog-in .18s ease-out; }
.email-preview-card { display: grid; max-height: min(780px, calc(100vh - 28px)); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.email-preview-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.email-preview-header .eyebrow { margin: 0 0 3px; }
.email-preview-header h2 { margin: 0; color: var(--navy-950); font-size: 21px; letter-spacing: -.025em; }
.email-preview-header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.email-preview-content { min-height: 260px; overflow: auto; padding: 20px; overscroll-behavior: contain; }
.email-preview-message { display: grid; gap: 16px; }
.email-preview-meta { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 7px 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg); }
.email-preview-meta dt { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.email-preview-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; color: var(--ink); font-size: 10px; }
.email-preview-body { min-height: 180px; margin: 0; padding: 16px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--theme-input-bg); font: 10px/1.62 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.email-preview-empty { margin: 0; padding: 18px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); background: var(--theme-subtle-bg); font-size: 10px; text-align: center; }
.email-preview-notice { margin: -7px 0 0; color: var(--muted); font-size: 8px; }
.email-preview-attachments { display: grid; gap: 7px; }
.email-preview-attachments h3 { margin: 0; color: var(--navy-950); font-size: 10px; }
.email-preview-attachments ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.email-preview-attachments li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--theme-subtle-bg); font-size: 9px; }
.email-preview-attachments li span { overflow-wrap: anywhere; }
.email-preview-attachments li small { flex: 0 0 auto; color: var(--muted); }
.email-preview-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--theme-subtle-bg); }
.email-preview-actions > span { margin-right: auto; color: var(--muted); font-size: 8px; }

@media (max-width: 620px) {
  .email-preview-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .email-preview-card { max-height: calc(100vh - 16px); }
  .email-preview-header { padding: 14px; }
  .email-preview-header h2 { font-size: 18px; }
  .email-preview-content { min-height: 220px; padding: 12px; }
  .email-preview-meta { grid-template-columns: 1fr; gap: 3px; }
  .email-preview-meta dd { margin-bottom: 6px; }
  .email-preview-actions { align-items: stretch; flex-direction: column; padding: 12px; }
  .email-preview-actions > span { margin: 0 0 3px; text-align: center; }
  .email-preview-actions .button { width: 100%; justify-content: center; }
}

/* Confirmaciones integradas: reemplazan los diálogos nativos del navegador. */
.avatar-crop-dialog {
  position: fixed;
  inset: 0;
  width: min(820px, calc(100vw - 28px));
  max-width: none;
  max-height: min(760px, calc(100vh - 28px));
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 18px;
  color: var(--ink);
  background: transparent;
  box-shadow: 0 28px 80px rgba(8, 24, 38, .3);
}
.avatar-crop-dialog::backdrop { background: rgba(8, 20, 31, .68); backdrop-filter: blur(5px); }
.avatar-crop-dialog[open] { animation: confirmation-dialog-in .18s ease-out; }
.avatar-crop-card { overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.avatar-crop-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.avatar-crop-header .eyebrow { margin-bottom: 3px; }
.avatar-crop-header h2 { margin: 0; color: var(--navy-950); font-size: 21px; letter-spacing: -.025em; }
.avatar-crop-layout { display: grid; grid-template-columns: minmax(300px, 480px) minmax(210px, 1fr); gap: 22px; padding: 20px; }
.avatar-crop-workspace { min-width: 0; }
.avatar-crop-stage { position: relative; overflow: hidden; width: 100%; max-width: 480px; aspect-ratio: 1; margin: auto; border: 1px solid var(--theme-strong-line); border-radius: 16px; background: #15212b; cursor: grab; touch-action: none; user-select: none; }
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage:focus-within { outline: 3px solid #ffbf47; outline-offset: 3px; }
.avatar-crop-stage canvas { display: block; width: 100%; height: 100%; outline: 0; }
.avatar-crop-mask { position: absolute; top: 50%; left: 50%; box-sizing: content-box; width: 75%; aspect-ratio: 1; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 999px rgba(7, 17, 25, .58), 0 0 0 5px rgba(247, 171, 8, .82); transform: translate(-50%, -50%); pointer-events: none; }
.avatar-crop-workspace > p { max-width: 480px; margin: 11px auto 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.avatar-crop-controls { display: flex; min-width: 0; flex-direction: column; gap: 12px; }
.avatar-crop-result { display: flex; align-items: center; gap: 11px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--theme-subtle-bg); }
.avatar-crop-result canvas { display: block; width: 64px; height: 64px; flex: 0 0 auto; border: 2px solid var(--surface); border-radius: 50%; background: var(--canvas); box-shadow: 0 0 0 1px var(--line); }
.avatar-crop-result strong, .avatar-crop-result span { display: block; }
.avatar-crop-result strong { color: var(--navy-950); font-size: 11px; }
.avatar-crop-result span { margin-top: 3px; color: var(--muted); font-size: 8px; }
.avatar-zoom-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); font-size: 10px; font-weight: 800; }
.avatar-zoom-label output { color: var(--secondary); font-variant-numeric: tabular-nums; }
#avatar-zoom { width: 100%; accent-color: var(--lime-500); cursor: pointer; }
.avatar-position-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.avatar-position-controls .button { min-width: 0; justify-content: center; padding-inline: 8px; font-size: 15px; }
.avatar-crop-guidance { display: grid; gap: 3px; margin: 2px 0 0; padding: 11px; border-radius: 10px; color: var(--muted); background: var(--theme-subtle-bg); font-size: 8px; line-height: 1.45; }
.avatar-crop-guidance strong { color: var(--ink); font-size: 9px; }
.avatar-crop-status { min-height: 16px; color: var(--muted); font-size: 8px; line-height: 1.4; }
.avatar-crop-status.error { color: var(--red-500); }
.avatar-crop-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--theme-subtle-bg); }

@media (max-width: 720px) {
  .profile-avatar-layout { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .profile-avatar-copy { justify-items: center; }
  .profile-avatar-actions { width: 100%; }
  .profile-avatar-actions .button { width: 100%; }
  .avatar-crop-dialog { max-height: calc(100vh - 16px); }
  .avatar-crop-layout { grid-template-columns: 1fr; padding: 14px; }
  .avatar-crop-stage { max-width: 390px; }
  .avatar-crop-controls { display: grid; grid-template-columns: 1fr; }
  .avatar-crop-result { display: none; }
  .avatar-crop-actions { padding: 12px 14px; }
  .avatar-crop-actions .button { flex: 1; justify-content: center; }
}

.confirmation-dialog {
  position: fixed;
  inset: 0;
  width: min(460px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--ink);
  background: transparent;
}
.confirmation-dialog[open] { animation: confirmation-dialog-in .18s ease-out; }
.confirmation-dialog::backdrop {
  background: rgba(8, 25, 42, .58);
  backdrop-filter: blur(4px);
}
.confirmation-dialog-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(6, 25, 43, .28);
}
.confirmation-dialog-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: var(--navy-900);
  background: var(--blue-100);
  font-size: 20px;
  font-weight: 900;
}
.confirmation-dialog-copy { min-width: 0; }
.confirmation-dialog-copy .eyebrow { margin-bottom: 5px; }
.confirmation-dialog-copy h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: -.025em;
}
.confirmation-dialog-copy > p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.confirmation-dialog-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.confirmation-dialog.is-danger .confirmation-dialog-icon {
  color: #af3040;
  background: var(--red-100);
}
.confirmation-dialog.is-danger #confirmation-accept {
  color: #fff;
  background: var(--red-500);
  box-shadow: 0 7px 16px rgba(217, 77, 93, .2);
}
@keyframes confirmation-dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
}
@media (max-width: 480px) {
  .confirmation-dialog-card { grid-template-columns: 38px minmax(0, 1fr); padding: 18px; }
  .confirmation-dialog-icon { width: 38px; height: 38px; border-radius: 12px; }
  .confirmation-dialog-actions { align-items: stretch; flex-direction: column-reverse; }
  .confirmation-dialog-actions .button { width: 100%; justify-content: center; }
}

.pipeline-loss-dialog {
  position: fixed;
  inset: 0;
  width: min(680px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  overflow: visible;
  border: 0;
  color: var(--ink);
  background: transparent;
}
.pipeline-loss-dialog[open] { animation: confirmation-dialog-in .18s ease-out; }
.pipeline-loss-dialog::backdrop {
  background: rgba(8, 25, 42, .58);
  backdrop-filter: blur(4px);
}
.pipeline-loss-dialog-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(6, 25, 43, .28);
}
.pipeline-loss-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}
.pipeline-loss-dialog-header .eyebrow { margin: 0 0 5px; color: #af3040; }
.pipeline-loss-dialog-header h2 { margin: 0; color: var(--navy-950); font-size: 21px; }
.pipeline-loss-dialog-header p:last-child { margin: 7px 0 0; color: var(--muted); font-size: 12px; }
.pipeline-loss-dialog-fields { padding: 20px 24px; }
.pipeline-loss-dialog-fields input[readonly] { color: var(--muted); background: var(--slate-50); }
.pipeline-loss-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
  background: var(--slate-50);
}
.pipeline-loss-dialog-actions .form-status { margin-right: auto; }
@media (max-width: 600px) {
  .pipeline-loss-dialog-fields { grid-template-columns: 1fr; }
  .pipeline-loss-dialog-fields .span-two { grid-column: auto; }
  .pipeline-loss-dialog-actions { align-items: stretch; flex-direction: column; }
  .pipeline-loss-dialog-actions .form-status { margin: 0; }
  .pipeline-loss-dialog-actions .button { width: 100%; justify-content: center; }
}

/* Prioridad final sobre el estilo histórico de la vista de valores. */
.cost-values-hero { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); gap: 24px; margin-bottom: 16px; }
.cost-values-hero h2 { font-size: 23px; }
.cost-values-hero > div > p:last-child { font-size: 12px; }
.cost-values-hero label,
.cost-values-create label,
.cost-value-row label,
.cost-values-toolbar label { gap: 6px; font-size: 11px; letter-spacing: .025em; }
.cost-values-hero :is(select, input),
.cost-values-create :is(select, input),
.cost-value-row :is(select, input),
.cost-values-toolbar input { min-height: 42px; padding: 9px 11px; border-radius: 9px; font-size: 12px; }
@media (max-width: 860px) {
  .cost-values-hero { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .cost-values-hero h2 { font-size: 20px; }
}

/* Cotizaciones cotjson: el contenedor sigue el tema; la cotización conserva papel blanco. */
.workspace-quote { display: grid; gap: 16px; overflow: hidden; }
.quote-card-heading { align-items: flex-start; gap: 14px; }
.quote-card-heading > div:first-child { min-width: 0; }
.quote-card-heading h2 { overflow-wrap: anywhere; }
.quote-card-heading p { margin: 5px 0 0; color: var(--muted); font-size: 9px; }
.quote-card-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.quote-card-actions .button, .quote-revision-actions .button { min-height: 34px; padding: 7px 10px; font-size: 9px; }
.quote-visibility-toggle { gap: 6px; }
.quote-visibility-toggle [aria-hidden] { font-size: 12px; line-height: 1; }
.quote-file-meta { display: flex; gap: 7px 14px; color: var(--muted); font-size: 8px; flex-wrap: wrap; }
.quote-file-meta span { display: inline-flex; align-items: center; gap: 5px; }
.quote-file-meta span + span::before { content: "•"; margin-right: 5px; color: var(--line-strong); }
.quote-upload-status { min-height: 0; color: var(--secondary); font-size: 9px; font-weight: 750; }
.quote-upload-status:empty { display: none; }
.quote-rendered-view { display: grid; gap: 16px; }
.quote-rendered-view[hidden] { display: none; }

.workspace-quote-empty { min-height: 260px; align-content: start; }
.quote-upload-zone {
  display: grid;
  min-height: 160px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border: 2px dashed color-mix(in srgb, var(--secondary) 30%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--theme-subtle-bg) 84%, var(--secondary) 3%);
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.quote-upload-zone.is-dragging { border-color: var(--secondary); background: color-mix(in srgb, var(--blue-100) 75%, var(--theme-input-bg)); transform: translateY(-2px); }
.quote-upload-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--on-secondary); background: var(--secondary); font-size: 23px; font-weight: 800; box-shadow: 0 8px 18px color-mix(in srgb, var(--secondary) 22%, transparent); }
.quote-upload-zone strong { display: block; color: var(--ink); font-size: 13px; }
.quote-upload-zone p { max-width: 620px; margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.quote-upload-zone code { padding: 1px 5px; border-radius: 5px; color: var(--secondary); background: var(--theme-input-bg); font-size: .95em; }

.quotation-preview-shell { margin-inline: -20px; padding: 22px; overflow-x: auto; background: #e9eef2; scrollbar-color: #8299aa transparent; }
.quotation-paper {
  width: min(816px, 100%);
  min-width: 650px;
  margin: 0 auto;
  padding: 38px;
  border: 1px solid #d7dde2;
  border-radius: 3px;
  color: #17212b;
  background: #fff;
  box-shadow: 0 16px 38px rgba(17, 31, 44, .16);
  font-family: Arial, Helvetica, sans-serif;
}
.quotation-document-header { display: grid; grid-template-columns: minmax(0, 1fr) 210px; align-items: start; gap: 24px; padding-bottom: 17px; border-bottom: 3px solid #f7ab08; }
.quotation-company { display: grid; grid-template-columns: 66px minmax(0, 1fr); align-items: center; gap: 14px; }
.quotation-logo { display: grid; width: 66px; height: 66px; place-items: center; overflow: hidden; }
.quotation-logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.quotation-logo-fallback { display: grid; width: 58px; height: 58px; place-items: center; border-radius: 12px; color: #fff; background: #17212b; font-size: 18px; font-weight: 900; }
.quotation-company h3 { margin: 0 0 5px; color: #101820; font-size: 14px; line-height: 1.25; }
.quotation-company p { margin: 2px 0; color: #485460; font-size: 8px; line-height: 1.35; }
.quotation-document-meta { display: grid; justify-items: end; gap: 5px; text-align: right; }
.quotation-document-meta > span { color: #101820; font-size: 20px; font-weight: 900; letter-spacing: .04em; }
.quotation-document-meta strong { color: #6a4800; font-size: 11px; }
.quotation-document-meta small { color: #59636d; font-size: 9px; }

.quotation-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.quotation-info-grid > div { min-height: 103px; padding: 12px 13px; border: 1px solid #ccd4da; border-radius: 4px; }
.quotation-info-grid h4 { display: flex; gap: 6px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid #e3e7ea; color: #6a4800; font-size: 8px; letter-spacing: .08em; }
.quotation-info-grid h4 span { overflow: hidden; color: #17212b; text-overflow: ellipsis; letter-spacing: 0; white-space: nowrap; }
.quotation-info-grid p { margin: 3px 0; color: #394550; font-size: 8px; line-height: 1.35; }
.quotation-info-grid p strong { color: #17212b; }

.quotation-terms { display: grid; grid-template-columns: .75fr .65fr 1.6fr; margin-top: 10px; border: 1px solid #ccd4da; border-radius: 4px; }
.quotation-terms > div { display: grid; gap: 3px; padding: 9px 11px; }
.quotation-terms > div + div { border-left: 1px solid #d8dee3; }
.quotation-terms strong { color: #6a4800; font-size: 7px; letter-spacing: .04em; text-transform: uppercase; }
.quotation-terms span { color: #25313b; font-size: 8px; }
.quotation-normativa { display: grid; grid-template-columns: 145px minmax(0, 1fr); margin-top: 8px; overflow: hidden; border: 1px solid #e0c57c; border-radius: 4px; font-size: 8px; }
.quotation-normativa strong { padding: 8px 10px; color: #4a3400; background: #fff4cf; text-transform: uppercase; }
.quotation-normativa span { padding: 8px 10px; }

.quotation-items-wrap { margin-top: 14px; overflow: hidden; border: 1px solid #bec8cf; border-radius: 4px; }
.quotation-items { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8px; }
.quotation-items th, .quotation-items td { padding: 7px 8px; border-right: 1px solid #d7dee3; border-bottom: 1px solid #d7dee3; vertical-align: top; }
.quotation-items th:last-child, .quotation-items td:last-child { border-right: 0; }
.quotation-items thead th { color: #322300; background: #f7ab08; font-size: 7px; letter-spacing: .04em; text-transform: uppercase; }
.quotation-items th:nth-child(1) { width: 7%; }
.quotation-items th:nth-child(2) { width: 45%; text-align: left; }
.quotation-items th:nth-child(3) { width: 12%; }
.quotation-items th:nth-child(4), .quotation-items th:nth-child(5) { width: 18%; }
.quotation-items tbody td { min-height: 30px; color: #28343e; white-space: pre-wrap; overflow-wrap: anywhere; }
.quotation-items .quote-empty-row { height: 31px; }
.quote-item-index, .quote-number-cell { text-align: center; }
.quotation-items .quote-number-cell { text-align: right; white-space: nowrap; }
.quotation-items tfoot td { padding-block: 6px; color: #26323b; background: #f6f8f9; font-weight: 700; text-align: right; }
.quotation-items tfoot tr:last-child td { border-bottom: 0; }
.quotation-items tfoot .quotation-total td { color: #fff; background: #17212b; font-size: 10px; }

.quotation-scope { margin-top: 15px; padding: 13px 14px; border: 1px solid #ccd4da; border-radius: 4px; }
.quotation-scope h3 { margin: 0 0 9px; color: #6a4800; font-size: 8px; letter-spacing: .08em; }
.quotation-scope :is(p, li), .quotation-technical-content :is(p, li) { color: #34414c; font-size: 8px; line-height: 1.55; }
.quotation-scope p, .quotation-technical-content p { margin: 5px 0; }
.quotation-scope :is(ul, ol), .quotation-technical-content :is(ul, ol) { margin: 5px 0; padding-left: 22px; }
.quotation-scope strong, .quotation-technical-content strong { color: #17212b; }
.quote-page-break { margin: 16px 0; border: 0; border-top: 1px dashed #b5bfc7; }

.quotation-technical { width: min(816px, 100%); min-width: 650px; margin: 14px auto 0; }
.quotation-technical > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 13px; border-radius: 8px; color: #24323e; background: #fff; cursor: pointer; list-style: none; }
.quotation-technical > summary::-webkit-details-marker { display: none; }
.quotation-technical summary span:first-child { display: grid; gap: 2px; }
.quotation-technical summary strong { font-size: 10px; }
.quotation-technical summary small { color: #667683; font-size: 8px; }
.quotation-technical[open] > summary { margin-bottom: 10px; }
.quotation-technical-paper > header { display: flex; justify-content: space-between; gap: 15px; padding-bottom: 14px; border-bottom: 3px solid #f7ab08; color: #17212b; font-size: 10px; }
.quotation-technical-content { margin-top: 18px; }
.quotation-technical-content h4 { margin: 15px 0 7px; color: #6a4800; font-size: 10px; }

.quote-parse-error { padding: 18px; border: 1px solid #fecaca; border-radius: 10px; color: #991b1b; background: #fff1f2; }
.quote-parse-error strong { display: block; font-size: 11px; }
.quote-parse-error p { margin: 5px 0 0; font-size: 9px; }
.quote-revision-history { border-top: 1px solid var(--line); padding-top: 13px; }
.quote-revision-history > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink); cursor: pointer; font-size: 10px; font-weight: 850; }
.quote-revision-history > summary small { color: var(--muted); font-size: 8px; font-weight: 600; }
.quote-revision-list { display: grid; gap: 8px; margin-top: 11px; }
.quote-revision-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--theme-subtle-bg); }
.quote-revision-list article > div:first-child { display: grid; min-width: 0; gap: 2px; }
.quote-revision-list strong, .quote-revision-list span, .quote-revision-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-revision-list strong { color: var(--ink); font-size: 9px; }
.quote-revision-list span, .quote-revision-list small { color: var(--muted); font-size: 8px; }
.quote-revision-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.workspace-event-marker.quote { color: #6a4800; background: #fff4cf; }

@media (max-width: 850px) {
  .quote-card-heading { align-items: stretch; flex-direction: column; }
  .quote-card-actions { justify-content: flex-start; }
  .quote-upload-zone { grid-template-columns: auto minmax(0, 1fr); }
  .quote-upload-zone .button { grid-column: 1 / -1; justify-self: start; }
  .quote-revision-list article { align-items: flex-start; flex-direction: column; }
  .quote-revision-actions { width: 100%; flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .quotation-preview-shell { margin-inline: -16px; padding: 14px; }
  .quote-upload-zone { grid-template-columns: 1fr; padding: 18px; }
  .quote-upload-icon { width: 42px; height: 42px; }
  .quote-file-meta span + span::before { display: none; }
  .quote-file-meta { flex-direction: column; gap: 4px; }
}

@media (forced-colors: active) {
  .quote-upload-zone, .quotation-paper, .quote-revision-list article { border-color: CanvasText; }
}

/* Prioridad, servicios múltiples y edición completa de oportunidades. */
.priority-stars { display: inline-flex; align-items: center; gap: 1px; color: #bcc6ce; font-size: 13px; line-height: 1; letter-spacing: -.04em; }
.priority-stars .is-active { color: var(--navy-950); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.card-priority { flex: 0 0 auto; margin-left: auto; }
.card-priority + .attention-pill { margin-left: 0; }
.priority-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.priority-picker-stars { display: inline-flex; align-items: center; gap: 2px; }
.priority-picker-stars button { width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 7px; color: #b8c2ca; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; transition: color .15s, background .15s, transform .15s; }
.priority-picker-stars button:hover, .priority-picker-stars button:focus-visible { border-color: var(--line); color: var(--navy-800); background: var(--blue-100); outline: 0; transform: translateY(-1px); }
.priority-picker-stars button.is-active { color: var(--navy-950); }
.priority-clear { padding: 4px 7px; border: 0; border-radius: 999px; color: var(--muted); background: #edf2f5; font-size: 9px; font-weight: 750; cursor: pointer; }
.priority-clear[aria-current="true"] { color: var(--navy-900); background: var(--blue-100); }
.priority-field { display: grid; gap: 6px; }
.priority-field-label { color: var(--ink); font-size: 11px; font-weight: 750; }
.priority-field .field-help { width: 100%; }
:is(.avatar, .user-avatar, .profile-avatar) { position: relative; overflow: hidden; }
:is(.avatar, .user-avatar, .profile-avatar).has-image { color: transparent; }
:is(.avatar, .user-avatar, .profile-avatar) > img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.card-service { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.kanban-column.is-compact .card-service { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -webkit-line-clamp: 1; }
.kanban-column.is-compact .opportunity-card { grid-template-columns: auto minmax(48px, auto) minmax(0, 1fr) auto auto; }
.kanban-column.is-compact .card-priority { grid-row: 1; grid-column: 4; margin-left: 0; }
.kanban-column.is-compact .attention-pill { grid-column: 5; }

.selected-services { overflow: hidden; margin-top: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-input-bg, #fff); }
.selected-services[hidden] { display: none; }
.selected-services-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg, #f5f8fa); }
.selected-services-heading strong { color: var(--navy-950); font-size: 10px; }
.selected-services-heading span { padding: 3px 6px; border-radius: 999px; color: var(--navy-800); background: var(--blue-100); font-size: 8px; font-weight: 850; }
.selected-services-table-wrap, .workspace-service-table-wrap { overflow-x: auto; }
.selected-services table, .workspace-service-table-wrap table { width: 100%; border-collapse: collapse; }
.selected-services th, .workspace-service-table-wrap th { padding: 7px 9px; color: var(--muted); background: color-mix(in srgb, var(--theme-subtle-bg, #f5f8fa) 72%, transparent); font-size: 7px; font-weight: 850; text-align: left; text-transform: uppercase; }
.selected-services td, .workspace-service-table-wrap td { padding: 8px 9px; border-top: 1px solid var(--line); color: var(--ink); font-size: 9px; vertical-align: middle; }
.selected-services td:first-child, .workspace-service-table-wrap td:first-child { width: 34px; color: var(--muted); font-variant-numeric: tabular-nums; }
.selected-services td:nth-last-child(-n+2), .workspace-service-table-wrap td:nth-last-child(-n+2) { width: 1%; white-space: nowrap; }
.selected-services td strong, .selected-services td small, .workspace-service-table-wrap td strong, .workspace-service-table-wrap td small { display: block; }
.selected-services td strong, .workspace-service-table-wrap td strong { color: var(--ink); font-size: 9px; line-height: 1.35; }
.selected-services td small, .workspace-service-table-wrap td small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.service-order-actions { display: flex; gap: 3px; }
.service-order-actions button, .service-remove { min-width: 25px; min-height: 25px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--navy-800); background: var(--theme-input-bg, #fff); font-size: 8px; font-weight: 800; cursor: pointer; }
.service-order-actions button:disabled { opacity: .35; cursor: default; }
.service-remove { color: var(--red-500); }

.workspace-priority-control { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.workspace-priority-control > span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.workspace-priority-control .card-priority { margin-left: 0; }
.workspace-priority-control .priority-stars { font-size: 18px; }
.workspace-priority-control .priority-picker-stars button { width: 31px; height: 31px; font-size: 23px; }
.workspace-details-editor { margin-top: 14px; border-top: 3px solid var(--workspace-stage); }
.workspace-editor-note { max-width: 360px; color: var(--muted); font-size: 9px; line-height: 1.45; text-align: right; }
.workspace-details-editor form { display: grid; gap: 14px; margin-top: 16px; }
.workspace-details-editor fieldset { min-width: 0; margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg, #f9fbfc); }
.workspace-details-editor legend { padding: 0 7px; color: var(--navy-900); font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.workspace-editor-context { display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 5px 10px; margin-bottom: 13px; padding: 10px 12px; border-radius: 9px; background: var(--blue-100); }
.workspace-editor-context span { color: var(--muted); font-size: 8px; font-weight: 750; text-transform: uppercase; }
.workspace-editor-context strong { overflow: hidden; color: var(--ink); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.workspace-editor-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 13px; }
.workspace-editor-grid .span-two { grid-column: 1 / -1; }
.workspace-editor-grid label, .workspace-editor-comments { display: grid; min-width: 0; gap: 5px; color: #46576a; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.workspace-editor-grid label small { color: var(--muted); font-size: 8px; font-weight: 500; }
.workspace-editor-grid :is(input, select), .workspace-editor-comments textarea { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #ccd7df; border-radius: 8px; color: var(--ink); background: var(--theme-input-bg, #fff); font: inherit; font-size: 11px; font-weight: 500; letter-spacing: normal; }
.workspace-service-editor { display: grid; gap: 7px; }
.workspace-service-editor > label { color: #46576a; font-size: 9px; font-weight: 800; letter-spacing: .02em; }
.workspace-service-add { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.workspace-service-add select { width: 100%; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid #ccd7df; border-radius: 8px; color: var(--ink); background: var(--theme-input-bg, #fff); font-size: 11px; }
.workspace-service-add .button { min-height: 38px; }
.workspace-service-editor > small { color: var(--muted); font-size: 8px; font-weight: 500; line-height: 1.45; }
.workspace-service-table-wrap { border: 1px solid var(--line); border-radius: 9px; background: var(--theme-input-bg, #fff); }
.workspace-services .workspace-service-table-wrap { margin-top: 12px; }
.workspace-services .workspace-service-table-wrap th { background: transparent; }
.workspace-services .workspace-service-count { display: grid; width: 26px; height: 26px; place-items: center; border-radius: 8px; color: var(--navy-900); background: var(--blue-100); font-size: 10px; font-weight: 900; }
.workspace-services .workspace-service-table-wrap td { padding-inline: 5px; }
.workspace-editor-comments textarea { min-height: 98px; resize: vertical; }
.workspace-editor-grid input[readonly] { color: var(--muted); background: #edf2f5; }
.workspace-loss-editor { margin-top: 14px; padding: 13px; border: 1px solid #efc3c8; border-radius: 10px; background: #fff7f8; }
.workspace-loss-editor[hidden] { display: none; }
.workspace-loss-editor .workspace-form-heading { margin-bottom: 11px; }
.workspace-editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.workspace-editor-actions .form-status { margin-right: auto; color: var(--red-500); font-size: 9px; }
@media (min-width: 781px) { html.opportunity-workspace-active .content { padding: 16px 18px 36px; } }

.client-copy-menu { position: relative; flex: 0 0 auto; }
.client-copy-menu > summary { display: inline-flex; align-items: center; gap: 5px; list-style: none; user-select: none; }
.client-copy-menu > summary::-webkit-details-marker { display: none; }
.client-copy-chevron { font-size: 11px; line-height: 1; transition: transform .16s ease; }
.client-copy-menu[open] > summary { border-color: var(--blue-500); background: var(--blue-100); }
.client-copy-menu[open] .client-copy-chevron { transform: rotate(180deg); }
.client-copy-popover { position: absolute; z-index: 45; top: calc(100% + 6px); right: 0; width: 226px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-input-bg, #fff); box-shadow: 0 16px 38px rgba(15, 41, 71, .18); }
.client-copy-option { display: grid; width: 100%; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 9px; padding: 8px; border: 0; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.client-copy-option:hover:not(:disabled), .client-copy-option:focus-visible { background: var(--blue-100); }
.client-copy-option:disabled { opacity: .48; cursor: not-allowed; }
.client-copy-option-icon { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: var(--navy-800); background: var(--blue-100); font-size: 13px; font-weight: 900; }
.client-copy-option-icon.email { color: var(--green-600); background: var(--green-100); }
.client-copy-option > span:last-child { display: grid; min-width: 0; gap: 2px; }
.client-copy-option strong { color: var(--ink); font-size: 10px; }
.client-copy-option small { color: var(--muted); font-size: 8px; }
.workspace-client-copy-menu { align-self: flex-start; }
.workspace-client-copy-menu > summary { min-height: 32px; padding: 6px 9px; font-size: 9px; }
.workspace-event-marker.priority { color: #6a4800; background: #fff4cf; }
.workspace-event-marker.owner { color: #075985; background: #e0f2fe; }
.workspace-event-marker.service { color: #6d28d9; background: #f3e8ff; }

@media (max-width: 620px) {
  .workspace-client-copy-menu .client-copy-popover { right: auto; left: 0; }
  .workspace-editor-grid, .workspace-editor-context { grid-template-columns: 1fr; }
  .workspace-editor-grid .span-two { grid-column: auto; }
  .workspace-service-add { grid-template-columns: 1fr; }
  .workspace-service-add .button { width: 100%; }
  .workspace-editor-note { max-width: none; text-align: left; }
  .workspace-editor-actions { align-items: stretch; flex-direction: column; }
  .workspace-editor-actions .form-status { margin-right: 0; }
  .workspace-editor-actions .button { width: 100%; }
}

/* Calendario comercial dentro del Pipeline. */
.pipeline-view-tabs { display: inline-flex; gap: 4px; margin: 0 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--theme-input-bg); box-shadow: 0 5px 14px rgba(25, 55, 80, .05); }
.pipeline-view-tab { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 7px 13px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 850; cursor: pointer; }
.pipeline-view-tab > span { font-size: 15px; line-height: 1; }
.pipeline-view-tab:hover { color: var(--navy-900); background: var(--blue-100); }
.pipeline-view-tab[aria-selected="true"] { color: var(--on-primary); background: var(--navy-900); box-shadow: 0 5px 12px rgba(23, 58, 99, .18); }
.crm-calendar { display: grid; gap: 14px; }
.calendar-toolbar { display: grid; grid-template-columns: auto minmax(230px, 1fr) auto; align-items: center; gap: 18px; padding: 17px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--theme-input-bg); box-shadow: 0 8px 22px rgba(25, 55, 80, .06); }
.calendar-navigation { display: inline-flex; align-items: center; gap: 4px; }
.calendar-navigation button { display: grid; min-width: 36px; height: 36px; place-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--navy-900); background: var(--theme-subtle-bg); font-size: 14px; font-weight: 850; cursor: pointer; }
.calendar-navigation button:hover { border-color: var(--secondary); color: var(--secondary); background: var(--blue-100); }
.calendar-navigation .calendar-today-button { min-width: 58px; font-size: 10px; }
.calendar-month-heading { min-width: 0; text-align: center; }
.calendar-month-heading p, .calendar-agenda header p { margin: 0 0 3px; color: var(--navy-700); font-size: 8px; font-weight: 900; letter-spacing: .13em; }
.calendar-month-heading h2 { margin: 0; color: var(--navy-950); font-size: 21px; letter-spacing: -.025em; }
.calendar-month-heading > span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.calendar-month-summary { display: flex; align-items: stretch; gap: 6px; }
.calendar-month-summary > span { display: grid; min-width: 78px; place-items: center; padding: 7px 9px; border-radius: 10px; color: var(--muted); background: var(--theme-subtle-bg); font-size: 8px; text-align: center; }
.calendar-month-summary strong { display: block; color: var(--navy-950); font-size: 14px; }
.calendar-filter-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 0 2px; }
.calendar-filter-heading div { display: grid; gap: 2px; }
.calendar-filter-heading strong { color: var(--navy-950); font-size: 12px; }
.calendar-filter-heading small, .calendar-filter-heading > span { color: var(--muted); font-size: 9px; }
.calendar-filter-heading > span { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; background: var(--theme-subtle-bg); }
.calendar-type-filters { display: flex; overflow-x: auto; gap: 7px; padding: 1px 1px 5px; scrollbar-color: #8299aa transparent; overscroll-behavior-inline: contain; }
.calendar-type-filter { display: grid; min-width: 146px; min-height: 50px; flex: 1 0 146px; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--theme-input-bg); text-align: left; cursor: pointer; transition: opacity .16s ease, border-color .16s ease, box-shadow .16s ease; }
.calendar-type-filter:hover { border-color: var(--calendar-border); }
.calendar-type-filter[aria-pressed="true"] { border-color: var(--calendar-border); box-shadow: inset 0 0 0 1px var(--calendar-border); }
.calendar-type-filter[aria-pressed="false"] { opacity: .52; filter: saturate(.55); }
.calendar-type-filter span { display: grid; min-width: 0; gap: 1px; }
.calendar-type-filter strong, .calendar-type-filter small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-type-filter strong { color: var(--ink); font-size: 9px; }
.calendar-type-filter small { color: var(--muted); font-size: 8px; }
.calendar-type-swatch { display: inline-grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 1px solid var(--calendar-border); border-radius: 8px; color: var(--calendar-color); background-color: var(--calendar-bg); font-size: 10px; font-style: normal; font-weight: 900; }
.calendar-type-activity { --calendar-color: #075985; --calendar-bg: #e0f2fe; --calendar-border: #7dd3fc; }
.calendar-type-expected-close { --calendar-color: #6d28d9; --calendar-bg: #f3e8ff; --calendar-border: #c4b5fd; }
.calendar-type-actual-close { --calendar-color: #047857; --calendar-bg: #d1fae5; --calendar-border: #6ee7b7; }
.calendar-type-last-contact { --calendar-color: #b45309; --calendar-bg: #ffedd5; --calendar-border: #fdba74; }
.calendar-type-created { --calendar-color: #475569; --calendar-bg: #f1f5f9; --calendar-border: #cbd5e1; }
html[data-colorblind-patterns="true"] :is(.calendar-event.calendar-type-activity, .calendar-type-activity .calendar-type-swatch) { background-image: repeating-linear-gradient(135deg, rgba(7, 89, 133, .16) 0 2px, transparent 2px 8px); }
html[data-colorblind-patterns="true"] :is(.calendar-event.calendar-type-expected-close, .calendar-type-expected-close .calendar-type-swatch) { background-image: radial-gradient(circle, rgba(109, 40, 217, .25) 1.2px, transparent 1.5px); background-size: 8px 8px; }
html[data-colorblind-patterns="true"] :is(.calendar-event.calendar-type-actual-close, .calendar-type-actual-close .calendar-type-swatch) { background-image: repeating-linear-gradient(0deg, rgba(4, 120, 87, .12) 0 1px, transparent 1px 7px), repeating-linear-gradient(90deg, rgba(4, 120, 87, .12) 0 1px, transparent 1px 7px); }
html[data-colorblind-patterns="true"] :is(.calendar-event.calendar-type-last-contact, .calendar-type-last-contact .calendar-type-swatch) { background-image: repeating-linear-gradient(90deg, rgba(180, 83, 9, .16) 0 2px, transparent 2px 9px); }
html[data-colorblind-patterns="true"] :is(.calendar-event.calendar-type-created, .calendar-type-created .calendar-type-swatch) { background-image: repeating-linear-gradient(0deg, rgba(71, 85, 105, .14) 0 2px, transparent 2px 8px); }
.calendar-layout { display: grid; min-width: 0; grid-template-columns: minmax(700px, 1fr) 286px; align-items: start; gap: 14px; }
.calendar-grid-card, .calendar-agenda { min-width: 0; border: 1px solid var(--line); border-radius: 15px; background: var(--theme-input-bg); box-shadow: 0 8px 22px rgba(25, 55, 80, .06); }
.calendar-grid-card { overflow: hidden; }
.calendar-grid-scroll { overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-color: #8299aa transparent; }
.calendar-grid-frame { min-width: 720px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.calendar-weekdays span { padding: 9px 8px; color: var(--muted); font-size: 8px; font-weight: 900; letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.calendar-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.calendar-day { position: relative; display: grid; min-width: 0; min-height: 126px; align-content: start; gap: 5px; padding: 7px; background: var(--theme-input-bg); }
.calendar-day.is-outside { background: var(--theme-quiet-bg); }
.calendar-day.is-outside .calendar-day-select { opacity: .5; }
.calendar-day.is-selected { z-index: 1; box-shadow: inset 0 0 0 2px var(--secondary); }
.calendar-day.is-today .calendar-day-select > span { color: var(--on-secondary); background: var(--secondary); }
.calendar-day-select { display: flex; width: 100%; min-height: 25px; align-items: center; justify-content: space-between; gap: 5px; padding: 0; border: 0; color: var(--ink); background: transparent; cursor: pointer; }
.calendar-day-select > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 8px; font-size: 10px; font-weight: 900; }
.calendar-day-select small { overflow: hidden; color: var(--muted); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.calendar-day-events { display: grid; min-width: 0; gap: 4px; }
.calendar-event { display: grid; width: 100%; min-width: 0; grid-template-columns: 17px minmax(0, 1fr); align-items: center; gap: 5px; padding: 5px 6px 5px 5px; border: 1px solid var(--calendar-border); border-left: 3px solid var(--calendar-color); border-radius: 7px; color: var(--ink); background-color: var(--calendar-bg); text-align: left; cursor: pointer; }
.calendar-event:hover { border-color: var(--calendar-color); box-shadow: 0 3px 9px color-mix(in srgb, var(--calendar-color) 16%, transparent); transform: translateY(-1px); }
.calendar-event.is-selected { outline: 2px solid var(--blue-500); outline-offset: 1px; box-shadow: 0 3px 10px color-mix(in srgb, var(--blue-500) 24%, transparent); }
.calendar-event-mark { display: grid; width: 17px; height: 17px; place-items: center; border-radius: 5px; color: var(--calendar-color); background: color-mix(in srgb, var(--calendar-bg) 66%, #fff); font-size: 8px; font-weight: 950; }
.calendar-event-copy { display: grid; min-width: 0; gap: 1px; }
.calendar-event-copy strong, .calendar-event-copy small, .calendar-event-copy em { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event-copy strong { color: var(--ink); font-size: 8px; }
.calendar-event-copy small { color: color-mix(in srgb, var(--calendar-color) 76%, var(--ink)); font-size: 7px; }
.calendar-event-copy em { color: var(--muted); font-size: 7px; font-style: normal; }
.calendar-more { width: 100%; padding: 3px 5px; border: 0; border-radius: 6px; color: var(--navy-700); background: var(--theme-subtle-bg); font-size: 7px; font-weight: 850; text-align: left; cursor: pointer; }
.calendar-more:hover { color: var(--secondary); background: var(--blue-100); }
.calendar-agenda { position: sticky; top: calc(var(--topbar-height) + 12px); overflow: hidden; }
.calendar-agenda > header { padding: 15px 15px 12px; border-bottom: 1px solid var(--line); background: var(--theme-subtle-bg); }
.calendar-agenda header h3 { margin: 0; color: var(--navy-950); font-size: 14px; line-height: 1.3; }
.calendar-agenda header > span { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; }
.calendar-agenda-list { display: grid; max-height: calc(100vh - var(--topbar-height) - 145px); overflow-y: auto; gap: 7px; padding: 10px; scrollbar-color: #8299aa transparent; }
.calendar-agenda-event { min-height: 64px; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 8px; padding: 9px; border-left-width: 4px; }
.calendar-agenda-event .calendar-event-mark { width: 24px; height: 24px; font-size: 10px; }
.calendar-agenda-event .calendar-event-copy { gap: 2px; }
.calendar-agenda-event .calendar-event-copy strong { font-size: 10px; }
.calendar-agenda-event .calendar-event-copy small { font-size: 8px; }
.calendar-event-value { color: var(--calendar-color); font-size: 8px; font-weight: 900; white-space: nowrap; }
.calendar-agenda-empty { display: grid; min-height: 210px; place-items: center; align-content: center; gap: 4px; padding: 24px; color: var(--muted); text-align: center; }
.calendar-agenda-empty > span { display: grid; width: 42px; height: 42px; place-items: center; margin-bottom: 4px; border: 1px dashed var(--line); border-radius: 13px; background: var(--theme-subtle-bg); font-size: 19px; }
.calendar-agenda-empty strong { color: var(--ink); font-size: 10px; }
.calendar-agenda-empty small { font-size: 8px; line-height: 1.5; }
.calendar-type-legend { display: flex; align-items: center; gap: 8px 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg); flex-wrap: wrap; }
.calendar-type-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.calendar-type-legend .calendar-type-swatch { width: 23px; height: 18px; border-radius: 5px; font-size: 7px; }
.calendar-type-legend strong { color: var(--ink); font-size: 9px; }
.accessibility-pattern-preview .calendar-type-legend { margin-top: 9px; }
@media (max-width: 1280px) {
  .calendar-layout { grid-template-columns: minmax(0, 1fr); }
  .calendar-agenda { position: static; }
  .calendar-agenda-list { max-height: none; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calendar-agenda-empty { grid-column: 1 / -1; min-height: 150px; }
}
@media (max-width: 780px) {
  .pipeline-view-tabs { display: flex; width: 100%; }
  .pipeline-view-tab { flex: 1; justify-content: center; }
  .calendar-toolbar { grid-template-columns: 1fr; gap: 12px; padding: 14px; }
  .calendar-navigation { justify-self: center; order: 2; }
  .calendar-month-heading { order: 1; }
  .calendar-month-summary { justify-content: center; order: 3; }
  .calendar-filter-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .calendar-type-filters { margin-inline: -15px; padding-inline: 15px; }
  .calendar-grid-card { margin-inline: -15px; border-right: 0; border-left: 0; border-radius: 0; }
  .calendar-grid-frame { min-width: 700px; }
  .calendar-day { min-height: 118px; }
  .calendar-agenda-list { grid-template-columns: 1fr; }
  .workspace-layout { grid-template-columns: 1fr; }
  .kanban-column.is-compact .opportunity-card { grid-template-columns: auto minmax(42px, 72px) minmax(0, 1fr) auto auto; }
}
@media (max-width: 480px) {
  .calendar-filter-heading > span { white-space: normal; }
  .calendar-month-summary { width: 100%; }
  .calendar-month-summary > span { flex: 1; }
  .calendar-type-filter { min-width: 152px; flex-basis: 152px; }
  .calendar-agenda-event { grid-template-columns: 24px minmax(0, 1fr); }
  .calendar-event-value { display: none; }
  .calendar-type-legend { align-items: stretch; flex-direction: column; }
}
@media (prefers-contrast: more) { .pipeline-view-tabs, .crm-calendar :is(.calendar-toolbar, .calendar-grid-card, .calendar-agenda, .calendar-type-filter, .calendar-event) { border-width: 2px; } }
@media (forced-colors: active) {
  .pipeline-view-tab[aria-selected="true"], .calendar-type-filter[aria-pressed="true"], .calendar-day.is-selected { outline: 2px solid Highlight; }
  .calendar-event.is-selected { outline-color: Highlight; }
  .calendar-event, .calendar-type-swatch { border-color: CanvasText; }
  .calendar-event-mark { color: ButtonText; background: ButtonFace; }
}

/* Centro de informes programados y archivo de ejecuciones. */
.reports-center { display: grid; min-width: 0; gap: 22px; }
.reports-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 390px);
  align-items: center;
  gap: 24px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  background:
    radial-gradient(circle at 8% 15%, color-mix(in srgb, var(--accent) 14%, transparent) 0 70px, transparent 71px),
    linear-gradient(120deg, color-mix(in srgb, var(--primary) 9%, var(--theme-input-bg)) 0%, var(--theme-input-bg) 62%);
  box-shadow: 0 10px 28px color-mix(in srgb, var(--ink) 7%, transparent);
}
.reports-hero h2 { margin: 3px 0 7px; color: var(--ink); font-size: clamp(22px, 2.3vw, 31px); line-height: 1.12; letter-spacing: -.035em; }
.reports-hero > div > p:last-child { max-width: 670px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
.reports-delivery-note {
  display: grid;
  min-width: 0;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1px solid color-mix(in srgb, var(--secondary) 26%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--blue-100) 48%, var(--theme-input-bg));
}
.reports-delivery-note > span { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--on-secondary); background: var(--secondary); font-size: 18px; font-weight: 900; }
.reports-delivery-note div { display: grid; min-width: 0; gap: 3px; }
.reports-delivery-note strong { color: var(--ink); font-size: 12px; }
.reports-delivery-note p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.reports-delivery-note small { color: var(--navy-700); font-size: 8px; font-weight: 800; overflow-wrap: anywhere; }
.reports-schedules,
.reports-history { display: grid; min-width: 0; gap: 13px; }
.reports-section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-inline: 2px; }
.reports-section-heading h2 { margin: 2px 0 0; color: var(--ink); font-size: 18px; }
.reports-section-heading > span { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; color: var(--muted); background: var(--theme-subtle-bg); font-size: 9px; font-weight: 800; }
.report-schedule-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 13px; }
.report-schedule-card {
  --report-card-color: var(--blue-500);
  --report-card-tint: var(--blue-100);
  display: grid;
  min-width: 0;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--report-card-color);
  border-radius: 14px;
  background: var(--theme-input-bg);
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ink) 6%, transparent);
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.report-schedule-card:nth-child(2) { --report-card-color: var(--purple-500); --report-card-tint: var(--purple-100); }
.report-schedule-card:nth-child(3) { --report-card-color: var(--green-600); --report-card-tint: var(--green-100); }
.report-schedule-card:hover { border-color: color-mix(in srgb, var(--report-card-color) 50%, var(--line)); transform: translateY(-1px); }
.report-schedule-card[aria-busy="true"] { cursor: progress; }
.report-schedule-card.is-paused { border-top-color: var(--muted); }
.report-schedule-card.is-unavailable { grid-template-rows: auto 1fr auto; border-top-color: var(--muted); opacity: .75; }
.report-schedule-card > header,
.report-schedule-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-schedule-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--report-card-color); background: var(--report-card-tint); font-size: 17px; font-weight: 900; }
.report-status-chip { padding: 5px 8px; border-radius: 999px; font-size: 8px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.report-status-chip.active { color: var(--green-600); background: var(--green-100); }
.report-status-chip.paused { color: var(--muted); background: var(--theme-subtle-bg); }
.report-schedule-copy h3,
.report-schedule-card > div h3 { margin: 3px 0 6px; color: var(--ink); font-size: 16px; }
.report-schedule-copy > p:last-child,
.report-schedule-card > div > p:last-child { min-height: 47px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.report-schedule-dates { display: grid; align-content: start; gap: 8px; margin: 0; }
.report-schedule-dates > div { display: grid; grid-template-columns: minmax(105px, .7fr) minmax(0, 1.3fr); align-items: center; gap: 10px; padding: 8px 9px; border-radius: 9px; background: var(--theme-subtle-bg); }
.report-schedule-dates dt { color: var(--muted); font-size: 8px; font-weight: 750; }
.report-schedule-dates dd { margin: 0; color: var(--ink); font-size: 9px; font-weight: 850; text-align: right; }
.report-delivery-compact { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; padding-top: 1px; color: var(--muted); font-size: 8px; flex-wrap: wrap; }
.report-delivery-compact strong { color: var(--ink); }
.report-schedule-card > footer { padding-top: 12px; border-top: 1px solid var(--line); }
.report-schedule-card > footer .button { min-height: 36px; padding: 7px 11px; font-size: 9px; }
.report-schedule-switch { display: inline-flex; min-height: 36px; align-items: center; gap: 7px; padding: 5px 7px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font: inherit; cursor: pointer; }
.report-schedule-switch > span { position: relative; width: 30px; height: 17px; border-radius: 999px; background: var(--theme-strong-line); transition: background .16s ease; }
.report-schedule-switch > span::after { position: absolute; top: 3px; left: 3px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(15, 41, 71, .24); content: ""; transition: transform .16s ease; }
.report-schedule-switch[aria-checked="true"] > span { background: var(--green-600); }
.report-schedule-switch[aria-checked="true"] > span::after { transform: translateX(13px); }
.report-schedule-switch b { font-size: 9px; }
.report-schedule-switch:hover:not(:disabled) { color: var(--ink); background: var(--theme-subtle-bg); }
.report-schedule-switch:disabled { cursor: wait; opacity: .65; }
.report-schedule-switch:focus-visible,
.report-run-now:focus-visible,
.report-run-card > summary:focus-visible { outline: 3px solid color-mix(in srgb, var(--secondary) 25%, transparent); outline-offset: 2px; }
.report-schedule-missing { align-self: end; margin: 0; padding: 10px; border-radius: 9px; color: var(--muted); background: var(--theme-subtle-bg); font-size: 9px; }
.report-run-list { display: grid; gap: 9px; }
.report-run-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: var(--theme-input-bg); box-shadow: 0 5px 16px color-mix(in srgb, var(--ink) 5%, transparent); }
.report-run-card > summary { display: grid; min-width: 0; grid-template-columns: 38px minmax(0, 1fr) minmax(150px, auto) 18px; align-items: center; gap: 11px; padding: 13px 15px; list-style: none; cursor: pointer; }
.report-run-card > summary::-webkit-details-marker { display: none; }
.report-run-card > summary:hover { background: color-mix(in srgb, var(--blue-100) 28%, transparent); }
.report-run-icon { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 10px; color: var(--navy-800); background: var(--blue-100); font-size: 15px; font-weight: 900; }
.report-run-title,
.report-run-time { display: grid; min-width: 0; gap: 2px; }
.report-run-title small { color: var(--navy-700); font-size: 7px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.report-run-title strong { overflow: hidden; color: var(--ink); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.report-run-title em { color: var(--muted); font-size: 8px; font-style: normal; }
.report-run-time { justify-items: end; text-align: right; }
.report-run-time small { color: var(--muted); font-size: 7px; text-transform: uppercase; }
.report-run-time strong { color: var(--ink); font-size: 9px; }
.report-run-chevron { color: var(--muted); font-size: 14px; transition: transform .16s ease; }
.report-run-card[open] .report-run-chevron { transform: rotate(180deg); }
.report-run-body { display: grid; gap: 13px; padding: 15px; border-top: 1px solid var(--line); background: var(--theme-quiet-bg); }
.report-run-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.report-run-metric { display: grid; min-width: 0; gap: 4px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--theme-input-bg); }
.report-run-metric span { overflow: hidden; color: var(--muted); font-size: 8px; font-weight: 750; text-overflow: ellipsis; white-space: nowrap; }
.report-run-metric strong { overflow: hidden; color: var(--ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.report-payload-section { display: grid; min-width: 0; gap: 7px; }
.report-payload-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.report-payload-heading h4 { margin: 0; color: var(--ink); font-size: 10px; }
.report-payload-heading > span { display: grid; min-width: 24px; height: 22px; place-items: center; padding-inline: 5px; border-radius: 7px; color: var(--navy-800); background: var(--blue-100); font-size: 8px; font-weight: 900; }
.report-payload-list { display: grid; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: var(--theme-input-bg); }
.report-payload-row { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 11px; border-top: 1px solid var(--line); }
.report-payload-row:first-child { border-top: 0; }
.report-payload-row > div { display: grid; min-width: 0; gap: 2px; }
.report-payload-row strong { overflow: hidden; color: var(--ink); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.report-payload-row small { overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.report-payload-row > b { flex: 0 0 auto; color: var(--navy-800); font-size: 9px; }
.report-payload-empty { margin: 0; padding: 13px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); background: var(--theme-input-bg); font-size: 9px; text-align: center; }
.reports-empty-history { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 5px; padding: 28px; border: 1px dashed var(--theme-strong-line); border-radius: 14px; color: var(--muted); background: var(--theme-input-bg); text-align: center; }
.reports-empty-history > span { display: grid; width: 46px; height: 46px; place-items: center; margin-bottom: 3px; border-radius: 13px; color: var(--navy-800); background: var(--blue-100); font-size: 20px; }
.reports-empty-history h3 { margin: 0; color: var(--ink); font-size: 13px; }
.reports-empty-history p { max-width: 500px; margin: 0; font-size: 9px; line-height: 1.55; }
.reports-load-error .button { margin-top: 8px; }

@media (max-width: 1120px) {
  .report-schedule-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-schedule-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .reports-hero { grid-template-columns: 1fr; padding: 19px; }
  .report-run-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .reports-center { gap: 18px; }
  .report-schedule-grid { grid-template-columns: 1fr; }
  .report-schedule-card:last-child { grid-column: auto; }
  .reports-section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .report-run-card > summary { grid-template-columns: 36px minmax(0, 1fr) 16px; }
  .report-run-time { grid-column: 2; justify-items: start; text-align: left; }
  .report-run-chevron { grid-column: 3; grid-row: 1 / span 2; }
}
@media (max-width: 440px) {
  .reports-hero { padding: 16px; }
  .reports-delivery-note { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; }
  .reports-delivery-note > span { width: 34px; height: 34px; border-radius: 10px; }
  .report-schedule-card { padding: 14px; }
  .report-schedule-card > footer { align-items: stretch; flex-direction: column; }
  .report-schedule-card > footer .button,
  .report-schedule-switch { width: 100%; justify-content: center; }
  .report-run-metrics { grid-template-columns: 1fr; }
  .report-payload-row { align-items: flex-start; flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .report-schedule-card,
  .report-schedule-switch > span,
  .report-schedule-switch > span::after,
  .report-run-chevron { transition: none; }
}
@media (forced-colors: active) {
  .report-schedule-switch[aria-checked="true"] > span,
  .report-status-chip,
  .report-run-icon,
  .report-schedule-icon { border: 1px solid CanvasText; }
  .report-schedule-switch:focus-visible,
  .report-run-card > summary:focus-visible { outline: 2px solid Highlight; }
}

/* Panel por pestaña para consultar cotizaciones sin salir del contexto comercial. */
:root { --quote-split-width: min(520px, 42vw); }
.quote-split-panel { position: fixed; z-index: 18; top: var(--topbar-height); right: 0; bottom: 0; display: grid; width: var(--quote-split-width); grid-template-rows: auto minmax(0, 1fr); border-left: 1px solid var(--line); color: var(--ink); background: var(--surface); box-shadow: -18px 0 40px rgba(18,42,61,.13); }
.quote-split-panel[hidden] { display: none; }
html.quote-split-active .content { margin-right: var(--quote-split-width); }
html.quote-split-active .opportunity-workspace #workspace-quote :is(.quote-rendered-view, .quote-visibility-toggle) { display: none; }
.quote-split-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--theme-quiet-bg, #fbfcfd); }
.quote-split-header h2 { margin: 2px 0 0; color: var(--ink); font-size: 18px; }
.quote-split-header p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.quote-split-content { min-height: 0; overflow: auto; overscroll-behavior: contain; }
.quote-split-content > .loading-state { min-height: 280px; }
.quote-split-empty { display: grid; min-height: 240px; place-items: center; align-content: center; gap: 7px; padding: 28px; color: var(--muted); text-align: center; }
.quote-split-empty > span { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--blue-500); background: var(--blue-100); font-size: 24px; }
.quote-split-empty strong { color: var(--ink); font-size: 13px; }
.quote-split-empty p { max-width: 320px; margin: 0; font-size: 10px; line-height: 1.5; }
.quote-split-empty.is-error > span { color: #a82e3d; background: var(--red-100); }
.quote-split-current { display: grid; gap: 12px; padding: 16px; }
.quote-split-meta { display: flex; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 9px; }
.quote-split-meta span { padding: 5px 8px; border-radius: 999px; background: var(--theme-soft-bg, #f4f7f9); }
.quote-split-actions { display: flex; justify-content: flex-end; }
.quote-split-document { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; }
.quote-split-document .quotation-preview-shell { margin: 0; padding: 14px; }
.quote-split-document-error { padding: 24px; color: var(--muted); background: var(--theme-subtle-bg); text-align: center; }
.quote-split-document-error strong { display: block; margin-bottom: 5px; color: var(--ink); font-size: 12px; }
.quote-split-document-error p { margin: 0; font-size: 10px; }
.quote-split-history { margin: 0 16px 18px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg); }
.quote-split-history > summary { display: flex; align-items: center; justify-content: space-between; color: var(--ink); cursor: pointer; font-size: 10px; font-weight: 850; }
.quote-split-history > summary span { display: grid; min-width: 22px; height: 22px; place-items: center; border-radius: 999px; background: var(--theme-input-bg); font-size: 9px; }
.quote-split-history-list { display: grid; gap: 7px; margin-top: 10px; }
.quote-split-history-list article { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--theme-input-bg); }
.quote-split-history-list article > div { display: grid; min-width: 0; gap: 2px; }
.quote-split-history-list strong, .quote-split-history-list span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-split-history-list strong { color: var(--ink); font-size: 9px; }
.quote-split-history-list span, .quote-split-history-empty { color: var(--muted); font-size: 8px; }
.quote-split-history-list .button { min-height: 30px; padding: 6px 8px; font-size: 8px; }

/* Flujo aislado de análisis y revisión de importaciones históricas. */
.staging-workflow-dialog { position: fixed; inset: 0; width: min(920px, calc(100vw - 30px)); max-width: none; max-height: min(850px, calc(100vh - 30px)); margin: auto; padding: 0; overflow: visible; border: 0; color: var(--ink); background: transparent; }
.staging-review-dialog { width: min(1240px, calc(100vw - 30px)); }
.staging-workflow-dialog::backdrop { background: rgba(8,25,42,.62); backdrop-filter: blur(4px); }
.staging-workflow-card { display: grid; max-height: min(850px, calc(100vh - 30px)); grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 28px 80px rgba(6,25,43,.3); }
.staging-workflow-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 21px 24px 17px; border-bottom: 1px solid var(--line); background: var(--theme-quiet-bg); }
.staging-workflow-header h2 { margin: 0; color: var(--ink); font-size: 21px; }
.staging-workflow-header p:last-child { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.staging-import-body { min-height: 0; padding: 20px 24px; overflow: auto; }
.staging-upload-step { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.staging-file-field { display: grid; align-content: start; gap: 7px; padding: 16px; border: 1px dashed var(--theme-strong-line); border-radius: 12px; color: var(--ink); background: var(--theme-subtle-bg); font-size: 11px; font-weight: 850; }
.staging-file-field input { width: 100%; min-width: 0; padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--theme-input-bg); font-size: 10px; font-weight: 600; }
.staging-file-field small { color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.45; }
.staging-folder-field { border-color: color-mix(in srgb, var(--blue-500) 45%, var(--theme-strong-line)); background: color-mix(in srgb, var(--blue-100) 55%, var(--theme-subtle-bg)); }
.staging-folder-field > strong { font-size: 11px; }
.staging-folder-field > .button { justify-self: start; }
.staging-folder-selection, .staging-folder-queue { grid-column: 1 / -1; }
.staging-folder-selection { display: grid; align-content: center; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--theme-input-bg); }
.staging-folder-selection strong { color: var(--ink); font-size: 11px; }
.staging-folder-selection span { font-size: 9px; line-height: 1.45; }
.staging-folder-selection small { color: var(--muted); font-size: 8px; }
.staging-folder-selection.has-files { border-color: color-mix(in srgb, var(--blue-500) 50%, var(--line)); box-shadow: inset 3px 0 0 var(--blue-500); }
.staging-folder-selection.has-warnings { border-color: #e5b64d; box-shadow: inset 3px 0 0 #d68a00; }
.staging-folder-queue { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--theme-subtle-bg); }
.staging-folder-queue[hidden] { display: none; }
.staging-folder-queue > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.staging-folder-queue > header strong { color: var(--ink); font-size: 10px; }
.staging-folder-queue > header .button { min-height: 28px; padding: 5px 8px; font-size: 8px; }
.staging-folder-list { display: grid; max-height: 190px; overflow: auto; }
.staging-folder-list article { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.staging-folder-list article:last-child { border-bottom: 0; }
.staging-folder-list article > div { display: grid; min-width: 0; gap: 2px; }
.staging-folder-list article strong, .staging-folder-list article span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staging-folder-list article strong { color: var(--ink); font-size: 9px; }
.staging-folder-list article span { color: var(--muted); font-size: 8px; }
.staging-folder-list article .button { min-height: 28px; flex: 0 0 auto; padding: 5px 8px; font-size: 8px; }
.staging-import-status { min-height: 21px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.staging-import-result { border: 1px solid var(--line); border-radius: 12px; background: var(--theme-subtle-bg); }
.staging-import-result[hidden] { display: none; }
.staging-import-result > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.staging-import-result > header span { color: var(--muted); font-size: 8px; }
.staging-import-result > header h3 { margin: 2px 0 0; color: var(--ink); font-size: 13px; }
.staging-import-result > header b { padding: 6px 9px; border-radius: 999px; color: #765000; background: #fff0bd; font-size: 8px; }
.staging-summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.staging-summary-grid > div { display: grid; gap: 3px; padding: 15px; border-right: 1px solid var(--line); }
.staging-summary-grid > div:last-child { border-right: 0; }
.staging-summary-grid strong { color: var(--ink); font-size: 20px; }
.staging-summary-grid span { color: var(--muted); font-size: 8px; }
.staging-summary-grid .has-errors strong { color: #a82e3d; }
.staging-file-errors { margin: 0 14px 14px; padding: 10px 12px; border: 1px solid #efc4c9; border-radius: 9px; background: var(--red-100); }
.staging-file-errors summary { color: #8f2936; cursor: pointer; font-size: 9px; font-weight: 850; }
.staging-file-errors ul { display: grid; gap: 5px; margin: 9px 0 0; padding: 0; list-style: none; }
.staging-file-errors li { display: flex; justify-content: space-between; gap: 12px; font-size: 8px; }
.staging-apply-summary { display: flex; justify-content: space-between; gap: 12px; margin: 0 14px 14px; padding: 10px 12px; border-radius: 9px; color: #176044; background: var(--green-100); font-size: 9px; }
.staging-workflow-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--line); background: var(--theme-quiet-bg); }
.staging-review-status { margin-right: auto; color: var(--muted); font-size: 9px; }
.staging-review-layout { display: grid; min-height: 0; grid-template-columns: 260px minmax(0, 1fr); }
.staging-batch-list { min-height: 0; padding: 12px; overflow: auto; border-right: 1px solid var(--line); background: var(--theme-subtle-bg); }
.staging-batch-list > button { display: grid; width: 100%; gap: 3px; margin-bottom: 7px; padding: 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--theme-input-bg); cursor: pointer; text-align: left; }
.staging-batch-list > button.is-active { border-color: var(--blue-500); box-shadow: inset 3px 0 0 var(--blue-500); }
.staging-batch-list span, .staging-batch-list small { color: var(--muted); font-size: 8px; }
.staging-batch-list strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.staging-review-detail { min-height: 0; padding: 16px; overflow: auto; }
.staging-review-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.staging-review-heading span { color: var(--muted); font-size: 8px; }
.staging-review-heading h3 { margin: 3px 0 0; color: var(--ink); font-size: 16px; }
.staging-review-heading b { padding: 6px 9px; border-radius: 999px; color: var(--blue-500); background: var(--blue-100); font-size: 9px; }
.staging-review-rows { display: grid; gap: 10px; }
.staging-review-row { padding: 13px; border: 1px solid var(--line); border-radius: 11px; background: var(--theme-subtle-bg); }
.staging-review-row > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.staging-review-row > header div { display: grid; gap: 2px; }
.staging-review-row > header span, .staging-review-row > header small { color: var(--muted); font-size: 8px; }
.staging-review-row h4 { margin: 0; color: var(--ink); font-size: 12px; }
.staging-review-row > header b { padding: 5px 8px; border-radius: 999px; color: var(--muted); background: var(--theme-input-bg); font-size: 8px; }
.staging-issues { display: grid; gap: 5px; margin: 10px 0; padding: 0; list-style: none; }
.staging-issues li { display: grid; grid-template-columns: minmax(90px, .35fr) 1fr; gap: 9px; padding: 7px 9px; border-radius: 7px; font-size: 8px; }
.staging-issues .issue-error { color: #8f2936; background: var(--red-100); }
.staging-issues .issue-warning { color: #765000; background: var(--amber-100); }
.staging-no-issues { margin: 10px 0; padding: 8px; border-radius: 7px; color: #176044; background: var(--green-100); font-size: 8px; }
.staging-review-controls { display: grid; grid-template-columns: minmax(150px,.55fr) minmax(240px,1.45fr) auto; align-items: end; gap: 9px; }
.staging-review-controls label { display: grid; gap: 5px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.staging-review-controls select, .staging-review-controls textarea { width: 100%; padding: 8px 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--theme-input-bg); font: inherit; font-size: 9px; text-transform: none; }
.staging-review-controls textarea { min-height: 50px; resize: vertical; }
.staging-promotion-open { border-color: #e4bd60; color: #765000; background: #fff4cf; font-weight: 850; }
.staging-promotion-dialog { width: min(1040px, calc(100vw - 30px)); }
.staging-promotion-content { min-height: 0; padding: 18px 20px; overflow: auto; }
.staging-promotion-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 12px; }
.staging-promotion-layout > section { padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--theme-subtle-bg); }
.staging-promotion-summary { grid-column: 1 / -1; }
.staging-promotion-summary > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.staging-promotion-summary > header span { color: var(--muted); font-size: 8px; font-weight: 850; }
.staging-promotion-summary h3 { margin: 3px 0; color: var(--ink); font-size: 16px; }
.staging-promotion-summary p { margin: 0; color: var(--muted); font-size: 9px; }
.staging-promotion-summary > header b { padding: 6px 9px; border-radius: 999px; color: #765000; background: var(--amber-100); font-size: 8px; }
.staging-promotion-counts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.staging-promotion-counts span { padding: 6px 8px; border-radius: 8px; color: var(--muted); background: var(--theme-input-bg); font-size: 8px; }
.staging-promotion-counts strong { color: var(--ink); }
.staging-promotion-blocker { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 9px 10px; border-radius: 8px; color: #8f2936; background: var(--red-100); font-size: 8px; }
.staging-promotion-blocker.is-success { color: #176044; background: var(--green-100); }
.staging-promotion-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.staging-promotion-section-heading span, .staging-promotion-section-heading small { color: var(--muted); font-size: 7px; font-weight: 850; letter-spacing: .06em; }
.staging-promotion-section-heading h3 { margin: 2px 0 0; color: var(--ink); font-size: 13px; }
.staging-promotion-review > label, .staging-promotion-destination > label { display: grid; gap: 5px; margin-top: 9px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.staging-promotion-review :is(select, textarea), .staging-promotion-destination select { width: 100%; padding: 9px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--theme-input-bg); font: inherit; font-size: 9px; text-transform: none; }
.staging-promotion-review textarea { min-height: 70px; resize: vertical; }
.staging-promotion-destination label > small { color: var(--muted); font-size: 8px; font-weight: 500; line-height: 1.4; text-transform: none; }
.staging-promotion-issues li { grid-template-columns: minmax(70px,.3fr) minmax(0,1fr) auto; align-items: center; }
.staging-promotion-issues li > label { display: inline-flex; align-items: center; gap: 4px; font-size: 7px; font-weight: 850; white-space: nowrap; }
.staging-promotion-note { margin: 12px 0 0; padding: 10px; border-radius: 8px; color: #765000; background: var(--amber-100); font-size: 8px; line-height: 1.45; }
.staging-promotion-success { display: grid; min-height: 320px; place-items: center; align-content: center; gap: 7px; text-align: center; }
.staging-promotion-success > span { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 50%; color: #fff; background: var(--green-600); font-size: 24px; }
.staging-promotion-success h3 { margin: 4px 0 0; color: var(--ink); font-size: 18px; }
.staging-promotion-success p, .staging-promotion-success small { margin: 0; color: var(--muted); font-size: 9px; }

@media (max-width: 1100px) and (min-width: 781px) { :root { --quote-split-width: min(440px, 46vw); } }
@media (max-width: 780px) {
  .top-actions { flex-wrap: wrap; }
  .top-actions .button.quote-panel-toggle, .top-actions .button.staging-action { display: inline-flex; width: 40px; flex: 0 0 40px; padding: 0; }
  .top-actions :is(.quote-panel-toggle, .staging-action) .action-label { display: none; }
  .quote-split-panel { z-index: 35; top: 0; width: min(94vw, 520px); }
  html.quote-split-active .content { margin-right: 0; }
  .staging-upload-step, .staging-summary-grid { grid-template-columns: 1fr 1fr; }
  .staging-summary-grid > div:nth-child(2) { border-right: 0; }
  .staging-summary-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .staging-review-layout { grid-template-columns: 1fr; }
  .staging-batch-list { display: flex; max-height: 128px; gap: 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .staging-batch-list > button { min-width: 210px; margin-bottom: 0; }
  .staging-review-controls { grid-template-columns: 1fr; }
  .staging-promotion-layout { grid-template-columns: 1fr; }
  .staging-promotion-summary { grid-column: auto; }
}
@media (max-width: 520px) {
  .staging-workflow-dialog { width: 100vw; max-height: 100vh; }
  .staging-workflow-card { max-height: 100vh; border-radius: 0; }
  .staging-workflow-header, .staging-import-body { padding-inline: 15px; }
  .staging-upload-step, .staging-summary-grid { grid-template-columns: 1fr; }
  .staging-summary-grid > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .staging-workflow-actions { flex-wrap: wrap; }
  .staging-workflow-actions .button { flex: 1; }
}
