/**
 * Trendi Joa Digital - Web Ops Theme v3.0
 * Dark Luxury Palette: Púrpuras, Magentas, Cians y Esmeraldas
 * Optimized for Jhoana & Carlos Operations
 */

:root {
  --bg-main: #0a0614;
  --bg-card: #130c24;
  --bg-card-hover: #1b1233;
  --bg-input: #1d1438;
  --border-color: rgba(163, 112, 255, 0.15);
  --border-color-hover: rgba(163, 112, 255, 0.35);

  --accent-primary: #a370ff;
  --accent-magenta: #f771ff;
  --accent-purple-deep: #811990;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #ef4444;

  --user-jhoana: #a370ff;
  --user-carlos: #06b6d4;

  --text-primary: #ffffff;
  --text-secondary: #c4b5fd;
  --text-muted: #8b7ca6;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px rgba(163, 112, 255, 0.25);
  --transition-fast: 0.18s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body.trendi-theme {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ================= TOAST NOTIFICATIONS ================= */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  color: #fff;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  animation: slideInToast 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast.success { border-color: var(--accent-emerald); }
.toast.error { border-color: var(--accent-rose); }
.toast.warning { border-color: var(--accent-amber); }
.toast.info { border-color: var(--accent-cyan); }

@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ================= AUTHENTICATION SCREEN ================= */
.login-screen-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top center, #241445 0%, #0a0614 70%);
  padding: 1.5rem;
}
.login-card-container {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  padding: 2.5rem 2rem;
}

.login-brand-header {
  text-align: center;
  margin-bottom: 2rem;
}
.brand-badge-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-magenta));
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  margin-bottom: 1rem;
  box-shadow: 0 4px 15px rgba(247, 113, 255, 0.35);
}
.login-brand-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.login-brand-title strong {
  color: var(--accent-magenta);
}
.login-brand-tagline {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin-top: 0.25rem;
}

/* ==========================================================================
   SISTEMA DE NAVEGACIÓN TOTALMENTE SEPARADO (DESKTOP vs MOBILE)
   ========================================================================== */

.app-top-nav-system {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #0b0716;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  width: 100%;
}

/* --------------------------------------------------------------------------
   1. EXCLUSIVO PARA ORDENADOR / PC (Pantallas mayores a 900px)
   -------------------------------------------------------------------------- */
@media (min-width: 901px) {
  /* BARRA 1: SUPERIOR */
  .nav-bar-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.65rem 2rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    width: 100% !important;
  }
  .nav-brand-container {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    cursor: pointer !important;
  }
  .nav-right-actions {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    margin-left: auto !important;
  }
  
  /* BARRA 2: INFERIOR */
  .nav-bar-bottom {
    display: flex !important;
    align-items: center !important;
    padding: 0.4rem 2rem !important;
    background: #120d22 !important;
    width: 100% !important;
  }
  .main-tabs-nav {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    width: 100% !important;
  }
  .tab-nav-btn {
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-muted) !important;
    padding: 0.45rem 0.95rem !important;
    border-radius: var(--radius-full) !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    cursor: pointer !important;
    transition: var(--transition-fast) !important;
    white-space: nowrap !important;
  }
  .tab-nav-btn:hover {
    color: #fff !important;
    background: rgba(163, 112, 255, 0.12) !important;
    border-color: rgba(163, 112, 255, 0.25) !important;
  }
  .tab-nav-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), #811990) !important;
    color: #fff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 10px rgba(163, 112, 255, 0.35) !important;
    border-color: transparent !important;
  }
}

/* --------------------------------------------------------------------------
   2. EXCLUSIVO PARA MÓVIL / CELULAR (Pantallas de 900px o menos)
   -------------------------------------------------------------------------- */
/* ==========================================================================
   2. REGLAS EXCLUSIVAS PARA MÓVIL / CELULAR (max-width: 900px)
   ========================================================================== */
@media (max-width: 900px) {
  /* BARRA 1 SUPERIOR MÓVIL */
  .nav-bar-top {
    padding: 0.55rem 0.85rem !important;
    gap: 0.4rem !important;
  }
  .nav-brand-container {
    gap: 0.45rem !important;
  }
  .brand-logo-icon {
    width: 28px !important;
    height: 28px !important;
    border-radius: 6px !important;
  }
  .brand-logo-icon svg {
    width: 17px !important;
    height: 17px !important;
  }
  .app-name {
    font-size: 0.98rem !important;
  }
  .app-sub {
    font-size: 0.58rem !important;
    letter-spacing: 0.05em !important;
  }

  .nav-right-actions {
    gap: 0.35rem !important;
  }
  .nav-right-actions .btn-nuevo-proyecto {
    display: none !important; /* Ahorra espacio para que nada se corte */
  }
  .nav-right-actions .btn-sm {
    padding: 0.3rem 0.55rem !important;
    font-size: 0.72rem !important;
  }
  .user-name-mini {
    display: none !important;
  }
  .user-pill-selector {
    padding: 0.2rem !important;
    background: transparent !important;
    border: none !important;
  }
  .user-avatar-mini {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
  }

  /* BARRA 2 INFERIOR MÓVIL (PESTAÑAS CON SCROLL PERFECTO) */
  .nav-bar-bottom {
    padding: 0.3rem 0.5rem !important;
    background: #110c22 !important;
    border-bottom: 1px solid rgba(163, 112, 255, 0.15) !important;
  }
  .main-tabs-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.35rem !important;
    width: 100% !important;
    padding: 0.15rem 0.25rem !important;
    overflow-x: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }
  .main-tabs-nav::-webkit-scrollbar {
    display: none !important;
  }
  .tab-nav-btn {
    padding: 0.4rem 0.75rem !important;
    font-size: 0.75rem !important;
    border-radius: var(--radius-full) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    color: #c4b5fd !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
  }
  .tab-nav-btn.active {
    background: linear-gradient(135deg, var(--accent-primary), #811990) !important;
    color: #fff !important;
    border-color: var(--accent-magenta) !important;
    font-weight: 700 !important;
  }

  /* BOTONES DEL HERO EN MÓVIL */
  .hero-actions-wrap {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.5rem !important;
    margin-top: 1rem !important;
  }
  .hero-actions-wrap .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .dashboard-hero-card {
    padding: 1.25rem !important;
  }
  .hero-greeting {
    font-size: 1.45rem !important;
  }
}

/* ================= COMMON UI ELEMENTS ================= */
.app-main-content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
}
.content-view {
  display: none;
  animation: fadeInView 0.2s ease;
}
.content-view.active {
  display: block;
}

@keyframes fadeInView {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-card);
}
.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
}
.section-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

