:root {
  color-scheme: light;
  --ink-950: #0a1c2b;
  --ink-900: #102a3e;
  --ink-800: #17384e;
  --ink-700: #2d4b5f;
  --ink-600: #526b7b;
  --ink-500: #718493;
  --ink-400: #9bacb8;
  --ink-300: #c3ced5;
  --ink-200: #dce4e9;
  --ink-100: #edf2f5;
  --ink-50: #f6f8fa;
  --white: #ffffff;
  --brand-800: #0d5b58;
  --brand-700: #0b706b;
  --brand-600: #0d8580;
  --brand-100: #d8f1ef;
  --brand-50: #edf9f8;
  --amber-700: #9a5a07;
  --amber-500: #db8a13;
  --amber-100: #fff0ca;
  --green-700: #167044;
  --green-100: #dff4e8;
  --red-700: #a93636;
  --red-100: #fce4e4;
  --blue-700: #285d9f;
  --blue-100: #e1ecfb;
  --purple-700: #6d50a5;
  --purple-100: #eee7fb;
  --orange-700: #a94f16;
  --orange-100: #ffeadc;
  --shadow-sm: 0 1px 2px rgba(10, 28, 43, 0.06), 0 3px 10px rgba(10, 28, 43, 0.04);
  --shadow-md: 0 14px 34px rgba(10, 28, 43, 0.12), 0 2px 8px rgba(10, 28, 43, 0.06);
  --shadow-lg: 0 28px 70px rgba(6, 22, 34, 0.24);
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --sidebar-width: 248px;
  --transition: 160ms ease;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Flujo rápido de fondos: compacto, operativo y sin tarjetas decorativas. */
.quick-request-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 10px;
  padding: 7px 10px;
  border: 1px solid var(--ink, #14211e);
  background: #f7f4ea;
}

.quick-request-bar strong {
  margin-right: 4px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quick-request-button {
  min-height: 30px;
  padding: 5px 12px;
  border: 1px solid #15251f;
  background: #fffdf7;
  color: #14211e;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.quick-request-button:hover,
.quick-request-button:focus-visible {
  background: #d6ff38;
}

#activeTemplateLabel {
  margin-left: auto;
  color: #486058;
  font-size: 12px;
  font-weight: 700;
}

.payment-profile-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.beneficiary-choice {
  margin: 0 0 8px;
  padding: 7px 10px;
  border-left: 4px solid #087e73;
  background: #e5f4ef;
  color: #17443d;
  font-size: 12px;
  font-weight: 800;
}

.bank-transfer-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.bank-transfer-fields[hidden] { display: none; }
.payment-profile-card { width: min(760px, calc(100vw - 32px)); }

@media (max-width: 840px) {
  .quick-request-bar { align-items: stretch; flex-wrap: wrap; }
  #activeTemplateLabel { width: 100%; margin-left: 0; }
  .payment-heading { align-items: flex-start; }
  .payment-profile-actions { justify-content: flex-start; }
  .bank-transfer-fields { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 560px) {
  .quick-request-button { flex: 1 1 46%; }
  .bank-transfer-fields { grid-template-columns: 1fr; }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--ink-50);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink-900);
  background: var(--ink-50);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button,
a,
input,
select,
textarea {
  outline-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(13, 133, 128, 0.3);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: var(--brand-700);
  transform: translateY(-150%);
  transition: transform var(--transition);
}

.skip-link:focus {
  transform: translateY(0);
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.015em;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--brand-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow--light {
  color: #8ce0d9;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand > span:last-child {
  display: grid;
  min-width: 0;
}

.brand strong {
  font-size: 15px;
  white-space: nowrap;
}

.brand small {
  margin-top: 1px;
  color: var(--ink-500);
  font-size: 11px;
}

.brand--light strong {
  color: var(--white);
}

.brand--light small {
  color: rgba(255, 255, 255, 0.58);
}

.brand-mark {
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  color: var(--white);
  background: linear-gradient(145deg, #17a19a, #0c6d69);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.14);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.07em;
}

.brand-mark--compact {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 11px;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.button:not(:disabled):active {
  transform: translateY(1px);
}

.button--primary {
  color: var(--white);
  background: var(--brand-700);
  border-color: var(--brand-700);
  box-shadow: 0 3px 9px rgba(11, 112, 107, 0.17);
}

.button--primary:hover:not(:disabled) {
  background: var(--brand-800);
  border-color: var(--brand-800);
}

.button--secondary {
  color: var(--brand-800);
  background: var(--brand-50);
  border-color: #b9dedb;
}

.button--secondary:hover:not(:disabled) {
  background: var(--brand-100);
}

.button--ghost {
  color: var(--ink-700);
  background: var(--white);
  border-color: var(--ink-200);
}

.button--ghost:hover:not(:disabled) {
  color: var(--ink-900);
  background: var(--ink-50);
  border-color: var(--ink-300);
}

.button--success {
  color: var(--white);
  background: var(--green-700);
  border-color: var(--green-700);
}

.button--danger {
  color: var(--white);
  background: var(--red-700);
  border-color: var(--red-700);
}

.button--warning {
  color: #664000;
  background: var(--amber-100);
  border-color: #ebc467;
}

.button--compact {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 12px;
}

.button--wide {
  width: 100%;
}

.button.is-loading,
.icon-button.is-loading {
  color: transparent !important;
  pointer-events: none;
  position: relative;
}

.button.is-loading::after,
.icon-button.is-loading::after {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-right-color: var(--white);
  border-bottom-color: var(--white);
  border-left-color: var(--white);
  border-radius: 50%;
  content: "";
  animation: spin 0.7s linear infinite;
}

.icon-button {
  display: inline-grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  color: var(--ink-600);
  background: transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.icon-button:hover:not(:disabled) {
  color: var(--ink-900);
  background: var(--ink-100);
}

.icon-button--bordered {
  border: 1px solid var(--ink-200);
  background: var(--white);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--ink-700);
}

.field > span:first-child,
.field > label:first-child {
  font-size: 12px;
  font-weight: 750;
}

.field b {
  color: var(--red-700);
}

.field input,
.field select,
.field textarea,
.search-field input,
.select-field select {
  width: 100%;
  border: 1px solid var(--ink-300);
  border-radius: 8px;
  color: var(--ink-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.field input,
.field select,
.search-field input,
.select-field select {
  min-height: 42px;
  padding: 9px 11px;
}

.field textarea {
  min-height: 84px;
  padding: 10px 11px;
  line-height: 1.5;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.search-field input:hover,
.select-field select:hover {
  border-color: var(--ink-400);
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.select-field select:focus {
  border-color: var(--brand-600);
  box-shadow: 0 0 0 3px rgba(13, 133, 128, 0.12);
  outline: none;
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"],
.field textarea[aria-invalid="true"] {
  border-color: var(--red-700);
  background: #fffafa;
}

.field small {
  min-height: 17px;
  color: var(--ink-500);
  font-size: 11px;
}

.field-error {
  color: var(--red-700) !important;
}

.input-action-wrap {
  position: relative;
  display: block;
}

.input-action-wrap input {
  padding-right: 70px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 7px;
  padding: 4px 6px;
  border: 0;
  color: var(--brand-700);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  transform: translateY(-50%);
}

.inline-alert {
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid #cbd9e2;
  border-radius: 8px;
  color: var(--blue-700);
  background: #f1f7fe;
  font-size: 12px;
}

.inline-alert--error {
  color: var(--red-700);
  background: #fff5f5;
  border-color: #f0bebe;
}

.auth-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(360px, 0.88fr) minmax(420px, 1.12fr);
}

.auth-context {
  position: relative;
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(34px, 5vw, 72px);
  color: var(--white);
  background: linear-gradient(145deg, #0b2335 0%, #103c4d 54%, #0d5b58 120%);
}

.auth-context::after {
  position: absolute;
  right: -110px;
  bottom: -140px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 62px rgba(255, 255, 255, 0.025), 0 0 0 124px rgba(255, 255, 255, 0.02);
  content: "";
  pointer-events: none;
}

.auth-message {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: auto 0;
  padding: 70px 0;
}

.auth-message h1 {
  max-width: 540px;
  margin-bottom: 18px;
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 750;
  line-height: 1.04;
}

.auth-message p {
  max-width: 500px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 16px;
}

.auth-benefits {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.auth-benefits li {
  display: flex;
  align-items: center;
  gap: 9px;
}

.auth-benefits .icon {
  width: 16px;
  height: 16px;
  color: #83d9d2;
}

.auth-card-wrap {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 36px;
  background: #f3f6f8;
}

.auth-card {
  width: min(100%, 410px);
  padding: clamp(28px, 5vw, 44px);
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.auth-card-heading {
  margin-bottom: 27px;
}

.auth-card-heading .brand-mark {
  display: none;
  margin-bottom: 22px;
}

.auth-card-heading h2 {
  margin-bottom: 7px;
  font-size: 30px;
  line-height: 1.12;
}

.auth-card-heading p {
  margin-bottom: 0;
  color: var(--ink-600);
}

.auth-card .field {
  margin-bottom: 17px;
}

.auth-footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 18px 0 0;
  color: var(--ink-500);
  font-size: 11px;
  text-align: center;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #50c58c;
  box-shadow: 0 0 0 3px rgba(80, 197, 140, 0.14);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 17px;
  color: var(--white);
  background: var(--ink-950);
}

.sidebar-brand {
  padding: 0 7px 24px;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
  padding-top: 17px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 43px;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  transition: color var(--transition), background var(--transition);
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--white);
  background: rgba(255, 255, 255, 0.09);
}

.nav-item.is-active {
  box-shadow: inset 3px 0 #54c8bf;
}

.sidebar-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: auto;
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note .status-dot {
  margin-top: 5px;
}

.sidebar-note div {
  display: grid;
}

.sidebar-note strong {
  font-size: 11px;
}

.sidebar-note small {
  color: rgba(255, 255, 255, 0.48);
  font-size: 10px;
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  height: 68px;
  align-items: center;
  justify-content: flex-end;
  padding: 0 clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--ink-200);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar-brand {
  display: none;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.session-controls,
.session-user {
  display: flex;
  align-items: center;
}

.session-controls {
  gap: 13px;
}

.session-user {
  gap: 9px;
}

.session-user > span:last-child {
  display: grid;
  min-width: 0;
}

.session-user strong {
  max-width: 190px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-user small {
  color: var(--ink-500);
  font-size: 10px;
}

.avatar {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  color: var(--brand-800);
  background: var(--brand-100);
  font-size: 10px;
  font-weight: 900;
}

.page-section {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: 31px clamp(20px, 3vw, 42px) 48px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 25px;
}

.page-heading h1 {
  margin-bottom: 6px;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.15;
}

.page-heading p {
  margin-bottom: 0;
  color: var(--ink-600);
}

.heading-with-back {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.heading-with-back .icon-button {
  margin-top: 4px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.metric-card > div:last-child {
  display: grid;
  min-width: 0;
}

.metric-card span {
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 750;
}

.metric-card strong {
  margin: 1px 0;
  font-size: 26px;
  line-height: 1.15;
}

.metric-card small {
  overflow: hidden;
  color: var(--ink-500);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card--primary {
  color: var(--white);
  background: linear-gradient(135deg, var(--ink-800), #145b63);
  border-color: transparent;
}

.metric-card--primary span,
.metric-card--primary small {
  color: rgba(255, 255, 255, 0.66);
}

.metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  color: var(--brand-800);
  background: var(--brand-100);
}

.metric-card--primary .metric-icon {
  color: #9ce8e1;
  background: rgba(255, 255, 255, 0.1);
}

.metric-icon--amber {
  color: var(--amber-700);
  background: var(--amber-100);
}

.metric-icon--green {
  color: var(--green-700);
  background: var(--green-100);
}

.metric-icon--red {
  color: var(--red-700);
  background: var(--red-100);
}

.content-card {
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ink-200);
}

.card-heading h2 {
  margin-bottom: 2px;
  font-size: 18px;
}

.card-heading p {
  margin-bottom: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(135px, 0.36fr)) auto;
  gap: 9px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--ink-200);
  background: var(--ink-50);
}

.search-field {
  position: relative;
  min-width: 0;
}

.search-field .icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  width: 17px;
  height: 17px;
  color: var(--ink-500);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input {
  padding-left: 36px;
}

.search-field input,
.select-field select {
  min-height: 38px;
  padding-top: 7px;
  padding-bottom: 7px;
  font-size: 12px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--ink-100);
  text-align: left;
  vertical-align: middle;
}

th:first-child,
td:first-child {
  padding-left: 20px;
}

th:last-child,
td:last-child {
  padding-right: 20px;
}

th {
  color: var(--ink-500);
  background: #fbfcfd;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr {
  transition: background var(--transition);
}

tbody tr:hover {
  background: var(--ink-50);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

.requirement-number {
  color: var(--brand-700);
  font-weight: 850;
  white-space: nowrap;
}

.requirement-title {
  display: grid;
  min-width: 230px;
  max-width: 390px;
}

.requirement-title strong {
  overflow: hidden;
  color: var(--ink-900);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.requirement-title small,
.cell-stack small {
  margin-top: 2px;
  color: var(--ink-500);
  font-size: 10px;
}

.cell-stack {
  display: grid;
  min-width: 130px;
}

.type-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-700);
  font-weight: 700;
  white-space: nowrap;
}

.type-label .icon {
  width: 16px;
  height: 16px;
  color: var(--brand-700);
}

.status-badge,
.priority-pill,
.payment-readiness-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.status-badge {
  padding: 7px 9px;
}

.payment-readiness-badge {
  padding: 7px 9px;
}

.payment-readiness-INCOMPLETE {
  color: var(--amber-700);
  background: var(--amber-100);
  border-color: #edd18e;
}

.payment-readiness-READY {
  color: var(--green-700);
  background: var(--green-100);
  border-color: #b9dfc9;
}

.payment-readiness-NOT_ELIGIBLE {
  color: var(--ink-600);
  background: var(--ink-100);
  border-color: var(--ink-200);
}

.priority-pill {
  margin-top: 4px;
  padding: 4px 7px;
  color: var(--ink-600);
  background: var(--ink-100);
}

.priority-URGENT {
  color: var(--red-700);
  background: var(--red-100);
}

.priority-HIGH {
  color: var(--amber-700);
  background: var(--amber-100);
}

.status-DRAFT,
.status-CANCELLED {
  color: var(--ink-600);
  background: var(--ink-100);
  border-color: var(--ink-200);
}

.status-SUBMITTED {
  color: var(--blue-700);
  background: var(--blue-100);
  border-color: #c2d8f3;
}

.status-UNDER_REVIEW {
  color: var(--amber-700);
  background: var(--amber-100);
  border-color: #edd18e;
}

.status-OBSERVED {
  color: var(--orange-700);
  background: var(--orange-100);
  border-color: #f2c7a9;
}

.status-APPROVED,
.status-COMPLETED {
  color: var(--green-700);
  background: var(--green-100);
  border-color: #b9dfc9;
}

.status-REJECTED {
  color: var(--red-700);
  background: var(--red-100);
  border-color: #efbfbf;
}

.status-IN_PROCESS {
  color: var(--purple-700);
  background: var(--purple-100);
  border-color: #d8c9ef;
}

.row-open-button {
  color: var(--brand-700);
}

.requirement-cards {
  padding: 10px;
}

.requirement-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--ink-200);
  background: var(--white);
}

.requirement-card:last-child {
  border-bottom: 0;
}

.requirement-card-head,
.requirement-card-foot,
.requirement-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.requirement-card h3 {
  margin: 0;
  font-size: 14px;
}

.requirement-card-meta {
  justify-content: flex-start;
  color: var(--ink-600);
  font-size: 11px;
}

.requirement-card-foot {
  padding-top: 9px;
  border-top: 1px solid var(--ink-100);
}

.empty-state {
  padding: 50px 20px;
  text-align: center;
}

.empty-state h3 {
  margin-bottom: 5px;
}

.empty-state p {
  margin-bottom: 18px;
  color: var(--ink-500);
}

.empty-icon {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 14px;
  color: var(--brand-700);
  background: var(--brand-50);
}

.list-loading {
  display: grid;
  gap: 10px;
  padding: 20px;
}

.list-loading span,
.detail-loading span {
  display: block;
  height: 44px;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--ink-100) 25%, #f8fafb 43%, var(--ink-100) 63%);
  background-size: 300% 100%;
  animation: shimmer 1.35s ease-in-out infinite;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid var(--ink-200);
  color: var(--ink-500);
  font-size: 11px;
}

.pagination > div {
  display: flex;
  gap: 7px;
}

.requirement-form {
  display: grid;
  gap: 16px;
  max-width: 1050px;
}

.form-section {
  padding: 22px;
}

.section-heading,
.section-heading-copy {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.section-heading {
  margin-bottom: 21px;
}

.section-heading--actions {
  justify-content: space-between;
}

.section-heading h2 {
  margin-bottom: 1px;
  font-size: 17px;
}

.section-heading p {
  margin-bottom: 0;
  color: var(--ink-500);
  font-size: 11px;
}

.step-number {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: var(--brand-800);
  background: var(--brand-100);
  font-size: 10px;
  font-weight: 900;
}

.form-grid {
  display: grid;
  gap: 15px;
}

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

.field--span-2 {
  grid-column: span 2;
}

.payment-section-note,
.payment-readiness-reason {
  margin-bottom: 16px;
  padding: 11px 13px;
  border-left: 3px solid var(--amber-500);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-700);
  background: var(--amber-100);
  font-size: 11px;
}

.payment-detail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.payment-detail-heading h3 {
  margin: 0;
  font-size: 14px;
}

.items-container {
  display: grid;
  gap: 13px;
}

.item-card {
  overflow: hidden;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  background: #fcfdfe;
}

.item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--ink-200);
  background: var(--ink-50);
}

.item-header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-index {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.item-kind-label {
  color: var(--brand-700);
  font-size: 12px;
}

.remove-item {
  width: 32px;
  height: 32px;
  color: var(--red-700);
}

.form-grid--item {
  grid-template-columns: 130px minmax(230px, 1fr) repeat(3, minmax(115px, 0.42fr));
  padding: 15px;
}

.field--item-description {
  grid-column: span 4;
}

.field--span-item {
  grid-column: 1 / -1;
}

.money-input {
  position: relative;
  display: block;
}

.money-input > span {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 11px;
  color: var(--ink-500);
  font-size: 11px;
  transform: translateY(-50%);
  pointer-events: none;
}

.money-input input {
  padding-left: 31px;
}

.item-subtotal {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 9px 14px;
  border-top: 1px solid var(--ink-200);
  color: var(--ink-500);
  background: var(--white);
  font-size: 11px;
}

.item-subtotal strong {
  min-width: 95px;
  color: var(--ink-900);
  font-size: 13px;
  text-align: right;
}

.items-total {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 16px;
  margin-top: 15px;
  padding: 15px;
  border-radius: 9px;
  color: var(--white);
  background: var(--ink-800);
}

.items-total span {
  font-size: 12px;
  font-weight: 700;
}

.items-total strong {
  grid-row: span 2;
  font-size: 21px;
}

.items-total small {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
}

.form-actions {
  position: sticky;
  z-index: 8;
  bottom: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--ink-200);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
}

dialog {
  padding: 0;
  border: 0;
  color: var(--ink-900);
  background: transparent;
}

dialog::backdrop {
  background: rgba(8, 25, 37, 0.53);
  backdrop-filter: blur(2px);
}

.drawer-dialog {
  width: min(680px, 100vw);
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0 0 0 auto;
}

.drawer-dialog[open] {
  animation: slide-in 190ms ease-out;
}

.drawer-panel {
  display: grid;
  height: 100%;
  grid-template-rows: auto 1fr auto;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.drawer-header {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink-200);
}

.drawer-header h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.drawer-header .eyebrow {
  margin-bottom: 1px;
}

.drawer-content,
.detail-loading {
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.detail-loading {
  display: grid;
  align-content: start;
  gap: 12px;
}

.detail-loading span:first-child {
  height: 105px;
}

.detail-summary {
  margin-bottom: 17px;
  padding: 17px;
  border: 1px solid var(--ink-200);
  border-radius: 11px;
  background: linear-gradient(145deg, var(--ink-50), var(--white));
}

.detail-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.detail-summary h3 {
  margin: 10px 0 7px;
  font-size: 20px;
}

.detail-summary > p {
  margin-bottom: 0;
  color: var(--ink-600);
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid var(--ink-200);
}

.detail-meta-grid div,
.definition-list div {
  display: grid;
  min-width: 0;
}

.detail-meta-grid span,
.definition-list dt,
.detail-item-grid span {
  color: var(--ink-500);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-meta-grid strong,
.definition-list dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.detail-section {
  margin-top: 20px;
}

.detail-section > h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.detail-section > p {
  color: var(--ink-700);
  white-space: pre-wrap;
}

.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
}

.detail-items {
  display: grid;
  gap: 10px;
}

.detail-item {
  padding: 13px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
}

.detail-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.detail-item-head > div {
  display: grid;
}

.detail-item-head span {
  color: var(--brand-700);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-item-head strong:last-child {
  white-space: nowrap;
}

.detail-item > p {
  margin-bottom: 11px;
  color: var(--ink-600);
  font-size: 12px;
  white-space: pre-wrap;
}

.detail-item-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-100);
}

.detail-item-grid div {
  display: grid;
}

.detail-item-grid strong {
  margin-top: 2px;
  font-size: 11px;
}

.history {
  display: grid;
  gap: 0;
}

.history-entry {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  min-height: 62px;
}

.history-entry:not(:last-child)::before {
  position: absolute;
  top: 18px;
  bottom: -2px;
  left: 6px;
  width: 1px;
  background: var(--ink-200);
  content: "";
}

.history-marker {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 3px;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: var(--brand-600);
  box-shadow: 0 0 0 1px var(--brand-600);
}

.history-copy {
  padding-bottom: 15px;
}

.history-copy strong {
  display: block;
  font-size: 12px;
}

.history-copy p {
  margin: 3px 0;
  color: var(--ink-600);
  font-size: 11px;
  white-space: pre-wrap;
}

.history-meta {
  color: var(--ink-500);
  font-size: 10px;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 20px;
  border-top: 1px solid var(--ink-200);
  background: #fbfcfd;
}

.document-actions,
.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.workflow-actions {
  justify-content: flex-end;
}

.modal-dialog {
  width: min(500px, calc(100vw - 28px));
  max-width: none;
  border-radius: var(--radius-md);
}

.modal-dialog[open] {
  animation: modal-in 160ms ease-out;
}

.modal-card {
  padding: 21px;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.modal-header h2 {
  margin-bottom: 0;
  font-size: 20px;
}

.modal-description {
  margin: 12px 0 17px;
  color: var(--ink-600);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 19px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  color: var(--ink-900);
  background: var(--white);
  box-shadow: var(--shadow-md);
  animation: toast-in 180ms ease-out;
  pointer-events: auto;
}

.toast .icon {
  color: var(--brand-700);
}

.toast--error .icon {
  color: var(--red-700);
}

.toast > div {
  display: grid;
}

.toast strong {
  font-size: 12px;
}

.toast span {
  color: var(--ink-600);
  font-size: 11px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(28px); }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, 0.45fr));
  }

  .filters .select-field:nth-of-type(4) {
    grid-column: 2;
  }

  .form-grid--item {
    grid-template-columns: 130px minmax(200px, 1fr) repeat(2, minmax(115px, 0.42fr));
  }

  .field--item-description {
    grid-column: span 3;
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: 64px;
    padding: 7px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sidebar-brand,
  .sidebar-note {
    display: none;
  }

  .sidebar-nav {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 0;
    border: 0;
  }

  .nav-item {
    justify-content: center;
    padding: 7px 10px;
  }

  .nav-item.is-active {
    box-shadow: inset 0 3px #54c8bf;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 64px;
  }

  .topbar {
    justify-content: space-between;
  }

  .topbar-brand {
    display: flex;
  }

  .table-wrap {
    display: none !important;
  }

  .requirement-cards:not([hidden]) {
    display: block;
  }

  .filters {
    grid-template-columns: 1fr 1fr;
  }

  .search-field {
    grid-column: 1 / -1;
  }

  .filters .select-field:nth-of-type(4) {
    grid-column: auto;
  }

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

  .field--item-description,
  .field--span-item {
    grid-column: 1 / -1;
  }

  .drawer-dialog {
    width: min(620px, 100vw);
  }
}

@media (max-width: 700px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-context {
    display: none;
  }

  .auth-card-wrap {
    min-height: 100vh;
    padding: 20px;
  }

  .auth-card-heading .brand-mark {
    display: grid;
  }

  .topbar {
    height: 62px;
    padding: 0 16px;
  }

  .topbar-brand > span:last-child {
    display: none;
  }

  .session-user strong {
    max-width: 120px;
  }

  .page-section {
    padding: 23px 14px 38px;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 15px;
  }

  .page-heading > .button {
    width: 100%;
  }

  .page-heading--form {
    flex-direction: row;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }

  .metric-card {
    align-items: flex-start;
    padding: 13px;
  }

  .metric-icon {
    width: 34px;
    height: 34px;
  }

  .metric-icon .icon {
    width: 17px;
    height: 17px;
  }

  .metric-card strong {
    font-size: 22px;
  }

  .metric-card small {
    white-space: normal;
  }

  .card-heading,
  .filters {
    padding-left: 14px;
    padding-right: 14px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters .select-field:nth-of-type(4),
  .search-field {
    grid-column: auto;
  }

  .filters #clearFiltersButton {
    width: 100%;
  }

  .form-section {
    padding: 17px 14px;
  }

  .form-grid--two {
    grid-template-columns: 1fr;
  }

  .field--span-2 {
    grid-column: auto;
  }

  .section-heading--actions {
    align-items: stretch;
    flex-direction: column;
  }

  .section-heading--actions .button {
    width: 100%;
  }

  .form-grid--item {
    grid-template-columns: 1fr;
  }

  .field--item-description,
  .field--span-item {
    grid-column: auto;
  }

  .items-total {
    grid-template-columns: 1fr;
  }

  .items-total strong {
    grid-row: auto;
    margin-top: 4px;
  }

  .form-actions {
    bottom: 72px;
  }

  .drawer-dialog {
    width: 100vw;
  }

  .detail-meta-grid,
  .definition-list,
  .detail-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .drawer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .document-actions,
  .workflow-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .workflow-actions:has(:only-child) {
    grid-template-columns: 1fr;
  }
}

/* Órdenes de pago: una descripción, un beneficiario y un importe. */
#simpleModeSelector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#simpleModeSelector button {
  min-height: 40px;
}

#simpleBeneficiaryFields {
  grid-template-columns: 140px 180px minmax(260px, 1fr);
}

#simpleBeneficiaryFields .field--wide {
  grid-column: auto;
}

.simple-payment-core {
  grid-template-columns: 180px minmax(220px, 320px);
  justify-content: start;
}

.payment-description-detail p {
  margin: 0;
  color: var(--ink-950);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
}

#filtersForm.filters {
  grid-template-columns: minmax(280px, 1fr) minmax(170px, .35fr) minmax(150px, .3fr) auto;
}

