/* =========================================================
GLOBAL STYLESHEET
=========================================================

   CLASES FALTANTES:
   Las siguientes clases se usan en JS/HTML pero no tenían
   definición CSS, causando que no se aplique ningún estilo.
========================================================= */

/* FIX: Clase usada en clients-view y billing-view para nombres de clientes */
.text-accent-clients {
  color: var(--accent-secondary);
}

/* FIX: Clase usada en clients-view para resaltar fila seleccionada */
.bg-accent-glass {
  background: rgba(255, 255, 255, 0.03);
}

/* FIX: Clase usada en assistant cards para efecto hover */
.hover-lift {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* FIX: Clase usada en tickets-view botón reset filtros */
.btn-outline-custom {
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  background: transparent;
}

.btn-outline-custom:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

/* FIX: Clase usada en clients-view para vencimientos expirados */
@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* FIX: Clase usada en navigate() para transición entre vistas */
.view-transition {
  animation: fadeIn 0.3s ease-out;
}

/* FIX: Clase usada en DOMContentLoaded para ocultar contenido pre-carga */
.app-preload {
  opacity: 0;
}

/* STYLE-01 FIX: Use text-dim for table headers instead of bg-deep */
.glass-card .table,
.glass-card .table thead th {
  color: var(--text-dim) !important;
}

/* Forzar color en tablas dentro de glass-card */
.glass-card .table tbody td,
.glass-card .table tbody tr {
  color: var(--text-main) !important;
}

#clients-view .glass-card.overflow-hidden {
  min-height: 525px;
  display: flex;
  flex-direction: column;
}

#clients-view .table-responsive {
  flex: 1;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.835) !important;
}

/* Forzar icono calendario blanco */
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.8;
}

/* =========================================================
   1. DESIGN SYSTEM (TOKENS) — DARK MODE (default)
========================================================= */

:root {
  --bg-deep: #0b0f1a;
  --bg-sidebar: rgba(12, 16, 28, 0.92);
  --bg-card: rgba(22, 27, 45, 0.549);
  --bg-glass: rgba(18, 22, 38, 0.75);
  --bg-input: #161925;

  --accent-primary: #38bdf8;
  --accent-secondary: #c084fc;

  --success: #34d399;
  --error: #f87171;
  --warning: #fbbf24;
  --info: #38bdf8;

  --text-main: #e2e8f0;
  --text-dim: #64748b;

  --border-soft: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.12);

  --glass-blur: blur(20px) saturate(1.8);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.05);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================
   1b. LIGHT MODE TOKENS
========================================================= */

[data-theme="light"] {
  --bg-deep: #f1f5f9;
  --bg-sidebar: rgba(255, 255, 255, 0.82);
  --bg-card: rgba(255, 255, 255, 0.55);
  --bg-glass: rgba(255, 255, 255, 0.65);
  --bg-input: #ffffff;

  --accent-primary: #0284c7;
  --accent-secondary: #9333ea;

  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --info: #0284c7;

  --text-main: #0f1318;
  --text-dim: #64748b;

  --border-soft: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.1);

  --glass-blur: blur(20px) saturate(1.5);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* Transición suave al cambiar tema */
body,
.sidebar,
.glass-card,
.service-card,
.modal-content,
.form-control,
.form-select,
.toast,
.offcanvas {
  transition: background-color 0.3s ease, color 0.3s ease,
    border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease;
}

/* =========================================================
   1c. BOOTSTRAP OVERRIDES PARA LIGHT MODE
========================================================= */

/* BODY — bg-dark de Bootstrap usa !important, necesitamos mayor especificidad */
body[data-theme="light"],
body[data-theme="light"].bg-dark {
  background-color: var(--bg-deep) !important;
  color: var(--text-main) !important;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(2, 132, 199, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(147, 51, 234, 0.06) 0%, transparent 50%);
}

/* TEXTOS */
[data-theme="light"] .text-light,
[data-theme="light"] .text-white {
  color: var(--text-main) !important;
}

[data-theme="light"] .separator-line {
  border-top: 1px solid var(--text-dim) !important;
}

[data-theme="light"] .text-secondary {
  color: var(--text-dim) !important;
}

[data-theme="light"] h2.fw-bold,
[data-theme="light"] h3.fw-bold,
[data-theme="light"] h5.fw-bold {
  color: var(--text-main) !important;
}

/* BACKGROUNDS */
[data-theme="light"] .bg-dark {
  background-color: var(--bg-card) !important;
}

[data-theme="light"] .text-bg-dark {
  background-color: var(--bg-glass) !important;
  color: var(--text-main) !important;
}

