:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #f8fafc;
  --accent: #111111;
  /* Identidad editorial compartida con el blog (guia v1): ambar como UNICO acento editorial
     (badges NUEVO/DESTACADO, links del hero negro); el negro sigue para botones solidos.
     --r-pill = pastillas. Unifica noticias + perfiles con /blog en una sola identidad. */
  --accent-editorial: #F6A821;
  --accent-editorial-ink: #111111;
  --wa: #1faf54;
  --r-pill: 999px;
  --danger: #d92d20;
  --faint: #98a2b3;
  --hairline: #eef1f5;
  --chip-bg: #f1f3f6;
  --chip-bd: #e3e7ee;
  --ok: #16a34a;
  --ok-bg: #ecfdf3;
  --ok-bd: #128c4a;
  --ok-ink: #0f5132;
  --s1: 4px;
  --s2: 8px;
  --s3: 11px;
  --s4: 14px;
  --s5: 16px;
  --s6: 20px;
  --s7: 24px;
  --r-sm: 8px;
  --r-md: 9px;
  --r-lg: 12px;
  --r-xl: 16px;
}

* { box-sizing: border-box; }

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

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

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.hidden {
  display: none !important;
}

.login-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
}

.login-card {
  width: min(430px, 100%);
  display: grid;
  gap: 14px;
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.08);
}

/* Novedades del ecosistema en el login: panel discreto al lado del card. Comparte la MISMA fuente
   que el login de PROCA D (/proca-d/news.json). Solo se ve si hay noticias; si no, el login es idéntico. */
.login-stage {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  max-width: 860px;
}

.login-news {
  width: min(340px, 100%);
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 16px 42px rgba(16, 24, 40, 0.08);
}

.login-news-head {
  margin-bottom: 14px;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.login-news-list {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.login-news-item {
  display: grid;
  gap: 5px;
}

.login-news-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-news-tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3538cd;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.login-news-tag--novedad { background: #e7f6ec; color: #0f5132; }
.login-news-tag--proximamente { background: #eef2ff; color: #3538cd; }
.login-news-tag--aviso { background: #fef3f2; color: #b42318; }

.login-news-date {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.login-news-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
}

a.login-news-title { text-decoration: none; }
a.login-news-title:hover { text-decoration: underline; }

.login-news-body {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.brand,
/* Marca al FONDO del menu (footer discreto): el protagonismo lo lleva el nombre del usuario arriba. */
.side-brand {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.side-brand:hover,
.side-brand:focus-visible {
  color: #000;
  outline: none;
}

.login-card h1,
.topbar h2,
.order-form h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.topbar h2 {
  font-weight: 900;
}

.login-card p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.4;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

input, textarea, select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.login-card button,
.primary {
  min-height: 42px;
  padding: 0 16px;
  color: #fff;
  background: #000;
  border: 1px solid #000;
  border-radius: 9px;
  font-weight: 800;
}

.primary:disabled {
  cursor: wait;
  opacity: 0.86;
}

/* El feedback de botones (carga/palomita/tache) vive en button-feedback.css */
.form-status {
  min-height: 18px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.form-status.success {
  color: #0f8f4e;
}

.form-status.error {
  color: var(--danger);
}

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

.side {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 14px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.client-name {
  display: grid;
  gap: 3px;
  min-height: 70px;
  align-content: center;
  padding: 12px 10px;
  color: #111;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.client-name span,
.client-name small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.client-name strong {
  display: block;
  color: #000;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.client-name .admin-phrase {
  display: block;
  margin-top: 6px;
  color: #111;
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.25;
}

.account-actions {
  display: grid;
  gap: 7px;
  margin-top: auto;
}

/* Boton que despliega/colapsa el grupo de cuenta y privacidad. Por defecto el
   submenu esta cerrado, asi el menu lateral no carga 4 botones extra al fondo. */
.account-toggle {
  width: 100%;
  min-height: 34px;
  padding: 0 11px;
  color: #7a818c;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  cursor: pointer;
}

.account-toggle:hover {
  color: #111;
  border-color: #c7cdd6;
}

.account-menu {
  display: none;
  gap: 7px;
  margin-top: 7px;
}

.account-menu.open {
  display: grid;
}

.account-actions .logout-button {
  width: 100%;
  min-height: 32px;
  text-align: center;
}

.privacy-button.active {
  color: #fff !important;
  background: #111 !important;
  border-color: #111 !important;
}

.privacy-mode .case-client,
.privacy-mode .client-row span,
.privacy-mode .money-main span,
.privacy-mode .archive-row span {
  color: #8a93a3;
}

.side nav {
  display: grid;
  gap: 8px;
}

.side button,
.side a {
  min-height: 40px;
  padding: 0 11px;
  color: #4b5563;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  text-transform: uppercase;
}

.side button.active {
  color: #fff;
  background: #000;
  border-color: #000;
}

/* E: badge in-app de casos nuevos/con cambios en el nav lateral. */
.side nav button:has(.nav-badge:not(.hidden)) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  border-radius: 9px;
  background: #d92d20;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.side nav button.active .nav-badge {
  background: #fff;
  color: #000;
}

.logout-button {
  color: #7a818c !important;
  font-size: 11px !important;
}

main {
  min-width: 0;
  padding: 22px;
}

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

.top-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.top-actions .subtle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Menu superior: en linea en escritorio (el toggle solo aparece en movil). */
.top-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.top-actions .top-menu-toggle {
  display: none;
}

.top-actions .whatsapp-link {
  color: #fff;
  background: #25d366;
  border-color: #1ebe5b;
}

.top-actions .whatsapp-link:hover {
  background: #1ebe5b;
  border-color: #1aa752;
}

.top-more {
  position: relative;
}

.top-more-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: transparent;
}

.top-more-menu {
  position: absolute;
  top: 46px;
  right: 0;
  z-index: 31;
  width: 230px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(16,24,40,.16);
}

.top-more-menu button,
.top-more-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #111;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.top-more-menu button:hover,
.top-more-menu a:hover {
  background: var(--bg);
}

.top-actions .info-link {
  color: #fff;
  background: #128c4a;
  border-color: #128c4a;
}

.top-actions .info-link:hover {
  background: #0f7a41;
  border-color: #0f7a41;
}

.top-actions .credits-top-button {
  min-height: 30px;
  padding: 0 9px;
  color: #111;
  background: #f7f7f7;
  border-color: #111;
  font-size: 11px;
  font-weight: 800;
}

.top-actions .credits-top-button::before {
  content: "$";
  margin-right: 5px;
  font-weight: 800;
}

/* "Grabar pantalla": circulo rojo minimo (icono de grabar), sin sombras ni chrome de boton. */
.top-actions .record-button {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 999px;
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.top-actions .record-button .record-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: none;
}

.top-actions .record-button:hover .record-dot {
  background: #dc2626;
}

.top-actions .record-button:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {
  .top-actions .record-button:active .record-dot {
    transform: scale(0.9);
  }
}

.gpt-circle-button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #fff;
  background: #111;
  border: 1px solid #111;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(17, 17, 17, 0.14);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.gpt-circle-button:hover {
  color: #111;
  background: #fff;
}

.gpt-circle-button::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 999px;
  opacity: 0.22;
}

.gpt-landing-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid #111;
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.08);
}

.gpt-landing-orb {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  color: #fff;
  background: #111;
  border: 1px solid #111;
  border-radius: 999px;
  box-shadow: 0 14px 30px rgba(17, 17, 17, 0.16);
  font-size: 12px;
  font-weight: 800;
}

.gpt-landing-orb::before {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid currentColor;
  border-radius: 999px;
  opacity: 0.22;
}

.gpt-landing-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gpt-landing-card h3 {
  margin: 0;
  font-size: 24px;
}

.gpt-landing-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.growth-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-color: #111;
  border-left: 6px solid #128c4a;
}

.growth-card span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.growth-card h3 {
  max-width: 720px;
}

.growth-card p {
  max-width: 760px;
}

.growth-f0-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.growth-f0-strip strong,
.growth-f0-strip span {
  padding: 6px 8px;
  border: 1px solid #111;
  background: #f8fafc;
  color: #111;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.growth-f0-strip strong {
  background: #111;
  color: #fff;
}

/* Tira de paquetes de creditos en la tarjeta PROCA CDD de la Portada (data-driven desde CREDIT_PACKS). */
.credit-pack-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.credit-pack-strip span {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #111;
  font-size: 12px;
  font-weight: 700;
}

.credit-pack-strip strong {
  font-weight: 900;
}

.top-actions #publicCaseButton {
  color: #fff;
  background: #111;
  border-color: #111;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.16);
}

.top-actions #growthLeadButton {
  color: #0f5132;
  background: #ecfdf3;
  border-color: #128c4a;
}

.top-actions #publicCaseButton:hover {
  background: #000;
  border-color: #000;
}

.top-more-menu #publicCaseButton,
.top-more-menu #growthLeadButton,
.top-more-menu #creditsButton {
  color: #111;
  background: #fff;
  border-color: transparent;
  box-shadow: none;
}