@media (max-width: 900px) {
  #simpleBeneficiaryFields {
    grid-template-columns: 130px 170px minmax(220px, 1fr);
  }

  #filtersForm.filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  #simpleModeSelector,
  #simpleBeneficiaryFields,
  .simple-payment-core,
  .simple-bank-grid {
    grid-template-columns: 1fr;
  }

  #simpleModeSelector button {
    width: 100%;
  }
}

/* Perfil operativo: compacto, sin desbordes y con cuenta bancaria bajo demanda. */
#paymentProfileDialog.modal-dialog {
  width: min(720px, calc(100vw - 24px));
  max-width: 720px;
  max-height: calc(100dvh - 24px);
  margin: auto;
  overflow: hidden;
  border: 1px solid var(--ink-950);
  border-radius: 2px;
  background: var(--white);
  box-shadow: 10px 10px 0 rgba(216, 255, 79, .72), 0 28px 70px rgba(6, 22, 34, .28);
}

#paymentProfileDialog .payment-profile-card {
  width: 100%;
  max-width: none;
  max-height: calc(100dvh - 26px);
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 0;
  background: #fffdf7;
  box-shadow: none;
  scrollbar-gutter: stable;
}

.profile-modal-header {
  position: sticky;
  z-index: 3;
  top: 0;
  min-height: 94px;
  padding: 17px 20px 15px;
  color: #fffdf7;
  background: var(--ink-950);
}

