:root {
  --bg: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --ink: #122033;
  --ink-soft: #33465b;
  --muted: #637487;
  --line: #dce5ee;
  --line-strong: #c8d4e0;
  --brand: #0f4c81;
  --brand-deep: #0a2f52;
  --brand-soft: #e8f1fa;
  --teal: #147d82;
  --green: #167a56;
  --green-soft: #e5f6ee;
  --amber: #9a6200;
  --amber-soft: #fff4dc;
  --red: #a52727;
  --red-soft: #fdecec;
  --violet: #5b4b9a;
  --shadow-sm: 0 1px 2px rgba(15, 35, 55, .06);
  --shadow-lg: 0 28px 70px rgba(8, 31, 54, .22);
  --radius: 14px;
  --radius-lg: 22px;
  --sidebar-width: 264px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button { cursor: pointer; }
svg { display: block; }
img { max-width: 100%; }

:focus-visible {
  outline: 3px solid rgba(20, 125, 130, .42);
  outline-offset: 2px;
  border-radius: 4px;
}

.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;
  top: 10px; left: 10px;
  z-index: 2000;
  transform: translateY(-160%);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  font-weight: 600;
}
.skip-link:focus { transform: translateY(0); }

.muted { color: var(--muted); }
.small-muted { color: var(--muted); font-size: .82rem; }
.mono { font-family: var(--mono); font-size: .86rem; letter-spacing: .02em; }

.eyebrow {
  margin: 0 0 6px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
}
.eyebrow--light { color: #9bd3d6; }

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.brand--inverse { color: #fff; }
.brand__mark {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 13px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
}
.brand__name { font-size: 1.1rem; }

/* ---------- Alertas y avisos ---------- */
.flash-stack {
  position: fixed;
  top: 18px; right: 18px;
  z-index: 1500;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 36px));
}
.flash {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  font-size: .9rem;
}
.flash--success { border-color: #b8e6d2; background: var(--green-soft); color: #0f5239; }
.flash--error { border-color: #f2c8c8; background: var(--red-soft); color: var(--red); }
.flash__close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  padding: 0 2px;
}
.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: .9rem;
}
.alert--danger { background: var(--red-soft); border-color: #f3cccc; color: var(--red); }
.alert__icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-weight: 800;
  font-size: .75rem;
}

/* ---------- Login ---------- */
.auth-page {
  background:
    radial-gradient(1100px 540px at 8% 0%, rgba(20, 125, 130, .14), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(15, 76, 129, .12), transparent 55%),
    var(--bg);
}
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, .94fr);
  gap: 22px;
  max-width: 1240px;
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 38px);
}
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 4vw, 54px);
  border-radius: 28px;
  color: #eaf5f8;
  background:
    radial-gradient(700px 420px at 85% 8%, rgba(30, 154, 160, .38), transparent 62%),
    linear-gradient(145deg, #082b4d 0%, #0c3b62 48%, #0b5559 100%);
  box-shadow: var(--shadow-lg);
}
.auth-brand::after {
  content: "";
  position: absolute;
  width: 430px; height: 430px;
  right: -170px; bottom: -180px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 0 0 46px rgba(255, 255, 255, .035), 0 0 0 92px rgba(255, 255, 255, .025);
  pointer-events: none;
}
.auth-brand__copy {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 42px 0;
}
.auth-brand h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.04em;
  font-weight: 750;
}
.auth-brand__lead {
  max-width: 490px;
  margin: 0 0 30px;
  color: rgba(234, 245, 248, .78);
  font-size: 1rem;
  line-height: 1.65;
}
.auth-features {
  display: grid;
  gap: 13px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: .92rem;
  color: rgba(234, 245, 248, .9);
}
.auth-features li { display: flex; align-items: center; gap: 10px; }
.auth-features__dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #65d4d7;
  box-shadow: 0 0 0 4px rgba(101, 212, 215, .14);
}
.auth-brand__foot {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(234, 245, 248, .52);
  font-size: .76rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(6px, 2vw, 20px);
}
.auth-panel__inner {
  width: min(100%, 430px);
  padding: clamp(26px, 4vw, 44px);
  background: var(--surface);
  border: 1px solid rgba(220, 229, 238, .85);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(15, 45, 75, .1);
}
.auth-panel__heading h2 {
  margin: 0 0 8px;
  font-size: 1.75rem;
  letter-spacing: -.03em;
}
.auth-panel__heading p { margin: 0 0 24px; font-size: .92rem; }

