/* ===========================================================================
   GIPFELTX — components.css · superficies de cristal y controles
   =========================================================================== */

/* ===========================================================================
   CRISTAL
   =========================================================================== */
.glass {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  border: 1px solid var(--glass-brd);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md), var(--sh-inset);
}

/* Filo luminoso en el borde superior */
.glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(160deg, var(--glass-hi), transparent 42%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

.glass--flat   { box-shadow: var(--sh-sm); }
.glass--raised { box-shadow: var(--sh-lg), var(--sh-inset); }
.glass--sunk   { background: var(--glass-bg-2); box-shadow: none; }
.glass--plain::before { display: none; }

.card {
  padding: var(--sp-6);
  border-radius: var(--r-xl);
}
.card--sm { padding: var(--sp-4); border-radius: var(--r-lg); }
.card--lg { padding: clamp(var(--sp-6), 4vw, var(--sp-10)); border-radius: var(--r-2xl); }

.card-hover {
  transition: transform var(--t-base) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out),
              border-color var(--t-base) var(--ease-out);
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg), var(--sh-inset);
  border-color: var(--brand-300);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.card-title {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}
.card-sub {
  font-size: var(--fs-sm);
  color: var(--text-mute);
  margin-top: 2px;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin-block: var(--sp-5);
}
.divider--soft { background: var(--line-soft); }

/* ===========================================================================
   BOTONES
   =========================================================================== */
.btn {
  --btn-h: 42px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: var(--btn-h);
  padding-inline: var(--sp-5);
  border-radius: var(--r-full);
  font-size: var(--fs-base);
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              box-shadow var(--t-base) var(--ease-out);
}
.btn:active:not(:disabled) { transform: scale(0.975); }
.btn:disabled,
.btn[aria-disabled='true'] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn .ico { flex-shrink: 0; }

/* Brillo que cruza al pasar el cursor */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.26) 50%, transparent 80%);
  transform: translateX(-120%);
  transition: transform var(--t-slower) var(--ease-out);
}
.btn:hover::after { transform: translateX(120%); }

.btn--primary {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border: 1px solid var(--brand-600);
  box-shadow: var(--sh-accent);
}
.btn--primary:hover { background: linear-gradient(135deg, var(--brand-400), var(--brand-500)); }

.btn--flame {
  background: linear-gradient(118deg, var(--flame-500) 0%, var(--brand-500) 52%, var(--brand-600) 100%);
  color: #fff;
  border: 1px solid var(--brand-600);
  box-shadow: var(--sh-accent);
}

.btn--ghost {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn--ghost:hover { border-color: var(--brand-400); color: var(--accent-text); }

.btn--soft {
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid transparent;
}
.btn--soft:hover { border-color: var(--brand-300); }

.btn--line {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--line-strong);
}
.btn--line:hover { border-color: var(--accent); color: var(--accent-text); }

.btn--quiet {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid transparent;
  box-shadow: none;
}
.btn--quiet:hover { background: var(--surface-3); color: var(--text); }

.btn--danger {
  background: var(--err-500);
  color: #fff;
  border: 1px solid var(--err-600);
}
.btn--danger:hover { background: var(--err-600); }

.btn--sm  { --btn-h: 34px; padding-inline: var(--sp-4); font-size: var(--fs-sm); }
.btn--xs  { --btn-h: 28px; padding-inline: var(--sp-3); font-size: var(--fs-xs); gap: 5px; }
.btn--lg  { --btn-h: 52px; padding-inline: var(--sp-8); font-size: var(--fs-md); }
.btn--xl  { --btn-h: 58px; padding-inline: var(--sp-10); font-size: var(--fs-lg); }
.btn--full{ width: 100%; }
.btn--icon{ width: var(--btn-h); padding: 0; border-radius: var(--r-full); }

.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::before {
  content: '';
  position: absolute;
  width: 17px; height: 17px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  color: #fff;
  animation: spin 620ms linear infinite;
}
.btn--ghost.is-loading::before,
.btn--line.is-loading::before,
.btn--quiet.is-loading::before { color: var(--accent); }

