/* ==========================================================================
   CENTRIC ANALYTICS - DASHBOARD DESIGN SYSTEM
   Modern, Dark Glassmorphism, Premium Aesthetics
   ========================================================================== */

:root {
  /* Color Palette - Base Dark */
  --bg-primary: #0a0d14;
  --bg-secondary: #0f1422;
  --bg-card: rgba(18, 24, 38, 0.75);
  --bg-card-hover: rgba(24, 32, 50, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);

  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(99, 102, 241, 0.35);
  --border-focus: #6366f1;

  /* Typography Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #0f172a;

  /* Accents & Signals */
  --accent-indigo: #6366f1;
  --accent-indigo-light: #818cf8;
  --accent-cyan: #06b6d4;
  --accent-cyan-light: #22d3ee;
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-amber: #f59e0b;
  --accent-amber-light: #fbbf24;
  --accent-violet: #8b5cf6;
  --accent-violet-light: #a78bfa;
  --accent-rose: #f43f5e;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-glow-indigo: 0 0 20px rgba(99, 102, 241, 0.25);
  --shadow-glow-cyan: 0 0 20px rgba(6, 182, 212, 0.25);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --trans-fast: 0.15s ease;
  --trans-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  background-image:
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(6, 182, 212, 0.06) 0%, transparent 45%);
  background-attachment: fixed;
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ==========================================================================
   TOP NAVIGATION & HEADER
   ========================================================================== */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  gap: 1.5rem;
  flex-wrap: wrap;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.brand-accent {
  background: linear-gradient(90deg, var(--accent-indigo-light), var(--accent-cyan-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Date Filter Panel */
.date-filter-panel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 20, 34, 0.9);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.quick-presets {
  display: flex;
  gap: 0.25rem;
}

.preset-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

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

.preset-btn.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.date-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.2rem 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.stepper-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.input-date-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.calendar-icon {
  position: absolute;
  left: 0.6rem;
  color: var(--accent-cyan);
  pointer-events: none;
}

.custom-date-picker {
  background: transparent;
  border: 1px solid transparent;
  color: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.35rem 0.6rem 0.35rem 2.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  outline: none;
  color-scheme: dark;
  transition: border-color var(--trans-fast);
}

.custom-date-picker:focus {
  border-color: var(--accent-indigo);
}

.refresh-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.refresh-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.refresh-icon.spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

/* Status Indicator */
.system-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-emerald-light);
}

.system-status.disconnected {
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

.system-status.disconnected .status-dot {
  background-color: var(--accent-rose);
  box-shadow: 0 0 10px var(--accent-rose);
  animation: none;
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.95);
    opacity: 0.7;
  }

  50% {
    transform: scale(1.15);
    opacity: 1;
  }

  100% {
    transform: scale(0.95);
    opacity: 0.7;
  }
}

/* ==========================================================================
   ALERTS & FEEDBACK
   ========================================================================== */

.alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1rem 2rem 0;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-error {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fecdd3;
}

.alert-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   MAIN DASHBOARD CONTENT
   ========================================================================== */

.dashboard-content {
  position: relative;
  flex: 1;
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 13, 20, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-radius: var(--radius-xl);
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--accent-indigo);
  border-right-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.loader-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Empty State Card */
.empty-state-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  gap: 1.5rem;
}

.empty-state-card .empty-state-icon {
  color: var(--accent-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.1);
}

.empty-state-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.empty-state-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   KPI GRID & CARDS
   ========================================================================== */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform var(--trans-normal), border-color var(--trans-normal), box-shadow var(--trans-normal);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background var(--trans-normal);
}

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

.kpi-card:hover::before {
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
}

.kpi-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.kpi-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-icon-pill {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-indigo {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-indigo-light);
}

.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan-light);
}

.icon-violet {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet-light);
}

.icon-amber {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber-light);
}

.icon-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-light);
}