/* BORDERS */
[data-theme="light"] .border-secondary {
  border-color: var(--border-light) !important;
}

[data-theme="light"] .border-warning {
  border-color: var(--warning) !important;
}

/* BOTONES — convertir outline a botones con fondo sólido en light mode */
[data-theme="light"] .btn-outline-light {
  color: var(--text-main) !important;
  background-color: #fcfcfc !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05) !important;
}

[data-theme="light"] .btn-outline-light:hover {
  background-color: #d4d4d4 !important;
  color: var(--text-dim) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

/* btn-outline-info, warning, etc. — hacerlos soft-solid */
[data-theme="light"] .btn-outline-info {
  background-color: rgba(2, 132, 199, 0.1) !important;
  color: var(--info) !important;
  border-color: transparent !important;
}

[data-theme="light"] .btn-outline-info:hover {
  background-color: rgba(2, 132, 199, 0.2) !important;
}

[data-theme="light"] .btn-outline-warning {
  background-color: rgba(217, 119, 6, 0.1) !important;
  color: var(--warning) !important;
  border-color: transparent !important;
}

[data-theme="light"] .btn-outline-warning:hover {
  background-color: rgba(217, 119, 6, 0.2) !important;
}



/* INPUTS */
[data-theme="light"] .btn-close-white {
  filter: none;
}

[data-theme="light"] input::placeholder {
  color: rgba(0, 0, 0, 0.4) !important;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
  opacity: 0.6;
}

/* SIDEBAR — adaptar items al fondo claro */
[data-theme="light"] .sidebar-item {
  color: var(--text-dim);
}

[data-theme="light"] .sidebar-item:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--accent-primary);
}

[data-theme="light"] .sidebar-item.active {
  background: var(--accent-primary);
  color: #fff;
}

/* DROPDOWN MENU LIGHT MODE (Tuerquita) */
[data-theme="light"] .dropdown-menu-dark {
  background-color: #ffffff !important;
  border-color: rgba(0, 0, 0, 0) !important;
  color: var(--text-main) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="light"] .dropdown-menu-dark .dropdown-item {
  color: var(--text-dim) !important;
}

[data-theme="light"] .dropdown-menu-dark .dropdown-item:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-main) !important;
}

[data-theme="light"] .dropdown-menu-dark .dropdown-item.text-danger {
  color: var(--error) !important;
}

[data-theme="light"] .dropdown-menu-dark .dropdown-item.text-danger:hover {
  background-color: rgba(220, 38, 38, 0.1) !important;
}

[data-theme="light"] .dropdown-menu-dark .dropdown-divider {
  border-color: rgba(0, 0, 0, 0.08) !important;
}

/* DETAIL PANEL — menú servicios (Logs, Variables, Redeploy) */
[data-theme="light"] .service-menu-item {
  color: var(--text-main) !important;
}

[data-theme="light"] .service-menu-item:hover {
  background: rgba(0, 0, 0, 0.05) !important;
  color: var(--accent-primary) !important;
}

[data-theme="light"] .service-menu-item.active {
  background: rgba(0, 0, 0, 0.08) !important;
  color: var(--text-main) !important;
}

/* DETAIL PANEL — textos del header y panel lateral */
[data-theme="light"] .detail-side-panel,
[data-theme="light"] #detail-side-panel {
  color: var(--text-main) !important;
}

[data-theme="light"] .dashboard-access {
  background: #ffffff !important;
  border-radius: var(--radius-lg);
  padding: 1.5rem !important;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .dashboard-access h3,
[data-theme="light"] .dashboard-access p {
  color: var(--text-main) !important;
}

[data-theme="light"] .dashboard-icon i {
  color: var(--accent-primary) !important;
}

/* DETAIL PANEL - BADGES DEL HEADER (Light mode) */
[data-theme="light"] #header-badges .badge {
  background-color: var(--bg-card) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-weight: 600;
}

[data-theme="light"] #header-badges .text-info {
  color: var(--info) !important;
}

[data-theme="light"] #header-badges .text-success {
  color: #0f766e !important;
  /* Verde más oscuro/legible */
}

[data-theme="light"] #header-badges .text-warning {
  color: #b45309 !important;
  /* Naranja más oscuro/legible */
}

[data-theme="light"] #header-badges .text-danger {
  color: #b91c1c !important;
  /* Rojo más oscuro/legible */
}

