/* Kit de interfaz del panel: tokens, temas, base, estructura, utilidades y componentes.
   Generado a partir de un kit propio con los prefijos renombrados (regla 1).
   Estructura: barra lateral + barra superior + contenido. Tema claro u oscuro según el sistema. */

/* ---------- tokens ---------- */

:root {
  /* ---- Espaciado (base 4px) ---- */
  --hp-space-1: 4px;
  --hp-space-2: 8px;
  --hp-space-3: 12px;
  --hp-space-4: 16px;
  --hp-space-5: 20px;
  --hp-space-6: 24px;
  --hp-space-8: 32px;
  --hp-space-10: 40px;
  --hp-space-12: 48px;
  --hp-space-16: 64px;

  /* ---- Radio ---- */
  --hp-radius-sm: 6px;
  --hp-radius: 10px;
  --hp-radius-md: 12px;
  --hp-radius-lg: 16px;
  --hp-radius-full: 9999px;

  /* ---- Tipografía ---- */
  --hp-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --hp-font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo,
    Consolas, "Liberation Mono", monospace;

  --hp-text-xs: 12px;
  --hp-text-sm: 13px;
  --hp-text-base: 14px;
  --hp-text-md: 15px;
  --hp-text-lg: 18px;
  --hp-text-xl: 22px;
  --hp-text-2xl: 28px;
  --hp-text-3xl: 34px;

  --hp-weight-normal: 400;
  --hp-weight-medium: 500;
  --hp-weight-semibold: 600;
  --hp-weight-bold: 700;

  --hp-leading-tight: 1.25;
  --hp-leading-normal: 1.5;

  /* ---- Z-index ---- */
  --hp-z-sticky: 100;
  --hp-z-dropdown: 1000;
  --hp-z-drawer: 1100;
  --hp-z-modal: 1200;
  --hp-z-toast: 1300;
  --hp-z-tooltip: 1400;

  /* ---- Transición / easing ---- */
  --hp-transition-fast: 120ms;
  --hp-transition: 200ms;
  --hp-transition-slow: 320ms;
  --hp-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --hp-ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- Layout ---- */
  --hp-sidebar-w: 264px;
  --hp-sidebar-collapsed-w: 72px;
  --hp-topbar-h: 60px;
  --hp-content-max: 1280px;

  /* ---- Breakpoints (referencia para media queries) ----
     sm 640 · md 768 · lg 1024 · xl 1280  */
}

/* ---------- themes ---------- */

/* ---------- Tema claro (default) ---------- */
:root,
:root[data-theme="light"] {
  color-scheme: light;

  --hp-bg: #f4f6fb;
  --hp-surface: #ffffff;
  --hp-surface-2: #f7f9fc;
  --hp-surface-3: #eef1f7;
  --hp-border: #e3e8f0;
  --hp-border-strong: #cdd5e3;

  --hp-text: #1a2233;
  --hp-text-muted: #5b667d;
  --hp-text-subtle: #8a94a8;

  --hp-primary: #4f46e5;
  --hp-primary-hover: #4338ca;
  --hp-primary-soft: #eceafe;
  --hp-on-primary: #ffffff;

  --hp-success: #16a34a;
  --hp-success-soft: #dcfce7;
  --hp-warning: #d97706;
  --hp-warning-soft: #fef3c7;
  --hp-danger: #dc2626;
  --hp-danger-soft: #fee2e2;
  --hp-info: #0284c7;
  --hp-info-soft: #e0f2fe;

  --hp-overlay: rgba(17, 24, 39, 0.45);
  --hp-focus-ring: rgba(79, 70, 229, 0.35);

  --hp-shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.06);
  --hp-shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --hp-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  --hp-shadow-md: 0 10px 24px rgba(16, 24, 40, 0.10);
  --hp-shadow-lg: 0 20px 48px rgba(16, 24, 40, 0.16);
}

/* ---------- Tema oscuro ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;

  --hp-bg: #0c0f17;
  --hp-surface: #151a26;
  --hp-surface-2: #1b2231;
  --hp-surface-3: #232c3e;
  --hp-border: #2a3346;
  --hp-border-strong: #3a445c;

  --hp-text: #e7ecf5;
  --hp-text-muted: #9aa6bf;
  --hp-text-subtle: #6b7794;

  --hp-primary: #7c7aff;
  --hp-primary-hover: #9290ff;
  --hp-primary-soft: #232447;
  --hp-on-primary: #ffffff;

  --hp-success: #34d399;
  --hp-success-soft: #0d2f23;
  --hp-warning: #fbbf24;
  --hp-warning-soft: #36280a;
  --hp-danger: #f87171;
  --hp-danger-soft: #3a1717;
  --hp-info: #38bdf8;
  --hp-info-soft: #0a2738;

  --hp-overlay: rgba(0, 0, 0, 0.6);
  --hp-focus-ring: rgba(124, 122, 255, 0.45);

  --hp-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --hp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
  --hp-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  --hp-shadow-md: 0 12px 28px rgba(0, 0, 0, 0.55);
  --hp-shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
}

/* ---------- Sigue al sistema si no hay preferencia guardada ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --hp-bg: #0c0f17;
    --hp-surface: #151a26;
    --hp-surface-2: #1b2231;
    --hp-surface-3: #232c3e;
    --hp-border: #2a3346;
    --hp-border-strong: #3a445c;
    --hp-text: #e7ecf5;
    --hp-text-muted: #9aa6bf;
    --hp-text-subtle: #6b7794;
    --hp-primary: #7c7aff;
    --hp-primary-hover: #9290ff;
    --hp-primary-soft: #232447;
    --hp-on-primary: #ffffff;
    --hp-success: #34d399;
    --hp-success-soft: #0d2f23;
    --hp-warning: #fbbf24;
    --hp-warning-soft: #36280a;
    --hp-danger: #f87171;
    --hp-danger-soft: #3a1717;
    --hp-info: #38bdf8;
    --hp-info-soft: #0a2738;
    --hp-overlay: rgba(0, 0, 0, 0.6);
    --hp-focus-ring: rgba(124, 122, 255, 0.45);
    --hp-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --hp-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.45);
    --hp-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    --hp-shadow-md: 0 12px 28px rgba(0, 0, 0, 0.55);
    --hp-shadow-lg: 0 24px 56px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Presets de acento (opcional): <html data-accent="..."> ---------- */
