/* ================================================================
   Puente Design System × Bootstrap 5.2
   Aplica look Increacity a clases Bootstrap existentes.
   No sustituye el framework ni añade reset de body agresivo.
   ================================================================ */

body {
  background-color: var(--surface-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-title);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

::selection {
  background: var(--ic-cyan-200);
  color: var(--ic-navy-900);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h-md);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: .01em;
  border-radius: var(--radius-pill) !important;
  border-width: var(--border-width-strong);
  transition: var(--transition-base);
}

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

.btn:disabled,
.btn.disabled {
  opacity: .45;
  box-shadow: none;
  transform: none;
}

.btn-primary {
  --bs-btn-color: var(--text-on-brand);
  --bs-btn-bg: var(--ic-cyan);
  --bs-btn-border-color: var(--ic-cyan);
  --bs-btn-hover-color: var(--text-on-brand);
  --bs-btn-hover-bg: color-mix(in srgb, var(--ic-cyan) 82%, white);
  --bs-btn-hover-border-color: color-mix(in srgb, var(--ic-cyan) 82%, white);
  --bs-btn-active-color: var(--text-on-brand);
  --bs-btn-active-bg: var(--ic-cyan);
  --bs-btn-active-border-color: var(--ic-cyan);
  --bs-btn-disabled-color: var(--text-on-brand);
  --bs-btn-disabled-bg: var(--ic-cyan);
  --bs-btn-disabled-border-color: var(--ic-cyan);
  box-shadow: var(--shadow-brand);
}

.btn-primary:hover {
  box-shadow: var(--shadow-brand);
}

.btn-primary:focus,
.btn-primary:active,
.btn-outline-primary:focus,
.btn-outline-primary:active {
  box-shadow: var(--ring-focus) !important;
}

.btn-outline-primary {
  --bs-btn-color: var(--ic-cyan);
  --bs-btn-border-color: var(--ic-cyan);
  --bs-btn-hover-color: var(--ic-cyan-700);
  --bs-btn-hover-bg: var(--ic-cyan-50);
  --bs-btn-hover-border-color: var(--ic-cyan);
  --bs-btn-active-color: var(--text-on-brand);
  --bs-btn-active-bg: var(--ic-cyan);
  --bs-btn-active-border-color: var(--ic-cyan);
  --bs-btn-disabled-color: var(--ic-cyan);
  box-shadow: none;
}

.btn-secondary {
  --bs-btn-color: var(--ic-white);
  --bs-btn-bg: var(--bs-secondary);
  --bs-btn-border-color: var(--bs-secondary);
}

.btn-link {
  color: var(--text-link);
}

.btn-link::after {
  background: var(--ic-cyan);
}

.btn-close:focus {
  box-shadow: var(--ring-focus);
}

/* ---------- Cards (sin padding: las de imagen usan p-0) ---------- */
.card {
  position: relative;
  background: var(--surface-card);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  color: var(--text-body);
}

/* ---------- Formularios ---------- */
.form-control,
.form-select,
.form-control-plaintext.input_form {
  min-height: var(--control-h-md);
  border-radius: var(--radius-sm);
  border-color: var(--border-default);
  color: var(--text-body);
  font-size: var(--text-base);
  transition: var(--transition-base);
}

.form-control::placeholder {
  color: var(--text-placeholder);
}

.form-control:hover,
.form-select:hover {
  border-color: var(--border-strong);
}

.form-control:focus,
.form-control:active,
.form-select:focus,
.form-select:active {
  border-color: var(--border-focus) !important;
  box-shadow: var(--ring-focus) !important;
}

.input-group-text {
  background-color: var(--surface-card);
  border-color: var(--border-default);
  color: var(--text-muted);
}

.form-label,
.ic-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  color: var(--text-title);
}

/* ---------- Alertas ---------- */
.alert {
  border-radius: var(--radius-md);
  border-width: var(--border-width);
  font-size: var(--text-sm);
}