.view-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.view-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
}
.view-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-magenta));
  color: #fff;
  box-shadow: 0 4px 15px rgba(163, 112, 255, 0.35);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(247, 113, 255, 0.4);
}
.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
}
.btn-secondary:hover {
  background: rgba(163, 112, 255, 0.15);
  border-color: var(--accent-primary);
}
.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
}
.btn-block { width: 100%; }
.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem;
  color: #fff;
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}
.form-input:focus {
  border-color: var(--accent-magenta);
  box-shadow: 0 0 10px rgba(247, 113, 255, 0.2);
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* Filter Pills */
.filter-pill-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.filter-pill {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}
.filter-pill:hover {
  color: #fff;
  border-color: var(--accent-primary);
}
.filter-pill.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}
.filter-pill.pill-jhoana.active {
  background: var(--accent-magenta);
  border-color: var(--accent-magenta);
}
.filter-pill.pill-carlos.active {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.pill-counter {
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 800;
}
.pill-warning { background: var(--accent-amber); color: #000; }

/* ================= VIEW 1: DASHBOARD ================= */
.dashboard-hero-card {
  background: linear-gradient(135deg, rgba(163, 112, 255, 0.15) 0%, rgba(247, 113, 255, 0.08) 100%), var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}
.hero-date-badge {
  display: inline-block;
  background: rgba(163, 112, 255, 0.2);
  color: var(--accent-magenta);
  border: 1px solid rgba(247, 113, 255, 0.3);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.hero-greeting {
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
}
.hero-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}
.hero-actions-wrap {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition-fast);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
}
.stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.stat-number {
  display: block;
  font-size: 1.65rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
}
.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.dashboard-split-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 992px) {
  .dashboard-split-grid { grid-template-columns: 1fr; }
}

/* Tasks Agenda List */
.task-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.task-item-row {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: var(--transition-fast);
}
.task-item-row:hover {
  border-color: var(--accent-primary);
  transform: translateX(2px);
}
.task-item-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}
.task-checkbox-custom {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}
.task-checkbox-custom.completed {
  background: var(--accent-emerald);
  border-color: var(--accent-emerald);
  color: #fff;
}
.task-title-text {
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
}
.task-title-text.completed {
  text-decoration: line-through;
  opacity: 0.5;
}
.task-meta-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.15rem;
}

/* Category & Assignee Badges */
.badge-cat {
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.badge-cat-cliente { background: rgba(163, 112, 255, 0.15); color: #c4b5fd; }
.badge-cat-admin { background: rgba(6, 182, 212, 0.15); color: #67e8f9; }
.badge-cat-interna { background: rgba(247, 113, 255, 0.15); color: #f771ff; }

.badge-user-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}
.badge-user-jhoana { background: rgba(247, 113, 255, 0.2); color: #f771ff; border: 1px solid rgba(247,113,255,0.4); }
.badge-user-carlos { background: rgba(6, 182, 212, 0.2); color: #06b6d4; border: 1px solid rgba(6,182,212,0.4); }

.user-avatar-tiny {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.62rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

/* ================= VIEW 2: MONTHLY CALENDAR ================= */
.calendar-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.calendar-nav-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.calendar-month-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  min-width: 170px;
  text-align: center;
}
.calendar-filters-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.calendar-container {
  padding: 1.25rem;
  overflow: hidden;
}
.calendar-weekdays-row {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  text-align: center;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  width: 100%;
}
.calendar-days-grid {
  display: grid !important;
  grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
}
.calendar-day-cell {
  min-height: 112px;
  min-width: 0 !important;
  overflow: hidden !important;
  background: rgba(24, 18, 44, 0.65);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}
.calendar-day-cell:hover {
  border-color: var(--accent-primary);
  background: rgba(163, 112, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.calendar-day-cell.other-month {
  opacity: 0.28;
  background: rgba(10, 6, 20, 0.4);
}
.calendar-day-cell.today {
  border-color: var(--accent-magenta);
  background: rgba(247, 113, 255, 0.08);
  box-shadow: inset 0 0 12px rgba(247, 113, 255, 0.15), 0 0 10px rgba(247, 113, 255, 0.2);
}
.calendar-day-cell.selected {
  border-color: #fff !important;
  background: rgba(163, 112, 255, 0.22) !important;
  box-shadow: 0 0 16px rgba(163, 112, 255, 0.4);
}
.day-num-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.day-num {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
}
.calendar-day-cell.today .day-num {
  background: linear-gradient(135deg, var(--accent-magenta), #c026d3);
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  box-shadow: 0 2px 8px rgba(247, 113, 255, 0.45);
}
.day-tasks-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
  width: 100%;
}
.cal-task-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  width: 100%;
  box-sizing: border-box;
  line-height: 1.3;
}
.cal-task-pill.jhoana {
  background: rgba(247, 113, 255, 0.22);
  color: #FFAAE2;
  border-left: 3px solid #f771ff;
}
.cal-task-pill.carlos {
  background: rgba(6, 182, 212, 0.22);
  color: #67e8f9;
  border-left: 3px solid #06b6d4;
}
.cal-task-pill.completed {
  opacity: 0.4;
  text-decoration: line-through;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border-left-color: var(--text-muted);
}
/* ================= VIEW 3: CLIENTS MODULE ================= */
.toolbar-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 240px;
}
.search-input-wrap svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}
.search-input-wrap input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.55rem 0.85rem 0.55rem 2.3rem;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.clients-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.client-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}
.client-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}
.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.client-company-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.client-contact-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.client-info-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.85rem 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.client-info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.client-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-color);
}

/* ================= VIEW 4: PROJECTS GRID ================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition-fast);
}
.project-card:hover {
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}
.project-card-header {
  margin-bottom: 0.75rem;
}
.project-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
}
.project-client-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* 4-Item Readiness Checklist */
.readiness-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 1rem 0;
}
.readiness-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.2rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.readiness-item.ready {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: #34d399;
}
.readiness-item.in_progress {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--accent-amber);
  color: #fbbf24;
}