.top-more-menu #publicCaseButton:hover,
.top-more-menu #growthLeadButton:hover,
.top-more-menu #creditsButton:hover {
  background: var(--bg);
  border-color: transparent;
}

.content {
  display: grid;
  gap: 16px;
}

.news-grid,
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

.case-grid {
  grid-template-columns: repeat(auto-fill, minmax(326px, 1fr));
  gap: 14px;
  max-width: 1180px;
}

.card,
.case-card,
.summary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
}

.card {
  padding: 20px;
}

.account-empty-card {
  max-width: 520px;
  border-color: #111;
}

.account-empty-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card h3,
.case-card h3 {
  margin: 0;
  color: #000;
  font-size: 20px;
  line-height: 1.14;
}

.case-card h3 {
  font-size: 19px;
  font-weight: 800;
}

.card p,
.case-card p {
  margin: 8px 0 0;
  color: #4b5563;
  line-height: 1.45;
}

.case-card .case-client {
  margin-top: 5px;
  color: #111;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-card .case-notes {
  display: -webkit-box;
  min-height: 38px;
  margin: 0;
  overflow: hidden;
  color: #111827;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.provider-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.summary-card {
  padding: 16px;
}

.provider-info {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
}

.provider-info span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.provider-info strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.provider-info p {
  margin: 5px 0 0;
  color: var(--muted);
}

.summary-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 4px;
  color: #000;
  font-size: 28px;
}

.summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.credit-summary {
  border-color: #111;
}

.credit-review-note {
  color: #b42318;
}

.credit-plan-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.credit-plan-breakdown b,
.credit-plan-breakdown em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.credit-plan-breakdown b {
  color: #fff;
  background: #111;
  border-color: #111;
}

.credit-plan-breakdown em {
  color: #475467;
  background: #fff;
}

.admin-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-filter-row button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-filter-row button.active {
  color: #fff;
  background: #000;
  border-color: #000;
}

.admin-filter-row span {
  min-width: 22px;
  padding: 2px 6px;
  color: inherit;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  text-align: center;
}

.admin-filter-row button.active span {
  background: rgba(255, 255, 255, 0.18);
}

.money-summary {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 10px;
}

.money-card {
  min-height: 118px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
}

.money-card span,
.money-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.money-card strong {
  display: block;
  margin: 7px 0 5px;
  color: #000;
  font-size: 30px;
  line-height: 1;
}

.primary-money {
  border-color: #111;
}

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

.money-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  background: #f5f6f7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.money-tabs button {
  min-width: 108px;
  min-height: 34px;
  padding: 0 14px;
  color: #475467;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
  cursor: pointer;
}

.money-tabs button.active {
  color: #fff;
  background: #111;
}

.client-directory-head {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
}

.reports-block { margin-bottom: 26px; }
.reports-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 12px;
  font-size: 16px;
}
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.reports-grid .card h4 { margin: 0 0 8px; font-size: 13px; }
.stat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.stat-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  border-bottom: 1px solid #f0f2f6;
  padding-bottom: 4px;
}
.stat-list li.muted, .muted { color: var(--muted); }
.stat-list strong { font-weight: 900; }
.reports-split { display: grid; grid-template-columns: minmax(200px, 280px) 1fr; gap: 12px; }
.reports-list { display: grid; gap: 6px; align-content: start; max-height: 540px; overflow: auto; }
.report-item {
  display: grid;
  gap: 2px;
  padding: 9px 11px;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 800;
}
.report-item small { color: var(--muted); font-weight: 600; }
.report-item.active { background: #000; color: #fff; border-color: #000; }
.report-item.active small { color: #cdd2d8; }
.report-item:disabled { opacity: 0.5; cursor: default; }
.report-content { max-height: 600px; overflow: auto; }
.report-content pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.5; }

.report-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.report-tab {
  flex: 0 0 auto;
  padding: 7px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.report-tab.active {
  color: #fff;
  background: #000;
  border-color: #000;
}

.maquila-pricing {
  margin: 16px 0;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.maquila-pricing h3 { margin: 0 0 10px; font-size: 15px; }
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pricing-table th, .pricing-table td {
  padding: 7px 9px;
  text-align: left;
  border-bottom: 1px solid #eef1f5;
  vertical-align: top;
}
.pricing-table th {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}
.pricing-table .pricing-notes { color: var(--muted); font-size: 12px; max-width: 360px; }

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

.client-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.2fr) minmax(170px, 1fr) minmax(130px, 0.8fr) minmax(80px, 0.4fr) minmax(86px, 0.4fr) 40px 40px 40px;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.05);
}