.kpi-card-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.kpi-value {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1.1;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.kpi-value.highlight {
  background: linear-gradient(135deg, #ffffff, #cbd5e1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  white-space: nowrap;
}

.kpi-badge.neutral {
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.kpi-card-footer {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.5rem;
}

/* ==========================================================================
   CHARTS GRID & PANELS
   ========================================================================== */

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-panel,
.table-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.panel-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.chart-wrapper {
  position: relative;
  flex: 1;
  min-height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-wrapper.donut-wrapper {
  min-height: 310px;
  max-height: 330px;
}

.chart-empty-msg {
  position: absolute;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
}

/* ==========================================================================
   TABLES GRID & STYLES
   ========================================================================== */

.tables-grid {
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .tables-grid {
    grid-template-columns: 1fr;
  }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
  padding: 0.85rem 1rem;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color var(--trans-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

/* Ranking Medals */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.rank-badge.rank-1 {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #1e1b4b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.rank-badge.rank-2 {
  background: linear-gradient(135deg, #e2e8f0, #94a3b8);
  color: #0f172a;
  box-shadow: 0 0 10px rgba(148, 163, 184, 0.3);
}

.rank-badge.rank-3 {
  background: linear-gradient(135deg, #fdba74, #ea580c);
  color: #1e1b4b;
  box-shadow: 0 0 10px rgba(234, 88, 12, 0.3);
}

/* User Avatar & Name */
.user-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-violet));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
}

.user-name {
  font-weight: 600;
  color: #ffffff;
}

/* Channel Pill */
.channel-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.channel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Visual Progress Bar */
.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.progress-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.progress-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  min-width: 44px;
  text-align: right;
}

/* Empty row in table */
.empty-table-row {
  text-align: center;
  padding: 2rem 1rem !important;
  color: var(--text-dim);
}

/* ==========================================================================
   DRILL-DOWN CHANNEL FILTER BAR & INTERACTIVITY
   ========================================================================== */

.filter-status-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(99, 102, 241, 0.12), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-md);
  padding: 0.65rem 1.25rem;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
  animation: slide-down 0.25s ease-out;
}

@keyframes slide-down {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-status-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.filter-status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.25);
  color: var(--accent-indigo-light);
}

.filter-status-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(99, 102, 241, 0.45);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--accent-cyan-light);
  box-shadow: 0 0 8px var(--accent-cyan);
}

.btn-clear-badge {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #ffffff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  line-height: 1;
  transition: all var(--trans-fast);
  margin-left: 0.2rem;
}

.btn-clear-badge:hover {
  background: var(--accent-rose);
  transform: scale(1.1);
}

.btn-text-clear {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-text-clear:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.05);
}

/* Interactivity on Canales table rows */
.clickable-row {
  cursor: pointer;
  transition: background-color var(--trans-fast), transform var(--trans-fast);
}

.clickable-row:hover {
  background-color: rgba(99, 102, 241, 0.1) !important;
}

.clickable-row.selected-channel-row {
  background: rgba(99, 102, 241, 0.18) !important;
  outline: 1px solid rgba(99, 102, 241, 0.5);
}

.clickable-row.selected-channel-row td:first-child {
  position: relative;
}

.clickable-row.selected-channel-row td:first-child::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 4px;
  background: var(--accent-cyan);
  border-radius: var(--radius-full);
}

.selected-badge-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: var(--accent-indigo);
  color: #ffffff;
  margin-left: 0.5rem;
}

#chartCanales {
  cursor: pointer;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: rgba(10, 13, 20, 0.95);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-sep {
  margin: 0 0.5rem;
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */

@media (max-width: 768px) {
  .top-nav {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  .brand-container {
    justify-content: center;
  }

  .date-filter-panel {
    flex-wrap: wrap;
    justify-content: center;
  }

  .system-status {
    align-self: center;
  }

  .dashboard-content {
    padding: 1rem;
    gap: 1.25rem;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .app-footer {
    flex-direction: column;
    text-align: center;
  }
}

/* ==========================================================================
   TIMELINE MODAL / DRAWER STYLES
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity var(--trans-normal);
}

#timelineModalBackdrop {
  z-index: 1100;
}

.modal-backdrop.hidden {
  display: none !important;
  opacity: 0;
}

.timeline-modal {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35), 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: modal-pop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  color: #0f172a;
}

@keyframes modal-pop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
}

.timeline-user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.timeline-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-indigo), var(--accent-cyan));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.timeline-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.timeline-operator-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.timeline-badge-tag {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #4338ca;
}

.timeline-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.modal-close-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.modal-close-btn:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

/* Timeline Stats Bar */
.timeline-stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding: 0.85rem 1.75rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: #0f172a;
}

/* Timeline Search Bar */
.timeline-search-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.75rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  color: #64748b;
}

.timeline-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: #0f172a;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
}