.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: .85rem; font-weight: 650; color: var(--ink-soft); }
.field input {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder { color: #93a2b2; }
.field input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 125, 130, .12);
}
.field__hint { margin: 0; font-size: .78rem; color: var(--muted); }
.field__hint--warning { color: var(--amber); font-weight: 600; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 48px; }
.password-toggle {
  position: absolute;
  top: 50%; right: 5px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}
.password-toggle:hover { background: var(--brand-soft); color: var(--brand); }
.password-toggle.is-active { color: var(--brand); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  font-weight: 650;
  font-size: .9rem;
  text-decoration: none;
  transition: background .15s, border-color .15s, transform .05s;
}
.button:active { transform: translateY(1px); }
.button--primary { background: var(--brand); color: #fff; }
.button--primary:hover { background: var(--brand-deep); text-decoration: none; }
.button--block { width: 100%; }
.button--ghost {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .16);
  color: #e6f0f6;
}
.button--ghost:hover { background: rgba(255, 255, 255, .13); text-decoration: none; }
.button:disabled { opacity: .75; cursor: wait; }
.button__spinner {
  display: none;
  width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.button.is-loading .button__spinner { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-help { margin: 20px 0 0; color: var(--muted); font-size: .8rem; line-height: 1.55; }
.auth-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .76rem;
}
.secure-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #23a36e;
  box-shadow: 0 0 0 3px rgba(35, 163, 110, .12);
}