:root[data-accent="emerald"] { --hp-primary:#059669; --hp-primary-hover:#047857; --hp-primary-soft:#d1fae5; --hp-focus-ring:rgba(5,150,105,.35); }
:root[data-accent="rose"]    { --hp-primary:#e11d48; --hp-primary-hover:#be123c; --hp-primary-soft:#ffe4e6; --hp-focus-ring:rgba(225,29,72,.35); }
:root[data-accent="amber"]   { --hp-primary:#d97706; --hp-primary-hover:#b45309; --hp-primary-soft:#fef3c7; --hp-focus-ring:rgba(217,119,6,.35); }
:root[data-accent="sky"]     { --hp-primary:#0284c7; --hp-primary-hover:#0369a1; --hp-primary-soft:#e0f2fe; --hp-focus-ring:rgba(2,132,199,.35); }
:root[data-accent="violet"]  { --hp-primary:#7c3aed; --hp-primary-hover:#6d28d9; --hp-primary-soft:#ede9fe; --hp-focus-ring:rgba(124,58,237,.35); }

/* ---------- base ---------- */

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

* {
  margin: 0;
}

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

body {
  font-family: var(--hp-font);
  font-size: var(--hp-text-base);
  line-height: var(--hp-leading-normal);
  color: var(--hp-text);
  background: var(--hp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: var(--hp-primary);
  text-decoration: none;
  transition: color var(--hp-transition-fast) var(--hp-ease);
}
a:hover {
  color: var(--hp-primary-hover);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--hp-weight-semibold);
  line-height: var(--hp-leading-tight);
  color: var(--hp-text);
}
h1 { font-size: var(--hp-text-2xl); }
h2 { font-size: var(--hp-text-xl); }
h3 { font-size: var(--hp-text-lg); }

p { color: var(--hp-text); }

small { font-size: var(--hp-text-xs); }

code, kbd, samp, pre {
  font-family: var(--hp-font-mono);
  font-size: 0.92em;
}

hr {
  border: none;
  border-top: 1px solid var(--hp-border);
  margin: var(--hp-space-4) 0;
}

ul, ol {
  padding-left: var(--hp-space-5);
}

/* Foco accesible global */
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hp-focus-ring);
  border-radius: var(--hp-radius-sm);
}

/* Selección */
::selection {
  background: var(--hp-primary-soft);
  color: var(--hp-text);
}

/* Scrollbar discreto */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--hp-border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--hp-border-strong);
  border-radius: var(--hp-radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: var(--hp-text-subtle); background-clip: padding-box; }

[hidden] { display: none !important; }

/* ---------- layout ---------- */

/* ---------- Shell ---------- */
.hp-app {
  display: grid;
  grid-template-columns: var(--hp-sidebar-w) 1fr;
  grid-template-rows: 100vh;
  transition: grid-template-columns var(--hp-transition) var(--hp-ease);
}
.hp-app.is-collapsed {
  grid-template-columns: var(--hp-sidebar-collapsed-w) 1fr;
}

/* ---------- Sidebar ---------- */
.hp-sidebar {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  background: var(--hp-surface);
  border-right: 1px solid var(--hp-border);
  height: 100vh;
  overflow: hidden;
  z-index: var(--hp-z-sticky);
}

.hp-sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--hp-space-3);
  height: var(--hp-topbar-h);
  padding: 0 var(--hp-space-5);
  flex-shrink: 0;
  border-bottom: 1px solid var(--hp-border);
  white-space: nowrap;
}
.hp-sidebar__logo {
  width: 32px; height: 32px;
  flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: var(--hp-radius);
  background: var(--hp-primary);
  color: var(--hp-on-primary);
  font-weight: var(--hp-weight-bold);
}
.hp-sidebar__brand-name {
  font-weight: var(--hp-weight-semibold);
  font-size: var(--hp-text-md);
  transition: opacity var(--hp-transition-fast) var(--hp-ease);
}

.hp-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--hp-space-3);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hp-sidebar__section {
  padding: var(--hp-space-4) var(--hp-space-3) var(--hp-space-2);
  font-size: var(--hp-text-xs);
  font-weight: var(--hp-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--hp-text-subtle);
  white-space: nowrap;
}

.hp-nav-item {
  display: flex;
  align-items: center;
  gap: var(--hp-space-3);
  padding: var(--hp-space-2) var(--hp-space-3);
  border-radius: var(--hp-radius);
  color: var(--hp-text-muted);
  font-size: var(--hp-text-base);
  font-weight: var(--hp-weight-medium);
  white-space: nowrap;
  position: relative;
  transition: background var(--hp-transition-fast) var(--hp-ease),
              color var(--hp-transition-fast) var(--hp-ease);
}
.hp-nav-item:hover {
  background: var(--hp-surface-3);
  color: var(--hp-text);
}
.hp-nav-item.is-active {
  background: var(--hp-primary-soft);
  color: var(--hp-primary);
  font-weight: var(--hp-weight-semibold);
}
.hp-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 20px;
  border-radius: var(--hp-radius-full);
  background: var(--hp-primary);
}
.hp-nav-item__icon {
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: grid; place-items: center;
}
.hp-nav-item__icon svg { width: 20px; height: 20px; }
.hp-nav-item__label { flex: 1; }
.hp-nav-item__badge {
  font-size: var(--hp-text-xs);
  font-weight: var(--hp-weight-semibold);
  padding: 1px 8px;
  border-radius: var(--hp-radius-full);
  background: var(--hp-danger);
  color: var(--hp-on-primary);
}
.hp-nav-item__chevron {
  width: 16px; height: 16px;
  transition: transform var(--hp-transition) var(--hp-ease);
}
.hp-nav-item.is-open .hp-nav-item__chevron { transform: rotate(90deg); }

/* Submenú anidado */
.hp-nav-sub {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--hp-transition) var(--hp-ease);
}
.hp-nav-sub.is-open { grid-template-rows: 1fr; }
.hp-nav-sub__inner {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: var(--hp-space-8);
}
.hp-nav-sub .hp-nav-item { font-size: var(--hp-text-sm); }

.hp-sidebar__footer {
  flex-shrink: 0;
  padding: var(--hp-space-3);
  border-top: 1px solid var(--hp-border);
}