.timeline-search-bar input::placeholder {
  color: #94a3b8;
}

.search-counter {
  font-size: 0.78rem;
  font-weight: 600;
  color: #4338ca;
  white-space: nowrap;
}

/* Timeline Body & Track */
.timeline-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 2rem;
  position: relative;
  max-height: 56vh;
  background: #f1f5f9;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 #f1f5f9;
}

.timeline-body::-webkit-scrollbar {
  width: 6px;
}

.timeline-body::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.timeline-body::-webkit-scrollbar-track {
  background: #f1f5f9;
}

.timeline-loading,
.timeline-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1rem;
  color: #64748b;
  text-align: center;
}

.timeline-track {
  position: relative;
  padding-left: 2.25rem;
}

.timeline-track::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 9px;
  width: 2px;
  background: #cbd5e1;
}

.timeline-node {
  position: relative;
  margin-bottom: 1.75rem;
}

.timeline-node:last-child {
  margin-bottom: 0.5rem;
}

.timeline-marker {
  position: absolute;
  left: -2.25rem;
  top: 14px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-marker::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-indigo);
}

.timeline-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: transform var(--trans-fast), border-color var(--trans-fast), box-shadow var(--trans-fast);
}

.timeline-card:hover {
  transform: translateX(3px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.timeline-time-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-time {
  font-size: 0.88rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.02em;
}

.timeline-channel-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-sm);
}

.timeline-context-meta {
  font-size: 0.78rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline-conv-id {
  font-weight: 600;
  color: #475569;
}

.timeline-client-name {
  color: #0f172a;
  font-weight: 700;
}

.timeline-subject {
  font-size: 0.8rem;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  display: inline-block;
}

.group-count-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 700;
  background: #e0e7ff;
  color: #4338ca;
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

/* Timeline Footer */
.timeline-footer {
  padding: 1rem 1.75rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-footer-hint {
  font-size: 0.78rem;
  color: #64748b;
}

.timeline-footer-hint kbd {
  background: #f1f5f9;
  color: #334155;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
  border: 1px solid #cbd5e1;
}

.timeline-modal .btn-secondary {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

.timeline-modal .btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Operator row hover enhancement */
#tbodyOperadores tr {
  cursor: pointer;
}

#tbodyOperadores tr:hover {
  background-color: rgba(99, 102, 241, 0.08) !important;
}

@media (max-width: 600px) {
  .timeline-stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   INTERACTIVE CONVERSATION THREADS (WHATSAPP GLOBO & EMAIL CADENA) - LIGHT
   ========================================================================== */

/* --- FORMATO WHATSAPP (CHAT BUBBLES) --- */
.chat-conversation-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.65rem;
  padding: 0.25rem 0;
}

.operator-bubbles-stack {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  align-items: flex-end;
  width: 100%;
}

.whatsapp-bubble {
  max-width: 88%;
  border-radius: 10px;
  padding: 0.38rem 0.72rem 0.32rem 0.72rem;
  font-size: 0.855rem;
  line-height: 1;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  word-break: break-word;
}

.whatsapp-bubble.incoming {
  align-self: flex-start;
  background-color: #f1f5f9;
  color: #111b21;
  border-top-left-radius: 2px;
  border: 1px solid #e2e8f0;
}

.whatsapp-bubble.outgoing {
  align-self: flex-end;
  background-color: #d9fdd3;
  color: #111b21;
  border-top-right-radius: 2px;
  border: 1px solid #c7f1c1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.bubble-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  font-weight: 700;
}

.bubble-sender-client {
  color: #008069;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bubble-sender-operator {
  color: #008069;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.bubble-timestamp {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 500;
}

.bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
  color: #111b21;
}

