/* style.css - Dayzir Pro */
:root {
  --bg-0: #0a0e1a;
  --bg-1: #0f1422;
  --bg-2: #151b2e;
  --card: rgba(15, 22, 42, 0.75);
  --border: rgba(148, 163, 184, 0.08);
  --border-hover: rgba(148, 163, 184, 0.15);
  --accent: #6366f1;
  --accent-hover: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.25);
  --accent-soft: rgba(99, 102, 241, 0.08);
  --text: #e2e8f0;
  --text-secondary: #cbd5e1;
  --muted: #64748b;
  --danger: #f43f5e;
  --success: #10b981;
  --warning: #f59e0b;
  --sidebar-w: 178px;
  --topbar-h: 48px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  color-scheme: dark;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-0);
  color: var(--text);
  overflow: hidden;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* Scrollbar global */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(100,116,139,0.5); }

/* Generic hidden */
.hidden { display: none !important; }

/* Background */
.bg-canvas {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 10% 30%, rgba(99,102,241,0.07) 0%, transparent 60%),
              radial-gradient(ellipse 50% 40% at 85% 75%, rgba(16,185,129,0.04) 0%, transparent 50%),
              var(--bg-0);
  z-index: -1;
}

.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  animation: drift 18s ease-in-out infinite alternate;
  z-index: -1;
  opacity: 0.6;
}
.orb-1 { width: 500px; height: 500px; background: rgba(99,102,241,0.06); top: -150px; left: -150px; }
.orb-2 { width: 350px; height: 350px; background: rgba(139,92,246,0.05); bottom: -100px; right: -100px; animation-delay: -8s; }
.orb-3 { width: 250px; height: 250px; background: rgba(16,185,129,0.04); top: 40%; left: 55%; animation-delay: -4s; }

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to   { transform: translate(25px, 15px) scale(1.05); }
}

/* ═══════════════════════════════════════════════
   APP SHELL — Sidebar + Content
═══════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  background: rgba(8, 12, 22, 0.96);
  backdrop-filter: blur(32px);
  border-right: 1px solid rgba(99,102,241,0.08);
  display: flex;
  flex-direction: column;
  padding: 16px 8px 12px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 2px 0 24px rgba(0,0,0,0.3);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 10px 18px;
  border-bottom: 1px solid rgba(99,102,241,0.1);
  margin-bottom: 6px;
}

.brand-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 10px rgba(99,102,241,0.5));
  transition: filter 0.2s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.brand-icon:hover {
  filter: drop-shadow(0 4px 16px rgba(99,102,241,0.75));
  transform: scale(1.1) rotate(-3deg);
}
.brand-icon img,
.brand-icon svg {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.brand-name {
  font-size: 1.05rem;
  font-weight: 900;
  font-family: 'Outfit', 'Inter', sans-serif;
  background: linear-gradient(135deg, #e2e8f0 20%, #818cf8 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.04em;
  text-shadow: none;
}

/* Nav groups */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.nav-group { margin-bottom: 6px; }

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.58rem;
  font-weight: 900;
  font-family: 'Outfit', 'Inter', sans-serif;
  color: rgba(99,102,241,0.6);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  padding: 6px 10px 5px;
  position: relative;
}
.nav-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(99,102,241,0.3), transparent);
  border-radius: 2px;
}

.nav-group-bottom {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(99,102,241,0.08);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: rgba(148,163,184,0.6);
  font-family: 'Outfit', 'Inter', sans-serif;
  font-size: 0.83rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
  text-align: left;
  position: relative;
  letter-spacing: -0.01em;
}

.nav-item:hover {
  background: rgba(99,102,241,0.06);
  color: var(--text-secondary);
  transform: translateX(2px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.08));
  color: #c4b5fd;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(99,102,241,0.18);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, #6366f1, #8b5cf6);
  box-shadow: 0 0 8px rgba(99,102,241,0.6);
}

.ni-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1);
}
.nav-item:hover .ni-icon { transform: scale(1.15); }
.nav-item.active .ni-icon { transform: scale(1.1); }

.ni-text { flex: 1; }

.nav-badge {
  background: rgba(148,163,184,0.1);
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 20px;
  text-align: center;
}
.nav-item.active .nav-badge {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 2px 6px rgba(99,102,241,0.35);
}

.nav-logout:hover { color: var(--danger); background: rgba(244,63,94,0.06); }

/* ── Content Area ────────────────────────────── */
.content-area {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,14,26,0.6);
  backdrop-filter: blur(16px);
  flex-shrink: 0;
}

.topbar-menu {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.topbar-title {
  font-size: 1.05rem;
  font-weight: 800;
  flex: 1;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #e2e8f0 0%, #818cf8 60%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.topbar-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.7);
  flex-shrink: 0;
  animation: titlePulse 2.5s ease-in-out infinite;
}
@keyframes titlePulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 8px rgba(99,102,241,0.7); }
  50% { transform: scale(1.35); opacity: 0.75; box-shadow: 0 0 14px rgba(99,102,241,0.5); }
}
[data-theme="light"] .topbar-title {
  background: linear-gradient(135deg, #1e293b 0%, #4f46e5 55%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .topbar-title::before {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  box-shadow: 0 0 8px rgba(79, 70, 229, 0.6);
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

/* ── Reloj en vivo ───────────────────────────── */
.topbar-clock {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  line-height: 1.1;
}
.clock-time {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: var(--text);
  letter-spacing: 0.05em;
  text-shadow: 0 0 12px rgba(99,102,241,0.45);
}
.clock-date {
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: capitalize;
  letter-spacing: 0.04em;
}

/* ── Main Content ────────────────────────────── */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px 20px;
}

/* Cuando el calendario mensual está activo: padding reducido */
.main-content:has(#monthView.active-view) {
  padding: 10px 16px;
  overflow: hidden;
}

/* Cuando la semana está activa: ocupa todo el alto sin scroll */
.main-content:has(#weekView.active-view) {
  padding: 10px 16px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.view {
  display: none;
  animation: viewEnter 0.3s cubic-bezier(0.16,1,0.3,1) forwards;
}
.view.active-view { display: block; }

/* Vista mes ocupa todo el alto disponible */
#monthView.active-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Vista semana ocupa todo el alto disponible */
#weekView.active-view {
  height: 100%;
  display: flex;
  flex-direction: column;
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(12px) scale(0.99); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ── Skeleton Loaders ─────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.09) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 10px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line {
  height: 13px;
  border-radius: 6px;
  margin-bottom: 8px;
}
.skeleton-line.short { width: 55%; }
.skeleton-line.medium{ width: 75%; }
.skeleton-line.long  { width: 90%; }
.skeleton-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.skeleton-circle {
  width: 26px; height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
}
.skeleton-body { flex: 1; }

/* ── Sidebar Tooltips (tablet icon-only mode) ──────── */
@media (max-width: 1024px) {
  .nav-item {
    position: relative;
  }
  .nav-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: rgba(15,22,42,0.96);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 5px 12px;
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s, transform 0.15s;
    transform: translateY(-50%) translateX(-4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 9999;
  }
  .nav-item:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Asegurar que en móvil nunca aparezca el tooltip duplicado */
@media (max-width: 768px) {
  .nav-item::after { display: none !important; }
}

/* ═══════════════════════════════════════════════
   LIGHT MODE THEME
═══════════════════════════════════════════════ */
[data-theme="light"] {
  --bg-0:   #f1f5f9;
  --bg-1:   #e8edf5;
  --bg-2:   #dde4f0;
  --card:   rgba(255,255,255,0.85);
  --border: rgba(100,116,139,0.15);
  --border-hover: rgba(100,116,139,0.3);
  --text:   #0f172a;
  --text-secondary: #334155;
  --muted:  #64748b;
  --accent-soft: rgba(99,102,241,0.1);
  color-scheme: light;
}
[data-theme="light"] html,
[data-theme="light"] body,
html[data-theme="light"],
body[data-theme="light"] {
  background: var(--bg-0);
  color: var(--text);
}
[data-theme="light"] .bg-canvas {
  background: radial-gradient(ellipse 80% 60% at 10% 30%, rgba(99,102,241,0.05) 0%, transparent 60%),
              radial-gradient(ellipse 50% 40% at 85% 75%, rgba(16,185,129,0.03) 0%, transparent 50%),
              var(--bg-0);
}
[data-theme="light"] .orb { opacity: 0.3; }
[data-theme="light"] .sidebar {
  background: rgba(255,255,255,0.9);
  border-color: rgba(100,116,139,0.15);
}
[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: rgba(99,102,241,0.08);
}
[data-theme="light"] .glass-item,
[data-theme="light"] .task-item {
  background: rgba(255,255,255,0.8);
  border-color: rgba(100,116,139,0.12);
}
[data-theme="light"] .task-item:hover {
  background: rgba(255,255,255,0.95);
  box-shadow: 0 6px 20px rgba(100,116,139,0.15);
}
[data-theme="light"] .topbar {
  background: rgba(241,245,249,0.9);
  border-color: rgba(100,116,139,0.12);
}
[data-theme="light"] .dash-stat-card,
[data-theme="light"] .dash-progress-card,
[data-theme="light"] .dash-quick {
  background: rgba(255,255,255,0.8);
  border-color: rgba(100,116,139,0.1);
}
[data-theme="light"] .modal-card {
  background: #fff;
  border-color: rgba(100,116,139,0.15);
}
[data-theme="light"] #chatPanel {
  background: rgba(248,250,252,0.97);
  border-color: rgba(100,116,139,0.2);
}
[data-theme="light"] .chat-msg-assistant .chat-bubble {
  background: rgba(241,245,249,0.9);
  border-color: rgba(100,116,139,0.15);
  color: var(--text);
}
[data-theme="light"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(0,0,0,0.04) 25%,
    rgba(0,0,0,0.08) 50%,
    rgba(0,0,0,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

/* Theme toggle button */
#themeToggleBtn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
  margin-left: auto;
  margin-right: auto;
}
#themeToggleBtn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}
[data-theme="light"] #themeToggleBtn {
  border-color: rgba(100,116,139,0.2);
  background: rgba(0,0,0,0.04);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
  :root { --sidebar-w: 52px; }
  .brand-name, .ni-text, .nav-group-label, .nav-badge { display: none; }
  .sidebar { padding: 12px 4px; align-items: center; }
  .sidebar-brand { padding: 0 0 14px; border-bottom: 1px solid rgba(99,102,241,0.1); margin-bottom: 4px; }
  .nav-item { justify-content: center; padding: 9px; border-radius: 10px; }
  .nav-item.active::before { left: -4px; }
  .ni-icon { width: auto; }
  .brand-icon { width: 28px; height: 28px; font-size: 0.9rem; }
  #themeToggleBtn { width: 32px; height: 32px; font-size: 0.9rem; }
}

@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -200px;
    top: 0;
    bottom: 0;
    width: 192px;
    transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 4px 0 28px rgba(0,0,0,0.6);
    padding: 16px 4px 12px 2px;
    z-index: 300;
  }
  .sidebar.open { left: 0; }
  .brand-name, .ni-text, .nav-group-label, .nav-badge { display: initial; }
  .sidebar-brand { padding: 2px 4px 12px 6px; }
  .nav-group-label { padding: 6px 4px 4px 6px; }
  .nav-item {
    justify-content: flex-start;
    padding: 8px 6px 8px 6px;
    min-height: 36px;
    font-size: 0.81rem;
    border-radius: 8px;
  }
  .nav-item.active::before { left: -2px; }
  .topbar-menu { display: flex; }
  .topbar { padding: 0 10px; z-index: 200; position: relative; gap: 8px; }
  .main-content { padding: 12px 12px 20px; }
  .brand-icon { width: 28px; height: 28px; font-size: 1rem; }
  .brand-name { font-size: 0.95rem; }

  /* Botón + Nueva Tarea compacto en móvil */
  #addTaskBtn {
    padding: 6px 12px;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 8px;
    letter-spacing: -0.01em;
  }
}

