:root {
  --ink: #0c1620;
  --navy: #102a3d;
  --navy-mid: #1a4560;
  --navy-deep: #08151f;
  --gold: #c4a35a;
  --gold-deep: #9a7c3a;
  --gold-soft: #ead9ad;
  --paper: #f3eee4;
  --cream: #faf7f1;
  --surface: #ffffff;
  --muted: #5c6a75;
  --line: rgba(16, 42, 61, 0.1);
  --line-strong: rgba(16, 42, 61, 0.16);
  --danger: #8b2e2e;
  --ok: #1f5c42;
  --warn: #8a5a12;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 16px 40px rgba(8, 21, 31, 0.12);
  --shadow-sm: 0 6px 18px rgba(8, 21, 31, 0.06);
  --sans: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --header-h: 68px;
  --sidebar-w: 252px;
  /* Tokens semánticos: lo que cambia entre tema claro y oscuro. */
  --title: var(--navy);
  --link: var(--navy-mid);
  --chip-bg: #f1f5f8;
  --track: #ece7dc;
  --soft: #faf7f1;
  --ghost-hover: rgba(16, 42, 61, 0.05);
  --field-bg: #fff;
  --field-border: #d8d2c6;
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --sidebar-top: #14364d;
  --sidebar-mid: var(--navy);
  --sidebar-bottom: var(--navy-deep);
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23102a3d' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  font-family: var(--serif);
}

html[data-tema="oscuro"] {
  --ink: #e4ecf3;
  --paper: #0a141d;
  --surface: #101f2b;
  --cream: #16232f;
  --muted: #93a4b3;
  --line: rgba(226, 238, 248, 0.1);
  --line-strong: rgba(226, 238, 248, 0.2);
  --gold-deep: #d7b76b;
  --title: #e8f0f7;
  --link: #8fc4e9;
  --chip-bg: rgba(143, 196, 233, 0.12);
  --track: rgba(226, 238, 248, 0.12);
  --soft: rgba(226, 238, 248, 0.04);
  --ghost-hover: rgba(226, 238, 248, 0.08);
  --field-bg: #16232f;
  --field-border: rgba(226, 238, 248, 0.18);
  --topbar-bg: rgba(12, 25, 35, 0.92);
  --sidebar-top: #0c1c28;
  --sidebar-mid: #091520;
  --sidebar-bottom: #050d14;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.3);
  --caret: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23a9c3d6' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
a:hover { color: var(--title); }
h1, h2, h3, h4, .hergo-sans {
  font-family: var(--sans);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--title);
}
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.hergo-logo { display: block; width: min(210px, 100%); height: auto; }
.hergo-logo--on-dark { filter: brightness(0) invert(1); }