.chat-reply-arrow {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  padding-left: 0.5rem;
  margin: -0.15rem 0;
}

/* --- FORMATO E-MAIL (CADENA / THREAD CORPORATIVO) --- */
.email-thread-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.65rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.email-quote-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #94a3b8;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1rem;
}

.email-quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.email-header-from strong {
  color: #0f172a;
}

.email-quote-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #1e293b;
  max-height: 250px;
  overflow-y: auto;
  word-break: break-word;
}

.email-quote-body a {
  color: #2563eb;
  text-decoration: underline;
}

.email-thread-divider {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: #4f46e5;
  margin: 0.2rem 0;
}

.email-thread-divider::before,
.email-thread-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e2e8f0;
}

.email-responses-stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.email-response-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.email-response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: #1d4ed8;
  border-bottom: 1px solid #dbeafe;
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.email-response-body {
  font-size: 0.88rem;
  line-height: 1.6;
  color: #0f172a;
  word-break: break-word;
}

.email-response-body a {
  color: #2563eb;
  text-decoration: underline;
}

/* Badge cuando no hay mensaje previo del cliente */
.no-prev-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.4rem;
  border: 1px dashed #cbd5e1;
}

/* ==========================================================================
   CONVERSATION LINKS & HIGH INTERACTION TABLE STYLES
   ========================================================================== */

.timeline-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-muted);
  transition: background var(--trans-fast), color var(--trans-fast), transform var(--trans-fast);
  white-space: nowrap;
}

.timeline-back-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  transform: translateX(-2px);
}

.timeline-chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(99, 102, 241, 0.4);
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-indigo-light);
  transition: background var(--trans-fast), border-color var(--trans-fast), transform var(--trans-fast);
  white-space: nowrap;
  vertical-align: middle;
}

.timeline-chat-btn:hover {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.7);
  transform: translateY(-1px);
}

.timeline-chat-btn:active {
  transform: translateY(0);
}

.timeline-conv-link {
  color: #4f46e5;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  transition: all var(--trans-fast);
}

.timeline-conv-link:hover {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  text-decoration: none;
}

.header-centric-link {
  font-size: 0.75rem;
  font-weight: 700;
  color: #4f46e5;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  vertical-align: middle;
  transition: all var(--trans-fast);
}

.header-centric-link:hover {
  background: #4338ca;
  color: #ffffff;
  border-color: #4338ca;
}

.section-conversaciones-extensas {
  margin-bottom: 2rem;
}

.panel-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.threshold-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber-light);
  border: 1px solid rgba(245, 158, 11, 0.35);
  white-space: nowrap;
}

.highlight-badge {
  background: rgba(99, 102, 241, 0.2) !important;
  color: var(--accent-indigo-light) !important;
  border: 1px solid rgba(99, 102, 241, 0.4) !important;
}

.table-conv-link {
  color: var(--accent-cyan-light);
  font-weight: 700;
  text-decoration: none;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all var(--trans-fast);
}

.table-conv-link:hover {
  background: var(--accent-cyan);
  color: #ffffff;
}

.btn-open-conv {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: var(--accent-indigo-light);
  padding: 0.25rem 0.55rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-open-conv:hover {
  background: var(--accent-indigo);
  color: #ffffff;
}

#tbodyConvsExtensas tr {
  cursor: pointer;
}

#tbodyConvsExtensas tr:hover {
  background-color: rgba(99, 102, 241, 0.08) !important;
}

.timeline-day-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0 1rem;
  position: relative;
}

.timeline-day-divider::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: #cbd5e1;
  z-index: 1;
}