/* VARIABLES VIEW — cards y valores */
[data-theme="light"] .var-card {
  background: var(--bg-card) !important;
  border-color: var(--border-light) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .var-value {
  background-color: rgba(0, 0, 0, 0.05) !important;
  color: var(--text-main) !important;
}

[data-theme="light"] .var-key {
  color: var(--accent-primary) !important;
  background-color: rgba(2, 132, 199, 0.1) !important;
}

/* TEMPLATE CARDS — light mode */
[data-theme="light"] .template-card {
  border-color: var(--border-light) !important;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .deploy-search-bar {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
}

/* BADGES DE PLANES (Clients View) y ESTADO */
[data-theme="light"] .badge.border.border-secondary {
  border-color: rgba(0, 0, 0, 0.25) !important;
  color: var(--text-main) !important;
}

[data-theme="light"] .badge.bg-secondary {
  background-color: rgba(0, 0, 0, 0.15) !important;
  color: var(--text-main) !important;
}

/* SERVICE CARD — textos dentro de la card del servicio */
[data-theme="light"] .service-card h6,
[data-theme="light"] .service-card .fw-bold {
  color: var(--text-main) !important;
}

[data-theme="light"] .service-card .text-dim,
[data-theme="light"] .service-card .small {
  color: var(--text-dim) !important;
}

/* =========================================================
   1d. UTILITY CLASSES (reemplazan inline styles)
========================================================= */

.clickable {
  cursor: pointer;
}

.text-truncate-75 {
  max-width: 75%;
}

.search-input-group {
  width: 250px;
  max-width: 280px;
}

.badge-sm {
  font-size: 11px;
  padding: 4px 8px;
}

.badge-sm-action {
  cursor: pointer;
  font-size: 11px;
  padding: 4px 8px;
}

.min-w-60 {
  min-width: 60px;
}

.ticket-textarea {
  min-height: 220px;
  resize: vertical;
}

.dashboard-desc {
  max-width: 320px;
  font-size: 0.82rem;
}

.dashboard-actions {
  max-width: 280px;
}

.payment-table-scroll {
  max-height: 300px;
}

.th-dark {
  color: var(--text-dim) !important;
}

.spinner-xs {
  width: 12px;
  height: 12px;
}

.audit-table-scroll {
  max-height: 600px;
  overflow-y: auto;
}

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

/* =========================================================
   1e. LIGHT MODE — COMPONENT OVERRIDES ADICIONALES
========================================================= */

[data-theme="light"] .offcanvas {
  background-color: #ffffff !important;
  color: var(--text-main) !important;
}

[data-theme="light"] .input-group-text {
  background-color: var(--bg-card) !important;
  border-color: var(--border-light) !important;
  color: var(--text-dim) !important;
}

[data-theme="dark"] .input-group-text {
  color: rgba(255, 255, 255, 0.75) !important;
}

[data-theme="light"] .table {
  color: var(--text-main) !important;
}

[data-theme="light"] .table tbody td {
  border-bottom-color: var(--border-soft) !important;
}

[data-theme="light"] .glass-card .table thead th {
  color: var(--text-dim) !important;
}

[data-theme="light"] .glass-card .table tbody td,
[data-theme="light"] .glass-card .table tbody tr {
  color: var(--text-main) !important;
}

[data-theme="light"] .toast {
  background-color: var(--bg-glass) !important;
  color: var(--text-main) !important;
}

[data-theme="light"] .splash-title {
  color: var(--text-main) !important;
}

/* STYLE-06: Side panel placeholder for light mode */
[data-theme="light"] .side-panel-placeholder {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: var(--border-light) !important;
}

/* Toast themed bg (replaces hardcoded bg-dark) */
.toast-themed {
  background-color: var(--bg-glass) !important;
  color: var(--text-main) !important;
}


/* =========================================================
   2. BASE LAYOUT
========================================================= */

body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 0% 0%, rgba(0, 255, 150, 0.06) 0%, transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(0, 255, 150, 0.04) 0%, transparent 50%);
}

/* Light mode body bg ahora se maneja en sección 1c con body[data-theme="light"].bg-dark */

/* =========================================================
   3. NAVBAR
========================================================= */

/* SIDEBAR */

.sidebar {
  width: 70px;
  min-width: 70px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--border-soft);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
  z-index: 1000;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.sidebar-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ITEMS */

.sidebar-item {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

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

.sidebar-item.active {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #000;
}

/* NOTIFICATION DOT */

.badge-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  background: red;
  border-radius: 50%;
  display: none;
}

/* MAIN */

.main-wrapper {
  margin-left: 70px;
  width: calc(100% - 70px);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.main-content {
  display: block;
  overflow: auto;
  height: 100%;
}

/* =========================================================
   4. GLASS COMPONENT SYSTEM
========================================================= */

.glass-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow), var(--glass-inset);
}

