/* ================================================================
   Asistente para Fiestas — Design System & Chatbot UI
   ================================================================ */

/* ---- Google Fonts already linked in HTML ---- */

/* ---- CSS Custom Properties ---- */
:root {
  --clr-bg:         #0D0D1A;
  --clr-surface:    #161626;
  --clr-surface-2:  #1E1E33;
  --clr-border:     rgba(255,255,255,0.07);
  --clr-primary:    #7B5CF5;
  --clr-primary-2:  #c4b5fd;
  --clr-accent:     #F75C7E;
  --clr-green:      #25D366;  /* WhatsApp */
  --clr-text:       #E8E8F0;
  --clr-muted:      #a1a1aa;
  --clr-bubble-bot: #1E1E33;
  --clr-bubble-usr: linear-gradient(135deg, #7B5CF5, #9D7BFA);
  --radius-lg:      18px;
  --radius-md:      12px;
  --radius-sm:      8px;
  --shadow-glow:    0 0 30px rgba(123,92,245,0.25);
  --header-h:       60px;
  --font-body:      'Inter', system-ui, sans-serif;
  --font-brand:     'Outfit', system-ui, sans-serif;
  --transition:     all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ---- Light Theme (Sage & Earth Pallete) ---- */
[data-theme="light"] {
  --clr-bg:         #838a7f;
  --clr-surface:    #9aa097;
  --clr-surface-2:  #707a6c;
  --clr-border:     rgba(255,255,255,0.15);
  --clr-primary:    #7d7565;
  --clr-primary-2:  #9c9483;
  --clr-text:       #F5F2EE;
  --clr-muted:      #D4CFC9;
  --clr-bubble-bot: #707a6c;
  --clr-bubble-usr: linear-gradient(135deg, #7d7565, #9c9483);
  --shadow-glow:    0 4px 20px rgba(0,0,0,0.15);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100dvh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ================================================================
   HEADER
   ================================================================ */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 900;
  background: rgba(13,13,26,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--clr-border);
}
/* Container & Layout */
.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  position: relative;
}

/* Header */
.app-header .brand {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.app-header .brand img {
  max-height: 32px; /* Aumentado de 26px */
  width: auto;
}

/* Hamburger */
.btn-hamburger {
  width: 34px; height: 34px;
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  gap: 4px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-hamburger span {
  display: block;
  width: 18px; height: 1.5px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: var(--transition);
}
.btn-hamburger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.btn-hamburger.open span:nth-child(2) { opacity: 0; }
.btn-hamburger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* Brand */
.brand {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-brand);
  font-weight: 700; font-size: 0.92rem;
  letter-spacing: -0.01em;
}
.brand-icon {
  width: 24px; height: 24px;
  background: var(--clr-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}

/* Login btn header */
.btn-login-header {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--clr-muted);
  font-size: 0.95rem;
  transition: var(--transition);
}
.btn-login-header:hover { color: var(--clr-primary-2); }

/* ================================================================
   SIDE MENU
   ================================================================ */
.side-menu {
  position: fixed;
  top: 0; left: 0;
  width: min(300px, 80vw);
  height: 100dvh;
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex; flex-direction: column;
}
.side-menu.open { transform: translateX(0); }

.side-menu-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.25rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
  font-family: var(--font-brand);
  font-weight: 700; font-size: 1.2rem;
}
.btn-close-menu {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  color: var(--clr-muted);
  transition: var(--transition);
}
.btn-close-menu:hover { background: var(--clr-surface-2); color: var(--clr-text); }

.side-menu-list {
  flex: 1; overflow-y: auto; padding: 1rem 0;
}
.side-menu-list li a {
  display: flex; align-items: center; gap: 12px;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  color: var(--clr-text);
  border-radius: 0;
  transition: var(--transition);
}
.side-menu-list li a i { width: 20px; text-align: center; color: var(--clr-primary-2); }
.side-menu-list li a:hover { background: var(--clr-surface-2); padding-left: 1.5rem; }

.side-menu-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--clr-border);
}
.btn-login-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 0.75rem 1rem;
  background: var(--clr-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.9rem;
  transition: var(--transition);
}
.btn-login-menu:hover { background: var(--clr-primary-2); }

/* Overlay */
.menu-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.menu-overlay.active { opacity: 1; pointer-events: all; }

/* ================================================================
   CHAT WRAPPER
   ================================================================ */