.alert-danger {
  background: var(--ic-danger-soft);
  border-color: #F2BDBC;
  color: #9C2A28;
}

.alert-info {
  background: var(--ic-info-soft);
  border-color: var(--ic-cyan-200);
  color: var(--ic-cyan-900);
}

.alert-success {
  background: var(--ic-success-soft);
  border-color: #B7E5D6;
  color: #0A6B50;
}

.alert-warning {
  background: var(--ic-warning-soft);
  border-color: #F3D69B;
  color: #8A5B00;
}

/* ---------- Tablas (look base; CRUD detallado en B2) ---------- */
.table {
  font-size: var(--text-sm);
  background: var(--surface-card);
  color: var(--text-body);
}

.table > :not(caption) > * > * {
  border-bottom-color: var(--border-subtle);
}

.table thead th {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  border-bottom: var(--border-width) solid var(--border-default);
  padding: var(--space-3) var(--space-4);
  vertical-align: middle;
  background: var(--ic-navy-50);
}

.table tbody td {
  padding: var(--space-4);
  vertical-align: middle;
}

.table tbody tr:hover {
  background: var(--ic-navy-50);
}

/* ---------- Modales ---------- */
.modal-content {
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal-header,
.modal-footer {
  border-color: var(--border-subtle);
}

.modal-title {
  font-family: var(--font-heading);
  color: var(--text-title);
}

.modal-backdrop.show {
  opacity: 1;
  background: var(--overlay-scrim);
  backdrop-filter: blur(2px);
}

.offcanvas {
  border-left: var(--border-width) solid var(--border-subtle);
}

/* ---------- Shell: sidebar + main (evita que .col al 100% baje de línea bajo el menú) ---------- */
.app-body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.app-body.activo {
  overflow: hidden;
}

.app-shell {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.app-shell__sidebar.sidebar {
  flex: 0 0 264px;
  width: 264px;
  max-width: 264px;
  min-width: 264px;
  height: 100vh;
  height: 100dvh;
  position: relative;
  z-index: 30;
  overflow: hidden;
  background-color: var(--ic-navy);
  color: var(--text-on-inverse);
  display: flex;
  flex-direction: column;
}

.app-shell__backdrop {
  display: none;
}

.app-shell__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--surface-page);
}

.app-shell__stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-shell__content {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--space-4) var(--space-6) var(--space-8);
  width: 100%;
  max-width: 100%;
}

/* Overlay de carga: solo cubre el contenido, no sidebar ni navbar */
.app-shell__stage #mostrar {
  position: absolute;
  inset: 0;
  z-index: 15;
  width: auto;
  height: auto;
  background: var(--surface-page);
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition:
    opacity 480ms var(--ease-out),
    transform 480ms var(--ease-out),
    visibility 0s linear 0s;
}

.app-shell__stage #mostrar.ocultar {
  top: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-1.25rem);
  transition:
    opacity 480ms var(--ease-out),
    transform 480ms var(--ease-out),
    visibility 0s linear 480ms;
}

.app-shell__stage #mostrar.mostrar {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition:
    opacity 280ms var(--ease-out),
    transform 280ms var(--ease-out),
    visibility 0s linear 0s;
}

.app-shell__stage #spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  font-size: 50px;
  color: var(--ic-cyan);
  animation: ic-spinner-rotate 0.85s linear infinite;
}

@keyframes ic-spinner-rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@media (max-width: 767.98px) {
  .app-shell__sidebar.sidebar {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    transform: translateX(-100%);
    transition: transform var(--duration-base) var(--ease-out);
    box-shadow: var(--shadow-lg);
  }

  .app-shell__sidebar.is-open {
    transform: translateX(0);
  }

  .app-body.app-sidebar-open .app-shell__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 14, 61, .45);
    z-index: 25;
  }
}