/* ---------- Dashboard ---------- */
.dashboard-page { background: var(--bg); }
.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 22px 16px 18px;
  color: #dbe9f2;
  background:
    radial-gradient(500px 360px at 5% 0%, rgba(20, 125, 130, .3), transparent 65%),
    linear-gradient(180deg, #082b4d 0%, #0a3760 58%, #082b4d 100%);
  overflow-y: auto;
}
.sidebar__brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 22px; }
.sidebar__close {
  display: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
}
.tenant-chip {
  display: grid;
  gap: 3px;
  margin: 0 2px 22px;
  padding: 13px 14px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .1);
}
.tenant-chip__label {
  font-size: .65rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(219, 233, 242, .55);
}
.tenant-chip strong { font-size: .94rem; color: #fff; }
.tenant-chip__role { font-size: .76rem; color: #8fd0d3; }

.side-nav { display: grid; gap: 3px; }
.side-nav__link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(219, 233, 242, .76);
  font-size: .88rem;
  font-weight: 550;
  text-decoration: none;
}
.side-nav__link:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.side-nav__link.is-active {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: inset 3px 0 0 #65d4d7;
}
.side-nav__count {
  margin-left: auto;
  min-width: 23px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(101, 212, 215, .18);
  color: #a9e7e9;
  font-size: .7rem;
  text-align: center;
}
.sidebar__spacer { flex: 1; min-height: 20px; }
.sidebar__footer { display: grid; gap: 13px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.user-chip__avatar {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-weight: 700;
}
.user-chip__copy { display: grid; min-width: 0; }
.user-chip__copy strong { font-size: .82rem; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip__copy span { font-size: .7rem; color: rgba(219, 233, 242, .55); }
.logout-form { margin: 0; }
.sidebar__legal { margin: 0; text-align: center; color: rgba(219, 233, 242, .38); font-size: .66rem; letter-spacing: .04em; }

.app-main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px clamp(18px, 3vw, 40px);
  background: rgba(255, 255, 255, .86);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar__left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar__eyebrow { margin: 0; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.topbar__title { margin: 0; font-weight: 650; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__right { display: flex; align-items: center; gap: 14px; }
.topbar__date { color: var(--muted); font-size: .78rem; }
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--green-soft);
  color: #0f5d42;
  font-size: .72rem;
  font-weight: 650;
}
.topbar__menu { display: none; }

.icon-button {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.icon-button span[aria-hidden] {
  grid-column: 1;
  grid-row: 1;
  width: 17px; height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.icon-button span[aria-hidden]:nth-child(2) { transform: translateY(-5px); }
.icon-button span[aria-hidden]:nth-child(3) { transform: translateY(5px); }

.content {
  width: min(100%, 1500px);
  margin: 0 auto;
  padding: clamp(22px, 3.4vw, 44px);
  padding-bottom: 20px;
}
.section { margin-bottom: clamp(26px, 3.4vw, 42px); scroll-margin-top: 90px; }
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.page-heading h1 { margin: 0 0 6px; font-size: clamp(1.55rem, 2.5vw, 2.15rem); letter-spacing: -.035em; }
.page-heading p { margin: 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.section-head h2 { margin: 0; font-size: 1.12rem; letter-spacing: -.02em; }
.section-head .eyebrow { margin-bottom: 3px; }

.chain-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  font-size: .76rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.chain-pill__dot { width: 8px; height: 8px; border-radius: 50%; background: #9aa8b6; }
.chain-pill--ok { border-color: #b9e3d1; background: var(--green-soft); color: #0f5d42; }
.chain-pill--ok .chain-pill__dot { background: #1f9c6d; }
.chain-pill--bad { border-color: #f0c4c4; background: var(--red-soft); color: var(--red); }
.chain-pill--bad .chain-pill__dot { background: #c43d3d; }
.chain-pill--unknown .chain-pill__dot { background: var(--amber); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.stat-card {
  display: grid;
  gap: 2px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.stat-card__label { color: var(--muted); font-size: .72rem; font-weight: 600; line-height: 1.3; }
.stat-card strong { font-size: 1.7rem; letter-spacing: -.04em; line-height: 1.2; }
.stat-card__hint { color: #8b99a8; font-size: .68rem; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(330px, 100%);
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
}
.search:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 125, 130, .1); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: .84rem; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.data-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.data-table th {
  padding: 11px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .67rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fbfdff; }
.data-table .is-right { text-align: right; }
.data-table--compact td, .data-table--compact th { padding: 10px 12px; }
.table-sub { display: block; color: var(--muted); font-size: .74rem; margin-top: 2px; }
.empty-state { padding: 26px 18px !important; color: var(--muted); text-align: center; font-size: .84rem; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .68rem;
  font-weight: 700;
  white-space: nowrap;
  background: #edf2f7;
  color: var(--ink-soft);
}
.badge--sent { background: var(--brand-soft); color: var(--brand); }
.badge--downloaded { background: var(--green-soft); color: var(--green); }
.badge--expired { background: #f0f2f5; color: #6d7b8a; }
.badge--failed { background: var(--red-soft); color: var(--red); }
.badge--revoked { background: #f2ecfa; color: var(--violet); }
.badge--packaging { background: var(--amber-soft); color: var(--amber); }
.badge--pending { background: #eef2f7; color: #5d6d7e; }
.badge--ok { background: var(--green-soft); color: var(--green); }
.badge--warning { background: var(--amber-soft); color: var(--amber); }

.split-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(18px, 2.6vw, 30px); }
.timeline { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 6px 16px; box-shadow: var(--shadow-sm); }
.timeline__item { position: relative; display: flex; gap: 12px; padding: 11px 0 11px 4px; border-bottom: 1px solid #edf2f7; }
.timeline__item:last-child { border-bottom: 0; }
.timeline__dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px rgba(20, 125, 130, .1); }
.timeline__body { min-width: 0; flex: 1; }
.timeline__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: .83rem; }
.timeline__top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline__meta { margin: 2px 0 0; color: var(--muted); font-size: .73rem; }

.content-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding: 17px 2px 0;
  border-top: 1px solid var(--line);
  color: #8d9aa8;
  font-size: .72rem;
}

.nav-scrim { display: none; }

.noscript {
  position: fixed;
  bottom: 14px; left: 14px;
  max-width: 420px;
  padding: 10px 13px;
  border-radius: 9px;
  background: #fff8e7;
  border: 1px solid #f0dcae;
  color: #765300;
  font-size: .78rem;
  z-index: 1200;
}

@media (max-width: 1250px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1050px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr) minmax(350px, .9fr); }
  .auth-brand { padding: 34px; }
  .auth-brand h1 { font-size: 2.3rem; }
  .split-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; padding: 14px; }
  .auth-brand { min-height: 300px; padding: 28px; }
  .auth-brand__copy { padding: 28px 0; }
  .auth-brand h1 { font-size: 2.1rem; }
  .auth-features { display: none; }
  .auth-brand__foot { margin-top: 14px; }
  .auth-panel { padding: 8px 0 30px; }
  .auth-panel__inner { width: min(100%, 520px); }
}

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    width: min(var(--sidebar-width), 86vw);
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: var(--shadow-lg);
  }
  .app.is-nav-open .sidebar { transform: translateX(0); }
  .sidebar__close { display: block; }
  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: rgba(8, 25, 42, .46);
    backdrop-filter: blur(2px);
  }
  .app.is-nav-open .nav-scrim { display: block; }
  .topbar__menu { display: grid; }
  body.nav-open { overflow: hidden; }
  .page-heading { flex-direction: column; }
  .chain-pill { align-self: flex-start; }
}

@media (max-width: 680px) {
  .topbar { padding: 11px 15px; }
  .topbar__right .topbar__date { display: none; }
  .content { padding: 20px 15px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-head { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .content-footer { flex-direction: column; gap: 4px; }
  .flash-stack { top: 10px; right: 10px; width: calc(100vw - 20px); }
  .data-table { min-width: 620px; }
  .data-table--compact { min-width: 480px; }
  .auth-brand { min-height: 240px; }
  .auth-brand h1 { font-size: 1.75rem; }
  .auth-brand__lead { font-size: .9rem; margin-bottom: 0; }
  .auth-brand__foot { display: none; }
  .auth-panel__inner { padding: 24px 20px; }
}

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

/* ---------- Formularios de ingesta / destinatarios ---------- */
.side-nav__link--create {
  margin-top: 10px;
  background: rgba(101, 212, 215, .12);
  border: 1px dashed rgba(101, 212, 215, .35);
  color: #c8f1f2;
}
.side-nav__link--create:hover { background: rgba(101, 212, 215, .2); }
.side-nav__link--create.is-active { border-style: solid; background: rgba(101, 212, 215, .25); }
.side-nav__secondary {
  display: block;
  margin: 4px 0 0 12px;
  padding: 6px 10px;
  color: rgba(219, 233, 242, .62);
  font-size: .76rem;
  text-decoration: none;
}
.side-nav__secondary:hover, .side-nav__secondary.is-active { color: #fff; text-decoration: none; }

.page-heading--compact { margin-bottom: 20px; }
.page-heading__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.back-link { display: inline-block; margin-bottom: 8px; color: var(--muted); font-size: .8rem; font-weight: 600; }
.back-link:hover { color: var(--brand); }
.inline-link { font-size: .8rem; font-weight: 650; white-space: nowrap; }
.inline-form { display: inline; margin: 0; }
.alert--warning { background: var(--amber-soft); border-color: #efd9a7; color: #765300; }
.alert--warning .alert__icon { background: var(--amber); }
.alert a { color: inherit; font-weight: 700; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px); gap: clamp(18px, 2.6vw, 30px); align-items: start; }
.panel-form {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.field--full { grid-column: 1 / -1; }
.field select, .field .input, .panel-form .input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
}
.field select:focus, .field .input:focus, .panel-form .input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 125, 130, .12);
}
.field__error { margin: 0; color: var(--red); font-size: .78rem; font-weight: 600; }
.checkbox-field { display: flex; gap: 11px; align-items: flex-start; margin: 20px 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.checkbox-field input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--brand); }
.checkbox-field label { font-weight: 650; font-size: .86rem; }
.checkbox-field .field__hint { margin: 3px 0 0; }
.notice { margin: 20px 0; padding: 13px 15px; border-radius: 10px; border: 1px solid #cfe3df; background: #f1faf8; color: #275e57; font-size: .82rem; line-height: 1.55; }
.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.button--ghost-dark { background: var(--surface-soft); border-color: var(--line-strong); color: var(--ink-soft); }
.button--ghost-dark:hover { background: #eef3f8; text-decoration: none; }
.button--secondary { background: var(--brand-soft); border-color: #c9deef; color: var(--brand); }
.button--secondary:hover { background: #dcecf9; text-decoration: none; }
.button--small { min-height: 30px; padding: 5px 10px; font-size: .74rem; border-radius: 7px; }

.file-drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 26px 18px;
  border: 1.5px dashed #b9cadb;
  border-radius: 12px;
  background: var(--surface-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop:hover, .file-drop:focus-within, .file-drop.is-dragover { border-color: var(--teal); background: #f0faf9; }
.file-drop .file-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-drop__icon { color: var(--teal); margin-bottom: 5px; }
.file-drop__title { font-size: .9rem; font-weight: 650; }
.file-drop__hint { color: var(--muted); font-size: .75rem; }
.file-drop__name { margin-top: 8px; padding: 4px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink-soft); font-size: .74rem; font-family: var(--mono); }

.form-aside { padding: 22px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.form-aside h2 { margin: 0 0 14px; font-size: .98rem; }
.form-aside p { color: var(--muted); font-size: .82rem; line-height: 1.6; }
.form-aside__note { padding-top: 13px; border-top: 1px solid var(--line); font-size: .76rem !important; }
.steps { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 10px; }
.steps__num { flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: .72rem; }
.steps strong { display: block; font-size: .82rem; }
.steps span:last-child { color: var(--muted); font-size: .75rem; line-height: 1.45; }

@media (max-width: 980px) {
  .form-layout { grid-template-columns: 1fr; }
  .form-aside { order: -1; }
  .page-heading__actions { justify-content: flex-start; }
}
@media (max-width: 600px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-actions .button { width: 100%; }
}
.table-sub--error { color: var(--red); font-weight: 600; }