/* Estado colapsado: oculta textos, centra íconos */
.hp-app.is-collapsed .hp-sidebar__brand-name,
.hp-app.is-collapsed .hp-sidebar__section,
.hp-app.is-collapsed .hp-nav-item__label,
.hp-app.is-collapsed .hp-nav-item__badge,
.hp-app.is-collapsed .hp-nav-item__chevron {
  opacity: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}
.hp-app.is-collapsed .hp-nav-item { justify-content: center; padding: var(--hp-space-2); }
.hp-app.is-collapsed .hp-nav-sub { display: none; }

/* ---------- Main column ---------- */
.hp-main {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  min-width: 0;
}

/* ---------- Topbar ---------- */
.hp-topbar {
  display: flex;
  align-items: center;
  gap: var(--hp-space-4);
  height: var(--hp-topbar-h);
  flex-shrink: 0;
  padding: 0 var(--hp-space-6);
  background: color-mix(in srgb, var(--hp-surface) 80%, transparent);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--hp-border);
  position: sticky;
  top: 0;
  z-index: var(--hp-z-sticky);
}
.hp-topbar__toggle {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--hp-radius);
  color: var(--hp-text-muted);
  transition: background var(--hp-transition-fast) var(--hp-ease);
}
.hp-topbar__toggle:hover { background: var(--hp-surface-3); color: var(--hp-text); }
.hp-topbar__spacer { flex: 1; }
.hp-topbar__actions { display: flex; align-items: center; gap: var(--hp-space-2); }

.hp-icon-btn {
  position: relative;
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--hp-radius);
  color: var(--hp-text-muted);
  transition: background var(--hp-transition-fast) var(--hp-ease),
              color var(--hp-transition-fast) var(--hp-ease);
}
.hp-icon-btn:hover { background: var(--hp-surface-3); color: var(--hp-text); }
.hp-icon-btn__dot {
  position: absolute; top: 8px; right: 9px;
  width: 8px; height: 8px;
  border-radius: var(--hp-radius-full);
  background: var(--hp-danger);
  border: 2px solid var(--hp-surface);
}

/* ---------- Content scroll area ---------- */
.hp-content {
  flex: 1;
  overflow-y: auto;
  padding: var(--hp-space-6);
}
.hp-content__inner {
  max-width: var(--hp-content-max);
  margin: 0 auto;
  width: 100%;
}

/* ---------- Page header ---------- */
.hp-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hp-space-4);
  flex-wrap: wrap;
  margin-bottom: var(--hp-space-6);
}
.hp-page-header__title { font-size: var(--hp-text-2xl); font-weight: var(--hp-weight-bold); }
.hp-page-header__subtitle { color: var(--hp-text-muted); margin-top: var(--hp-space-1); }
.hp-page-header__actions { display: flex; gap: var(--hp-space-2); align-items: center; }

/* ---------- Backdrop móvil para sidebar ---------- */
.hp-sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: var(--hp-overlay);
  z-index: calc(var(--hp-z-sticky) - 1);
  opacity: 0;
  transition: opacity var(--hp-transition) var(--hp-ease);
}

/* ---------- Responsivo: sidebar como overlay en móvil ---------- */
@media (max-width: 1024px) {
  .hp-app { grid-template-columns: 1fr; }
  .hp-app.is-collapsed { grid-template-columns: 1fr; }
  .hp-sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--hp-sidebar-w);
    transform: translateX(-100%);
    transition: transform var(--hp-transition) var(--hp-ease);
    box-shadow: var(--hp-shadow-lg);
  }
  .hp-app.is-mobile-open .hp-sidebar { transform: translateX(0); }
  .hp-app.is-mobile-open .hp-sidebar-backdrop { display: block; opacity: 1; }
  /* En móvil nunca colapsamos a íconos, mostramos completo en overlay */
  .hp-app.is-collapsed .hp-sidebar__brand-name,
  .hp-app.is-collapsed .hp-nav-item__label,
  .hp-app.is-collapsed .hp-nav-item__badge,
  .hp-app.is-collapsed .hp-nav-item__chevron { opacity: 1; width: auto; }
  .hp-app.is-collapsed .hp-nav-item { justify-content: flex-start; padding: var(--hp-space-2) var(--hp-space-3); }
}

@media (max-width: 640px) {
  .hp-content { padding: var(--hp-space-4); }
  .hp-topbar { padding: 0 var(--hp-space-4); }
}

/* ---------- utilities ---------- */

/* Display / flex / grid */
.u-flex { display: flex; }
.u-inline-flex { display: inline-flex; }
.u-grid { display: grid; }
.u-block { display: block; }
.u-hidden { display: none; }
.u-flex-col { flex-direction: column; }
.u-flex-wrap { flex-wrap: wrap; }
.u-items-center { align-items: center; }
.u-items-start { align-items: flex-start; }
.u-items-end { align-items: flex-end; }
.u-justify-center { justify-content: center; }
.u-justify-between { justify-content: space-between; }
.u-justify-end { justify-content: flex-end; }
.u-flex-1 { flex: 1 1 0%; }
.u-flex-auto { flex: 1 1 auto; }
.u-shrink-0 { flex-shrink: 0; }

/* Gap */
.u-gap-1 { gap: var(--hp-space-1); }
.u-gap-2 { gap: var(--hp-space-2); }
.u-gap-3 { gap: var(--hp-space-3); }
.u-gap-4 { gap: var(--hp-space-4); }
.u-gap-6 { gap: var(--hp-space-6); }

/* Margin / padding (las más usadas) */
.u-m-0 { margin: 0; }
.u-mt-1 { margin-top: var(--hp-space-1); }
.u-mt-2 { margin-top: var(--hp-space-2); }
.u-mt-3 { margin-top: var(--hp-space-3); }
.u-mt-4 { margin-top: var(--hp-space-4); }
.u-mt-6 { margin-top: var(--hp-space-6); }
.u-mb-2 { margin-bottom: var(--hp-space-2); }
.u-mb-3 { margin-bottom: var(--hp-space-3); }
.u-mb-4 { margin-bottom: var(--hp-space-4); }
.u-mb-6 { margin-bottom: var(--hp-space-6); }
.u-p-2 { padding: var(--hp-space-2); }
.u-p-3 { padding: var(--hp-space-3); }
.u-p-4 { padding: var(--hp-space-4); }
.u-p-6 { padding: var(--hp-space-6); }