.profile-modal-header .eyebrow {
  color: var(--acid, #d8ff4f);
}

.profile-modal-header h2 {
  margin: 2px 0 0;
  color: inherit;
  font-size: clamp(24px, 3vw, 30px);
  line-height: 1.05;
}

.profile-modal-header p {
  margin: 7px 0 0;
  color: rgba(255, 253, 247, .72);
  font-size: 12px;
}

.profile-modal-header .icon-button {
  flex: 0 0 auto;
  border-color: rgba(255, 255, 255, .42);
  color: #fff;
  background: transparent;
}

.profile-modal-header .icon-button:hover {
  color: var(--ink-950);
  background: var(--acid, #d8ff4f);
}

.profile-modal-body {
  display: grid;
  gap: 12px;
  padding: 14px 18px 8px;
}

.profile-section,
.profile-bank-panel {
  min-width: 0;
  margin: 0;
  border: 1px solid #aeb8b1;
  background: #fffefb;
}

.profile-section {
  padding: 13px 14px 15px;
  border-left: 4px solid #087e73;
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d9ddd8;
}

.profile-section-header div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.profile-section-header div > span,
.profile-bank-panel summary b {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid var(--ink-950);
  color: var(--ink-950);
  background: var(--acid, #d8ff4f);
  font-size: 9px;
  letter-spacing: .04em;
}

.profile-section-header strong,
.profile-bank-panel summary strong {
  color: var(--ink-950);
  font-size: 15px;
}

.profile-section-header > small {
  padding: 3px 7px;
  color: #0d625d;
  background: #e1f2ed;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, .72fr) minmax(0, 1.28fr);
  gap: 10px 12px;
}

.profile-grid > * {
  min-width: 0;
}

.profile-grid .field {
  gap: 4px;
}

.profile-grid .field > span {
  font-size: 10px;
  letter-spacing: .025em;
}

.profile-grid .field input,
.profile-grid .field select {
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 7px 10px;
  background-color: #fff;
}

.profile-field-wide {
  grid-column: 1 / -1;
}

.profile-bank-panel > summary {
  position: relative;
  display: flex;
  min-height: 55px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 48px 10px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.profile-bank-panel > summary::-webkit-details-marker {
  display: none;
}

.profile-bank-panel > summary > span {
  display: grid;
  min-width: 0;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 0 9px;
}

.profile-bank-panel > summary small {
  grid-column: 2;
  color: #60706a;
  font-size: 10px;
  line-height: 1.25;
}

.profile-bank-panel > summary::after {
  position: absolute;
  right: 15px;
  content: '+';
  color: #087e73;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
}

.profile-bank-panel[open] > summary {
  border-bottom: 1px solid #cbd2cd;
  background: #f3f5ef;
}

.profile-bank-panel[open] > summary::after {
  content: '−';
}

.profile-bank-grid {
  padding: 13px 14px 15px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-currency-field {
  max-width: 210px;
}

#paymentProfileDialog #paymentProfileAlert {
  margin: 8px 18px 0;
}

#paymentProfileDialog .profile-modal-actions {
  position: sticky;
  z-index: 3;
  bottom: 0;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 18px;
  border-top: 1px solid #aeb8b1;
  background: rgba(255, 253, 247, .98);
}

#paymentProfileDialog .profile-modal-actions .button {
  min-height: 40px;
}

@media (max-width: 620px) {
  #paymentProfileDialog.modal-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    box-shadow: 5px 5px 0 rgba(216, 255, 79, .72);
  }

  #paymentProfileDialog .payment-profile-card {
    max-height: calc(100dvh - 14px);
  }

  .profile-modal-header {
    min-height: 86px;
    padding: 14px;
  }

  .profile-modal-header p {
    max-width: 34ch;
  }

  .profile-modal-body {
    padding: 10px 10px 5px;
  }

  .profile-section {
    padding: 11px;
  }

  .profile-grid,
  .profile-bank-grid {
    grid-template-columns: 1fr;
  }

  .profile-field-wide,
  .profile-bank-panel > summary small {
    grid-column: 1;
  }

  .profile-bank-panel > summary > span {
    grid-template-columns: 27px minmax(0, 1fr);
  }

  .profile-bank-panel > summary small {
    grid-column: 2;
  }

  .profile-currency-field {
    max-width: none;
  }

  #paymentProfileDialog .profile-modal-actions {
    padding: 10px;
  }

  #paymentProfileDialog .profile-modal-actions .button--primary {
    flex: 1;
  }
}