.timeline-day-divider span {
  position: relative;
  z-index: 2;
  background: #e2e8f0;
  color: #475569;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.25rem 0.85rem;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.direction-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

.direction-badge.outgoing {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.direction-badge.incoming {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Chips de adjuntos descargables */
.msg-attachments-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #1e293b;
  text-decoration: none;
  transition: all var(--trans-fast);
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip:hover {
  background: #e2e8f0;
  color: #0f172a;
  border-color: #94a3b8;
}

.attachments-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  align-self: center;
  margin-right: 0.2rem;
}

.attachment-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-arrow {
  font-size: 0.7rem;
  opacity: 0.75;
}

.whatsapp-bubble.outgoing .msg-attachments-bar {
  border-top-color: rgba(18, 140, 126, 0.25);
}

.whatsapp-bubble.outgoing .attachments-label {
  color: #047857;
}

.whatsapp-bubble.outgoing .attachment-chip {
  background: #dcf8c6;
  border-color: #a7f3d0;
  color: #065f46;
}

.whatsapp-bubble.outgoing .attachment-chip:hover {
  background: #bbf7d0;
  color: #047857;
}

.email-quote-body img,
.email-response-body img,
.bubble-text img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 4px;
  display: inline-block;
  margin: 0.35rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   VISTA DE CONVERSACIÓN TIPO CHAT (Globitos ordenados sin aspecto de timeline)
   ========================================================================== */
.chat-conversation-stream {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  gap: 0.35rem;
  padding: 0.5rem 0.25rem 1.5rem 0.25rem;
  position: relative;
}

/* Divisor de fecha central sticky */
.chat-date-separator {
  display: flex;
  justify-content: center;
  margin: 1.25rem 0 0.85rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.chat-date-separator span {
  background: #e2e8f0;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.3rem 0.95rem;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  letter-spacing: 0.02em;
  border: 1px solid #cbd5e1;
}

/* Fila del mensaje */
.chat-msg-row {
  display: flex;
  width: 100%;
  animation: chatMsgFadeIn 0.15s ease-out;
}

@keyframes chatMsgFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-msg-row.incoming {
  justify-content: flex-start;
}

.chat-msg-row.outgoing {
  justify-content: flex-end;
}

.chat-msg-row.first-of-block {
  margin-top: 0.65rem;
}

.chat-msg-row.stacked-bubble {
  margin-top: 0.15rem;
}

/* Tarjeta / Globito de chat */
.chat-bubble-card {
  position: relative;
  max-width: 82%;
  min-width: 140px;
  padding: 0.42rem 0.78rem 0.32rem 0.78rem;
  font-size: 0.875rem;
  line-height: 1.45;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07);
  transition: box-shadow var(--trans-fast);
}

/* E-mail bubbles keep more generous padding */
.chat-bubble-card.email-bubble {
  padding: 0.65rem 0.95rem 0.5rem 0.95rem;
  font-size: 0.9rem;
  line-height: 1.52;
}

.chat-bubble-card:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Globito Cliente (Incoming / Izquierda) */
.chat-bubble-card.incoming {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-radius: 14px 14px 14px 3px;
}

.chat-msg-row.stacked-bubble .chat-bubble-card.incoming {
  border-top-left-radius: 6px;
}

/* Globito Operador (Outgoing / Derecha) */
.chat-bubble-card.outgoing {
  background: #d9fdd3;
  color: #0f172a;
  border: 1px solid #bbf7d0;
  border-radius: 14px 14px 3px 14px;
}

.chat-msg-row.stacked-bubble .chat-bubble-card.outgoing {
  border-top-right-radius: 6px;
}

/* Modo Correo Electrónico (ancho un poco más expandido para firmas y tablas) */
.chat-bubble-card.email-bubble {
  max-width: 92%;
}

/* Columna "Sin Actividad" solo visible al consultar el día de hoy */
#tablaOperadores thead th:nth-child(8),
#tablaOperadores tbody td:nth-child(8) {
  display: none;
}

#tablaOperadores.is-today thead th:nth-child(8),
#tablaOperadores.is-today tbody td:nth-child(8) {
  display: table-cell;
}

/* Inactividad - indicadores semáforo */
.inactivity-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.18rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}

.inactivity-badge.green {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.inactivity-badge.orange {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.inactivity-badge.red {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
  animation: inactivity-pulse 2s ease-in-out infinite;
}

@keyframes inactivity-pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.6;
  }
}