.glass-header {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-soft);
}


/* =========================================================
   5. SERVICE CARDS
========================================================= */

.service-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
}

.service-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}


/* =========================================================
   6. TABLE SYSTEM (GLOBAL)
========================================================= */

.table {
  color: var(--text-main);
  vertical-align: middle;
}

.table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-soft);
  padding: 1.25rem 1rem;
}

.table tbody td {
  padding: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  background: transparent;
}


/* =========================================================
   7. STATUS BADGES (GLOBAL SYSTEM)
========================================================= */

.status-badge {
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-abierto {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

.status-enprogreso {
  background: rgba(0, 210, 255, 0.1);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.2);
}

.status-cerrado {
  background: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}


/* =========================================================
   8. DETAIL SPLIT LAYOUT
========================================================= */

.detail-layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 2rem;
  align-items: start;
}

.services-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.side-panel-column {
  position: sticky;
  top: 0;
  min-width: 0;
}

.side-panel-placeholder {
  background: rgba(20, 23, 35, 0.6);
  border: 1px dashed var(--border-light);
  padding: 2rem;
  border-radius: var(--radius-lg);
}

#detail-side-panel {
  height: calc(100vh - 220px);
  max-height: calc(100vh - 220px);
  overflow-wrap: break-word;
  word-break: break-word;
}

@media (max-width: 1100px) {
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .side-panel-column {
    position: static;
  }

  #detail-side-panel {
    height: auto;
    max-height: 45vh;
  }
}

.dropdown-menu-dark {
  border-color: transparent;
  background-color: var(--bg-sidebar);
}

/* =========================================================
   9. FORM & MODALS
========================================================= */

.form-control,
.form-select {
  background-color: var(--bg-input) !important;
  border: 1px solid var(--border-light) !important;
  color: var(--text-main) !important;
}

.modal-content {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(30px) saturate(2) !important;
  -webkit-backdrop-filter: blur(30px) saturate(2) !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  color: var(--text-main);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-secondary) !important;
  box-shadow: 0 0 0 0.25rem rgba(192, 132, 252, 0.15) !important;
}


/* =========================================================
   10. BUTTON SYSTEM
========================================================= */

.badges-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.badge-client-btn,
.badge-ticket-btn,
.badge-pending.btn {
  cursor: pointer;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;

}


.btn-update-mini {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 0 6px rgba(255, 193, 7, 0.4);
  transition: all 0.2s ease;
}

.btn-update-mini:hover {
  transform: rotate(90deg);
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.8);
}

/* FIX: Se eliminó .btn-update-mini duplicado (ya definido arriba, línea 342).
   El @keyframes pulseUpdate también estaba duplicado (ver sección 19). */


/* =========================================================
   11. TOAST SYSTEM
========================================================= */

.toast {
  background: rgba(20, 20, 30, 0.95) !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-light) !important;
}


/* =========================================================
  12. SCROLLBARS
========================================================= */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* STYLE-07: Scrollbar for light mode */
[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}


/* =========================================================
  13. SKELETON LOADING
========================================================= */

@keyframes skeleton-shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.04) 25%,
      rgba(255, 255, 255, 0.11) 50%,
      rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
  border-radius: 6px;
}

[data-theme="light"] .skeleton {
  background: linear-gradient(90deg,
      rgba(0, 0, 0, 0.06) 25%,
      rgba(0, 0, 0, 0.14) 50%,
      rgba(0, 0, 0, 0.06) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s infinite linear;
}

/* =========================================================
  14. ANIMATIONS
========================================================= */

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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

.animate-fade {
  animation: fadeIn 0.4s ease-out forwards;
}

.animate-fade-up {
  animation: fadeUp 0.5s ease-out forwards;
}


/* =========================================================
   14. SPLASH SCREEN
========================================================= */

.splash-container {
  animation: fadeIn 0.8s ease forwards;
}

.splash-title {
  letter-spacing: 1px;
  font-weight: 600;
}

.splash-version {
  font-size: 12px;
  color: var(--text-dim);
}

/* =========================================================
   15. CLIENTS VIEW
========================================================= */

/* Clip any overflow so long names/buttons never escape the card boundary */
.client-card {
  overflow: hidden;
}

/* Tabla comportamiento */

.table-hover tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition-fast);
}

/* Tamaños utilitarios */

.x-small {
  font-size: 0.7rem;
}

.ls-1 {
  letter-spacing: 1px;
}

/* Dashboard health dot */
.dash-health-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  animation: health-pulse 2.5s ease-in-out infinite;
}

