/*
 * --------------------------------
 * VARIABLES Y ESTILOS BASE
 * --------------------------------
 */
:root {
  --color-primary: #07162d;
  --color-secondary: #9e1428;
  --color-black: #07080a;
  --color-green: #50AF70;
  --color-highlight: #ffc857;
  --color-background: #f5f5f5;
  --color-text-light: #f1f5f9;
  --color-text-dark: #1e293b;
  --color-secondary-rgb: 158, 20, 40;
  --color-success: #4caf50;
  --color-warning: #ff9800;
}

body {
  font-family: 'Barlow', sans-serif;
  background-color: var(--color-background);
  color: var(--color-text-dark);
  overflow-x: hidden;
}

/*
 * --------------------------------
 * ESTILOS DE SCROLLBAR
 * --------------------------------
 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #e2e8f0;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/*
 * --------------------------------
 * COMPONENTES GENERALES Y TRANSICIONES
 * --------------------------------
 */
.btn,
.service-card,
.client-card,
.kanban-card,
.promo-card {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.kanban-card,
.promo-card,
.sidebar-ad-image,
.tool-card-button {
  border-radius: 0.5rem;
}

.stat-card,
.client-card,
.service-card,
.tool-card,
.sidebar-ad-image {
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.stat-card:hover,
.client-card:hover,
.service-card:hover,
.tool-card:hover,
.promo-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.1);
}

.sidebar-ad-image {
  width: 100%;
  height: auto;
  cursor: pointer;
}

.sidebar-ad-image:hover {
  transform: scale(1.02);
}

/*
 * --------------------------------
 * BOTONES
 * --------------------------------
 */
.btn {
  color: white;
  transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-text-light);
}

.btn-primary:hover {
  background-color: #1a2b42;
  box-shadow: 0 10px 15px -3px rgba(7, 22, 45, 0.3), 0 4px 6px -2px rgba(7, 22, 45, 0.1);
}

.btn-secondary {
  background-color: var(--color-secondary);
  color: var(--color-text-light);
}

.btn-secondary:hover {
  background-color: #7c1020;
  box-shadow: 0 10px 15px -3px rgba(158, 20, 40, 0.3), 0 4px 6px -2px rgba(158, 20, 40, 0.1);
}

.tool-card-button {
  background-color: var(--color-highlight);
  color: var(--color-primary);
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.tool-card-button:hover {
  background-color: white;
  transform: scale(1.05);
}

.tool-card-button .arrow-icon {
  transition: transform 0.2s ease-in-out;
}

.tool-card-button:hover .arrow-icon {
  transform: translateX(4px);
}

/*
 * --------------------------------
 * NAVEGACI�0�7N
 * --------------------------------
 */
.nav-link.active-button {
  background-color: var(--color-secondary);
  color: white;
  font-weight: 700;
  position: relative;
}

.nav-link.active-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: -4px;
  transform: translateY(-50%);
  width: 8px;
  height: 80%;
  background-color: var(--color-highlight);
  border-radius: 4px;
  transition: all 0.3s ease;
}

/*
 * --------------------------------
 * ENCABEZADO DE PAGINA (HEADER)
 * --------------------------------
 */
#main-app-header {
  background-color: white;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  padding: 10px 15px;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  position: sticky;
  top: 0;
  z-index: 20;
}
.page-header-container {
  flex-grow: 1;
  text-align: center;
  padding: 0;
  margin: 0 auto;
  width: 100%;
}

#page-title {
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 0.9;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
  word-break: break-word;
}

#page-title i {
  width: 1.5rem;
  height: 1.5rem;
  margin-right: 0.25rem;
  flex-shrink: 0;
}

#page-title .main-title-part-1,
#page-title .main-title-part-2 {
  display: inline;
  line-height: 0.9;
  white-space: normal;
}

#page-subtitle {
  font-size: 0.8rem;
  font-weight: 700;
  color: #333;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.15rem;
  display: none;
  width: 100%;
}

/*
 * --------------------------------
 * TITULOS Y TEXTO
 * --------------------------------
 */
.main-title-part-1 {
  color: var(--color-primary);
}

.main-title-part-2 {
  color: var(--color-secondary);
}