/* ── Sidebar Overlay (móvil) ─────────────────── */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 250;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ── Pull-to-Refresh ──────────────────────────── */
#pullRefreshIndicator {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 0;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(139,92,246,0.12));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99,102,241,0.2);
  transition: height 0.15s ease, opacity 0.15s ease;
  opacity: 0;
  pointer-events: none;
}
#pullRefreshIndicator.ptr-visible {
  opacity: 1;
}
#pullRefreshIndicator.ptr-ready .ptr-icon {
  color: #a5b4fc;
  transform: rotate(180deg);
}
#pullRefreshIndicator.ptr-loading .ptr-spinner {
  display: block;
}
#pullRefreshIndicator.ptr-loading .ptr-icon {
  display: none;
}
.ptr-icon {
  font-size: 1.2rem;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), color 0.2s;
  color: rgba(148,163,184,0.6);
  transform: rotate(0deg);
}
.ptr-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(99,102,241,0.25);
  border-top-color: #818cf8;
  border-radius: 50%;
  animation: ptrSpin 0.7s linear infinite;
}
@keyframes ptrSpin {
  to { transform: rotate(360deg); }
}
.ptr-text {
  font-size: 0.78rem;
  font-weight: 600;
  font-family: 'Outfit', 'Inter', sans-serif;
  color: rgba(148,163,184,0.75);
  letter-spacing: 0.01em;
}


/* ── Grid & Cards ────────────────────────────── */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}

.col-span-2 { grid-column: span 2; }
@media (max-width: 768px) { .col-span-2 { grid-column: span 1; } }

.glass-card {
  background: var(--card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  transition: border-color 0.2s;
}
.glass-card:hover { border-color: var(--border-hover); }

.card-header { margin-bottom: 14px; }

.subtitle {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}


/* Stats Box */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.stat-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-box.success { border-color: rgba(16,185,129,0.3); background: rgba(16,185,129,0.05); }
.stat-box.warning { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.05); }

.stat-label {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.stat-box strong {
  font-size: 1.5rem;
  color: var(--text);
}
.stat-box.success strong { color: var(--success); }
.stat-box.warning strong { color: var(--warning); }

/* Buttons */
.btn-primary, .btn-secondary {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  box-shadow: 0 2px 10px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
  filter: brightness(1.1);
}

.btn-secondary {
  background: rgba(255,255,255,0.04);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: rgba(255,255,255,0.08);
  border-color: var(--border-hover);
}

.btn-icon {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); color: var(--text); }

/* Forms & Inputs */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-row {
  display: flex;
  gap: 16px;
}
.w-1\/2 { width: 50%; }
.w-full { width: 100%; }

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
}

.input-field, .textarea-field {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Opciones del select: fondo oscuro para modo dark */
select.input-field option {
  background: #1a2035;
  color: #e2e8f0;
}

/* Modo claro */
[data-theme="light"] select.input-field option {
  background: #ffffff;
  color: #0f172a;
}

.input-field:focus, .textarea-field:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.12);
}

/* Calendario nativo en modo oscuro */
input[type="date"].input-field,
input[type="time"].input-field {
  color-scheme: dark;
}
[data-theme="light"] input[type="date"].input-field,
[data-theme="light"] input[type="time"].input-field {
  color-scheme: light;
}

.textarea-field {
  resize: vertical;
  min-height: 100px;
}
.full-height {
  height: 300px;
}

/* Custom Date Picker — calendario oscuro */
.custom-date-picker { position: relative; width: 100%; }

.cdp-trigger-btn {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.2s;
  text-align: left;
}
.cdp-trigger-btn:hover { border-color: rgba(255,255,255,0.22); }

.cdp-popup {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: #1a2035;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  padding: 16px;
  z-index: 1100;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  width: 268px;
  animation: dropIn 0.15s ease-out;
}
.cdp-popup.cdp-open { display: block; }

.cdp-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.cdp-month-label { font-weight: 700; font-size: 0.88rem; color: var(--text); }

.cdp-nav {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text);
  border-radius: 7px;
  width: 28px; height: 28px;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  transition: background 0.15s;
}
.cdp-nav:hover { background: rgba(255,255,255,0.13); }

.cdp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 4px;
}
.cdp-weekdays span {
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--muted);
  padding: 3px 0;
}
.cdp-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cdp-day {
  text-align: center;
  padding: 7px 2px;
  border-radius: 7px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background 0.12s, color 0.12s;
  user-select: none;
}
.cdp-day:hover:not(.cdp-empty) { background: rgba(99,102,241,0.2); color: var(--text); }
.cdp-day.cdp-today  { color: var(--accent); font-weight: 700; }
.cdp-day.cdp-sel    { background: var(--accent); color: #fff; font-weight: 700; }
.cdp-day.cdp-empty  { cursor: default; pointer-events: none; }

.cdp-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.cdp-footer button {
  background: none; border: none;
  color: var(--accent);
  font-family: inherit; font-size: 0.81rem; font-weight: 600;
  cursor: pointer; padding: 4px 8px; border-radius: 6px;
  transition: background 0.15s;
}
.cdp-footer button:hover { background: rgba(99,102,241,0.12); }

/* Tasks */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.glass-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s, background 0.2s;
}

.glass-item:hover {
  background: rgba(255,255,255,0.06);
  transform: translateX(4px);
}

/* ── Task Card — Premium Redesign ─────────────────────────── */
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid var(--task-color, rgba(255,255,255,0.15));
  border-radius: 10px;
  padding: 10px 12px;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1),
              background 0.2s, box-shadow 0.25s;
  position: relative;
}
.task-item:hover {
  background: rgba(255,255,255,0.06);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
}

/* Priority border colors */
.task-item.task-high  { --task-color: var(--danger);  }
.task-item.task-medium{ --task-color: var(--warning); }
.task-item.task-low   { --task-color: var(--success); }

/* ── Status-based border brightness ─────────────────────────
   active  → nítido + glow
   backlog → apagado
   done    → muy apagado (además de opacity global)
──────────────────────────────────────────────────────────── */
.task-item.status-active {
  border-left-color: var(--task-color, rgba(255,255,255,0.35));
  box-shadow: -3px 0 10px -2px color-mix(in srgb, var(--task-color, rgba(255,255,255,0.3)) 50%, transparent),
              0 4px 16px rgba(0,0,0,0.15);
}
.task-item.status-backlog,
.task-item.status-pending {
  border-left-color: color-mix(in srgb, var(--task-color, rgba(255,255,255,0.15)) 35%, transparent);
  box-shadow: none;
}
.task-item.status-done {
  border-left-color: color-mix(in srgb, var(--task-color, rgba(255,255,255,0.15)) 18%, transparent);
  box-shadow: none;
}

/* ── Animated Checkbox ───────────────────────────────────── */
.task-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  align-items: center;
}
.task-checkbox {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s, background 0.25s, transform 0.2s;
  padding: 0;
}
.task-checkbox.btn-done:hover {
  border-color: var(--success);
  background: rgba(16,185,129,0.12);
  transform: scale(1.1);
}
.task-checkbox.btn-fail {
  width: 20px; height: 20px;
  border-width: 1.5px;
  border-color: rgba(255,255,255,0.12);
}
.task-checkbox.btn-fail:hover {
  border-color: var(--danger);
  background: rgba(244,63,94,0.15);
  transform: scale(1.15);
}
.check-icon {
  width: 13px; height: 13px;
  pointer-events: none;
  overflow: visible;
}
.check-path {
  stroke-dasharray: 28;
  stroke-dashoffset: 28;
  transition: stroke-dashoffset 0.35s cubic-bezier(.65,0,.35,1);
}
.fail-icon {
  width: 10px; height: 10px;
  pointer-events: none;
  overflow: visible;
  opacity: 0.35;
  transition: opacity 0.2s;
}
.task-checkbox.btn-fail:hover .fail-icon {
  opacity: 1;
  color: var(--danger);
}
.fail-path-1, .fail-path-2 {
  stroke-dasharray: 22;
  stroke-dashoffset: 22;
  transition: stroke-dashoffset 0.3s cubic-bezier(.65,0,.35,1);
}

/* Done state */
.task-item.is-done .btn-done {
  background: var(--success);
  border-color: var(--success);
}
.task-item.is-done .check-path {
  stroke-dashoffset: 0;
}
.task-item.is-done {
  opacity: 0.55;
}
/* Dim fail button when done — but keep clickable */
.task-item.is-done .btn-fail {
  opacity: 0.3;
}

/* Failed / Backlog state */
.task-item.is-failed .btn-fail {
  background: var(--danger);
  border-color: var(--danger);
}
.task-item.is-failed .fail-icon {
  opacity: 1;
  color: white;
}
.task-item.is-failed .fail-path-1,
.task-item.is-failed .fail-path-2 {
  stroke-dashoffset: 0;
  stroke: white;
}
.task-item.is-failed {
  opacity: 0.55;
}
.task-item.is-failed .task-name {
  color: var(--muted);
}
/* Dim done button when failed — but keep clickable */
.task-item.is-failed .btn-done {
  opacity: 0.3;
}