/* ---------- Navbar top (clara, no navy: el sidebar ya es oscuro) ---------- */
.app-navbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 100%;
  max-width: 100%;
  min-height: 4.5rem;
  padding: var(--space-3) var(--space-6);
  margin: 0;
  background: var(--surface-card);
  border-bottom: var(--border-width) solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  z-index: 20;
  position: sticky;
  top: 0;
}

.app-navbar .btn {
  margin-top: 0;
}

.app-navbar__start,
.app-navbar__end {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 0 0 auto;
  margin-left: auto;
}

.app-navbar__search {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 28rem;
}

.app-navbar__search .input-group {
  margin: 0;
}

.app-navbar__user {
  display: flex;
  flex-direction: column;
  line-height: var(--leading-snug);
  min-width: 0;
}

.app-navbar__user-name {
  font-weight: var(--fw-semibold);
  color: var(--text-title);
  font-size: var(--text-sm);
}

.app-navbar__user-role {
  font-size: var(--text-xs);
  color: var(--ic-cyan);
}

.app-navbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-circle);
  background: var(--ic-cyan);
  color: var(--ic-white);
  flex: none;
}

.app-navbar__icon-btn svg {
  margin: 0;
}

.app-navbar .navbar-toggle {
  position: static;
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: var(--radius-sm);
}

.app-navbar .navbar-toggle:hover {
  background: var(--ic-navy-50);
}

@media (max-width: 767.98px) {
  .app-navbar .navbar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .app-navbar {
    padding-inline: var(--space-4);
    flex-wrap: wrap;
  }
}

.app-navbar .nav-link {
  color: var(--text-body) !important;
  opacity: 1;
  margin: 0;
}

.app-navbar .input-group {
  background: var(--surface-sunken);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  opacity: 1;
}

.app-navbar .input-group .form-control,
.app-navbar .input-group .input-group-text {
  background: transparent;
  opacity: 1;
}

.app-navbar .dropdown-menu {
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-4);
}

/* ---------- Sidebar ---------- */
.sidebar {
  background-color: var(--ic-navy);
  color: var(--text-on-inverse);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  width: 100%;
}

.app-sidebar__brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6) var(--space-4) var(--space-5);
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.app-sidebar__brand-link {
  display: flex;
  width: 100%;
  justify-content: center;
  align-items: center;
}

.app-sidebar__nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: var(--space-3) var(--space-3) var(--space-4);
}

.app-sidebar__nav::-webkit-scrollbar {
  width: 6px;
}

.app-sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 255, .45);
}

.app-sidebar__footer {
  flex: 0 0 auto;
  padding: var(--space-3) var(--space-3) var(--space-5);
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.sidebar .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  max-width: 100%;
  color: rgba(255, 255, 255, .78) !important;
  opacity: 1;
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  margin: 0 0 var(--space-1);
  padding: var(--space-3);
  border-bottom: none;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
}

.sidebar .nav-link:hover {
  color: var(--ic-white) !important;
  text-decoration: none !important;
  background: rgba(255, 255, 255, .08);
}

.sidebar .nav-link.active,
.sidebar .nav-link.active > li.icon-nav {
  color: var(--ic-cyan) !important;
  opacity: 1 !important;
  font-weight: var(--fw-bold) !important;
  background: rgba(6, 182, 255, .14);
  box-shadow: inset 3px 0 0 var(--ic-cyan);
}

.sidebar a:not(.nav-link) {
  color: rgba(255, 255, 255, .78);
}

.sidebar a:not(.nav-link):hover {
  color: var(--ic-white);
}

.sidebar .app-sidebar__footer .nav-link:hover,
.sidebar .app-sidebar__footer a:hover {
  background: rgba(255, 255, 255, .08) !important;
}