.stage-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}
.stage-pill.brief { background: rgba(163, 112, 255, 0.2); color: #c4b5fd; }
.stage-pill.diseño { background: rgba(247, 113, 255, 0.2); color: #f771ff; }
.stage-pill.desarrollo { background: rgba(6, 182, 212, 0.2); color: #67e8f9; }
.stage-pill.revision { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.stage-pill.entregado { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.stage-pill.cancelado { background: rgba(239, 68, 68, 0.2); color: #f87171; }

/* Progress Bar */
.progress-bar-bg {
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

/* ================= TABLES ================= */
.table-responsive-container {
  overflow-x: auto;
  padding: 0;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.data-table th {
  background: rgba(19, 12, 36, 0.95);
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}
.data-table td {
  padding: 0.85rem 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(163, 112, 255, 0.08);
  vertical-align: middle;
}
.data-table tr:hover td {
  background: rgba(163, 112, 255, 0.04);
}

/* ================= MODALS ================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeInModal 0.2s ease;
}
@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}
.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}
.modal-close-btn:hover { color: #fff; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

/* ================= DETAIL PANEL ================= */
.detail-header-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.btn-back-projects {
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  margin-bottom: 0.4rem;
  display: inline-block;
}
.btn-back-projects:hover { color: #fff; }
.detail-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}
.detail-client-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.detail-status-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.status-toggle-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}
.toggle-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.toggle-icon { font-size: 1.4rem; }
.toggle-info h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}
.toggle-info span {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.status-click-badge {
  display: block;
  text-align: center;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}

.detail-tabs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 768px) {
  .detail-tabs-grid { grid-template-columns: 1fr; }
}

.file-item-row {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.vault-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}


/* ==========================================================================
   COMPLETE MOBILE & TABLET RESPONSIVE SYSTEM (Trendi Joa Ops 2026)
   ========================================================================== */

@media (max-width: 1024px) {
  .app-top-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  .app-top-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }
  .main-tabs-nav {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.35rem 0.5rem;
    gap: 0.35rem;
    border-radius: var(--radius-md);
  }
  .main-tabs-nav::-webkit-scrollbar {
    display: none;
  }
  .tab-nav-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    flex-shrink: 0;
  }
}

@media (max-width: 768px) {
  .app-main-content {
    padding: 1rem 0.75rem;
  }
  
  .view-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }
  .view-title {
    font-size: 1.3rem;
  }
  .view-subtitle {
    font-size: 0.78rem;
  }

  .dashboard-hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.25rem 1rem;
    gap: 1rem;
  }
  .hero-greeting {
    font-size: 1.35rem;
  }
  .hero-actions-wrap {
    width: 100%;
    display: flex;
    gap: 0.5rem;
  }
  .hero-actions-wrap .btn {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.5rem 0.65rem;
  }

  .stats-overview-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }
  .stat-card {
    padding: 0.85rem 0.75rem;
    gap: 0.65rem;
  }
  .stat-icon-wrap {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }
  .stat-number {
    font-size: 1.35rem;
  }
  .stat-label {
    font-size: 0.68rem;
  }

  .dashboard-split-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .projects-cards-grid, .clients-grid, .vault-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .form-row-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .modal-overlay {
    padding: 0.5rem;
  }
  .modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    padding: 1.25rem 1rem;
    margin: 0;
    border-radius: var(--radius-md);
  }
  .modal-actions {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }
  .modal-actions .btn {
    width: 100%;
  }

  .calendar-header-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .calendar-nav-group, .calendar-filters-group {
    width: 100%;
    justify-content: space-between;
  }
  .calendar-day-cell {
    min-height: 65px !important;
    padding: 4px !important;
  }
  .calendar-weekdays-row {
    font-size: 0.65rem !important;
    padding: 0.4rem 0 !important;
  }

  .table-responsive-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
  }
  .data-table {
    min-width: 600px;
  }
  .data-table th, .data-table td {
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
  }

  .filter-pill-group {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 0.35rem;
    width: 100%;
  }
  .filter-pill {
    flex-shrink: 0;
    font-size: 0.72rem;
    padding: 0.3rem 0.65rem;
  }
}