/* ===========================================================================
   ICONOS
   =========================================================================== */
.ico {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}
.ico--xs { width: 14px; height: 14px; }
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 24px; height: 24px; }
.ico--xl { width: 32px; height: 32px; }
.ico--fill { fill: currentColor; stroke: none; }

.ico-badge {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  border: 1px solid var(--glass-brd-2);
}
.ico-badge--lg { width: 56px; height: 56px; border-radius: var(--r-lg); }
.ico-badge--flame {
  background: linear-gradient(135deg, var(--brand-500), var(--brand-600));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--sh-accent);
}

/* ===========================================================================
   FORMULARIOS
   =========================================================================== */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field--row { grid-column: 1 / -1; }

.label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-soft);
  letter-spacing: 0.005em;
}
.label .req { color: var(--brand-500); font-weight: 700; }

.control {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              background-color var(--t-fast) var(--ease-out);
  appearance: none;
}
.control::placeholder { color: var(--text-faint); }
.control:hover:not(:disabled):not(:focus) { border-color: var(--line-strong); }
.control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
}
.control:disabled { background: var(--surface-3); color: var(--text-mute); cursor: not-allowed; }
.control[readonly] { background: var(--surface-2); }

textarea.control { min-height: 110px; resize: vertical; line-height: var(--lh-base); }

select.control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237e786f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 40px;
  cursor: pointer;
}

.field.is-invalid .control {
  border-color: var(--err-500);
  background: color-mix(in srgb, var(--err-500) 5%, var(--surface));
}
.field.is-invalid .control:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--err-500) 26%, transparent); }
.field.is-valid .control { border-color: var(--ok-500); }

.field-msg {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-xs);
  color: var(--err-500);
  animation: slide-right var(--t-fast) var(--ease-out);
}
.field.is-invalid .field-msg { display: flex; }

.field-hint {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  line-height: 1.45;
}

.input-group { position: relative; display: flex; align-items: center; }
.input-group .control { padding-left: 42px; }
.input-group__ico {
  position: absolute;
  left: 13px;
  color: var(--text-faint);
  pointer-events: none;
  transition: color var(--t-fast) var(--ease-out);
}
.input-group .control:focus ~ .input-group__ico { color: var(--accent); }

.input-group__btn {
  position: absolute;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border-radius: var(--r-sm);
  color: var(--text-mute);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.input-group__btn:hover { background: var(--surface-3); color: var(--text); }
.input-group:has(.input-group__btn) .control { padding-right: 46px; }

/* Casillas y radios */
.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: var(--fs-sm);
  line-height: 1.45;
  user-select: none;
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  margin-top: 1px;
  border: 1.5px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  transition: all var(--t-fast) var(--ease-out);
}
.check__box svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3; opacity: 0; transform: scale(0.4); transition: all var(--t-fast) var(--ease-spring); }
.check input:checked + .check__box {
  background: var(--accent);
  border-color: var(--accent);
}
.check input:checked + .check__box svg { opacity: 1; transform: none; }
.check input:focus-visible + .check__box { box-shadow: var(--ring); }
.check:hover .check__box { border-color: var(--brand-400); }
.check--radio .check__box { border-radius: 50%; }

/* Interruptor */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  position: relative;
  width: 44px; height: 25px;
  border-radius: var(--r-full);
  background: var(--line-strong);
  transition: background-color var(--t-base) var(--ease-out);
}
.switch__thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--sh-sm);
  transition: transform var(--t-base) var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(19px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }

/* ===========================================================================
   INFOTIP  (icono de información con mensaje)
   =========================================================================== */
.infotip {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 17px; height: 17px;
  border-radius: 50%;
  color: var(--text-faint);
  cursor: help;
  flex-shrink: 0;
  transition: color var(--t-fast) var(--ease-out);
  vertical-align: middle;
}
.infotip:hover, .infotip:focus-visible { color: var(--accent); }
.infotip svg { width: 15px; height: 15px; }