/* ── Strikethrough animation ─────────────────────────────── */
.task-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.task-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
  display: block;
  transition: color 0.3s;
}
.task-name::after {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  height: 1.5px;
  background: var(--muted);
  max-width: 0;
  width: 100%;
  transition: max-width 0.4s ease;
}
.task-item.is-done .task-name {
  color: var(--muted);
}
.task-item.is-done .task-name::after {
  max-width: 100%;
}

.task-meta {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Task actions ────────────────────────────────────────── */
.task-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.task-item:hover .task-actions,
.task-item:focus-within .task-actions {
  opacity: 1;
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.action-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.btn-delete:hover { color: var(--danger); }

/* ── Priority label colors (non-task contexts, e.g. dots) ── */
.priority-high   { background: var(--danger);  box-shadow: 0 0 8px var(--danger);  }
.priority-medium { background: var(--warning); box-shadow: 0 0 8px var(--warning); }
.priority-low    { background: var(--success); box-shadow: 0 0 8px var(--success); }

/* ── Empty States ────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 18px;
  text-align: center;
  gap: 0;
}
.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: floatIcon 3.5s ease-in-out infinite;
  display: block;
}
.empty-state-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px;
}
.empty-state-sub {
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 260px;
  line-height: 1.6;
  margin: 0 0 22px;
}
.empty-state-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-2, #8b5cf6));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 10px 26px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.empty-state-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}
@keyframes floatIcon {
  0%, 100% { transform: translateY(0);    }
  50%       { transform: translateY(-10px); }
}


/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal.hidden {
  display: none;
}

/* El modal de limpiar chat debe estar por encima del panel del chat (z-index: 8999) */
#chatClearModal {
  z-index: 9500;
}

.modal-card {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-card h2 { margin-bottom: 20px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Schedule Grid — CSS Grid puro */
.schedule-container {
  overflow-x: auto;
  margin-top: 12px;
  padding-bottom: 4px;
}

.sched-header-cell {
  padding: 10px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--muted);
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky;
  top: 0;
  z-index: 2;
}

.sched-time-label {
  padding: 0 6px 0 0;
  text-align: right;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  border-right: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.01);
}

.sched-cell {
  border-bottom: 1px solid rgba(255,255,255,0.03);
  border-right: 1px solid rgba(255,255,255,0.03);
  background: rgba(0,0,0,0.1);
  pointer-events: none;
}
.sched-cell-hour {
  border-top: 1px solid rgba(255,255,255,0.08);
}

.sched-block {
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 0.68rem;
  overflow: visible;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  margin: 0 1px;
  z-index: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
  line-height: 1.2;
}
.sched-block:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  z-index: 3;
}

.sched-block strong {
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sched-block-time {
  font-size: 0.62rem;
  opacity: 0.8;
}

.sched-block-del {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  border-radius: 4px;
  width: 22px;
  height: 22px;
  font-size: 0.7rem;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  pointer-events: auto;
}
.sched-block:hover .sched-block-del { display: flex; }
.sched-block-del:hover { background: var(--danger); color: white; }

.bg-study { background: rgba(59, 130, 246, 0.25); border-left: 3px solid #3b82f6; color: #bfdbfe; }
.bg-work { background: rgba(245, 158, 11, 0.25); border-left: 3px solid #f59e0b; color: #fde68a; }
.bg-personal { background: rgba(16, 185, 129, 0.25); border-left: 3px solid #10b981; color: #a7f3d0; }
.bg-purple { background: rgba(139, 92, 246, 0.25); border-left: 3px solid #8b5cf6; color: #ddd6fe; }

/* ═══════════════════════════════════════════════
   WEEK VIEW — Responsive: Laptop → Tablet → Móvil
═══════════════════════════════════════════════ */
.week-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
}

.week-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 4px 0;
  flex-shrink: 0;
}

.week-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.week-nav-btn {
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

.week-today-btn {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.18s;
}
.week-today-btn:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-glow);
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 1fr;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.day-card {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
}

.day-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  border-radius: 10px 10px 0 0;
  flex-shrink: 0;
}

.day-card-header .day-name {
  font-weight: 800;
  font-size: 0.88rem;
  font-family: 'Outfit', 'Inter', sans-serif;
  background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}

.day-card-header .day-date {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.today-header {
  background: rgba(59, 130, 246, 0.12) !important;
  border-bottom-color: rgba(59, 130, 246, 0.3) !important;
}
.today-header .day-name { color: #93c5fd; }
.today-header .day-date { color: #bfdbfe; }

.today-chip {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.day-card-today {
  border-color: rgba(59, 130, 246, 0.3) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2), 0 4px 16px rgba(0,0,0,0.15);
}

.day-card-body {
  padding: 5px;
  padding-top: 3px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.day-card-body::-webkit-scrollbar { width: 3px; }
.day-card-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.week-free {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
  padding: 8px 0;
}

/* Tareas dentro de la semana — tarjetas con más altura y mejor tipografía */
.week-drop-zone .glass-item,
.week-drop-zone .task-item {
  padding: 6px 8px;
  border-radius: 7px;
  min-height: 40px;
}

/* Nombre de tarea en semana: más grande, truncado a 2 líneas */
.week-drop-zone .task-name {
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: clip;
  cursor: default;
  word-break: break-word;
}

/* Estado expandido — doble click */
.week-drop-zone .task-item.week-expanded .task-name {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
  white-space: normal;
}

/* ═══════════════════════════════════════════════════════════
   WEEK CARD — Fila meta: texto + botones inline
═══════════════════════════════════════════════════════════ */
.week-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-top: 2px;
}
.week-meta-text {
  font-size: 0.68rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.week-inline-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   WEEK CARD — Estado apagado / encendido
   Dimming solo en nombre y meta, botones siempre nítidos
═══════════════════════════════════════════════════════════ */
.week-drop-zone .task-item.week-off .task-name,
.week-drop-zone .task-item.week-off .week-meta-text {
  opacity: 0.3;
  filter: saturate(0.2);
  transition: opacity 0.3s ease, filter 0.3s ease;
}
.week-drop-zone .task-item.week-off:hover .task-name,
.week-drop-zone .task-item.week-off:hover .week-meta-text {
  opacity: 0.55;
  filter: saturate(0.45);
}
.week-drop-zone .task-item.week-off {
  transform: none !important;
  box-shadow: none !important;
}

/* ── Botones de acción (inline) ───────────────────────────── */
.week-act-btn {
  width: 20px;
  height: 18px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.1s;
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.4);
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.week-act-btn:hover  { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.week-act-btn:active { transform: scale(0.9); }

/* ✓ Hecha */
.week-act-check:hover  { background: rgba(16,185,129,0.2); color: #10b981; }
.week-act-check.wab-on {
  background: rgba(16,185,129,0.15);
  color: #10b981;
  box-shadow: inset 0 0 0 1.5px rgba(16,185,129,0.45);
}
/* ✕ Reprogramar */
.week-act-uncheck:hover  { background: rgba(244,63,94,0.2); color: #f43f5e; }
.week-act-uncheck.wab-on {
  background: rgba(244,63,94,0.15);
  color: #f43f5e;
  box-shadow: inset 0 0 0 1.5px rgba(244,63,94,0.45);
}
/* 🗑 Eliminar */
.week-act-del:hover { background: rgba(244,63,94,0.15); color: #f43f5e; }

.week-drop-zone .priority-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
}

.week-drop-zone .task-info {
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.week-drop-zone .task-details {
  min-width: 0;
  overflow: hidden;
}

/* Drag & Drop */
.draggable-task {
  cursor: grab;
  transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s;
}
.draggable-task:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.07) !important;
}
.draggable-task.dragging {
  opacity: 0.35;
  cursor: grabbing;
  transform: scale(0.97);
}

.week-drop-zone {
  min-height: 60px;
  transition: background 0.15s, box-shadow 0.15s;
  border-radius: 0 0 12px 12px;
}
.week-drop-zone.drop-active {
  background: rgba(59, 130, 246, 0.1) !important;
  box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.5);
}
.week-drop-zone.drop-active .week-free { color: #93c5fd; }

/* ── Touch Drag Ghost (móvil) ── */
#touchDragGhost {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  opacity: 0.88;
  border-radius: 10px;
  box-shadow: 0 10px 36px rgba(0,0,0,0.55), 0 0 0 2px rgba(99,102,241,0.5);
  transform: scale(1.05) rotate(-1.5deg);
  max-width: 260px;
  background: rgba(18, 24, 48, 0.97);
  backdrop-filter: blur(10px);
}
.touch-dragging {
  opacity: 0.25 !important;
  transform: scale(0.95) !important;
}
.week-drop-zone.touch-drop-active {
  background: rgba(99,102,241,0.15) !important;
  box-shadow: inset 0 0 0 2px rgba(99,102,241,0.6) !important;
}

/* ── Tablet (768–1024px): 4 arriba + 3 abajo ── */
@media (max-width: 1024px) {
  .week-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .day-card:nth-child(n+5) {
    /* Los últimos 3 días (Vie-Dom) se ajustan a la segunda fila */
  }
  .day-card-header .day-name { font-size: 0.82rem; }
  .day-card-header .day-date { font-size: 0.7rem; }
  .day-card-body { min-height: 0; }
  .week-drop-zone .task-name { font-size: 0.75rem; }
  .week-act-btn { width: 26px; height: 24px; font-size: 11px; }
  .week-inline-actions { gap: 3px; }
  /* Scroll principal deshabilitado, week usa toda la altura */
  .main-content:has(#weekView.active-view) {
    padding: 8px 10px;
  }
}

/* ── Móvil (<768px): lista vertical con scroll ── */
@media (max-width: 768px) {
  /* En móvil sí permitir scroll vertical para la semana */
  .main-content:has(#weekView.active-view) {
    overflow-y: auto;
    padding: 10px 12px 16px;
  }
  #weekView.active-view {
    height: auto;
    display: block;
  }
  .week-view-wrapper {
    min-height: auto;
  }
  .week-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 8px;
    flex: none;
  }
  .day-card {
    border-radius: 12px;
    min-height: 80px;
    border-top: 2px solid rgba(99,102,241,0.2);
    margin-bottom: 2px;
  }
  /* Días impares: fondo levemente más luminoso */
  .day-card:nth-child(odd) {
    background: rgba(15, 20, 40, 0.85);
  }
  /* Días pares: fondo más oscuro/neutro */
  .day-card:nth-child(even) {
    background: rgba(8, 12, 24, 0.92);
  }
  .day-card-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(99,102,241,0.12);
    background: rgba(99,102,241,0.06);
    border-radius: 10px 10px 0 0;
  }
  /* Días impares: header con más opacidad */
  .day-card:nth-child(odd) .day-card-header {
    background: rgba(99,102,241,0.09);
  }
  .day-card-header .day-name {
    font-size: 1.05rem;
    font-weight: 900;
    background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  .day-card-header .day-date {
    font-size: 0.85rem;
    color: rgba(148,163,184,0.6);
  }
  .day-card-body {
    padding: 10px;
    gap: 6px;
    min-height: auto;
    max-height: none;
  }

  /* ── HOY: destacado fuerte ── */
  .day-card-today {
    background: linear-gradient(160deg,
      rgba(99,102,241,0.14) 0%,
      rgba(139,92,246,0.08) 100%) !important;
    border: 1.5px solid rgba(99,102,241,0.45) !important;
    border-top: 3px solid #818cf8 !important;
    box-shadow:
      0 0 0 1px rgba(99,102,241,0.12),
      0 0 20px rgba(99,102,241,0.18),
      0 6px 24px rgba(0,0,0,0.3);
  }
  .today-header {
    background: linear-gradient(135deg,
      rgba(99,102,241,0.22),
      rgba(139,92,246,0.14)) !important;
    border-bottom: 1px solid rgba(99,102,241,0.3) !important;
    border-radius: 10px 10px 0 0;
  }
  .today-header .day-name {
    background: linear-gradient(135deg, #ffffff, #c7d2fe) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    font-size: 1.1rem !important;
  }
  .today-header .day-date {
    color: #c7d2fe !important;
    font-weight: 600 !important;
  }
  .today-chip {
    display: inline-flex !important;
    background: linear-gradient(135deg, #6366f1, #8b5cf6) !important;
    box-shadow: 0 0 10px rgba(99,102,241,0.5) !important;
    font-size: 0.6rem !important;
  }

  .week-drop-zone .glass-item,
  .week-drop-zone .task-item {
    padding: 10px 12px;
    border-radius: 10px;
    min-height: 44px;
  }
  .week-drop-zone .task-name { font-size: 0.88rem; }
  .week-drop-zone .task-meta { font-size: 0.78rem; }
  .week-drop-zone .priority-dot { width: 10px; height: 10px; }
  .week-nav-bar { padding: 8px 0; }
  .week-title-text { font-size: 1rem; }
  .week-act-btn { width: 32px; height: 28px; font-size: 12px; }
  .week-inline-actions { gap: 4px; }
  .task-actions { opacity: 1; }
}

/* Utilities */
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.text-right { text-align: right; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 500px; }

/* Shortcuts List */
.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shortcut-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  color: var(--text);
  width: 100%;
}

.shortcut-btn:hover {
  background: rgba(255,255,255,0.08);
}

.shortcut-btn .icon {
  font-size: 1.5rem;
  background: rgba(255,255,255,0.1);
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
}

.shortcut-btn .info strong {
  display: block;
  font-size: 1rem;
}

.shortcut-btn .info small {
  color: var(--muted);
}

/* ── Settings sub-tabs ─────────────────────────────────── */
.settings-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 24px;
}

.stab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.stab:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.stab.active {
  background: rgba(59,130,246,0.2);
  color: #93c5fd;
  box-shadow: 0 0 0 1px rgba(59,130,246,0.3);
}

.stab-panel { display: block; }
.stab-panel.hidden { display: none; }

/* ── Timezone Setting Block ──────────────────── */
.tz-setting-block {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}
.tz-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.tz-icon { font-size: 1.8rem; }
.tz-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.tz-auto-info {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}
.tz-auto-badge {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 20px;
}
.tz-select {
  font-size: 0.82rem !important;
  padding: 4px !important;
  height: 164px !important;
  cursor: pointer;
  background: var(--bg-1) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  outline: none;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}
.tz-select option {
  padding: 6px 8px;
  background: var(--bg-1);
  color: var(--text);
}
.tz-select option:checked {
  background: var(--accent);
  color: #fff;
}
.tz-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 14px;
}
.tz-preview-label {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tz-preview-time {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  color: var(--accent);
  text-shadow: 0 0 14px rgba(99,102,241,0.4);
  letter-spacing: 0.04em;
}
.tz-preview-zone {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
}

/* Divider dentro de formulario */
.settings-divider {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 8px 0 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

/* Badge de key API — base */
.key-badge {
  display: inline-block;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  margin-left: 8px;
  text-transform: none;
  letter-spacing: 0;
  vertical-align: middle;
}
/* Key configurada correctamente */
.key-badge--ok {
  background: rgba(16,185,129,0.15);
  color: #34d399;
  border: 1px solid rgba(16,185,129,0.35);
}
/* Key no configurada */
.key-badge--missing {
  background: rgba(244,63,94,0.12);
  color: #fb7185;
  border: 1px solid rgba(244,63,94,0.28);
}

/* Nota informativa en settings */
.settings-info {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
}

/* Toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 24px;
  transition: background 0.2s;
  border: 1px solid rgba(255,255,255,0.15);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 2px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(59,130,246,0.6); border-color: #3b82f6; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* Notes list */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

/* Text utilities */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }

/* (week view enhancements now consolidated above) */

/* ═══════════════════════════════════════════════
   CHAT PANEL — Aria IA
═══════════════════════════════════════════════ */

/* FAB — botón flotante */
#chatFab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(59,130,246,0.45), 0 0 0 0 rgba(59,130,246,0.4);
  z-index: 9000;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s;
  animation: fabPulse 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
}
#chatFab:hover {
  transform: scale(1.12);
  box-shadow: 0 12px 32px rgba(59,130,246,0.6);
  animation: none;
}
#chatFab.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  transform: scale(1.05) rotate(20deg);
  animation: none;
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(59,130,246,0.45), 0 0 0 0 rgba(59,130,246,0.4); }
  50%       { box-shadow: 0 8px 24px rgba(59,130,246,0.45), 0 0 0 12px rgba(59,130,246,0); }
}

/* ── Chat Panel ────────────────────────────── */
#chatPanel {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 400px;
  max-height: 620px;
  display: flex;
  flex-direction: column;
  background: rgba(6, 12, 28, 0.97);
  backdrop-filter: blur(28px);
  border: 1px solid rgba(99,179,237,0.18);
  border-radius: 22px;
  box-shadow: 0 28px 72px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04) inset;
  z-index: 8999;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