/* Texto */
.u-text-xs { font-size: var(--hp-text-xs); }
.u-text-sm { font-size: var(--hp-text-sm); }
.u-text-lg { font-size: var(--hp-text-lg); }
.u-text-xl { font-size: var(--hp-text-xl); }
.u-text-muted { color: var(--hp-text-muted); }
.u-text-subtle { color: var(--hp-text-subtle); }
.u-text-primary { color: var(--hp-primary); }
.u-text-success { color: var(--hp-success); }
.u-text-danger { color: var(--hp-danger); }
.u-text-center { text-align: center; }
.u-text-right { text-align: right; }
.u-font-medium { font-weight: var(--hp-weight-medium); }
.u-font-semibold { font-weight: var(--hp-weight-semibold); }
.u-font-bold { font-weight: var(--hp-weight-bold); }
.u-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.u-mono { font-family: var(--hp-font-mono); }
.u-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }

/* Layout helpers */
.u-w-full { width: 100%; }
.u-h-full { height: 100%; }
.u-rounded { border-radius: var(--hp-radius); }
.u-rounded-full { border-radius: var(--hp-radius-full); }
.u-shadow { box-shadow: var(--hp-shadow); }
.u-border { border: 1px solid var(--hp-border); }
.u-surface { background: var(--hp-surface); }

/* Grid de columnas responsivo rápido */
.u-cols { display: grid; gap: var(--hp-space-4); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.u-cols-2 { display: grid; gap: var(--hp-space-4); grid-template-columns: repeat(2, 1fr); }
.u-cols-3 { display: grid; gap: var(--hp-space-4); grid-template-columns: repeat(3, 1fr); }
.u-cols-4 { display: grid; gap: var(--hp-space-4); grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
  .u-cols-2, .u-cols-3, .u-cols-4 { grid-template-columns: 1fr; }
}

/* Accesibilidad: solo para lectores de pantalla */
.u-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;
}

/* Responsivo: ocultar en móvil / escritorio */
@media (max-width: 768px) { .u-hide-mobile { display: none !important; } }
@media (min-width: 769px) { .u-hide-desktop { display: none !important; } }

/* ---------- alert ---------- */

.hp-alert {
  display: flex;
  gap: var(--hp-space-3);
  padding: var(--hp-space-4);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-md);
  background: var(--hp-surface-2);
  color: var(--hp-text);
}

/* Icono: tamaño fijo, no se encoge */
.hp-alert__icon {
  flex-shrink: 0;
  color: var(--hp-text-muted);
}
.hp-alert__icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Contenido: ocupa el espacio restante */
.hp-alert__content {
  flex: 1;
  min-width: 0;
}
.hp-alert__title {
  font-weight: var(--hp-weight-semibold);
  line-height: var(--hp-leading-tight);
}
.hp-alert__text {
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
  line-height: var(--hp-leading-normal);
}
/* Separación cuando hay título + texto */
.hp-alert__title + .hp-alert__text {
  margin-top: var(--hp-space-1);
}

/* Botón de cierre (X): hereda el color del contexto */
.hp-alert__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin: calc(-1 * var(--hp-space-1)) calc(-1 * var(--hp-space-1)) 0 0;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--hp-radius-sm);
  color: inherit;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity var(--hp-transition-fast) var(--hp-ease),
              background var(--hp-transition-fast) var(--hp-ease);
}
.hp-alert__close:hover {
  opacity: 1;
  background: var(--hp-surface-3);
}
.hp-alert__close:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hp-focus-ring);
}
.hp-alert__close svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* ---- Variantes: fondo *-soft, borde e icono con color pleno ---- */
.hp-alert--success {
  background: var(--hp-success-soft);
  border-color: var(--hp-success);
}
.hp-alert--success .hp-alert__icon { color: var(--hp-success); }

.hp-alert--warning {
  background: var(--hp-warning-soft);
  border-color: var(--hp-warning);
}
.hp-alert--warning .hp-alert__icon { color: var(--hp-warning); }

.hp-alert--danger {
  background: var(--hp-danger-soft);
  border-color: var(--hp-danger);
}
.hp-alert--danger .hp-alert__icon { color: var(--hp-danger); }

.hp-alert--info {
  background: var(--hp-info-soft);
  border-color: var(--hp-info);
}
.hp-alert--info .hp-alert__icon { color: var(--hp-info); }

/* ---- Salida: el core agrega .is-leaving antes de remover del DOM ---- */
@keyframes hp-alert-out {
  to {
    opacity: 0;
    transform: translateX(8px);
  }
}
.hp-alert.is-leaving {
  animation: hp-alert-out var(--hp-transition) var(--hp-ease) forwards;
}

/* ---------- badge ---------- */

.hp-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--hp-space-2);
  padding: 2px var(--hp-space-3);
  border-radius: var(--hp-radius-full);
  font-size: var(--hp-text-xs);
  font-weight: var(--hp-weight-semibold);
  line-height: var(--hp-leading-tight);
  white-space: nowrap;
  background: var(--hp-surface-3);
  color: var(--hp-text-muted);
}

/* ---- Variantes suaves (fondo *-soft + color pleno) ---- */
.hp-badge--primary { background: var(--hp-primary-soft); color: var(--hp-primary); }
.hp-badge--success { background: var(--hp-success-soft); color: var(--hp-success); }
.hp-badge--warning { background: var(--hp-warning-soft); color: var(--hp-warning); }
.hp-badge--danger  { background: var(--hp-danger-soft);  color: var(--hp-danger); }
.hp-badge--info    { background: var(--hp-info-soft);    color: var(--hp-info); }

/* ---- Variante sólida (fondo color pleno + texto sobre color) ---- */
.hp-badge--solid { color: var(--hp-on-primary); }
.hp-badge--solid.hp-badge--primary { background: var(--hp-primary); }
.hp-badge--solid.hp-badge--success { background: var(--hp-success); }
.hp-badge--solid.hp-badge--warning { background: var(--hp-warning); }
.hp-badge--solid.hp-badge--danger  { background: var(--hp-danger); }
.hp-badge--solid.hp-badge--info     { background: var(--hp-info); }

/* ---- Punto indicador: hereda el color actual del texto ---- */
.hp-badge--dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: var(--hp-radius-full);
  background: currentColor;
  flex: none;
}