.infotip__bubble {
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  z-index: var(--z-tip);
  width: max-content;
  max-width: min(290px, 78vw);
  padding: 10px 13px;
  font-size: var(--fs-xs);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-lg);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition: opacity var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out),
              visibility var(--t-fast);
  pointer-events: none;
}
.infotip__bubble::after {
  content: '';
  position: absolute;
  top: 100%; left: 50%;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--line);
}
.infotip:hover .infotip__bubble,
.infotip:focus-visible .infotip__bubble,
.infotip.is-open .infotip__bubble {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
/* se voltea cerca del borde izquierdo */
.infotip--start .infotip__bubble { left: 0; transform: translate(0, 6px); }
.infotip--start:hover .infotip__bubble,
.infotip--start.is-open .infotip__bubble { transform: translate(0, 0); }
.infotip--start .infotip__bubble::after { left: 14px; }

/* ===========================================================================
   DISTINTIVOS Y FICHAS
   =========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.6;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid var(--line-soft);
  white-space: nowrap;
}
.badge--accent { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.badge--ok     { background: color-mix(in srgb, var(--ok-500) 14%, transparent); color: var(--ok-600); border-color: transparent; }
.badge--warn   { background: color-mix(in srgb, var(--warn-500) 16%, transparent); color: var(--warn-600); border-color: transparent; }
.badge--err    { background: color-mix(in srgb, var(--err-500) 14%, transparent); color: var(--err-600); border-color: transparent; }
.badge--info   { background: color-mix(in srgb, var(--info-500) 14%, transparent); color: var(--info-600); border-color: transparent; }
.badge--solid  { background: var(--accent); color: #fff; border-color: transparent; }
.badge__dot    { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

:root[data-theme='dark'] .badge--ok   { color: var(--ok-400); }
:root[data-theme='dark'] .badge--warn { color: var(--warn-400); }
:root[data-theme='dark'] .badge--err  { color: var(--err-400); }
:root[data-theme='dark'] .badge--info { color: var(--info-400); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  white-space: nowrap;
}
.chip:hover { border-color: var(--brand-400); transform: translateY(-1px); }
.chip.is-on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
}
.chip__x { display: grid; place-items: center; opacity: 0.6; }
.chip__x:hover { opacity: 1; }

/* ===========================================================================
   AVISOS
   =========================================================================== */
.note {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-lg);
  font-size: var(--fs-sm);
  line-height: 1.55;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-strong);
}
.note__ico { flex-shrink: 0; margin-top: 1px; }
.note__title { font-weight: 600; margin-bottom: 2px; }
.note--info  { background: color-mix(in srgb, var(--info-500) 7%, var(--surface)); border-left-color: var(--info-500); }
.note--ok    { background: color-mix(in srgb, var(--ok-500) 8%, var(--surface));   border-left-color: var(--ok-500); }
.note--warn  { background: color-mix(in srgb, var(--warn-500) 9%, var(--surface)); border-left-color: var(--warn-500); }
.note--err   { background: color-mix(in srgb, var(--err-500) 7%, var(--surface));  border-left-color: var(--err-500); }
.note--accent{ background: var(--accent-soft); border-left-color: var(--accent); }
.note--info  .note__ico { color: var(--info-500); }
.note--ok    .note__ico { color: var(--ok-500); }
.note--warn  .note__ico { color: var(--warn-500); }
.note--err   .note__ico { color: var(--err-500); }
.note--accent .note__ico { color: var(--accent); }

/* ===========================================================================
   AVISOS FLOTANTES
   =========================================================================== */