.sidebar .ic-logo--sidebar {
  display: flex;
  width: 100%;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.sidebar .ic-logo--sidebar img,
.sidebar .ic-logo--sidebar .ic-logo__img {
  height: auto;
  width: 100%;
  max-width: none;
  max-height: 6.25rem;
  object-fit: contain;
}

/* ---------- Logos (src lo define el proyecto / configs) ---------- */
.ic-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.ic-logo img,
.ic-logo__img {
  height: 32px;
  width: auto;
  display: block;
}

.ic-logo--sm img,
.ic-logo--sm .ic-logo__img {
  height: 24px;
}

.ic-logo--lg img,
.ic-logo--lg .ic-logo__img {
  height: 48px;
}

.ic-logo:hover {
  opacity: .85;
  text-decoration: none !important;
}

.ic-logo-safe {
  padding: calc(var(--logo-clearspace) * .5em);
}

.form-login .ic-logo:not(.ic-logo--auth) img,
.form-login .ic-logo:not(.ic-logo--auth) .ic-logo__img {
  height: auto;
  width: 50%;
  max-width: 240px;
  margin-inline: auto;
}

/* ---------- Avatar ---------- */
.ic-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-circle);
  background: var(--ic-navy);
  color: var(--ic-white);
  overflow: hidden;
  flex: none;
  object-fit: cover;
}

.ic-avatar--lg {
  width: 56px;
  height: 56px;
}

/* ---------- Progress ---------- */
.progress {
  height: 10px;
  background: var(--surface-sunken);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar {
  background: var(--gradient-cyan);
  border-radius: var(--radius-pill);
}

/* ---------- Paginación ---------- */
.pagination > .page-item > .page-link,
.pagination > .page-item > span {
  color: var(--ic-cyan);
}

.pagination > .page-item > .page-link:hover,
.pagination > .page-item > .page-link:focus,
.pagination > .page-item.active > a,
.pagination > .page-item.active > span {
  color: var(--ic-cyan) !important;
}

/* ---------- Superficie oscura / utilidades de marca ---------- */
.ic-surface-dark,
.bg-personal {
  background: var(--ic-navy);
  color: var(--ic-white);
}

.bg-gradient-blue::before {
  background-color: var(--ic-navy);
}

/* ---------- Auth (login / register / forgot) ---------- */
html.auth-html,
html.auth-html body.auth-body {
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--surface-card);
}

.auth-shell {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.auth-shell > .row {
  height: 100%;
  min-height: 0;
}

.auth-pane {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--surface-card);
  padding: clamp(var(--space-3), 2.4vh, var(--space-8)) var(--space-4);
}

.auth-pane::before,
.auth-pane::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
}

.auth-hero {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  padding: 0;
}

.auth-hero .carousel,
.auth-hero .carousel-inner,
.auth-hero .carousel-item,
.auth-hero .container-f {
  height: 100%;
}

.auth-hero .background-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-hero .overlay-image {
  top: auto;
  left: 0;
  bottom: 0;
  width: 100%;
  max-height: 45%;
  object-fit: contain;
  object-position: left bottom;
}

.auth-pane .form-login {
  width: min(26rem, 100%);
  margin: 0;
  flex: 0 0 auto;
}

.auth-pane--register .form-login {
  width: min(42rem, 100%);
  padding-bottom: var(--space-2);
}

.auth-pane .btn {
  margin-top: 0;
}

.auth-pane .form-login h3 {
  margin-top: var(--space-2);
  margin-bottom: var(--space-1);
}

.auth-pane .form-login h6.fw-normal {
  margin-bottom: var(--space-4);
}

.auth-pane .form-login .input-group.mb-3 {
  margin-bottom: var(--space-3) !important;
}

.auth-pane .form-login .row.gx-4 a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-h-md);
  padding: var(--space-2) !important;
  font-size: var(--text-xs);
}

.auth-pane .form-login .row.gx-4 img {
  max-width: 1.5rem !important;
  height: auto;
  padding: 0 !important;
}

.ic-logo--auth {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: clamp(var(--space-2), 1.6vh, var(--space-5));
}

.ic-logo--auth img,
.ic-logo--auth .ic-logo__img,
.form-login .ic-logo--auth img,
.form-login .ic-logo--auth .ic-logo__img {
  height: auto;
  width: min(24rem, 94%, 38svh);
  max-width: 24rem;
  min-width: 12rem;
  margin-inline: auto;
}