/* ---------- buttons ---------- */

.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--hp-space-2);
  padding: 0 var(--hp-space-4);
  height: 38px;
  border-radius: var(--hp-radius);
  font-size: var(--hp-text-base);
  font-weight: var(--hp-weight-semibold);
  line-height: 1;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: background var(--hp-transition-fast) var(--hp-ease),
              border-color var(--hp-transition-fast) var(--hp-ease),
              color var(--hp-transition-fast) var(--hp-ease),
              transform var(--hp-transition-fast) var(--hp-ease),
              box-shadow var(--hp-transition-fast) var(--hp-ease);
}
.hp-btn:active { transform: translateY(1px); }
.hp-btn:disabled,
.hp-btn.is-disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.hp-btn svg { width: 18px; height: 18px; }

/* Variantes */
.hp-btn--primary {
  background: var(--hp-primary);
  color: var(--hp-on-primary);
  box-shadow: var(--hp-shadow-xs);
}
.hp-btn--primary:hover { background: var(--hp-primary-hover); box-shadow: var(--hp-shadow-sm); }

.hp-btn--secondary {
  background: var(--hp-surface);
  color: var(--hp-text);
  border-color: var(--hp-border-strong);
}
.hp-btn--secondary:hover { background: var(--hp-surface-3); }

.hp-btn--ghost {
  background: transparent;
  color: var(--hp-text-muted);
}
.hp-btn--ghost:hover { background: var(--hp-surface-3); color: var(--hp-text); }

.hp-btn--danger {
  background: var(--hp-danger);
  color: var(--hp-on-primary);
}
.hp-btn--danger:hover { filter: brightness(0.94); }

.hp-btn--success {
  background: var(--hp-success);
  color: var(--hp-on-primary);
}
.hp-btn--success:hover { filter: brightness(0.94); }

.hp-btn--soft {
  background: var(--hp-primary-soft);
  color: var(--hp-primary);
}
.hp-btn--soft:hover { background: color-mix(in srgb, var(--hp-primary-soft) 70%, var(--hp-primary) 12%); }

.hp-btn--link {
  background: transparent;
  color: var(--hp-primary);
  height: auto; padding: 0;
}
.hp-btn--link:hover { text-decoration: underline; }

/* Tamaños */
.hp-btn--sm { height: 30px; padding: 0 var(--hp-space-3); font-size: var(--hp-text-sm); }
.hp-btn--lg { height: 46px; padding: 0 var(--hp-space-6); font-size: var(--hp-text-md); }
.hp-btn--block { display: flex; width: 100%; }

/* Icon-only */
.hp-btn--icon { padding: 0; width: 38px; }
.hp-btn--icon.hp-btn--sm { width: 30px; }
.hp-btn--icon.hp-btn--lg { width: 46px; }

/* Loading: oculta texto y muestra spinner */
.hp-btn.is-loading { color: transparent !important; position: relative; pointer-events: none; }
.hp-btn.is-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: var(--hp-radius-full);
  color: var(--hp-on-primary);
  animation: hp-spin 0.6s linear infinite;
}
.hp-btn--secondary.is-loading::after,
.hp-btn--ghost.is-loading::after,
.hp-btn--soft.is-loading::after { color: var(--hp-text); }

/* Grupo de botones segmentado */
.hp-btn-group { display: inline-flex; }
.hp-btn-group .hp-btn { border-radius: 0; border-color: var(--hp-border-strong); }
.hp-btn-group .hp-btn:first-child { border-radius: var(--hp-radius) 0 0 var(--hp-radius); }
.hp-btn-group .hp-btn:last-child { border-radius: 0 var(--hp-radius) var(--hp-radius) 0; }
.hp-btn-group .hp-btn:not(:first-child) { margin-left: -1px; }

/* ---------- cards ---------- */

/* ---- Bloque base ---- */
.hp-card {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-sm);
  overflow: hidden;
}

/* ---- Encabezado ---- */
.hp-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--hp-space-4);
  padding: var(--hp-space-5);
  border-bottom: 1px solid var(--hp-border);
}

.hp-card__title {
  font-size: var(--hp-text-md);
  font-weight: var(--hp-weight-semibold);
  line-height: var(--hp-leading-tight);
  color: var(--hp-text);
}

.hp-card__subtitle {
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
  line-height: var(--hp-leading-normal);
}

.hp-card__actions {
  display: flex;
  align-items: center;
  gap: var(--hp-space-2);
}

/* ---- Cuerpo ---- */
.hp-card__body {
  padding: var(--hp-space-5);
}

/* ---- Pie ---- */
.hp-card__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--hp-space-2);
  padding: var(--hp-space-5);
  border-top: 1px solid var(--hp-border);
}

/* ---- Modificador: elevación al pasar el cursor ---- */
.hp-card--hover {
  transition: transform var(--hp-transition) var(--hp-ease),
              box-shadow var(--hp-transition) var(--hp-ease);
}
.hp-card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--hp-shadow-md);
}

/* ---- Modificador: tarjeta accionable (mismo realce que hover) ---- */
.hp-card--clickable {
  cursor: pointer;
  transition: transform var(--hp-transition) var(--hp-ease),
              box-shadow var(--hp-transition) var(--hp-ease);
}
.hp-card--clickable:hover {
  transform: translateY(-2px);
  box-shadow: var(--hp-shadow-md);
}
/* Foco visible cuando la tarjeta es interactiva (p. ej. tabindex / <a>) */
.hp-card--clickable:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hp-focus-ring);
}

/* ---- Modificador: relleno reducido ---- */
.hp-card--compact .hp-card__header,
.hp-card--compact .hp-card__body,
.hp-card--compact .hp-card__footer {
  padding: var(--hp-space-3) var(--hp-space-4);
}

/* ---- Modificador: cuerpo a sangre (sin relleno) ---- */
.hp-card--flush .hp-card__body {
  padding: 0;
}

/* ---------- forms ---------- */

.hp-field {
  display: flex;
  flex-direction: column;
  gap: var(--hp-space-2);
  margin-bottom: var(--hp-space-4);
}
.hp-label {
  font-size: var(--hp-text-sm);
  font-weight: var(--hp-weight-semibold);
  color: var(--hp-text);
}
.hp-label__req { color: var(--hp-danger); margin-left: 2px; }
.hp-hint { font-size: var(--hp-text-xs); color: var(--hp-text-muted); }
.hp-error-text { font-size: var(--hp-text-xs); color: var(--hp-danger); }

