.custom-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #3498db;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin: 10px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.logo-container {
  text-align: center;
}

.logo-login {
  max-width: 300px;
}

.grid-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.navbar-logo {
  max-height: 100px !important;
}

.logo-link:hover {
  background-color: transparent !important;
  opacity: 1 !important;
  filter: none !important;
}

.logo-link {
  max-width: 220px;
}

/* Estilo para el navbar */
.navbar {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Sombra */
  height: 58px;
}

.navbar-item, .navbar-link {
    padding: 1.3rem 0.75rem;
}

/* Ajusta la altura de las columnas restando la altura de la navbar (~3.25rem) */
.content-columns {
  /* height: calc(100vh - 3.25rem); */
  /* height: calc(100vh - 85px); */
  height: calc(100vh - 58px);
}

.columns.is-layout-end {
  margin-bottom: 0 !important;
}

/* Hacer scroll interno en el sidebar si es necesario */
.sidebar {
  overflow-y: auto;
  background-color: #FAFAFA !important;
  max-width: 220px;
}

@media (max-width: 768px) {
  .sidebar {
    max-width: none;
  }
}

@media (max-width: 1023px) {
  .navbar-logo {
    max-height: 40px !important;
  }
}


/* 1. Make links flex containers, with space-between text and icon */
.menu-list li>a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #e8e8e8;
  background-color: #FAFAFA;
}

.menu-list li>a.is-active {
  /* background-color: var(--brand-primary) !important;
  background-image: linear-gradient(45deg, var(--brand-gradient-start), var(--brand-gradient-end)) !important; */
  /* font-weight: 500; */
  color: var(--brand-primary);
  font-weight: 600;
}

/* 3. Style the icon */
.toggle-icon i {
  transition: transform 0.2s ease;
}

/* 4. When open, rotate the “+” into an “×” look by rotation */
.menu-list li.open>a .toggle-icon i {
  transform: rotate(45deg);
}

/* 5. Submenu indent & spacing */
.submenu {
  margin-left: 1rem;
  background-color: #F4F4F4;
}

.submenu li>a {
  background-color: #F4F4F4;
}

a:hover {
  /* background-color: color-mix(in srgb, var(--brand-primary) 8%, transparent) !important; */
  color: var(--brand-primary);
}

.menu-list li ul {
  border-inline-start: "none";
  margin: 0;
}

.table-container {
  overflow-x: auto;
  max-width: 100%;
}

.table-container table {
  min-width: 100%;
}

.main-content {
  overflow-x: auto;
}

.button.is-gradient-yellow {
  background-image: linear-gradient(90deg, var(--brand-gradient-start) 4%, var(--brand-gradient-mid) 41%, var(--brand-gradient-end) 100%);
  border: none;
  color: white;
  box-shadow: none;
  padding-left: 24px;
  padding-right: 24px;
}

.button.is-gradient-yellow:hover {
  background-image: linear-gradient(90deg, var(--brand-gradient-hover-start) 4%, var(--brand-gradient-hover-mid) 41%, var(--brand-gradient-hover-end) 100%);
}

.button.is-yellow {
  background-color: #ffa500;
  /* border: none; */
  border-color: #e69500;
  color: white;
  box-shadow: none;
  /* padding-left: 24px;
  padding-right: 24px; */
}

.button.is-yellow:hover {
  background-color: #e59400;
}

span.icon.success > i {
  color: green;
}

span.icon.failed > i {
  color: red;
}

span.icon.misinfo > i {
  color: #3498db;
}

span.icon.started > i {
  color: orange;
}

span.icon.pending > i {
  color: gray;
}

span.icon.partial_success > i {
  color: goldenrod;
}

span.icon.running > i {
  color: orange;
}


html, body { height: 100%;}
body { height: 100%; }

.sidebar .at-bottom { margin-top: auto; }

aside.menu {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.channel-logo-container {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fafafa; */
    overflow: hidden;
}

.channel-logo-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.channel-logo-container-inline {
    margin-left: 1rem;
}

/* Animaciones para toasts */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Clase para animación de entrada (solo primera vez) */
.toast-slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Estilos para el toast container */
#toast-container {
  pointer-events: none;
  width: 400px; /* Ancho fijo */
}