.auth-pane--register .ic-logo--auth img,
.auth-pane--register .ic-logo--auth .ic-logo__img {
  width: min(22rem, 86%, 34svh);
  max-width: 22rem;
  min-width: 13rem;
}

.auth-register-form .form-control,
.auth-register-form .form-select {
  min-height: var(--control-h-sm);
  font-size: var(--text-sm);
  padding-block: var(--space-2);
}

.auth-register-form .row.g-2 {
  --bs-gutter-y: .5rem;
}

@media (max-height: 720px) {
  .auth-pane .form-login h3 {
    font-size: 1.35rem;
  }

  .auth-pane .form-login h6.fw-normal {
    margin-bottom: var(--space-3);
  }

  .auth-pane .form-login .mt-4 {
    margin-top: var(--space-3) !important;
  }

  .auth-pane .form-login .mb-4 {
    margin-bottom: var(--space-2) !important;
  }
}

@media (max-width: 767.98px) {
  html.auth-html,
  html.auth-html body.auth-body {
    overflow: hidden;
  }
}

/* ---------- Admin listados (B2) ---------- */
.admin-panel {
  background: var(--surface-card);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
  min-height: 30rem;
}

.admin-panel + .admin-panel {
  margin-top: var(--space-6);
}

.admin-panel--form {
  min-height: 0;
}

.admin-panel__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.admin-panel__title {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--text-xl);
  color: var(--text-title);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.admin-panel__title a {
  color: var(--ic-cyan);
  display: inline-flex;
  line-height: 1;
}

.admin-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.admin-panel .btn {
  margin-top: 0;
}

.admin-panel .table-responsive {
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow-x: hidden;
}

.admin-panel .table {
  margin-bottom: 0;
  table-layout: fixed;
  width: 100%;
}

.admin-panel .table th,
.admin-panel .table td {
  vertical-align: middle;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-panel .table thead th:last-child,
.admin-panel .table tbody td:last-child {
  text-align: right;
  white-space: nowrap;
  width: 11.5rem;
  min-width: 11.5rem;
  padding-left: var(--space-3);
  padding-right: 1.75rem;
}

.admin-panel .table tbody td:last-child > .btn {
  margin-left: var(--space-2);
}

.admin-panel .table tbody td:last-child > .btn:first-of-type {
  margin-left: 0;
}

.admin-panel .table .btn {
  min-height: var(--control-h-sm);
  padding-inline: var(--space-3);
  font-size: var(--text-xs);
}

.admin-panel .table img {
  max-width: 4.5rem;
  max-height: 2.75rem;
  width: auto;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-xs);
}

.admin-panel .table td .row {
  --bs-gutter-x: 0;
  margin: 0;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: var(--space-2);
  padding-right: var(--space-1);
}

.admin-table__primary {
  display: block;
  font-weight: var(--fw-semibold);
  color: var(--text-title);
}

.admin-table__muted {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.admin-table__clip {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.admin-panel input[type="color"] {
  width: 3rem;
  height: 2.5rem;
  padding: 0.15rem;
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  cursor: pointer;
}

.ic-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: .01em;
  background: var(--ic-navy-100);
  color: var(--ic-navy-800);
}

.ic-badge--success {
  background: var(--ic-success-soft);
  color: var(--ic-success);
}

.ic-badge--danger {
  background: var(--ic-danger-soft);
  color: var(--ic-danger);
}

.ic-badge--warning {
  background: var(--ic-warning-soft);
  color: var(--ic-warning);
}

.ic-card--interactive {
  cursor: pointer;
  transition: transform var(--duration-base) var(--ease-out),
    box-shadow var(--duration-base) var(--ease-out),
    border-color var(--duration-base) var(--ease-out);
}

.ic-card--interactive:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--ic-cyan-200);
}

.ic-stat {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--ic-info-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}