/* Inputs base */
.hp-input,
.hp-textarea,
.hp-select {
  width: 100%;
  padding: 0 var(--hp-space-3);
  height: 40px;
  background: var(--hp-surface);
  color: var(--hp-text);
  border: 1px solid var(--hp-border-strong);
  border-radius: var(--hp-radius);
  font-size: var(--hp-text-base);
  transition: border-color var(--hp-transition-fast) var(--hp-ease),
              box-shadow var(--hp-transition-fast) var(--hp-ease),
              background var(--hp-transition-fast) var(--hp-ease);
}
.hp-textarea { height: auto; min-height: 96px; padding: var(--hp-space-3); resize: vertical; line-height: var(--hp-leading-normal); }

.hp-input::placeholder,
.hp-textarea::placeholder { color: var(--hp-text-subtle); }

.hp-input:hover,
.hp-textarea:hover,
.hp-select:hover { border-color: var(--hp-text-subtle); }

.hp-input:focus,
.hp-textarea:focus,
.hp-select:focus {
  outline: none;
  border-color: var(--hp-primary);
  box-shadow: 0 0 0 3px var(--hp-focus-ring);
}

.hp-input:disabled,
.hp-textarea:disabled,
.hp-select:disabled { background: var(--hp-surface-3); opacity: 0.7; cursor: not-allowed; }

/* Select con chevron (sin ícono DENTRO del flujo de texto; es decoración del control) */
.hp-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("/estilos/flecha.svg");
  background-repeat: no-repeat;
  background-position: right var(--hp-space-3) center;
  padding-right: var(--hp-space-8);
}

/* Estados de validación */
.hp-field.is-invalid .hp-input,
.hp-field.is-invalid .hp-textarea,
.hp-field.is-invalid .hp-select { border-color: var(--hp-danger); }
.hp-field.is-invalid .hp-input:focus { box-shadow: 0 0 0 3px var(--hp-danger-soft); }
.hp-field.is-valid .hp-input { border-color: var(--hp-success); }

/* Tamaños */
.hp-input--sm { height: 32px; font-size: var(--hp-text-sm); }
.hp-input--lg { height: 48px; font-size: var(--hp-text-md); }

/* Search box (label aparte; sin ícono dentro) */
.hp-search { position: relative; max-width: 360px; width: 100%; }
.hp-search .hp-input { width: 100%; }

/* Checkbox / radio */
.hp-check {
  display: inline-flex;
  align-items: center;
  gap: var(--hp-space-2);
  cursor: pointer;
  font-size: var(--hp-text-base);
  user-select: none;
}
.hp-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.hp-check__box {
  width: 18px; height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--hp-border-strong);
  border-radius: var(--hp-radius-sm);
  background: var(--hp-surface);
  display: grid; place-items: center;
  transition: background var(--hp-transition-fast) var(--hp-ease),
              border-color var(--hp-transition-fast) var(--hp-ease);
}
.hp-check__box::after {
  content: "";
  width: 10px; height: 10px;
  transform: scale(0);
  transition: transform var(--hp-transition-fast) var(--hp-ease-out);
  background: var(--hp-on-primary);
  clip-path: polygon(14% 44%, 0 65%, 38% 100%, 100% 22%, 82% 0, 38% 64%);
}
.hp-check input:checked + .hp-check__box { background: var(--hp-primary); border-color: var(--hp-primary); }
.hp-check input:checked + .hp-check__box::after { transform: scale(1); }
.hp-check input:focus-visible + .hp-check__box { box-shadow: 0 0 0 3px var(--hp-focus-ring); }
/* Radio (redondo) */
.hp-check--radio .hp-check__box { border-radius: var(--hp-radius-full); }
.hp-check--radio .hp-check__box::after { clip-path: none; border-radius: var(--hp-radius-full); width: 8px; height: 8px; }

/* Switch / toggle */
.hp-switch { display: inline-flex; align-items: center; gap: var(--hp-space-2); cursor: pointer; user-select: none; }
.hp-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.hp-switch__track {
  width: 40px; height: 22px;
  border-radius: var(--hp-radius-full);
  background: var(--hp-border-strong);
  position: relative;
  transition: background var(--hp-transition) var(--hp-ease);
}
.hp-switch__track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px;
  border-radius: var(--hp-radius-full);
  background: var(--hp-on-primary);
  box-shadow: var(--hp-shadow-sm);
  transition: transform var(--hp-transition) var(--hp-ease-out);
}
.hp-switch input:checked + .hp-switch__track { background: var(--hp-primary); }
.hp-switch input:checked + .hp-switch__track::after { transform: translateX(18px); }
.hp-switch input:focus-visible + .hp-switch__track { box-shadow: 0 0 0 3px var(--hp-focus-ring); }

/* Input group: prefijo/sufijo de texto (no ícono dentro del input) */
.hp-input-group { display: flex; align-items: stretch; }
.hp-input-group .hp-input { border-radius: 0; }
.hp-input-group > :first-child { border-radius: var(--hp-radius) 0 0 var(--hp-radius); }
.hp-input-group > :last-child { border-radius: 0 var(--hp-radius) var(--hp-radius) 0; }
.hp-input-group__addon {
  display: inline-flex; align-items: center;
  padding: 0 var(--hp-space-3);
  background: var(--hp-surface-3);
  border: 1px solid var(--hp-border-strong);
  color: var(--hp-text-muted);
  font-size: var(--hp-text-sm);
  white-space: nowrap;
}
.hp-input-group > :not(:first-child) { margin-left: -1px; }

/* File upload (dropzone) */
.hp-file {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--hp-space-2);
  padding: var(--hp-space-8);
  border: 1.5px dashed var(--hp-border-strong);
  border-radius: var(--hp-radius-md);
  background: var(--hp-surface-2);
  color: var(--hp-text-muted);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--hp-transition-fast) var(--hp-ease),
              background var(--hp-transition-fast) var(--hp-ease);
}
.hp-file:hover,
.hp-file.is-dragover { border-color: var(--hp-primary); background: var(--hp-primary-soft); color: var(--hp-primary); }
.hp-file input { display: none; }