.tab-container {
  display: flex;
  border-bottom: 2px solid #e2e8f0;
  margin-bottom: 1.5rem;
  background-color: var(--color-primary);
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-button {
  flex-shrink: 0;
  padding: 0.75rem 1.5rem;
  color: var(--color-text-light);
  font-weight: 600;
  text-transform: uppercase;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  background-color: var(--color-primary);
  position: relative;
  z-index: 1;
  border-top-left-radius: 0.5rem;
  border-top-right-radius: 0.5rem;
  transition: background-color 0.3s ease, color 0.3s ease, border-bottom-color 0.3s ease;
}

.tab-button:hover {
  background-color: #1a2b42;
  border-bottom-color: #94a3b8;
}

.active-tab {
  color: var(--color-highlight);
  font-weight: 800;
  border-bottom-color: var(--color-secondary);
  border-bottom-width: 4px;
  z-index: 2;
}

/*
 * --------------------------------
 * TARJETAS Y COMPONENTES ESPEC�0�1FICOS
 * --------------------------------
 */
.client-avatar {
  width: 64px;
  height: 64px;
  background-color: var(--color-primary);
  color: white;
  font-size: 1.875rem;
  font-weight: 600;
}

.service-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.service-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.service-card-header {
  background-color: var(--color-primary);
  color: var(--color-text-light);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.service-card-price {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--color-secondary);
  line-height: 1;
}

.service-card-body {
  padding: 1.5rem;
  flex-grow: 1;
}

.transaction-card {
  transition: background-color 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.transaction-card:hover {
  background-color: #f8fafc;
  transform: translateX(4px);
}

.transaction-income .icon-container {
  background-color: #dcfce7;
  color: #16a34a;
}

.transaction-expense .icon-container {
  background-color: #fee2e2;
  color: #dc2626;
}

.calendar-day-header.today {
  background-color: var(--color-secondary);
  color: white;
}

.appointment-card {
  border-left: 4px solid var(--color-primary);
}

.appointment-card.cancelled {
  border-left-color: #9ca3af;
  background-color: #f3f4f6;
}

.appointment-card.cancelled p {
  text-decoration: line-through;
  color: #6b7280;
}

.appointment-list-item {
  transition: background-color 0.2s ease;
}

.appointment-list-item:hover {
  background-color: #f8fafc;
}

.tool-card {
  background-image: linear-gradient(to top right, var(--color-primary), #1e3a5f);
  color: var(--color-text-light);
  position: relative;
  overflow: hidden;
}

.tool-card:before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0) 60%);
  transform: scale(0);
  transition: transform 0.5s ease;
  pointer-events: none;
}

.tool-card:hover:before {
  transform: scale(2);
}

.tool-card:hover {
  box-shadow: 0 20px 25px -5px rgba(7, 22, 45, 0.3), 0 8px 10px -6px rgba(7, 22, 45, 0.2);
}

.tool-card-icon {
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
}

.promo-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.promo-card:hover {
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  transform: translateY(-8px);
}

.promo-card-image {
  transition: transform 0.4s ease;
}

.promo-card:hover .promo-card-image {
  transform: scale(1.05);
}

.contact-selection-group {
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.contact-selection-group.active-selection {
  border-color: var(--color-highlight);
  background-color: #fefce8;
}

.initial-hidden {
  display: none;
}

.footer-dark-theme .footer-copyright,
.footer-dark-theme .footer-disclaimer {
  font-size: 12px;
  line-height: 1.1;
  margin: 0.1rem 0;
}

.footer-dark-theme .footer-disclaimer {
  margin-top: 0.5rem;
}

/*
 * --------------------------------
 * TABLA KANBAN Y CELDAS
 * --------------------------------
 */
.kanban-board {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

.kanban-column {
  background-color: #f8fafc;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: 300px;
}

.kanban-column-header {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kanban-column-title {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.875rem;
}

.kanban-column-body {
  padding: 0.5rem;
  flex-grow: 1;
  overflow-y: auto;
}

.kanban-card {
  background-color: white;
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  border-left: 4px solid transparent;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.kanban-card:hover {
  transform: translateY(-3px);
}

.kanban-card-source-web {
  border-left-color: #3b82f6;
}

.kanban-card-source-referencia {
  border-left-color: #8b5cf6;
}

.kanban-card-source-llamada {
  border-left-color: #10b981;
}

.kanban-card-source-redes {
  border-left-color: #ec4899;
}

/*
 * --------------------------------
 * NOTIFICACIONES (TOAST)
 * --------------------------------
 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background-color: #333;
  color: #fff;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 1;
  transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
  transform: translateX(0);
  min-width: 280px;
}

.toast.hide {
  opacity: 0;
  transform: translateX(100%);
}

.toast-icon {
  font-size: 20px;
}

.toast-message {
  flex-grow: 1;
  text-transform: uppercase;
  font-weight: 900;
}

.toast-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  margin-left: 10px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

.toast-success {
  background-color: #4caf50;
}

.toast-error {
  background-color: #f44336;
}

.toast-info {
  background-color: #2196f3;
}

.toast-warning {
  background-color: #ff9800;
}

/*
 * --------------------------------
 * ESTILOS RESPONSIVOS Y MEDIA QUERIES
 * --------------------------------
 */
@media (min-width: 768px) {
  .kanban-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .text-xl {
    font-size: 1.2rem !important;
    line-height: 1.0rem !important;
  }

  #mobile-menu-button {
    display: none;
  }

  #main-app-header {
    justify-content: space-between;
    padding: 1rem;
  }

  #mobile-menu-button {
    margin-right: initial;
  }

  .page-header-container {
    text-align: left;
    flex-grow: 0;
    margin: 0;
    width: auto;
  }

  #page-title {
    font-size: 1.875rem;
    justify-content: flex-start;
    gap: 0.75rem;
    width: auto;
  }

  #page-title i {
    width: 1.75rem;
    height: 1.75rem;
    margin-right: initial;
  }

  #page-subtitle {
    display: block;
    font-size: 1rem;
    margin-top: 0.25rem;
    width: auto;
  }
}