#chatPanel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ────────────────────────────────── */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.12), rgba(99,102,241,0.08));
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 11px;
}

/* Avatar with online status dot */
.chat-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(59,130,246,0.45);
}
.chat-avatar-online {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid rgba(6,12,28,0.97);
  animation: onlinePulse 2.5s ease-in-out infinite;
}
@keyframes onlinePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50%       { box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}

.chat-header strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.chat-subtitle {
  font-size: 0.72rem;
  color: #34d399;
  font-weight: 500;
}
.chat-header-actions { display: flex; gap: 6px; }
.chat-icon-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.chat-icon-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* ── Messages area ─────────────────────────── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 3px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

/* ── Message rows ──────────────────────────── */
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: msgIn 0.22s cubic-bezier(0.16,1,0.3,1);
  margin-bottom: 2px;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.chat-msg-user { flex-direction: row-reverse; }

/* Mini avatar on assistant messages */
.chat-msg-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  margin-bottom: 2px;
  box-shadow: 0 2px 8px rgba(59,130,246,0.35);
}

/* Content column — ocupa el espacio restante del row */
.chat-col {
  display: flex;
  flex-direction: column;
  max-width: 82%;          /* límite máximo dentro del row */
  gap: 3px;
  min-width: 0;            /* permite shrink correcto */
}
.chat-msg-user .chat-col      { align-items: flex-end; }
.chat-msg-assistant .chat-col { align-items: flex-start; }

/* bubble-wrap es flex: la burbuja crece para llenar el espacio disponible */
.chat-bubble-wrap {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  max-width: 100%;
}
.chat-msg-user .chat-bubble-wrap { flex-direction: row-reverse; }

.chat-timestamp {
  font-size: 0.65rem;
  color: rgba(148,163,184,0.45);
  padding: 0 6px;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-wrap: break-word;  /* rompe palabras largas si es necesario */
  word-break: normal;         /* NO rompe a nivel de carácter */
  display: inline-block;      /* se adapta al ancho del texto */
  width: fit-content;         /* burbuja del tamaño del contenido */
  max-width: 100%;            /* no desborda chat-col */
  min-width: 0;               /* permite burbujas muy pequeñas */
  white-space: pre-wrap;      /* respeta saltos de línea explícitos */
  box-sizing: border-box;
}

/* User bubble — right aligned */
.chat-msg-user .chat-bubble {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 16px rgba(59,130,246,0.3);
}

/* Aria bubble — left aligned */
.chat-msg-assistant .chat-bubble {
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.09);
  color: var(--text);
  border-bottom-left-radius: 5px;
}

.chat-bubble code {
  background: rgba(0,0,0,0.35);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
}
.chat-bubble strong { font-weight: 700; }
.chat-bubble em { font-style: italic; opacity: 0.9; }

/* Copy button (appears on hover) */
.chat-copy-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  width: 26px;
  height: 26px;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  align-self: flex-end;
  margin-bottom: 2px;
}
.chat-msg-assistant:hover .chat-copy-btn { opacity: 1; }
.chat-copy-btn:hover { background: rgba(255,255,255,0.14); color: var(--text); }
.chat-copy-btn.copied { color: #34d399; border-color: rgba(52,211,153,0.4); }

/* Button group (speaker + copy) */
.chat-btn-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-self: flex-end;
  margin-bottom: 2px;
}
.chat-btn-group .chat-copy-btn {
  align-self: auto;
  margin-bottom: 0;
}

/* ── Action tags ───────────────────────────── */
.chat-actions-done {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chat-action-tag {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.28);
  color: #6ee7b7;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
}

/* ── Typing indicator ──────────────────────── */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 12px;
  flex-shrink: 0;
}
.chat-typing-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}
.chat-typing-dots {
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 16px;
  border-bottom-left-radius: 5px;
  padding: 9px 14px;
  display: flex;
  gap: 5px;
  align-items: center;
}
.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: typingBounce 1.4s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.18s; }
.typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0);   opacity: 0.35; }
  30%            { transform: translateY(-5px); opacity: 1;    }
}