/* ---------- table ---------- */

/* Contenedor: permite scroll horizontal y recorta los bordes redondeados */
.hp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-md);
  background: var(--hp-surface);
}

/* Tabla base */
.hp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--hp-text-base);
  color: var(--hp-text);
}

/* Encabezado */
.hp-table thead th {
  text-align: left;
  padding: var(--hp-space-3) var(--hp-space-4);
  font-size: var(--hp-text-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--hp-text-subtle);
  font-weight: var(--hp-weight-semibold);
  border-bottom: 1px solid var(--hp-border);
  background: var(--hp-surface-2);
  white-space: nowrap;
}

/* Celdas del cuerpo */
.hp-table tbody td {
  padding: var(--hp-space-3) var(--hp-space-4);
  border-bottom: 1px solid var(--hp-border);
}

/* Hover de fila */
.hp-table tbody tr:hover {
  background: var(--hp-surface-2);
}

/* Última fila sin borde inferior */
.hp-table tbody tr:last-child td {
  border-bottom: none;
}

/* Variante rayada (filas alternas) */
.hp-table--striped tbody tr:nth-child(even) {
  background: var(--hp-surface-2);
}

/* Variante con encabezado fijo al hacer scroll vertical */
.hp-table--sticky thead th {
  position: sticky;
  top: 0;
  z-index: var(--hp-z-sticky);
}

/* Columnas ordenables */
.hp-table th[data-sort] {
  cursor: pointer;
  user-select: none;
}

/* Botón/etiqueta interna que agrupa texto + chevron del encabezado ordenable */
.hp-table th[data-sort] .hp-table__sort {
  display: inline-flex;
  align-items: center;
  gap: var(--hp-space-1);
}

/* Indicador chevron: oculto/atenuado por defecto, visible al ordenar */
.hp-table th[data-sort] .hp-table__sort-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--hp-transition-fast) var(--hp-ease),
              transform var(--hp-transition-fast) var(--hp-ease);
}
.hp-table th[data-sort]:hover .hp-table__sort-icon {
  opacity: 0.5;
}

/* Estado ascendente: chevron visible apuntando hacia arriba */
.hp-table th[data-sort].is-asc .hp-table__sort-icon {
  opacity: 1;
  transform: rotate(180deg);
  color: var(--hp-primary);
}

/* Estado descendente: chevron visible apuntando hacia abajo */
.hp-table th[data-sort].is-desc .hp-table__sort-icon {
  opacity: 1;
  transform: rotate(0deg);
  color: var(--hp-primary);
}

/* Fila seleccionada */
.hp-table tbody tr.is-selected {
  background: var(--hp-primary-soft);
}

/* Celda de acciones alineada a la derecha */
.hp-table__actions {
  text-align: right;
  white-space: nowrap;
}

/* Foco visible (teclado) en encabezados ordenables y controles internos */
.hp-table th[data-sort]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hp-focus-ring);
}

/* ---------- stat-card ---------- */

/* Base: misma superficie que una tarjeta (surface, borde, radio, sombra) */
.hp-stat {
  display: flex;
  flex-direction: column;
  gap: var(--hp-space-2);
  padding: var(--hp-space-5);
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-md);
  box-shadow: var(--hp-shadow-sm);
}

/* Fila superior: contenido a la izquierda, icono a la derecha */
.hp-stat__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--hp-space-3);
}

/* Icono cuadrado con fondo suave (acento por defecto) */
.hp-stat__icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--hp-radius);
  display: grid;
  place-items: center;
  background: var(--hp-primary-soft);
  color: var(--hp-primary);
}
.hp-stat__icon svg {
  width: 22px;
  height: 22px;
}

/* Variantes de color del icono (fondo *-soft + color pleno) */
.hp-stat__icon--success {
  background: var(--hp-success-soft);
  color: var(--hp-success);
}
.hp-stat__icon--warning {
  background: var(--hp-warning-soft);
  color: var(--hp-warning);
}
.hp-stat__icon--danger {
  background: var(--hp-danger-soft);
  color: var(--hp-danger);
}
.hp-stat__icon--info {
  background: var(--hp-info-soft);
  color: var(--hp-info);
}

/* Valor principal (la cifra) */
.hp-stat__value {
  font-size: var(--hp-text-2xl);
  font-weight: var(--hp-weight-bold);
  line-height: var(--hp-leading-tight);
  color: var(--hp-text);
}

/* Etiqueta descriptiva del valor */
.hp-stat__label {
  font-size: var(--hp-text-sm);
  color: var(--hp-text-muted);
}

/* Tendencia (variación respecto a un periodo previo) */
.hp-stat__trend {
  display: inline-flex;
  align-items: center;
  gap: var(--hp-space-1);
  font-size: var(--hp-text-sm);
  font-weight: var(--hp-weight-medium);
  color: var(--hp-text-muted);
}
.hp-stat__trend svg {
  width: 16px;
  height: 16px;
}
.hp-stat__trend--up {
  color: var(--hp-success);
}
.hp-stat__trend--down {
  color: var(--hp-danger);
}

/* ---------- progress ---------- */

/* ---------------------------------------------------------------------------
   Barra de progreso
   --------------------------------------------------------------------------- */
.hp-progress {
  height: 8px;
  background: var(--hp-surface-3);
  border-radius: var(--hp-radius-full);
  overflow: hidden;
}

.hp-progress__bar {
  height: 100%;
  width: 0; /* fallback; el ancho real se pone inline con style="width:NN%" */
  background: var(--hp-primary);
  border-radius: inherit;
  transition: width var(--hp-transition) var(--hp-ease);
}

/* ---- Variantes de color (cambian el relleno de la barra) ---- */
.hp-progress--success .hp-progress__bar {
  background: var(--hp-success);
}
.hp-progress--warning .hp-progress__bar {
  background: var(--hp-warning);
}
.hp-progress--danger .hp-progress__bar {
  background: var(--hp-danger);
}
.hp-progress--info .hp-progress__bar {
  background: var(--hp-info);
}

/* ---- Tamaños ---- */
.hp-progress--sm {
  height: 5px;
}
.hp-progress--lg {
  height: 12px;
}