.toasts {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - var(--sp-8)));
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-xl);
  font-size: var(--fs-sm);
  line-height: 1.45;
  pointer-events: auto;
  animation: toast-in var(--t-base) var(--ease-spring) both;
  overflow: hidden;
}
.toast.is-out { animation: toast-out var(--t-base) var(--ease-in-out) both; }
.toast__ico { flex-shrink: 0; margin-top: 1px; }
.toast__body { flex: 1; min-width: 0; }
.toast__title { font-weight: 600; }
.toast__text { color: var(--text-soft); font-size: var(--fs-xs); margin-top: 2px; }
.toast__x { color: var(--text-faint); display: grid; place-items: center; }
.toast__x:hover { color: var(--text); }
.toast__bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  background: currentColor;
  opacity: 0.4;
  animation: toast-bar linear forwards;
}
.toast--ok   { border-left: 3px solid var(--ok-500); }
.toast--err  { border-left: 3px solid var(--err-500); }
.toast--warn { border-left: 3px solid var(--warn-500); }
.toast--info { border-left: 3px solid var(--info-500); }
.toast--ok   .toast__ico { color: var(--ok-500); }
.toast--err  .toast__ico { color: var(--err-500); }
.toast--warn .toast__ico { color: var(--warn-500); }
.toast--info .toast__ico { color: var(--info-500); }

@keyframes toast-in  { from { opacity: 0; transform: translate3d(26px, 0, 0) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to   { opacity: 0; transform: translate3d(26px, 0, 0) scale(0.96); } }
@keyframes toast-bar { from { width: 100%; } to { width: 0; } }

@media (max-width: 560px) {
  .toasts { left: var(--sp-4); right: var(--sp-4); bottom: var(--sp-4); width: auto; }
}

/* ===========================================================================
   MODAL
   =========================================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background: var(--scrim);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in var(--t-base) var(--ease-out);
  overflow-y: auto;
}
.modal.is-out { animation: fade-in var(--t-base) var(--ease-out) reverse forwards; }
.modal__panel {
  width: min(560px, 100%);
  max-height: calc(100vh - var(--sp-10));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-xl);
  animation: modal-in var(--t-slow) var(--ease-spring) both;
  overflow: hidden;
}
.modal__panel--wide { width: min(900px, 100%); }
.modal__panel--full { width: min(1180px, 100%); }
.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6);
  border-bottom: 1px solid var(--line-soft);
}
.modal__title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; }
.modal__body { padding: var(--sp-6); overflow-y: auto; flex: 1; }
.modal__foot {
  display: flex;
  justify-content: flex-end;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--line-soft);
  background: var(--surface-2);
}
@keyframes modal-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } to { opacity: 1; transform: none; } }

@media (max-width: 560px) {
  .modal { padding: 0; place-items: end stretch; }
  .modal__panel { border-radius: var(--r-2xl) var(--r-2xl) 0 0; max-height: 92vh; }
  .modal__foot { flex-direction: column-reverse; }
  .modal__foot .btn { width: 100%; }
}

/* ===========================================================================
   PESTAÑAS
   =========================================================================== */
.tabs {
  position: relative;
  display: flex;
  gap: 3px;
  padding: 4px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-mute);
  border-radius: var(--r-full);
  white-space: nowrap;
  transition: color var(--t-base) var(--ease-out);
}
.tab:hover { color: var(--text); }
.tab.is-on { color: var(--text); }
.tabs__pill {
  position: absolute;
  top: 4px;
  height: calc(100% - 8px);
  border-radius: var(--r-full);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  transition: transform var(--t-slow) var(--ease-spring), width var(--t-slow) var(--ease-spring);
  pointer-events: none;
}

.tabpanel { animation: fade-up var(--t-slow) var(--ease-out); }

/* ===========================================================================
   PASOS
   =========================================================================== */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
}

/* Cada paso se estira; el último solo ocupa lo suyo, así la barra
   siempre cabe en la tarjeta sin barra de desplazamiento. */
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}
.step:last-child { flex: 0 0 auto; }
.step__dot {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-mute);
  background: var(--surface-3);
  border: 1.5px solid var(--line);
  transition: all var(--t-base) var(--ease-spring);
}
.step__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t-base) var(--ease-out);
}
.step__line {
  flex: 1 1 auto;
  min-width: 14px;
  height: 2px;
  margin-inline: 10px;
  background: var(--line);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.step__line::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--t-slow) var(--ease-out);
}
.step.is-done .step__line::after { transform: scaleX(1); }
.step.is-on .step__dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--sh-accent);
  transform: scale(1.1);
}
.step.is-on .step__label { color: var(--text); }
.step.is-done .step__dot {
  background: var(--ok-500);
  border-color: var(--ok-500);
  color: #fff;
}
.step.is-done .step__label { color: var(--text-soft); }