/* Formulario operativo compacto */
#formView .quick-request-bar,
#requirementForm > .form-section {
  display: none !important;
}

#formView {
  max-width: 1180px;
  margin: 0 auto;
}

#formView .page-heading--form {
  min-height: 72px;
  margin-bottom: 8px;
  padding: 13px 18px;
}

#formView .page-heading--form h1 {
  font-size: clamp(25px, 2.5vw, 34px);
}

#formView .page-heading--form p {
  margin-top: 2px;
  font-size: 12px;
}

.simple-requirement-card {
  border: 1px solid var(--ink-900, #13211d);
  background: #fffdf7;
  box-shadow: 5px 5px 0 rgba(20, 34, 29, .10);
}

.simple-block {
  padding: 14px 18px;
  border-bottom: 1px solid #b8beb5;
}

.simple-block:last-child { border-bottom: 0; }

.simple-block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.simple-block-heading > div:first-child {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  column-gap: 9px;
}

.simple-block-heading h2 {
  margin: 0;
  font-family: var(--font-display, Georgia, serif);
  font-size: 19px;
  color: #10211c;
}

.simple-block-heading small {
  grid-column: 2;
  margin-top: 1px;
  color: #607168;
  font-size: 10px;
}

.simple-index {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #16251f;
  background: #d5ff3f;
  font: 800 9px/1 monospace;
}

.text-action {
  padding: 5px 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: #006d65;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.requester-facts {
  display: grid;
  grid-template-columns: .8fr 1.7fr 1fr 1fr;
  border: 1px solid #cad0c8;
  background: #f4f2e9;
}

.requester-facts > div {
  min-width: 0;
  padding: 9px 12px;
  border-right: 1px solid #cad0c8;
}

.requester-facts > div:last-child { border-right: 0; }
.requester-facts span { display: block; color: #627168; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.requester-facts strong { display: block; overflow: hidden; margin-top: 3px; color: #15231e; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }

.profile-warning {
  margin: 7px 0 0;
  color: #a03b25;
  font-size: 10px;
  font-weight: 700;
}

.choice-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.choice-strip button {
  min-height: 33px;
  padding: 6px 13px;
  border: 1px solid #25332e;
  background: #fffdf7;
  color: #1c2925;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.choice-strip button:hover,
.choice-strip button:focus-visible,
.choice-strip button.is-selected {
  background: #d5ff3f;
  box-shadow: 2px 2px 0 #15231e;
}

.choice-strip--small button { min-height: 29px; padding: 4px 11px; }

.simple-description-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
  margin-top: 10px;
}

.simple-description-grid textarea { min-height: 74px; resize: vertical; }
.simple-date-field small { display: block; margin-top: 4px; color: #4e6259; font-size: 9px; }

.simple-purchase-details,
.simple-payment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.simple-purchase-details[hidden],
.simple-payment-grid[hidden] { display: none; }

.simple-choice-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 10px;
  margin-top: 7px;
}

.simple-choice-row > span {
  color: #30433b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.simple-payment-grid .field--wide { grid-column: span 2; }
.simple-payment-core { padding-top: 8px; border-top: 1px dashed #b8c0b9; }
.simple-bank-grid { padding: 8px; background: #edf4ef; border-left: 3px solid #007a70; }
.simple-payment-hint { margin: 7px 0 0; color: #496158; font-size: 10px; }
.profile-bank-heading { padding-top: 8px; border-top: 1px dashed #bcc4bd; }
.profile-bank-heading strong, .profile-bank-heading small { display: block; }
.profile-bank-heading small { margin-top: 2px; color: #64756d; }

#requirementForm > .form-actions {
  position: sticky;
  bottom: 0;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #15231e;
  background: rgba(255, 253, 247, .97);
  box-shadow: 0 -4px 14px rgba(20, 34, 29, .08);
}

@media (max-width: 900px) {
  .requester-facts { grid-template-columns: 1fr 1fr; }
  .requester-facts > div:nth-child(2) { border-right: 0; }
  .requester-facts > div:nth-child(-n+2) { border-bottom: 1px solid #cad0c8; }
  .simple-payment-grid, .simple-purchase-details { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .simple-block { padding: 12px; }
  .simple-block-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .requester-facts, .simple-description-grid, .simple-payment-grid, .simple-purchase-details { grid-template-columns: 1fr; }
  .requester-facts > div { border-right: 0; border-bottom: 1px solid #cad0c8; }
  .requester-facts > div:last-child { border-bottom: 0; }
  .simple-choice-row { grid-template-columns: 1fr; }
  .simple-payment-grid .field--wide { grid-column: auto; }
  .choice-strip button { flex: 1 1 45%; }
}

@media (max-width: 440px) {
  .auth-card-wrap {
    padding: 0;
  }

  .auth-card {
    min-height: 100vh;
    padding: 27px 22px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .session-user > span:last-child {
    display: none;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .metric-card {
    align-items: center;
  }

  .form-actions {
    display: grid;
    grid-template-columns: 0.7fr 1.3fr;
  }

  .detail-meta-grid,
  .definition-list,
  .detail-item-grid {
    grid-template-columns: 1fr;
  }

  .document-actions,
  .workflow-actions {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .sidebar,
  .topbar,
  .page-heading,
  .metric-grid,
  .filters,
  .card-heading .button,
  .pagination,
  .form-actions,
  .toast-region {
    display: none !important;
  }

  .main-content {
    margin: 0;
  }

  .page-section {
    max-width: none;
    padding: 0;
  }

  .content-card {
    border: 0;
    box-shadow: none;
  }
}

/* ========================================================================== */
/* ORDEN DE PAGO — identidad visual del gestor operativo                       */
/* ========================================================================== */

:root {
  --ink-950: #101d1f;
  --ink-900: #182828;
  --ink-800: #29413f;
  --ink-700: #405957;
  --ink-600: #5b716e;
  --ink-500: #72847f;
  --ink-400: #9aa7a0;
  --ink-300: #bdbfb4;
  --ink-200: #d7d1c3;
  --ink-100: #e9e3d7;
  --ink-50: #f4f0e7;
  --white: #fffdf7;
  --brand-800: #075e5a;
  --brand-700: #087f79;
  --brand-600: #0c958d;
  --brand-100: #cce9e2;
  --brand-50: #e8f4ef;
  --amber-700: #7f5008;
  --amber-500: #d19a35;
  --amber-100: #f4e6b8;
  --green-700: #1d6e4c;
  --green-100: #d2ead9;
  --red-700: #9c3f2c;
  --red-100: #f2d5cd;
  --blue-700: #2348a7;
  --blue-100: #dce5ff;
  --purple-700: #704866;
  --purple-100: #eadce6;
  --orange-700: #9a4e24;
  --orange-100: #f4ddca;
  --acid: #d8ff4f;
  --copper: #b75c35;
  --cobalt: #2942d1;
  --paper: #f4f0e7;
  --paper-deep: #e8e0d1;
  --paper-line: rgba(16, 29, 31, 0.075);
  --shadow-sm: 3px 3px 0 rgba(16, 29, 31, 0.12);
  --shadow-md: 7px 7px 0 rgba(16, 29, 31, 0.18);
  --shadow-lg: 14px 14px 0 rgba(16, 29, 31, 0.24);
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --sidebar-width: 112px;
  --transition: 150ms cubic-bezier(.2, .8, .2, 1);
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
}

html,
body {
  background-color: var(--paper);
}

body {
  color: var(--ink-900);
  background-image:
    linear-gradient(var(--paper-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 26px 26px;
  font-size: 14px;
}

h1,
h2,
h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.035em;
}

strong,
.metric-card strong,
.requirement-number,
.numeric,
.dispatch-code,
.status-badge,
.payment-readiness-badge,
.priority-pill {
  font-variant-numeric: tabular-nums;
}

.eyebrow,
th,
.step-number,
.item-index,
.status-badge,
.payment-readiness-badge,
.priority-pill,
.requirement-number,
.dispatch-code {
  font-family: "Cascadia Mono", Consolas, monospace;
}

:focus-visible {
  outline: 3px solid var(--cobalt);
  outline-offset: 3px;
}

.eyebrow {
  margin-bottom: 8px;
  color: var(--brand-700);
  font-size: 10px;
  letter-spacing: .16em;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(216, 255, 79, .66);
  border-radius: 2px;
  color: var(--ink-950);
  background: var(--acid);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, .28);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 12px;
  transform: rotate(-2deg);
}

.brand-mark--compact {
  width: 36px;
  height: 36px;
  border-radius: 1px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .2);
}

.button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 1px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .01em;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
}

.button--primary {
  color: var(--ink-950);
  background: var(--acid);
  border-color: var(--ink-950);
  box-shadow: 4px 4px 0 var(--ink-950);
}

.button--primary:hover:not(:disabled) {
  color: var(--white);
  background: var(--brand-700);
  border-color: var(--ink-950);
  box-shadow: 6px 6px 0 var(--ink-950);
  transform: translate(-2px, -2px);
}

.button--secondary {
  color: var(--ink-950);
  background: var(--brand-100);
  border-color: var(--ink-950);
}

.button--ghost {
  color: var(--ink-900);
  background: transparent;
  border-color: var(--ink-400);
}

.button--ghost:hover:not(:disabled) {
  color: var(--white);
  background: var(--ink-900);
  border-color: var(--ink-900);
}

.button--compact {
  min-height: 40px;
  padding: 8px 12px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 1px;
}

.icon-button--bordered {
  border-color: var(--ink-400);
  background: var(--white);
  box-shadow: 2px 2px 0 var(--ink-200);
}

.field input,
.field select,
.field textarea,
.search-field input,
.select-field select {
  border-color: var(--ink-300);
  border-radius: 1px;
  color: var(--ink-950);
  background: rgba(255, 253, 247, .92);
  box-shadow: inset 0 -2px 0 rgba(16, 29, 31, .08);
}

.field input,
.field select,
.search-field input,
.select-field select {
  min-height: 46px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.search-field input:focus,
.select-field select:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(41, 66, 209, .16);
}

/* Acceso: portada editorial en lugar de tarjeta SaaS. */
.auth-shell {
  grid-template-columns: minmax(470px, 1.1fr) minmax(410px, .9fr);
}

.auth-context {
  padding: clamp(34px, 5vw, 78px);
  color: var(--white);
  background-color: var(--ink-950);
  background-image:
    linear-gradient(rgba(216, 255, 79, .06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 255, 79, .06) 1px, transparent 1px),
    radial-gradient(circle at 78% 28%, rgba(8, 127, 121, .55), transparent 38%);
  background-size: 32px 32px, 32px 32px, auto;
}

.auth-context::before {
  position: absolute;
  top: clamp(110px, 16vh, 180px);
  right: -32px;
  color: rgba(216, 255, 79, .1);
  content: "01";
  font: 900 clamp(180px, 25vw, 380px)/.8 "Cascadia Mono", Consolas, monospace;
}

.auth-context::after {
  right: 42px;
  bottom: 36px;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(216, 255, 79, .32);
  border-radius: 0;
  box-shadow: 22px 22px 0 rgba(216, 255, 79, .04), -22px -22px 0 rgba(8, 127, 121, .12);
  transform: rotate(45deg);
}

.auth-message h1 {
  max-width: 660px;
  font-size: clamp(48px, 6.3vw, 86px);
  line-height: .94;
}

.auth-message p {
  max-width: 570px;
  padding-left: 18px;
  border-left: 3px solid var(--acid);
  color: rgba(255, 255, 255, .74);
}

.auth-card-wrap {
  background-color: var(--paper);
  background-image: linear-gradient(90deg, transparent 49px, rgba(183, 92, 53, .14) 50px, transparent 51px);
}

.auth-card {
  position: relative;
  border: 1px solid var(--ink-950);
  border-radius: 2px;
  background: var(--white);
  box-shadow: 12px 12px 0 var(--ink-950);
}

.auth-card::before {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 11px;
  height: 11px;
  border: 1px solid var(--copper);
  content: "";
  transform: rotate(45deg);
}

.auth-card-heading h2 {
  font-size: 38px;
}

/* Riel de control. */
.sidebar {
  width: var(--sidebar-width);
  padding: 18px 11px;
  overflow: hidden;
  border-right: 1px solid rgba(216, 255, 79, .24);
  background-color: var(--ink-950);
  background-image: linear-gradient(180deg, rgba(8, 127, 121, .2), transparent 38%);
}

.sidebar::after {
  position: absolute;
  bottom: 175px;
  left: 50%;
  color: rgba(255, 255, 255, .12);
  content: "CONTROL · TRAZABILIDAD · 2026";
  font: 700 8px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .24em;
  white-space: nowrap;
  writing-mode: vertical-rl;
  transform: translateX(-50%) rotate(180deg);
}

.sidebar-brand {
  align-items: center;
  flex-direction: column;
  gap: 10px;
  padding: 0 0 21px;
  text-align: center;
}

.sidebar-brand > span:last-child {
  display: grid;
}

.sidebar-brand strong {
  font-size: 10px;
  white-space: normal;
}

.sidebar-brand small {
  color: rgba(216, 255, 79, .62);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 8px;
}

.sidebar-nav {
  gap: 8px;
  padding-top: 15px;
  border-top-color: rgba(216, 255, 79, .14);
}

.nav-item {
  min-height: 76px;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding: 10px 4px;
  border: 1px solid transparent;
  border-radius: 1px;
  color: rgba(255, 255, 255, .62);
  font-size: 10px;
  text-align: center;
}

.nav-item .icon {
  width: 22px;
  height: 22px;
}

.nav-item:hover,
.nav-item.is-active {
  color: var(--ink-950);
  background: var(--acid);
  border-color: var(--acid);
}

.nav-item.is-active {
  box-shadow: 4px 4px 0 rgba(8, 127, 121, .62);
}

.sidebar-note {
  position: relative;
  z-index: 1;
  align-items: center;
  flex-direction: column;
  gap: 7px;
  padding: 11px 5px;
  border-color: rgba(216, 255, 79, .2);
  border-radius: 1px;
  text-align: center;
}

.sidebar-note .status-dot {
  margin: 0;
}

.sidebar-note small {
  display: none;
}

.main-content {
  margin-left: var(--sidebar-width);
}

.topbar {
  height: 64px;
  justify-content: space-between;
  padding: 0 clamp(22px, 3vw, 48px);
  border-bottom: 1px solid rgba(16, 29, 31, .18);
  background: rgba(244, 240, 231, .9);
}

.topbar-brand {
  display: flex;
  color: var(--ink-700);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.avatar {
  border: 1px solid var(--ink-950);
  border-radius: 1px;
  color: var(--ink-950);
  background: var(--acid);
}

.page-section {
  width: min(100%, 1600px);
  padding: 34px clamp(22px, 3.4vw, 58px) 60px;
}

/* Cabecera de despacho. */
.dashboard-heading {
  position: relative;
  min-height: 272px;
  align-items: stretch;
  margin-bottom: 0;
  padding: clamp(34px, 4vw, 58px) clamp(28px, 4vw, 62px) 92px;
  overflow: hidden;
  border: 1px solid var(--ink-950);
  color: var(--white);
  background-color: var(--ink-950);
  background-image:
    linear-gradient(rgba(216, 255, 79, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 255, 79, .07) 1px, transparent 1px),
    radial-gradient(circle at 72% 10%, rgba(8, 127, 121, .62), transparent 35%);
  background-size: 28px 28px, 28px 28px, auto;
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 0 100%);
}

.dashboard-heading::after {
  position: absolute;
  right: clamp(180px, 20vw, 340px);
  bottom: -38px;
  color: rgba(216, 255, 79, .075);
  content: "01";
  font: 900 clamp(170px, 19vw, 310px)/.8 "Cascadia Mono", Consolas, monospace;
}

.dashboard-heading-copy,
.dispatch-action {
  position: relative;
  z-index: 1;
}

.dashboard-heading .eyebrow {
  color: var(--acid);
}

.dashboard-heading h1 {
  max-width: 760px;
  margin-bottom: 15px;
  font-size: clamp(46px, 5vw, 72px);
  line-height: .96;
}

.dashboard-heading p {
  max-width: 650px;
  color: rgba(255, 255, 255, .68);
  font-size: 15px;
}

.dispatch-action {
  display: flex;
  min-width: 220px;
  align-items: flex-end;
  justify-content: center;
  flex-direction: column;
  gap: 13px;
}

.dispatch-action .button {
  min-width: 210px;
}

.dispatch-action small {
  max-width: 240px;
  color: rgba(255, 255, 255, .52);
  font: 10px/1.4 "Cascadia Mono", Consolas, monospace;
  text-align: right;
  text-transform: capitalize;
}

.dispatch-code {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(216, 255, 79, .4);
  color: var(--white);
  font-size: 13px;
  letter-spacing: .13em;
}

.dispatch-code i {
  color: var(--acid);
  font-style: normal;
}

/* Banda de control: una pieza, no cuatro tarjetas sueltas. */
.metric-grid {
  position: relative;
  z-index: 3;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  gap: 0;
  margin: -64px 24px 28px;
  border: 1px solid var(--ink-950);
  background: var(--white);
  box-shadow: 8px 8px 0 rgba(16, 29, 31, .22);
}

.metric-card {
  position: relative;
  min-height: 128px;
  padding: 25px 20px 21px;
  border: 0;
  border-right: 1px solid var(--ink-300);
  border-radius: 0;
  background: var(--white);
  box-shadow: none;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card::before {
  position: absolute;
  top: 10px;
  right: 12px;
  color: var(--ink-400);
  content: attr(data-index);
  font: 800 9px/1 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .12em;
}

.metric-card::after {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 5px;
  background: var(--brand-700);
  content: "";
}

.metric-card:nth-child(2)::after { background: var(--amber-500); }
.metric-card:nth-child(3)::after { background: var(--green-700); }
.metric-card:nth-child(4)::after { background: var(--copper); }

.metric-card--primary {
  color: var(--ink-950);
  background: var(--acid);
}

.metric-card--primary::after {
  background: var(--ink-950);
}

.metric-card--primary span,
.metric-card--primary small,
.metric-card span,
.metric-card small {
  color: var(--ink-600);
}

.metric-card--primary span,
.metric-card--primary small {
  color: rgba(16, 29, 31, .68);
}

.metric-card span {
  font: 750 10px/1.2 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.metric-card strong {
  margin: 4px 0 1px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  line-height: 1;
}

.metric-card small {
  font-size: 11px;
}

.metric-icon {
  width: 44px;
  height: 44px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.metric-card--primary .metric-icon {
  color: var(--ink-950);
  background: rgba(255, 255, 255, .24);
}

/* Libro de registro. */
.content-card {
  border: 1px solid var(--ink-950);
  border-radius: 2px;
  background: rgba(255, 253, 247, .96);
  box-shadow: 7px 7px 0 rgba(16, 29, 31, .14);
}

.requirements-card {
  overflow: hidden;
  box-shadow: 9px 9px 0 var(--ink-950);
}

.card-heading {
  min-height: 92px;
  padding: 22px 25px;
  border-bottom: 1px solid var(--ink-950);
  background: var(--white);
}

.card-heading .eyebrow {
  margin-bottom: 2px;
  color: var(--copper);
}

.card-heading h2 {
  margin-bottom: 2px;
  font-size: 27px;
}

.filters {
  grid-template-columns: minmax(260px, 1.25fr) repeat(3, minmax(145px, .42fr)) auto;
  gap: 11px;
  padding: 17px 24px;
  border-bottom: 1px solid var(--ink-950);
  background-color: var(--paper-deep);
  background-image: linear-gradient(90deg, rgba(16, 29, 31, .06) 1px, transparent 1px);
  background-size: 22px 100%;
}

.search-field input,
.select-field select {
  min-height: 44px;
  border-color: var(--ink-400);
  border-radius: 1px;
  font-size: 12px;
}

.table-wrap {
  padding: 10px 14px 16px;
  background: var(--paper);
}

table {
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 12px;
}

th,
td {
  padding: 14px 13px;
}

th {
  border: 0;
  color: var(--ink-600);
  background: transparent;
  font-size: 9px;
  letter-spacing: .09em;
}

tbody tr {
  cursor: pointer;
}

tbody td {
  border-top: 1px solid var(--ink-200);
  border-bottom: 1px solid var(--ink-200);
  background: var(--white);
  transition: background var(--transition), transform var(--transition);
}

tbody td:first-child {
  border-left: 5px solid var(--brand-700);
}

tbody td:last-child {
  border-right: 1px solid var(--ink-200);
}

tbody tr.priority-URGENT td:first-child { border-left-color: var(--copper); }
tbody tr.priority-HIGH td:first-child { border-left-color: var(--amber-500); }
tbody tr.priority-LOW td:first-child { border-left-color: var(--ink-400); }

tbody tr:hover td,
tbody tr:focus-visible td {
  background: #f1f6e5;
}

tbody tr:hover td:first-child,
tbody tr:focus-visible td:first-child {
  transform: translateX(4px);
}

.order-cell {
  min-width: 175px;
}

.requirement-number {
  display: block;
  color: var(--ink-950);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: -.02em;
  white-space: nowrap;
}

.priority-pill {
  margin: 0 0 7px;
  padding: 3px 6px;
  border: 1px solid var(--ink-300);
  border-radius: 0;
  color: var(--ink-600);
  background: transparent;
  font-size: 8px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.priority-pill.priority-URGENT {
  color: var(--white);
  background: var(--copper);
  border-color: var(--copper);
}

.priority-pill.priority-HIGH {
  color: var(--ink-950);
  background: var(--amber-100);
  border-color: var(--amber-500);
}

.requirement-title {
  min-width: 230px;
  max-width: 400px;
}

.requirement-title strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-950);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.2;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.requirement-title small,
.cell-stack small {
  margin-top: 5px;
  font-size: 10px;
}

.cell-stack strong {
  font-size: 11px;
}

.amount-cell,
.updated-cell {
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 10px;
}

.status-badge,
.payment-readiness-badge {
  min-height: 26px;
  padding: 7px 9px;
  border-radius: 0;
  font-size: 8px;
  letter-spacing: .04em;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 0 100%);
  text-transform: uppercase;
}

.payment-readiness-INCOMPLETE {
  border-color: var(--amber-500);
  color: var(--amber-700);
  background: #fff7d6;
}

.payment-readiness-READY {
  border-color: var(--green-700);
  color: var(--white);
  background: var(--green-700);
}

.payment-readiness-NOT_ELIGIBLE {
  border-color: var(--copper);
  color: var(--copper);
  background: transparent;
}

.table-open {
  display: inline-flex;
  min-width: 104px;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--ink-950);
  border-radius: 0;
  color: var(--ink-950);
  background: var(--acid);
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}

.table-open:hover {
  color: var(--white);
  background: var(--ink-950);
}

.table-open .icon {
  width: 15px;
  height: 15px;
}

.requirement-cards {
  display: none !important;
}

.empty-state {
  background: var(--paper);
}

.pagination {
  border-top-color: var(--ink-950);
  background: var(--paper-deep);
}

/* Formularios como expediente por secciones. */
.page-heading--form {
  padding: 22px 25px;
  border: 1px solid var(--ink-950);
  background: var(--ink-950);
  color: var(--white);
  box-shadow: 7px 7px 0 rgba(16, 29, 31, .18);
}

.page-heading--form p {
  color: rgba(255, 255, 255, .62);
}

.page-heading--form .eyebrow {
  color: var(--acid);
}

.requirement-form {
  max-width: 1180px;
  gap: 22px;
}

.form-section {
  position: relative;
  padding: 28px;
}

.form-section::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 5px;
  background: var(--brand-700);
  content: "";
}

.section-heading h2 {
  font-size: 23px;
}

.step-number {
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink-950);
  border-radius: 0;
  color: var(--ink-950);
  background: var(--acid);
  box-shadow: 3px 3px 0 var(--ink-950);
}

.payment-section-note,
.payment-readiness-reason {
  padding: 13px 15px;
  border: 1px solid var(--amber-500);
  border-left: 5px solid var(--amber-500);
  border-radius: 0;
  background: #fff7d6;
}

.item-card {
  border-color: var(--ink-400);
  border-radius: 1px;
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink-100);
}

.item-header {
  border-bottom-color: var(--ink-400);
  background: var(--paper-deep);
}

.items-total {
  border: 1px solid var(--ink-950);
  border-radius: 1px;
  color: var(--ink-950);
  background: var(--acid);
  box-shadow: 5px 5px 0 var(--ink-950);
}

.items-total small {
  color: rgba(16, 29, 31, .62);
}

.form-actions {
  bottom: 18px;
  border-color: var(--ink-950);
  border-radius: 1px;
  background: rgba(255, 253, 247, .96);
  box-shadow: 7px 7px 0 var(--ink-950);
}

/* Detalle presentado como orden física. */
dialog::backdrop {
  background: rgba(16, 29, 31, .7);
  backdrop-filter: blur(4px);
}

.drawer-dialog {
  width: min(740px, 100vw);
  height: 100dvh;
}

.drawer-panel {
  background-color: var(--paper);
  background-image: linear-gradient(90deg, transparent 46px, rgba(183, 92, 53, .11) 47px, transparent 48px);
  box-shadow: -12px 0 0 rgba(216, 255, 79, .7);
}

.drawer-header {
  min-height: 88px;
  padding: 18px 25px;
  border-bottom-color: var(--ink-950);
  color: var(--white);
  background: var(--ink-950);
}

.drawer-header .eyebrow {
  color: var(--acid);
}

.drawer-content,
.detail-loading {
  padding: 25px 28px 25px 68px;
}

.detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--ink-950);
  background: var(--white);
  box-shadow: 5px 5px 0 var(--ink-950);
}

.detail-hero > span {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.detail-hero > strong {
  font: 700 23px/1 Georgia, "Times New Roman", serif;
  white-space: nowrap;
}

.detail-grid,
.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid var(--ink-300);
  background: var(--white);
}

.detail-grid > div,
.definition-list > div {
  min-width: 0;
  padding: 12px;
  border-right: 1px solid var(--ink-200);
  border-bottom: 1px solid var(--ink-200);
}

.detail-grid dt,
.definition-list dt {
  color: var(--ink-500);
  font: 750 9px/1.3 "Cascadia Mono", Consolas, monospace;
  text-transform: uppercase;
}

.detail-grid dd,
.definition-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.detail-section > h3,
.payment-detail-heading h3 {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ink-950);
  font-size: 19px;
}

.detail-items {
  display: grid;
  gap: 10px;
}

.detail-items > article {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--ink-300);
  background: var(--white);
}

.detail-items > article > span {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  color: var(--ink-950);
  background: var(--acid);
  font: 800 10px/1 "Cascadia Mono", Consolas, monospace;
}

.detail-items > article > div {
  display: grid;
  gap: 3px;
}

.detail-items small,
.detail-items em {
  color: var(--ink-600);
  font-size: 10px;
  font-style: normal;
}

.timeline {
  display: grid;
}

.timeline > article {
  position: relative;
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 11px;
  min-height: 66px;
}

.timeline > article::before {
  position: absolute;
  top: 14px;
  bottom: -4px;
  left: 6px;
  width: 1px;
  background: var(--ink-300);
  content: "";
}

.timeline > article:last-child::before {
  display: none;
}

.timeline > article > i {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 2px;
  border: 3px solid var(--paper);
  border-radius: 50%;
  background: var(--brand-700);
  box-shadow: 0 0 0 1px var(--brand-700);
}

.timeline > article > div {
  display: grid;
  align-content: start;
  padding-bottom: 15px;
}

.timeline span,
.timeline p {
  margin: 2px 0 0;
  color: var(--ink-600);
  font-size: 10px;
}

.drawer-footer {
  border-top-color: var(--ink-950);
  background: var(--paper-deep);
}

.modal-card {
  border: 1px solid var(--ink-950);
  border-radius: 1px;
  background: var(--white);
  box-shadow: 10px 10px 0 var(--acid);
}

.toast {
  border-color: var(--ink-950);
  border-radius: 1px;
  background: var(--white);
  box-shadow: 6px 6px 0 var(--ink-950);
}

@media (max-width: 1180px) {
  .dashboard-heading h1 {
    max-width: 620px;
  }

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

  .metric-card:nth-child(2) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ink-300);
  }

  .filters {
    grid-template-columns: minmax(240px, 1fr) repeat(2, minmax(145px, .45fr));
  }
}

@media (max-width: 860px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    inset: auto 0 0;
    width: 100%;
    height: calc(72px + env(safe-area-inset-bottom));
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--acid);
    border-right: 0;
  }

  .sidebar::after,
  .sidebar-brand,
  .sidebar-note {
    display: none;
  }

  .sidebar-nav {
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    padding: 0;
    border: 0;
  }

  .nav-item {
    min-height: 54px;
    flex-direction: row;
    gap: 9px;
    padding: 8px 12px;
    font-size: 11px;
  }

  .nav-item.is-active {
    box-shadow: 3px 3px 0 rgba(8, 127, 121, .62);
  }

  .main-content {
    margin-left: 0;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .dashboard-heading {
    min-height: 290px;
  }

  .dashboard-heading::after {
    right: 10%;
  }

  .metric-grid {
    margin-right: 16px;
    margin-left: 16px;
  }

  .table-wrap {
    display: none !important;
  }

  .requirement-cards:not([hidden]) {
    display: grid !important;
    gap: 10px;
    padding: 14px;
    background: var(--paper);
  }

  .requirement-card-mobile {
    position: relative;
    display: grid;
    gap: 12px;
    width: 100%;
    min-height: 190px;
    padding: 17px;
    border: 1px solid var(--ink-950);
    border-left: 6px solid var(--brand-700);
    border-radius: 0;
    color: var(--ink-900);
    background: var(--white);
    box-shadow: 5px 5px 0 rgba(16, 29, 31, .14);
    text-align: left;
  }

  .requirement-card-mobile.priority-URGENT { border-left-color: var(--copper); }
  .requirement-card-mobile.priority-HIGH { border-left-color: var(--amber-500); }

  .mobile-card-top,
  .mobile-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }

  .mobile-card-top .priority-pill {
    margin: 0;
  }

  .mobile-card-title {
    font: 700 19px/1.15 Georgia, "Times New Roman", serif;
  }

  .mobile-card-meta {
    color: var(--ink-600);
    font: 10px/1.4 "Cascadia Mono", Consolas, monospace;
  }

  .mobile-card-foot {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--ink-300);
  }

  .mobile-open-copy {
    margin-left: auto;
    color: var(--brand-700);
    font: 800 9px/1 "Cascadia Mono", Consolas, monospace;
    text-transform: uppercase;
  }

  .toast-region {
    bottom: calc(88px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 700px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-context {
    display: none;
  }

  .auth-card-wrap {
    min-height: 100dvh;
    padding: 24px;
  }

  .auth-card {
    box-shadow: 7px 7px 0 var(--ink-950);
  }

  .topbar {
    height: 62px;
    padding: 0 14px;
  }

  .page-section {
    padding: 22px 13px 44px;
  }

  .dashboard-heading {
    min-height: 0;
    flex-direction: column;
    gap: 27px;
    padding: 30px 24px 75px;
  }

  .dashboard-heading h1 {
    font-size: clamp(36px, 10vw, 46px);
    overflow-wrap: anywhere;
  }

  .dispatch-action {
    min-width: 0;
    align-items: flex-start;
  }

  .dispatch-action .button {
    width: 100%;
  }

  .dispatch-action small {
    text-align: left;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: -43px 10px 24px;
    box-shadow: 5px 5px 0 rgba(16, 29, 31, .22);
  }

  .metric-card {
    min-height: 145px;
    align-items: flex-start;
    flex-direction: column;
    padding: 21px 15px 17px;
  }

  .metric-card strong {
    font-size: 32px;
  }

  .card-heading,
  .filters {
    padding-right: 14px;
    padding-left: 14px;
  }

  .card-heading {
    align-items: flex-start;
  }

  .card-heading h2 {
    font-size: 23px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters .select-field:nth-of-type(4),
  .search-field {
    grid-column: auto;
  }

  .field input,
  .field select,
  .field textarea,
  .search-field input,
  .select-field select {
    font-size: 16px;
  }

  .form-section {
    padding: 21px 16px;
  }

  .form-grid--two,
  .form-grid--item {
    grid-template-columns: 1fr;
  }

  .field--span-2,
  .field--item-description,
  .field--span-item {
    grid-column: auto;
  }

  .drawer-dialog {
    width: 100vw;
    height: 100dvh;
  }

  .drawer-content,
  .detail-loading {
    padding: 19px;
  }

  .detail-grid,
  .definition-list {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    flex-direction: column;
  }

  .detail-items > article {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .detail-items > article > b {
    grid-column: 2;
  }

  .form-actions {
    bottom: calc(83px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 440px) {
  .auth-card-wrap {
    padding: 0;
  }

  .auth-card {
    min-height: 100dvh;
    border: 0;
    box-shadow: none;
  }

  .dashboard-heading {
    padding-right: 20px;
    padding-left: 20px;
  }

  .dashboard-heading::after {
    right: -20px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-card {
    min-width: 0;
  }

  .metric-card small {
    white-space: normal;
  }

  .requirement-card-mobile {
    min-height: 205px;
  }

  .form-actions {
    grid-template-columns: .8fr 1.2fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .requirements-card,
  .content-card {
    box-shadow: none;
  }
}

/* ========================================================================== */
/* MODO PRODUCTIVO — registro primero, mínimo espacio ornamental               */
/* ========================================================================== */

:root {
  --sidebar-width: 0px;
}

.sidebar {
  display: none !important;
}

.main-content {
  margin-left: 0;
  padding-bottom: 0;
}

.topbar {
  height: 58px;
  padding: 0 clamp(16px, 2.2vw, 34px);
  background: rgba(255, 253, 247, .96);
}

.topbar-brand {
  gap: 11px;
  color: var(--ink-950);
  text-transform: none;
}

.topbar-brand > span:last-child {
  display: grid;
  line-height: 1.15;
}

.topbar-brand strong {
  font-size: 12px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.topbar-brand small {
  margin-top: 2px;
  color: var(--ink-600);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 8px;
}

.topbar .brand-mark--compact {
  width: 34px;
  height: 34px;
  font-size: 9px;
}

.page-section {
  width: min(100%, 1760px);
  padding: 16px clamp(14px, 2.4vw, 38px) 38px;
}

.dashboard-heading {
  min-height: 0;
  align-items: center;
  margin-bottom: 12px;
  padding: 14px 18px;
  overflow: visible;
  border: 1px solid var(--ink-950);
  color: var(--ink-950);
  background: var(--white);
  box-shadow: 4px 4px 0 rgba(16, 29, 31, .12);
  clip-path: none;
}

.dashboard-heading::after {
  display: none;
}

.dashboard-heading .eyebrow {
  margin-bottom: 3px;
  color: var(--brand-700);
  font-size: 9px;
}

.dashboard-heading h1 {
  max-width: none;
  margin-bottom: 2px;
  color: var(--ink-950);
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1;
}

.dashboard-heading p {
  max-width: none;
  margin: 0;
  color: var(--ink-600);
  font-size: 11px;
}

.dispatch-action {
  min-width: 230px;
  gap: 5px;
}

.dispatch-action .button {
  min-width: 205px;
}

.dispatch-action small {
  max-width: none;
  color: var(--ink-500);
  font-size: 8px;
}

.requirements-card {
  box-shadow: 5px 5px 0 var(--ink-950);
}

.card-heading {
  min-height: 66px;
  padding: 10px 16px;
}

.card-heading .eyebrow {
  margin-bottom: 0;
  font-size: 8px;
}

.card-heading h2 {
  margin-bottom: 0;
  font-size: 22px;
  line-height: 1.05;
}

.card-heading p {
  margin-top: 3px;
  font: 9px/1.2 "Cascadia Mono", Consolas, monospace;
}

.metric-grid {
  position: static;
  z-index: auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 0;
  border-bottom: 1px solid var(--ink-950);
  background: var(--white);
  box-shadow: none;
}

.metric-card,
.metric-card--primary {
  min-height: 72px;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 0;
  border-right: 1px solid var(--ink-300);
  color: var(--ink-950);
  background: var(--white);
  box-shadow: none;
  text-align: left;
  cursor: pointer;
  appearance: none;
}

.metric-card:last-child {
  border-right: 0;
}

.metric-card::before {
  top: 7px;
  right: 8px;
  font-size: 7px;
}

.metric-card::after {
  height: 3px;
}

.metric-card:hover,
.metric-card:focus-visible {
  background: var(--brand-50);
}

.metric-card.is-selected {
  color: var(--ink-950);
  background: var(--acid);
  box-shadow: inset 0 0 0 2px var(--ink-950);
}

.metric-card.is-selected::after {
  background: var(--ink-950);
}

.metric-card--primary span,
.metric-card--primary small,
.metric-card span,
.metric-card small {
  color: var(--ink-600);
}

.metric-icon,
.metric-card--primary .metric-icon {
  width: 32px;
  height: 32px;
  border-color: currentColor;
  color: var(--brand-700);
  background: transparent;
}

.metric-icon .icon {
  width: 15px;
  height: 15px;
}

.metric-card > div:last-child {
  display: grid;
  min-width: 0;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 0 8px;
}

.metric-card span {
  grid-column: 1;
  font-size: 8px;
}

.metric-card strong {
  grid-row: span 2;
  grid-column: 1;
  margin: 1px 0 0;
  font-size: 25px;
}

.metric-card small {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  font-size: 9px;
  white-space: normal;
}

.filters {
  gap: 8px;
  padding: 9px 12px;
}

.search-field input,
.select-field select {
  min-height: 40px;
  font-size: 11px;
}

.filters .button {
  min-height: 40px;
}

.table-wrap {
  padding: 3px 9px 10px;
}

table {
  border-spacing: 0 5px;
}

th,
td {
  padding: 9px 10px;
}

th:first-child,
td:first-child {
  padding-left: 12px;
}

th:last-child,
td:last-child {
  padding-right: 12px;
}

.order-cell {
  min-width: 160px;
}

.priority-pill {
  margin-bottom: 4px;
  padding: 2px 5px;
  font-size: 7px;
}

.requirement-title strong {
  font-size: 13px;
}

.requirement-title small,
.cell-stack small {
  margin-top: 2px;
  font-size: 9px;
}

.status-badge,
.payment-readiness-badge {
  min-height: 23px;
  padding: 6px 7px;
  font-size: 7px;
}

.table-open {
  min-width: 94px;
  min-height: 38px;
  padding: 7px 9px;
  font-size: 8px;
}

.pagination {
  padding: 8px 14px;
}

/* Captura rápida: más campos visibles, menos desplazamiento. */
.page-heading--form {
  min-height: 0;
  margin-bottom: 10px;
  padding: 12px 16px;
  box-shadow: 4px 4px 0 rgba(16, 29, 31, .16);
}

.page-heading--form h1 {
  margin-bottom: 2px;
  font-size: 27px;
}

.page-heading--form p {
  font-size: 11px;
}

.heading-with-back {
  gap: 0;
}

.requirement-form {
  max-width: none;
  gap: 10px;
}

.form-section {
  padding: 15px 17px;
  box-shadow: 4px 4px 0 rgba(16, 29, 31, .1);
}

.section-heading {
  align-items: center;
  margin-bottom: 11px;
}

.section-heading h2 {
  font-size: 18px;
}

.section-heading p {
  font-size: 9px;
}

.step-number {
  width: 29px;
  height: 29px;
  box-shadow: 2px 2px 0 var(--ink-950);
  font-size: 8px;
}

.form-grid {
  gap: 10px;
}

.form-section[aria-labelledby="generalInfoTitle"] .form-grid--two,
.form-section[aria-labelledby="paymentDataTitle"] .form-grid--two {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field--span-4 {
  grid-column: span 4;
}

.field {
  gap: 3px;
}

.field > span:first-child,
.field > label:first-child {
  font-size: 10px;
}

.field input,
.field select,
.search-field input,
.select-field select {
  min-height: 39px;
  padding: 7px 9px;
}

.field textarea {
  min-height: 62px;
  padding: 8px 9px;
}

.field small {
  min-height: 12px;
  font-size: 9px;
}

.payment-section-note,
.payment-readiness-reason {
  margin-bottom: 10px;
  padding: 8px 10px;
  font-size: 9px;
}

.items-container {
  gap: 8px;
}

.item-header {
  padding: 7px 10px;
}

.form-grid--item {
  gap: 9px;
  padding: 10px;
}

.item-subtotal {
  padding: 6px 10px;
}

.items-total {
  margin-top: 9px;
  padding: 10px 12px;
  box-shadow: 3px 3px 0 var(--ink-950);
}

.items-total strong {
  font-size: 18px;
}

.form-actions {
  bottom: 10px;
  padding: 9px;
  box-shadow: 4px 4px 0 var(--ink-950);
}

@media (max-width: 980px) {
  .metric-card small {
    display: none;
  }

  .metric-card > div:last-child {
    grid-template-columns: 1fr;
  }

  .form-section[aria-labelledby="generalInfoTitle"] .form-grid--two,
  .form-section[aria-labelledby="paymentDataTitle"] .form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field--span-4 {
    grid-column: span 2;
  }
}

@media (max-width: 700px) {
  .main-content {
    padding-bottom: 0;
  }

  .topbar-brand small {
    display: none;
  }

  .topbar-brand strong {
    font-size: 10px;
  }

  .page-section {
    padding: 9px 8px 24px;
  }

  .dashboard-heading {
    min-height: 0;
    align-items: stretch;
    flex-direction: row;
    gap: 10px;
    padding: 10px 12px;
  }

  .dashboard-heading-copy {
    min-width: 0;
  }

  .dashboard-heading .eyebrow,
  .dashboard-heading p,
  .dispatch-action small {
    display: none;
  }

  .dashboard-heading h1 {
    margin: 5px 0 0;
    font-size: 24px;
    overflow-wrap: normal;
  }

  .dispatch-action {
    min-width: 150px;
    justify-content: center;
  }

  .dispatch-action .button {
    width: 100%;
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .metric-card,
  .metric-card--primary {
    min-height: 64px;
    align-items: center;
    flex-direction: row;
    padding: 8px 10px;
  }

  .metric-card:nth-child(2) {
    border-right: 0;
  }

  .metric-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--ink-300);
  }

  .metric-card strong {
    font-size: 22px;
  }

  .card-heading {
    min-height: 58px;
  }

  .card-heading h2 {
    font-size: 19px;
  }

  .filters {
    padding: 8px;
  }

  .requirement-cards:not([hidden]) {
    padding: 8px;
  }

  .requirement-card-mobile {
    min-height: 160px;
    padding: 13px;
  }

  .page-heading--form {
    align-items: center;
    flex-direction: row;
    padding: 10px 12px;
  }

  .page-heading--form h1 {
    font-size: 23px;
  }

  .page-heading--form p {
    display: none;
  }

  .form-section {
    padding: 13px 11px;
  }

  .form-section[aria-labelledby="generalInfoTitle"] .form-grid--two,
  .form-section[aria-labelledby="paymentDataTitle"] .form-grid--two {
    grid-template-columns: 1fr;
  }

  .field--span-4 {
    grid-column: auto;
  }

  .form-actions {
    bottom: 8px;
  }

  .toast-region {
    bottom: 16px;
  }
}

@media (max-width: 440px) {
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-heading h1 {
    font-size: 23px;
  }

  .dispatch-action {
    width: 100%;
  }

  .metric-icon {
    display: none;
  }
}

/* Cabecera consolidada: un solo contexto, un solo título operativo. */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.topbar-create {
  min-height: 38px;
  padding: 7px 13px;
  box-shadow: 2px 2px 0 var(--ink-950);
}

#dashboardView {
  padding-top: 12px;
}

#dashboardView > .requirements-card {
  min-height: calc(100dvh - 108px);
}

.card-heading h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1;
}

.card-heading h1 + p {
  margin-top: 5px;
}

@media (max-width: 700px) {
  .topbar-actions {
    gap: 5px;
  }

  .topbar-create {
    width: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    clip-path: none;
  }

  .topbar-create span {
    display: none;
  }

  #dashboardView {
    padding-top: 7px;
  }

  #dashboardView > .requirements-card {
    min-height: calc(100dvh - 82px);
  }

  .card-heading h1 {
    font-size: 25px;
  }
}

/* Conteos en la cabecera: línea de control, sin tarjetas. */
.topbar {
  display: grid;
  grid-template-columns: minmax(320px, auto) minmax(360px, 560px) auto;
  gap: 18px;
}

.header-metrics {
  display: flex;
  height: 100%;
  min-width: 0;
  align-items: stretch;
  border-right: 1px solid var(--ink-200);
  border-left: 1px solid var(--ink-200);
}

.header-metric {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid var(--ink-200);
  color: var(--ink-700);
  background: transparent;
  transition: color var(--transition), background var(--transition), box-shadow var(--transition);
}

.header-metric:last-child {
  border-right: 0;
}

.header-metric span {
  font: 750 7px/1.2 "Cascadia Mono", Consolas, monospace;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.header-metric strong {
  color: var(--ink-950);
  font: 700 20px/1 Georgia, "Times New Roman", serif;
}

.header-metric:hover,
.header-metric:focus-visible {
  color: var(--brand-700);
  background: var(--brand-50);
}

.header-metric.is-selected {
  color: var(--ink-950);
  background: transparent;
  box-shadow: inset 0 -4px var(--acid);
}

.header-metric.is-selected::after {
  position: absolute;
  right: 8px;
  bottom: 6px;
  left: 8px;
  height: 1px;
  background: var(--ink-950);
  content: "";
}

@media (max-width: 1180px) {
  .topbar {
    height: 98px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 57px 41px;
    gap: 0 12px;
  }

  .topbar-brand {
    grid-row: 1;
    grid-column: 1;
  }

  .topbar-actions {
    grid-row: 1;
    grid-column: 2;
  }

  .header-metrics {
    height: 41px;
    grid-row: 2;
    grid-column: 1 / -1;
    border-top: 1px solid var(--ink-200);
  }

  .header-metric strong {
    font-size: 17px;
  }

  #dashboardView > .requirements-card {
    min-height: calc(100dvh - 148px);
  }
}

@media (max-width: 700px) {
  .topbar {
    height: 94px;
    padding: 0 8px;
    grid-template-rows: 53px 41px;
    gap: 0 5px;
  }

  .topbar-brand {
    gap: 7px;
  }

  .topbar .brand-mark--compact {
    width: 31px;
    height: 31px;
  }

  .header-metrics {
    height: 41px;
  }

  .header-metric {
    gap: 4px;
    padding: 0 4px;
  }

  .header-metric span {
    font-size: 6px;
    letter-spacing: .02em;
  }

  .header-metric strong {
    font-size: 16px;
  }

  #dashboardView > .requirements-card {
    min-height: calc(100dvh - 112px);
  }
}

/* Buscador compacto de beneficiarios reutilizables. */
.beneficiary-lookup {
  position: relative;
  z-index: 12;
  min-width: 0;
  grid-column: 1 / -1;
  padding: 8px;
  border: 1px solid #bdc8c0;
  background: #f3f7f3;
}

.beneficiary-lookup[hidden],
.beneficiary-results[hidden],
.beneficiary-search-loading[hidden] {
  display: none !important;
}

.beneficiary-search-field > span:first-child {
  display: flex;
  align-items: center;
  gap: 7px;
}

.beneficiary-search-field > span:first-child small {
  min-height: 0;
  padding: 1px 5px;
  border: 1px solid #aeb9b2;
  color: #4d6258;
  font-size: 8px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.beneficiary-search-control {
  position: relative;
  display: block;
}

.beneficiary-search-control > .icon {
  position: absolute;
  top: 50%;
  left: 10px;
  z-index: 1;
  width: 15px;
  height: 15px;
  color: #52665d;
  transform: translateY(-50%);
  pointer-events: none;
}

.beneficiary-search-control input {
  width: 100%;
  padding-right: 82px;
  padding-left: 33px;
  background: #fffef9;
}

.beneficiary-search-loading {
  position: absolute;
  top: 50%;
  right: 9px;
  color: #496158;
  font-size: 9px;
  font-weight: 800;
  transform: translateY(-50%);
}

.beneficiary-results {
  position: absolute;
  top: calc(100% - 25px);
  right: 8px;
  left: 8px;
  z-index: 30;
  overflow-y: auto;
  max-height: min(238px, 42vh);
  border: 1px solid #17251f;
  background: #fffef9;
  box-shadow: 4px 4px 0 rgba(17, 31, 25, .18);
}

.beneficiary-option {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid #d5dcd7;
  color: #16251f;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.beneficiary-option:last-child {
  border-bottom: 0;
}

.beneficiary-option:hover,
.beneficiary-option:focus-visible {
  outline: 0;
  background: #eaff9c;
  box-shadow: inset 3px 0 #007a70;
}

.beneficiary-option > span {
  min-width: 0;
}

.beneficiary-option strong,
.beneficiary-option small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.beneficiary-option strong {
  font-size: 11px;
}

.beneficiary-option small {
  margin-top: 3px;
  color: #52665d;
  font-size: 9px;
}

.beneficiary-option .icon {
  width: 15px;
  min-width: 15px;
  height: 15px;
}

.beneficiary-results-empty {
  margin: 0;
  padding: 12px;
  color: #53675e;
  font-size: 10px;
}

.beneficiary-search-hint {
  display: block;
  min-height: 12px;
  margin-top: 4px;
  color: #52665d;
  font-size: 9px;
}

@media (max-width: 620px) {
  .beneficiary-lookup {
    padding: 7px;
  }

  .beneficiary-results {
    right: 7px;
    left: 7px;
  }
}
.tenant-logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
}