@media (min-width: 1024px) {
  .kanban-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .kanban-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .nav-link {
    font-size: 24px !important;
    line-height: 1.0 !important;
    letter-spacing: 0.01em !important;
  }

  .responsive-invoices-table {
    border-collapse: separate;
  }

  .responsive-invoices-table thead {
    display: none;
  }

  .responsive-invoices-table,
  .responsive-invoices-table tbody,
  .responsive-invoices-table tr {
    display: block;
    width: 100%;
  }

  .responsive-invoices-table tr {
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.5rem;
    background-color: white;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  }

  .responsive-invoices-table td {
    display: block;
    text-align: right !important;
    padding-left: 50% !important;
    position: relative;
    border-bottom: 1px solid #edf2f7;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .responsive-invoices-table td:last-child {
    border-bottom: 0;
  }

  .responsive-invoices-table td::before {
    content: attr(data-label);
    position: absolute;
    left: 0.75rem;
    width: calc(50% - 1.5rem);
    padding-right: 1rem;
    white-space: nowrap;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    color: #4a5568;
  }

  .responsive-invoices-table td.actions-cell {
    text-align: center !important;
    padding-left: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    min-height: 48px;
  }

  .responsive-invoices-table td.actions-cell::before {
    content: none;
  }

  #calendar-grid.weekly-mobile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #calendar-grid.weekly-mobile-grid .appointment-list-day {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 90px;
  }

  #calendar-grid.weekly-mobile-grid .appointment-list-day .appointment-card {
    flex-shrink: 0;
    min-width: 0;
  }
}

/*
 * --------------------------------
 * ANIMACIONES
 * --------------------------------
 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- ESTILOS PARA EL REPRODUCTOR DE VIDEO PERSONALIZADO --- */
.video-shell {
    background: rgba(0, 0, 0, .35);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .12);
    overflow: hidden;
}

.video-shell .relative {
    padding-bottom: 56.25%; /* Esto mantiene la relaci��n de aspecto 16:9 */
}

.video-shell .absolute {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-shell #playOverlay {
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.video-shell #playOverlay:hover .bg-black\/40 {
    background-color: rgba(0, 0, 0, 0.6);
}

.video-shell #playOverlay:hover .opacity-80 {
    opacity: 1;
}

.video-shell .bg-black\/40 {
    background-color: rgba(0, 0, 0, 0.4);
    transition: background-color 0.3s ease-in-out;
}

.video-shell .text-white\/90 {
    color: rgba(255, 255, 255, 0.9);
}

.video-shell .flex.items-center.justify-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Header & cards tweaks */
 @media (max-width: 768px){ .page-header-container{display:none!important} .dashboard-section:first-of-type,#inicio:first-of-type{margin-top:calc(var(--header-height) + 12px)!important} }
 
 /* * ESTILOS GENÉRICOS PARA WIDGETS DE VIDEO*/
.video-widget{position:relative;overflow:hidden;border-radius:18px;background:linear-gradient(135deg,var(--color-primary,#07162d) 0%,#0b2242 55%,#07162d 100%);color:#fff}
.video-widget .blob{position:absolute;filter:blur(64px);opacity:.35;border-radius:9999px}
.video-widget .blob.bl1{height:280px;width:280px;left:-80px;top:-80px;background:var(--color-secondary,#9e1428)}
.video-widget .blob.bl2{height:280px;width:280px;right:-80px;bottom:-80px;background:#ffc857}
.chip{display:inline-flex;align-items:center;gap:.5rem;padding:.35rem .65rem;border-radius:999px;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.15);font-size:.75rem;letter-spacing:.3px}
.hero-cta{display:inline-flex;align-items:center;gap:.5rem;padding:.6rem 1rem;border-radius:12px;background:#fff;color:#0b1220;font-weight:800}
.hero-cta.secondary{background:rgba(255,255,255,.08);color:#fff;border:1px solid rgba(255,255,255,.15);font-weight:700}
.video-shell{background:rgba(0,0,0,.35);border-radius:16px;border:1px solid rgba(255,255,255,.12);overflow:hidden}


/* --- CÓDIGO PARA CORREGIR WIDGET EN MÓVIL --- */
@media (max-width: 767px) {
  .video-widget {
    margin-left: -1rem; 
    margin-right: -1rem;
    border-radius: 0 !important;
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* BOTÓN DE VIDEO EN MÓVIL */
@media (max-width: 768px) {
  header.sticky {
    flex-wrap: wrap;
  }

  .show-widget-container {
    width: 100%; 
    order: 3; 
    text-align: center;
    padding-top: 45px !important;
    padding-bottom: 4px;
  }
}