@keyframes health-pulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(1.4);
  }
}

/* Avatar cliente */

.client-avatar {
  width: 40px;
  height: 40px;
  background: rgba(240, 147, 251, 0.1);
  color: var(--accent-secondary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.client-avatar-lg {
  width: 52px;
  height: 52px;
  background: rgba(240, 147, 251, 0.12);
  color: var(--accent-secondary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.25rem;
  border: 1px solid rgba(240, 147, 251, 0.2);
}

/* Client detail tabs */

[data-theme="dark"] #client-detail-tabs .nav-link:not(.active) {
  color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] #client-detail-tabs .nav-link:not(.active):hover {
  color: #fff;
}

[data-theme="light"] #client-detail-tabs .nav-link:not(.active) {
  color: rgba(0, 0, 0, 0.65);
}

[data-theme="light"] #client-detail-tabs .nav-link:not(.active):hover {
  color: #000;
}

/* Asistente tab icon */

.assistant-tab-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.2rem;
}

/* Vincular asistente card */

.link-assistant-card {
  cursor: pointer;
  border: 1.5px dashed var(--border-light);
  color: var(--text-main);
  transition: border-color 0.2s, background 0.2s;
}

.link-assistant-card:hover {
  border-color: var(--accent-primary);
}

/* Badge pendiente */

.badge-pending {
  background: rgba(255, 193, 7, 0.1);
  color: #ffc107;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
  border: 1px solid rgba(255, 193, 7, 0.2);
}

/* FIX: Se eliminó .badge-ticket — no se usa en ningún JS/HTML.
   Los tickets usan status-badge o badges de Bootstrap. */

/* Details expandibles */

.details-row {
  display: none;
  background: rgba(0, 0, 0, 0.2);
}

.details-row.active {
  display: table-row;
  animation: slideDown 0.3s ease-out;
}

.details-container {
  padding: 1.5rem;
  border-left: 4px solid var(--accent-secondary);
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 2rem;
  align-items: start;
}

/* Panel acciones lateral */

/* FIX: Se eliminaron .action-section, .row-active, .clickable-row —
   no se referencian en ningún JS/HTML (código residual). */

/* Animación específica clients */

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

/* =========================================================
   16. VARIABLES-VIEW
========================================================= */

.variables-panel {
  height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  background: transparent;
}

/* HEADER */
.variables-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

/* FORM */
.variables-form {
  margin-bottom: 12px;
}

/* GRID */
.variables-grid {
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 10px;

  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

/* CARD */
.var-card {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 12px;

  transition: all 0.2s ease;
}

.var-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

/* HEADER INTERNO */
.var-card-header {
  margin-bottom: 8px;
}

/* KEY + ACTIONS */
.var-key-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* KEY */
.var-key {
  font-weight: 600;
  font-size: 12px;
  color: #ffc107;
  background: rgba(255, 193, 7, 0.1);
  padding: 4px 8px;
  border-radius: 6px;
}

/* VALUE */
.var-card-body {
  max-height: 120px;
  overflow: hidden;
}

.var-value {
  font-family: monospace;
  font-size: 12px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 8px;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.4;
  max-height: 100px;
  overflow: auto;
}

/* ACTIONS INLINE */
.var-actions-inline {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.var-card:hover .var-actions-inline {
  opacity: 1;
}

/* BADGES */
.badge-edit {
  background: rgba(13, 202, 240, 0.15);
  color: #0dcaf0;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.badge-edit:hover {
  background: rgba(13, 202, 240, 0.3);
}

.badge-delete {
  background: rgba(220, 53, 69, 0.15);
  color: #dc3545;
  cursor: pointer;
  padding: 5px 7px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.badge-delete:hover {
  background: rgba(220, 53, 69, 0.3);
}

/* SEARCH */
#vars-search {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

#vars-search:focus {
  border-color: #ffc107;
  box-shadow: none;
}


/* =========================================================
   17. SERVICES BUTTONS MENU
========================================================= */

.service-menu-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.service-menu {
  width: 100%;
  max-width: 220px;
  /* controla el ancho del menú */
  margin-top: 12px;

  display: flex;
  flex-direction: column;
  align-items: center;
}

.service-menu hr {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.08);
  margin: 6px 0;
}

.service-menu-item {
  width: 100%;

  text-align: center;
  font-size: 13px;
  padding: 8px 12px;

  color: #ddd;
  cursor: pointer;

  border-radius: 6px;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;

  transition: all .2s ease;
}

.service-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.service-menu-item.active {
  background: rgba(0, 210, 255, 0.15);
  color: #00d2ff;
  border: 1px solid rgba(0, 210, 255, 0.3);
}

/* =========================================================
   18. LOGS STYLES  
========================================================= */

.logs-panel {
  height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}

.logs-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.logs-terminal {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 13.5px;
  line-height: 1.6;
  color: #e6e6e6;
}

/* SCROLL */
.logs-terminal::-webkit-scrollbar {
  width: 6px;
}

.logs-terminal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 6px;
}