.inactivity-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.inactivity-dot.green {
  background: #10b981;
}

.inactivity-dot.orange {
  background: #f59e0b;
}

.inactivity-dot.red {
  background: #f43f5e;
}

/* Op channel tags */
.op-channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.op-channel-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-indigo-light);
  border: 1px solid rgba(99, 102, 241, 0.25);
  white-space: nowrap;
}

/* Cabecera del globito (autor) */
.chat-bubble-author {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.chat-author-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-bubble-card.incoming .chat-bubble-author {
  color: #0d9488;
  /* Verde azulado */
}

.chat-bubble-card.outgoing .chat-bubble-author {
  color: #15803d;
  /* Verde operador */
}

/* Roles pill */
.chat-role-pill {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chat-role-pill.client {
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #ccfbf1;
}

.chat-role-pill.operator {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* Contenido del mensaje */
.chat-bubble-content {
  color: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
}

.chat-bubble-content p {
  margin: 0.25rem 0;
}

.chat-bubble-content p:first-child {
  margin-top: 0;
}

.chat-bubble-content p:last-child {
  margin-bottom: 0;
}

.chat-bubble-content img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 6px;
  margin: 0.35rem 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-bubble-content blockquote {
  margin: 0.4rem 0;
  padding-left: 0.65rem;
  border-left: 3px solid #cbd5e1;
  color: #64748b;
}

/* Pie del globito (hora + tildes) */
.chat-bubble-meta-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-top: 0.35rem;
  font-size: 0.71rem;
  color: #64748b;
  font-weight: 600;
}

.chat-bubble-card.outgoing .chat-bubble-meta-footer {
  color: #15803d;
}

.chat-double-check {
  color: #2563eb;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: -2px;
  margin-left: 2px;
}







/* ==========================================================================
   MODAL: DETALLE TIEMPOS DE RESPUESTA
   ========================================================================== */

.tiempos-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: min(1000px, 95vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.tiempos-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.tiempos-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

.tiempos-modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.tiempos-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem 1.5rem 1.25rem;
}

/* Tabla sortable */
.sortable-table thead th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color var(--trans-fast);
}

.sortable-table thead th.sortable:hover {
  color: var(--accent-indigo-light);
}

.sortable-table thead th.sorted-asc .sort-icon,
.sortable-table thead th.sorted-desc .sort-icon {
  color: var(--accent-indigo-light);
}

.sort-icon {
  font-size: 0.75rem;
  opacity: 0.6;
  margin-left: 0.25rem;
}

/* Badge de tiempo de espera coloreado */
.espera-badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.espera-badge.fast {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.espera-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.espera-badge.slow {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ==========================================================================
   TOP NAV: ACCESO A FAVORITAS
   ========================================================================== */

.top-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.nav-fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--trans-fast);
  text-decoration: none;
}

.nav-fav-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fef08a;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.2);
}

.nav-fav-icon {
  color: #f59e0b;
}

.nav-fav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9999px;
  background: #f59e0b;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

/* ==========================================================================
   GRÁFICO OPERADORES: SWITCH DE MÉTRICA (MENSAJES VS CONVERSACIONES)
   ========================================================================== */

.panel-header-with-actions {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.panel-actions-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.segment-btn {
  background: transparent;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.32rem 0.75rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--trans-fast);
}

.segment-btn svg {
  opacity: 0.75;
}

.segment-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.segment-btn:hover svg {
  opacity: 1;
}

.segment-btn.active {
  background: var(--accent-indigo);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.segment-btn.active svg {
  opacity: 1;
}

/* ==========================================================================
   BOTÓN MARCAR FAVORITA EN MODAL TIMELINE
   ========================================================================== */

.btn-fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-fav-toggle:hover {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  transform: translateY(-1px);
}

.btn-fav-toggle.is-favorite {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.6);
  color: #fbbf24;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.3);
}

.btn-fav-toggle.is-favorite .fav-star-icon {
  fill: #f59e0b;
  stroke: #f59e0b;
  animation: starPulse 0.35s ease-out;
}