.ic-stat__value {
  font-family: var(--font-heading);
  font-weight: var(--fw-black);
  font-size: var(--text-2xl);
  color: var(--text-title);
  line-height: 1;
}

.ic-stat__label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.ic-stat__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-circle);
  background: var(--ic-cyan);
}

.ic-avatar--xl {
  width: 200px;
  height: 200px;
  max-width: 200px;
}

/* ---------- Portal (B3) ---------- */
.portal-page {
  text-align: start;
  margin-bottom: var(--space-6);
}

.portal-page__title {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  font-size: var(--text-xl);
  color: var(--text-title);
  margin: 0 0 var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.portal-page__title a {
  color: var(--ic-cyan);
  display: inline-flex;
  line-height: 1;
}

.portal-page__lead {
  color: var(--text-muted);
  font-weight: var(--fw-regular);
  margin: 0;
}

.portal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.portal-panel {
  background: var(--surface-card);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-6);
}

.portal-media-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  min-height: 12rem;
}

.portal-media-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, var(--overlay-scrim) 100%);
  pointer-events: none;
  border-radius: inherit;
}

.portal-media-card .card-body {
  position: relative;
  z-index: 1;
}

.portal-cat-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--ic-navy);
}

.portal-search-hit {
  background: var(--ic-info-soft);
  border: var(--border-width) solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-3) 0;
}

.portal-search-hit a {
  color: var(--text-title);
  font-weight: var(--fw-semibold);
}

.portal-wizard__timer {
  border-color: var(--ic-cyan) !important;
}

.ranking-board {
  background: var(--ic-cyan);
  border-radius: var(--radius-lg);
}

.ranking-board .padre.bg-primary,
.ranking-board .ranking-item {
  background: var(--ic-cyan) !important;
}

.portal-reward-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 22rem;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.portal-reward-card__rule {
  border: 0;
  border-top: 2px dashed var(--ic-navy-300) !important;
  opacity: 1;
}

.portal-reward-card .card-title {
  font-family: var(--font-heading);
  font-weight: var(--fw-bold);
  color: var(--text-title);
}

.portal-reward-card .card-body {
  padding-bottom: 3.5rem;
}

.portal-badge-card {
  background: var(--ic-navy-100) !important;
  border: var(--border-width) solid var(--border-subtle) !important;
  border-radius: var(--radius-lg);
}

.portal-badge-card a {
  color: var(--text-title);
}

.portal-badge-card__media {
  width: 75px;
  height: 75px;
  border-radius: var(--radius-circle);
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  flex: none;
}

/* Home portal / admin: encajar en el viewport sin alterar las proporciones originales */
.app-shell__content:has(.home-screen) {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-screen {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.home-screen__hero {
  flex: 0 0 auto;
}

.home-screen__hero > [class*="col-"] {
  min-height: 0;
}

.home-screen .carousel-item > .container-f:not(.carouse) {
  display: block;
  width: 100%;
}

.home-screen__stats {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.5rem;
  height: 100%;
}

.home-screen__cats-title {
  flex: none;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.home-screen__cats {
  flex: 0 1 auto;
  min-height: 0;
}

.home-screen .img-h {
  display: block;
  width: 90%;
  height: auto;
  aspect-ratio: 445 / 373;
}

.home-screen .img-h:hover {
  width: 93%;
}

.home-screen .portal-cat-card img {
  width: 100%;
  height: auto;
  display: block;
}

.home-screen .overlay-image-categ {
  top: 70%;
  left: 10%;
  bottom: auto;
}

.home-screen--admin {
  justify-content: flex-start;
}

.home-screen--admin .home-screen__cats {
  flex: 0 1 auto;
}

@media (max-width: 767.98px) {
  .app-shell__content:has(.home-screen) {
    overflow-y: auto;
  }

  .home-screen {
    overflow: visible;
    height: auto;
    flex: none;
  }

  .home-screen .img-h,
  .home-screen .img-h:hover {
    width: 90%;
    margin-bottom: var(--space-3);
  }
}