/* ——— Auth ——— */
.hergo-auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 38%) 1fr;
  background: #f4f6f8;
}
.hergo-auth-brand {
  position: relative;
  overflow: hidden;
  color: #f7f4ee;
  padding: 3rem 2.6rem 1.7rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #00152a;
  background-image: url("../img/auth-columns.jpg");
  background-size: cover;
  background-position: 28% center;
}
.hergo-auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(0, 15, 30, 0.42) 0%, rgba(0, 18, 36, 0.74) 48%, rgba(0, 12, 25, 0.93) 100%),
    radial-gradient(ellipse at 20% 105%, rgba(197, 160, 89, 0.16), transparent 58%);
  pointer-events: none;
}
.hergo-auth-brand::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--gold) 35%, var(--gold-deep) 70%, transparent);
  opacity: 0.75;
  pointer-events: none;
}
.hergo-auth-brand-inner,
.hergo-auth-copy { position: relative; z-index: 1; }
.hergo-auth-brand .hergo-logo {
  width: min(168px, 62%);
  margin-bottom: 0.4rem;
  filter: brightness(0) invert(1) drop-shadow(0 2px 10px rgba(0, 10, 20, 0.55));
}
.hergo-auth-rule {
  width: 72px;
  height: 2px;
  border: 0;
  margin: 1.15rem 0 1.5rem;
  background: linear-gradient(90deg, var(--gold), rgba(196, 163, 90, 0.15));
}
.hergo-auth-hero {
  margin: 0 0 1.9rem;
  max-width: 20rem;
  font-family: "Playfair Display", var(--serif);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 10, 20, 0.5);
}
.hergo-auth-hero em { font-style: italic; color: var(--gold-soft); }
.hergo-auth-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1.05rem;
}
.hergo-auth-features li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.85rem;
  align-items: start;
  font-family: var(--sans);
}
.hergo-auth-ico {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(197, 160, 89, 0.5);
  background: rgba(10, 30, 52, 0.45);
  backdrop-filter: blur(2px);
  color: var(--gold);
  display: grid;
  place-items: center;
}
.hergo-auth-ico svg { width: 18px; height: 18px; }
.hergo-auth-features strong {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 0.15rem;
}
.hergo-auth-features span {
  color: rgba(247, 244, 238, 0.78);
  font-size: 0.9rem;
  line-height: 1.4;
}
.hergo-auth-copy {
  margin: 2rem 0 0;
  font-family: var(--sans);
  font-size: 0.75rem;
  color: rgba(247, 244, 238, 0.5);
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.hergo-auth-panel {
  position: relative;
  background-color: #eef1f5;
  background-image: url("../img/auth-hall.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  gap: 1.35rem;
}
.hergo-auth-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 65% 55% at 50% 46%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.12) 65%, transparent 100%),
    linear-gradient(180deg, rgba(252, 253, 254, 0.5) 0%, rgba(246, 249, 251, 0.4) 45%, rgba(214, 224, 233, 0.52) 100%);
  pointer-events: none;
}
.hergo-auth-panel > * { position: relative; z-index: 1; }
.hergo-auth-welcome { text-align: center; max-width: 28rem; }
.hergo-auth-welcome h1 {
  margin: 0 0 0.4rem;
  font-family: "Playfair Display", var(--serif);
  font-size: 2.05rem;
  font-weight: 600;
  color: #001a33;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.9);
}
.hergo-auth-welcome p {
  margin: 0;
  font-family: var(--sans);
  color: #47566a;
  font-size: 0.95rem;
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.85);
}
.hergo-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 2.15rem 2rem 1.85rem;
  border-radius: var(--radius);
}
.hergo-card h2 { margin: 0 0 0.35rem; font-size: 1.55rem; }
.hergo-login-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  box-shadow:
    0 1px 2px rgba(0, 26, 51, 0.04),
    0 12px 24px rgba(0, 26, 51, 0.07),
    0 32px 64px rgba(0, 26, 51, 0.12);
  text-align: center;
  padding: 2.35rem 2.1rem 1.9rem;
}
.hergo-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold) 50%, var(--gold-soft));
}
.hergo-login-mark {
  width: 76px;
  height: 76px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 25%, #123f63 0%, #001a33 70%);
  box-shadow:
    0 0 0 1px rgba(196, 163, 90, 0.55),
    0 0 0 6px rgba(196, 163, 90, 0.1),
    0 8px 18px rgba(0, 26, 51, 0.22);
  display: grid;
  place-items: center;
}
.hergo-logo--mark {
  width: 34px;
  height: auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.hergo-login-kicker {
  margin: 0 0 0.55rem;
  font-family: var(--sans);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
}
.hergo-login-card h2 {
  font-family: "Playfair Display", var(--serif);
  color: #001a33;
  font-size: 1.5rem;
  letter-spacing: 0;
}
.hergo-login-card form { text-align: left; margin-top: 1.35rem; }
.hergo-login-card .hergo-field { margin: 1.05rem 0; }
.hergo-login-card .hergo-field label {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.86rem;
  font-weight: 650;
  color: #16283a;
}
.hergo-input-wrap { position: relative; }
.hergo-input-ico {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #8a96a3;
  pointer-events: none;
  z-index: 1;
}
.hergo-input-ico svg { width: 18px; height: 18px; display: block; }
.hergo-input-wrap input[type="text"],
.hergo-input-wrap input[type="email"],
.hergo-input-wrap input[type="tel"],
.hergo-input-wrap input[type="password"] {
  padding: 0.8rem 2.7rem 0.8rem 2.6rem;
  border-color: #dbe2e9;
  background: #fcfdfe;
}
.hergo-input-wrap input:focus {
  background: #fff;
  border-color: var(--navy-mid);
}
.hergo-input-wrap input:focus ~ .hergo-input-ico,
.hergo-input-wrap:focus-within .hergo-input-ico { color: var(--navy-mid); }
.hergo-eye {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #8a96a3;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.hergo-eye:hover { color: var(--navy); background: rgba(16, 42, 61, 0.06); }
.hergo-eye svg { width: 18px; height: 18px; display: block; }
.hergo-eye .hergo-eye-shut { display: none; }
.hergo-eye[aria-pressed="true"] .hergo-eye-open { display: none; }
.hergo-eye[aria-pressed="true"] .hergo-eye-shut { display: block; }
.hergo-login-row {
  display: flex;
  justify-content: flex-end;
  margin: 0.35rem 0 1.25rem;
}
.hergo-login-card .hergo-link { margin-top: 0; }
.hergo-btn--block {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: linear-gradient(180deg, #17405e, var(--navy));
  box-shadow: 0 8px 18px rgba(0, 26, 51, 0.18);
}
.hergo-btn--block:hover { background: linear-gradient(180deg, #1d4d6f, #143953); }
.hergo-auth-legal {
  margin: 0;
  max-width: 27rem;
  text-align: center;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: #4c5a68;
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(3px);
}
.hergo-auth-legal svg { flex: 0 0 auto; margin-top: 0.15rem; }
.hergo-muted { color: var(--muted); font-size: 0.95rem; font-family: var(--sans); }

.hergo-field { margin: 0.95rem 0; }
.hergo-field label {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.38rem;
  color: var(--muted);
  font-weight: 650;
}
.hergo-field label .hergo-field-label-ico {
  width: 16px;
  height: 16px;
  color: var(--gold-deep);
  flex: 0 0 auto;
}
.hergo-alta-card > h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hergo-alta-card > h2 .hergo-field-label-ico {
  width: 20px;
  height: 20px;
}
.hergo-input-affix > span .hergo-ico {
  width: 16px;
  height: 16px;
  color: var(--gold-deep);
}
.hergo-input-wrap select,
.hergo-input-wrap input[type="date"],
.hergo-input-wrap input[type="datetime-local"],
.hergo-input-wrap input[type="number"],
.hergo-input-wrap textarea,
.hergo-input-wrap input[type="text"] {
  width: 100%;
  padding-left: 2.55rem;
}
.hergo-input-wrap textarea {
  padding-top: 0.75rem;
  min-height: 6.5rem;
}
.hergo-input-wrap .hergo-input-ico {
  top: 0.82rem;
  transform: none;
}
.hergo-input-wrap--area .hergo-input-ico { top: 0.78rem; }
.hergo-field .hergo-req {
  display: inline;
  color: #b42318;
  font-weight: 700;
  margin-left: 0.12rem;
}
.hergo-field small {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
}
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="tel"], select, textarea, input[type="file"] {
  width: 100%;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  padding: 0.68rem 0.82rem;
  font: 400 0.98rem/1.4 var(--sans);
  color: var(--ink);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:hover, select:hover, textarea:hover { border-color: #c4bba9; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-mid);
  box-shadow: 0 0 0 3px rgba(26, 69, 96, 0.12);
}
textarea { min-height: 96px; resize: vertical; }
select { appearance: none; background-image: var(--caret); background-repeat: no-repeat; background-position: right 0.85rem center; padding-right: 2rem; }

.hergo-btn {
  font-family: var(--sans);
  font-weight: 650;
  background: var(--navy);
  color: var(--cream);
  border: 1px solid transparent;
  padding: 0.72rem 1.15rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.94rem;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
}
.hergo-btn:hover { background: var(--navy-mid); color: #fff; }
.hergo-btn:active { transform: translateY(1px); }
.hergo-btn.ghost {
  background: transparent;
  color: var(--title);
  border-color: var(--line-strong);
}
.hergo-btn.ghost:hover { background: var(--ghost-hover); color: var(--title); }
.hergo-btn.gold {
  background: var(--gold);
  color: var(--navy-deep);
}
.hergo-btn.gold:hover { background: #d4b56c; color: var(--navy-deep); }
.hergo-link {
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 69, 96, 0.25);
}
.hergo-link:hover { border-bottom-color: var(--navy); }

.message {
  padding: 0.75rem 0.9rem;
  margin: 0 0 1rem;
  font-family: var(--sans);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
}
.message.error { background: #f8ecea; color: var(--danger); border: 1px solid #ead4d1; }
.message.success { background: #e8f2ec; color: var(--ok); border: 1px solid #cfe0d6; }

/* ——— Staff shell ——— */
.hergo-staff {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  background: var(--paper);
}
.hergo-sidebar {
  background: linear-gradient(180deg, var(--sidebar-top) 0%, var(--sidebar-mid) 45%, var(--sidebar-bottom) 100%);
  color: var(--cream);
  padding: 1.1rem 0 0.9rem;
  border-right: 1px solid rgba(196, 163, 90, 0.18);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: sticky;
  top: 0;
  max-height: 100vh;
}
.hergo-sidebar .brand {
  padding: 0.2rem 1.15rem 0.95rem;
  border-bottom: 1px solid rgba(196, 163, 90, 0.16);
}
.hergo-sidebar .brand .hergo-logo { width: 76px; margin-inline: auto; }
.hergo-nav-scroll { flex: 1; overflow-y: auto; padding: 0.5rem 0 0.4rem; }
.hergo-nav-scroll::-webkit-scrollbar { width: 6px; }
.hergo-nav-scroll::-webkit-scrollbar-thumb { background: rgba(234, 217, 173, 0.18); border-radius: 999px; }
.hergo-nav-group {
  margin: 0.9rem 0 0.3rem;
  padding: 0 1.35rem;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: rgba(234, 217, 173, 0.5);
}
.hergo-nav { list-style: none; margin: 0; padding: 0 0.5rem; }
.hergo-nav-row { display: flex; align-items: center; }
.hergo-nav-row > a {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: rgba(250, 247, 241, 0.78);
  text-decoration: none;
  padding: 0.52rem 0.7rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.hergo-nav-row > a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hergo-nav-row > a .hergo-ico { flex: 0 0 auto; color: rgba(234, 217, 173, 0.82); }
.hergo-nav-row > a.is-active .hergo-ico { color: var(--gold); }
.hergo-nav-caret {
  border: 0;
  background: transparent;
  color: rgba(234, 217, 173, 0.55);
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 6px;
  transition: transform 0.18s, color 0.15s;
}
.hergo-nav-caret:hover { color: #fff; }
.hergo-nav li.is-open .hergo-nav-caret { transform: rotate(180deg); }
.hergo-nav-sub { list-style: none; margin: 0.1rem 0 0.4rem; padding: 0 0 0 2.1rem; display: none; }
.hergo-nav li.is-open .hergo-nav-sub { display: block; }
.hergo-nav-sub a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.34rem 0.6rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: rgba(250, 247, 241, 0.62);
  text-decoration: none;
  border-radius: 6px;
}
.hergo-nav-sub a .hergo-ico { flex: 0 0 auto; opacity: 0.85; }
.hergo-nav-sub a:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.hergo-nav-row > a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.hergo-nav-row > a.is-active {
  background: rgba(196, 163, 90, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--gold);
}
.hergo-sidebar-foot { margin-top: auto; padding: 0.8rem 0.9rem 0; }
.hergo-support {
  border: 1px solid rgba(196, 163, 90, 0.28);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 0.75rem 0.8rem 0.8rem;
  font-family: var(--sans);
}
.hergo-support-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--gold-soft);
}
.hergo-support-text { margin: 0.2rem 0 0.65rem; font-size: 0.76rem; color: rgba(250, 247, 241, 0.58); }
.hergo-support-btn {
  display: block;
  text-align: center;
  padding: 0.42rem 0.6rem;
  border-radius: 7px;
  border: 1px solid rgba(196, 163, 90, 0.4);
  color: var(--gold-soft);
  text-decoration: none;
  font-size: 0.79rem;
  font-weight: 650;
}
.hergo-support-btn:hover { background: rgba(196, 163, 90, 0.16); color: #fff; }
.hergo-sidebar-version {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.8rem 0 0;
  padding: 0.65rem 0.35rem 0;
  border-top: 1px solid rgba(196, 163, 90, 0.16);
  font-family: var(--sans);
  font-size: 0.69rem;
  color: rgba(250, 247, 241, 0.42);
}

.hergo-main { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.hergo-topbar {
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 20;
}
.hergo-topbar-title { margin: 0; font-size: 1.1rem; font-weight: 650; flex: 1; }
.hergo-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  color: var(--title);
  place-items: center;
}
.hergo-mega,
.hergo-sidebar-acciones { display: none; }

@media (min-width: 961px) {
  .hergo-staff.is-menu-horizontal {
    grid-template-columns: 1fr;
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar {
    flex-direction: row;
    align-items: stretch;
    min-height: 0;
    max-height: none;
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 0 1rem;
    border-right: 0;
    border-bottom: 1px solid rgba(196, 163, 90, 0.18);
    overflow: visible;
    background: linear-gradient(180deg, #163a52 0%, var(--navy) 100%);
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar .brand {
    padding: 0.35rem 0.9rem 0.35rem 0;
    border-bottom: 0;
    display: flex;
    align-items: center;
    flex: 0 0 auto;
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar .brand .hergo-logo {
    width: 42px;
    margin-inline: 0;
  }
  .hergo-staff.is-menu-horizontal .hergo-nav-scroll {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex: 1;
    min-width: 0;
    overflow: visible;
    padding: 0;
  }
  .hergo-staff.is-menu-horizontal .hergo-nav-group { display: none; }
  .hergo-staff.is-menu-horizontal .hergo-nav {
    display: flex;
    align-items: stretch;
    flex-wrap: nowrap;
    padding: 0;
    gap: 0.1rem;
  }
  .hergo-staff.is-menu-horizontal .hergo-nav > li { position: relative; }
  .hergo-staff.is-menu-horizontal .hergo-nav > li:hover,
  .hergo-staff.is-menu-horizontal .hergo-nav > li.is-open { z-index: 6; }
  .hergo-staff.is-menu-horizontal .hergo-nav-row {
    height: 100%;
    padding: 0.55rem 0.12rem;
  }
  .hergo-staff.is-menu-horizontal .hergo-nav-row > a {
    padding: 0.42rem 0.55rem;
    border-radius: 8px;
    white-space: nowrap;
    font-size: 0.86rem;
    border: 1px solid transparent;
  }
  .hergo-staff.is-menu-horizontal .hergo-nav-row > a.is-active {
    color: var(--gold-soft);
    background: rgba(196, 163, 90, 0.14);
    box-shadow: inset 0 -2px 0 var(--gold);
  }
  .hergo-staff.is-menu-horizontal .hergo-nav > li:hover > .hergo-nav-row > a,
  .hergo-staff.is-menu-horizontal .hergo-nav > li.is-open > .hergo-nav-row > a {
    color: var(--gold-soft);
    border-color: rgba(196, 163, 90, 0.55);
    background: rgba(196, 163, 90, 0.08);
  }
  .hergo-staff.is-menu-horizontal .hergo-nav > li:hover > .hergo-nav-row > a .hergo-ico,
  .hergo-staff.is-menu-horizontal .hergo-nav > li.is-open > .hergo-nav-row > a .hergo-ico,
  .hergo-staff.is-menu-horizontal .hergo-nav-row > a.is-active .hergo-ico {
    color: var(--gold);
  }
  .hergo-staff.is-menu-horizontal .hergo-nav-caret {
    transform: none;
    width: 22px;
    margin-left: -0.15rem;
  }
  .hergo-staff.is-menu-horizontal .hergo-nav li.is-open .hergo-nav-caret,
  .hergo-staff.is-menu-horizontal .hergo-nav > li:hover .hergo-nav-caret {
    transform: rotate(180deg);
    color: var(--gold-soft);
  }
  .hergo-staff.is-menu-horizontal .hergo-nav-sub { display: none !important; }
  .hergo-staff.is-menu-horizontal .hergo-nav > li:hover .hergo-mega,
  .hergo-staff.is-menu-horizontal .hergo-nav > li.is-open .hergo-mega {
    display: grid;
  }
  .hergo-mega {
    position: absolute;
    top: 100%;
    left: 0;
    width: 34rem;
    grid-template-columns: 17rem 15.5rem;
    gap: 0.35rem;
    min-width: 34rem;
    min-height: 20rem;
    max-width: min(48rem, calc(100vw - 2rem));
    padding: 0.75rem;
    background: #fff;
    color: var(--ink);
    border-radius: 14px;
    box-shadow: 0 22px 48px rgba(8, 21, 31, 0.18);
    border: 1px solid rgba(16, 42, 61, 0.08);
    z-index: 40;
  }
  .hergo-mega.is-compact {
    grid-template-columns: 1fr;
    width: auto;
    min-width: 17.5rem;
    min-height: 0;
    max-width: 22rem;
  }
  .hergo-mega.is-compact .hergo-mega-mid { display: none; }
  .hergo-mega.is-compact .hergo-mega-cats {
    padding-right: 0;
    border-right: 0;
  }
  .hergo-mega-vacio {
    margin: 0;
    font: 400 0.82rem/1.4 var(--sans);
    color: var(--muted);
  }
  .hergo-staff.is-menu-horizontal .hergo-nav > li:nth-last-child(-n+2) .hergo-mega {
    left: auto;
    right: 0;
  }
  .hergo-mega-cats {
    display: grid;
    align-content: start;
    gap: 0.28rem;
    padding-right: 0.45rem;
    border-right: 1px solid var(--line);
  }
  .hergo-mega-cat {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.7rem;
    padding: 0.7rem 0.75rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--title);
  }
  .hergo-mega-cat:hover,
  .hergo-mega-cat.is-on {
    background: #f6f0e4;
    color: var(--navy);
  }
  .hergo-mega-cat-ico {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(16, 42, 61, 0.06);
    color: var(--navy-mid);
  }
  .hergo-mega-cat.is-on .hergo-mega-cat-ico,
  .hergo-mega-cat:hover .hergo-mega-cat-ico {
    background: rgba(196, 163, 90, 0.18);
    color: var(--gold-deep);
  }
  .hergo-mega-cat-txt { min-width: 0; }
  .hergo-mega-cat-txt strong {
    display: block;
    font: 700 0.92rem/1.2 var(--sans);
  }
  .hergo-mega-cat-txt small {
    display: block;
    margin-top: 0.18rem;
    color: var(--muted);
    font: 400 0.75rem/1.3 var(--sans);
  }
  .hergo-mega-cat-go { color: var(--muted); opacity: 0; }
  .hergo-mega-cat.is-on .hergo-mega-cat-go,
  .hergo-mega-cat:hover .hergo-mega-cat-go { opacity: 1; color: var(--gold-deep); }
  .hergo-mega-mid {
    padding: 0.35rem 0.85rem;
    min-width: 15.5rem;
    min-height: 18.5rem;
  }
  .hergo-mega-panel {
    min-width: 13.5rem;
    min-height: 18rem;
    box-sizing: border-box;
  }
  .hergo-mega-titulo {
    margin: 0 0 0.65rem;
    font: 700 0.95rem/1.2 var(--sans);
    color: var(--title);
  }
  .hergo-mega-links { list-style: none; margin: 0; padding: 0; }
  .hergo-mega-links a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.2rem;
    font: 500 0.9rem/1.3 var(--sans);
    color: var(--ink);
    text-decoration: none;
    border-radius: 6px;
  }
  .hergo-mega-links a .hergo-ico { color: var(--gold-deep); flex: 0 0 auto; }
  .hergo-mega-links a:hover { color: var(--navy); background: var(--soft); }
  .hergo-mega-atajos {
    display: grid;
    align-content: start;
    gap: 0.5rem;
    padding-left: 0.55rem;
    border-left: 1px solid var(--line);
  }
  .hergo-mega-card {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    color: var(--title);
    background: #fff;
  }
  .hergo-mega-card:hover {
    border-color: rgba(196, 163, 90, 0.45);
    background: #fbf8f1;
    color: var(--navy);
  }
  .hergo-mega-card-ico {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: rgba(16, 42, 61, 0.06);
    color: var(--navy-mid);
  }
  .hergo-mega-card-txt strong {
    display: block;
    font: 700 0.86rem/1.2 var(--sans);
  }
  .hergo-mega-card-txt small {
    display: block;
    margin-top: 0.12rem;
    color: var(--muted);
    font: 400 0.74rem/1.3 var(--sans);
  }
  html[data-tema="oscuro"] .hergo-mega {
    background: var(--surface);
    border-color: var(--line);
  }
  html[data-tema="oscuro"] .hergo-mega-cat:hover,
  html[data-tema="oscuro"] .hergo-mega-cat.is-on { background: rgba(196, 163, 90, 0.14); color: var(--title); }
  html[data-tema="oscuro"] .hergo-mega-card { background: var(--surface); }
  html[data-tema="oscuro"] .hergo-mega-card:hover { background: var(--soft); }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-foot { display: none; }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex: 0 1 auto;
    margin-left: auto;
    min-width: 0;
    padding: 0.35rem 0 0.35rem 0.6rem;
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-search {
    flex: 1 1 16rem;
    max-width: 22rem;
    min-width: 11rem;
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-search input[type="search"] {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-search input[type="search"]::placeholder {
    color: rgba(250, 247, 241, 0.42);
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-search input[type="search"]:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(196, 163, 90, 0.45);
    box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.12);
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-search-ico {
    color: rgba(250, 247, 241, 0.48);
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-icon-btn {
    color: rgba(250, 247, 241, 0.78);
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-icon-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-usermenu-btn {
    color: #fff;
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-usermenu-btn:hover {
    background: rgba(255, 255, 255, 0.08);
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-usermenu-btn .meta small {
    color: var(--gold-soft);
  }
  .hergo-staff.is-menu-horizontal .hergo-sidebar-acciones .hergo-usermenu-btn > .hergo-ico {
    color: rgba(250, 247, 241, 0.55);
  }
  .hergo-staff.is-menu-horizontal .hergo-main { min-height: 0; }
  .hergo-staff.is-menu-horizontal .hergo-topbar { display: none; }
}

@media (max-width: 1180px) and (min-width: 961px) {
  .hergo-staff.is-menu-horizontal .hergo-usermenu-btn .meta { display: none; }
  .hergo-mega:not(.is-compact) {
    grid-template-columns: 15rem minmax(12rem, 16rem);
  }
}

.hergo-orientacion {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1rem 0 0;
}
.hergo-orientacion-opcion {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--soft);
  cursor: pointer;
}
.hergo-orientacion-opcion.is-on,
.hergo-orientacion-opcion:has(input:checked) {
  border-color: var(--navy-mid);
  background: var(--chip-bg);
  box-shadow: inset 0 0 0 1px var(--navy-mid);
}
.hergo-orientacion-opcion input { accent-color: var(--navy); }
.hergo-orientacion-opcion strong { display: block; color: var(--title); }
.hergo-orientacion-opcion small { display: block; color: var(--muted); margin-top: 0.15rem; }
.hergo-orientacion-preview {
  flex: 0 0 auto;
  width: 42px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  overflow: hidden;
}
.hergo-orientacion-preview.is-vertical { grid-template-columns: 11px 1fr; }
.hergo-orientacion-preview.is-horizontal { grid-template-rows: 9px 1fr; }
.hergo-orientacion-preview i:first-child { background: var(--navy); }
.hergo-orientacion-preview i:last-child { background: var(--paper); }

.hergo-search { position: relative; flex: 1; max-width: 33rem; margin: 0; }
.hergo-search-ico {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.hergo-search input[type="search"] {
  width: 100%;
  padding: 0.56rem 0.95rem 0.56rem 2.5rem;
  border-radius: 999px;
  background: var(--soft);
  border: 1px solid var(--line);
  font-size: 0.9rem;
}
.hergo-search input[type="search"]:focus { background: var(--field-bg); }
.hergo-topbar-actions { display: flex; align-items: center; gap: 0.35rem; margin-left: auto; }
.hergo-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.hergo-icon-btn:hover { background: var(--ghost-hover); color: var(--title); }
.hergo-dot {
  position: absolute;
  top: 3px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  display: grid;
  place-items: center;
}
.hergo-ico.hergo-tema-oscuro { display: none; }
html[data-tema="oscuro"] .hergo-ico.hergo-tema-claro { display: none; }
html[data-tema="oscuro"] .hergo-ico.hergo-tema-oscuro { display: block; }

.hergo-usermenu { position: relative; font-family: var(--sans); }
.hergo-usermenu-btn {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.28rem 0.5rem;
  cursor: pointer;
  color: var(--title);
}
.hergo-usermenu-btn:hover { background: var(--ghost-hover); }
.hergo-usermenu-btn .meta { text-align: left; line-height: 1.25; }
.hergo-usermenu-btn .meta strong { display: block; font-size: 0.85rem; font-weight: 650; }
.hergo-usermenu-btn .meta small {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
}
.hergo-usermenu-btn > .hergo-ico { color: var(--muted); }
.hergo-usermenu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  min-width: 12.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.35rem;
  z-index: 40;
}
.hergo-usermenu-panel form { margin: 0; }
.hergo-usermenu-panel a,
.hergo-usermenu-panel button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 0.6rem;
  border: 0;
  background: transparent;
  border-radius: 7px;
  font: 650 0.87rem var(--sans);
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
}
.hergo-usermenu-panel a:hover,
.hergo-usermenu-panel button:hover { background: var(--ghost-hover); color: var(--title); }
.hergo-usermenu-panel button.is-danger { color: var(--danger); }
.hergo-usermenu-panel .hergo-ico { color: var(--muted); }
.hergo-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--navy-mid), var(--navy));
  color: var(--gold-soft);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.hergo-user .meta { text-align: right; }
.hergo-user .meta small {
  display: block;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 650;
}
.hergo-user form { margin: 0; }
.hergo-content {
  padding: 1.55rem 1.7rem 2.4rem;
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background-color: var(--paper);
  background-image: url("../img/fondo-contenido.jpg");
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: min(100%, 1080px) auto;
}
html[data-tema="oscuro"] .hergo-content {
  background-image:
    linear-gradient(180deg, rgba(10, 20, 29, 0.72), rgba(8, 21, 31, 0.78)),
    url("../img/fondo-contenido.jpg");
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: min(100%, 1080px) auto;
}
.hergo-content:has(.hergo-dash) { padding-bottom: 1.25rem; }
.hergo-content:has(.hergo-alta) {
  max-width: 100%;
  width: 100%;
}

.hergo-page-intro { margin: 0 0 1.15rem; max-width: 46rem; }

.hergo-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.3rem 1.4rem 1.25rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.hergo-panel h2 { margin: 0 0 0.85rem; font-size: 1.08rem; }
.hergo-kicker {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 0.25rem;
  font-weight: 700;
}

.hergo-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}
.hergo-page-head h2 { margin: 0.1rem 0 0.25rem; font-size: 1.45rem; }
.hergo-page-head p { margin: 0; }
.hergo-page-head .hergo-actions { margin: 0; }
.hergo-page-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.hergo-page-title-ico {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(196, 163, 90, 0.16);
  color: var(--gold-deep);
}

.hergo-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.hergo-kpi-grid.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hergo-kpi {
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 1.2rem 1.2rem 1.1rem;
  min-height: 124px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.hergo-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--gold);
}
.hergo-kpi strong {
  display: block;
  font-size: 1.85rem;
  color: var(--title);
  font-family: var(--sans);
  letter-spacing: -0.03em;
  margin-top: 0.15rem;
}
.hergo-kpi small { color: var(--muted); font-family: var(--sans); }
.hergo-kpi .hergo-progress-row { margin: 0.4rem 0 0.5rem; }
.hergo-kpi .hergo-progress-label { display: none; }

.hergo-dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}
.hergo-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}
.hergo-panel-head.is-inner { margin-top: 1.35rem; }
.hergo-panel-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hergo-chip {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--link);
  background: var(--chip-bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  white-space: nowrap;
}
.hergo-chip.is-quiet { background: var(--soft); color: var(--muted); }
.hergo-chip.is-soft { background: var(--chip-bg); color: var(--title); border-color: var(--line); }
.hergo-chip.is-warn { background: #f8f1e2; color: var(--warn); border-color: #ecdfc4; }

.hergo-figura { margin: 0; }
.hergo-figura.is-dona {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.hergo-grafica { width: 100%; height: auto; display: block; }
.hergo-grafica-guia { stroke: var(--line); stroke-width: 1; }
.hergo-dona-base { stroke: var(--track); }
.hergo-grafica-eje {
  font-family: var(--sans);
  font-size: 11px;
  fill: var(--muted);
}
.hergo-dona { width: 160px; height: 160px; flex: 0 0 160px; }
.hergo-dona-valor {
  font-family: var(--sans);
  font-size: 26px;
  font-weight: 700;
  fill: var(--title);
}
.hergo-dona-nota {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  fill: var(--muted);
}
.hergo-leyenda {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  margin-top: 0.75rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
}
.hergo-figura.is-dona .hergo-leyenda {
  flex-direction: column;
  margin-top: 0;
  flex: 1 1 10rem;
}
.hergo-leyenda-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.hergo-leyenda-item i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
  flex: 0 0 10px;
}

.hergo-dato {
  font-family: var(--sans);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--title);
  margin: 0.1rem 0 0;
  letter-spacing: -0.01em;
}
.hergo-kpi.is-money strong { color: var(--gold-deep); }
table.hergo-table th.is-num, table.hergo-table td.is-num { text-align: right; white-space: nowrap; }
table.hergo-table td.is-strong { font-weight: 700; color: var(--title); }

.hergo-list-item > .hergo-bar-track { display: block; margin: 0.5rem 0 0.1rem; }

.hergo-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.hergo-bar-row {
  display: grid;
  grid-template-columns: minmax(6rem, 34%) 1fr auto;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--sans);
  font-size: 0.9rem;
}
.hergo-bar-label { color: var(--muted); font-weight: 650; }
.hergo-bar-track { height: 9px; background: var(--track); border-radius: 999px; overflow: hidden; }
.hergo-bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--navy), var(--navy-mid));
  border-radius: inherit;
}
.hergo-bar-value { font-weight: 700; color: var(--title); min-width: 2rem; text-align: right; }

.hergo-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0 0 1rem;
}
.hergo-mini-stats.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hergo-mini-stats.is-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.hergo-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
}
.hergo-stats-grid > .hergo-panel { margin: 0; }
.hergo-mini-stats > div {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.8rem;
}
.hergo-mini-stats strong {
  display: block;
  margin-top: 0.4rem;
  font-family: var(--sans);
  font-size: 1.35rem;
  color: var(--title);
  letter-spacing: -0.02em;
}
.hergo-mini-stats span {
  display: block;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
}
.hergo-mini-stat-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--chip-bg, #eef3f6);
  color: var(--link, #1a4560);
}
.hergo-mini-stat-ico.is-gold { background: rgba(196, 163, 90, 0.16); color: var(--gold-deep); }
.hergo-mini-stat-ico.is-ok { background: rgba(31, 92, 66, 0.12); color: var(--ok); }

.hergo-list { list-style: none; margin: 0 0 0.4rem; padding: 0; }
.hergo-list-item { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.hergo-list-item:last-child { border-bottom: 0; }
.hergo-list.is-compact .hergo-list-item { padding: 0.6rem 0; }
.hergo-list-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--sans);
}
.hergo-list-main strong { font-weight: 700; }
.hergo-list-main a { text-decoration: none; }
.hergo-list-meta {
  margin: 0.25rem 0 0;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
}

.hergo-timeline { list-style: none; margin: 0; padding: 0 0 0 1.1rem; position: relative; }
.hergo-timeline::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.45rem;
  bottom: 0.45rem;
  width: 1px;
  background: var(--line-strong);
}
.hergo-timeline li { position: relative; padding: 0 0 0.95rem; }
.hergo-timeline li:last-child { padding-bottom: 0; }
.hergo-timeline li::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.45rem;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(196, 163, 90, 0.18);
}
.hergo-timeline-title {
  margin: 0;
  font-family: var(--sans);
  font-weight: 650;
  font-size: 0.93rem;
  color: var(--title);
}
.hergo-timeline-meta {
  margin: 0.15rem 0 0;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
}
.hergo-timeline-date {
  margin: 0.1rem 0 0;
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hergo-toolbar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.hergo-toolbar form {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: flex-end;
  flex: 1;
}
.hergo-toolbar .hergo-field { margin: 0; min-width: 168px; }

table.hergo-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
}
table.hergo-table th, table.hergo-table td {
  text-align: left;
  padding: 0.82rem 0.6rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.hergo-table th {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  background: var(--soft);
}
table.hergo-table tbody tr:hover td { background: var(--soft); }
table.hergo-table tbody tr.hergo-table-vacio:hover td { background: transparent; }
table.hergo-table .hergo-table-vacio td {
  text-align: center;
  padding: 2.2rem 1rem;
  border-bottom: 0;
}
table.hergo-table.is-listado .hergo-table-vacio td {
  background: var(--surface);
  color: inherit;
}
table.hergo-table a { font-weight: 650; text-decoration: none; }

.hergo-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.18rem 0.52rem;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
}
.hergo-badge.is-pending { background: #f4eee4; color: #6d5a3a; }
.hergo-badge.is-progress { background: #e7eef5; color: var(--navy); }
.hergo-badge.is-done { background: #e4efe8; color: var(--ok); }
.hergo-badge.is-final { background: #ece9f6; color: #4a3d8f; }
.hergo-badge.is-lock, .hergo-badge.is-muted { background: #ececec; color: #444; }
.hergo-badge.is-lock {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}
.hergo-badge.is-lock svg { width: 14px; height: 14px; flex: 0 0 auto; }
.hergo-badge.has-ico { gap: 0.28rem; }
.hergo-badge.has-ico svg { width: 13px; height: 13px; flex: 0 0 auto; }
.hergo-badge.is-danger { background: #f7e9e7; color: var(--danger); }
.hergo-via-celda {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.hergo-ico-btn.is-via-ok { color: var(--ok); }

.hergo-progress {
  height: 7px;
  background: var(--track);
  position: relative;
  flex: 1;
  border-radius: 999px;
  overflow: hidden;
}
.hergo-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--navy-mid), var(--gold));
  border-radius: inherit;
}
.hergo-progress-row { display: flex; align-items: center; gap: 0.7rem; margin: 0.45rem 0; }
.hergo-progress-label { font-family: var(--sans); font-size: 0.85rem; min-width: 3.2rem; font-weight: 650; color: var(--title); }

.hergo-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.95rem; }
.hergo-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.95rem; }
.hergo-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem 1rem;
  margin: 0.4rem 0 1rem;
}
.hergo-facts p { margin: 0.15rem 0 0; font-family: var(--sans); }
.hergo-person-card {
  border: 1px solid var(--line);
  padding: 1.05rem 1.1rem;
  background: var(--cream);
  margin-top: 0.85rem;
  border-radius: var(--radius);
}
.hergo-person-card h3 { margin: 0.1rem 0 0.35rem; }
.hergo-person-card.is-moral { border-left: 3px solid var(--gold); }
.hergo-person-card.is-done { background: #f4f5f3; }
.hergo-check-rol {
  margin: 0 0 0.35rem;
  font-family: var(--sans);
}
.hergo-check-rol span { font-weight: 600; }
.hergo-label-opcional {
  font-weight: 400;
  color: var(--muted, #6b6b6b);
  font-size: 0.85em;
}
.hergo-person-card.is-pendiente h3 { color: #7a5a12; }
.hergo-lock { font-size: 0.85rem; color: #555; font-family: var(--sans); margin: 0.4rem 0; }

div.hergo-req {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.58rem 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.hergo-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.85rem; align-items: center; }

.hergo-wizard-nav {
  display: flex;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.1rem;
  font-family: var(--sans);
  font-size: 0.88rem;
}
.hergo-wizard-nav li {
  padding: 0.55rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 650;
}
.hergo-wizard-nav li.is-current {
  border-color: var(--gold);
  background: var(--navy);
  color: var(--cream);
}

.hergo-alta { width: 100%; max-width: none; }
.hergo-alta-card h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.hergo-alta-section {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1.55rem 0 0.75rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
}
.hergo-alta-section svg { flex: 0 0 auto; color: var(--gold-deep); }
.hergo-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 0.35rem 0 1.35rem;
  margin: 0;
  font-family: var(--sans);
}
.hergo-stepper li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
  font-size: 0.92rem;
}
.hergo-stepper li + li::before {
  content: "";
  width: 52px;
  height: 2px;
  background: var(--line-strong);
  margin: 0 0.75rem 0 0.35rem;
}
.hergo-stepper-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  background: var(--surface);
}
.hergo-stepper li.is-current { color: var(--title); }
.hergo-stepper li.is-current .hergo-stepper-num,
.hergo-stepper li.is-done .hergo-stepper-num {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.hergo-stepper li.is-done { color: var(--title); }
.hergo-input-affix {
  display: flex;
  align-items: stretch;
}
.hergo-input-affix > span {
  display: grid;
  place-items: center;
  min-width: 2.4rem;
  padding: 0 0.7rem;
  border: 1px solid var(--field-border);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--chip-bg);
  color: var(--muted);
  font-family: var(--sans);
  font-weight: 700;
}
.hergo-input-affix input {
  flex: 1;
  min-width: 0;
  width: auto;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.hergo-field input:disabled,
.hergo-field input[readonly] {
  background: var(--chip-bg);
  color: var(--muted);
  cursor: default;
}
.hergo-form-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.hergo-info-banner {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: rgba(26, 69, 96, 0.07);
  border: 1px solid rgba(26, 69, 96, 0.12);
  color: var(--title);
  font-family: var(--sans);
  font-size: 0.92rem;
}
.hergo-info-banner p { margin: 0; }
.hergo-info-banner svg { flex: 0 0 auto; margin-top: 0.1rem; color: var(--navy-mid); }
html[data-tema="oscuro"] .hergo-info-banner {
  background: rgba(143, 196, 233, 0.1);
  border-color: rgba(143, 196, 233, 0.18);
}
html[data-tema="oscuro"] .hergo-info-banner svg { color: var(--link); }
.hergo-field.is-invalid label { color: var(--danger); }
.hergo-field.is-invalid input,
.hergo-field.is-invalid select,
.hergo-field.is-invalid textarea {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

body.hergo-modal-open { overflow: hidden; }
.hergo-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 0.85rem;
}
.hergo-modal[hidden] { display: none; }
.hergo-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 21, 31, 0.52);
  backdrop-filter: blur(3px);
}
.hergo-modal-dialog {
  position: relative;
  width: min(360px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  animation: hergo-modal-in 0.18s ease-out;
}
@keyframes hergo-modal-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.hergo-modal-header {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.75rem 0.55rem;
  border-bottom: 1px solid var(--line);
}
.hergo-modal-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: rgba(180, 35, 24, 0.1);
  color: var(--danger);
  flex: 0 0 auto;
}
.hergo-modal-icon svg { width: 16px; height: 16px; }
.hergo-modal-icon.is-navy {
  background: rgba(16, 42, 61, 0.08);
  color: var(--navy);
}
.hergo-modal-dialog.is-wide {
  width: min(980px, 100%);
  max-height: calc(100vh - 1.7rem);
  display: flex;
  flex-direction: column;
}
.hergo-modal-dialog.is-wide .hergo-modal-body {
  overflow: auto;
  flex: 1 1 auto;
  max-height: calc(100vh - 8.5rem);
  padding: 0.85rem 1rem 1rem;
}
.hergo-pp-layout.is-modal { gap: 0.85rem; }
.hergo-pp-layout.is-modal .hergo-pp-aside { position: static; }
.hergo-modal-header h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.94rem;
  line-height: 1.25;
  color: var(--title);
}
.hergo-modal-lead {
  margin: 0 0 0.45rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.35;
}
.hergo-modal-lead[hidden] { display: none; }
.hergo-modal-close {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
.hergo-modal-close:hover { background: var(--ghost-hover); color: var(--title); }
.hergo-modal-body {
  padding: 0.55rem 0.75rem 0.65rem;
}
.hergo-modal-body:empty { display: none; }
.hergo-validacion-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.2rem;
  font-family: var(--sans);
}
.hergo-validacion-lista li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0;
  color: var(--title);
  font-size: 0.84rem;
  line-height: 1.3;
}
.hergo-validacion-lista li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--danger);
  flex: 0 0 auto;
}
.hergo-modal-foot {
  display: flex;
  justify-content: flex-end;
  padding: 0.5rem 0.75rem 0.65rem;
  border-top: 1px solid var(--line);
  background: var(--cream);
}
.hergo-modal-foot .hergo-btn {
  padding: 0.48rem 0.85rem;
  font-size: 0.86rem;
}
html[data-tema="oscuro"] .hergo-modal-foot { background: rgba(255, 255, 255, 0.03); }