.chat-wrapper {
  max-width: 480px;
  margin: 0 auto;
  padding-top: calc(var(--header-h) + 1rem);
  padding-bottom: 2rem;
  min-height: 100dvh;
}
.chat-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
}

/* ================================================================
   CHAT BUBBLES
   ================================================================ */
.msg-row { display: flex; align-items: flex-end; gap: 8px; animation: slideUp 0.3s ease; }
.msg-row.bot  { justify-content: flex-start; }
.msg-row.user { justify-content: flex-end; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.bot-avatar {
  width: 32px; height: 32px;
  background: var(--clr-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; flex-shrink: 0;
}
.bubble {
  max-width: 78%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.92rem;
  line-height: 1.5;
  word-break: break-word;
}

@media (max-width: 480px) {
  .bubble {
    font-size: 1.05rem; /* Aumentar un par de puntos en celulares */
    padding: 0.85rem 1.1rem;
  }
}

.bubble-bot {
  background: var(--clr-bubble-bot);
  border: 1px solid var(--clr-border);
  border-bottom-left-radius: 4px;
  color: var(--clr-text);
}
.bubble-usr {
  background: var(--clr-primary);
  border-bottom-right-radius: 4px;
  color: #fff;
}

/* Options grid */
.options-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}
.btn-option {
  display: flex; align-items: center; gap: 7px;
  padding: 0.5rem 0.9rem;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--clr-text);
  transition: var(--transition);
  white-space: nowrap;
}
.btn-option:hover, .btn-option.selected {
  background: var(--clr-primary);
  border-color: var(--clr-primary);
  color: #fff;
  transform: scale(1.04);
}
.btn-option i { font-size: 0.8rem; }

/* Select departamento */
.chat-select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text);
  font-family: inherit; font-size: 0.9rem;
  margin-top: 0.5rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='%238888AA'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  cursor: pointer;
}
.chat-select:focus { outline: none; border-color: var(--clr-primary); }
.chat-select option { background: var(--clr-surface); }

/* CTA button */
.btn-buscar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-2));
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 700; font-size: 1rem;
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
  margin-top: 0.75rem;
}
.btn-buscar:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(123,92,245,0.45); }
.btn-buscar:active { transform: translateY(0); }

/* Typing indicator */
.typing-indicator { padding: 0 1rem; }
.typing-indicator .bubble-bot {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.65rem 1rem;
}
.typing-indicator .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--clr-muted);
  animation: bounce 1.2s infinite ease-in-out;
}
.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}
.hidden { display: none !important; }

/* Magnifying Glass Animation */
.searching-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  color: var(--clr-primary-2);
}
.lupa-wrapper {
  position: relative;
  font-size: 2.5rem;
  animation: searchMove 2s infinite ease-in-out;
}
@keyframes searchMove {
  0%, 100% { transform: translate(0, 0) rotate(0); }
  25%      { transform: translate(15px, -10px) rotate(15deg); }
  50%      { transform: translate(-10px, 15px) rotate(-10deg); }
  75%      { transform: translate(15px, 15px) rotate(5deg); }
}
.searching-text {
  font-family: var(--font-brand);
  font-weight: 600;
  letter-spacing: 0.5px;
}


/* ================================================================
   RESULTS PANEL
   ================================================================ */