.client-row a,
.client-row .client-name {
  color: #111;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-row span,
.client-row small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-row strong {
  font-size: 12px;
  text-align: right;
}

.client-gpt-button {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  background: #111;
  border: 1px solid #111;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.client-gpt-button:hover {
  color: #111;
  background: #fff;
}

.client-view-button {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.client-view-button:hover { background: #f5f6f7; }

.client-reset-button {
  display: inline-grid;
  place-items: center;
  justify-self: end;
  width: 34px;
  height: 34px;
  padding: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
}
.client-reset-button:hover { background: #f5f6f7; }

.client-view-head {
  display: grid;
  grid-template-columns: auto repeat(4, minmax(160px, 1fr));
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.client-view-head > button {
  align-self: center;
  height: 40px;
}

.client-view-section {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.client-view-section h3 {
  margin: 0;
  font-size: 15px;
}

.client-preview-grid .case-card {
  cursor: default;
}

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

.request-card {
  display: grid;
  gap: 10px;
  min-height: 218px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 5px solid var(--status-color, #f2c94c);
  border-radius: 18px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, 0.07);
}

.request-card header,
.request-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.request-card header span,
.request-card footer small,
.request-card footer time,
.request-client {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.request-card h3 {
  margin: 0;
  color: #000;
  font-size: 18px;
  line-height: 1.15;
}

.request-card p {
  margin: 0;
  color: #344054;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.money-row {
  display: grid;
  grid-template-columns: 34px minmax(82px, 110px) minmax(170px, 1.4fr) minmax(110px, 0.8fr) minmax(120px, 0.8fr) minmax(95px, 0.6fr) minmax(90px, 0.6fr) minmax(80px, 0.5fr);
  gap: 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.05);
}

.money-row a {
  color: #111;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.money-main {
  min-width: 0;
}

.money-main strong,
.money-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-main strong {
  font-size: 13px;
}

.money-main span,
.money-row small,
.money-row time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.money-payment {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.money-payment.paid {
  color: #0f8f4e;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.money-payment.pending {
  color: #111;
  background: #fff;
  border-style: dashed;
}

.money-due {
  font-size: 13px;
  text-align: right;
}

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

.active-view-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.active-view-toggle button {
  width: 34px;
  height: 32px;
  color: #667085;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.active-view-toggle button.active {
  color: #fff;
  background: #111;
}

/* Controles de actividad (ordenar por reciente / solo con cambios) en la vista Activos. */
.search-row {
  flex-wrap: wrap;
}

.search-row input[type="search"] {
  flex: 1 1 220px;
  min-width: 200px;
}

.active-activity-controls {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.active-activity-controls .activity-count {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: #d1462f;
  border-radius: 999px;
}

/* "Actualizado hace X" en tarjeta/fila de orden activa. */
.case-updated {
  color: #98a2b3;
  font-size: 11px;
}

/* Tabla densa: contenedor con borde y esquinas; las filas van planas adentro. */
.case-list {
  display: grid;
  gap: 0;
  max-width: 1240px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  box-shadow: 0 7px 18px rgba(16, 24, 40, 0.05);
}

.case-list-head,
.case-list-row {
  display: grid;
  grid-template-columns: 28px 78px minmax(170px, 1fr) 116px 134px 118px 90px 190px;
  align-items: center;
  gap: 11px;
}

.case-list-head {
  min-width: 764px;
  padding: 11px 16px;
  background: #fafbfc;
  border-bottom: 1px solid var(--line);
  border-left: 4px solid transparent;
}

.case-list-head span {
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-list-head .col-salida,
.case-list-head .col-archivos {
  text-align: right;
}

.case-list-row {
  min-width: 764px;
  min-height: 62px;
  padding: 12px 16px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  border-left: 4px solid var(--status-color, #111);
  cursor: pointer;
}

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

.case-list-row:hover {
  background: #f6f8fb;
}

/* Pestana Entregas: rejilla propia (8 columnas) para listos-para-salir. */
.delivery-head,
.delivery-row {
  grid-template-columns: 84px minmax(150px, 1fr) 104px 120px 128px 108px minmax(118px, 1.1fr) 104px;
}

.deliveries-summary {
  margin-bottom: 12px;
}

.delivery-method span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.delivery-method small {
  display: block;
  font-size: 10.5px;
  color: var(--faint);
}

.delivery-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.delivery-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.delivery-tag.tag-red {
  background: #fde8e8;
  color: #b42318;
}

.delivery-tag.tag-amber {
  background: #fef3cd;
  color: #92600a;
}

.delivery-tag.tag-green {
  background: #e7f6ec;
  color: #128c4a;
}

.delivery-action[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.needs-scan-row {
  background: #fff5f4;
}

.case-list-order {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

.case-list-main {
  min-width: 0;
}

.case-list-main strong,
.case-list-main span,
.case-list-main small,
.case-list-date strong,
.case-list-date small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-list-main strong {
  color: #000;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
}

.case-list-main span,
.case-list-main small,
.case-list-date span,
.case-list-date small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 850;
}

.case-list-date strong {
  font-size: 13px;
  font-weight: 800;
}

.case-list-main small,
.case-list-date span {
  text-transform: uppercase;
}

.case-list-date {
  display: grid;
  justify-content: flex-end;
  text-align: right;
}

.case-list-payment {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  column-gap: 6px;
  align-items: center;
  min-width: 0;
}

.case-list-payment strong,
.case-list-payment small {
  overflow: hidden;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.case-list-payment small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.case-list-files {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 5px;
  text-align: right;
}

.case-list-files .file-pill {
  min-height: 29px;
  padding: 0 10px;
  font-size: 11px;
}

/* Chip de producto y estado mas legibles dentro de la fila de lista. */
.case-list-row .product-chip,
.case-list-row .status {
  min-height: 27px;
  font-size: 11.5px;
}

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

.pending-row {
  display: grid;
  grid-template-columns: 34px minmax(82px, 104px) minmax(190px, 1.4fr) minmax(120px, 0.8fr) minmax(190px, 1.2fr) minmax(170px, 1fr) 84px;
  align-items: center;
  gap: 9px;
  min-height: 62px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--status-color, #111);
  border-radius: 14px;
  box-shadow: 0 7px 18px rgba(16, 24, 40, 0.055);
  cursor: pointer;
}

.pending-row-attention {
  border-top: 3px solid #d92d20;
}

.pending-reasons {
  overflow: hidden;
  color: #111;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pending-row small,
.pending-row time {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

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

.action-card {
  display: grid;
  gap: 10px;
  min-height: 220px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #64748b;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.06);
}

.action-card header,
.action-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-card header span,
.action-card footer small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.action-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.action-card p,
.action-impact {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

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

.action-status {
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.action-urgent {
  border-left-color: #d92d20;
}

.action-high {
  border-left-color: #f59e0b;
}

.action-low {
  border-left-color: #94a3b8;
}

.case-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.case-card:hover {
  border-color: #8c96a3;
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.14);
  transform: translateY(-1px);
}

.credit-case-card {
  border-top: 5px solid #111;
}

.needs-scan-card {
  border-top: 4px solid var(--danger);
  box-shadow: 0 0 0 1px rgba(217, 45, 32, 0.18), 0 12px 30px rgba(217, 45, 32, 0.12);
}

.needs-scan-card::before {
  content: "Necesita nuevo escaneo";
  position: absolute;
  top: 0;
  left: 18px;
  transform: translateY(-50%);
  min-height: 22px;
  padding: 4px 9px;
  color: #fff;
  background: var(--danger);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.work-date {
  position: absolute;
  top: 14px;
  right: 18px;
  color: #8a929d;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 14px;
  align-items: start;
  padding-top: 12px;
}

.no-due-card .case-top {
  grid-template-columns: minmax(0, 1fr);
}

.case-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
}

.case-heading > strong,
.case-heading > .case-order-link,
.detail-topline > .case-order-link {
  color: #000;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.detail-topline > .case-order-link {
  font-size: inherit;
}

.case-order-link:hover,
.case-list-order:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.product-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 150px;
  padding: 0 8px;
  overflow: hidden;
  color: #111;
  background: color-mix(in srgb, var(--product-color, #d8dadd) 20%, #fff);
  border: 1px solid color-mix(in srgb, var(--product-color, #d8dadd) 45%, #d8dadd);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  color: var(--status-text, #111);
  background: var(--status-color, #e5e7eb);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.credit-case-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  margin-top: 8px;
  padding: 0 9px;
  color: #111;
  background: #f5f5f5;
  border: 1px solid #111;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-top .status {
  width: min(100%, 260px);
  min-height: 30px;
  justify-content: center;
  margin-top: 8px;
  padding: 0 13px;
  border-radius: 9px;
  box-shadow: inset 3px 0 0 rgba(0,0,0,0.16);
}

.exit-box {
  display: grid;
  justify-items: end;
  gap: 3px;
  min-height: 78px;
  margin-top: auto;
  padding-top: 26px;
  color: #000;
}

.exit-box span,
.exit-box small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.exit-box strong {
  overflow: hidden;
  max-width: 132px;
  font-size: 15px;
  font-weight: 800;
  text-align: right;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Fecha de salida en rojo: sin liquidar (con fecha) o sin anticipo (sin fecha). */
.exit-date.danger {
  color: var(--danger);
}

/* Entrada secundaria/chica bajo la salida en la vista de lista. */
.case-list-date .entry-line,
.exit-box .entry-line {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
}

.exit-box small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pay-dot {
  display: inline-flex;
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 999px;
}

.pay-dot.paid { background: var(--ok); }
.pay-dot.unpaid { background: var(--danger); }
.pay-dot.monthly { background: #9ca3af; }

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

.case-detail .case-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Tarjeta: Costo total + Restante + Video en una sola fila (3 columnas). */
.case-card .case-meta {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Lista: el total va bajo el badge de pago, en tono tenue para no competir con el restante. */
.case-list-payment .pay-total {
  color: var(--faint);
  font-weight: 700;
}

.case-meta div {
  min-height: 42px;
  padding: 9px 11px;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

.case-meta span {
  display: block;
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-meta strong {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-meta strong.danger {
  color: var(--danger);
}

.case-actions,
.file-list,
.case-file-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-file-buttons {
  align-self: end;
}

.file-pill.html-file {
  border-style: dashed;
}

.case-upload-panel {
  display: grid;
  gap: 10px;
  margin: 0;
}

.case-upload-panel h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.case-upload-panel p {
  margin: 0;
  color: #475467;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}

.case-upload-panel textarea {
  min-height: 78px;
}

.approval-panel {
  display: grid;
  gap: 10px;
}

.approval-panel .subtle-button {
  justify-self: end;
}

.case-upload-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1.2fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.case-upload-row strong,
.case-upload-row span {
  display: block;
}

.case-upload-row strong {
  font-size: 12px;
}

.case-upload-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.case-upload-row input {
  min-width: 0;
  font-size: 12px;
}

.admin-upload-layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 1240px;
}

.admin-upload-panel {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
}

.admin-upload-panel .eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-upload-panel h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 850;
}

.admin-upload-panel textarea {
  min-height: 104px;
}

.admin-upload-cases {
  display: grid;
  gap: 8px;
}

.admin-upload-row {
  display: grid;
  grid-template-columns: 88px minmax(140px, 1.2fr) minmax(120px, 1fr) minmax(110px, 0.8fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: left;
}

.admin-upload-row:hover,
.admin-upload-row.active {
  border-color: #111;
  box-shadow: 0 8px 18px rgba(16, 24, 40, 0.08);
}

.admin-upload-row strong,
.admin-upload-row span,
.admin-upload-row small,
.admin-upload-row em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-upload-row strong {
  font-size: 12px;
  font-weight: 850;
}

.admin-upload-row span {
  font-size: 13px;
  font-weight: 800;
}

.admin-upload-row small,
.admin-upload-row em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.subtle-button,
.case-actions button,
.file-list a,
.file-list button {
  min-height: 34px;
  padding: 0 10px;
  color: #000;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.compact {
  min-height: 32px;
  padding: 0 14px;
  font-size: 12px;
}

.approval {
  border-color: #f2c94c !important;
  background: #fff8d7 !important;
}

.approval-note {
  width: fit-content;
  min-height: 26px;
  padding: 5px 9px;
  color: #111;
  background: #fff8d7;
  border: 1px solid #f2c94c;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.loading-card {
  min-height: 160px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.state-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(520px, 100%);
  margin: 20px auto;
  padding: 24px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.state-card h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.state-card p {
  margin: 0;
  color: #475467;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}

.error-state {
  border-color: var(--danger);
}

.skeleton {
  background: linear-gradient(90deg,#eef1f5 25%,#f6f8fb 37%,#eef1f5 63%);
  background-size: 400% 100%;
  animation: sk 1.2s ease infinite;
  border-radius: 8px;
}

@keyframes sk {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

.skeleton-card {
  min-height: 180px;
  cursor: default;
}

.skeleton-row {
  cursor: default;
}

.sk-line {
  display: block;
  width: 100%;
  height: 14px;
}

.sk-line.short {
  width: 58%;
}

.sk-line.medium {
  width: 76%;
}

.sk-block {
  display: block;
  width: 100%;
  height: 54px;
}

.sk-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15,23,42,.40);
}

.modal-panel {
  width: min(700px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 0;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 54px rgba(16, 24, 40, 0.24);
}

.modal-close {
  float: right;
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 12px 12px 0 0;
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-form {
  display: grid;
  gap: 12px;
  clear: both;
  /* El modal-panel viene con padding:0 (para que el boton Cerrar pegue arriba);
     el formulario aporta sus propios margenes laterales/inferior para no tocar el borde. */
  padding: 0 28px 28px;
}

/* Campo de archivos estilizado: el <input type=file> nativo se oculta y el label
   muestra un boton on-brand "Elegir archivos" + el nombre del archivo elegido. */
.file-field {
  position: relative;
}
.file-field-hint {
  display: block;
  margin: 2px 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
}
.file-field input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.file-field-control {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 5px 6px 5px 5px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
}
.file-field:focus-within .file-field-control {
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.12);
}
.file-field-btn {
  flex: 0 0 auto;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: #fff;
  background: #000;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
}
.file-field-name {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-field.has-files .file-field-name {
  color: var(--ink);
  font-weight: 700;
}

/* Boton "Cargar mas" de la paginacion de Activos. */
.load-more-row {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}
.load-more {
  min-height: 42px;
  padding: 0 22px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
}
.load-more span {
  color: var(--muted);
  font-weight: 700;
}
.load-more:hover {
  border-color: #000;
}

.core-widget-fab {
  position: fixed;
  right: 18px;
  /* Se apila POR ENCIMA del FAB de Soporte (que ocupa la esquina inferior derecha). */
  bottom: 84px;
  z-index: 18;
  min-height: 44px;
  padding: 0 18px;
  color: #fff;
  background: #000;
  border: 1px solid #000;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.28);
}

/* ===== "Preguntale a CORE": FAB de Soporte + panel de chat (identidad del portal) ===== */
.core-chat-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 19;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(16, 24, 40, 0.28);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.core-chat-fab:hover { transform: translateY(-1px); box-shadow: 0 16px 36px rgba(16, 24, 40, 0.34); }
.core-chat-fab:focus-visible { outline: 3px solid rgba(17, 17, 17, 0.35); outline-offset: 2px; }
.core-chat-fab svg { display: block; }

.core-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  width: min(380px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 32px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.30);
  overflow: hidden;
}
.core-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  color: #fff;
  background: var(--accent);
}
.core-chat-title { display: flex; align-items: center; gap: 10px; }
.core-chat-dot {
  width: 9px; height: 9px; border-radius: 999px;
  background: #34d399; box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}
.core-chat-titletext { display: flex; flex-direction: column; line-height: 1.15; }
.core-chat-titletext strong { font-size: 14px; font-weight: 800; }
.core-chat-titletext small { font-size: 11px; opacity: 0.8; }
.core-chat-close {
  appearance: none; border: 0; background: transparent; color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 8px;
}
.core-chat-close:hover { background: rgba(255, 255, 255, 0.15); }

.core-chat-body {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--soft);
}
.core-chat-empty { margin: auto; text-align: center; color: var(--muted); font-size: 13px; padding: 12px; }
.core-chat-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.core-chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.core-chat-msg.core {
  align-self: flex-start;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.core-chat-msg.thinking { align-self: flex-start; color: var(--muted); font-style: italic; }
.core-chat-thinking-dots span {
  display: inline-block; width: 5px; height: 5px; margin-left: 2px; border-radius: 999px;
  background: var(--muted); animation: coreChatBlink 1.2s infinite ease-in-out;
}
.core-chat-thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.core-chat-thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes coreChatBlink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.core-chat-input {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.core-chat-input textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink);
  background: var(--panel);
}
.core-chat-input textarea:focus-visible { outline: 2px solid rgba(17, 17, 17, 0.35); outline-offset: 1px; }
.core-chat-send {
  flex: none;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; background: var(--accent); border: 1px solid var(--accent);
  border-radius: 12px; cursor: pointer;
}
.core-chat-send:disabled { opacity: 0.5; cursor: default; }
.core-chat-foot { margin: 0; padding: 0 12px 10px; color: var(--faint); font-size: 10.5px; text-align: center; background: var(--panel); }

/* ===== Filas de caso en el chat (guia del lider) =====
   Tipografia ACOTADA al widget: Hanken Grotesk para lenguaje/UI, JetBrains Mono para datos de
   sistema (ID, unidades, dinero, fechas). Fallbacks system-ui / ui-monospace si la fuente no carga.
   Tokens de color propios del widget para no depender de las variables globales del portal. */
.core-chat-body {
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  --cc-ink: #17191c;
  --cc-muted: #8d8a84;
  --cc-line: #f2f1ec;
  --cc-surface: #fff;
  --cc-hover: #faf9f6;
  --cc-paid-fg: #1f7a4d;   --cc-paid-bg: #e7f4ec;
  --cc-due-fg: #9a6a12;    --cc-due-bg: #f8efdd;
  --cc-pend-fg: #6b6862;   --cc-pend-bg: #efeeea;
  --cc-future-fg: #3355aa; --cc-future-bg: #eef1f7;
  --cc-overdue-fg: #b0432e;--cc-overdue-bg: #f7e7e2;
}
.core-chat-cases {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  /* flex:none es OBLIGATORIO: este bloque es hijo flex de .core-chat-body (columna con altura
     topada) y su overflow:hidden vuelve 0 el min-height automatico -> sin esto, flex-shrink lo
     COMPRIME a la altura visible del panel y RECORTA las filas que no caben (bug "dice aqui
     esta la lista pero no esta / incompleta"). Con flex:none conserva su altura natural y
     .core-chat-body scrollea la lista completa. */
  flex: none;
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 16px;
  overflow: hidden;
}
.core-chat-case-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  border-top: 1px solid var(--cc-line);
  cursor: pointer;
  transition: background 0.12s ease;
}
.core-chat-case-row:first-child { border-top: 0; }
.core-chat-case-row:hover { background: var(--cc-hover); }
.core-chat-case-row:focus-visible { outline: 2px solid var(--cc-future-fg); outline-offset: -2px; }
.core-chat-case-row--static { cursor: default; }
.core-chat-case-row--static:hover { background: transparent; }
.core-chat-case-left { display: flex; align-items: center; gap: 9px; min-width: 0; }
.core-chat-case-dot { flex: none; width: 9px; height: 9px; border-radius: 999px; }
.core-chat-case-idwrap { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.core-chat-case-idline { display: flex; align-items: center; gap: 6px; }
.core-chat-case-id {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  font-size: 13px;
  color: var(--cc-ink);
}
.core-chat-case-tag {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 5px;
  background: #f1f0ec;
  color: #6b6862;
  text-transform: uppercase;
}
.core-chat-case-tag--fija { background: #16181c; color: #fff; }
.core-chat-case-sub {
  font-size: 11.5px;
  color: var(--cc-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.core-chat-case-right { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.core-chat-case-pay {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.core-chat-case-pay--paid { color: var(--cc-paid-fg); background: var(--cc-paid-bg); }
.core-chat-case-pay--due { color: var(--cc-due-fg); background: var(--cc-due-bg); }
.core-chat-case-chip {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.core-chat-case-chip--future { color: var(--cc-future-fg); background: var(--cc-future-bg); }
.core-chat-case-chip--soon { color: var(--cc-due-fg); background: var(--cc-due-bg); }
.core-chat-case-chip--overdue { color: var(--cc-overdue-fg); background: var(--cc-overdue-bg); }

/* Chips de sugerencia (protocolo de no-contexto). Heredan los tokens --cc-* del .core-chat-body. */
.core-chat-suggests {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-top: 2px;
}
.core-chat-chip {
  font-family: "Hanken Grotesk", system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cc-ink);
  background: var(--cc-surface);
  border: 1px solid var(--cc-line);
  border-radius: 20px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.core-chat-chip:hover { background: var(--cc-hover); border-color: #e3e1da; }
.core-chat-chip:focus-visible { outline: 2px solid var(--cc-future-fg); outline-offset: 1px; }

/* ===== Pestaña CORE (chat de pagina completa; reusa .core-chat-body/-input/-msg del panel) ===== */
.core-tab {
  display: flex;
  flex-direction: column;
  max-width: 860px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(16, 24, 40, 0.08);
}
.core-tab-head {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 15px 18px;
  color: #fff;
  background: var(--accent);
}
.core-tab-head .core-chat-dot { margin-top: 6px; }
.core-tab-headtext { display: flex; flex-direction: column; gap: 3px; line-height: 1.3; }
.core-tab-headtext strong { font-size: 15px; font-weight: 800; }
.core-tab-headtext small { font-size: 12px; opacity: 0.85; }
.core-tab-body { min-height: 44vh; max-height: 62vh; }
.core-tab-input textarea { max-height: 160px; }

/* Pestaña CORE (Beta): chat izquierda + reporte conciso derecha + pendientes abajo. */
.beta-chip {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  vertical-align: middle;
}
.core-tab-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.core-tab-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.core-side-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 14px 16px;
}
.core-side-card h3 { font-size: 14px; margin: 0 0 10px; }
.core-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.core-side-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
}
.core-side-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}
.core-side-stats strong { font-size: 17px; }
.core-side-stats strong small { font-size: 11px; font-weight: 600; opacity: 0.7; }
.core-side-stats span { font-size: 11px; color: #6b7280; }
/* Reportes: selector de cliente + tabs Finanzas/Productos/Operación + cuerpo. */
.core-report-card { display: flex; flex-direction: column; gap: 10px; }
.core-report-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.core-report-top h3 { margin: 0; }
.core-report-client { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7280; }
.core-report-client select { max-width: 150px; font-size: 12px; }
.core-report-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.core-report-tab {
  border: 1px solid var(--line);
  background: var(--soft);
  color: #4b5563;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.core-report-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.core-report-body { display: flex; flex-direction: column; gap: 10px; }
.core-report-sub { font-size: 12px; margin: 4px 0 0; color: #374151; text-transform: uppercase; letter-spacing: 0.03em; }
.core-report-note { font-size: 12px; color: #4b5563; margin: 2px 0 0; line-height: 1.4; }
/* Barras del mix de productos. */
.core-bars { display: flex; flex-direction: column; gap: 6px; }
.core-bar-row { display: grid; grid-template-columns: 90px 1fr 28px; align-items: center; gap: 8px; font-size: 12px; }
.core-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #374151; }
.core-bar-track { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.core-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.core-bar-value { text-align: right; font-variant-numeric: tabular-nums; color: #4b5563; }
/* Recomendaciones de operación. */
.core-recs { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.core-recs li { font-size: 12.5px; line-height: 1.4; color: #374151; }
/* Pendientes en formato chat: CORE pide lo que falta por caso. */
.core-pend {
  margin-top: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 14px 16px;
}
.core-pend-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.core-pend-head h3 { font-size: 14px; margin: 0; }
.core-pend-head small { color: #6b7280; font-size: 12px; }
.core-pend-item { margin: 10px 0 14px; }
.core-pend-msg {
  max-width: 640px;
  padding: 10px 13px;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  font-size: 13.5px;
  line-height: 1.45;
  background: var(--soft);
  border: 1px solid var(--line);
}
.core-pend-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 6px 0 0 6px;
}
.core-pend-upload { cursor: pointer; }
.core-pend-status { font-size: 12px; color: #1f7a4d; }
/* Clip + barra de adjuntos del chat. */
.core-chat-clip {
  border: none;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
  padding: 6px 4px;
  align-self: flex-end;
  opacity: 0.75;
}
.core-chat-clip:hover { opacity: 1; }
.core-attach {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--soft);
}
.core-attach select { max-width: 240px; font-size: 12.5px; }
.core-attach input[type="file"] { font-size: 12px; max-width: 220px; }

@media (max-width: 980px) {
  .core-tab-layout { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .core-chat-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .core-chat-fab { right: 14px; bottom: 14px; }
  .core-widget-fab { bottom: 80px; right: 14px; }
  .core-tab-body { min-height: 50vh; max-height: 60vh; }
}

.core-widget-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.core-widget-sent {
  margin-top: 4px;
}

.core-widget-sent h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.core-widget-sent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.core-widget-sent-list li {
  padding: 8px 10px;
  background: var(--soft);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: 12px;
}

.core-widget-sent-at {
  display: block;
  color: var(--faint);
  font-size: 11px;
  margin-bottom: 2px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* O40 - Orden multi-linea: cada linea = producto + cantidad + total de linea; GRAN TOTAL en vivo. */
.order-lines-block {
  display: grid;
  gap: 10px;
  margin: 6px 0 4px;
}
.order-lines-head {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
}
.order-lines {
  display: grid;
  gap: 10px;
}
.order-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px auto auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.order-line label {
  display: grid;
  gap: 4px;
  margin: 0;
}
.order-line-total {
  display: grid;
  gap: 4px;
  align-self: end;
  padding-bottom: 8px;
  text-align: right;
  min-width: 90px;
}
.order-line-total-label {
  font-size: 0.72rem;
  color: var(--muted);
}
.order-line-total-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.order-line-remove {
  align-self: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--danger);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.order-line-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.order-add-line {
  justify-self: start;
  background: transparent;
  border: 1px dashed var(--accent);
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
}
.order-grand-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
}
.order-grand-total-label {
  font-weight: 600;
}
.order-grand-total-value {
  font-size: 1.25rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.order-internal-cost {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}
.order-internal-cost strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.order-grand-total-note {
  font-size: 0.78rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  .order-line {
    grid-template-columns: minmax(0, 1fr) 80px;
    grid-template-areas:
      "product product"
      "qty total"
      "remove remove";
  }
  .order-line-product { grid-area: product; }
  .order-line-qty { grid-area: qty; }
  .order-line-total { grid-area: total; }
  .order-line-remove { grid-area: remove; justify-self: end; }
}

.detail-head {
  display: grid;
  gap: 8px;
  padding: 22px 24px 18px;
}

.case-detail {
  clear: both;
}

.case-detail section {
  padding: 18px 24px;
  border-bottom: 1px solid var(--hairline);
}

.case-detail section:last-child {
  border-bottom: 0;
}

.case-detail .detail-head {
  padding: 22px 24px 18px;
}

.detail-head h2 {
  margin: 0;
  font-size: 25px;
  font-weight: 900;
  line-height: 1.12;
}

/* Ficha expandida v2: modal mas ancho + 2 columnas (izq cliente/orden, der
   archivos/videos/chat). Bloques con padding consistente para evitar margenes
   raros en los pop-ups. */
.case-modal-panel {
  width: min(1080px, 100%);
}

.case-detail-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 16px;
  padding: 18px 24px 22px;
}

.case-detail-cols .case-col {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.case-detail .case-detail-cols .case-block {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.case-block h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

/* Panel de edicion de campos de gestion (Ops): admin/demo editan nombre, paciente,
   pago, restante, fecha de salida y notas del caso. Convive con estado y pago. */
.case-edit-panel {
  background: #f8fafc;
}
.case-edit-panel h3 {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.case-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.case-edit-grid label {
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}
.case-edit-grid input,
.case-edit-grid select,
.case-edit-grid textarea {
  font: inherit;
  font-weight: 500;
  color: inherit;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
}

/* Panel "Editar cuenta" de la Vista Cliente (details plegable, reusa el grid de edicion). */
.client-account-edit {
  margin-bottom: 14px;
}
.client-account-edit > summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}
.client-account-edit[open] > summary {
  margin-bottom: 12px;
}
.case-edit-grid textarea {
  resize: vertical;
  min-height: 64px;
}
.case-edit-notes {
  grid-column: 1 / -1;
}
.case-edit-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.order-line-items-block {
  display: grid;
  gap: 8px;
}

.order-line-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-line-items-head h3 {
  margin-bottom: 0;
}

.order-line-items-head strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.order-line-items-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.order-line-items-list {
  display: grid;
  gap: 6px;
}

.order-line-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(86px, auto);
  gap: 10px;
  align-items: center;
  min-height: 34px;
  padding: 7px 8px;
  background: #f8fafc;
  border: 1px solid var(--hairline);
  border-radius: 8px;
}

.order-line-item-row strong,
.order-line-item-row small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-line-item-row small {
  color: var(--muted);
  font-size: 11px;
}

.order-line-item-row span,
.order-line-item-row b {
  font-size: 12px;
  font-weight: 850;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.client-block-name {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}

.client-block-name.muted {
  color: var(--muted);
  font-weight: 600;
}

.case-file-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-file-pill-row.compact .file-pill {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
  border-radius: 8px;
}

/* Lista de archivos al fondo de la orden expandida: agrupada por categoria, con subir/borrar. */
.case-files-list-block { margin-top: 12px; }
.case-file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.case-file-list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid #e6e8ec; border-radius: 8px;
  background: #fafbfc; font-size: 12px;
}
.case-file-list-row .cf-cat { flex: 0 0 auto; min-width: 92px; color: #6b7280; font-weight: 600; }
.case-file-list-row .cf-name { color: #1f2937; text-decoration: none; word-break: break-word; }
.case-file-list-row .cf-name:hover { text-decoration: underline; }
.case-file-list-row.locked { opacity: .75; }
.case-file-list-row.locked .cf-locked { color: #9ca3af; font-style: italic; }
.cf-group { margin-top: 10px; }
.cf-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.cf-group-head .cf-cat { color: #6b7280; font-weight: 700; font-size: 12px; }
.cf-upload {
  border: 1px dashed rgba(100, 116, 139, .5); background: transparent; color: #475569;
  border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer;
}
.cf-upload:hover { background: rgba(100, 116, 139, .1); }
.cf-empty { margin: 0; font-size: 12px; }
.case-file-list-row .cf-del {
  margin-left: auto; flex: 0 0 auto; border: none; background: transparent; color: #9ca3af;
  cursor: pointer; font-size: 13px; line-height: 1; padding: 2px 5px; border-radius: 6px;
}
.case-file-list-row .cf-del:hover { color: #dc2626; background: rgba(220, 38, 38, .1); }

/* Leyenda sobre los botones de categorias de la ficha (pedido del lider). */
.case-files-caption { margin: 0 0 6px; color: #6b7280; font-size: 11.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; }

/* Seccion unificada "Pagos": subtitulo de comprobantes + confirmacion legacy ClickUp. */
.case-proof-subtitle { margin: 14px 0 6px; font-size: 12.5px; color: #475569; }
.case-legacy-confirm { display: grid; gap: 8px; margin-top: 8px; }
.case-legacy-confirm p { margin: 0; font-size: 12.5px; color: #6b7280; }

/* Busqueda de comprobantes (Finanzas): considera el texto LEIDO del comprobante. */
.proof-search-card label { display: grid; gap: 6px; font-size: 12.5px; color: #475569; font-weight: 600; }
.proof-search-card input { font: inherit; padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(100, 116, 139, .35); }
.proof-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.card-product-chip {
  margin-top: 6px;
}

.line-items-pill {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  width: max-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 8px;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid var(--hairline);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
  line-height: 1.2;
}

.case-list-row .line-items-pill {
  margin-top: 0;
  justify-self: start;
  white-space: nowrap;
}

.case-chat-thread {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 4px;
}

.chat-msg {
  padding: 8px 10px;
  background: var(--soft, #f5f6f7);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}

.chat-msg-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--muted);
}

.chat-msg-head strong {
  color: #14181f;
  font-weight: 800;
}

.chat-msg p {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.chat-empty,
.chat-loading {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.case-chat-input {
  display: grid;
  gap: 5px;
}

.upload-hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.detail-head p,
.approval-panel p {
  margin: 0;
  color: #475467;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
}

.detail-topline,
.detail-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.detail-status-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.admin-status-select {
  min-height: 30px;
  padding: 3px 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  background: var(--status-color, #fff);
  color: var(--status-text, #111);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
}

.admin-status-select:disabled {
  opacity: 0.7;
  cursor: default;
}

.approved-pill {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #0f5132;
  background: #eef7ef;
  border: 1px solid #cfe8d2;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.video-list video {
  width: 100%;
  max-height: 420px;
  background: #000;
  border-radius: 12px;
}

.client-video-grid {
  display: grid;
  gap: 12px;
}

.client-video-grid h3 {
  margin: 0;
}

.client-video-item {
  display: grid;
  gap: 6px;
}

.client-video-item a {
  color: #111;
  font-size: 12px;
  font-weight: 850;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.case-file-buttons h3,
.case-upload-panel h3,
.approval-panel h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 800;
}

.case-detail .case-file-buttons {
  display: grid;
  gap: 12px;
}

.case-file-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.file-preview {
  display: grid;
  min-height: 120px;
  margin-top: 12px;
  overflow: hidden;
  background:
    linear-gradient(var(--soft), var(--soft)) padding-box,
    repeating-linear-gradient(135deg, #eef1f5 0 10px, #f8fafc 10px 20px) border-box;
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.file-preview div {
  display: grid;
  place-items: center;
  min-height: 118px;
  color: var(--faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.file-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  color: #000;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.file-pill.active {
  color: #fff;
  background: #000;
  border-color: #000;
}

.file-pill.disabled {
  color: #9aa3af;
  background: #f5f6f7;
}

.file-pill.empty {
  color: #9aa3af;
  background: #f5f6f7;
  border-color: #e0e4ea;
}

.file-pill.locked {
  color: #2f3946;
  background: #fff;
  border-style: dashed;
  border-color: #9aa3af;
}

/* Subida por categoria en la orden expandida (dueño/admin): pills fantasma, minimas.
   Reposan discretas (borde punteado, gris) y toman el negro del sistema al hover. */
.case-upload-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.case-upload-caption {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9aa3af;
  margin-right: 2px;
}

.upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 0 10px;
  color: #2f3946;
  background: transparent;
  border: 1px dashed #c3c9d2;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.upload-pill:hover {
  color: #fff;
  background: #000;
  border-color: #000;
  border-style: solid;
}

.upload-pill svg {
  flex: none;
}

.case-upload-status {
  font-size: 11px;
  color: #6b7480;
}

/* Gestor de archivos (admin): overlay con zonas por categoria, drop directo y borrar. */
.fm-open {
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #2f3946;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  vertical-align: middle;
}

.fm-open:hover {
  color: #fff;
  background: #000;
  border-color: #000;
}

.fm-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 14, 20, 0.55);
}

.fm-panel {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.fm-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.fm-head h3 {
  margin: 0;
  font-size: 16px;
}

.fm-head small {
  color: #6b7480;
  font-size: 11px;
}

.fm-status {
  margin-left: auto;
  font-size: 11px;
  color: #6b7480;
  white-space: nowrap;
  padding-top: 4px;
}

.fm-close {
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.fm-close:hover {
  background: #000;
  color: #fff;
  border-color: #000;
}

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

.fm-zone {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
}

.fm-zone.drag {
  border: 2px dashed #000;
  background: #f0f2f5;
}

.fm-zone-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.fm-zone-head span {
  font-size: 11px;
  color: #9aa3af;
  font-weight: 800;
}

.fm-files {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fm-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: #fff;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  font-size: 12px;
}

.fm-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0b4f9c;
  text-decoration: none;
  font-weight: 700;
}

.fm-file-name:hover {
  text-decoration: underline;
}

.fm-file-meta {
  flex: none;
  font-size: 10px;
  color: #9aa3af;
}

.fm-delete {
  flex: none;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #9aa3af;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.fm-delete:hover {
  background: #e5484d;
  color: #fff;
}

.fm-drop {
  border: 1px dashed #c3c9d2;
  border-radius: 8px;
  background: transparent;
  color: #6b7480;
  font-size: 11px;
  font-weight: 700;
  padding: 10px 8px;
  cursor: pointer;
}

.fm-drop:hover {
  border-color: #000;
  color: #000;
}

.fm-loading {
  color: #6b7480;
  font-size: 12px;
}

.file-pill.label-pill {
  color: #0b4f9c;
  background: #eef4fd;
  border-color: #c4d8f5;
  cursor: pointer;
}

.file-pill.label-pill:hover {
  color: #fff;
  background: #0b4f9c;
  border-color: #0b4f9c;
}

.case-list-phone {
  color: #5f6368;
  font-weight: 700;
}

body.privacy-mode .case-list-phone {
  color: #9aa3af;
}

.detail-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.detail-contact div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  background: #f5f6f7;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.detail-contact span {
  color: #7a828c;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.detail-contact strong {
  color: #14181f;
  font-size: 14px;
  font-weight: 800;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
}

.detail-entry {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.approval-panel {
  display: grid;
  gap: 10px;
}

.admin-payment-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border-color: #f59e0b;
  background: #fffbeb;
}

.admin-payment-panel span {
  display: block;
  color: #92400e;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.admin-payment-panel p {
  margin-top: 4px;
}

.admin-payment-panel .form-status {
  grid-column: 1 / -1;
}

.video-empty {
  min-height: 94px;
}

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

.provider-list {
  display: grid;
  gap: 14px;
}

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

.provider-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.provider-group h3 {
  margin: 0;
  font-size: 18px;
}

.provider-group header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.provider-group header span {
  min-width: 26px;
  min-height: 24px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #111;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.provider-empty {
  min-height: 48px;
  display: grid;
  align-items: center;
  padding: 10px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 800;
}

.provider-row {
  display: grid;
  grid-template-columns: 92px minmax(170px, 1.35fr) minmax(84px, 0.65fr) 118px minmax(104px, 0.85fr) 98px 92px minmax(126px, 0.8fr) 142px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--status-color, #111);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.provider-assign {
  min-height: 34px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.public-hero {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.public-hero span,
.admin-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.provider-order {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.provider-row strong,
.provider-color {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-row .status {
  width: fit-content;
  margin-top: 5px;
}

.provider-file-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.provider-file-pills .file-pill {
  min-height: 29px;
  max-width: 118px;
  padding: 0 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-color {
  color: #111;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.provider-margin {
  width: fit-content;
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 9px;
  color: #111;
  background: #eef2f7;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.provider-margin.red {
  background: #fff1f2;
  border-color: #fecdd3;
}

.provider-margin.yellow {
  background: #fffbeb;
  border-color: #fde68a;
}

.provider-margin.green {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.provider-file-check {
  width: fit-content;
  max-width: 112px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 9px;
  color: #111;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.provider-file-check.ready {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.provider-file-check.missing {
  background: #fff7ed;
  border-color: #fed7aa;
}

.provider-capture-check {
  width: fit-content;
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 7px 9px;
  color: #111;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

button.provider-capture-check {
  cursor: pointer;
}

.provider-capture-check.ready {
  background: #ecfdf5;
  border-color: #bbf7d0;
}

.provider-capture-check.partial {
  background: #fefce8;
  border-color: #fde68a;
}

.provider-capture-check.missing {
  background: #fff7ed;
  border-color: #fed7aa;
}

.provider-capture-panel {
  width: min(900px, 100%);
}

.provider-capture-head {
  padding: 28px 28px 12px;
}

.provider-capture-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.provider-capture-head h2 {
  margin: 4px 0;
  font-size: 24px;
}

.provider-capture-head p {
  margin: 0;
  color: var(--muted);
}

.provider-capture-viewer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px;
  gap: 14px;
  padding: 0 28px 28px;
}

.provider-capture-main {
  min-height: 360px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.provider-capture-main img {
  max-width: 100%;
  max-height: 58vh;
  object-fit: contain;
}

.provider-capture-main small {
  color: var(--muted);
  font-weight: 800;
}

.provider-capture-thumbs {
  display: grid;
  align-content: start;
  gap: 8px;
}

.provider-capture-thumbs button {
  min-height: 38px;
  padding: 8px 10px;
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 850;
  text-align: left;
}

.ready-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 7px;
  color: #111;
  font-size: 11px;
}

.ready-check input {
  width: 16px;
  min-height: 16px;
  accent-color: #111;
}

.archive-row {
  display: grid;
  grid-template-columns: 34px 92px minmax(150px, 1.1fr) minmax(180px, 1.4fr) 110px 84px 96px;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

/* Papelera: fila flexible (no la grilla fija del archivo) para acomodar las acciones. */
.archive-row.trash-row { display: flex; flex-wrap: wrap; align-items: center; }
.archive-row.trash-row strong { flex: 1 1 160px; min-width: 0; }
.trash-hint { color: var(--muted); font-size: 13px; margin: 4px 2px 10px; }
.trash-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.trash-danger { color: #b91c1c; border-color: #f0c4c4; }
.trash-danger:hover { background: #b91c1c; color: #fff; border-color: #b91c1c; }

.archive-row a {
  color: #6b7280;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.archive-row strong,
.archive-row span,
.archive-row small,
.archive-row time {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.archive-row small,
.archive-row time {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.icon-button {
  width: 30px;
  height: 30px;
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.request-panel {
  width: min(620px, 100%);
}

.price-panel {
  width: min(860px, 100%);
}

.price-content {
  display: grid;
  gap: 12px;
  clear: both;
}

.price-content > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.price-content h2 {
  margin: 0;
  font-size: 28px;
}

.price-content p {
  margin: 0;
  color: var(--muted);
}

.price-list-grid,
.credit-grid {
  display: grid;
  gap: 10px;
  align-items: stretch;
}

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

.price-section-title {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: #111;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.price-item,
.credit-pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 10px;
  padding: 10px 12px;
  color: #111;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.price-item,
.credit-pack {
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
}

.price-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.price-item-info strong {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.price-item > span,
.credit-pack > span {
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Fila de la tabla de unidades (no es enlace de compra): sin sombra, cursor normal. */
.credit-unit {
  cursor: default;
}

.credit-note {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  line-height: 1.4;
}

.price-item small,
.credit-pack small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.credit-pack strong,
.credit-pack span {
  font-weight: 800;
}

.gpt-content {
  max-width: 760px;
}

.gpt-steps {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.gpt-steps article,
.gpt-prompt-box,
.gpt-details {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.gpt-steps strong,
.gpt-prompt-box strong {
  color: #111;
  font-size: 13px;
  font-weight: 800;
}

.gpt-steps small,
.gpt-prompt-box p,
.gpt-details {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.gpt-steps code,
.gpt-details code {
  overflow: auto;
  padding: 8px;
  color: #111;
  background: #f6f7f8;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.gpt-steps .subtle-button,
.gpt-prompt-box .subtle-button {
  justify-self: start;
}

[data-copy].copied::after {
  content: " copiado";
}

.soon-card {
  max-width: 560px;
}

.app-version {
  margin: 34px 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
}

@media (max-width: 760px) {
  /* En celular la tarjeta apila en una sola columna: el estado (incluido el
     <select> de admin) ocupa todo el ancho y deja de recortarse a "lis...". */
  .case-top {
    grid-template-columns: minmax(0, 1fr);
  }
  .case-top .exit-box {
    justify-items: start;
    min-height: 0;
    margin-top: 4px;
    padding-top: 6px;
  }
  .case-top .admin-status-select,
  .case-top .status {
    width: 100%;
    max-width: 100%;
  }

  .admin-payment-panel {
    grid-template-columns: 1fr;
  }

  .admin-payment-panel .primary {
    width: 100%;
  }

  .app {
    grid-template-columns: 1fr;
  }
  .side {
    position: static;
    height: auto;
  }
  .side nav {
    grid-template-columns: repeat(3, 1fr);
  }
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .top-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .top-actions .top-menu-toggle {
    display: inline-flex;
  }
  .top-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 31;
    display: none;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    width: min(240px, calc(100vw - 44px));
    padding: 6px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16);
  }
  .top-menu.open {
    display: flex;
  }
  .top-menu .subtle-button {
    width: 100%;
    justify-content: flex-start;
  }
  .file-pill,
  .icon-button,
  .side nav button,
  .top-actions button,
  .top-actions a,
  .subtle-button,
  .primary {
    min-height: 44px;
  }
  .gpt-landing-card {
    grid-template-columns: 1fr;
    justify-items: start;
    text-align: left;
  }
  .gpt-landing-card .link-button,
  .gpt-landing-card .primary {
    width: 100%;
    text-align: center;
  }
  .growth-card {
    grid-template-columns: 1fr;
  }
  .growth-card .primary {
    width: 100%;
  }
  .archive-row {
    grid-template-columns: 32px 88px 1fr 88px;
  }
  .client-row {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .client-row a,
  .client-row span {
    grid-column: 1 / -1;
  }
  .client-view-head {
    grid-template-columns: 1fr;
  }
  .provider-summary {
    grid-template-columns: 1fr;
  }
  .provider-row {
    grid-template-columns: 1fr;
  }
  .provider-capture-viewer {
    grid-template-columns: 1fr;
  }
  .provider-capture-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .money-summary {
    grid-template-columns: 1fr;
  }
  .client-directory-head {
    grid-template-columns: 1fr;
  }
  .client-row {
    grid-template-columns: 1fr;
  }
  .money-row {
    grid-template-columns: 32px 86px minmax(0, 1fr);
  }
  .search-row {
    align-items: stretch;
    flex-direction: column;
  }
  .active-view-toggle {
    width: fit-content;
  }
  .case-list-row {
    min-width: 0;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
    padding: 14px 16px;
  }
  .case-list-head {
    display: none;
  }
  .case-list-row > * {
    grid-column: 1;
  }
  .case-list-row .product-chip,
  .case-list-row .status,
  .case-list-payment,
  .case-list-date {
    grid-column: 1;
  }
  .case-list-date,
  .case-list-files {
    justify-content: flex-start;
    text-align: left;
  }
  .case-list-files {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .pending-row {
    grid-template-columns: 32px 86px minmax(0, 1fr);
    align-items: start;
  }
  .pending-row .status,
  .pending-reasons,
  .pending-row small,
  .pending-row time {
    grid-column: 3;
  }
  .money-row small,
  .money-row .status,
  .money-row .money-payment,
  .money-row time {
    display: none;
  }
  .money-due {
    grid-column: 2 / -1;
    text-align: left;
  }
  .case-upload-row {
    grid-template-columns: 1fr;
  }
  .admin-upload-layout {
    grid-template-columns: 1fr;
  }
  .admin-upload-panel {
    position: static;
  }
  .admin-upload-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .price-list-grid {
    grid-template-columns: 1fr;
  }
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  .modal {
    padding: 14px;
  }
  .case-detail section,
  .case-detail .detail-head {
    padding: 16px;
  }
  .case-detail-cols {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .case-meta {
    grid-template-columns: 1fr;
  }
  .archive-row span,
  .archive-row small,
  .archive-row time {
    display: none;
  }
}

/* ===== Movil angosto (<480px): que los pop-ups no se desborden ===== */
/* request-panel (620), price-panel (860) y modal-panel (700) traian anchos fijos
   sin tope para pantallas chicas y se salian del viewport. Aqui los limitamos al
   ancho disponible y dejamos scroll vertical interno. No toca el caseModal (1080),
   que ya cae al ancho del viewport via min(...). */
@media (max-width: 480px) {
  .modal {
    padding: 12px;
  }
  .modal-panel,
  .request-panel,
  .price-panel {
    width: min(100% - 24px, 100%);
    max-width: 100%;
    max-height: 92vh;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 14px;
  }
  .order-form {
    padding: 0 16px 18px;
  }
  .request-panel .order-form,
  .price-panel .price-content {
    padding-left: 16px;
    padding-right: 16px;
  }
  .order-form h2,
  .price-content h2 {
    word-break: break-word;
  }
  /* En angosto el control de archivos apila boton sobre nombre para no recortarse. */
  .file-field-control {
    flex-wrap: wrap;
  }
  .file-field-name {
    flex-basis: 100%;
  }
}

/* ===== Home accionable: hero, ofertas, oferta de servicio ===== */
.news-hero {
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px solid #111;
  background: linear-gradient(180deg, #ffffff 0%, #f6f8fb 100%);
  box-shadow: 0 18px 44px rgba(17, 17, 17, 0.08);
}
.news-hero span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.news-hero h1 {
  margin: 0;
  max-width: 720px;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.12;
}
.news-hero p {
  margin: 0;
  max-width: 680px;
  color: #475467;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.hero-ctas .hero-blog-link {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.offer-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: #fff;
  border: 1px solid #111;
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.08);
}
.offer-card--promo {
  border-color: #128c4a;
  border-left-width: 6px;
}
.offer-badge {
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--accent-editorial);
  color: var(--accent-editorial-ink);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.offer-badge--promo {
  background: #ecfdf3;
  color: #0f5132;
  border: 1px solid #128c4a;
}
.offer-card h3 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 800;
}
.offer-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.offer-price strong {
  font-size: 26px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.offer-was {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: line-through;
}
.offer-card p {
  margin: 0;
  color: #475467;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}
.offer-cta {
  margin-top: 6px;
  width: fit-content;
}

.offering-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}
.offering-card {
  display: grid;
  gap: 6px;
  padding: 20px;
}
.offering-card span {
  color: #0f5132;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.offering-card h3 {
  margin: 2px 0 0;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}
.offering-card p {
  margin: 0;
  color: #475467;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.news-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.news-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}
.news-head-actions {
  display: flex;
  gap: 8px;
}
.news-head-actions a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* Badge top seller / promo en el modal de maquila */
.price-item--top {
  border: 1px solid #111 !important;
  box-shadow: 0 8px 18px rgba(17, 17, 17, 0.08);
}
.price-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.price-tag--promo {
  background: #ecfdf3;
  color: #0f5132;
  border: 1px solid #128c4a;
}
.price-promo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #128c4a;
  border-left-width: 6px;
  border-radius: 12px;
  background: #f6fef8;
}
.price-promo strong {
  font-size: 15px;
  font-weight: 800;
}
.price-promo span {
  font-size: 18px;
  font-weight: 900;
}
.price-promo span s {
  margin-left: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.price-promo small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 760px) {
  .news-hero {
    padding: 20px;
  }
  .news-hero h1 {
    font-size: 24px;
  }
  .hero-ctas .primary,
  .hero-ctas .subtle-button {
    flex: 1 1 auto;
    min-height: 44px;
  }
  .offer-grid,
  .offering-grid {
    grid-template-columns: 1fr;
  }
}

/* Barra de notificaciones (banner superior no intrusivo) */
.notif-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12);
  font-size: 14px;
}

.notif-bar.hidden {
  display: none;
}

.notif-bar-tag {
  flex: 0 0 auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.notif-bar-link {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notif-bar-link:hover {
  text-decoration: underline;
}

.notif-bar-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.notif-bar-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* Tarjeta de noticia que enlaza al blog */
a.news-card--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

a.news-card--link:hover {
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.12);
  transform: translateY(-2px);
}

.news-card .news-card-cta {
  display: inline-block;
  margin-top: 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

/* Carta de presentación del Laboratorio (Fase 1 MVP): identidad + contacto + mapa + precios. */
.carta {
  padding: 20px;
}

.carta-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.carta-logo {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.carta-logo-initial {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: #000;
  font-size: 24px;
  font-weight: 900;
}

.carta-id {
  flex: 1;
  min-width: 0;
}

.carta-eyebrow {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.carta-id h2 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.carta-id small {
  color: var(--muted);
  font-size: 12px;
}

.carta-edit {
  flex: none;
  align-self: flex-start;
}

.carta-head-actions {
  flex: none;
  align-self: flex-start;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.carta-enviar {
  text-decoration: none;
  color: #fff;
  background: #000;
  border-color: #000;
}

.carta-enviar:hover {
  opacity: 0.85;
}

.carta-bio {
  margin: 14px 0 0;
  color: #333;
  font-size: 13px;
  line-height: 1.5;
}

.carta-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

@media (max-width: 720px) {
  .carta-body { grid-template-columns: 1fr; }
}

.carta-share {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
}
@media (max-width: 720px) {
  .carta-share { grid-template-columns: 1fr; }
}
.carta-share-block { display: grid; gap: 6px; align-content: start; }
.carta-share-label {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.carta-copy { display: flex; gap: 6px; }
.carta-copy input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 9px;
  font-size: 13px;
  background: var(--surface, #fff);
  color: inherit;
}
.carta-copy .subtle-button, .carta-copy .primary { white-space: nowrap; flex: 0 0 auto; }
.carta-share-hint { font-size: 11px; color: var(--muted); margin: 0; }
.carta-share-hint code { font-size: 11px; word-break: break-all; }

.carta-contact {
  display: grid;
  gap: 8px;
  align-content: start;
}

.carta-contact-row {
  display: grid;
  gap: 1px;
}

.carta-contact-row span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.carta-contact-row strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.carta-map {
  min-height: 180px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.carta-map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  border: 0;
}

.carta-prices {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.carta-prices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.carta-prices-head h3 {
  margin: 0;
  font-size: 15px;
}

.carta-prices-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.carta-price-group h4 {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.carta-price-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.carta-price-group li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.carta-price-group li span {
  overflow-wrap: anywhere;
}

.carta-price-group li strong {
  flex: none;
  font-variant-numeric: tabular-nums;
}

.carta-empty {
  color: var(--muted);
  font-size: 12px;
}

/* Doble pestaña del perfil: separa la carta del laboratorio ("Laboratorio") del perfil personal
   ("Mi perfil"). Hijos directos de .content (grid gap 16px). */
.perfil-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.perfil-tab {
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.perfil-tab:hover {
  color: #000;
}

.perfil-tab.active {
  color: #000;
  border-bottom-color: #000;
}

.perfil-tab-panel {
  display: grid;
  gap: 16px;
}

/* Perfil: "hoja de vida" de la cuenta (dashboard de un vistazo). */
.perfil-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.perfil-head span {
  color: #6b7280;
  font-size: 13px;
}
.perfil-head h2 {
  margin: 2px 0 4px;
}
.perfil-head small {
  color: #6b7280;
}
.perfil-head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.perfil-add-provider { padding: 9px 14px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.perfil-summary {
  margin-top: 16px;
}
.perfil-recent {
  margin-top: 20px;
}
.perfil-case-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.perfil-case-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.perfil-case-row:hover {
  border-color: var(--accent-editorial-ink);
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08);
}
.perfil-case-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.perfil-case-main strong {
  font-size: 14px;
}
.perfil-case-main span {
  color: #4b5563;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.perfil-case-updated {
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
}
/* "Para hoy": chip con la razón por la que CORE subió el caso (ámbar = pide acción/urge). */
.perfil-priority-note {
  color: #6b7280;
  font-size: 13px;
  margin: 4px 0 10px;
}
.perfil-priority-reason {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}
.perfil-priority-reason.is-urgent {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

/* Enviar maquila: intake mínimo (un solo cuadro). */
.maquila-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 4px 0 12px;
}
.maquila-product {
  display: block;
  position: relative;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.maquila-product input {
  position: absolute;
  top: 10px;
  right: 10px;
}
.maquila-product:hover {
  border-color: #cbd5e1;
}
.maquila-product:has(input:checked) {
  border-color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}
.maquila-product-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.maquila-product-body strong {
  font-size: 14px;
}
.maquila-product-body small {
  color: #6b7280;
  font-size: 12px;
}
.maquila-note {
  color: #b45309;
  font-size: 13px;
  font-weight: 600;
  margin: 4px 0 8px;
}

/* Comprobantes de pago (Finanzas > Comprobantes + bloque en la ficha del caso) */
.proof-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
.proof-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.proof-group-head strong {
  display: block;
  font-size: 15px;
  color: var(--ink);
}
.proof-group-head span {
  display: block;
  color: #475467;
  font-size: 13px;
}
.proof-group-head small {
  display: block;
  color: #667085;
  font-size: 12px;
}
.proof-group-totals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.proof-case-total {
  font-weight: 900;
  color: #1e3a8a;
}
.proof-pending-count {
  background: #fef3c7;
  color: #b45309;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
}
.proof-case-due {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}
.proof-table td.proof-files {
  max-width: 220px;
}
.proof-file {
  display: inline-block;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 6px;
  padding: 1px 8px;
  margin: 1px 2px;
  font-size: 12px;
  word-break: break-all;
}
.proof-file.muted { background: transparent; color: #98a2b3; }
.proof-status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
}
.proof-status-pill.pending { background: #fef3c7; color: #b45309; }
.proof-status-pill.verified { background: #dcfce7; color: #166534; }
.proof-actions { white-space: nowrap; }

/* Bloque de comprobantes dentro de la ficha del caso */
.case-proof-block .case-proof-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-proof-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.case-proof-block label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #475467;
}
.case-proof-block input,
.case-proof-block select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
}
.case-proof-list {
  margin-top: 10px;
}
.case-proof-empty {
  font-size: 13px;
  margin: 6px 0 0;
}

/* Control de costos: historial de pagos/cargos del caso (ledger) + alta rapida de abono */
.case-money-list {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.money-event {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}
.money-event-kind {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 1px 8px;
  background: #eef2f6;
  color: #475467;
}
.money-event.is-payment .money-event-kind { background: #dcfce7; color: #166534; }
.money-event.is-charge .money-event-kind { background: #fee2e2; color: #b42318; }
.money-event.is-adjustment .money-event-kind { background: #fef3c7; color: #b45309; }
.money-event-meta { color: var(--faint); }
.money-event-note {
  flex-basis: 100%;
  color: var(--faint);
  font-size: 12px;
}
.case-money-empty {
  font-size: 13px;
  margin: 6px 0 10px;
}
.case-money-block .case-payment-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.case-payment-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
.case-money-block label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #475467;
}
.case-money-block input {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
}
/* "Debe" en rojo solo con saldo real (lo pinta dueDangerClass) */
.case-list-payment small.danger { color: #d92d20; font-weight: 700; }