.hergo-char-count { text-align: right; }
.hergo-roles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.4rem;
}
.hergo-roles-grid .hergo-person-card { margin-top: 0; }
.hergo-resumen-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1.2rem;
  margin: 0.4rem 0 0;
  font-family: var(--sans);
}
.hergo-resumen-dl div { min-width: 0; }
.hergo-resumen-dl dt {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.hergo-resumen-dl dd { margin: 0.15rem 0 0; font-weight: 600; color: var(--title); }
.hergo-resumen-roles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  font-family: var(--sans);
}
.hergo-resumen-roles li {
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--soft);
}
.hergo-expediente {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hergo-expediente-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: 1rem;
  align-items: start;
}
.hergo-expediente-head .hergo-page-head { margin: 0; }
.hergo-expediente-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.hergo-expediente-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
}
.hergo-expediente-bloque {
  padding-top: 0.85rem;
  margin-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.hergo-expediente-bloque:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}
.hergo-expediente-bloque h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  color: var(--title);
}
.hergo-expediente-bloque h3 svg { color: var(--gold-deep); }
.hergo-dl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 1rem;
  margin: 0;
  font-family: var(--sans);
}
.hergo-dl-grid div { min-width: 0; }
.hergo-dl-grid dt {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.hergo-dl-grid dd {
  margin: 0.12rem 0 0;
  font-weight: 600;
  color: var(--title);
  font-size: 0.9rem;
  line-height: 1.35;
}
.hergo-expediente-nota {
  margin: 0;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--soft);
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--title);
}
.hergo-expediente-nota-pie { margin: 0.85rem 0 0; font-size: 0.88rem; }
.hergo-expediente-participantes-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.hergo-expediente-participantes-head h2 { margin: 0.1rem 0 0.25rem; font-size: 1.05rem; }
.hergo-expediente-participantes-head p { margin: 0; }
.hergo-expediente-vacio { margin: 0.85rem 0 0; }
.hergo-roles-resumen {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hergo-roles-resumen li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.76rem;
  background: var(--soft);
  color: var(--title);
}
.hergo-roles-resumen li.is-ok {
  border-color: rgba(31, 92, 66, 0.25);
  background: #eef5f0;
  color: var(--ok);
}
.hergo-roles-resumen li.is-pending {
  border-color: rgba(109, 90, 58, 0.25);
  background: #f8f3ea;
  color: #7a5a12;
}
.hergo-roles-resumen li small {
  font-weight: 650;
  opacity: 0.9;
}
.hergo-participantes-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.hergo-participante-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.9rem 0.95rem;
}
.hergo-participante-card.is-moral { border-left: 3px solid var(--gold); }
.hergo-participante-card.is-done { background: var(--soft); }
.hergo-participante-card.is-pendiente .hergo-participante-nombre { color: #7a5a12; }
.hergo-participante-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: start;
}
.hergo-participante-head .hergo-avatar-mini {
  width: 42px;
  height: 42px;
  font-size: 0.82rem;
}
.hergo-participante-meta { min-width: 0; }
.hergo-participante-meta .hergo-muted {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}
.hergo-participante-rol {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  font-family: var(--sans);
}
.hergo-participante-nombre {
  margin: 0.08rem 0 0.15rem;
  font-size: 1rem;
  line-height: 1.25;
}
.hergo-participante-tipo {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}
.hergo-participante-estado {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
}
.hergo-participante-avance { margin-top: 0.7rem; }
.hergo-participante-avance .hergo-avance { width: 100%; }
.hergo-participante-link {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}
.hergo-participante-link .hergo-kicker { margin-bottom: 0.35rem; }
.hergo-participante-acciones {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}
.hergo-participante-acciones form { margin: 0; }
.hergo-link-field {
  font-family: var(--sans);
  font-size: 0.85rem;
  background: var(--field-bg);
}
.hergo-copy-row { display: flex; gap: 0.45rem; align-items: stretch; }
.hergo-copy-row .hergo-link-field { flex: 1; }
.hergo-copy-row code {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-size: 0.82rem;
  color: var(--title);
}