/* ── Input area ────────────────────────────── */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.25);
  flex-shrink: 0;
}
#chatInput {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.45;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
#chatInput::placeholder { color: rgba(148,163,184,0.4); }
#chatInput:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
  background: rgba(255,255,255,0.07);
}
.chat-input-hint {
  font-size: 0.65rem;
  color: rgba(148,163,184,0.3);
  text-align: right;
  padding: 2px 4px 0;
}
#chatSendBtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
#chatSendBtn:hover { transform: scale(1.12); box-shadow: 0 6px 18px rgba(59,130,246,0.55); }
#chatSendBtn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── Mic button (voice input) ──────────────── */
.chat-mic-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.08);
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  border: 1px solid rgba(255,255,255,0.1);
}
.chat-mic-btn:hover {
  background: rgba(255,255,255,0.14);
  color: var(--text);
  transform: scale(1.08);
}
.chat-mic-btn.recording {
  background: rgba(239,68,68,0.2);
  color: #f87171;
  border-color: rgba(239,68,68,0.5);
  animation: micPulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(239,68,68,0.4);
}
@keyframes micPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239,68,68,0.4), 0 0 12px rgba(239,68,68,0.2);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239,68,68,0), 0 0 20px rgba(239,68,68,0.3);
    transform: scale(1.08);
  }
}

/* ── Welcome screen ────────────────────────── */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 24px 16px 16px;
  gap: 10px;
  animation: msgIn 0.3s ease;
}
.chat-welcome-icon {
  font-size: 2.4rem;
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(99,102,241,0.2));
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
  animation: floatIcon 4s ease-in-out infinite;
}
.chat-welcome h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.chat-welcome p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 280px;
}
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
}
.chat-suggestion {
  background: rgba(59,130,246,0.09);
  border: 1px solid rgba(59,130,246,0.22);
  color: #93c5fd;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-suggestion:hover {
  background: rgba(59,130,246,0.18);
  border-color: rgba(59,130,246,0.45);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 480px) {
  #chatPanel { right: 10px; left: 10px; width: auto; bottom: 82px; }
  #chatFab   { right: 16px; bottom: 18px; }
}






/* Header del chat */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(59,130,246,0.15), rgba(99,102,241,0.1));
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}

.chat-header strong {
  display: block;
  font-size: 0.95rem;
  color: var(--text);
}

.chat-subtitle {
  font-size: 0.75rem;
  color: var(--muted);
}

.chat-header-actions {
  display: flex;
  gap: 6px;
}

.chat-icon-btn {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.chat-icon-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* Área de mensajes */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

/* Mensajes */
.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  animation: msgIn 0.2s ease-out;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-msg-user {
  flex-direction: row-reverse;
}

.chat-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* Burbujas — reglas duplicadas eliminadas, ahora unificadas arriba */

/* Tags de acciones realizadas */
.chat-actions-done {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chat-action-tag {
  background: rgba(16,185,129,0.15);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 8px;
}

/* Indicador de escritura */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 16px;
  flex-shrink: 0;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: typingBounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}

/* Input area */
.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.2);
  flex-shrink: 0;
}

#chatInput {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  resize: none;
  outline: none;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.4;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#chatInput::placeholder { color: rgba(148,163,184,0.5); }
#chatInput:focus {
  border-color: rgba(59,130,246,0.5);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

#chatSendBtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(59,130,246,0.4);
}
#chatSendBtn:hover { transform: scale(1.1); box-shadow: 0 6px 16px rgba(59,130,246,0.5); }
#chatSendBtn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Pantalla de bienvenida */
.chat-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 10px;
  gap: 10px;
}

.chat-welcome-icon {
  font-size: 2.5rem;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, rgba(59,130,246,0.2), rgba(99,102,241,0.2));
  border: 1px solid rgba(59,130,246,0.3);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.chat-welcome h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.chat-welcome p {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
}

.chat-suggestion {
  background: rgba(59,130,246,0.1);
  border: 1px solid rgba(59,130,246,0.25);
  color: #93c5fd;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.chat-suggestion:hover {
  background: rgba(59,130,246,0.2);
  border-color: rgba(59,130,246,0.5);
}

/* Responsive: en móvil ocupa más ancho */
@media (max-width: 480px) {
  #chatPanel {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 84px;
  }
  #chatFab { right: 16px; bottom: 20px; }
}

/* ═══════════════════════════════════════════════
   GLOBAL RESPONSIVE — Tablet + Móvil
═══════════════════════════════════════════════ */

/* ── Tablet (≤1024px) ────────────────────────── */
@media (max-width: 1024px) {
  .app-container {
    padding: 14px;
    gap: 14px;
  }
  .glass-header {
    padding: 12px 16px;
    border-radius: 14px;
  }
  .logo h1 { font-size: 1.1rem; }
  .logo-icon { width: 36px; height: 36px; font-size: 1rem; }

  .glass-nav {
    border-radius: 12px;
    gap: 4px;
    padding: 6px;
  }
  .tab {
    padding: 8px 14px;
    font-size: 0.8rem;
    border-radius: 8px;
  }

  .grid-layout {
    grid-template-columns: 1fr;
  }
  .col-span-2 { grid-column: span 1; }

  .glass-card {
    padding: 18px;
    border-radius: 16px;
  }

  .modal-card {
    padding: 24px;
    max-width: 90vw;
  }

  .stats-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

/* ── Móvil (≤768px) ──────────────────────────── */
@media (max-width: 768px) {
  .app-container {
    padding: 10px;
    gap: 10px;
  }

  .glass-header {
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border-radius: 14px;
  }

  .glass-nav {
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
  }
  .tab {
    padding: 8px 12px;
    font-size: 0.78rem;
    flex: 1 1 auto;
    justify-content: center;
  }
  .tab .badge { display: none; }

  .glass-card {
    padding: 14px;
    border-radius: 14px;
  }

  .grid-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .stats-row {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
  }
  .stat-box {
    padding: 10px;
    gap: 4px;
  }
  .stat-box strong { font-size: 1.2rem; }
  .stat-label { font-size: 0.75rem; }

  .field-row {
    flex-direction: column;
    gap: 12px;
  }
  .w-1\/2 { width: 100%; }

  .modal-card {
    padding: 20px;
    max-width: 100%;
    border-radius: 16px;
  }

  .schedule-grid {
    grid-template-columns: 50px repeat(7, minmax(90px, 1fr));
  }

  /* Settings tabs en móvil */
  .settings-tabs { flex-wrap: wrap; }
  .stab { flex: 1 1 auto; font-size: 0.8rem; padding: 8px; }
}

/* ── Móvil pequeño (≤480px) ──────────────────── */
@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
  .tab {
    padding: 7px 10px;
    font-size: 0.75rem;
  }
}

/* Viewport height para app completa */
@media (min-width: 1025px) {
  .app-container {
    max-width: 1280px;
  }
}

/* ── Color Palette Picker ─────────────────────── */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 0 8px;
}

.color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  flex-shrink: 0;
}

.color-swatch:hover {
  transform: scale(1.2);
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}

.color-swatch.selected {
  border-color: white;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5), 0 4px 14px rgba(0,0,0,0.4);
}

.color-swatch.selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 800;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.color-selected-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Custom Select Dropdown (tema oscuro) ────── */
.custom-select {
  position: relative;
  width: 100%;
}

.cs-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-align: left;
}

.cs-trigger:hover,
.custom-select.open .cs-trigger {
  border-color: rgba(99,102,241,0.5);
  background: rgba(255,255,255,0.09);
}