.results-panel {
  position: fixed;
  top: var(--header-h);
  bottom: 0; left: 0; right: 0;
  background: var(--clr-bg);
  z-index: 800;
  overflow-y: auto;
  padding-top: 0;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.results-header {
  position: sticky;
  top: 0;
  background: var(--clr-bg);
  border-bottom: 1px solid var(--clr-border);
  padding: 0.35rem 1rem;
  display: flex; align-items: center; gap: 1rem;
  z-index: 10;
}
.btn-back-chat {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--clr-primary-2);
  font-weight: 600; padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-back-chat:hover { background: var(--clr-surface-2); }
.results-header h2 { font-size: 1rem; font-family: var(--font-brand); }

.results-grid {
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1rem;
  max-width: 520px;
  margin: 0 auto;
}

/* Provider Card */
.provider-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  animation: slideUp 0.35s ease;
}
.provider-card:hover { border-color: var(--clr-primary); box-shadow: var(--shadow-glow); }
.ad-card {
  width: 100%;
  aspect-ratio: 3 / 1;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  transition: var(--transition);
  margin-bottom: 0.5rem;
  animation: slideUp 0.35s ease;
  cursor: pointer;
}
.ad-card:hover { border-color: var(--clr-primary); box-shadow: var(--shadow-glow); }
.ad-card img {
  width: 100%; height: 100%; object-fit: cover;
}
.ad-tag {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-media {
  position: relative;
  background: var(--clr-surface-2);
  aspect-ratio: 16/9;
  overflow: hidden;
  min-height: 180px;
}
.card-media iframe {
  width: 100%; height: 100%; border: none;
}
.card-logo {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 1.5rem;
}
.card-logo-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--clr-primary);
}
.match-badge {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  background: var(--clr-primary);
  color: #fff;
  font-size: 0.8rem; font-weight: 700;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(123,92,245,0.5);
}
.match-badge.high   { background: #22c55e; }
.match-badge.medium { background: #f59e0b; }
.match-badge.low    { background: #ef4444; }

.card-body { padding: 1rem; }
.card-name { font-family: var(--font-brand); font-weight: 700; font-size: 1.05rem; margin-bottom: 0.35rem; }
.card-desc { font-size: 0.85rem; color: var(--clr-muted); margin-bottom: 0.75rem; line-height: 1.5; }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }
.tag {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 600;
  padding: 0.25rem 0.6rem;
  background: rgba(123,92,245,0.18);
  color: var(--clr-primary-2);
  border-radius: 999px;
  border: 1px solid rgba(123,92,245,0.35);
}
.tag i { font-size: 0.7rem; }

.card-actions { display: flex; gap: 8px; }
.btn-wa {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0.7rem;
  background: var(--clr-green);
  color: #fff; font-weight: 700; font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.btn-wa:hover { background: #1da851; transform: translateY(-1px); }
.btn-email {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--clr-surface-2);
  border: 1px solid rgba(250, 204, 21, 0.4);
  border-radius: var(--radius-md);
  color: #facc15; font-size: 1.1rem;
  transition: var(--transition);
}
.btn-email:hover { color: #fff; border-color: #facc15; background: #facc15; }

/* No results */
.no-results {
  text-align: center; padding: 3rem 1rem;
  color: var(--clr-muted);
}
.no-results i { font-size: 3rem; margin-bottom: 1rem; color: var(--clr-surface-2); }
.no-results h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--clr-text); }

/* ================================================================
   AUTH PAGES (login, reset, admin)
   ================================================================ */
.auth-page {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: radial-gradient(ellipse at top, rgba(123,92,245,0.15) 0%, var(--clr-bg) 60%);
}
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-glow);
}
.auth-logo {
  text-align: center; margin-bottom: 1.5rem;
}
.auth-logo .brand-icon {
  width: 56px; height: 56px; font-size: 1.5rem;
  margin: 0 auto 0.75rem;
}
.auth-logo h1 {
  font-family: var(--font-brand);
  font-weight: 800; font-size: 1.5rem;
}
.auth-logo p { color: var(--clr-muted); font-size: 0.85rem; margin-top: 0.25rem; }
.auth-tabs {
  display: flex;
  background: var(--clr-surface-2);
  border-radius: var(--radius-md);
  padding: 4px; gap: 4px;
  margin-bottom: 1.5rem;
}
.auth-tab {
  flex: 1; padding: 0.55rem;
  border-radius: calc(var(--radius-md) - 2px);
  font-size: 0.85rem; font-weight: 600; text-align: center;
  color: var(--clr-muted); transition: var(--transition);
}
.auth-tab.active { background: var(--clr-primary); color: #fff; }

/* Form */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.82rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--clr-muted); }
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  color: var(--clr-text); font-family: inherit; font-size: 0.9rem;
  transition: var(--transition);
}
.form-control:focus { outline: none; border-color: var(--clr-primary); box-shadow: 0 0 0 3px rgba(123,92,245,0.15); }
.form-control::placeholder { color: var(--clr-muted); }

.btn-submit {
  width: 100%; padding: 0.85rem;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-2));
  color: #fff; font-weight: 700; font-size: 0.95rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
  margin-top: 0.5rem;
}
.btn-submit:hover { transform: translateY(-2px); }
.btn-submit:disabled { opacity: 0.6; pointer-events: none; }

.form-link {
  display: block; text-align: center;
  font-size: 0.82rem; color: var(--clr-primary-2);
  margin-top: 0.75rem;
  transition: var(--transition);
}
.form-link:hover { text-decoration: underline; }

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem; margin-bottom: 1rem;
}
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }

/* Date picker icon styling */
input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(0.6) sepia(100%) saturate(2000%) hue-rotate(220deg);
  opacity: 0.9;
  transition: var(--transition);
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
  transform: scale(1.1);
  filter: invert(0.8) sepia(100%) saturate(2000%) hue-rotate(220deg);
}