#toast-container .notification {
  pointer-events: all;
  width: 100% !important; /* Forzar que todos los toasts usen el 100% del contenedor */
  max-width: 400px !important;
}

/* Badge de tareas - Personalizado */
#tasks-badge {
  position: absolute !important;
  top: 2px !important;
  right: -8px !important;
  background-color: var(--brand-primary) !important;
  color: white !important;
  font-size: 0.65rem !important;
  min-width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 4px rgba(214, 0, 89, 0.3) !important;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 2px 4px rgba(214, 0, 89, 0.3);
  }
  50% {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(214, 0, 89, 0.5);
  }
}

/* Mejorar el dropdown de tareas */
#tasks-dropdown {
  scrollbar-width: thin;
  scrollbar-color: #dbdbdb transparent;
}

#tasks-dropdown::-webkit-scrollbar {
  width: 6px;
}

#tasks-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

#tasks-dropdown::-webkit-scrollbar-thumb {
  background-color: #dbdbdb;
  border-radius: 3px;
}

/* Icono de sincronización animado - solo para sync */
.task-toast .material-icons,
#tasks-dropdown .material-icons {
  animation: none; /* Por defecto sin animación */
}

.task-toast .icon .material-icons:not(.check_circle),
#tasks-dropdown .icon .material-icons:not(.check_circle) {
  animation: rotate 2s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

.rotating {
  animation: rotate 2s linear infinite;
}

/* Detener animación cuando la tarea está completa */
.material-icons.completed-task {
  animation: none !important;
  -webkit-animation: none !important;
}

.notification.is-primary .material-icons {
  animation: none;
}

.notification.is-primary {
  animation: pulse-success 0.5s ease-out;
}

@keyframes pulse-success {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Transición suave para elementos que se eliminan */
.task-toast {
  padding-right: 3rem !important;
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.badge {
    display: inline-block;
    padding: 0.35em 0.65em;
    font-size: 0.875em;
    /* font-weight: 600; */
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    border-radius: 50rem;
    min-width: 60px;
}

.badge-success {
    /* background-color: #48c774; Verde Bulma */
    background-color: #a4f5c0;
    color: #363636;
}

.badge-warning {
    /* background-color: #ffdd57; Amarillo Bulma */
    background-color: #fdea9e;
    color: #363636;
}

.badge-danger {
    /* background-color: #f14668; Rojo Bulma */
    background-color: #fb6885;
}

.badge-pending {
    background-color: #e0e0e0;
    color: #363636;
}

.badge-started {
    background-color: #3e8ed0;
    color: #fff;
    animation: pulse-started 1.5s ease-in-out infinite;
}

@keyframes pulse-started {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}

#taskInfoContent {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out, opacity 0.3s ease-in-out;
}

/* Estilos para el botón de acciones */
/* Regla base - para todos los .button.is-ghost */
.button.is-ghost {
  background-color: transparent;
  border: none;
  padding: 0.25rem;
}

/* ── User pill switch ─────────────────────────────────── */
.user-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.user-switch input { display: none; }
.user-switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  background-color: #d0d0d0;
  cursor: pointer;
  transition: background 0.25s;
}
.user-switch-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: white;
  top: 3px;
  left: 3px;
  transition: transform 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.user-switch input:checked + .user-switch-slider {
  background-image: linear-gradient(90deg, var(--brand-gradient-start) 4%, var(--brand-gradient-mid) 41%, var(--brand-gradient-end) 100%);
}
.user-switch input:checked + .user-switch-slider::before {
  transform: translateX(22px);
}
.user-switch input:disabled + .user-switch-slider {
  opacity: 0.45;
  cursor: not-allowed;
}
.switch-cell {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}
.switch-cell .switch-label {
  font-size: 0.78rem;
  color: #888;
  min-width: 52px;
}
.switch-cell .switch-label.is-active {
  color: var(--brand-primary);
  font-weight: 600;
}

/* ─── Products filter box ────────────────────────────────────────────────── */

.products-adv-filters {
  border-top: 1px solid #ededed;
  padding-top: 1rem;
  animation: advFiltersSlideDown 0.18s ease-out;
}