/* Expediente detalle (v2) */
.hergo-expediente-v2 { gap: 0.85rem; }
.hergo-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
}
.hergo-breadcrumbs a { color: var(--navy-mid); text-decoration: none; font-weight: 650; }
.hergo-breadcrumbs a:hover { text-decoration: underline; }
.hergo-breadcrumbs .is-current { color: var(--title); font-weight: 650; }
.hergo-expediente-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.hergo-expediente-hero-main { min-width: 0; flex: 1 1 420px; }
.hergo-expediente-hero-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.hergo-expediente-titulo {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.hergo-expediente-titulo h1 {
  margin: 0.15rem 0 0;
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  letter-spacing: 0.02em;
}
.hergo-expediente-creada { margin: 0.45rem 0 0; font-size: 0.86rem; }
.hergo-exp-tabs {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid var(--line);
}
.hergo-exp-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.8rem;
  border: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  color: var(--muted);
  font: 650 0.84rem/1.2 var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.hergo-exp-tab svg { opacity: 0.75; }
.hergo-exp-tab.is-active {
  color: var(--navy);
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--navy);
}
.hergo-exp-tab-count {
  min-width: 1.25rem;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.72rem;
  text-align: center;
}
.hergo-exp-tab.is-active .hergo-exp-tab-count { background: #e8eef3; color: var(--navy); }
.hergo-exp-panel[hidden] { display: none !important; }
.hergo-expediente-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr);
  gap: 1rem;
  align-items: start;
}
.hergo-expediente-main,
.hergo-expediente-rail { display: grid; gap: 1rem; align-content: start; }
.hergo-exp-section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.85rem;
  font-size: 1rem;
}
.hergo-exp-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}
.hergo-exp-section-head .hergo-exp-section-title { margin: 0; }
.hergo-via-form .hergo-field { margin-bottom: 0.85rem; }
.hergo-via-actual {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.hergo-form-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.1rem;
}
.hergo-exp-grupo + .hergo-exp-grupo {
  margin-top: 1.05rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--line);
}
.hergo-exp-grupo h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 750;
}
.hergo-exp-grupo h3 svg { color: var(--navy-mid); opacity: 0.85; }
.hergo-exp-info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
  font-family: var(--sans);
}
.hergo-exp-info-grid--tight { margin-top: 0.75rem; }
.hergo-exp-info-grid dt {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.hergo-exp-info-grid dd {
  margin: 0.12rem 0 0;
  font-weight: 650;
  color: var(--title);
  font-size: 0.9rem;
  line-height: 1.35;
}
.hergo-exp-subgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
.hergo-exp-subbloque h3 {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.55rem;
  font-size: 0.86rem;
}
.hergo-dl-compact {
  display: grid;
  gap: 0.45rem;
  margin: 0;
  font-family: var(--sans);
}
.hergo-dl-compact dt {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.hergo-dl-compact dd { margin: 0.1rem 0 0; font-weight: 600; font-size: 0.88rem; }
.hergo-roles-resumen-inline { margin-bottom: 0.75rem; }
.hergo-pp-unificado { margin-top: 0.15rem; }
.hergo-pp-roles {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.4rem 0.75rem;
}
.hergo-pp-roles li {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--soft);
  font-family: var(--sans);
}
.hergo-pp-roles li strong {
  font-size: 0.78rem;
  color: var(--title);
}
.hergo-pp-roles li span {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 650;
}
.hergo-pp-roles li.is-ok { border-color: rgba(31, 92, 66, 0.18); background: #f3f7f4; }
.hergo-pp-roles li.is-ok span { color: var(--ok); }
.hergo-pp-roles li.is-pending { border-color: rgba(109, 90, 58, 0.16); background: #f8f5ef; }
.hergo-pp-roles li.is-pending span { color: #7a5a12; }
.hergo-pp-list { display: grid; gap: 0.7rem; }
.hergo-pp-fila {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.85rem 1rem;
  align-items: start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.hergo-pp-fila.is-moral { border-left: 3px solid var(--gold); }
.hergo-pp-fila.is-done { background: #f7f9fb; }
.hergo-pp-fila.is-pendiente .hergo-pp-nombre { color: #7a5a12; }
.hergo-pp-fila .hergo-avatar-mini {
  width: 42px;
  height: 42px;
  font-size: 0.82rem;
}
.hergo-pp-cuerpo { min-width: 0; }
.hergo-pp-rol {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  font-family: var(--sans);
}
.hergo-pp-nombre {
  margin: 0.12rem 0 0.2rem;
  font-size: 1.02rem;
  line-height: 1.25;
}
.hergo-pp-meta {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}
.hergo-pp-cuerpo .hergo-muted { margin: 0.28rem 0 0; font-size: 0.82rem; }
.hergo-pp-avance { margin-top: 0.65rem; max-width: 280px; }
.hergo-pp-avance .hergo-avance { width: 100%; }
.hergo-exp-dictamen { display: grid; gap: 0.45rem; }
.hergo-exp-dictamen .hergo-muted { margin: 0; font-size: 0.82rem; }
.hergo-exp-dictamen-acciones { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.hergo-pp-extras {
  margin-top: 0.75rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.7rem;
}
.hergo-pp-firma-ok {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--title);
  font-family: var(--sans);
}
.hergo-pp-docs {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.hergo-pp-docs-tit {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  font-family: var(--sans);
}
.hergo-pp-docs ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.hergo-pp-docs li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  line-height: 1.35;
}
.hergo-pp-docs li span { min-width: 0; color: var(--title); }
.hergo-pp-docs .hergo-muted { margin: 0; font-size: 0.82rem; }
.hergo-pp-lado {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.hergo-pp-acciones {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.25rem;
}
.hergo-pp-acciones form { margin: 0; }
.hergo-pp-pie { margin: 0.85rem 0 0; font-size: 0.82rem; }
.hergo-table-wrap,
.hergo-tabla-scroll { overflow-x: auto; }
.hergo-tabla-scroll:has(.hergo-menu[open]) { overflow: visible; }
table.hergo-table.hergo-exp-table { min-width: 720px; }
table.hergo-table.hergo-exp-table .hergo-avance { min-width: 120px; }
table.hergo-table td.is-sm { font-size: 0.82rem; }
.hergo-exp-inmueble-dir {
  margin: 0;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--title);
  line-height: 1.45;
}
.hergo-exp-rail-title {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
}
.hergo-exp-ring-panel { text-align: center; }
.hergo-exp-ring {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto 0.75rem;
}
.hergo-exp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hergo-exp-ring-bg {
  fill: none;
  stroke: var(--line);
  stroke-width: 2.6;
}
.hergo-exp-ring-fill {
  fill: none;
  stroke: var(--navy);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.hergo-exp-ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font: 700 1.35rem/1 var(--sans);
  color: var(--navy);
}
.hergo-exp-ring-stats {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: 0.84rem;
  color: var(--muted);
}
.hergo-exp-ring-stats li + li { margin-top: 0.25rem; }
.hergo-exp-estado-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  font-family: var(--sans);
}
.hergo-exp-estado-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.65rem;
  padding: 0.55rem 0 0.55rem 0.15rem;
  position: relative;
}
.hergo-exp-estado-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0.48rem;
  top: 1.45rem;
  bottom: -0.15rem;
  width: 2px;
  background: var(--line);
}
.hergo-exp-estado-step.is-done:not(:last-child)::after { background: rgba(31, 92, 66, 0.35); }
.hergo-exp-estado-dot {
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.15rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
}
.hergo-exp-estado-step.is-active {
  background: #eef4fa;
  border-radius: var(--radius-sm);
  padding-left: 0.55rem;
  margin-left: -0.4rem;
  padding-right: 0.4rem;
}
.hergo-exp-estado-step.is-active .hergo-exp-estado-dot {
  border-color: var(--navy);
  background: var(--navy);
  box-shadow: 0 0 0 3px rgba(15, 52, 96, 0.15);
}
.hergo-exp-estado-step.is-done .hergo-exp-estado-dot {
  border-color: var(--ok);
  background: var(--ok);
}
.hergo-exp-estado-step strong {
  display: block;
  font-size: 0.88rem;
  color: var(--title);
}
.hergo-exp-estado-step span {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.08rem;
}
.hergo-exp-fin-grid {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  font-family: var(--sans);
}
.hergo-exp-fin-grid dt {
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.hergo-exp-fin-grid dd {
  margin: 0.08rem 0 0;
  font-weight: 650;
  color: var(--title);
  font-size: 0.9rem;
}
.hergo-exp-quick {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.15rem;
}
.hergo-exp-quick button,
.hergo-exp-quick a {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.55rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--navy-mid);
  font: 650 0.86rem/1.3 var(--sans);
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}
.hergo-exp-quick button:hover:not(:disabled),
.hergo-exp-quick a:hover { background: var(--soft); }
.hergo-exp-quick button:disabled { opacity: 0.55; cursor: not-allowed; }
.hergo-exp-actividad {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.hergo-exp-actividad li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
}
.hergo-exp-actividad p {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--title);
}
.hergo-exp-actividad span {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.76rem;
  color: var(--muted);
  font-family: var(--sans);
}
.hergo-exp-actividad-more { margin-top: 0.85rem; }
.hergo-btn.is-sm { padding: 0.38rem 0.65rem; font-size: 0.82rem; }
.hergo-btn.is-full { width: 100%; justify-content: center; }

.hergo-callout {
  background: var(--cream);
  border: 1px solid var(--gold-soft);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
}
.hergo-callout .hergo-muted { margin: 0.15rem 0 0.7rem; }
.paginator {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-family: var(--sans);
}
.paginator a, .paginator span {
  display: inline-flex;
  min-width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--line);
  padding: 0 0.4rem;
  background: var(--surface);
  font-size: 0.85rem;
}
.paginator .current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ——— Listado de pólizas ——— */
.hergo-ico { width: 16px; height: 16px; display: block; flex: 0 0 auto; }
.hergo-link-plano {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--muted);
  text-decoration: none;
}
.hergo-link-plano:hover { color: var(--navy); }

.hergo-filtros { padding: 1.15rem 1.3rem 1.25rem; }
.hergo-filtros-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.9rem 1rem;
  align-items: end;
}
.hergo-filtros-grid .hergo-field { margin: 0; min-width: 0; }
.hergo-filtros-grid .hergo-field.is-ancho { grid-column: span 2; }
.hergo-filtros-grid.is-pagos {
  grid-template-columns: minmax(14rem, 2fr) repeat(3, minmax(0, 1fr)) auto;
}
.hergo-filtros-grid.is-pagos .hergo-field.is-ancho { grid-column: auto; }
.hergo-filtros-grid.is-pagos .hergo-filtros-cta {
  grid-column: auto;
  justify-content: flex-end;
}
.hergo-filtros-cta {
  grid-column: span 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1.1rem;
}

