/* Ajustes operativos de la vista móvil. */
body::before { opacity: .32; }
.topbar { background: rgba(255, 255, 255, .84); }
.collection-hero { padding: 18px 19px; background: linear-gradient(145deg, rgba(18, 108, 100, .84), rgba(11, 80, 75, .78)); }
.collection-hero > strong { margin: 2px 0; font-size: clamp(29px, 7vw, 39px); }
.collection-hero-footer { margin-top: 13px; padding-top: 10px; }
.collection-hero.collection-hero-pay { background: linear-gradient(145deg, rgba(162, 60, 60, .9), rgba(120, 38, 38, .84)); }
.collection-hero-pay > span,
.collection-hero-pay p,
.collection-hero-pay .collection-hero-footer { color: #ffe7e7; }
.collection-panel { background: rgba(255, 255, 255, .84); }
.collection-summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 12px; padding: 12px 8px; border-radius: 16px; background: linear-gradient(145deg, rgba(18, 108, 100, .9), rgba(11, 80, 75, .84)); color: #cce9e5; box-shadow: var(--shadow); }
.collection-summary-strip span { display: grid; gap: 1px; place-items: center; min-width: 0; padding: 0 5px; text-align: center; font-size: 11px; font-weight: 700; }
.collection-summary-strip span + span { border-left: 1px solid rgba(255, 255, 255, .2); }
.collection-summary-strip strong { color: #fff; font-size: 19px; line-height: 1.05; }
.collection-summary-strip .summary-pay { color: #ffd5d5; }
.collection-summary-income { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: -3px 0 12px; }
.collection-summary-income span { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .76); color: var(--muted); font-size: 11px; font-weight: 700; }
.collection-summary-income strong { color: var(--ink); font-size: 16px; letter-spacing: -.02em; }
.collection-summary-income .summary-net { border-color: rgba(18, 108, 100, .34); background: rgba(232, 244, 241, .9); }
.mobile-nav a.mobile-collect { color: var(--primary); }
.mobile-nav a.mobile-pay,
.mobile-nav a.mobile-pay.active { color: var(--danger); }
.mobile-nav a.mobile-collect.active,
.mobile-nav a.mobile-pay.active { font-weight: 800; }
.collection-state-completed { background: rgba(229, 243, 235, .58); }
.collection-state-pay_aup { background: rgba(255, 240, 240, .62); }

.collection-item { padding-right: 16px; }
.collection-item-action { display: flex; align-items: center; gap: 8px; flex: none; }
.collection-item-action form { margin: 0; }
.collection-item-open { display: grid; place-items: center; width: 28px; height: 32px; color: var(--primary); font-size: 28px; line-height: 1; }
.collection-complete { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #dff3e6; color: #247144; font-weight: 850; }
.collection-state-completed { background: rgba(229, 243, 235, .72); }
.collection-state-completed .collection-item-amount strong { color: #247144; }
.collection-state-pay_aup { background: rgba(255, 240, 240, .78); }
.collection-state-pay_aup .collection-item-amount strong { color: var(--danger); }
.collection-state-pending .collection-item-amount strong { color: var(--primary); }
.collection-quick-menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 13px 0 0; }
.collection-quick-menu a { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: center; min-height: 66px; padding: 12px 15px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .92); box-shadow: var(--shadow); color: var(--primary); }
.collection-quick-menu span { font-size: 13px; font-weight: 800; }
.collection-quick-menu strong { grid-row: span 2; grid-column: 2; font-size: 26px; letter-spacing: -.04em; }
.collection-quick-menu small { color: var(--muted); font-size: 11px; }
.collection-quick-menu a.active { border-color: var(--primary); background: var(--soft); }
.collection-quick-menu .pay-menu { color: var(--danger); }
.collection-quick-menu .pay-menu.active { border-color: var(--danger); background: #fff2f2; }
.aup-mini-tag { display: inline-flex; align-items: center; width: fit-content; margin-top: 5px; padding: 3px 7px; border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.aup-mini-tag-incoming { background: #e2f5e8; color: #247144; }
.aup-mini-tag-outgoing { background: #fff0f0; color: var(--danger); }
.quick-amount-field { position: relative; margin-top: 20px; }
.quick-amount-field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.quick-amount-field span { position: absolute; left: 14px; bottom: 12px; color: var(--primary); font-size: 20px; font-weight: 800; }
.quick-amount-field input { width: 100%; min-height: 52px; padding: 10px 14px 10px 32px; border: 1px solid #bfd0cf; border-radius: 13px; font-size: 21px; font-weight: 750; }

/* Los radios dentro del modal no deben heredar el ancho de los campos de texto. */
.wizard-aup-direction input[type="radio"] { width: 18px !important; min-height: 18px !important; height: 18px; margin: 0; padding: 0 !important; flex: none; }
.wizard-aup-direction label { min-height: 48px; }
.wizard-add-new { margin-top: 10px; }
.wizard-add-new summary { width: fit-content; color: var(--primary); font-size: 13px; font-weight: 750; cursor: pointer; list-style: none; }
.wizard-add-new summary::-webkit-details-marker { display: none; }
.wizard-add-new summary::before { content: "+ "; }
.wizard-add-new[open] summary::before { content: "− "; }
.wizard-new-field { margin-top: 9px; }
.wizard-new-field input { width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid #bfd0cf; border-radius: 12px; background: #fff; font-size: 16px; }
.wizard-new-field input:focus { outline: 3px solid #d8efeb; border-color: var(--primary); }
.wizard-question { min-height: 0; padding-bottom: 24px; }
.wizard-load-track { height: 5px; margin: 0 0 12px; background: rgba(18, 108, 100, .14); }
.wizard-load-track span { width: 16.6667%; transition: width .22s ease; }

.wizard-field { width: 100%; min-width: 0; overflow: hidden; }
.wizard-field input,
.wizard-field select { display: block; width: 100% !important; max-width: 100%; min-width: 0; box-sizing: border-box; }
.wizard-field input[type="date"] { appearance: none; -webkit-appearance: none; }

@media (max-width: 800px) {
  body::before { background-size: 118vw auto; background-position: center center; opacity: .28; }
  .mobile-nav { background: rgba(255, 255, 255, .84); backdrop-filter: blur(8px); }
  .mobile-nav { justify-content: space-evenly; }
  .mobile-nav a { width: 33.333%; }
  .mobile-nav .mobile-create span { width: 42px; height: 42px; margin-top: -20px; font-size: 25px; }
  .collection-hero { padding: 16px 17px; border-radius: 16px; }
  .collection-panel { background: rgba(255, 255, 255, .9); }
  .collection-panel-summary .collection-item { padding-top: 11px; padding-bottom: 11px; }
  .collection-panel-summary .collection-item-main small { display: block; font-size: 10px; }
  .collection-panel-summary { margin-top: 10px; }
  .collection-panel-summary .collection-panel-heading { padding-top: 13px; padding-bottom: 8px; }
  .collection-panel-summary .collection-item { gap: 8px 10px; padding-top: 8px; padding-bottom: 8px; }
  .collection-panel-summary .collection-item-label { font-size: 11px; }
  .collection-panel-summary .collection-item-main strong { font-size: 14px; }
  .collection-panel-summary .collection-item-amount strong { font-size: 14px; }
  .collection-panel-summary .collection-item-amount small { font-size: 11px; }
  .collection-panel-summary .aup-mini-tag { margin-top: 2px; font-size: 10px; }
  .collection-summary-strip { margin-top: -8px; margin-bottom: 8px; padding: 11px 5px; }
  .collection-summary-strip strong { font-size: 18px; }
  .collection-summary-income { margin-top: -1px; margin-bottom: 8px; gap: 8px; }
  .collection-summary-income { grid-template-columns: 1fr 1fr; }
  .collection-summary-income span { padding: 9px 10px; }
  .collection-summary-income strong { font-size: 14px; }
  .collection-item { 
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "main main"
      "amount actions";
    gap: 11px 12px;
    align-items: end;
    padding: 16px 15px;
  }
  .collection-quick-menu { margin-top: 11px; }
  .wizard-question { min-height: 0; }
  .collection-item-main { grid-area: main; width: 100%; }
  .collection-item-main strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.25;
  }
  .collection-item-main small { white-space: normal; }
  .collection-item-amount { grid-area: amount; min-width: 0; text-align: left; }
  .collection-item-action { grid-area: actions; justify-self: end; gap: 4px; }
  .collection-item-action .button { padding: 8px 10px; }
  .collection-item-open { width: 22px; font-size: 24px; }
  .collection-complete { width: 28px; height: 28px; }
}

.load-more { display: grid; place-items: center; gap: 6px; margin: 16px 0; }
.load-more small { color: var(--muted); }
.detail-complete-label { display: inline-flex; align-items: center; color: #fff; font-weight: 800; }

@media (max-width: 800px) {
  .collection-heading { margin-bottom: 12px; }
  .collection-heading .muted { margin-top: 2px; }
  .collection-hero { padding: 14px 16px; }
  .collection-hero > strong { font-size: 32px; }
  .collection-hero-footer { margin-top: 10px; padding-top: 8px; }
  .wizard-question { min-height: 0; }
  .empty-state { padding: 34px 18px; }
  .panel, .form-card, .simple-details, .simple-detail-section { background: rgba(255, 255, 255, .92); }

  .mobile-card-table { overflow: visible; }
  .mobile-card-table table,
  .mobile-card-table tbody,
  .mobile-card-table tr,
  .mobile-card-table td { display: block; width: 100%; min-width: 0; white-space: normal; }
  .mobile-card-table thead { display: none; }
  .mobile-card-table tbody { padding: 0 14px 14px; }
  .mobile-card-table tr { margin-top: 12px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .95); }
  .mobile-card-table td { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 5px 0; border: 0; text-align: left; }
  .mobile-card-table td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
  .mobile-card-table td.card-action { display: flex; justify-content: flex-end; padding-top: 10px; border-top: 1px solid #edf0f1; margin-top: 5px; }
  .mobile-card-table td.card-action::before { display: none; }
}

@media (max-width: 360px) {
  .topbar { padding: 0 11px; gap: 8px; }
  .brand { gap: 7px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 14px; }
  .session-actions { gap: 8px; }
  .session-actions .text-button, .top-summary-link { font-size: 12px; }
}

/* Dashboard: jerarquía tipográfica y densidad inspiradas en productos de datos. */
.dashboard-page {
  --dashboard-surface: rgba(255, 255, 255, .88);
  --dashboard-soft: rgba(247, 250, 249, .82);
  --dashboard-rule: rgba(23, 35, 43, .09);
}
.dashboard-page .collection-heading {
  align-items: flex-start;
  margin: 3px 0 24px;
}
.dashboard-page .collection-heading .eyebrow {
  margin-bottom: 7px;
  color: #52716e;
  font-size: 10px;
  letter-spacing: .14em;
}
.dashboard-page .collection-heading h1 {
  margin-bottom: 5px;
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.02;
}
.dashboard-page .collection-heading .muted {
  color: #738087;
  font-size: 14px;
}
.dashboard-page .collection-summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 12px;
  padding: 0 0 17px;
  border-bottom: 1px solid var(--dashboard-rule);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}
.dashboard-page .collection-summary-strip span {
  place-items: start;
  gap: 4px;
  padding: 0 18px;
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  font-weight: 650;
}
.dashboard-page .collection-summary-strip span:first-child { padding-left: 0; }
.dashboard-page .collection-summary-strip span + span { border-left: 1px solid var(--dashboard-rule); }
.dashboard-page .collection-summary-strip strong {
  color: var(--ink);
  font-size: 27px;
  font-weight: 760;
  letter-spacing: -.035em;
}
.dashboard-page .collection-summary-strip .summary-collect strong { color: var(--primary); }
.dashboard-page .collection-summary-strip .summary-pay strong { color: var(--danger); }
.dashboard-page .dashboard-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 24px;
}
.dashboard-page .dashboard-metrics .metric-card {
  min-width: 0;
  padding: 17px 18px;
  border: 0;
  border-radius: 13px;
  background: var(--dashboard-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .08), 0 8px 24px rgba(22, 39, 45, .035);
}
.dashboard-page .dashboard-metrics .metric-card span {
  color: #748087;
  font-size: 11px;
  font-weight: 650;
}
.dashboard-page .dashboard-metrics .metric-card strong {
  display: block;
  overflow: hidden;
  margin: 6px 0 0;
  color: var(--ink);
  font-size: clamp(18px, 2.3vw, 25px);
  font-weight: 760;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-page .dashboard-metrics .metric-card.accent {
  background: rgba(224, 241, 237, .9);
  color: var(--ink);
}
.dashboard-page .dashboard-metrics .metric-card.accent span { color: #52716e; }
.dashboard-page .dashboard-metrics .metric-card.accent strong { color: var(--primary-dark); }
.dashboard-page .collection-hero {
  position: relative;
  overflow: hidden;
  padding: 20px 22px;
  border: 0;
  border-left: 3px solid var(--primary);
  border-radius: 13px;
  background: var(--dashboard-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .07);
  color: var(--ink);
}
.dashboard-page .collection-hero > span {
  color: #61716f;
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.dashboard-page .collection-hero > strong {
  margin: 3px 0;
  color: var(--primary);
  font-size: 38px;
  font-weight: 760;
}
.dashboard-page .collection-hero p { color: var(--muted); font-size: 13px; }
.dashboard-page .collection-hero-footer {
  margin-top: 14px;
  padding-top: 11px;
  border-color: var(--dashboard-rule);
  color: var(--muted);
}
.dashboard-page .collection-hero-footer a { color: var(--primary); }
.dashboard-page .collection-hero.collection-hero-pay {
  border-left-color: var(--danger);
  background: rgba(255, 249, 249, .9);
}
.dashboard-page .collection-hero-pay > span,
.dashboard-page .collection-hero-pay p,
.dashboard-page .collection-hero-pay .collection-hero-footer { color: var(--muted); }
.dashboard-page .collection-hero-pay > strong,
.dashboard-page .collection-hero-pay .collection-hero-footer a { color: var(--danger); }
.dashboard-page .collection-panel {
  margin-top: 16px;
  border: 0;
  border-radius: 15px;
  background: var(--dashboard-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .08), 0 10px 30px rgba(22, 39, 45, .035);
}
.dashboard-page .collection-panel-heading { padding: 19px 20px 10px; }
.dashboard-page .collection-panel-heading h2 {
  font-size: 19px;
  font-weight: 740;
  letter-spacing: -.025em;
}
.dashboard-page .collection-panel-heading p { color: #7a858b; font-size: 12px; }
.dashboard-page .collection-panel-heading .text-link { font-size: 12px; }
.dashboard-page .collection-search {
  gap: 8px;
  padding: 0 20px 14px;
  border-bottom: 0;
}
.dashboard-page .collection-search input {
  height: 40px;
  border-color: transparent;
  border-radius: 9px;
  background: rgba(240, 244, 243, .9);
  color: var(--ink);
}
.dashboard-page .collection-search input:focus {
  outline: 2px solid rgba(18, 108, 100, .18);
  border-color: rgba(18, 108, 100, .45);
  background: #fff;
}
.dashboard-page .collection-search .button-secondary {
  border-color: transparent;
  background: rgba(240, 244, 243, .9);
  color: #45545b;
}
.dashboard-page .collection-list { border-top: 1px solid var(--dashboard-rule); }
.dashboard-page .collection-item {
  gap: 18px;
  padding: 15px 18px;
  border-bottom-color: var(--dashboard-rule);
  background: transparent;
}
.dashboard-page .collection-item:hover { background: rgba(245, 248, 247, .72); }
.dashboard-page .collection-state-completed,
.dashboard-page .collection-state-pay_aup { background: transparent; }
.dashboard-page .collection-item-label {
  color: #61716f;
  font-size: 11px;
  font-weight: 700;
}
.dashboard-page .collection-item-main strong {
  margin-top: 1px;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -.015em;
}
.dashboard-page .collection-item-main small { color: #7a858b; font-size: 12px; }
.dashboard-page .aup-mini-tag {
  margin-top: 6px;
  padding: 2px 7px;
  font-size: 9px;
  letter-spacing: .035em;
}
.dashboard-page .collection-item-amount strong {
  font-size: 16px;
  font-weight: 740;
  letter-spacing: -.025em;
}
.dashboard-page .collection-item-amount small { color: #7a858b; font-size: 11px; }
.dashboard-page .collection-item-action .button {
  min-width: 68px;
  border-radius: 8px;
  box-shadow: none;
}
.dashboard-page .collection-item-open { color: #879197; }
.dashboard-page .collection-complete {
  width: 27px;
  height: 27px;
  background: rgba(36, 113, 68, .1);
  font-size: 12px;
}
.dashboard-page .simple-empty { padding: 50px 20px; }
.dashboard-page .load-more { margin: 14px 0 0; }

@media (max-width: 800px) {
  .dashboard-page .collection-heading { margin: 0 0 18px; }
  .dashboard-page .collection-heading .eyebrow { margin-bottom: 4px; }
  .dashboard-page .collection-heading h1 { font-size: 32px; }
  .dashboard-page .collection-heading .muted { font-size: 13px; }
  .dashboard-page .collection-summary-strip { margin-top: 0; padding-bottom: 14px; }
  .dashboard-page .collection-summary-strip span { padding: 0 11px; font-size: 10px; }
  .dashboard-page .collection-summary-strip strong { font-size: 23px; }
  .dashboard-page .dashboard-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
  }
  .dashboard-page .dashboard-metrics .metric-card { padding: 13px 14px; }
  .dashboard-page .dashboard-metrics .metric-card strong { font-size: 18px; }
  .dashboard-page .collection-hero { padding: 16px 17px; }
  .dashboard-page .collection-hero > strong { font-size: 33px; }
  .dashboard-page .collection-panel { margin: 12px 0 0; border-radius: 14px; }
  .dashboard-page .collection-panel-heading { padding: 15px 15px 8px; }
  .dashboard-page .collection-search { padding: 0 15px 12px; }
  .dashboard-page .collection-search input { font-size: 13px; }
  .dashboard-page .collection-item {
    gap: 8px 12px;
    padding: 13px 15px;
  }
  .dashboard-page .collection-panel-summary .collection-item { padding-top: 11px; padding-bottom: 11px; }
  .dashboard-page .collection-panel-summary .collection-item-main strong { font-size: 14px; }
  .dashboard-page .collection-panel-summary .collection-item-main small { font-size: 10px; }
  .dashboard-page .collection-item-action .button { min-width: 62px; }
}

@media (max-width: 380px) {
  .dashboard-page .collection-summary-strip span { padding: 0 8px; }
  .dashboard-page .collection-summary-strip strong { font-size: 21px; }
  .dashboard-page .dashboard-metrics .metric-card { padding: 12px; }
  .dashboard-page .dashboard-metrics .metric-card strong { font-size: 16px; }
  .dashboard-page .collection-search { flex-wrap: wrap; }
  .dashboard-page .collection-search input { flex-basis: calc(100% - 76px); }
}

/* Nueva cirugía: Wizard, ProgressBar, FormField, InlineCreateField y FormActions. */
dialog.wizard-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  border-radius: 18px;
  background: rgba(251, 252, 252, .98);
  box-shadow: 0 24px 70px rgba(19, 34, 39, .24);
}
dialog.wizard-dialog::backdrop {
  background: rgba(22, 35, 40, .48);
  backdrop-filter: blur(4px);
}
dialog.wizard-dialog .wizard-dialog-close {
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: rgba(232, 237, 236, .9);
  color: #435158;
  font-size: 21px;
}
.surgery-wizard {
  padding: 23px 24px 20px;
}
.surgery-wizard .wizard-progress {
  margin: 0 42px 9px 0;
  color: #67757c;
  font-size: 11px;
  font-weight: 680;
  letter-spacing: .01em;
}
.surgery-wizard .wizard-progress small {
  color: #929ca1;
  font-size: 10px;
  font-weight: 600;
}
.surgery-wizard .wizard-load-track {
  height: 3px;
  margin: 0 0 24px;
  border-radius: 99px;
  background: rgba(18, 108, 100, .11);
}
.surgery-wizard .wizard-load-track span {
  border-radius: inherit;
  background: var(--primary);
  transition: width .22s ease;
}
.surgery-wizard .wizard-question {
  min-height: 0;
  padding: 0 0 28px;
}
.surgery-wizard .wizard-question .eyebrow {
  margin-bottom: 7px;
  color: #52716e;
  font-size: 10px;
  letter-spacing: .14em;
}
.surgery-wizard .wizard-question h1 {
  max-width: 480px;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: clamp(29px, 5vw, 36px);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.06;
}
.surgery-wizard .wizard-question > .muted {
  max-width: 440px;
  color: #748087;
  font-size: 14px;
}
.surgery-wizard .wizard-field {
  margin-top: 22px;
  overflow: visible;
}
.surgery-wizard .wizard-field input,
.surgery-wizard .wizard-field select,
.surgery-wizard .wizard-new-field input {
  min-height: 52px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(238, 243, 242, .92);
  color: var(--ink);
  font-size: 16px;
  box-shadow: inset 0 0 0 1px rgba(23, 35, 43, .025);
}
.surgery-wizard .wizard-field input:hover,
.surgery-wizard .wizard-field select:hover,
.surgery-wizard .wizard-new-field input:hover {
  background: rgba(234, 240, 239, .96);
}
.surgery-wizard .wizard-field input:focus,
.surgery-wizard .wizard-field select:focus,
.surgery-wizard .wizard-new-field input:focus {
  outline: 2px solid rgba(18, 108, 100, .16);
  border-color: rgba(18, 108, 100, .45);
  background: #fff;
}
.surgery-wizard .wizard-field small {
  margin-top: 7px;
  color: #7d888e;
  font-size: 11px;
}
.surgery-wizard .wizard-add-new { margin-top: 12px; }
.surgery-wizard .wizard-add-new summary {
  color: #58726f;
  font-size: 12px;
  font-weight: 680;
}
.surgery-wizard .wizard-add-new summary:hover { color: var(--primary); }
.surgery-wizard .wizard-new-field { margin-top: 10px; }
.surgery-wizard .wizard-aup-toggle {
  gap: 16px;
  margin-top: 21px;
  padding: 15px 16px;
  border: 0;
  border-radius: 11px;
  background: rgba(235, 242, 241, .9);
}
.surgery-wizard .wizard-aup-toggle strong {
  color: #27363c;
  font-size: 14px;
  font-weight: 720;
}
.surgery-wizard .wizard-aup-toggle small {
  color: #748087;
  font-size: 11px;
}
.surgery-wizard .wizard-aup-toggle input {
  width: 21px;
  height: 21px;
}
.surgery-wizard .wizard-aup-direction {
  margin-top: 11px;
  padding: 14px;
  border-radius: 11px;
  background: rgba(242, 246, 245, .86);
}
.surgery-wizard .wizard-aup-direction p {
  margin-bottom: 9px;
  color: #536168;
  font-size: 12px;
  font-weight: 700;
}
.surgery-wizard .wizard-aup-direction ul { gap: 7px; }
.surgery-wizard .wizard-aup-direction label {
  min-height: 44px;
  padding: 11px 12px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, .95);
  color: #34434a;
  font-size: 13px;
  box-shadow: 0 1px 2px rgba(23, 35, 43, .05);
}
.surgery-wizard .field-error {
  margin-top: 6px;
  font-size: 11px;
}
.surgery-wizard .wizard-actions {
  padding-top: 14px;
  border-top-color: rgba(23, 35, 43, .08);
}
.surgery-wizard .wizard-actions .button {
  min-height: 42px;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: none;
}
.surgery-wizard .wizard-actions .button-secondary {
  border-color: transparent;
  background: rgba(236, 241, 240, .9);
  color: #4d5b62;
}
.wizard-page {
  max-width: 560px;
  margin-top: 0;
}
.wizard-page > .back-link {
  margin-bottom: 14px;
  color: #647279;
  font-size: 12px;
}
.wizard-page > .surgery-wizard {
  border: 0;
  border-radius: 16px;
  background: rgba(251, 252, 252, .94);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .08), 0 16px 45px rgba(22, 39, 45, .06);
}

@media (max-width: 800px) {
  dialog.wizard-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 16px;
  }
  dialog.wizard-dialog .wizard-dialog-close {
    top: 11px;
    right: 11px;
  }
  .surgery-wizard { padding: 19px 18px 16px; }
  .surgery-wizard .wizard-progress { margin-right: 38px; }
  .surgery-wizard .wizard-load-track { margin-bottom: 21px; }
  .surgery-wizard .wizard-question { padding-bottom: 24px; }
  .surgery-wizard .wizard-question h1 { font-size: 29px; }
  .surgery-wizard .wizard-question > .muted { font-size: 13px; }
  .surgery-wizard .wizard-field { margin-top: 19px; }
  .surgery-wizard .wizard-field input,
  .surgery-wizard .wizard-field select,
  .surgery-wizard .wizard-new-field input { min-height: 50px; }
  .surgery-wizard .wizard-actions .button { min-height: 43px; }
  .wizard-page { margin: 0; }
  .wizard-page > .surgery-wizard { border-radius: 14px; }
}

@media (max-width: 360px) {
  .surgery-wizard { padding: 17px 15px 14px; }
  .surgery-wizard .wizard-question h1 { font-size: 27px; }
  .surgery-wizard .wizard-actions { gap: 7px; }
  .surgery-wizard .wizard-actions .button { padding-inline: 12px; }
}

/* Detalle de cirugía: PageHeader, Metric, StatusBadge, Surface, ListItem y Dialog. */
.surgery-detail-page {
  --detail-surface: rgba(255, 255, 255, .9);
  --detail-soft: rgba(243, 247, 246, .88);
  --detail-rule: rgba(23, 35, 43, .09);
  max-width: 920px;
  margin: 0 auto;
}
.surgery-detail-page .simple-detail-heading { margin-bottom: 20px; }
.surgery-detail-page .simple-detail-heading .back-link {
  margin-bottom: 15px;
  color: #68767d;
  font-size: 12px;
}
.surgery-detail-page .simple-detail-title { gap: 22px; }
.surgery-detail-page .simple-detail-title .eyebrow {
  margin-bottom: 7px;
  color: #52716e;
  font-size: 10px;
  letter-spacing: .14em;
}
.surgery-detail-page .simple-detail-title h1 {
  margin-bottom: 5px;
  font-size: clamp(34px, 5vw, 44px);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.03;
}
.surgery-detail-page .simple-detail-title p:last-child {
  color: #748087;
  font-size: 14px;
}
.surgery-detail-page .status {
  padding: 5px 9px;
  border: 0;
  background: rgba(89, 105, 112, .1);
  color: #56646b;
  font-size: 10px;
  font-weight: 720;
  letter-spacing: .025em;
}
.surgery-detail-page .status-pagado { background: rgba(36, 113, 68, .1); color: #247144; }
.surgery-detail-page .status-parcial { background: rgba(139, 91, 22, .11); color: #8b5b16; }
.surgery-detail-page .collection-detail-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  padding: 20px 22px;
  border: 0;
  border-left: 3px solid var(--primary);
  border-radius: 13px;
  background: var(--detail-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .08), 0 9px 28px rgba(22, 39, 45, .035);
  color: var(--ink);
}
.surgery-detail-page .collection-detail-card > p {
  grid-column: 1;
  margin: 0;
  color: #718087;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.surgery-detail-page .collection-detail-card h2 {
  grid-column: 1;
  margin: 3px 0 0;
  color: #314047;
  font-size: 18px;
  font-weight: 730;
}
.surgery-detail-page .collection-detail-money {
  grid-column: 2;
  grid-row: 1 / 3;
  display: grid;
  justify-items: end;
  align-self: center;
  gap: 2px;
  min-width: 190px;
}
.surgery-detail-page .collection-detail-money span {
  color: #718087;
  font-size: 11px;
}
.surgery-detail-page .collection-detail-money strong {
  color: var(--primary);
  font-size: clamp(28px, 5vw, 38px);
  font-weight: 770;
}
.surgery-detail-page .collection-detail-actions {
  grid-column: 1 / -1;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px solid var(--detail-rule);
}
.surgery-detail-page .collection-detail-actions .button {
  min-height: 39px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  box-shadow: none;
}
.surgery-detail-page .collection-detail-actions .button-primary {
  background: var(--primary);
  color: #fff;
}
.surgery-detail-page .collection-detail-actions .button-secondary {
  border-color: transparent;
  background: rgba(236, 241, 240, .92);
  color: #4e5c63;
}
.surgery-detail-page .detail-complete-label {
  color: #247144;
  font-size: 12px;
  font-weight: 750;
}
.surgery-detail-page .detail-state-pay_aup {
  border-left-color: var(--danger);
  background: rgba(255, 250, 250, .92);
}
.surgery-detail-page .detail-state-pay_aup .collection-detail-money strong { color: var(--danger); }
.surgery-detail-page .detail-state-completed { border-left-color: #247144; }
.surgery-detail-page .compact-detail-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 10px 0;
}
.surgery-detail-page .compact-detail-metrics .metric-card {
  padding: 14px 16px;
  border: 0;
  border-radius: 11px;
  background: var(--detail-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .06);
}
.surgery-detail-page .compact-detail-metrics .metric-card span {
  color: #748087;
  font-size: 10px;
  font-weight: 650;
}
.surgery-detail-page .compact-detail-metrics .metric-card strong {
  display: block;
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.03em;
}
.surgery-detail-page .compact-detail-metrics .metric-card.accent {
  background: rgba(225, 241, 237, .92);
}
.surgery-detail-page .compact-detail-metrics .metric-card.accent span { color: #59726f; }
.surgery-detail-page .compact-detail-metrics .metric-card.accent strong { color: var(--primary-dark); }
.delivery-tracking {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 10px 0;
}
.delivery-toggle-form { margin: 0; }
.delivery-toggle {
  width: 100%;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid rgba(23, 35, 43, .09);
  border-radius: 11px;
  background: rgba(255, 255, 255, .9);
  color: #5f6e75;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(22, 39, 45, .05);
}
.delivery-toggle:hover { background: rgba(248, 251, 250, .96); }
.delivery-toggle:disabled { cursor: wait; opacity: .72; }
.delivery-toggle:focus-visible { outline: 3px solid rgba(18, 108, 100, .2); outline-offset: 2px; }
.delivery-toggle-copy small,
.delivery-toggle-copy strong { display: block; }
.delivery-toggle-copy small { color: #7a858b; font-size: 10px; }
.delivery-toggle-copy strong { margin-top: 2px; color: #536168; font-size: 13px; }
.delivery-switch {
  width: 40px;
  height: 23px;
  flex: none;
  display: flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: #d7dedf;
  transition: background .16s ease;
}
.delivery-switch span {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 35, 43, .24);
  transition: transform .16s ease;
}
.delivery-toggle.is-on {
  border-color: rgba(36, 113, 68, .14);
  background: rgba(225, 243, 232, .92);
}
.delivery-toggle.is-on .delivery-toggle-copy small,
.delivery-toggle.is-on .delivery-toggle-copy strong { color: #247144; }
.delivery-toggle.is-on .delivery-switch { background: #2f8a57; }
.delivery-toggle.is-on .delivery-switch span { transform: translateX(17px); }
.delivery-tracking-compact { margin: 14px 0 0; }
.delivery-tracking-compact .delivery-toggle { min-height: 54px; }
.surgery-detail-page .simple-aup-card {
  gap: 11px;
  margin: 10px 0;
  padding: 12px 14px;
  border: 0;
  border-radius: 11px;
  background: rgba(235, 244, 249, .88);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .05);
}
.surgery-detail-page .simple-aup-card.outgoing { background: rgba(252, 242, 231, .9); }
.surgery-detail-page .simple-aup-card > span {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .8);
  font-size: 9px;
}
.surgery-detail-page .simple-aup-card strong { font-size: 13px; }
.surgery-detail-page .simple-aup-card small { color: #748087; font-size: 11px; }
.surgery-detail-page .simple-detail-section,
.surgery-detail-page .simple-details {
  border: 0;
  border-radius: 13px;
  background: var(--detail-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .07);
}
.surgery-detail-page .simple-detail-section { margin-top: 14px; }
.surgery-detail-page .simple-section-heading {
  padding: 15px 17px 11px;
  border-bottom-color: var(--detail-rule);
}
.surgery-detail-page .simple-section-heading .eyebrow {
  margin-bottom: 2px;
  color: #667770;
  font-size: 9px;
}
.surgery-detail-page .simple-section-heading h2 {
  font-size: 17px;
  font-weight: 740;
  letter-spacing: -.025em;
}
.surgery-detail-page .simple-section-heading .button { border-radius: 8px; }
.surgery-detail-page .movement-list article {
  gap: 11px;
  padding: 12px 17px;
  border-bottom-color: var(--detail-rule);
}
.surgery-detail-page .movement-icon {
  width: 29px;
  height: 29px;
  background: rgba(18, 108, 100, .08);
  font-size: 12px;
}
.surgery-detail-page .movement-list article div strong { font-size: 12px; }
.surgery-detail-page .movement-list small { color: #7a858b; font-size: 10px; }
.surgery-detail-page .movement-list article > strong {
  font-size: 13px;
  font-weight: 740;
}
.surgery-detail-page .movement-action { color: #68767d; font-size: 11px; }
.surgery-detail-page .simple-empty { padding: 38px 20px; }
.surgery-detail-page .simple-empty h2 { font-size: 17px; }
.surgery-detail-page .simple-empty p { font-size: 13px; }
.surgery-detail-page .simple-details { margin-top: 8px; }
.surgery-detail-page .simple-details summary {
  padding: 13px 16px;
  color: #435159;
  font-size: 12px;
  font-weight: 700;
}
.surgery-detail-page .simple-details summary::after {
  color: #899399;
  font-size: 15px;
}
.surgery-detail-page .simple-details[open] summary { border-bottom-color: var(--detail-rule); }
.surgery-detail-page .simple-details-content { padding: 14px 16px; }
.surgery-detail-page .simple-definition-list { gap: 13px 20px; }
.surgery-detail-page .simple-definition-list dt {
  color: #7a858b;
  font-size: 9px;
}
.surgery-detail-page .simple-definition-list dd {
  color: #34434a;
  font-size: 13px;
}
.surgery-detail-page .simple-danger { background: rgba(255, 250, 250, .86); }
.surgery-detail-page dialog {
  border-radius: 16px;
  background: rgba(251, 252, 252, .99);
}
.surgery-detail-page dialog .dialog-form { padding: 22px; }
.surgery-detail-page dialog .dialog-heading h2 {
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -.035em;
}
.surgery-detail-page dialog input,
.surgery-detail-page dialog select,
.surgery-detail-page dialog textarea {
  border-color: transparent;
  border-radius: 9px;
  background: rgba(238, 243, 242, .92);
}

@media (max-width: 800px) {
  .surgery-detail-page .simple-detail-heading { margin-bottom: 16px; }
  .surgery-detail-page .simple-detail-title { gap: 12px; }
  .surgery-detail-page .simple-detail-title h1 { font-size: 31px; }
  .surgery-detail-page .simple-detail-title p:last-child { font-size: 12px; }
  .surgery-detail-page .collection-detail-card {
    display: block;
    padding: 16px 17px;
  }
  .surgery-detail-page .collection-detail-card h2 { margin-bottom: 13px; }
  .surgery-detail-page .collection-detail-money {
    display: flex;
    min-width: 0;
  }
  .surgery-detail-page .collection-detail-money strong { font-size: 30px; }
  .surgery-detail-page .collection-detail-actions { margin-top: 13px; padding-top: 11px; }
  .surgery-detail-page .collection-detail-actions .button { flex: 0 1 auto; min-width: 86px; }
  .surgery-detail-page .compact-detail-metrics .metric-card { padding: 12px 13px; }
  .surgery-detail-page .compact-detail-metrics .metric-card strong { font-size: 16px; }
  .surgery-detail-page .simple-aup-card { align-items: center; }
  .surgery-detail-page .movement-list article { padding: 11px 14px; }
  .surgery-detail-page dialog .dialog-form { padding: 19px; }
}

@media (max-width: 360px) {
  .surgery-detail-page .simple-detail-title h1 { font-size: 28px; }
  .surgery-detail-page .collection-detail-money { align-items: end; }
  .surgery-detail-page .collection-detail-money span { max-width: 120px; }
  .surgery-detail-page .collection-detail-actions .button { min-width: 76px; }
  .delivery-toggle { padding: 10px; }
  .delivery-toggle-copy strong { font-size: 12px; }
}

/* Reportes: PageHeader, FormField, MetricGroup, ResponsiveTable y EmptyState. */
.reports-page {
  --reports-surface: rgba(255, 255, 255, .9);
  --reports-soft: rgba(241, 246, 245, .9);
  --reports-rule: rgba(23, 35, 43, .09);
  max-width: 1080px;
  margin: 0 auto;
}
.reports-page .page-heading {
  margin-bottom: 21px;
  max-width: 820px;
}
.reports-page .page-heading .eyebrow {
  margin-bottom: 7px;
  color: #52716e;
  font-size: 10px;
  letter-spacing: .14em;
}
.reports-page .page-heading h1 {
  margin-bottom: 6px;
  font-size: clamp(34px, 5vw, 44px);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.03;
}
.reports-page .page-heading .muted {
  max-width: 680px;
  color: #748087;
  font-size: 14px;
}
.reports-page .report-filter {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 14px;
  border: 0;
  border-radius: 13px;
  background: var(--reports-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .07);
}
.reports-page .report-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
  flex: 1;
}
.reports-page .report-filter .field label {
  margin-bottom: 4px;
  color: #69777e;
  font-size: 10px;
  font-weight: 680;
}
.reports-page .report-filter .field input,
.reports-page .report-filter .field select {
  min-height: 40px;
  border-color: transparent;
  border-radius: 9px;
  background: rgba(238, 243, 242, .92);
  font-size: 13px;
}
.reports-page .report-filter .field input:focus,
.reports-page .report-filter .field select:focus {
  outline: 2px solid rgba(18, 108, 100, .16);
  border-color: rgba(18, 108, 100, .42);
  background: #fff;
}
.reports-page .report-filter > .button {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 9px;
  font-size: 12px;
  box-shadow: none;
}
.reports-page .report-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 14px;
}
.reports-page .report-metrics .metric-card {
  min-width: 0;
  padding: 15px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--reports-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .07), 0 8px 24px rgba(22, 39, 45, .025);
}
.reports-page .report-metrics .metric-card span,
.reports-page .report-metrics .metric-card small {
  overflow: hidden;
  color: #748087;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reports-page .report-metrics .metric-card span { font-weight: 670; }
.reports-page .report-metrics .metric-card strong {
  display: block;
  overflow: hidden;
  margin: 5px 0 2px;
  color: var(--ink);
  font-size: clamp(17px, 2.1vw, 22px);
  font-weight: 760;
  letter-spacing: -.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reports-page .report-metrics .metric-card.accent {
  background: rgba(224, 241, 237, .92);
}
.reports-page .report-metrics .metric-card.accent span,
.reports-page .report-metrics .metric-card.accent small { color: #58726f; }
.reports-page .report-metrics .metric-card.accent strong { color: var(--primary-dark); }
.reports-page .report-movements-panel {
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: var(--reports-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .08), 0 10px 30px rgba(22, 39, 45, .035);
}
.reports-page .report-movements-panel .panel-heading {
  padding: 17px 19px 13px;
  border-bottom-color: var(--reports-rule);
}
.reports-page .report-movements-panel .panel-heading .eyebrow {
  margin-bottom: 2px;
  color: #667770;
  font-size: 9px;
}
.reports-page .report-movements-panel .panel-heading h2 {
  font-size: 18px;
  font-weight: 740;
  letter-spacing: -.025em;
}
.reports-page .panel-actions { display: flex; gap: 6px; }
.reports-page .panel-actions .button {
  min-width: 48px;
  padding: 6px 9px;
  border-color: transparent;
  border-radius: 8px;
  background: rgba(237, 242, 241, .9);
  color: #526067;
  font-size: 10px;
  box-shadow: none;
}
.reports-page .report-table table { font-size: 12px; }
.reports-page .report-table th {
  padding: 10px 14px;
  border-bottom-color: var(--reports-rule);
  background: rgba(246, 248, 248, .68);
  color: #7a858b;
  font-size: 9px;
  font-weight: 690;
}
.reports-page .report-table td {
  padding: 12px 14px;
  border-bottom-color: var(--reports-rule);
  color: #445159;
}
.reports-page .report-table td strong {
  color: var(--ink);
  font-weight: 710;
}
.reports-page .report-table td.amount {
  color: var(--primary-dark);
  font-weight: 740;
  letter-spacing: -.015em;
}
.reports-page .empty-state { padding: 46px 20px; }
.reports-page .empty-state .empty-icon {
  width: 40px;
  height: 40px;
  background: rgba(18, 108, 100, .08);
  font-size: 18px;
}
.reports-page .empty-state h2 { font-size: 17px; }
.reports-page .empty-state p { font-size: 13px; }

@media (max-width: 1000px) and (min-width: 801px) {
  .reports-page .report-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .reports-page .page-heading { margin-bottom: 17px; }
  .reports-page .page-heading h1 { font-size: 31px; }
  .reports-page .page-heading .muted { font-size: 13px; }
  .reports-page .report-filter {
    display: grid;
    padding: 12px;
  }
  .reports-page .report-filter-fields { grid-template-columns: 1fr 1fr; }
  .reports-page .report-filter > .button { width: 100%; }
  .reports-page .report-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }
  .reports-page .report-metrics .metric-card { padding: 13px 14px; }
  .reports-page .report-metrics .metric-card strong { font-size: 18px; }
  .reports-page .report-metrics .metric-card:last-child { grid-column: 1 / -1; }
  .reports-page .report-movements-panel .panel-heading { padding: 15px 14px 11px; }
  .reports-page .mobile-card-table tbody { padding: 0 10px 10px; }
  .reports-page .mobile-card-table tr {
    margin-top: 9px;
    padding: 11px 12px;
    border: 0;
    border-radius: 10px;
    background: rgba(246, 249, 248, .86);
    box-shadow: 0 1px 2px rgba(22, 39, 45, .05);
  }
  .reports-page .mobile-card-table td {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    padding: 4px 0;
    font-size: 12px;
  }
  .reports-page .mobile-card-table td::before {
    color: #7a858b;
    font-size: 9px;
    font-weight: 680;
  }
  .reports-page .mobile-card-table td.amount { text-align: left; }
}

@media (max-width: 380px) {
  .reports-page .report-filter-fields { grid-template-columns: 1fr; }
  .reports-page .report-metrics .metric-card { padding: 12px; }
  .reports-page .report-metrics .metric-card strong { font-size: 16px; }
  .reports-page .report-movements-panel .panel-heading { align-items: flex-start; }
}

/* Exportar cirugías: filtros, selección múltiple, ListItem y acciones de archivo. */
.surgery-export-page {
  --export-surface: rgba(255, 255, 255, .91);
  --export-soft: rgba(241, 246, 245, .9);
  --export-rule: rgba(23, 35, 43, .09);
  max-width: 1040px;
  margin: 0 auto;
}
.surgery-export-page .page-heading {
  margin-bottom: 20px;
  max-width: 800px;
}
.surgery-export-page .page-heading .back-link {
  margin-bottom: 14px;
  color: #68767d;
  font-size: 12px;
}
.surgery-export-page .page-heading .eyebrow {
  margin-bottom: 7px;
  color: #52716e;
  font-size: 10px;
  letter-spacing: .14em;
}
.surgery-export-page .page-heading h1 {
  margin-bottom: 6px;
  font-size: clamp(34px, 5vw, 44px);
  font-weight: 780;
  letter-spacing: -.045em;
  line-height: 1.03;
}
.surgery-export-page .page-heading .muted {
  color: #748087;
  font-size: 14px;
}
.surgery-export-page .export-filter {
  margin-bottom: 12px;
  padding: 14px;
  border: 0;
  border-radius: 13px;
  background: var(--export-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .07);
}
.surgery-export-page .export-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.surgery-export-page .export-filter-search { grid-column: span 2; }
.surgery-export-page .export-filter .field label {
  margin-bottom: 4px;
  color: #69777e;
  font-size: 10px;
  font-weight: 680;
}
.surgery-export-page .export-filter .field input,
.surgery-export-page .export-filter .field select {
  width: 100%;
  min-height: 40px;
  border-color: transparent;
  border-radius: 9px;
  background: rgba(238, 243, 242, .92);
  font-size: 13px;
}
.surgery-export-page .export-filter .field input:focus,
.surgery-export-page .export-filter .field select:focus {
  outline: 2px solid rgba(18, 108, 100, .16);
  border-color: rgba(18, 108, 100, .42);
  background: #fff;
}
.surgery-export-page .export-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 11px;
}
.surgery-export-page .export-filter-actions .button {
  min-height: 39px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
}
.surgery-export-page .export-selection-panel {
  overflow: visible;
  border: 0;
  border-radius: 14px;
  background: var(--export-surface);
  box-shadow: 0 1px 2px rgba(22, 39, 45, .08), 0 10px 30px rgba(22, 39, 45, .035);
}
.surgery-export-page .export-selection-heading {
  padding: 16px 18px 12px;
  border-bottom-color: var(--export-rule);
}
.surgery-export-page .export-selection-heading .eyebrow {
  margin-bottom: 2px;
  color: #667770;
  font-size: 9px;
}
.surgery-export-page .export-selection-heading h2 {
  font-size: 18px;
  font-weight: 740;
  letter-spacing: -.025em;
}
.surgery-export-page .export-selection-heading p:last-child {
  margin: 2px 0 0;
  color: #7a858b;
  font-size: 11px;
}
.surgery-export-page .export-select-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(237, 242, 241, .9);
  color: #526067;
  font-size: 11px;
  font-weight: 680;
  cursor: pointer;
}
.surgery-export-page .export-select-all input,
.surgery-export-page .export-surgery-item > input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--primary);
}
.surgery-export-page .export-surgery-list { display: grid; }
.surgery-export-page .export-surgery-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "check main meta" ". tags tags";
  gap: 5px 12px;
  align-items: center;
  padding: 13px 18px;
  border-bottom: 1px solid var(--export-rule);
  cursor: pointer;
  transition: background .15s ease;
}
.surgery-export-page .export-surgery-item:last-child { border-bottom: 0; }
.surgery-export-page .export-surgery-item:hover { background: rgba(245, 248, 247, .7); }
.surgery-export-page .export-surgery-item:has(> input:checked) { background: rgba(229, 242, 239, .72); }
.surgery-export-page .export-surgery-item > input { grid-area: check; }
.surgery-export-page .export-surgery-main { grid-area: main; min-width: 0; }
.surgery-export-page .export-surgery-main small,
.surgery-export-page .export-surgery-main strong,
.surgery-export-page .export-surgery-main > span { display: block; }
.surgery-export-page .export-surgery-main small {
  overflow: hidden;
  color: #65747b;
  font-size: 10px;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.surgery-export-page .export-surgery-main strong {
  overflow: hidden;
  margin-top: 1px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.surgery-export-page .export-surgery-main > span {
  overflow: hidden;
  color: #7a858b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.surgery-export-page .export-surgery-meta {
  grid-area: meta;
  min-width: 110px;
  text-align: right;
}
.surgery-export-page .export-surgery-meta strong,
.surgery-export-page .export-surgery-meta small { display: block; }
.surgery-export-page .export-surgery-meta strong {
  color: var(--primary-dark);
  font-size: 14px;
  font-weight: 750;
}
.surgery-export-page .export-surgery-meta small { color: #7a858b; font-size: 10px; }
.surgery-export-page .export-surgery-tags {
  grid-area: tags;
  display: flex;
  justify-content: flex-end;
  gap: 5px;
}
.surgery-export-page .export-surgery-tags .status,
.surgery-export-page .export-surgery-tags .aup-mini-tag {
  margin: 0;
  padding: 2px 6px;
  border: 0;
  font-size: 8px;
}
.surgery-export-page .export-submit-bar {
  position: sticky;
  z-index: 6;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(18, 108, 100, .12);
  border-radius: 12px;
  background: rgba(250, 252, 251, .96);
  box-shadow: 0 12px 35px rgba(22, 39, 45, .13);
  backdrop-filter: blur(8px);
}
.surgery-export-page .export-submit-bar strong,
.surgery-export-page .export-submit-bar small { display: block; }
.surgery-export-page .export-submit-bar strong { color: #34434a; font-size: 12px; }
.surgery-export-page .export-submit-bar small { color: #7a858b; font-size: 9px; }
.surgery-export-page .export-format-actions { display: flex; gap: 7px; }
.surgery-export-page .export-format-actions .button {
  min-height: 39px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 11px;
}
.surgery-export-page .export-format-actions .button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

@media (max-width: 800px) {
  .surgery-export-page .page-heading { margin-bottom: 17px; }
  .surgery-export-page .page-heading h1 { font-size: 31px; }
  .surgery-export-page .page-heading .muted { font-size: 13px; }
  .surgery-export-page .export-filter { padding: 12px; }
  .surgery-export-page .export-filter-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .surgery-export-page .export-filter-search { grid-column: 1 / -1; }
  .surgery-export-page .export-filter-actions .button { flex: 1; }
  .surgery-export-page .export-selection-heading {
    align-items: flex-start;
    padding: 14px 14px 11px;
  }
  .surgery-export-page .export-select-all { padding: 6px 8px; }
  .surgery-export-page .export-surgery-item {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "check main" ". meta" ". tags";
    gap: 4px 10px;
    padding: 12px 14px;
  }
  .surgery-export-page .export-surgery-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    text-align: left;
  }
  .surgery-export-page .export-surgery-tags { justify-content: flex-start; }
  .surgery-export-page .export-submit-bar {
    bottom: 76px;
    display: grid;
    margin: 10px;
    padding: 11px 12px;
  }
  .surgery-export-page .export-format-actions .button { flex: 1; }
}

@media (max-width: 380px) {
  .surgery-export-page .export-filter-grid { grid-template-columns: 1fr; }
  .surgery-export-page .export-filter-search { grid-column: auto; }
  .surgery-export-page .export-selection-heading { display: grid; }
  .surgery-export-page .export-select-all { width: fit-content; }
}

/* Lista principal de cirugías: renglón mínimo y ficha rápida legible. */
.dashboard-page .collection-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: none;
  gap: 0;
  align-items: stretch;
  padding: 0;
}
.dashboard-page .collection-item-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  padding: 14px 8px 14px 18px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.dashboard-page .collection-item-summary:focus-visible {
  outline: 2px solid rgba(18, 108, 100, .38);
  outline-offset: -3px;
}
.dashboard-page .collection-item-summary-main { min-width: 0; }
.dashboard-page .collection-item-summary-main strong,
.dashboard-page .collection-item-summary-main small { display: block; }
.dashboard-page .collection-item-summary-main strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 740;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-page .collection-item-summary-main small {
  margin-top: 3px;
  color: #69777e;
  font-size: 11px;
  font-weight: 650;
}
.dashboard-page .collection-item-summary-main .collection-item-summary-meta {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.dashboard-page .collection-item-summary-meta span {
  overflow: hidden;
  min-width: 0;
  color: var(--primary);
  font-weight: 720;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dashboard-page .collection-item-summary-meta i {
  flex: none;
  color: #a0aaae;
  font-style: normal;
}
.dashboard-page .collection-item-summary-meta time {
  flex: none;
  color: #7b878d;
  white-space: nowrap;
}
.dashboard-page .collection-item-summary-hint {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  color: #7a858b;
  font-size: 10px;
  font-weight: 650;
  white-space: nowrap;
}
.dashboard-page .collection-item-summary-hint b {
  color: var(--primary);
  font-size: 21px;
  font-weight: 500;
  line-height: 1;
}
.dashboard-page .collection-item-action {
  grid-area: auto;
  align-self: center;
  justify-self: auto;
  padding-right: 16px;
}
.dashboard-page .collection-item.collection-aup-incoming,
.dashboard-page .collection-item.collection-aup-full {
  background: rgba(238, 143, 48, .15);
  box-shadow: inset 4px 0 #d97919;
}
.dashboard-page .collection-item.collection-aup-outgoing {
  background: rgba(116, 75, 157, .14);
  box-shadow: inset 4px 0 #744b9d;
}
.dashboard-page .collection-item.collection-aup-incoming:hover,
.dashboard-page .collection-item.collection-aup-full:hover { background: rgba(238, 143, 48, .21); }
.dashboard-page .collection-item.collection-aup-outgoing:hover { background: rgba(116, 75, 157, .20); }
.dashboard-page .collection-aup-identifier {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.4;
}
.dashboard-page .collection-item-summary-main .collection-aup-identifier-incoming,
.aup-mini-tag-incoming { background: #fff0df; color: #a6530b; }
.dashboard-page .collection-item-summary-main .collection-aup-identifier-outgoing,
.aup-mini-tag-outgoing { background: #f1e9f8; color: #653a8c; }
.dashboard-page .collection-item-summary-main .collection-aup-identifier-full,
.aup-mini-tag-full { background: #fff0df; color: #a6530b; }
.aup-quick-edit-link {
  align-self: center;
  margin-left: 3px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.aup-form-card { scroll-margin-top: 84px; }
.aup-edit-warning {
  margin-top: 15px;
  padding: 14px;
  border: 1px solid #d6dfe1;
  border-radius: 11px;
  background: #f8faf9;
}
.aup-edit-warning > strong { display: block; font-size: 13px; }
.aup-edit-warning > p { margin: 3px 0 11px; color: var(--muted); font-size: 12px; }
.aup-change-confirm { display: flex; align-items: center; gap: 9px; font-weight: 750; }
.aup-change-confirm input { width: 19px; height: 19px; accent-color: var(--primary); }
.aup-edit-warning > small { display: block; margin: 5px 0 0 28px; color: var(--muted); font-size: 11px; }
.surgery-detail-page .simple-aup-card.full { background: rgba(233, 241, 251, .92); }
.surgery-detail-page .simple-aup-card.none { background: rgba(244, 246, 246, .9); }
.surgery-detail-page .aup-edit-link { flex: none; margin-left: auto; font-size: 12px; }
.surgery-quick-dialog {
  width: min(540px, calc(100vw - 28px));
  max-height: min(780px, calc(100dvh - 28px));
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: rgba(252, 253, 253, .98);
  box-shadow: 0 30px 90px rgba(17, 35, 41, .28);
}
.surgery-quick-dialog::backdrop { background: rgba(25, 42, 48, .5); backdrop-filter: blur(3px); }
.surgery-quick-dialog .surgery-quick-card {
  overflow-y: auto;
  max-height: min(780px, calc(100dvh - 28px));
  padding: 20px;
}
.surgery-quick-dialog .dialog-heading { align-items: flex-start; margin-bottom: 15px; }
.surgery-quick-dialog .dialog-heading h2 { margin-top: 3px; font-size: 24px; line-height: 1.08; }
.surgery-quick-lead {
  padding: 13px 14px;
  border-radius: 11px;
  background: rgba(231, 242, 240, .76);
}
.surgery-quick-lead > span,
.surgery-quick-notes > span {
  display: block;
  color: #708087;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.surgery-quick-lead > strong { display: block; margin-top: 2px; font-size: 17px; }
.surgery-quick-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.surgery-quick-tags .status,
.surgery-quick-tags .aup-mini-tag { margin: 0; padding: 3px 7px; border: 0; font-size: 9px; }
.surgery-quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 14px 0 0;
  border-top: 1px solid rgba(23, 35, 43, .09);
}
.surgery-quick-grid > div { min-width: 0; padding: 11px 8px 10px 0; border-bottom: 1px solid rgba(23, 35, 43, .09); }
.surgery-quick-grid > div:nth-child(even) { padding-right: 0; padding-left: 8px; }
.surgery-quick-grid dt { margin-bottom: 2px; color: #78858b; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.surgery-quick-grid dd { margin: 0; color: #27383f; font-size: 12px; font-weight: 650; line-height: 1.3; }
.surgery-quick-notes { margin-top: 13px; padding: 12px 13px; border-radius: 10px; background: rgba(242, 245, 244, .8); }
.surgery-quick-notes p { margin: 4px 0 0; color: #405159; font-size: 12px; line-height: 1.45; }
.surgery-quick-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.surgery-quick-actions .button { min-height: 40px; border-radius: 8px; font-size: 12px; }

@media (max-width: 800px) {
  .dashboard-page .collection-item-summary { padding: 13px 7px 13px 15px; }
  .dashboard-page .collection-item-summary-main strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .dashboard-page .collection-item-summary-hint { font-size: 0; }
  .dashboard-page .collection-item-action { justify-self: auto; padding-right: 13px; }
  .surgery-quick-dialog .surgery-quick-card { padding: 17px; }
  .surgery-quick-dialog .dialog-heading h2 { font-size: 22px; }
}

/* Panel administrativo: comparación compacta y bitácora legible. */
.security-admin-page { display: grid; gap: 20px; }
.security-admin-page .page-heading,
.security-admin-page .metric-grid { margin-bottom: 0; }
.security-metrics { grid-template-columns: repeat(3, 1fr); }
.security-users-panel,
.security-events-panel { overflow: hidden; }
.security-users-panel .panel-heading small,
.security-events-panel .panel-heading small { color: var(--muted); }
.security-users-table { min-width: 1180px; }
.security-users-table td { vertical-align: top; }
.security-users-table td strong,
.security-users-table td small { display: block; }
.security-users-table td small { color: var(--muted); }
.security-users-table .amount { font-variant-numeric: tabular-nums; }
.admin-badge {
  display: block;
  width: fit-content;
  margin-top: 5px;
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--soft);
  color: var(--primary);
  font-size: 9px;
  text-transform: uppercase;
}
.security-warning { color: var(--danger)!important; font-weight: 700; }
.security-event-list { display: grid; }
.security-event-list article {
  display: grid;
  grid-template-columns: 10px minmax(180px, .8fr) minmax(240px, 1.2fr);
  align-items: center;
  gap: 13px;
  padding: 13px 20px;
  border-bottom: 1px solid #edf0f1;
}
.security-event-list article:last-child { border-bottom: 0; }
.security-event-list strong,
.security-event-list small { display: block; }
.security-event-list small { color: var(--muted); font-size: 11px; }
.security-event-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2f8b62;
}
.security-event-dot.failed { background: var(--danger); }
.security-event-origin { min-width: 0; text-align: right; }
.security-event-origin small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 800px) {
  .security-metrics { grid-template-columns: 1fr 1fr; }
  .security-metrics .metric-card:first-child { grid-column: 1 / -1; }
  .security-users-table { min-width: 0!important; white-space: normal; }
  .security-users-table thead { display: none; }
  .security-users-table tbody,
  .security-users-table tr,
  .security-users-table td { display: block; }
  .security-users-table tbody { padding: 0 14px 14px; }
  .security-users-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 11px 15px;
    margin-top: 12px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255,255,255,.88);
  }
  .security-users-table td { min-width: 0; padding: 0; border: 0; text-align: left; }
  .security-users-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: .05em;
    text-transform: uppercase;
  }
  .security-users-table .security-user-identity {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid #edf0f1;
  }
  .security-users-table .security-user-identity::before { display: none; }
  .security-users-table td[data-label="Práctica"] { grid-column: 1 / -1; }
  .security-event-list article {
    grid-template-columns: 9px minmax(0, 1fr);
    padding: 12px 14px;
  }
  .security-event-origin { grid-column: 2; text-align: left; }
}