@keyframes advFiltersSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Filters toggle button gets a subtle active state */
#advFiltersToggle.is-active {
  border-color: var(--bulma-primary, #00d1b2);
  color: var(--bulma-primary, #00d1b2);
}

/* Special filter pills */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.1rem;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border: 1.5px solid #dbdbdb;
  border-radius: 2rem;
  background: #fff;
  color: #555;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  user-select: none;
  white-space: nowrap;
}

.filter-pill:hover {
  border-color: #aaa;
  color: #222;
}

.filter-pill.is-active {
  background: #fff8e1;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 600;
}

.filter-pill .icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.filter-pill .icon i {
  font-size: 14px;
  line-height: 1;
}

/* ─── Bulk selection ─────────────────────────────────────────────────────── */

.bulk-toolbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background-color: #ffffff;
  border: 1px solid #dbdbdb;
  border-left: 3px solid var(--bulma-primary, #00d1b2);
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  animation: bulkToolbarSlideDown 0.2s ease-out;
}

@keyframes bulkToolbarSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bulk-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.bulk-toolbar-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.bulk-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.bulk-checkbox-col {
  width: 36px !important;
  min-width: 36px;
  text-align: center !important;
}

tr.is-selected-bulk {
  background-color: var(--bulma-primary-95, #e8faf8) !important;
}

.bulk-row-checkbox,
.bulk-header-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--bulma-primary, #00d1b2);
}

/* ── Media grid card bulk selection ──────────────────────────── */
.media-card-wrapper {
  position: relative;
}

.media-card-selector {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  cursor: pointer;
}

.media-card-selector input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--bulma-primary, #00d1b2);
  margin: 0;
}

.card.is-selected-bulk-card {
  outline: 2px solid var(--bulma-primary, #00d1b2);
  box-shadow: 0 0 0 4px var(--bulma-primary-95, #e8faf8);
}

.button.is-ghost:hover {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

/* Regla específica - solo para botones dentro de dropdowns */
.dropdown .dropdown-trigger .button.is-ghost {
  text-decoration: none !important;
  transition: background-color 0.2s ease;
}

.dropdown .dropdown-trigger .button.is-ghost:hover {
  text-decoration: none !important;
  background-color: rgba(213, 0, 88, 0.08) !important;
}

.dropdown .dropdown-trigger .button.is-ghost:focus {
  text-decoration: none !important;
  box-shadow: none !important;
}

/* Estilos para dropdown de acciones en task details */
.dropdown-action-item {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  text-decoration: none !important;
}

.dropdown-action-item:hover {
  text-decoration: none !important;
}

.dropdown-action-item .icon {
  text-decoration: none !important;
  display: inline-flex !important;
}

.dropdown-action-item:hover .icon {
  text-decoration: none !important;
}

.dropdown-action-item .icon i {
  text-decoration: none !important;
}

.dropdown-action-item:hover .icon i {
  text-decoration: none !important;
}

/* Asegurar que solo el texto se subraye */
.dropdown-action-item:hover > span:not(.icon) {
  text-decoration: underline;
}

/* Asegurar que el dropdown se pueda abrir hacia arriba */
.dropdown.is-up .dropdown-menu {
  bottom: 100%;
  padding-bottom: 4px;
  padding-top: unset;
  top: auto;
}

/* Asegurar que la tabla permita overflow visible para los dropdowns */
.table-container {
  overflow: visible !important;
}

.table-container table {
  overflow: visible !important;
}

tbody tr {
  position: relative;
}

tbody tr td {
  overflow: visible !important;
}


/* Actions dropdown: position:fixed so it never causes page overflow/scrollbars */
.dropdown[id^="actions-dropdown-"].is-active .dropdown-menu {
  position: fixed !important;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.1s ease-in;
  width: max-content;
  max-width: 220px;
}

.dropdown[id^="actions-dropdown-"].is-active.is-positioned .dropdown-menu {
  opacity: 1;
}

/* Eliminar subrayado en botones ghost al hacer hover */
.button.is-ghost:hover {
  text-decoration: none !important;
}