@keyframes starPulse {
  0% { transform: scale(0.8); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   MODAL: CONVERSACIONES FAVORITAS
   ========================================================================== */

.favorites-modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: min(920px, 95vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.favorites-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.favorites-modal-title-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.fav-header-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f59e0b;
}

.favorites-modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.favorites-modal-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.favorites-search-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
}

.favorites-search-bar svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.favorites-search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.88rem;
  font-family: inherit;
}

.favorites-search-bar input::placeholder {
  color: var(--text-dim);
}

.favorites-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.5rem 1.5rem;
}

.favorites-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
}

.empty-star-icon {
  font-size: 2.8rem;
  margin-bottom: 0.75rem;
  opacity: 0.7;
}

.favorites-empty-state h3 {
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.favorites-empty-state p {
  max-width: 450px;
  margin: 0 auto;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}

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

.favorites-footer-hint {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* Acciones en la tabla de favoritos */
.fav-actions-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-fav-open-chat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: var(--accent-indigo-light);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-fav-open-chat:hover {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

.btn-fav-open-ext {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.76rem;
  text-decoration: none;
  transition: all var(--trans-fast);
}

.btn-fav-open-ext:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.btn-fav-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-fav-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

/* Toast de feedback */
.dashboard-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  padding: 0.75rem 1.15rem;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(245, 158, 11, 0.15);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: toastSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

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

/* ==========================================================================
   LOGIN OVERLAY & AUTHENTICATION STYLES
   ========================================================================== */

/* User Session Badge in Top Nav */
.user-session-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.35rem 0.25rem 0.75rem;
  font-size: 0.82rem;
  transition: all var(--trans-fast);
}

.user-session-pill:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(30, 41, 59, 0.9);
}

.user-avatar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-weight: 500;
}

.user-avatar svg {
  color: var(--accent-indigo-light);
}

.user-name {
  color: var(--text-main);
  font-weight: 600;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-fast);
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fff;
  transform: translateY(-1px);
}

.btn-logout:active {
  transform: translateY(0);
}

/* Fullscreen Login Overlay */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.15), transparent 70%),
              radial-gradient(circle at 80% 80%, rgba(6, 182, 212, 0.1), transparent 60%),
              #070a10;
  backdrop-filter: blur(20px);
  padding: 1.5rem;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.login-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Login Card */
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 40px rgba(99, 102, 241, 0.12);
  backdrop-filter: blur(16px);
  overflow: hidden;
  animation: loginCardAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-card-header {
  padding: 2.2rem 2rem 1.4rem;
  text-align: center;
}

.login-logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(6, 182, 212, 0.25));
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: var(--accent-indigo-light);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
  margin-bottom: 1.1rem;
}

.login-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin: 0;
}

.login-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0.3rem 0 1rem;
}

.login-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 1.2rem auto;
  width: 80%;
}

.login-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.25rem;
}

.login-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
}

/* Login Form */
.login-form {
  padding: 0.5rem 2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.login-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-dim);
  pointer-events: none;
  transition: color var(--trans-fast);
}

.login-input {
  width: 100%;
  background: rgba(10, 15, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 2.8rem 0.75rem 2.75rem;
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  transition: all var(--trans-fast);
}

.login-input:focus {
  outline: none;
  border-color: var(--accent-indigo);
  background: rgba(10, 15, 28, 0.95);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.login-input:focus + .login-input-icon,
.login-input:focus ~ .login-input-icon {
  color: var(--accent-indigo-light);
}

.btn-toggle-password {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.35rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--trans-fast);
}

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

.login-alert {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 500;
  animation: shakeAlert 0.35s ease;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.login-form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.remember-label input[type="checkbox"] {
  accent-color: var(--accent-indigo);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn-login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
  transition: all var(--trans-fast);
  margin-top: 0.3rem;
  position: relative;
}

.btn-login-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

.btn-login-submit:active:not(:disabled) {
  transform: translateY(0);
}

.btn-login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.login-card-footer {
  padding: 0.9rem 1.5rem;
  background: rgba(10, 15, 28, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-dim);
}