@media (max-width: 760px) {
  .step__label { display: none; }
  .step__line { margin-inline: 6px; }
}

/* ===========================================================================
   PROGRESO
   =========================================================================== */
.bar {
  height: 7px;
  width: 100%;
  border-radius: var(--r-full);
  background: var(--surface-3);
  overflow: hidden;
}
.bar__fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-500), var(--flame-500));
  width: 0;
  transition: width var(--t-slower) var(--ease-out);
}
.bar--sm { height: 5px; }
.bar--lg { height: 10px; }
.bar__fill--ok   { background: linear-gradient(90deg, var(--ok-500), var(--ok-400)); }
.bar__fill--warn { background: linear-gradient(90deg, var(--warn-500), var(--warn-400)); }

.ring { display: grid; place-items: center; position: relative; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--surface-3); fill: none; }
.ring__fill {
  stroke: var(--accent);
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset var(--t-slower) var(--ease-out);
}
.ring__val {
  position: absolute;
  font-family: var(--font-display);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ===========================================================================
   TABLAS
   =========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
}
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 11px 14px;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-mute);
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table tbody tr { transition: background-color var(--t-fast) var(--ease-out); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table--click tbody tr { cursor: pointer; }
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--text); }
.th-sort__ico { display: inline-block; width: 12px; margin-left: 4px; opacity: 0.4; }
.th-sort.is-asc .th-sort__ico,
.th-sort.is-desc .th-sort__ico { opacity: 1; color: var(--accent); }
.th-sort.is-desc .th-sort__ico { transform: rotate(180deg); }

/* ===========================================================================
   CARGA DE ARCHIVOS
   =========================================================================== */
.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 148px;
  padding: var(--sp-5);
  text-align: center;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--t-base) var(--ease-out);
}
.drop:hover { border-color: var(--brand-400); background: var(--accent-soft); }
.drop.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.012);
  box-shadow: var(--sh-accent);
}
.drop.is-filled { border-style: solid; border-color: var(--ok-500); background: color-mix(in srgb, var(--ok-500) 7%, var(--surface)); }
.drop input[type='file'] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__ico { color: var(--text-faint); transition: color var(--t-base), transform var(--t-base) var(--ease-spring); }
.drop:hover .drop__ico { color: var(--accent); transform: translateY(-3px); }
.drop.is-filled .drop__ico { color: var(--ok-500); }
.drop__title { font-size: var(--fs-sm); font-weight: 600; }
.drop__hint { font-size: var(--fs-xs); color: var(--text-faint); }

.filecard {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  animation: scale-in var(--t-base) var(--ease-spring);
}
.filecard__thumb {
  width: 40px; height: 40px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  color: var(--text-mute);
  overflow: hidden;
}
.filecard__thumb img { width: 100%; height: 100%; object-fit: cover; }
.filecard__name { font-size: var(--fs-sm); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filecard__meta { font-size: var(--fs-xs); color: var(--text-faint); }

/* ===========================================================================
   ESCALA DE VALORACIÓN 1-4 + N/E
   =========================================================================== */
.rate {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  border: 1px solid var(--line-soft);
}
.rate__opt { position: relative; }
.rate__opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.rate__opt span {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 28px;
  padding-inline: 7px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-mute);
  border-radius: var(--r-full);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  user-select: none;
}
.rate__opt span:hover { background: var(--surface); color: var(--text); }
.rate__opt input:focus-visible + span { box-shadow: var(--ring); }
.rate__opt input:checked + span {
  color: #fff;
  transform: scale(1.04);
  box-shadow: var(--sh-sm);
}
.rate__opt[data-v='NE'] input:checked + span { background: var(--lvl-ne); }
.rate__opt[data-v='1']  input:checked + span { background: var(--lvl-1); }
.rate__opt[data-v='2']  input:checked + span { background: var(--lvl-2); }
.rate__opt[data-v='3']  input:checked + span { background: var(--lvl-3); color: var(--n-950); }
.rate__opt[data-v='4']  input:checked + span { background: var(--lvl-4); }