@media (max-width: 480px) {
  .stats-overview-grid {
    grid-template-columns: 1fr;
  }
  .user-name-mini {
    display: none;
  }
  .user-pill-selector {
    padding: 0.25rem;
  }
  .nav-right-actions {
    gap: 0.35rem;
  }
  .nav-right-actions .btn span {
    font-size: 0.75rem;
  }
  .calendar-day-cell {
    min-height: 52px !important;
    padding: 2px !important;
  }
}


    :root {
      --bg-main: #080511;
      --bg-card: #110c22;
      --bg-input: #18122c;
      --border-color: rgba(163, 112, 255, 0.22);
      --border-glow: rgba(163, 112, 255, 0.45);
      --accent-primary: #a370ff;
      --accent-magenta: #f771ff;
      --accent-cyan: #06b6d4;
      --accent-green: #10b981;
      --accent-amber: #f59e0b;
      --accent-rose: #f43f5e;
      --text-main: #f1f5f9;
      --text-muted: #94a3b8;
      --radius-sm: 8px;
      --radius-md: 12px;
      --radius-lg: 20px;
      --radius-full: 9999px;
      --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      background-color: var(--bg-main);
      color: var(--text-main);
      font-size: 14px;
      line-height: 1.5;
      min-height: 100vh;
      display: flex;
      flex-direction: column;
    }

    /* SCROLLBAR */
    ::-webkit-scrollbar { width: 7px; height: 7px; }
    ::-webkit-scrollbar-track { background: #080511; }
    ::-webkit-scrollbar-thumb { background: rgba(163, 112, 255, 0.28); border-radius: 4px; }
    ::-webkit-scrollbar-thumb:hover { background: rgba(163, 112, 255, 0.5); }

    /* ==========================================================================
       SISTEMA DE NAVEGACIÓN PC OFICIAL (2 BARRAS FIJAS)
       ========================================================================== */
    .app-top-nav-system {
      position: sticky;
      top: 0;
      z-index: 1000;
      background: #0b0716;
      border-bottom: 1px solid var(--border-color);
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
      width: 100%;
    }

    /* BARRA 1: SUPERIOR */
    .nav-bar-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 0.55rem 1.8rem;
      border-bottom: 1px solid rgba(255, 255, 255, 0.07);
      width: 100%;
    }

    .nav-brand-container {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      cursor: pointer;
    }

    .brand-logo-icon {
      width: 36px;
      height: 36px;
      background: linear-gradient(135deg, var(--accent-primary), var(--accent-magenta));
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      box-shadow: 0 2px 10px rgba(163, 112, 255, 0.35);
    }

    .brand-title-wrap { display: flex; flex-direction: column; line-height: 1.2; }
    .app-name { font-size: 1.18rem; font-weight: 800; color: #fff; letter-spacing: -0.01em; }
    .app-name strong { color: var(--accent-magenta); }
    .app-sub { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 700; }

    .nav-right-actions {
      display: flex;
      align-items: center;
      gap: 0.65rem;
      margin-left: auto;
    }

    /* CONMUTADOR DE USUARIO EN 1 CLIC */
    .user-pill-selector {
      display: flex;
      align-items: center;
      gap: 0.55rem;
      padding: 0.3rem 0.85rem 0.3rem 0.4rem;
      background: #18122b;
      border: 1px solid var(--border-color);
      border-radius: var(--radius-full);
      cursor: pointer;
      transition: var(--transition);
      user-select: none;
    }
    .user-pill-selector:hover { border-color: var(--accent-primary); background: rgba(163, 112, 255, 0.12); }
    .user-avatar-mini {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      background: var(--accent-cyan);
      color: #000;
      font-size: 0.75rem;
      font-weight: 800;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: var(--transition);
    }
    .user-name-mini { font-size: 0.82rem; font-weight: 700; color: #fff; white-space: nowrap; }
    .user-role-badge { font-size: 0.65rem; color: var(--accent-cyan); font-weight: 700; margin-left: 0.2rem; }

    /* BARRA 2: PESTAÑAS */
    .nav-bar-bottom {
      display: flex;
      align-items: center;
      padding: 0.35rem 1.8rem;
      background: #120d24;
      width: 100%;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .nav-bar-bottom::-webkit-scrollbar { display: none; }

    .main-tabs-nav {
      display: flex;
      align-items: center;
      gap: 0.4rem;
      width: 100%;
    }

    .tab-nav-btn {
      background: transparent;
      border: 1px solid transparent;
      color: var(--text-muted);
      padding: 0.42rem 0.85rem;
      border-radius: var(--radius-full);
      font-size: 0.8rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.45rem;
      cursor: pointer;
      transition: var(--transition);
      white-space: nowrap;
      font-family: inherit;
    }
    .tab-nav-btn:hover {
      color: #fff;
      background: rgba(163, 112, 255, 0.12);
      border-color: rgba(163, 112, 255, 0.25);
    }
    .tab-nav-btn.active {
      background: linear-gradient(135deg, var(--accent-primary), #811990);
      color: #fff;
      font-weight: 700;
      box-shadow: 0 2px 10px rgba(163, 112, 255, 0.35);
      border-color: transparent;
    }

    .pill-counter {
      font-size: 0.68rem;
      font-weight: 800;
      padding: 0.12rem 0.45rem;
      border-radius: var(--radius-full);
      background: rgba(255, 255, 255, 0.12);
      color: #fff;
      min-width: 18px;
      text-align: center;
    }
    .pill-cyan { background: rgba(6, 182, 212, 0.25); color: var(--accent-cyan); border: 1px solid rgba(6, 182, 212, 0.4); }
    .pill-magenta { background: rgba(247, 113, 255, 0.25); color: var(--accent-magenta); border: 1px solid rgba(247, 113, 255, 0.4); }
    .pill-warning { background: rgba(245, 158, 11, 0.25); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.4); }

    /* ==========================================================================
       CONTENIDO PRINCIPAL
       ========================================================================== */
    .app-main-content {
      flex: 1;
      padding: 1.5rem 1.8rem 3rem 1.8rem;
      max-width: 1440px;
      width: 100%;
      margin: 0 auto;
    }

    .content-view {
      display: none;
      animation: viewFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .content-view.active { display: block; }
    @keyframes viewFade {
      from { opacity: 0; transform: translateY(6px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 1.25rem;
      position: relative;
    }

    .btn {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.5rem 1.05rem;
      border-radius: var(--radius-md);
      font-size: 0.82rem;
      font-weight: 700;
      cursor: pointer;
      border: none;
      transition: var(--transition);
      font-family: inherit;
      text-decoration: none;
    }
    .btn-sm { padding: 0.35rem 0.75rem; font-size: 0.75rem; border-radius: var(--radius-sm); }
    .btn-primary { background: linear-gradient(135deg, var(--accent-primary), #811990); color: #fff; }
    .btn-primary:hover { box-shadow: 0 4px 15px rgba(163, 112, 255, 0.4); transform: translateY(-1px); }
    .btn-secondary { background: transparent; border: 1px solid var(--border-color); color: var(--text-main); }
    .btn-secondary:hover { border-color: var(--accent-primary); background: rgba(163, 112, 255, 0.1); }
    .btn-success { background: rgba(16, 185, 129, 0.18); border: 1px solid #10b981; color: #10b981; }
    .btn-success:hover { background: #10b981; color: #000; }
    .btn-danger { background: rgba(244, 63, 94, 0.15); border: 1px solid #f43f5e; color: #f43f5e; }
    .btn-danger:hover { background: #f43f5e; color: #fff; }

    .form-group { margin-bottom: 1rem; }
    .form-group label { display: block; font-size: 0.76rem; font-weight: 700; color: var(--text-muted); margin-bottom: 0.35rem; text-transform: uppercase; letter-spacing: 0.05em; }
    .form-input {
      width: 100%;
      background: var(--bg-input);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-sm);
      color: #fff;
      padding: 0.6rem 0.85rem;
      font-size: 0.85rem;
      font-family: inherit;
      outline: none;
      transition: var(--transition);
    }
    .form-input:focus { border-color: var(--accent-primary); box-shadow: 0 0 10px rgba(163, 112, 255, 0.25); }
    .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

    /* DRAG & DROP FILE UPLOAD BOX */
    .dropzone-box {
      border: 2px dashed rgba(163, 112, 255, 0.35);
      background: rgba(18, 12, 38, 0.5);
      border-radius: var(--radius-md);
      padding: 1.25rem;
      text-align: center;
      cursor: pointer;
      transition: var(--transition);
    }
    .dropzone-box:hover {
      border-color: var(--accent-magenta);
      background: rgba(163, 112, 255, 0.08);
    }

    /* STATS ROW */
    .stats-grid-row {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 1rem;
      margin-bottom: 1.5rem;
    }
    .kpi-card {
      background: var(--bg-card);
      border: 1px solid var(--border-color);
      border-radius: var(--radius-md);
      padding: 1rem 1.25rem;
      display: flex;
      align-items: center;
      gap: 1rem;
    }
    .kpi-icon {
      width: 44px;
      height: 44px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 1.25rem;
      flex-shrink: 0;
    }
    .kpi-val { font-size: 1.65rem; font-weight: 800; color: #fff; line-height: 1; }
    .kpi-title { font-size: 0.72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

    /* TOAST */
    #toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
    .toast-msg {
      background: #18122c;
      border: 1px solid var(--accent-primary);
      color: #fff;
      padding: 0.65rem 1.1rem;
      border-radius: var(--radius-sm);
      font-size: 0.82rem;
      font-weight: 600;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
      animation: toastIn 0.25s ease;
    }
    @keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

    /* MODAL */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(8, 5, 17, 0.85);
      backdrop-filter: blur(8px);
      z-index: 2000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: 1rem;
    }
    .modal-overlay.open { display: flex; }
    .modal-card {
      background: var(--bg-card);
      border: 1px solid var(--border-glow);
      border-radius: var(--radius-lg);
      width: 100%;
      max-width: 520px;
      padding: 1.5rem;
      box-shadow: 0 20px 50px rgba(0,0,0,0.8), 0 0 30px rgba(163, 112, 255, 0.2);
    }
    .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.75rem; }
    .modal-title { font-size: 1.1rem; font-weight: 800; color: #fff; }
    .modal-close-btn { background: transparent; border: none; color: var(--text-muted); font-size: 1.3rem; cursor: pointer; }
    .modal-close-btn:hover { color: #fff; }

    /* DROPZONE LOCAL FILE UPLOADER */
    .dropzone-box {
      border: 2px dashed rgba(163, 112, 255, 0.45);
      background: rgba(18, 12, 38, 0.65);
      border-radius: var(--radius-md);
      padding: 1.6rem 1.25rem;
      text-align: center;
      cursor: pointer;
      transition: var(--transition);
      user-select: none;
    }
    .dropzone-box:hover {
      border-color: var(--accent-magenta);
      background: rgba(224, 62, 153, 0.12);
      box-shadow: 0 0 20px rgba(224, 62, 153, 0.25);
    }

    /* ==========================================================================
       ESTILOS DEL GESTOR WEB & PORTAFOLIO (FOTO 2 EXACTA & CARRUSELES)
       ========================================================================== */
    
    /* 1. TARJETA ESTILO NAVEGADOR EXACTA DE LA FOTO 2 */
    .tj-portfolio-grid {
      display: grid !important;
      grid-template-columns: repeat(3, 1fr) !important;
      gap: 24px !important;
      width: 100% !important;
      margin-top: 20px !important;
    }
    @media (max-width: 1024px) {
      .tj-portfolio-grid { grid-template-columns: repeat(2, 1fr) !important; }
    }
    @media (max-width: 768px) {
      .tj-portfolio-grid { grid-template-columns: 1fr !important; }
    }

    .tj-project-card {
      background: #190a28 !important;
      border: 1.5px solid rgba(157, 114, 231, 0.3) !important;
      border-radius: 22px !important;
      overflow: hidden !important;
      display: flex !important;
      flex-direction: column !important;
      box-sizing: border-box !important;
      transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
    }
    .tj-project-card:hover {
      transform: translateY(-6px) !important;
      border-color: #E03E99 !important;
      box-shadow: 0 16px 36px rgba(224, 62, 153, 0.25) !important;
    }

    .tj-browser-bar {
      background: #130720 !important;
      padding: 10px 16px !important;
      display: flex !important;
      align-items: center !important;
      gap: 10px !important;
      border-bottom: 1px solid rgba(157, 114, 231, 0.25) !important;
    }
    .tj-browser-dots { display: flex !important; gap: 6px !important; }
    .tj-browser-dots span { width: 10px !important; height: 10px !important; border-radius: 50% !important; }
    .dot-red { background: #FF5F56 !important; }
    .dot-yellow { background: #FFBD2E !important; }
    .dot-green { background: #27C93F !important; }

    .tj-browser-address {
      background: rgba(255, 255, 255, 0.06) !important;
      border-radius: 999px !important;
      padding: 4px 16px !important;
      font-family: 'Manrope', sans-serif !important;
      font-size: 13px !important;
      color: #C7B9DC !important;
      flex-grow: 1 !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
    }

    .tj-project-preview {
      aspect-ratio: 16 / 10 !important;
      width: 100% !important;
      background-size: cover !important;
      background-position: center !important;
      background-repeat: no-repeat !important;
      background-color: #0c0217 !important;
    }

    .tj-project-info {
      padding: 22px 20px !important;
      display: flex !important;
      flex-direction: column !important;
      flex-grow: 1 !important;
      gap: 10px !important;
      font-family: 'Manrope', sans-serif !important;
    }

    .tj-project-niche {
      font-size: 13px !important;
      font-weight: 800 !important;
      text-transform: uppercase !important;
      letter-spacing: 0.06em !important;
    }
    .niche-cya { color: #00E5FF !important; }
    .niche-mag { color: #FFAAE2 !important; }
    .niche-gld { color: #FFD68A !important; }
    .niche-pur { color: #CBA4FF !important; }
    .niche-grn { color: #10B981 !important; }
    .niche-rose { color: #FB7185 !important; }

    .tj-project-info h4 {
      font-size: 18px !important;
      font-weight: 800 !important;
      color: #FFFFFF !important;
      margin: 0 !important;
      line-height: 1.3 !important;
    }

    .tj-project-info p {
      font-size: 13.5px !important;
      line-height: 1.5 !important;
      color: #E2D9F3 !important;
      margin: 0 !important;
      flex-grow: 1 !important;
    }

    .tj-project-link-btn {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 8px !important;
      padding: 10px 20px !important;
      border-radius: 999px !important;
      background: rgba(255, 255, 255, 0.08) !important;
      border: 1px solid rgba(224, 62, 153, 0.4) !important;
      color: #FFAAE2 !important;
      font-size: 14px !important;
      font-weight: 700 !important;
      text-decoration: none !important;
      transition: all 0.25s ease !important;
      margin-top: 6px !important;
    }
    .tj-project-link-btn:hover {
      background: linear-gradient(135deg, #FF69B4 0%, #E03E99 50%, #945ACF 100%) !important;
      color: #FFFFFF !important;
      border-color: transparent !important;
      box-shadow: 0 6px 18px rgba(224, 62, 153, 0.4) !important;
    }

    /* FILTROS & PAGINACIÓN PARA SITIOS WEB */
    .tj-portfolio-filters {
      display: flex !important;
      justify-content: center !important;
      flex-wrap: wrap !important;
      gap: 10px !important;
      margin: 15px 0 !important;
    }
    .tj-filter-btn {
      padding: 8px 20px !important;
      border-radius: 999px !important;
      background-color: #190a28 !important;
      border: 1.5px solid rgba(157, 114, 231, 0.35) !important;
      color: #E2D9F3 !important;
      font-family: 'Manrope', sans-serif !important;
      font-size: 14px !important;
      font-weight: 700 !important;
      cursor: pointer !important;
      transition: all 0.25s ease !important;
    }
    .tj-filter-btn:hover {
      background-color: rgba(224, 62, 153, 0.2) !important;
      border-color: rgba(224, 62, 153, 0.6) !important;
      color: #FFFFFF !important;
    }
    .tj-filter-btn.active {
      background: linear-gradient(135deg, #FF69B4 0%, #E03E99 50%, #945ACF 100%) !important;
      border-color: transparent !important;
      color: #FFFFFF !important;
      box-shadow: 0 6px 20px rgba(224, 62, 153, 0.4) !important;
    }

    .tj-pagination-wrapper {
      display: flex !important;
      justify-content: center !important;
      align-items: center !important;
      gap: 10px !important;
      margin-top: 30px !important;
    }
    .tj-page-btn {
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      min-width: 44px !important;
      height: 44px !important;
      padding: 0 14px !important;
      border-radius: 50px !important;
      background: #190a28 !important;
      border: 1.5px solid rgba(157, 114, 231, 0.35) !important;
      color: #E2D9F3 !important;
      font-family: 'Manrope', sans-serif !important;
      font-size: 15px !important;
      font-weight: 800 !important;
      cursor: pointer !important;
      transition: all 0.3s ease !important;
    }
    .tj-page-btn:hover:not(:disabled) {
      background: rgba(224, 62, 153, 0.2) !important;
      border-color: #FF77E0 !important;
      color: #FFFFFF !important;
    }
    .tj-page-btn.active {
      background: linear-gradient(135deg, #FF69B4 0%, #E03E99 50%, #945ACF 100%) !important;
      border-color: transparent !important;
      color: #FFFFFF !important;
    }
    .tj-page-btn:disabled { opacity: 0.3; cursor: not-allowed !important; }

    /* 2. ESTILOS CARRUSEL DE LOGOS HD (SNIPPET 1) */
    .tj-marquee-slider {
      display: flex;
      overflow: hidden;
      user-select: none;
      mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
      -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
      padding: 1rem 0;
      width: 100%;
    }
    .tj-marquee-group {
      display: flex;
      align-items: center;
      gap: 2.5rem;
      flex-shrink: 0;
      min-width: 100%;
      animation: tjScrollInfinite 45s linear infinite;
      padding-right: 2.5rem;
    }
    .tj-marquee-slider:hover .tj-marquee-group { animation-play-state: paused; }
    @keyframes tjScrollInfinite { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

    .tj-zoom-logo {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 155px !important;
      min-width: 270px !important;
      padding: 1.2rem 1.8rem;
      border-radius: 24px;
      background: #FFFFFF !important;
      border: 2px solid rgba(224, 62, 153, 0.4);
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 18px rgba(224, 62, 153, 0.2);
    }
    .tj-zoom-logo:hover {
      transform: translateY(-6px) scale(1.03);
      border-color: #E03E99;
      box-shadow: 0 16px 40px rgba(224, 62, 153, 0.5);
    }
    .tj-zoom-logo img {
      max-height: 120px !important;
      max-width: 235px !important;
      width: 100%;
      height: auto;
      object-fit: contain;
      pointer-events: none;
    }

    /* 3. ESTILOS CARRUSEL DE TARJETAS (SNIPPET 2) */
    .tj-marquee-viewport {
      width: 100%;
      overflow: hidden;
      position: relative;
      padding: 1rem 0;
      -webkit-mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
      mask-image: linear-gradient(to right, transparent, black 8%, black 92%, transparent);
    }
    .tj-marquee-track {
      display: flex;
      width: max-content;
      animation: tjCardsScroll 48s linear infinite;
    }
    .tj-marquee-track:hover { animation-play-state: paused; }
    @keyframes tjCardsScroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

    .tj-marquee-set { display: flex; gap: 24px; padding-right: 24px; }
    .tj-card-item {
      width: 320px;
      flex-shrink: 0;
      border-radius: 18px;
      background: rgba(255, 255, 255, 0.04);
      border: 1px solid rgba(255, 255, 255, 0.12);
      padding: 12px;
      cursor: pointer;
      transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .tj-card-item:hover {
      transform: translateY(-6px);
      border-color: rgba(224, 62, 153, 0.6);
      background: rgba(224, 62, 153, 0.08);
      box-shadow: 0 16px 36px rgba(224, 62, 153, 0.22);
    }
    .tj-card-img-box {
      width: 100%;
      aspect-ratio: 16 / 10;
      border-radius: 12px;
      overflow: hidden;
      position: relative;
      background: #190a28;
    }
    .tj-card-img-box img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }
    .tj-card-hover-overlay {
      position: absolute;
      inset: 0;
      background: rgba(25, 10, 40, 0.65);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.3s ease;
      backdrop-filter: blur(2px);
    }
    .tj-card-item:hover .tj-card-hover-overlay { opacity: 1; }
    .tj-card-zoom-btn {
      font-family: 'Manrope', sans-serif;
      font-size: 15px;
      font-weight: 700;
      color: #ffffff;
      background: linear-gradient(135deg, #E03E99 0%, #945ACF 100%);
      padding: 8px 18px;
      border-radius: 50px;
      box-shadow: 0 8px 25px rgba(224, 62, 153, 0.45);
    }

    /* LIGHTBOX COMÚN */
    .tj-lightbox-modal {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 999999;
      align-items: center;
      justify-content: center;
    }
    .tj-lightbox-modal.is-open, .tj-lightbox-modal.show { display: flex; }
    .tj-lightbox-backdrop, .tj-lightbox-overlay {
      position: absolute;
      inset: 0;
      background: rgba(14, 5, 23, 0.94);
      backdrop-filter: blur(12px);
    }
    .tj-lightbox-container {
      position: relative;
      z-index: 2;
      max-width: 520px;
      width: 92%;
      background: #FFFFFF;
      border: 2px solid #E03E99;
      border-radius: 20px;
      padding: 16px;
      text-align: center;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(224, 62, 153, 0.35);
    }
    .tj-lightbox-card {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }
    .tj-lightbox-close {
      position: absolute;
      top: 10px;
      right: 12px;
      width: 32px;
      height: 32px;
      border-radius: 50%;
      background: rgba(0, 0, 0, 0.1);
      border: none;
      color: #190a28;
      font-size: 18px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
    }
    .tj-lightbox-close:hover { background: #E03E99; color: #fff; }
    .tj-lightbox-img-area img {
      max-height: 180px;
      max-width: 95%;
      object-fit: contain;
      margin: 10px 0;
    }
  


/* ==========================================================================
   TRENDI JOA MASTER OPS v4.0 - ADVANCED MODULES & MOBILE FLUID DESIGN
   ========================================================================== */

/* 1. Niche Badges */
.niche-cya { background: rgba(6, 182, 212, 0.15) !important; color: #06b6d4 !important; border: 1px solid rgba(6, 182, 212, 0.4) !important; }
.niche-mag { background: rgba(247, 113, 255, 0.15) !important; color: #f771ff !important; border: 1px solid rgba(247, 113, 255, 0.4) !important; }
.niche-gld { background: rgba(251, 191, 36, 0.15) !important; color: #fbbf24 !important; border: 1px solid rgba(251, 191, 36, 0.4) !important; }
.niche-pur { background: rgba(163, 112, 255, 0.15) !important; color: #a370ff !important; border: 1px solid rgba(163, 112, 255, 0.4) !important; }
.niche-grn { background: rgba(16, 185, 129, 0.15) !important; color: #10b981 !important; border: 1px solid rgba(16, 185, 129, 0.4) !important; }
.niche-rose { background: rgba(244, 63, 94, 0.15) !important; color: #f43f5e !important; border: 1px solid rgba(244, 63, 94, 0.4) !important; }

/* 2. Leads Module Styles */
.leads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
}
.lead-card:hover {
  border-color: rgba(163, 112, 255, 0.5);
  box-shadow: 0 8px 25px rgba(0,0,0,0.4);
  transform: translateY(-2px);
}
.lead-badge-hot {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.lead-badge-warm {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}
.lead-badge-cold {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
  border-radius: 9999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
}

/* 3. View Switcher Pills in Projects */
.view-mode-toggle-group {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 3px;
}
.btn-view-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-view-mode.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-magenta));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(163, 112, 255, 0.35);
}

/* 4. Dropzone & File Upload Box */
.dropzone-box {
  border: 2px dashed rgba(163, 112, 255, 0.4);
  border-radius: 12px;
  padding: 2rem 1.5rem;
  text-align: center;
  background: rgba(163, 112, 255, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
}
.dropzone-box:hover, .dropzone-box.drag-over {
  border-color: #a370ff;
  background: rgba(163, 112, 255, 0.1);
}

/* 5. Mobile Fluid Overrides */
@media (max-width: 768px) {
  /* 2x2 Readiness Strip on mobile instead of 4 squished columns */
  .readiness-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin: 0.85rem 0 !important;
  }
  .readiness-item {
    padding: 0.6rem 0.5rem !important;
    text-align: center !important;
    border-radius: 8px !important;
  }
  .readiness-item span {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
  }
  .readiness-item small {
    font-size: 0.7rem !important;
    margin-top: 2px !important;
  }

  /* Full-width comfortable tap buttons on mobile project cards */
  .project-card-footer {
    display: flex !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
    padding-top: 0.75rem !important;
    border-top: 1px solid var(--border-color) !important;
  }
  .project-card-footer-actions {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }
  .project-card-footer-actions .btn-espacio {
    flex: 1 !important;
    text-align: center !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.82rem !important;
    font-weight: 700 !important;
  }

  /* Slim Mobile Navigation */
  .nav-bar-top {
    padding: 0.4rem 0.75rem !important;
  }
  .nav-bar-bottom {
    padding: 0.25rem 0.5rem !important;
  }
  .tab-nav-btn {
    padding: 0.35rem 0.65rem !important;
    font-size: 0.72rem !important;
  }

  /* Project and Lead card layouts on mobile */
  .projects-grid, .leads-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  /* Filter bar wrap */
  .toolbar-filter-bar {
    padding: 0.75rem !important;
  }
}


/* ==========================================================================
   TRENDI JOA MASTER OPS v4.0 - LIVE CHATBOT & HUMAN TAKEOVER HUB
   ========================================================================== */

/* Sub-tabs */
.leads-subtabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 0.75rem;
  align-items: center;
}
.leads-subtab-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.leads-subtab-btn:hover {
  color: #fff;
  border-color: rgba(6, 182, 212, 0.4);
  background: rgba(6, 182, 212, 0.08);
}
.leads-subtab-btn.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(163, 112, 255, 0.15));
  border-color: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

/* Chat Hub Grid Layout */
.chat-hub-container {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 1.25rem;
  height: calc(100vh - 280px);
  min-height: 560px;
  max-height: 760px;
  box-sizing: border-box;
}

/* Sessions List Pane */
.chat-sessions-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.chat-sessions-header {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}
.chat-sessions-search {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.chat-sessions-search input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}
.chat-sessions-search input:focus {
  border-color: var(--accent-cyan);
}
.chat-sessions-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
}
.chat-session-item {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  position: relative;
  flex-shrink: 0;
}
.chat-session-item:hover {
  background: rgba(255, 255, 255, 0.03);
}
.chat-session-item.active {
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--accent-cyan);
}
.chat-session-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-session-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.chat-session-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.chat-session-snippet {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-session-badges {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  margin-top: 0.2rem;
}
.badge-mode-bot {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.35);
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.badge-mode-human {
  background: rgba(163, 112, 255, 0.2);
  color: #c084fc;
  border: 1px solid rgba(163, 112, 255, 0.45);
  border-radius: 9999px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Conversation Feed Pane */
.chat-feed-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.chat-feed-header {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.chat-feed-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chat-feed-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #a370ff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}
.chat-feed-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.chat-stream-box {
  flex: 1;
  min-height: 0;
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.15);
  scroll-behavior: smooth;
}

/* Custom Scrollbars for Chat */
.chat-sessions-list::-webkit-scrollbar,
.chat-stream-box::-webkit-scrollbar {
  width: 6px;
}
.chat-sessions-list::-webkit-scrollbar-track,
.chat-stream-box::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}
.chat-sessions-list::-webkit-scrollbar-thumb,
.chat-stream-box::-webkit-scrollbar-thumb {
  background: rgba(163, 112, 255, 0.35);
  border-radius: 4px;
}
.chat-sessions-list::-webkit-scrollbar-thumb:hover,
.chat-stream-box::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.6);
}

.chat-msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: fadeInMsg 0.2s ease-out;
  flex-shrink: 0;
}
@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-msg-row.user {
  align-self: flex-start;
}
.chat-msg-row.bot, .chat-msg-row.human {
  align-self: flex-end;
}
.chat-msg-bubble {
  padding: 0.75rem 1.05rem;
  border-radius: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg-row.user .chat-msg-bubble {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  border-bottom-left-radius: 3px;
}
.chat-msg-row.bot .chat-msg-bubble {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(163, 112, 255, 0.14));
  border: 1px solid rgba(6, 182, 212, 0.38);
  color: #f8fafc;
  border-bottom-right-radius: 3px;
}
.chat-msg-row.human .chat-msg-bubble {
  background: linear-gradient(135deg, rgba(163, 112, 255, 0.28), rgba(16, 185, 129, 0.18));
  border: 1px solid rgba(163, 112, 255, 0.55);
  color: #fff;
  border-bottom-right-radius: 3px;
}
.chat-msg-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.chat-msg-row.bot .chat-msg-meta, .chat-msg-row.human .chat-msg-meta {
  justify-content: flex-end;
}
.chat-input-area {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-shrink: 0;
}
.chat-input-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.chat-input-form input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  padding: 0.65rem 1.15rem;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s;
}
.chat-input-form input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}
.chat-takeover-alert {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Leads & Live Chat Responsive Architecture */
.leads-header-banner {
  background: linear-gradient(135deg, rgba(6,182,212,0.12), rgba(163,112,255,0.06));
  border: 1px solid rgba(6,182,212,0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.6rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.leads-status-badge {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(6,182,212,0.15);
  border: 1px solid var(--accent-cyan);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.leads-header-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin: 0.15rem 0;
}
.leads-header-sub {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}
.leads-header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Mobile Responsiveness for Chat Hub & Leads */
@media (max-width: 900px) {
  .leads-header-banner {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .leads-header-title {
    font-size: 1.15rem;
  }
  .leads-status-badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.45rem;
    letter-spacing: 0.04em;
  }
  .leads-header-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .leads-header-actions .btn {
    width: 100%;
    justify-content: center;
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
    text-align: center;
  }

  .leads-subtabs {
    display: flex;
    gap: 0.4rem;
    width: 100%;
  }
  .leads-subtab-btn {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.4rem;
    font-size: 0.75rem;
    justify-content: center;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  .chat-hub-container {
    display: flex !important;
    flex-direction: column !important;
    height: calc(100vh - 250px) !important;
    min-height: 480px !important;
    max-height: 75vh !important;
    width: 100% !important;
    gap: 0 !important;
  }
  .chat-sessions-pane {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .chat-feed-pane {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: 100% !important;
    display: none !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .chat-feed-pane.active-mobile {
    display: flex !important;
  }
  .chat-sessions-pane.hidden-mobile {
    display: none !important;
  }

  .chat-sessions-list {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  .chat-stream-box {
    flex: 1 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 1rem 0.85rem;
  }

  .chat-feed-header {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .chat-feed-user-info {
    width: 100%;
  }
  .chat-feed-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .chat-feed-actions .btn {
    flex: 1;
    min-width: 110px;
    font-size: 0.72rem;
    padding: 0.35rem 0.5rem;
    justify-content: center;
  }
  .chat-input-area {
    padding: 0.75rem 0.85rem;
  }
}

/* ==========================================================================
   OPS V4.2 LUXURY SIDEBAR & MOBILE SYSTEM
   ========================================================================== */
.app-sidebar-nav {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 72px;
  height: 100vh;
  background: rgba(12, 8, 25, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid rgba(163, 112, 255, 0.22);
  z-index: 1050;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  overflow: hidden;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
  user-select: none;
}

.app-sidebar-nav:hover,
.app-sidebar-nav.sidebar-expanded {
  width: 260px;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(163, 112, 255, 0.15);
}

.sidebar-brand {
  height: 72px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  cursor: pointer;
  flex-shrink: 0;
}

.sidebar-logo-wrap {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(163, 112, 255, 0.3);
  box-shadow: 0 2px 10px rgba(163, 112, 255, 0.25);
}

.sidebar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.app-sidebar-nav:hover .sidebar-brand-text,
.app-sidebar-nav.sidebar-expanded .sidebar-brand-text {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebar-app-name {
  font-size: 1.12rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.sidebar-app-sub {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.sidebar-nav-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-nav-list::-webkit-scrollbar { width: 4px; }
.sidebar-nav-list::-webkit-scrollbar-thumb { background: rgba(163,112,255,0.2); border-radius: 4px; }

.sidebar-nav-list .tab-nav-btn {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  position: relative;
  text-align: left;
}

.sidebar-nav-list .tab-nav-btn:hover {
  background: rgba(163, 112, 255, 0.12);
  color: #fff;
  border-color: rgba(163, 112, 255, 0.25);
}

.sidebar-nav-list .tab-nav-btn.active {
  background: linear-gradient(135deg, var(--accent-primary), #811990);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(163, 112, 255, 0.4);
  border-color: transparent;
}

.sidebar-icon-wrap {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}

.sidebar-label {
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  flex: 1;
}

.app-sidebar-nav:hover .sidebar-label,
.app-sidebar-nav.sidebar-expanded .sidebar-label {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebar-nav-list .pill-counter {
  margin-left: auto;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.12rem 0.48rem;
  border-radius: var(--radius-full);
}

.app-sidebar-nav:hover .sidebar-nav-list .pill-counter,
.app-sidebar-nav.sidebar-expanded .sidebar-nav-list .pill-counter {
  opacity: 1;
}

.sidebar-actions-strip {
  padding: 10px;
  display: flex;
  gap: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.btn-sidebar-action {
  flex: 1;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(163, 112, 255, 0.12);
  border: 1px solid rgba(163, 112, 255, 0.3);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.btn-sidebar-action:hover {
  background: rgba(163, 112, 255, 0.25);
  border-color: var(--accent-primary);
}

.btn-sidebar-action-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-magenta));
  border-color: transparent;
}

.sb-act-text {
  white-space: nowrap;
  display: none;
}

.app-sidebar-nav:hover .sb-act-text,
.app-sidebar-nav.sidebar-expanded .sb-act-text {
  display: inline;
}

.sidebar-footer {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.sidebar-user-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-user-card:hover {
  background: rgba(163, 112, 255, 0.12);
}

.sidebar-user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.app-sidebar-nav:hover .sidebar-user-details,
.app-sidebar-nav.sidebar-expanded .sidebar-user-details {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.sidebar-user-role {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 700;
}

.sidebar-logout-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-logout-btn:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: var(--accent-rose);
}

/* Calendar Event Enhancements */
.calendar-event-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  margin-top: 3px;
  background: linear-gradient(135deg, rgba(163, 112, 255, 0.25), rgba(247, 113, 255, 0.15));
  border-left: 3px solid var(--accent-magenta);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.calendar-event-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(163, 112, 255, 0.35);
}

.calendar-event-time {
  font-size: 0.62rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.35);
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--accent-cyan);
}

/* Overdue Task Highlight */
.task-item-row.task-overdue-border {
  border-color: rgba(244, 63, 94, 0.45) !important;
  background: rgba(244, 63, 94, 0.05) !important;
}
.task-item-row.task-overdue-border:hover {
  border-color: var(--accent-rose) !important;
}


/* ==========================================================================
   DOMAINS & RENEWALS MOBILE RESPONSIVE CARD SYSTEM
   ========================================================================== */
@media (max-width: 820px) {
  #view-renewals .view-header-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  #view-renewals .view-header-flex .btn-primary {
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0.6rem 1rem;
  }

  .renewals-card-wrapper,
  #view-renewals .table-responsive-container {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  table.data-table.renewals-table,
  #view-renewals table.data-table {
    display: block !important;
    width: 100% !important;
    border: none !important;
  }

  table.data-table.renewals-table thead,
  #view-renewals table.data-table thead {
    display: none !important;
  }

  table.data-table.renewals-table tbody,
  #view-renewals table.data-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
  }

  table.data-table.renewals-table tr.renewal-item-row,
  #view-renewals table.data-table tbody tr {
    display: flex !important;
    flex-direction: column !important;
    background: rgba(17, 12, 34, 0.95) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.15rem 1.1rem !important;
    gap: 0.65rem !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    transition: transform 0.2s ease, border-color 0.2s ease !important;
  }

  table.data-table.renewals-table tr.renewal-item-row:hover,
  #view-renewals table.data-table tbody tr:hover {
    border-color: var(--accent-primary) !important;
    transform: translateY(-2px) !important;
  }

  table.data-table.renewals-table td,
  #view-renewals table.data-table tbody td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.4rem 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  table.data-table.renewals-table td::before,
  #view-renewals table.data-table tbody td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: 0.75rem;
    flex-shrink: 0;
  }

  table.data-table.renewals-table td.col-client,
  #view-renewals table.data-table tbody td:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 2px !important;
    border-bottom: 1px solid rgba(163, 112, 255, 0.15) !important;
    padding-bottom: 0.6rem !important;
  }
  table.data-table.renewals-table td.col-client::before,
  #view-renewals table.data-table tbody td:first-child::before {
    margin-bottom: 2px;
  }

  table.data-table.renewals-table td.col-actions,
  #view-renewals table.data-table tbody td:last-child {
    border-bottom: none !important;
    padding-top: 0.65rem !important;
    margin-top: 0.2rem !important;
  }
  table.data-table.renewals-table td.col-actions::before,
  #view-renewals table.data-table tbody td:last-child::before {
    display: none !important;
  }

  .renewal-actions-group,
  #view-renewals table.data-table tbody td:last-child > div {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr 44px !important;
    gap: 0.5rem !important;
  }

  .renewal-actions-group .btn,
  #view-renewals table.data-table tbody td:last-child .btn {
    width: 100% !important;
    height: 38px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    justify-content: center !important;
    text-align: center !important;
  }
}