/* LINEA */
.log-line {
  display: grid;
  grid-template-columns: 90px 70px 1fr;
  align-items: center;
  padding: 4px 8px;
  gap: 10px;
  border-left: 3px solid transparent;
  border-radius: 4px;
  transition: background 0.15s ease;
}

/* HOVER */
.log-line:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* TIME */
.log-time {
  color: #6c757d;
  font-size: 11px;
}

/* LABEL */
.log-label {
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* MSG */
.log-msg {
  word-break: break-word;
  font-size: 13px;
}

/* TIPOS */

.log-info {
  border-left-color: #0dcaf0;
}

.log-info .log-label {
  color: #0dcaf0;
}

.log-warn {
  border-left-color: #ffc107;
  background: rgba(255, 193, 7, 0.05);
}

.log-warn .log-label {
  color: #ffc107;
}

.log-error {
  border-left-color: #ff4d4f;
  background: rgba(255, 77, 79, 0.08);
}

.log-error .log-label {
  color: #ff4d4f;
}

.log-error .log-msg {
  color: #ffb3b3;
  /* 🔥 más legible */
  font-weight: 500;
}

/* DEBUG */
.log-debug {
  border-left-color: #adb5bd;
  opacity: 0.7;
}

.log-debug .log-label {
  color: #adb5bd;
}

/* =========================================================
   19. UPDATE BANNER (no se usa — el update ahora usa modal)
========================================================= */

/* FIX: Se eliminaron estilos de .update-banner, .update-banner-content,
   .update-left, .update-icon, .update-text, .update-btn —
   el sistema de updates ahora usa el modal #updateModal, no un banner. */

.sidebar-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #ff3b3b;
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  border-radius: 50%;
  padding: 2px 6px;
  line-height: 1;
}

.notif-canvas-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.notif-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.notif-header-sub {
  font-size: 11px;
  color: var(--text-dim);
}

.notif-header-sub-label {
  display: none;
}

#notif-unread-count:not(:empty)~.notif-header-sub-label {
  display: inline;
}

#notif-unread-count:not(:empty) {
  color: var(--accent-primary);
  font-weight: 600;
  margin-right: 3px;
}

.notif-action-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  transition: background var(--anim-dur-fast) ease, color var(--anim-dur-fast) ease;
}

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

.notif-action-danger:hover {
  background: rgba(248, 113, 113, 0.15);
  color: var(--error);
  border-color: rgba(248, 113, 113, 0.3);
}

.notification-item {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--anim-dur-fast) ease, border-color var(--anim-dur-fast) ease, opacity var(--anim-dur-fast) ease;
}

.notification-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notif-unread {
  border-left: 3px solid var(--accent-primary);
  background: rgba(56, 189, 248, 0.04);
}

.notif-read {
  opacity: 0.45;
}

.notif-icon-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.notif-icon-error {
  background: rgba(248, 113, 113, 0.14);
  color: var(--error);
}

.notif-icon-info {
  background: rgba(56, 189, 248, 0.14);
  color: var(--info);
}

.notif-icon-warning {
  background: rgba(251, 191, 36, 0.14);
  color: var(--warning);
}

.notif-icon-default {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
}

.notif-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
}

.notif-message {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: 3px;
}

.notif-time {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.65;
  white-space: nowrap;
  flex-shrink: 0;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 3.5rem 1rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.notif-empty-icon {
  font-size: 2.2rem;
  opacity: 0.3;
}

/* Offcanvas: spring entrance / snap exit */
#notificationsCanvas {
  transition:
    transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 300ms ease !important;
  will-change: transform, opacity;
}

#notificationsCanvas.hiding {
  transition:
    transform 240ms cubic-bezier(0.4, 0, 1, 1),
    opacity 180ms ease-in !important;
}

#notificationsCanvas:not(.show) {
  transform: translateX(calc(100% + 24px)) !important;
  opacity: 0 !important;
}

/* =========================================================
   20. TEMPLATE CARDS & DEPLOY MODAL
========================================================= */

.deploy-modal-header-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(52, 211, 153, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  color: var(--success);
  flex-shrink: 0;
}

.deploy-search-bar {
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.deploy-search-bar input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text-main);
  font-size: 0.88rem;
  flex: 1;
}

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