/* ===========================================================================
   ACORDEÓN
   =========================================================================== */
.acc { display: flex; flex-direction: column; gap: 10px; }
.acc__item {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
  transition: border-color var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.acc__item.is-open { border-color: var(--brand-300); box-shadow: var(--sh-md); }
.acc__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4);
  text-align: left;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out);
}
.acc__head:hover { background: var(--surface-2); }
.acc__chev { margin-left: auto; color: var(--text-faint); transition: transform var(--t-base) var(--ease-out); }
.acc__item.is-open .acc__chev { transform: rotate(180deg); color: var(--accent); }
.acc__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--t-slow) var(--ease-out);
}
.acc__item.is-open .acc__body { grid-template-rows: 1fr; }
.acc__inner { overflow: hidden; }
.acc__pad { padding: 0 var(--sp-4) var(--sp-4); }

/* ===========================================================================
   ESQUELETOS
   =========================================================================== */
.skel {
  border-radius: var(--r-sm);
  background: linear-gradient(100deg, var(--surface-3) 28%, var(--surface-2) 46%, var(--surface-3) 64%);
  background-size: 260% 100%;
  animation: shimmer 1.5s linear infinite;
}
.skel--text { height: 12px; margin-block: 5px; }
.skel--line { height: 1em; }
.skel--card { height: 128px; border-radius: var(--r-lg); }
.skel--avatar { width: 40px; height: 40px; border-radius: 50%; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-12) var(--sp-5);
  text-align: center;
  color: var(--text-mute);
}
.empty__ico { color: var(--text-faint); opacity: 0.65; }
.empty__title { font-family: var(--font-display); font-size: var(--fs-lg); font-weight: 600; color: var(--text); }
.empty__text { font-size: var(--fs-sm); max-width: 380px; }

/* ===========================================================================
   AVATAR
   =========================================================================== */
.avatar {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-700));
  color: #fff;
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow: hidden;
  user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: var(--fs-xs); }
.avatar--lg { width: 60px; height: 60px; font-size: var(--fs-lg); }
.avatar--xl { width: 88px; height: 88px; font-size: var(--fs-2xl); }

/* ===========================================================================
   MENÚ DESPLEGABLE
   =========================================================================== */
.menu { position: relative; }
.menu__pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: var(--z-drawer);
  min-width: 206px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top right;
  transition: all var(--t-fast) var(--ease-out);
}
.menu.is-open .menu__pop { opacity: 1; visibility: visible; transform: none; }
.menu__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
  color: var(--text-soft);
  border-radius: var(--r-sm);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.menu__item:hover { background: var(--surface-3); color: var(--text); }
.menu__item.is-on { color: var(--accent-text); background: var(--accent-soft); }
.menu__item--danger { color: var(--err-500); }
.menu__item--danger:hover { background: color-mix(in srgb, var(--err-500) 12%, transparent); color: var(--err-600); }
.menu__sep { height: 1px; background: var(--line-soft); margin: 5px 0; }
.menu__label {
  padding: 7px 11px 4px;
  font-size: var(--fs-2xs);
  font-weight: 700;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ===========================================================================
   ESTADÍSTICA
   =========================================================================== */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat__label {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-caps);
  text-transform: uppercase;
  color: var(--text-mute);
}
.stat__value {
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--tracking-tight);
}
.stat__delta { display: inline-flex; align-items: center; gap: 3px; font-size: var(--fs-xs); font-weight: 600; }
.stat__delta--up { color: var(--ok-500); }
.stat__delta--down { color: var(--err-500); }