.cs-arrow {
  color: var(--muted);
  font-size: 0.8rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.custom-select.open .cs-arrow {
  transform: rotate(180deg);
}

.cs-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e2130;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  overflow: hidden;
  z-index: 999;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.custom-select.open .cs-dropdown {
  display: block;
  animation: dropIn 0.15s ease-out;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cs-option {
  padding: 10px 16px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.cs-option:last-child { border-bottom: none; }

.cs-option:hover {
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
}

.cs-option.selected {
  background: rgba(99,102,241,0.2);
  color: #c7d2fe;
  font-weight: 600;
}

.cs-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   TOAST NOTIFICATIONS
═══════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  min-width: 300px;
  max-width: 420px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  pointer-events: all;
  animation: toastIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  border-radius: 14px 0 0 14px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(60px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0) scale(1); max-height: 200px; }
  to   { opacity: 0; transform: translateX(60px) scale(0.9); max-height: 0; padding: 0; margin: 0; }
}

.toast.removing {
  animation: toastOut 0.3s ease-in forwards;
}

/* Tipos de toast */
.toast-error {
  background: rgba(30, 10, 15, 0.92);
}
.toast-error::before { background: #f43f5e; }
.toast-error .toast-icon { color: #f43f5e; }

.toast-warning {
  background: rgba(30, 25, 5, 0.92);
}
.toast-warning::before { background: #f59e0b; }
.toast-warning .toast-icon { color: #f59e0b; }

.toast-success {
  background: rgba(5, 25, 15, 0.92);
}
.toast-success::before { background: #10b981; }
.toast-success .toast-icon { color: #10b981; }

.toast-info {
  background: rgba(5, 15, 30, 0.92);
}
.toast-info::before { background: #6366f1; }
.toast-info .toast-icon { color: #6366f1; }

.toast-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.toast-body {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}

.toast-msg {
  font-size: 0.8rem;
  color: rgba(203,213,225,0.85);
  line-height: 1.45;
  word-break: break-word;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0 0 6px;
  flex-shrink: 0;
  transition: color 0.15s;
  line-height: 1;
  align-self: flex-start;
}
.toast-close:hover { color: var(--text); }

.toast-progress {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 0 0 14px 14px;
  opacity: 0.4;
  animation: toastProgress linear forwards;
}

@keyframes toastProgress {
  from { width: 100%; }
  to   { width: 0%; }
}

/* ═══════════════════════════════════════════════
   MONTH CALENDAR VIEW
═══════════════════════════════════════════════ */
.month-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  /* Ocupa todo el espacio vertical disponible en el flex container */
  flex: 1;
  min-height: 0;
}

.month-nav-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}

.month-title-text {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

.month-nav-btn {
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
}

.month-day-headers {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid var(--border);
}

.month-day-headers > div {
  padding: 10px 0;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.month-day-headers .weekend {
  color: rgba(99,102,241,0.7);
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Celda de día */
.month-cell {
  /* Sin min-height fija: la celda crece para llenar el grid */
  padding: 8px;
  border-right: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.month-cell:hover {
  background: rgba(255,255,255,0.04);
}

.month-cell:nth-child(7n) {
  border-right: none;
}

.month-cell.other-month {
  background: rgba(0,0,0,0.08);
  opacity: 0.5;
}

.month-cell.today {
  background: rgba(99,102,241,0.08);
}

.month-cell.today .month-day-num {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(99,102,241,0.4);
}

.month-day-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.month-cell.weekend-cell .month-day-num {
  color: rgba(139,92,246,0.8);
}

/* Tareas dentro de la celda */
.month-task-pill {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  line-height: 1.4;
  transition: opacity 0.15s;
  min-width: 0;
  max-width: 100%;
}

.month-task-pill:hover { opacity: 0.85; }

.month-task-pill.done {
  opacity: 0.45;
  text-decoration: line-through;
}

.month-task-pill.prio-high   { background: rgba(244,63,94,0.2);  color: #fda4af; border-left: 2px solid #f43f5e; }
.month-task-pill.prio-medium { background: rgba(245,158,11,0.2); color: #fcd34d; border-left: 2px solid #f59e0b; }
.month-task-pill.prio-low    { background: rgba(16,185,129,0.2); color: #6ee7b7; border-left: 2px solid #10b981; }

.month-more {
  font-size: 0.65rem;
  color: var(--muted);
  padding: 1px 4px;
  margin-top: 2px;
}

.month-more-btn {
  cursor: pointer;
  color: var(--accent-hover);
  font-weight: 600;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.month-more-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

/* ── Day Popover ───────────────────────────────────────────────── */
.day-popover {
  position: fixed;
  z-index: 9999;
  width: 270px;
  background: rgba(15, 20, 40, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04);
  animation: popoverIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  overflow: hidden;
}

@keyframes popoverIn {
  from { opacity: 0; transform: scale(0.93) translateY(-6px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

.dp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(99, 102, 241, 0.08);
}

.dp-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}

.dp-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.dp-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.dp-list {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 340px;
  overflow-y: auto;
}
.dp-list::-webkit-scrollbar { width: 4px; }
.dp-list::-webkit-scrollbar-thumb { background: rgba(100,116,139,0.3); border-radius: 4px; }

.dp-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border-radius: 10px;
  border-left: 3px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.15s;
}
.dp-item:hover { background: rgba(255, 255, 255, 0.06); }

.dp-item.dp-prio-high   { border-left-color: #f43f5e; }
.dp-item.dp-prio-medium { border-left-color: #f59e0b; }
.dp-item.dp-prio-low    { border-left-color: #10b981; }

.dp-status-dot {
  font-size: 0.72rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.dp-dot-active  { background: rgba(99,102,241,0.2);  color: #818cf8; }
.dp-dot-done    { background: rgba(16,185,129,0.2);  color: #6ee7b7; }
.dp-dot-backlog { background: rgba(244,63,94,0.15);  color: #fda4af; }

.dp-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.dp-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
  line-height: 1.3;
}
.dp-strikethrough {
  text-decoration: line-through;
  opacity: 0.5;
}
.dp-item-meta {
  font-size: 0.7rem;
  color: var(--muted);
}

[data-theme="light"] .day-popover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 20px 60px rgba(100, 116, 139, 0.25), 0 0 0 1px rgba(0,0,0,0.04);
}
[data-theme="light"] .dp-header { background: rgba(99, 102, 241, 0.06); }
[data-theme="light"] .dp-item   { background: rgba(0,0,0,0.02); }
[data-theme="light"] .dp-item:hover { background: rgba(0,0,0,0.05); }

/* Responsive — tablet */
@media (max-width: 1024px) {
  .month-nav-bar {
    padding: 12px 14px;
  }
  .month-cell {
    padding: 5px;
    gap: 2px;
  }
  .month-day-num {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
  .month-cell.today .month-day-num {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
  .month-task-pill {
    font-size: 0.62rem;
    padding: 1px 5px;
  }
  .month-title-text {
    font-size: 1rem;
    min-width: 130px;
  }
}

/* Responsive — móvil */
@media (max-width: 768px) {
  .month-nav-bar {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 12px;
    text-align: center;
  }
  .month-nav-bar > div {
    justify-content: center;
  }
  .month-cell {
    padding: 3px;
    gap: 1px;
  }
  .month-day-num {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }
  .month-cell.today .month-day-num {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }
  .month-task-pill {
    font-size: 0.55rem;
    padding: 1px 3px;
    border-left-width: 1px;
  }
  .month-title-text { font-size: 0.9rem; min-width: 120px; }
  .month-day-headers > div {
    font-size: 0.6rem;
    padding: 6px 0;
  }
  .month-more {
    font-size: 0.55rem;
  }
  .month-grid {
    grid-auto-rows: auto;
    min-height: 60vh;
    flex: none;
  }
  #monthView.active-view {
    height: auto;
    display: block;
  }
  .main-content:has(#monthView.active-view) {
    overflow-y: auto;
  }
}

/* Responsive — pantallas muy pequeñas */
@media (max-width: 500px) {
  .month-cell {
    padding: 2px;
  }
  .month-day-num {
    width: 18px;
    height: 18px;
    font-size: 0.62rem;
  }
  .month-cell.today .month-day-num {
    width: 18px;
    height: 18px;
    font-size: 0.62rem;
  }
  .month-task-pill {
    font-size: 0.5rem;
    padding: 0px 2px;
    border-radius: 3px;
  }
  .month-day-headers > div {
    font-size: 0.55rem;
    padding: 4px 0;
    letter-spacing: 0;
  }
}

/* ═══════════════════════════════════════════════
   IDEAS VIEW
═══════════════════════════════════════════════ */
.ideas-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

/* Panel de captura */
.ideas-capture-panel {
  position: sticky;
  top: 10px;
}

.idea-textarea {
  width: 100%;
  min-height: 120px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  transition: border-color 0.2s;
  box-sizing: border-box;
  line-height: 1.5;
}

.idea-textarea:focus {
  outline: none;
  border-color: rgba(99,102,241,0.5);
  background: rgba(255,255,255,0.07);
}

.idea-textarea::placeholder { color: var(--muted); }

.ideas-quick-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.idea-form-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.idea-priority-select {
  flex: 1;
  min-width: 0;
}

.idea-save-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

/* Filtros */
.ideas-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.idea-filter {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.78rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.idea-filter:hover {
  background: rgba(99,102,241,0.1);
  color: var(--text);
}

.idea-filter.active {
  background: rgba(99,102,241,0.2);
  border-color: rgba(99,102,241,0.4);
  color: #a5b4fc;
  font-weight: 600;
}

/* Lista panel */
.ideas-list-panel {}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-soft {
  background: rgba(99,102,241,0.15);
  color: #a5b4fc;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ideas-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

/* Tarjeta de idea */
.idea-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-left: 4px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: background 0.15s, transform 0.15s;
  animation: ideaIn 0.3s ease-out;
}

@keyframes ideaIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.idea-card:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(3px);
}

.idea-card.prio-high   { border-left-color: #f43f5e; }
.idea-card.prio-medium { border-left-color: #f59e0b; }
.idea-card.prio-low    { border-left-color: #10b981; }

.idea-card-body {
  flex: 1;
  min-width: 0;
}

.idea-card-text {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.idea-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.idea-prio-badge {
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.idea-prio-badge.high   { background: rgba(244,63,94,0.15);  color: #fda4af; }
.idea-prio-badge.medium { background: rgba(245,158,11,0.15); color: #fcd34d; }
.idea-prio-badge.low    { background: rgba(16,185,129,0.15); color: #6ee7b7; }

.idea-date-badge {
  font-size: 0.68rem;
  color: var(--muted);
}

.idea-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.idea-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.73rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  font-family: inherit;
}

.idea-btn:hover { background: rgba(255,255,255,0.1); color: var(--text); }
.idea-btn.promote { border-color: rgba(99,102,241,0.3); color: #a5b4fc; }
.idea-btn.promote:hover { background: rgba(99,102,241,0.15); }
.idea-btn.delete:hover  { background: rgba(244,63,94,0.15); color: #fda4af; border-color: rgba(244,63,94,0.3); }

/* Estado vacío */
.ideas-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}
.ideas-empty .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.ideas-empty p { font-size: 0.88rem; }

/* Responsive */
@media (max-width: 900px) {
  .ideas-layout {
    grid-template-columns: 1fr;
  }
  .ideas-capture-panel { position: static; }
}

/* ═══════════════════════════════════════════════
   DASHBOARD (HOME)
═══════════════════════════════════════════════ */
.dash-greeting { margin-bottom: 16px; }
.dash-greeting h1 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.dash-date {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Stats row */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.dash-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: border-color 0.2s, transform 0.15s;
}
.dash-stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.dash-stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.dash-stat-info { display: flex; flex-direction: column; }
.dash-stat-value { font-size: 1.3rem; font-weight: 800; color: var(--text); letter-spacing: -0.02em; }
.dash-stat-label { font-size: 0.75rem; color: var(--muted); font-weight: 500; margin-top: 1px; }

/* Dash grid */
.dash-grid {
  display: grid;
  grid-template-columns: 260px 1fr 280px;
  gap: 14px;
  align-items: start;
}

/* Progress ring */
.dash-progress-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.dash-progress-card h3 { align-self: flex-start; margin-bottom: 12px; }

.progress-ring-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 12px;
}

.progress-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}

.ring-fill {
  fill: none;
  stroke: url(#progressGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1);
}

.progress-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.progress-pct {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.progress-sub {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}

.dash-mini-stats {
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.dash-mini-stats strong { margin-left: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.dot-done { background: var(--success); }
.dot-pending { background: var(--warning); }

/* Tasks card */
.dash-tasks-card { min-height: 300px; }
.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
  margin-bottom: 20px;
}

.quick-action-btn {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  color: var(--text-secondary);
  font-family: inherit;
}
.quick-action-btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.qa-icon { font-size: 1.3rem; }
.qa-label { font-size: 0.75rem; font-weight: 600; }
.qa-count {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--danger);
  color: white;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 700;
}

/* Schedule preview */
.dash-schedule-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.sched-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
}

.sched-preview-time {
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  min-width: 80px;
}

.sched-preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sched-preview-name {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-muted-sm { color: var(--muted); font-size: 0.8rem; }

.mt-4 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }

/* Dashboard responsive */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-quick-card { grid-column: span 2; }
}
@media (max-width: 768px) {
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-quick-card { grid-column: span 1; }
  .dash-greeting h1 { font-size: 1.3rem; }
}

/* ═══════════════════════════════════════════════
   VISTA ESTADÍSTICAS v2 — Profesional
═══════════════════════════════════════════════ */
.stats-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

/* ── Barra de período ── */
.stats-period-bar {
  display: flex;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  width: fit-content;
}

.stats-period-tab {
  padding: 8px 24px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(.4,0,.2,1);
  letter-spacing: .01em;
}
.stats-period-tab:hover { color: var(--text-secondary); background: rgba(255,255,255,0.04); }
.stats-period-tab.active {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* ── Fila top ── */
.stats-row-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── Card Racha ── */
.stats-streak-card { display: flex; flex-direction: column; gap: 16px; }
.streak-header { display: flex; align-items: center; gap: 20px; }
.streak-flame {
  font-size: 2.8rem; line-height: 1;
  animation: flamePulse 2s ease-in-out infinite;
}
@keyframes flamePulse {
  0%,100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(245,158,11,.5)); }
  50%     { transform: scale(1.08); filter: drop-shadow(0 0 14px rgba(245,158,11,.9)); }
}
.streak-title { font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 2px; }
.streak-value { font-size: 1.7rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.streak-best { margin-left: auto; text-align: right; }
.streak-best-val { font-size: 1.3rem; color: var(--accent-hover); }
.level-block { display: flex; flex-direction: column; gap: 6px; }
.level-label-row { display: flex; align-items: center; justify-content: space-between; }
.level-badge {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: white; font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 20px;
}
.level-next { font-size: .72rem; color: var(--muted); }
.level-bar-bg { height: 8px; background: rgba(255,255,255,.06); border-radius: 10px; overflow: hidden; }
.level-bar-fill {
  height: 100%; background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 10px; transition: width .8s cubic-bezier(.23,1,.32,1);
}
.level-pct { font-size: .72rem; font-weight: 700; color: var(--accent-hover); text-align: right; }

/* ── Métricas globales grid ── */
.stats-global-metrics { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 10px; }
.stats-metric-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 14px 10px; gap: 4px; transition: transform .2s, box-shadow .2s;
}
.stats-metric-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.25); }
.sm-icon { font-size: 1.4rem; margin-bottom: 2px; }
.sm-value { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -.03em; }
.sm-label { font-size: .7rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ── Gráfico de línea profesional ── */
.stats-chart-card { overflow: visible; }
.chart-summary { display: flex; align-items: center; gap: 16px; font-size: .75rem; color: var(--muted); }
.chart-summary-item { display: flex; align-items: center; gap: 6px; }
.cs-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.stats-line-chart { width: 100%; padding: 12px 0 0; position: relative; }
.stats-line-chart svg { display: block; width: 100%; }

/* Tooltip */
.chart-tooltip {
  position: fixed; background: rgba(15,22,42,.97); border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px; padding: 10px 16px; font-size: .78rem; color: var(--text);
  pointer-events: none; z-index: 9999; white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0,0,0,.5); transform: translate(-50%, -120%);
  line-height: 1.5;
}

/* ── Fila mid ── */
.stats-row-mid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; }

/* ── Timeline de períodos ── */
.stats-timeline { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.tl-item {
  display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 14px; background: rgba(255,255,255,.03); border: 1px solid var(--border);
  border-radius: 12px; transition: border-color .2s, background .2s;
}
.tl-item:hover { border-color: var(--border-hover); background: rgba(255,255,255,.05); }
.tl-date { font-size: .72rem; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.3; }
.tl-date strong { display: block; font-size: .95rem; color: var(--text); }
.tl-body { display: flex; flex-direction: column; gap: 4px; }
.tl-counts { display: flex; gap: 14px; font-size: .72rem; color: var(--muted); }
.tl-counts strong { color: var(--text); }
.tl-bar-bg { height: 4px; background: rgba(255,255,255,.06); border-radius: 10px; overflow: hidden; }
.tl-bar-fill { height: 100%; border-radius: 10px; transition: width .7s cubic-bezier(.23,1,.32,1); }
.tl-rate {
  font-size: .82rem; font-weight: 800; padding: 3px 12px; border-radius: 20px; white-space: nowrap;
}
.tl-rate.rate-high  { background: rgba(16,185,129,.15); color: #6ee7b7; }
.tl-rate.rate-mid   { background: rgba(245,158,11,.15); color: #fcd34d; }
.tl-rate.rate-low   { background: rgba(244,63,94,.15);  color: #fda4af; }
.tl-rate.rate-none  { background: rgba(100,116,139,.1); color: var(--muted); }

/* ── Donut ── */
.stats-donut-card { display: flex; flex-direction: column; }
.donut-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; flex: 1; justify-content: center; }
.donut-center-val { font-size: 22px; font-weight: 800; fill: var(--text); }
.donut-center-lbl { font-size: 9px; font-weight: 600; fill: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.donut-leg-item { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--text-secondary); }
.donut-leg-item span:last-of-type { flex: 1; }
.donut-leg-item strong { font-size: 1rem; color: var(--text); font-weight: 700; }
.donut-leg-dot { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ── Responsive Stats ── */
@media (max-width: 1100px) {
  .stats-row-top { grid-template-columns: 1fr; }
  .stats-global-metrics { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr; }
  .stats-row-mid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .stats-global-metrics { grid-template-columns: repeat(2, 1fr); }
  .stats-row-mid { grid-template-columns: 1fr; }
  .streak-value { font-size: 1.3rem; }
  .sm-value { font-size: 1.3rem; }
  .stats-period-bar { width: 100%; }
  .stats-period-tab { flex: 1; text-align: center; padding: 8px 12px; }
}

/* ── Light mode stats ── */
[data-theme="light"] .stats-metric-card,
[data-theme="light"] .stats-streak-card,
[data-theme="light"] .stats-chart-card,
[data-theme="light"] .stats-timeline-card,
[data-theme="light"] .stats-donut-card {
  background: rgba(255,255,255,.8); border-color: rgba(100,116,139,.12);
}
[data-theme="light"] .tl-item { background: rgba(0,0,0,.02); }
[data-theme="light"] .level-bar-bg { background: rgba(0,0,0,.08); }
[data-theme="light"] .chart-tooltip {
  background: rgba(255,255,255,.98); border-color: rgba(100,116,139,.2); color: #0f172a;
}
[data-theme="light"] .donut-center-val { fill: #0f172a; }
[data-theme="light"] .donut-center-lbl { fill: #64748b; }
[data-theme="light"] .stats-period-bar { background: rgba(255,255,255,.8); }


/* ── Timeline summary labels ── */
.tl-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-main-stat { font-size: .82rem; font-weight: 600; color: var(--text); }
.tl-main-stat.tl-empty { color: var(--muted); font-weight: 500; }
.tl-active-note {
  font-size: .7rem; color: var(--muted); background: rgba(255,255,255,.05);
  padding: 2px 8px; border-radius: 8px;
}
[data-theme="light"] .tl-active-note { background: rgba(0,0,0,.05); }


/* ═══════════════════════════════════════════
   ZONA DE PRUEBAS / DEMO
═══════════════════════════════════════════ */
.demo-zone {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.demo-zone-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px;
  background: rgba(99,102,241,.06);
  border: 1px solid rgba(99,102,241,.15);
  border-radius: 14px;
}

.demo-zone-icon { font-size: 2rem; }
.demo-zone-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.demo-zone-desc { font-size: .82rem; color: var(--muted); line-height: 1.5; }

.demo-actions { display: flex; flex-direction: column; gap: 12px; }

.demo-action-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  transition: border-color .2s, background .2s;
}
.demo-action-card:hover { border-color: var(--border-hover); background: rgba(255,255,255,.05); }
.demo-seed:hover { border-color: rgba(99,102,241,.4); }
.demo-clear:hover { border-color: rgba(244,63,94,.3); }

.dac-icon { font-size: 1.8rem; flex-shrink: 0; }

.dac-body { flex: 1; }
.dac-title { font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.dac-desc { font-size: .78rem; color: var(--muted); line-height: 1.5; }

.dac-btn { flex-shrink: 0; min-width: 140px; }

/* Danger button */
.btn-danger {
  background: rgba(244,63,94,.15);
  color: #f87171;
  border: 1px solid rgba(244,63,94,.3);
  padding: 10px 20px;
  border-radius: 10px;
  font-family: inherit;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-danger:hover {
  background: rgba(244,63,94,.25);
  border-color: rgba(244,63,94,.5);
  color: #fca5a5;
}
.btn-danger:active { transform: scale(.97); }
.btn-danger:disabled { opacity: .5; cursor: not-allowed; }

/* Demo feedback */
.demo-feedback {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: .85rem;
  font-weight: 500;
  line-height: 1.5;
  animation: fadeIn .3s ease;
}
.demo-feedback.fb-success {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.2);
  color: #6ee7b7;
}
.demo-feedback.fb-error {
  background: rgba(244,63,94,.1);
  border: 1px solid rgba(244,63,94,.2);
  color: #fca5a5;
}

/* Modal danger */
.modal-danger-card { text-align: center; max-width: 420px; }
.modal-danger-icon { font-size: 3rem; margin-bottom: 10px; }

@media (max-width: 600px) {
  .demo-action-card { flex-direction: column; align-items: flex-start; }
  .dac-btn { width: 100%; }
}


/* ── Modal Overlay (generic) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none; }
.modal-danger-card { text-align: center; max-width: 420px; width: 100%; }
.modal-danger-icon { font-size: 3rem; margin-bottom: 10px; }

/* ═══════════════════════════════════════════════
   TELEGRAM WIZARD & STATUS PANEL
═══════════════════════════════════════════════ */

/* ── Button utilities ── */
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
}
.btn-link:hover { color: var(--accent-hover); }

.btn-danger {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: white;
  box-shadow: 0 2px 10px rgba(244,63,94,0.25);
  transition: all 0.2s;
}
.btn-danger:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

/* ── Status Panel (in settings tab) ── */
.tg-status-panel {
  text-align: center;
}

.tg-state {
  animation: viewEnter 0.3s ease-out;
}

.tg-state-icon {
  margin: 8px auto 16px;
  opacity: 0.8;
}
.tg-state-icon.tg-state-off {
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.tg-state-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.tg-state-desc {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.5;
  max-width: 360px;
  margin: 0 auto 20px;
}

.tg-features {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 auto 24px;
  max-width: 280px;
}

.tg-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-align: left;
}
.tg-feature span {
  font-size: 1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.tg-connect-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 0.9rem;
  gap: 0;
}

.tg-advanced-toggle {
  display: block;
  margin: 12px auto 0;
}

.tg-advanced-form {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: left;
}

/* ── Connected State ── */
.tg-connected-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: rgba(41, 182, 246, 0.06);
  border: 1px solid rgba(41, 182, 246, 0.15);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}

.tg-connected-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(41, 182, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tg-connected-info {
  text-align: left;
}

.tg-connected-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tg-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
}

.tg-bot-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

.tg-connected-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
}

.tg-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 16px;
  font-size: 0.84rem;
}
.tg-detail-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.tg-detail-label {
  color: var(--muted);
  font-weight: 500;
}

.tg-detail-value {
  color: var(--text);
  font-weight: 600;
}

.tg-detail-value.tg-active {
  color: #10b981;
}

.tg-bot-link {
  color: var(--accent) !important;
  text-decoration: none;
  transition: color 0.15s;
}
.tg-bot-link:hover { color: var(--accent-hover) !important; }

.tg-connected-actions {
  display: flex;
  justify-content: center;
}

.tg-disconnect-btn {
  color: var(--danger) !important;
  border-color: rgba(244, 63, 94, 0.2) !important;
}
.tg-disconnect-btn:hover {
  background: rgba(244, 63, 94, 0.08) !important;
  border-color: rgba(244, 63, 94, 0.4) !important;
}

/* ── Wizard Modal ── */
.tg-wizard-card {
  max-width: 520px;
  width: 100%;
  position: relative;
  padding: 28px 28px 24px;
}

.tg-wizard-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-family: inherit;
}
.tg-wizard-close:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text);
}

/* ── Stepper ── */
.tg-wizard-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 28px;
}

.tg-step {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.4;
  transition: opacity 0.3s;
}
.tg-step.active { opacity: 1; }
.tg-step.done { opacity: 0.7; }

.tg-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px solid rgba(255,255,255,0.15);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.3s;
}

.tg-step.active .tg-step-num {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 0 12px var(--accent-glow);
}

.tg-step.done .tg-step-num {
  background: #10b981;
  border-color: #10b981;
  color: white;
}

.tg-step-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}
.tg-step.active .tg-step-label { color: var(--text); }

.tg-step-line {
  width: 40px;
  height: 2px;
  background: rgba(255,255,255,0.08);
  margin: 0 8px;
  border-radius: 1px;
  transition: background 0.3s;
}
.tg-step-line.done { background: #10b981; }

/* ── Wizard Panels ── */
.tg-wizard-panel {
  text-align: center;
  animation: wizPanelIn 0.35s ease-out;
}

@keyframes wizPanelIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.tg-wiz-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}

.tg-wiz-icon-success {
  animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.tg-wizard-panel h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.tg-wiz-desc {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

/* ── Instructions ── */
.tg-wiz-instructions,
.tg-wiz-connect-box {
  text-align: left;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.tg-instruction,
.tg-wiz-connect-instruction {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.tg-instruction:not(:last-child),
.tg-wiz-connect-instruction:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.tg-inst-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.tg-instruction code,
.tg-wiz-connect-instruction code {
  background: rgba(99,102,241,0.12);
  color: var(--accent-hover);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Actions ── */
.tg-wiz-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

.tg-wiz-btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.88rem;
  text-decoration: none;
  gap: 0;
  margin: 0 auto 12px;
}

.tg-wiz-btn-next,
.tg-wiz-btn-back,
.tg-wiz-btn-skip {
  padding: 10px 20px;
  font-size: 0.84rem;
}

/* ── Token Feedback ── */
.tg-token-feedback {
  font-size: 0.8rem;
  margin-top: 6px;
  min-height: 20px;
  transition: all 0.2s;
}
.tg-token-feedback.tg-valid {
  color: #10b981;
}
.tg-token-feedback.tg-invalid {
  color: #f43f5e;
}

/* ── Spinner ── */
.tg-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Waiting / Polling ── */
.tg-wiz-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 0;
  font-size: 0.84rem;
  color: var(--muted);
  animation: pulse 2s infinite;
}

.tg-wiz-waiting code {
  background: rgba(99,102,241,0.12);
  color: var(--accent-hover);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── Success State ── */
.tg-wiz-success {
  animation: wizPanelIn 0.35s ease-out;
  padding: 16px 0;
}

.tg-success-check {
  margin-bottom: 16px;
}

.tg-check-anim {
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: drawCheck 0.6s ease-out 0.2s forwards;
}

@keyframes drawCheck {
  to { stroke-dashoffset: 0; }
}

.tg-wiz-success h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

/* ── Light mode overrides ── */
[data-theme="light"] .tg-connected-header {
  background: rgba(41, 182, 246, 0.04);
  border-color: rgba(41, 182, 246, 0.12);
}

[data-theme="light"] .tg-wiz-instructions,
[data-theme="light"] .tg-wiz-connect-box {
  background: rgba(0,0,0,0.02);
  border-color: rgba(100,116,139,0.12);
}

[data-theme="light"] .tg-wizard-card {
  background: #fff;
}

[data-theme="light"] .tg-step-num {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
}

[data-theme="light"] .tg-instruction,
[data-theme="light"] .tg-wiz-connect-instruction {
  border-color: rgba(0,0,0,0.06);
}

[data-theme="light"] .tg-spinner {
  border-color: rgba(0,0,0,0.1);
  border-top-color: var(--accent);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .tg-wizard-card { padding: 20px 16px 18px; }
  .tg-step-label { display: none; }
  .tg-step-line { width: 28px; }
  .tg-wiz-actions { flex-direction: column; }
}

/* ═══════════════════════════════════════════════
   WHATSAPP OVERRIDES (green theme)
═══════════════════════════════════════════════ */

.wa-connect-btn {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  box-shadow: 0 2px 10px rgba(37,211,102,0.25) !important;
}
.wa-connect-btn:hover {
  box-shadow: 0 4px 16px rgba(37,211,102,0.35) !important;
}

.wa-btn-main {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  box-shadow: 0 2px 10px rgba(37,211,102,0.25) !important;
}
.wa-btn-main:hover {
  box-shadow: 0 4px 16px rgba(37,211,102,0.35) !important;
}

.wa-connected-header {
  background: rgba(37,211,102,0.06) !important;
  border-color: rgba(37,211,102,0.15) !important;
}

.wa-connected-icon {
  background: rgba(37,211,102,0.1) !important;
}

.wa-badge {
  color: #25d366 !important;
}

.wa-pulse {
  background: #25d366 !important;
}

@keyframes waPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(37,211,102,0.4); }
  50% { opacity: 0.8; box-shadow: 0 0 0 6px rgba(37,211,102,0); }
}
.wa-pulse { animation: waPulse 2s infinite; }

.wa-step.active .tg-step-num {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  border-color: #25d366 !important;
  box-shadow: 0 0 12px rgba(37,211,102,0.25) !important;
}

.wa-step.done .tg-step-num {
  background: #25d366 !important;
  border-color: #25d366 !important;
}

[data-theme="light"] .wa-connected-header {
  background: rgba(37,211,102,0.04) !important;
  border-color: rgba(37,211,102,0.12) !important;
}

/* Caja del número central destacado */
.wa-central-box {
  background: linear-gradient(135deg, rgba(37,211,102,0.08), rgba(18,140,126,0.06));
  border: 1px solid rgba(37,211,102,0.25);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 0 0 16px;
  text-align: center;
}

.wa-central-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(37,211,102,0.8);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.wa-central-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.wa-central-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: #25d366;
  letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 20px rgba(37,211,102,0.25);
}

.wa-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37,211,102,0.1);
  border: 1px solid rgba(37,211,102,0.25);
  color: rgba(37,211,102,0.8);
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.wa-copy-btn:hover {
  background: rgba(37,211,102,0.18);
  border-color: rgba(37,211,102,0.4);
  color: #25d366;
  transform: scale(1.03);
}

.wa-central-hint {
  font-size: 0.79rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Instrucciones paso a paso del sandbox */
.wa-sandbox-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
  text-align: left;
}

.wa-sandbox-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.wa-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(37,211,102,0.15);
  border: 1px solid rgba(37,211,102,0.3);
  color: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.wa-join-code {
  background: rgba(37,211,102,0.12);
  color: #25d366;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: monospace;
  border: 1px solid rgba(37,211,102,0.2);
}



/* Botón iniciar chat */
.wa-start-chat-btn {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  box-shadow: 0 4px 18px rgba(37,211,102,0.3) !important;
  color: #fff !important;
  text-decoration: none !important;
  width: 100%;
  font-size: 0.95rem !important;
  padding: 14px 24px !important;
  border-radius: var(--radius-md) !important;
  transition: all 0.25s !important;
}
.wa-start-chat-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 24px rgba(37,211,102,0.45) !important;
}



/* ═══════════════════════════════════════════════
   GOOGLE CALENDAR — Integración
═══════════════════════════════════════════════ */

/* Botón de conexión con colores de Google */
.gcal-connect-btn {
  background: linear-gradient(135deg, #4285F4 0%, #34A853 50%, #FBBC05 75%, #EA4335 100%) !important;
  background-size: 200% 200% !important;
  animation: gcalGradient 4s ease infinite !important;
  border: none !important;
  color: #fff !important;
  font-weight: 700 !important;
  padding: 14px 28px !important;
  font-size: 1rem !important;
}

.gcal-connect-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(66,133,244,0.5) !important;
}

.gcal-connect-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none !important;
}

@keyframes gcalGradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Estado conectado */
.gcal-connected-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(66,133,244,0.08);
  border: 1px solid rgba(66,133,244,0.2);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}

.gcal-connected-icon {
  width: 52px;
  height: 52px;
  background: rgba(66,133,244,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gcal-badge {
  background: rgba(66,133,244,0.15) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(66,133,244,0.3) !important;
}

.gcal-pulse {
  background: #4285F4 !important;
}

/* Fila de acciones (sync + import) */
.gcal-action-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.gcal-action-btn {
  flex: 1;
  min-width: 140px;
  padding: 11px 16px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  border-radius: 12px !important;
  transition: all 0.2s !important;
}

.gcal-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* Mensaje de estado del sync */
.gcal-sync-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.4;
}

.gcal-sync-ok {
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.25);
  color: #6ee7b7;
}

.gcal-sync-error {
  background: rgba(244,63,94,0.1);
  border: 1px solid rgba(244,63,94,0.25);
  color: #fda4af;
}

/* Mensaje sin credenciales */
.gcal-no-config {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  color: #fcd34d;
  font-size: 0.83rem;
  font-weight: 500;
}

/* Light theme overrides */
[data-theme="light"] .gcal-connected-header {
  background: rgba(66,133,244,0.05) !important;
  border-color: rgba(66,133,244,0.15) !important;
}

[data-theme="light"] .gcal-badge {
  background: rgba(66,133,244,0.1) !important;
  color: #1a73e8 !important;
  border-color: rgba(66,133,244,0.25) !important;
}