.template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: var(--transition-fast);
  cursor: pointer;
  height: 100%;
}

.template-card:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.03);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(52, 211, 153, 0.08);
}

.template-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.template-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.template-name {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
}

.template-badge {
  font-size: 0.6rem;
  background: var(--border-soft);
  color: var(--text-dim);
  padding: 2px 7px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.deploy-confirm-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: rgba(52, 211, 153, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--success);
  margin: 0 auto;
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.12);
}

/* =========================================================
   21. DASHBOARD STYLE
========================================================= */

.dashboard-access {
  background: radial-gradient(circle at top, rgba(0, 255, 150, 0.05), transparent);
  overflow-y: auto;
  padding-top: 1.25rem;
  padding-bottom: 1.25rem;
}

.dashboard-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: rgba(0, 255, 150, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #00ff9c;
  box-shadow: 0 0 16px rgba(0, 255, 150, 0.15);
}

/* =========================================================
   23. METRIC & DASHBOARD UTILITIES
========================================================= */

/* Text color utilities */
.text-dim {
  color: var(--text-dim);
}

.text-online {
  color: var(--success);
}

.text-error-c {
  color: var(--error);
}

/* Layout utilities */
.min-w-0 {
  min-width: 0;
}

.scrollable-list {
  max-height: 300px;
  overflow-y: auto;
}

/* KPI label — uppercase tiny category label */
.kpi-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

/* KPI big number */
.kpi-number {
  font-size: 2rem;
  line-height: 1.1;
  font-weight: 700;
}

.kpi-number-primary {
  color: var(--accent-primary);
}

.kpi-number-warning {
  color: var(--warning);
}

/* KPI faded icon (top-right of card) */
.kpi-icon {
  font-size: 1.3rem;
  opacity: 0.35;
  margin-top: 2px;
  flex-shrink: 0;
}

.kpi-icon-primary {
  color: var(--accent-primary);
}

.kpi-icon-warning {
  color: var(--warning);
}

/* Counter inside donut */
.kpi-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Project name below donut */
.kpi-project-name {
  font-size: 0.9rem;
}

/* Service status stats */
.kpi-stat-online {
  font-size: 0.75rem;
  color: var(--success);
  margin-top: 2px;
}

.kpi-stat-error {
  font-size: 0.75rem;
  color: var(--error);
}

/* Health status big text — color set inline (dynamic) */
.kpi-health-status {
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 700;
}

/* Donut chart layout */
.donut-wrapper {
  position: relative;
  flex-shrink: 0;
}

.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Progress bar track */
.bar-track {
  flex: 1;
  height: 4px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
}

/* Bar fill — width & background set inline (dynamic per row) */
.bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

/* Bar labels & counts */
.bar-label {
  font-size: 0.62rem;
  color: var(--text-dim);
}

.bar-label-plan {
  width: 54px;
  white-space: nowrap;
}

.bar-label-prio {
  width: 30px;
}

.bar-count {
  font-size: 0.62rem;
  width: 16px;
  text-align: right;
  color: var(--text-dim);
}

/* Service distribution */
.svc-bar-track {
  flex: 2;
  height: 6px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
}

.svc-dist-label {
  flex: 1;
  font-size: 0.78rem;
}

.svc-dist-count {
  font-size: 0.72rem;
  width: 36px;
  text-align: right;
  color: var(--text-dim);
}

/* Indicator dot — background set inline (dynamic per status) */
.indicator-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Ticket list */
.ticket-list-name {
  font-size: 0.85rem;
}

.ticket-list-client {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.ticket-border {
  border-color: var(--border-soft) !important;
}

/* Priority pill — background & color set inline (dynamic per priority) */
.prio-pill {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}

/* Pending count pill */
.pending-pill {
  font-size: 0.7rem;
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning);
  padding: 2px 10px;
  border-radius: 99px;
}

/* Uptime bar */
.uptime-label {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.uptime-track {
  height: 5px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
}

.uptime-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.6s ease;
}

.uptime-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Variables view service icon */
.icon-service {
  color: var(--warning);
  font-size: 1.2rem;
}

/* =========================================================
   22. GLOBAL NORMALIZATION
========================================================= */

/* Todos los h2.fw-bold usan var(--text-main) — sin necesidad de text-light o text-main */
h2.fw-bold {
  color: var(--text-main);
}

/* Botones de modal footer: tamaño y padding consistente con el estilo del dashboard */
.modal-footer .btn {
  font-size: 0.82rem;
  padding: 0.32rem 0.85rem;
}