/* ================================================================
   ADMIN PANEL
   ================================================================ */
.admin-layout {
  display: flex; min-height: 100dvh;
}
.admin-sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh;
  z-index: 950;
  overflow-y: auto;
}
.admin-sidebar-brand {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
  font-family: var(--font-brand); font-weight: 700; font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.sidebar-logo {
  max-width: 90%;
  height: auto;
  max-height: 80px;
  object-fit: contain;
}
.admin-nav { flex: 1; padding: 1rem 0; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 0.7rem 1.25rem;
  font-size: 0.9rem; color: var(--clr-muted);
  transition: var(--transition);
}
.admin-nav a i { width: 18px; text-align: center; }
.admin-nav a:hover, .admin-nav a.active {
  color: var(--clr-text);
  background: var(--clr-surface-2);
  border-left: 3px solid var(--clr-primary);
  padding-left: calc(1.25rem - 3px);
}
.admin-nav a.active i { color: var(--clr-primary-2); }

.admin-main { flex: 1; min-width: 0; padding: 1.5rem; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2rem; gap: 1rem;
}
.admin-topbar h1 { font-family: var(--font-brand); font-size: 1.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-primary {
  display: flex; align-items: center; gap: 7px;
  padding: 0.6rem 1.2rem;
  background: var(--clr-primary);
  color: #fff; font-weight: 600; font-size: 0.875rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.btn-primary:hover { background: var(--clr-primary-2); }
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem; font-weight: 600;
  transition: var(--transition);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-edit {
  background: rgba(123,92,245,0.15);
  color: var(--clr-primary-2);
  border: 1px solid rgba(123,92,245,0.3);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem; font-weight: 600;
  transition: var(--transition);
}
.btn-edit:hover { background: rgba(123,92,245,0.25); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th {
  text-align: left; padding: 0.75rem 1rem;
  background: var(--clr-surface-2);
  border-bottom: 1px solid var(--clr-border);
  font-weight: 600; color: var(--clr-muted);
  white-space: nowrap;
}
.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--clr-border);
  vertical-align: middle;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }
.data-table .logo-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: var(--radius-sm); }
.badge-active   { background: rgba(34,197,94,0.15); color: #86efac; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-inactive { background: rgba(239,68,68,0.15); color: #fca5a5; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }

/* Stats cards */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px,1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}
.stat-card .stat-icon { font-size: 1.5rem; color: var(--clr-primary-2); margin-bottom: 0.5rem; }
.stat-card .stat-val  { font-size: 1.75rem; font-weight: 700; font-family: var(--font-brand); }
.stat-card .stat-lbl  { font-size: 0.78rem; color: var(--clr-muted); margin-top: 0.15rem; }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 2000;
  align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.25s ease;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.modal-header h2 { font-family: var(--font-brand); font-size: 1.15rem; }

/* Checkbox-grid for services/departments */
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-label {
  display: flex; align-items: center; gap: 6px;
  padding: 0.4rem 0.8rem;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: 999px;
  font-size: 0.8rem;
  cursor: pointer; transition: var(--transition);
}
.check-label input { display: none; }
.check-label.checked { background: var(--clr-primary); border-color: var(--clr-primary); color: #fff; }

/* Responsive sidebar collapse on mobile */
@media (max-width: 860px) {
  .admin-sidebar { width: 70px; }
  .admin-sidebar-brand span, .admin-nav a span, .admin-nav a span + b, .admin-sidebar div b { display: none; }
  .admin-sidebar-brand { justify-content: center; padding: 1rem 0; }
  .admin-nav a { justify-content: center; padding: 1rem; }
  /* hide labels */
  .admin-nav a { font-size: 0; }
  .admin-nav a i { font-size: 1.2rem; margin: 0; }
  .admin-sidebar div { display: none !important; }
}

@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar {
    width: 100%; height: auto; position: relative;
    border-right: none; border-bottom: 1px solid var(--clr-border);
  }
  .admin-sidebar-brand { display: flex; justify-content: space-between; font-size: 0.9rem; }
  .admin-nav { display: flex; overflow-x: auto; padding: 0.5rem; }
  .admin-nav a { display: flex; flex-direction: column; gap: 4px; padding: 0.5rem 1rem; min-width: fit-content; font-size: 0.7rem; }
  .admin-nav a i { font-size: 1rem; }
  .admin-main { padding: 1rem; }
}

/* ================================================================
   SCROLLBAR
   ================================================================ */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-surface-2); border-radius: 5px; }