.hergo-panel.is-listado { padding: 0; }
.hergo-listado-head,
.hergo-listado-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.2rem;
  font-family: var(--sans);
}
.hergo-listado-head { border-bottom: 1px solid var(--line); }
.hergo-listado-foot { border-top: 1px solid var(--line); }
.hergo-listado-foot p { margin: 0; font-size: 0.85rem; }

.hergo-conteos {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
}
.hergo-conteo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbf9f5;
  color: #46555f;
  font-weight: 650;
  text-decoration: none;
}
.hergo-conteo.is-total {
  border: 0;
  background: transparent;
  padding-left: 0;
  color: var(--muted);
}
.hergo-conteo.is-total b {
  background: var(--navy);
  color: #fff;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
}
.hergo-conteo--en_proceso { background: #eef4f9; border-color: #d9e6f0; color: #1a4560; }
.hergo-conteo--vigente { background: #ecf5ef; border-color: #d3e6da; color: var(--ok); }
.hergo-conteo--enviada { background: #ecf5ef; border-color: #d3e6da; color: var(--ok); }
.hergo-conteo--finalizada { background: #f1eefa; border-color: #ddd6f1; color: #4a3d8f; }
.hergo-conteo--cancelada { background: #faeceb; border-color: #efd8d5; color: var(--danger); }
a.hergo-conteo:hover { border-color: var(--line-strong); color: var(--navy); }
a.hergo-conteo.is-activo {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.hergo-mostrar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.hergo-mostrar select {
  width: auto;
  padding: 0.36rem 1.9rem 0.36rem 0.6rem;
  font-size: 0.85rem;
}

.hergo-tabla-scroll { overflow-x: auto; }
.hergo-tabla-scroll:has(.hergo-menu[open]) { overflow: visible; }
table.hergo-table.is-listado { min-width: 1020px; }
table.hergo-table.is-listado th {
  background: var(--navy);
  color: rgba(250, 247, 241, 0.92);
  border-bottom: 0;
  white-space: nowrap;
  padding: 0.72rem 0.75rem;
}
table.hergo-table.is-listado td {
  padding: 0.72rem 0.75rem;
  vertical-align: middle;
  font-size: 0.9rem;
}
table.hergo-table.is-listado th:first-child,
table.hergo-table.is-listado td:first-child { padding-left: 1.2rem; }
table.hergo-table.is-listado th:last-child,
table.hergo-table.is-listado td:last-child { padding-right: 1.2rem; }
table.hergo-table.is-listado th.is-check,
table.hergo-table.is-listado td.is-check { width: 44px; }
table.hergo-table.is-listado td.is-folio a { color: var(--navy-mid); }
table.hergo-table.is-listado td.is-monto {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
  color: var(--navy);
  white-space: nowrap;
}
table.hergo-table.is-listado td.is-nota {
  max-width: 16rem;
  color: var(--muted);
}
table.hergo-table.is-listado input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--navy);
  cursor: pointer;
}
table.hergo-table td.is-doble strong {
  display: block;
  font-weight: 650;
  color: var(--navy);
}
table.hergo-table td.is-doble small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.hergo-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  color: inherit;
  text-decoration: none;
}
.hergo-sort::after {
  content: "⇅";
  font-size: 0.9em;
  opacity: 0.45;
}
.hergo-sort.is-asc::after { content: "↑"; opacity: 1; color: var(--gold-soft); }
.hergo-sort.is-desc::after { content: "↓"; opacity: 1; color: var(--gold-soft); }

.hergo-avance { display: grid; gap: 0.32rem; min-width: 84px; }
.hergo-avance-num { font-size: 0.82rem; font-weight: 700; color: #3d4d5a; }
.hergo-avance-track {
  display: block;
  height: 6px;
  border-radius: 999px;
  background: #e9e4d9;
  overflow: hidden;
}
.hergo-avance-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #9aa5ad;
}
.hergo-avance-track.is-completo > span,
.hergo-avance-track.is-alto > span { background: #2f8f5b; }
.hergo-avance-track.is-medio > span { background: #d69b2c; }
.hergo-avance-track.is-bajo > span { background: #c0563f; }

.hergo-persona { display: inline-flex; align-items: center; gap: 0.5rem; }
.hergo-avatar-mini {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.hergo-avatar-mini.is-vacio { background: #ececec; color: #7c8791; }
.hergo-avatar-mini.is-tono1 { background: #dceaf6; color: #1a4560; }
.hergo-avatar-mini.is-tono2 { background: #e3f0e6; color: var(--ok); }
.hergo-avatar-mini.is-tono3 { background: #ece7f8; color: #4a3d8f; }
.hergo-avatar-mini.is-tono4 { background: #fbe6ec; color: #8f3b57; }
.hergo-avatar-mini.is-tono5 { background: #f8eddc; color: var(--warn); }
.hergo-avatar-mini.is-tono6 { background: #dff0f0; color: #1c5b5b; }

.hergo-fila-acciones { display: flex; align-items: center; gap: 0.15rem; }
.hergo-fila-acciones form { margin: 0; display: inline-flex; }
.hergo-ico-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: #6b7883;
  cursor: pointer;
  text-decoration: none;
}
.hergo-ico-btn:hover { background: #f1f5f8; color: var(--navy); }
.hergo-ico-btn.is-ok:hover { color: var(--ok); }
.hergo-ico-btn.is-danger:hover { color: var(--danger); background: #f8eeee; }
.hergo-menu { position: relative; }
.hergo-menu > summary { list-style: none; }
.hergo-menu > summary::-webkit-details-marker { display: none; }
.hergo-menu[open] > summary { background: #f1f5f8; color: var(--navy); }
.hergo-menu-pop {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 25;
  min-width: 14rem;
  padding: 0.35rem;
  display: grid;
  gap: 0.1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.hergo-menu-pop a,
.hergo-menu-pop button {
  font: 650 0.88rem/1.3 var(--sans);
  text-align: left;
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #35434e;
  text-decoration: none;
  cursor: pointer;
}
.hergo-menu-pop a:hover,
.hergo-menu-pop button:hover { background: #f3eee4; color: var(--navy); }

.hergo-pager {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--sans);
}
.hergo-pager a,
.hergo-pager span {
  display: inline-flex;
  min-width: 2.1rem;
  height: 2.1rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #46555f;
  font-size: 0.85rem;
  text-decoration: none;
}
.hergo-pager a:hover { border-color: var(--line-strong); background: #f3eee4; color: var(--navy); }
.hergo-pager .is-current {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 700;
}
.hergo-pager .is-disabled { background: #fbf9f5; color: #a9b3bb; }
.hergo-pager .is-ellipsis { border-color: transparent; background: transparent; }

.hergo-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-family: var(--sans);
}
.hergo-empty .hergo-empty-ico,
.hergo-empty > .hergo-ico {
  display: inline-grid;
  margin: 0 auto 0.55rem;
  color: var(--gold-deep);
  opacity: 0.7;
}
.hergo-empty p { margin: 0; }
.hergo-lock > .hergo-ico {
  vertical-align: -3px;
  margin-right: 0.25rem;
}

.hergo-logo-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 0.9rem 1.1rem;
  margin: 0 0 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--navy);
}
.hergo-logo-preview.is-light { background: #f4f1ea; }
.hergo-logo-preview.is-light .hergo-logo--on-dark { filter: none; }
.hergo-logo-preview .hergo-logo { width: min(180px, 100%); margin: 0; }

.hergo-pp-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}
.hergo-pp-aside { position: sticky; top: 1rem; }
.hergo-pp-check {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  font-family: var(--sans);
  font-size: 0.86rem;
}
.hergo-pp-check li {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.hergo-pp-check .is-ok { color: var(--ok, #2c6b45); }
.hergo-pp-check .is-pending { color: var(--muted); }
.hergo-pp-lista {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hergo-pp-lista li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0;
  border-top: 1px solid var(--line);
  font-family: var(--sans);
}
.hergo-pp-lista li:first-child { border-top: 0; }
.hergo-pp-grupo + .hergo-pp-grupo { margin-top: 1.25rem; }
.hergo-pp-grupo h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.hergo-pp-index-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.hergo-doc-visor {
  display: grid;
  gap: 0.85rem;
}
.hergo-doc-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.hergo-doc-card header {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--line);
}
.hergo-doc-card header span {
  font-size: 0.84rem;
  color: var(--muted);
  word-break: break-word;
}
.hergo-doc-card img,
.hergo-doc-card iframe {
  display: block;
  width: 100%;
  border: 0;
  background: #f4f6f8;
}
.hergo-doc-card img {
  max-height: 520px;
  object-fit: contain;
}
.hergo-doc-card iframe {
  height: 480px;
}
.hergo-pp-layout.is-modal .hergo-doc-card iframe {
  height: min(420px, 55vh);
}
.hergo-doc-card > p {
  margin: 0;
  padding: 0.75rem 0.85rem;
}
.hergo-firma-preview {
  margin: 0;
  padding: 0.85rem 0.95rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.hergo-firma-preview img {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  background: #fff;
  border-radius: 8px;
}
.hergo-firma-preview figcaption {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.hergo-oculto-visual {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.hergo-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 21, 31, 0.45);
  z-index: 30;
}

@media (max-width: 1180px) {
  .hergo-kpi-grid.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1080px) {
  .hergo-facts { grid-template-columns: 1fr 1fr; }
  .hergo-dash-grid { grid-template-columns: 1fr; }
  .hergo-filtros-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hergo-filtros-grid .hergo-field.is-ancho { grid-column: span 3; }
  .hergo-filtros-cta { grid-column: span 3; }
}
@media (max-width: 960px) {
  .hergo-content { padding: 1.2rem 1rem 1.8rem; }
  .hergo-pp-layout { grid-template-columns: 1fr; }
  .hergo-pp-aside { position: static; }
  .hergo-expediente-grid { grid-template-columns: 1fr; }
  .hergo-expediente-layout { grid-template-columns: 1fr; }
  .hergo-exp-info-grid { grid-template-columns: 1fr 1fr; }
  .hergo-exp-subgrid { grid-template-columns: 1fr; }
  .hergo-expediente-hero-acciones { width: 100%; }
  .hergo-dl-grid { grid-template-columns: 1fr; }
  .hergo-pp-fila { grid-template-columns: auto 1fr; }
  .hergo-pp-lado {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
  }
  .hergo-pp-acciones { justify-content: flex-start; }
  .hergo-participante-head { grid-template-columns: auto 1fr; }
  .hergo-participante-estado {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  .hergo-auth { grid-template-columns: 1fr; }
  .hergo-auth-brand {
    min-height: 260px;
    padding: 1.8rem 1.4rem 1.3rem;
    background-position: 20% center;
  }
  .hergo-auth-brand::after { display: none; }
  .hergo-auth-hero { font-size: 1.3rem; margin-bottom: 1.2rem; }
  .hergo-auth-features { gap: 0.8rem; }
  .hergo-auth-copy { margin-top: 1.3rem; }
  .hergo-staff { grid-template-columns: 1fr; }
  .hergo-sidebar {
    position: fixed;
    z-index: 40;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    max-height: 100vh;
  }
  .hergo-staff.is-nav-open .hergo-sidebar { transform: none; }
  .hergo-staff.is-nav-open .hergo-overlay { display: block; }
  .hergo-menu-btn { display: inline-grid; place-items: center; }
  .hergo-search { max-width: none; }
  .hergo-kpi-grid, .hergo-grid-3 { grid-template-columns: 1fr 1fr; }
  .hergo-roles-grid { grid-template-columns: 1fr 1fr; }
}

.hergo-catalog-desc {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}
.hergo-catalog-add {
  display: grid;
  grid-template-columns: 1fr 14rem auto;
  gap: 0.75rem;
  align-items: end;
}
.hergo-catalog-add .hergo-field { margin: 0; }
.hergo-catalog-add-cta { display: flex; align-items: end; }
.hergo-catalog-inline {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.hergo-catalog-inline input {
  width: 14rem;
  max-width: 100%;
}
.hergo-catalog-sort {
  display: inline-flex;
  gap: 0.45rem;
}
table.hergo-table tr.is-muted td { color: var(--muted); }

@media (max-width: 720px) {
  .hergo-grid-2, .hergo-kpi-grid, .hergo-kpi-grid.is-4, .hergo-grid-3, .hergo-facts { grid-template-columns: 1fr; }
  .hergo-mini-stats,
  .hergo-mini-stats.is-4,
  .hergo-mini-stats.is-5 { grid-template-columns: 1fr 1fr; }
  .hergo-stats-grid { grid-template-columns: 1fr; }
  .hergo-bar-row { grid-template-columns: 1fr auto; }
  .hergo-bar-track { grid-column: 1 / -1; }
  .hergo-topbar { gap: 0.45rem; padding: 0.55rem 0.9rem; }
  .hergo-usermenu-btn .meta { display: none; }
  .hergo-content { padding: 1.1rem 1rem 2rem; }
  .hergo-wizard-nav { overflow-x: auto; }
  .hergo-wizard-nav li { white-space: nowrap; }
  .hergo-roles-grid,
  .hergo-resumen-dl { grid-template-columns: 1fr; }
  .hergo-stepper li + li::before { width: 28px; }
  .hergo-filtros-grid { grid-template-columns: 1fr; }
  .hergo-filtros-grid .hergo-field.is-ancho,
  .hergo-filtros-cta { grid-column: span 1; }
  .hergo-filtros-cta { justify-content: space-between; }
  .hergo-listado-head,
  .hergo-listado-foot { flex-direction: column; align-items: flex-start; }
  .hergo-catalog-add { grid-template-columns: 1fr; }
  .hergo-orientacion { grid-template-columns: 1fr; }
}

.hergo-mark {
  background: #f6e08a;
  color: inherit;
  padding: 0 0.12em;
  border-radius: 0.2em;
}
html[data-tema="oscuro"] .hergo-mark {
  background: #6b5420;
  color: #fff4c8;
}
.hergo-busqueda-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.hergo-busqueda-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel, #fff);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  text-decoration: none;
}
.hergo-busqueda-tab.is-on {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.hergo-busqueda-seccion + .hergo-busqueda-seccion { margin-top: 1rem; }
.hergo-busqueda-seccion .hergo-panel-head h2 {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hergo-busqueda-cuenta {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.75rem;
}
.hergo-busqueda-lista {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hergo-busqueda-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.hergo-busqueda-lista > li:first-child { border-top: 0; padding-top: 0.2rem; }
.hergo-busqueda-titulo {
  font-weight: 750;
  color: var(--title);
  text-decoration: none;
}
a.hergo-busqueda-titulo:hover { text-decoration: underline; }
.hergo-busqueda-sub {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.hergo-busqueda-hits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
}
.hergo-busqueda-hits li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--soft);
  font-size: 0.78rem;
}
.hergo-busqueda-campo {
  font-weight: 700;
  color: var(--navy);
}
.hergo-busqueda-ayuda p { margin: 0 0 0.85rem; }
.hergo-busqueda-ayuda-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.hergo-busqueda-ayuda-lista li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.hergo-busqueda-ayuda-lista svg { flex: 0 0 auto; margin-top: 0.15rem; }