/* ---- Variante a rayas (con animación de desplazamiento) ---- */
.hp-progress--striped .hp-progress__bar {
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.18) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0.18) 75%,
    transparent 75%,
    transparent
  );
  background-size: 32px 32px;
  animation: hp-progress-stripes 1s linear infinite;
}

@keyframes hp-progress-stripes {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 32px 0;
  }
}

/* ---------------------------------------------------------------------------
   Anillo de progreso
   El relleno se dibuja con un conic-gradient gobernado por --hp-value (0..100).
   --------------------------------------------------------------------------- */
.hp-progress-ring {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--hp-radius-full);
  display: grid;
  place-items: center;
  background: conic-gradient(
    var(--hp-primary) calc(var(--hp-value, 0) * 1%),
    var(--hp-surface-3) 0
  );
  transition: background var(--hp-transition) var(--hp-ease);
}

/* Hueco interior: deja ver el avance solo como un aro delgado */
.hp-progress-ring::before {
  content: "";
  position: absolute;
  width: 76%;
  height: 76%;
  border-radius: var(--hp-radius-full);
  background: var(--hp-surface);
}

/* Etiqueta central (porcentaje, etc.); va por encima del hueco */
.hp-progress-ring__label {
  position: relative;
  font-size: var(--hp-text-sm);
  font-weight: var(--hp-weight-semibold);
  color: var(--hp-text);
}

/* ---- Variantes de color del anillo ---- */
.hp-progress-ring--success {
  background: conic-gradient(
    var(--hp-success) calc(var(--hp-value, 0) * 1%),
    var(--hp-surface-3) 0
  );
}
.hp-progress-ring--warning {
  background: conic-gradient(
    var(--hp-warning) calc(var(--hp-value, 0) * 1%),
    var(--hp-surface-3) 0
  );
}
.hp-progress-ring--danger {
  background: conic-gradient(
    var(--hp-danger) calc(var(--hp-value, 0) * 1%),
    var(--hp-surface-3) 0
  );
}
.hp-progress-ring--info {
  background: conic-gradient(
    var(--hp-info) calc(var(--hp-value, 0) * 1%),
    var(--hp-surface-3) 0
  );
}

/* ---- Tamaños del anillo ---- */
.hp-progress-ring--sm {
  width: 48px;
  height: 48px;
}
.hp-progress-ring--sm .hp-progress-ring__label {
  font-size: var(--hp-text-xs);
}
.hp-progress-ring--lg {
  width: 96px;
  height: 96px;
}
.hp-progress-ring--lg .hp-progress-ring__label {
  font-size: var(--hp-text-lg);
}

/* ---------- empty-state ---------- */

/* Contenedor centrado vertical y horizontalmente con holgura generosa */
.hp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--hp-space-3);
  padding: var(--hp-space-12) var(--hp-space-6);
}

/* Icono dentro de un círculo de superficie elevada */
.hp-empty__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--hp-radius-full);
  background: var(--hp-surface-3);
  color: var(--hp-text-subtle);
  display: grid;
  place-items: center;
}
.hp-empty__icon svg {
  width: 30px;
  height: 30px;
}

/* Título: enunciado breve de la ausencia de contenido */
.hp-empty__title {
  font-size: var(--hp-text-lg);
  font-weight: var(--hp-weight-semibold);
  color: var(--hp-text);
}

/* Texto de apoyo: explica o sugiere el siguiente paso */
.hp-empty__text {
  color: var(--hp-text-muted);
  max-width: 360px;
}

/* Acción opcional (botón) separada del texto */
.hp-empty__action {
  margin-top: var(--hp-space-2);
}

/* ---------- chip ---------- */

.hp-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--hp-space-2);
  /* Asimétrico: más aire a la izquierda (texto) que a la derecha (botón X) */
  padding: 4px 6px 4px 12px;
  border-radius: var(--hp-radius-full);
  background: var(--hp-surface-3);
  border: 1px solid var(--hp-border);
  font-size: var(--hp-text-sm);
  color: var(--hp-text);
  line-height: var(--hp-leading-tight);
  white-space: nowrap;
}

/* Sin botón de cierre: padding parejo a ambos lados */
.hp-chip--no-remove {
  padding: 4px 12px;
}

/* ---- Variantes suaves de color (fondo *-soft + color pleno) ---- */
.hp-chip--primary { background: var(--hp-primary-soft); border-color: var(--hp-primary-soft); color: var(--hp-primary); }
.hp-chip--success { background: var(--hp-success-soft); border-color: var(--hp-success-soft); color: var(--hp-success); }
.hp-chip--warning { background: var(--hp-warning-soft); border-color: var(--hp-warning-soft); color: var(--hp-warning); }
.hp-chip--danger  { background: var(--hp-danger-soft);  border-color: var(--hp-danger-soft);  color: var(--hp-danger); }
.hp-chip--info    { background: var(--hp-info-soft);    border-color: var(--hp-info-soft);    color: var(--hp-info); }

/* ---- Botón de cierre (X) ---- */
.hp-chip__remove {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: var(--hp-radius-full);
  background: none;
  color: var(--hp-text-muted);
  cursor: pointer;
  transition: background var(--hp-transition-fast) var(--hp-ease),
              color var(--hp-transition-fast) var(--hp-ease);
}
.hp-chip__remove:hover {
  /* Tinte rojo translúcido derivado del token de peligro */
  background: color-mix(in srgb, var(--hp-danger) 15%, transparent);
  color: var(--hp-danger);
}
.hp-chip__remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--hp-focus-ring);
}
.hp-chip__remove svg {
  display: block;
  width: 12px;
  height: 12px;
}

/* ---- Modo seleccionable (filtros / toggles) ---- */
.hp-chip--selectable {
  cursor: pointer;
  transition: background var(--hp-transition-fast) var(--hp-ease),
              border-color var(--hp-transition-fast) var(--hp-ease),
              color var(--hp-transition-fast) var(--hp-ease);
}
.hp-chip.is-active {
  background: var(--hp-primary-soft);
  border-color: var(--hp-primary);
  color: var(--hp-primary);
}

/* ---- Salida: el core agrega .is-leaving al hacer click en data-hp-dismiss ---- */
@keyframes hp-chip-out {
  to {
    transform: scale(0.85);
    opacity: 0;
  }
}
.hp-chip.is-leaving {
  animation: hp-chip-out var(--hp-transition-fast) var(--hp-ease) forwards;
}