/* btn-outline-secondary en dark mode: coherente con glass cards */
body:not([data-theme="light"]) .btn-outline-secondary {
  color: var(--text-dim);
  border-color: var(--border-light);
  background: transparent;
}

body:not([data-theme="light"]) .btn-outline-secondary:hover,
body:not([data-theme="light"]) .btn-outline-secondary:focus {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-light);
}

/* Input group addon en dark mode: usa CSS vars */
body:not([data-theme="light"]) .input-group-text {
  background: var(--bg-glass);
  border-color: var(--border-light);
  color: var(--text-dim);
}

/* form-control en dark mode: normaliza text-light legacy */
body:not([data-theme="light"]) .form-control {
  background-color: var(--bg-input);
  border-color: var(--border-light);
  color: var(--text-main);
}

body:not([data-theme="light"]) .form-control::placeholder {
  color: var(--text-dim);
}

body:not([data-theme="light"]) .form-select {
  background-color: var(--bg-input);
  border-color: var(--border-light);
  color: var(--text-main);
}

/* =========================================================
   24. ANIMATION SYSTEM
   Change --anim-dur here to adjust all animations globally
========================================================= */

:root {
  --anim-dur: 350ms;
  --anim-dur-fast: 160ms;
  --anim-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --anim-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --stagger-base: 55ms;
}

/* --- Keyframes --- */

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.96);
  }

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

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

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

@keyframes slide-from-right {
  from {
    opacity: 0;
    transform: translateX(32px);
  }

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

@keyframes view-exit {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}

/* --- Entrance classes --- */

.anim-card-enter {
  animation: card-enter var(--anim-dur) var(--anim-ease) both;
  animation-delay: calc(var(--si, 0) * var(--stagger-base));
}

.anim-panel-enter {
  animation: panel-enter var(--anim-dur) var(--anim-ease) both;
}

.anim-slide-right {
  animation: slide-from-right var(--anim-dur) var(--anim-ease) both;
}

.is-exiting {
  animation: view-exit var(--anim-dur-fast) var(--anim-ease) forwards !important;
  pointer-events: none;
}

/* --- Hover: spring lift with per-type glow --- */

.hover-lift {
  transition:
    transform var(--anim-dur) var(--anim-spring),
    box-shadow var(--anim-dur) var(--anim-ease),
    border-color var(--anim-dur) var(--anim-ease) !important;
  will-change: transform;
}

.hover-lift:hover {
  transform: translateY(-7px) scale(1.013) !important;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.35) !important;
}

.assistant-card.hover-lift:hover {
  border-color: var(--accent-primary) !important;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(56, 189, 248, 0.3) !important;
}

.client-card.hover-lift:hover {
  border-color: var(--accent-secondary) !important;
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(192, 132, 252, 0.3) !important;
}

/* --- Button press --- */

.btn {
  transition:
    transform var(--anim-dur-fast) var(--anim-spring),
    background-color var(--anim-dur) var(--anim-ease),
    box-shadow var(--anim-dur) var(--anim-ease),
    border-color var(--anim-dur) var(--anim-ease),
    color var(--anim-dur) var(--anim-ease) !important;
}

.btn:active {
  transform: scale(0.91) !important;
}

/* --- Service menu item: slide + stagger in --- */

.service-menu-item {
  transition:
    background var(--anim-dur-fast) var(--anim-ease),
    color var(--anim-dur-fast) var(--anim-ease),
    transform var(--anim-dur-fast) var(--anim-spring) !important;
}

.service-menu-item:hover {
  transform: translateX(4px) !important;
}

/* Items stagger in after the card (--si inherited from .service-card) */
.service-menu .service-menu-item:nth-child(1) {
  animation: panel-enter var(--anim-dur) var(--anim-ease) both;
  animation-delay: calc(var(--si, 0) * var(--stagger-base) + 80ms);
}

.service-menu .service-menu-item:nth-child(3) {
  animation: panel-enter var(--anim-dur) var(--anim-ease) both;
  animation-delay: calc(var(--si, 0) * var(--stagger-base) + 145ms);
}

.service-menu .service-menu-item:nth-child(5) {
  animation: panel-enter var(--anim-dur) var(--anim-ease) both;
  animation-delay: calc(var(--si, 0) * var(--stagger-base) + 210ms);
}

/* Service card uses global timing */
.service-card {
  transition:
    transform var(--anim-dur) var(--anim-spring),
    border-color var(--anim-dur) var(--anim-ease),
    box-shadow var(--anim-dur) var(--anim-ease) !important;
}

.service-card:hover {
  transform: translateY(-3px) !important;
}