/* ==========================================================================
   ACADEMIA SUPPORT & REAL-TIME ADMIN DASHBOARD
   Design System: Dark Glassmorphism, Micro-interactions, Fluid Responsive Layout
   ========================================================================== */

:root {
  --bg-dark: #0b0f19;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(28, 36, 56, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.15);
  
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.6;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================================================
   Header & View Navigation
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 25, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  padding: 1rem 2rem;
}

.header-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.brand span {
  background: linear-gradient(135deg, #fff 30%, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* View Switcher Tabs */
.view-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-glass);
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-btn i {
  font-size: 1rem;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}

/* Live Indicator Badge */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-emerald);
  border-radius: 50%;
  position: relative;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  background: var(--accent-emerald);
  opacity: 0.6;
  animation: pulse-ring 1.5s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.5); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Main Container */
.main-layout {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.view-section {
  display: none;
  animation: fadeIn 0.3s ease-out forwards;
}

.view-section.active {
  display: block;
}

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

/* ==========================================================================
   VIEW 1: CLIENT CHATBOT / STEP FORM
   ========================================================================== */

.chat-wrapper {
  max-width: 720px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: clamp(550px, 75vh, 700px);
}

.chat-header {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-glass);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bot-profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.bot-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.35rem;
}

.bot-info h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.bot-info p {
  font-size: 0.8rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.step-indicator-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Chat History Body */
.chat-body {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.message-row {
  display: flex;
  gap: 0.75rem;
  max-width: 85%;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.message-row.bot {
  align-self: flex-start;
}

.message-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.bot .msg-avatar {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.user .msg-avatar {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.msg-bubble {
  padding: 0.9rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.925rem;
  position: relative;
  word-wrap: break-word;
}

.bot .msg-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-top-left-radius: 4px;
}

.user .msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
}

.msg-time {
  font-size: 0.7rem;
  opacity: 0.65;
  margin-top: 0.4rem;
  display: block;
  text-align: right;
}

/* Interactive Option Chips inside Bot Messages */
.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.chip-btn {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid var(--border-glow);
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.chip-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Typing Indicator Animation */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.8rem 1.1rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  width: fit-content;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 100% { transform: translateY(0); opacity: 0.4; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* Chat Input Footer */
.chat-footer {
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid var(--border-glass);
}

.input-group {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  color: var(--text-main);
  font-size: 0.925rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  resize: none;
  max-height: 120px;
}

.chat-input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Confirmation Card Inside Chat */
.ticket-summary-card {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 0.5rem;
}

.summary-title {
  color: var(--accent-emerald);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.summary-label {
  color: var(--text-muted);
}

.summary-val {
  color: var(--text-main);
  font-weight: 600;
  text-align: right;
}

/* ==========================================================================
   VIEW 2: REAL-TIME ADMIN DASHBOARD
   ========================================================================== */

.admin-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.dashboard-title h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.dashboard-title p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* KPI Stats Bar */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}

.kpi-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-3px);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.kpi-icon.primary { background: rgba(99, 102, 241, 0.15); color: var(--primary); }
.kpi-icon.amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.kpi-icon.cyan { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }
.kpi-icon.emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

.kpi-data span {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-data h3 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

/* Filter Controls Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.filter-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.search-box {
  position: relative;
  min-width: 260px;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem 0.5rem 2.6rem;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary);
}

.btn-demo {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: var(--accent-cyan);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.825rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-demo:hover {
  background: var(--accent-cyan);
  color: #000;
}

/* Ticket Cards Grid ("Los Cuadritos") */
.tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.ticket-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  backdrop-filter: blur(16px);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ticket-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(99, 102, 241, 0.15);
}

.ticket-card.new-arrival {
  animation: highlightPulse 2s ease-out 2;
  border-color: var(--accent-cyan);
}

@keyframes highlightPulse {
  0% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.6); }
  70% { box-shadow: 0 0 0 16px rgba(6, 182, 212, 0); }
  100% { box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.ticket-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.user-meta h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.user-phone {
  font-size: 0.825rem;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.ticket-badge {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-pendiente {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-proceso {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-resuelto {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ticket-doubt-preview {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.ticket-card-bottom {
  border-top: 1px solid var(--border-glass);
  padding-top: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.775rem;
  color: var(--text-dim);
}

.urgency-tag {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
}

.urgency-alta { color: var(--accent-rose); }
.urgency-media { color: var(--accent-amber); }
.urgency-baja { color: var(--accent-emerald); }

.card-action-hint {
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0;
  transform: translateX(-4px);
  transition: var(--transition);
}

.ticket-card:hover .card-action-hint {
  opacity: 1;
  transform: translateX(0);
}

/* Empty State */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  display: block;
}

/* ==========================================================================
   MODAL: DETALLES COMPLETOS DEL CLIENTE AL DAR CLIC EN UN CUADRITO
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 7, 13, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  background: #111726;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7), var(--shadow-glow);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-container {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-title h3 {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.detail-group {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.detail-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}

.detail-value {
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 600;
  word-break: break-word;
}

.detail-value.doubt-full {
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.7;
  color: #e2e8f0;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.25);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  margin-top: 0.4rem;
}

.modal-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn-whatsapp {
  background: #25d366;
  color: #000;
  border: none;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: var(--transition);
}

.btn-whatsapp:hover {
  background: #20bd5a;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.35);
  transform: translateY(-2px);
}

.status-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  outline: none;
  font-family: inherit;
  cursor: pointer;
}

.btn-delete {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-delete:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: #1e293b;
  border: 1px solid var(--primary);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

/* Chat Input Attachment & Image Preview */
.attach-btn {
  width: 44px;
  height: 48px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.attach-btn:hover {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  border-color: var(--accent-cyan);
}

.image-preview-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  width: fit-content;
  animation: fadeIn 0.2s ease-out;
}

.image-preview-badge img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.image-preview-badge span {
  font-size: 0.775rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.remove-img-btn {
  background: none;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

/* Chat & Ticket Attached Image Displays */
.chat-img-thumb {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-md);
  margin-top: 0.5rem;
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: var(--transition);
  object-fit: cover;
}

.chat-img-thumb:hover {
  transform: scale(1.02);
  border-color: var(--primary);
}

.ticket-img-preview {
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  width: fit-content;
}

/* Admin Password Modal Styles */
.auth-card {
  background: #111726;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), var(--shadow-glow);
}

.auth-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid var(--border-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 1.25rem auto;
}

.auth-card h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.auth-card p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}

.password-input-group {
  position: relative;
  margin-bottom: 1.25rem;
}

.password-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem 0.85rem 2.5rem;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

.password-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.password-input-group i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  border: none;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-logout {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-logout:hover {
  background: var(--accent-rose);
  color: #fff;
}

.badge-resuelto-bot {
  background: rgba(139, 92, 246, 0.18);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.4);
}

.kpi-icon.purple {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.bot-image-container {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bot-media-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  text-align: center;
}

.bot-media-card img {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  object-fit: contain;
}

.bot-media-card img:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

.bot-media-caption {
  font-size: 0.775rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-weight: 600;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  margin-top: 0.5rem;
  transition: var(--transition);
}

.link-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.35);
}

.resolved-bot-banner {
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  color: #c4b5fd;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.badge-skool-vip {
  background: rgba(245, 158, 11, 0.22);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.kpi-icon.gold {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.skool-vip-banner {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.25));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  color: #fef08a;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.skool-vip-banner i {
  font-size: 1.6rem;
  color: #fbbf24;
}

/* Chat Transcript History Box in Admin Modal */
.chat-transcript-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.transcript-row {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  max-width: 90%;
}

.transcript-row.bot {
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--primary);
  align-self: flex-start;
  color: #cbd5e1;
}

.transcript-row.user {
  background: rgba(6, 182, 212, 0.12);
  border-right: 3px solid var(--accent-cyan);
  align-self: flex-end;
  color: #f1f5f9;
}

.transcript-header {
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
}

.transcript-text {
  line-height: 1.5;
  white-space: pre-wrap;
}

/* Multi-Topic Breakdown Box in Admin Modal */
.topic-breakdown-box {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.topic-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.topic-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.topic-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
}

.topic-desc {
  font-size: 0.775rem;
  color: var(--text-muted);
}

.topic-badge-resolved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.topic-badge-pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .app-header { padding: 1rem; }
  .header-container { flex-direction: column; align-items: flex-start; }
  .view-tabs { width: 100%; justify-content: center; }
  .main-layout { padding: 0 1rem; }
  .chat-wrapper { height: 80vh; }
  .modal-footer { flex-direction: column; align-items: stretch; }
  .btn-whatsapp { justify-content: center; }
}