/* ================================================================
   FAB CHATBOT
   ================================================================ */
.fab-chatbot {
  position: fixed;
  bottom: calc(25px + env(safe-area-inset-bottom));
  right: calc(25px + env(safe-area-inset-right));
  width: 65px;
  height: 65px;
  background: var(--clr-surface);
  border: 2px solid var(--clr-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(123, 92, 245, 0.4);
  text-decoration: none;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, box-shadow 0.3s;
  z-index: 10000;
  animation: bounceIn 0.6s ease forwards 0.5s, pulse-aura 2s infinite;
  opacity: 1; /* Por defecto visible */
  transform: scale(1);
  padding: 0;
  overflow: visible;
}

.fab-chatbot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.fab-chatbot:hover {
  transform: scale(1.1);
  box-shadow: 0 15px 35px rgba(123, 92, 245, 0.6);
  border-color: var(--clr-primary-2);
}

.fab-chatbot:hover img {
  transform: rotate(5deg) scale(1.05);
}

@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0); }
  60% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes pulse-aura {
  0% { box-shadow: 0 0 0 0 rgba(123, 92, 245, 0.6); }
  70% { box-shadow: 0 0 0 15px rgba(123, 92, 245, 0); }
  100% { box-shadow: 0 0 0 0 rgba(123, 92, 245, 0); }
}

@media (max-width: 480px) {
  .fab-chatbot {
    bottom: calc(20px + env(safe-area-inset-bottom));
    right: calc(20px + env(safe-area-inset-right));
    width: 60px;
    height: 60px;
    animation: bounceIn 0.5s ease forwards, pulse-aura 2s infinite;
  }
}

/* ==========================================================================
   YOUTUBE OPTIMIZATION (FACADE)
   ========================================================================== */
.yt-video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
}

.yt-facade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
    z-index: 1;
}

/* Subtle overlay to make play button pop */
.yt-facade::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.2);
    transition: background 0.3s ease;
}

.yt-video-container:hover .yt-facade {
    transform: scale(1.05);
}
.yt-video-container:hover .yt-facade::after {
    background: rgba(0,0,0,0.1);
}

.yt-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(33, 33, 33, 0.9);
    z-index: 2;
    border-radius: 12%;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.yt-play-btn::before {
    content: "";
    border-style: solid;
    border-width: 11px 0 11px 19px;
    border-color: transparent transparent transparent #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
}

.yt-video-container:hover .yt-play-btn {
    background-color: #ff0000;
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
}

.yt-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    z-index: 3;
}

/* Capa Protectora para controlar Play/Pause */
.yt-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    cursor: pointer;
    background: transparent;
}

/* ==========================================================================
   PERFIL DEL PROVEEDOR (MEJORAS)
   ========================================================================== */
@media (min-width: 768px) {
    /* Permitir que el perfil ocupe más ancho en desktop */
    main.container.profile-main {
        max-width: 1200px;
    }
    .profile-card {
        padding: 3rem;
    }
}

.btn-profile-wa {
    background: var(--clr-green);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.btn-profile-wa:hover {
    background: #20ba5a;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 211, 102, 0.35);
    color: #fff;
}

.btn-profile-wa i {
    font-size: 1.3rem;
}
/* ==========================================================================
   DYNAMIC FOOTER WIDGET
   ========================================================================== */
.footer-widget-container {
    padding: 3rem 0;
    background: linear-gradient(to bottom, transparent, rgba(123, 92, 245, 0.05));
    border-top: 1px solid var(--clr-border);
    margin-top: 4rem;
}

.footer-widget-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-widget-item {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
    text-decoration: none;
}

.footer-widget-item i {
    font-size: 1.5rem;
    color: var(--clr-primary-2);
    width: 40px;
    text-align: center;
}

.footer-widget-item span {
    font-family: var(--font-brand);
    font-weight: 600;
    font-size: 1rem;
    color: var(--clr-text);
}

.footer-widget-item:hover {
    background: var(--clr-surface-2);
    border-color: var(--clr-primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-glow);
}

@media (min-width: 768px) {
    .footer-widget-grid {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }
    .footer-widget-item {
        flex: 1;
        min-width: 200px;
        max-width: 280px;
        flex-direction: column;
        text-align: center;
        padding: 2rem 1.5rem;
    }
    .footer-widget-item i {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
}
