/*
 * Nextal Graphic - Control de Pedidos
 * Premium Design System — Rediseño Moderno Corporativo v2
 * Paleta: Azul Nextal #004793 | Cyan Nextal #00B6EB
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   DESIGN TOKENS — LIGHT MODE
   ============================================================ */
:root {
  --primary:       #004793;
  --primary-dark:  #003670;
  --primary-light: #E8F0FB;
  --accent:        #00B6EB;
  --accent-dark:   #0099CC;
  --accent-glow:   rgba(0, 182, 235, 0.12);

  /* Surfaces */
  --bg-app:        #F0F4F9;
  --bg-sidebar:    #FFFFFF;
  --bg-card:       #FFFFFF;
  --bg-header:     rgba(255,255,255,0.97);

  /* Borders */
  --border-color:  #E2E8F0;
  --border-subtle: #F1F5F9;

  /* Sidebar */
  --sidebar-text:       #64748B;
  --sidebar-active-bg:  rgba(0, 71, 147, 0.07);
  --sidebar-active-text:#004793;

  /* Text */
  --text-main:    #1E293B;
  --text-muted:   #64748B;
  --text-subtle:  #94A3B8;

  /* Shadows — refined */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.03);
  --shadow-md: 0 4px 20px rgba(0,71,147,0.06), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,71,147,0.10), 0 4px 12px rgba(0,0,0,0.06);

  /* Glass */
  --glass-bg:     rgba(255,255,255,0.92);
  --glass-border: rgba(226,232,240,0.8);

  /* Status badges */
  --status-pending:       #F59E0B;
  --status-pending-bg:    #FEF9EE;
  --status-pending-bdr:   #FDE68A;
  --status-process:       #3B82F6;
  --status-process-bg:    #EFF6FF;
  --status-process-bdr:   #BFDBFE;
  --status-review:        #8B5CF6;
  --status-review-bg:     #F5F3FF;
  --status-review-bdr:    #DDD6FE;
  --status-delivered:     #10B981;
  --status-delivered-bg:  #F0FDF9;
  --status-delivered-bdr: #A7F3D0;
  --status-cancelled:     #EF4444;
  --status-cancelled-bg:  #FFF5F5;
  --status-cancelled-bdr: #FECACA;
}

/* ============================================================
   DESIGN TOKENS — DARK MODE
   ============================================================ */
.dark {
  --bg-app:        #0C1120;
  --bg-sidebar:    #101827;
  --bg-card:       #131E2E;
  --bg-header:     rgba(16,24,39,0.97);

  --border-color:  rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.03);

  --sidebar-text:       #8B9EB7;
  --sidebar-active-bg:  rgba(0,182,235,0.10);
  --sidebar-active-text:#00B6EB;

  --text-main:    #F1F5F9;
  --text-muted:   #8B9EB7;
  --text-subtle:  #4B6080;

  --shadow-xs: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.30);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.40);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.55);

  --glass-bg:     rgba(19,30,46,0.90);
  --glass-border: rgba(255,255,255,0.05);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,182,235,0.3) transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  width: 100%;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  width: 100%;
  min-height: 100vh;
}

#app-wrapper {
  /* Keep the navigation and the workspace side by side on desktop.
     This explicit layout also works when the Tailwind CDN is unavailable. */
  display: flex;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

#main-scroll-container {
  flex: 1 1 0;
  flex-direction: column !important;
  min-width: 0;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

/* App-shell fallback: do not depend on utility classes for the core layout. */
#app-sidebar {
  flex: 0 0 16rem;
  width: 16rem;
  min-width: 16rem;
  height: 100%;
  min-height: 0;
  position: relative;
  z-index: 30;
  transform: translateX(0);
}

@media (max-width: 1023px) {
  #app-wrapper { display: block; }

  #app-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    height: 100dvh;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  #app-sidebar:not(.-translate-x-full) { transform: translateX(0); }
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(0,182,235,0.25);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ============================================================
   KEYFRAME ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulseGlow {
  0%   { box-shadow: 0 0 0 0 rgba(0,182,235,0.35); }
  70%  { box-shadow: 0 0 0 8px rgba(0,182,235,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,182,235,0); }
}
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.animate-fade   { animation: fadeInUp 0.35s cubic-bezier(0.22,1,0.36,1) forwards; }
.animate-scale  { animation: scaleUp 0.3s cubic-bezier(0.34,1.56,0.64,1) forwards; }
.animate-slide  { animation: slideInRight 0.3s cubic-bezier(0.22,1,0.36,1) forwards; }
.animate-pulse-glow { animation: pulseGlow 2.5s infinite; }

/* ============================================================
   PREMIUM CARD / GLASS PANEL
   ============================================================ */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  border-radius: 1rem;
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.glass-panel:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0,182,235,0.18);
}

/* KPI Cards — extra premium with accent left border */
.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--primary));
  border-radius: 1rem 0 0 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kpi-card:hover::before { opacity: 1; }

/* ============================================================
   SIDEBAR
   ============================================================ */
aside {
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
}

/* Sidebar nav items */
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sidebar-text);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4,0,0.2,1);
  user-select: none;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  transform: translateX(2px);
}

.nav-item.active,
.nav-item[class*="bg-slate-100"],
.nav-item[class*="bg-[#00B6EB"]  {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ============================================================
   DATA TABLE
   ============================================================ */
.table-container {
  overflow-x: auto;
  width: 100%;
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  border: 1px solid var(--border-color);
  -webkit-overflow-scrolling: touch;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  background: #f8fafc;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.custom-table th:hover { background: #f1f5f9; }

.dark .custom-table th { 
  background: #1e293b; 
  color: #94a3b8;
  border-bottom-color: #334155;
}
.dark .custom-table th:hover { background: #253349; }

.custom-table td {
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  white-space: nowrap;
  transition: background 0.12s ease;
  vertical-align: middle;
}

.custom-table tbody tr:last-child td { border-bottom: none; }

.custom-table tbody tr:hover td { background: #f8fafc; }
.dark .custom-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* Pedidos table specific */
.pedidos-table .badge-id {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 50%, #0f172a 100%);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.25);
  display: inline-block;
  line-height: 1.4;
}

.pedidos-table .badge-canal {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-block;
}

.pedidos-table .cell-cliente {
  color: #334155;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
}

.pedidos-table .cell-muted {
  color: #94a3b8;
  font-size: 0.75rem;
}

/* Badge ID - Menu blue gradient */
.pedidos-table .badge-id {
  background: linear-gradient(135deg, #0088cc 0%, #005580 100%);
  color: #ffffff !important;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0, 136, 204, 0.3);
  display: inline-block;
  line-height: 1.4;
  letter-spacing: 0.3px;
}

/* Canal badges - color coded */
.pedidos-table .badge-canal {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.pedidos-table .badge-canal:hover { box-shadow: 0 1px 3px rgba(3,105,161,0.15); }

.pedidos-table .badge-whatsapp { background-color: #dcfce7; color: #15803d; border-color: #bbf7d0; }
.pedidos-table .badge-email { background-color: #ede9fe; color: #6d28d9; border-color: #ddd6fe; }
.pedidos-table .badge-redes { background-color: #fce7f3; color: #be185d; border-color: #fbcfe8; }
.pedidos-table .badge-web { background-color: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.pedidos-table .badge-referido { background-color: #fef3c7; color: #92400e; border-color: #fde68a; }
.pedidos-table .badge-portal { background-color: #e0f2fe; color: #0369a1; border-color: #bae6fd; }

/* Asesor selector - blue soft style */
.pedidos-table .asesor-selector {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.pedidos-table .asesor-selector:hover {
  background: #e0f2fe;
  box-shadow: 0 1px 3px rgba(3,105,161,0.12);
}

/* Cliente cell */
.pedidos-table .cell-cliente {
  color: #334155;
  font-weight: 600;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
}
.dark .pedidos-table .cell-cliente { color: #e2e8f0; }

/* Ciudad tag */
.pedidos-table .badge-ciudad {
  background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
  color: #0369a1;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #7dd3fc;
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pedidos-table .badge-ciudad .badge-icon {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* Tipo Diseño — Premium badged cell */
.td-tipo-diseno {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
}

.td-tipo-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
}
.td-tipo-icon svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}
tr:hover .td-tipo-icon { transform: scale(1.08); }

.td-tipo-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.td-tipo-name {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.dark .td-tipo-name { color: #e2e8f0; }

.td-tipo-spec {
  display: inline-flex;
  align-items: center;
  margin-top: 3px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  width: fit-content;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.dark .td-tipo-spec {
  background: rgba(51,65,85,0.4);
  color: #94a3b8;
  border-color: rgba(71,85,105,0.3);
}

/* Note card — premium */
.note-container {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #38bdf8;
  border-radius: 6px;
  padding: 6px 10px;
  max-width: 200px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.note-container:hover {
  background-color: #ffffff;
  border-color: #cbd5e1;
  border-left-color: #0ea5e9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.dark .note-container {
  background-color: rgba(15,23,42,0.5);
  border-color: rgba(51,65,85,0.6);
  border-left-color: #0ea5e9;
}
.dark .note-container:hover {
  background-color: rgba(15,23,42,0.8);
  border-color: rgba(71,85,105,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.note-text {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  color: #334155;
  font-style: normal;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.dark .note-text { color: #94a3b8; }

.note-empty-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  border: 1px dashed #e2e8f0;
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.note-empty-btn svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.note-empty-btn:hover {
  color: #0284c7;
  border-color: #7dd3fc;
  background: #f0f9ff;
}
.dark .note-empty-btn {
  color: #475569;
  border-color: rgba(71,85,105,0.4);
}
.dark .note-empty-btn:hover {
  color: #38bdf8;
  border-color: #0ea5e9;
  background: rgba(14,165,233,0.06);
}

/* ============================================================
   TIEMPO DE ENTREGA — Celda minimalista + Modal
   ============================================================ */
.time-cell-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

/* Pastilla de horas */
.time-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  background: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
  white-space: nowrap;
  letter-spacing: 0.1px;
}
.dark .time-pill {
  background: rgba(2,132,199,0.15);
  color: #38bdf8;
  border-color: rgba(56,189,248,0.3);
}

/* Botón acción rápida en celda */
.time-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.65rem;
  font-weight: 700;
  background: #0f172a;
  color: #ffffff;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.time-action-btn:hover {
  background: #0284c7;
}
.time-action-btn:active {
  transform: scale(0.96);
}
.dark .time-action-btn {
  background: #1e293b;
  color: #e2e8f0;
}
.dark .time-action-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

/* ============================================================
   VISTA PREVIA / REFERENCIA — Thumbnail & Buttons
   ============================================================ */

/* Thumbnail con proporción fija */
.ref-thumb-wrap {
  position: relative;
  width: 64px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  cursor: zoom-in;
  flex-shrink: 0;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.ref-thumb-wrap:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: scale(1.04);
}
.dark .ref-thumb-wrap {
  border-color: #334155;
  background: #1e293b;
}

.ref-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Overlay zoom al hover */
.ref-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
}
.ref-thumb-wrap:hover .ref-thumb-overlay {
  background: rgba(15,23,42,0.45);
}

/* Fallback cuando no carga la imagen */
.ref-thumb-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: #f0fdf4;
}

/* Botón "Abrir / Ver Drive" — cuando hay URL pero no imagen */
.ref-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 7px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.ref-link-btn:hover {
  background: #e0f2fe;
}
.dark .ref-link-btn {
  background: rgba(2,132,199,0.12);
  color: #38bdf8;
  border-color: rgba(56,189,248,0.25);
}

/* Botón "+ Agregar" — celda vacía */
.ref-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 7px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}
.ref-add-btn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}
.dark .ref-add-btn {
  background: #1e293b;
  color: #94a3b8;
  border-color: #334155;
}
.dark .ref-add-btn:hover {
  background: #334155;
  color: #e2e8f0;
  border-color: #475569;
}

/* Confirmación de pago */
.pedidos-table .badge-conf-pendiente {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.pedidos-table .badge-conf-confirmado {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

/* Método de pago */
.pedidos-table .metodo-pill {
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.pedidos-table .metodo-pill:hover { filter: brightness(0.95); }
.pedidos-table .metodo-transferencia { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pedidos-table .metodo-efectivo { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.pedidos-table .metodo-tarjeta { background: #faf5ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.pedidos-table .metodo-nequi { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }

/* Estado pills */
.pedidos-table .estado-pill {
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.pedidos-table .estado-pill:hover { filter: brightness(0.95); }
.pedidos-table .estado-pendiente-pago { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.pedidos-table .estado-pendiente { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.pedidos-table .estado-proceso { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.pedidos-table .estado-revision { background: #f5f3ff; color: #7c3aed; border: 1px solid #e9d5ff; }
.pedidos-table .estado-entregado { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }
.pedidos-table .estado-cancelado { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }

.dark .pedidos-table .badge-conf-pendiente,
.dark .pedidos-table .estado-pendiente-pago,
.dark .pedidos-table .estado-cancelado { background: rgba(220,38,38,0.1); border-color: rgba(220,38,38,0.2); }
.dark .pedidos-table .badge-conf-confirmado,
.dark .pedidos-table .estado-entregado { background: rgba(22,163,74,0.1); border-color: rgba(22,163,74,0.2); }
.dark .pedidos-table .estado-proceso { background: rgba(29,78,216,0.1); border-color: rgba(29,78,216,0.2); }
.dark .pedidos-table .estado-revision { background: rgba(124,58,237,0.1); border-color: rgba(124,58,237,0.2); }
.dark .pedidos-table .estado-pendiente { background: rgba(71,85,105,0.1); border-color: rgba(71,85,105,0.2); }

.dark .pedidos-table .badge-canal { background-color: rgba(3, 105, 161, 0.15); color: #38bdf8; border-color: rgba(56, 189, 248, 0.25); }
.dark .pedidos-table .badge-ciudad { background: linear-gradient(135deg, rgba(3,105,161,0.15) 0%, rgba(56,189,248,0.1) 100%); color: #38bdf8; border-color: rgba(56,189,248,0.25); }
.dark .pedidos-table .badge-ciudad .badge-icon { color: #38bdf8; }

.badge-ciudad-empty {
  display: inline-block;
  background-color: #f8fafc;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
}
.dark .badge-ciudad-empty {
  background-color: rgba(30,41,59,0.5);
  color: #64748b;
  border-color: rgba(51,65,85,0.5);
}

.badge-telefono-wa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.badge-telefono-wa:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.35);
}
.badge-telefono-wa .badge-icon {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.badge-telefono-empty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: #f8fafc;
  color: #94a3b8;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}
.badge-telefono-empty .badge-icon-wa-gray {
  width: 12px;
  height: 12px;
  color: #cbd5e1;
}
.dark .badge-telefono-empty {
  background-color: rgba(30,41,59,0.5);
  color: #64748b;
  border-color: rgba(51,65,85,0.5);
}
.dark .badge-telefono-empty .badge-icon-wa-gray {
  color: #475569;
}
.dark .pedidos-table .asesor-selector { background: rgba(3,105,161,0.1); color: #38bdf8; border-color: rgba(56,189,248,0.2); }
.dark .pedidos-table .metodo-transferencia { background: rgba(29,78,216,0.1); color: #60a5fa; border-color: rgba(29,78,216,0.2); }
.dark .pedidos-table .metodo-efectivo { background: rgba(22,163,74,0.1); color: #4ade80; border-color: rgba(22,163,74,0.2); }
.dark .pedidos-table .metodo-tarjeta,
.dark .pedidos-table .metodo-nequi { background: rgba(124,58,237,0.1); color: #a78bfa; border-color: rgba(124,58,237,0.2); }

/* Canal Dropdown */
.canal-dropdown-container {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 200px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.1);
  padding: 6px;
  margin-top: 4px;
}
.dark .canal-dropdown-container {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.4);
}

.canal-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #334155;
  border-radius: 8px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.canal-item:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}
.dark .canal-item { color: #cbd5e1; }
.dark .canal-item:hover { background-color: #1e293b; color: #f1f5f9; }
.dark .canal-item.bg-slate-800 { background-color: #1e293b; }

.canal-custom-input {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid #f1f5f9;
}
.dark .canal-custom-input { border-top-color: #1e293b; }

.canal-custom-input input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.78rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  outline: none;
  transition: border-color 0.15s;
}
.canal-custom-input input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2,132,199,0.1);
}
.dark .canal-custom-input input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}

/* Asesor Dropdown */
.asesor-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 50;
  min-width: 190px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
  padding: 6px;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
}
.dark .asesor-dropdown-menu {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
}

.asesor-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #1e293b;
  border-radius: 8px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}
.asesor-dropdown-item:hover {
  background-color: #f0f9ff;
  color: #0284c7;
}
.dark .asesor-dropdown-item { color: #cbd5e1; }
.dark .asesor-dropdown-item:hover { background-color: #1e293b; color: #38bdf8; }
.dark .asesor-dropdown-item.bg-slate-800 { background-color: #1e293b; }

.asesor-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0088cc, #005580);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.asesor-avatar-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Cliente Card in Table */
.cliente-card-table {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  max-width: 240px;
}
.cliente-card-table:hover {
  background-color: #f0f9ff;
  border-color: #93c5fd;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}
.dark .cliente-card-table {
  background-color: #1e293b;
  border-color: #334155;
}
.dark .cliente-card-table:hover {
  background-color: #0c1a2e;
  border-color: #3b82f6;
}

.cliente-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.5px;
}

.cliente-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cliente-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.dark .cliente-name { color: #e2e8f0; }

.cliente-email {
  font-size: 0.65rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.cliente-edit-icon {
  width: 14px;
  height: 14px;
  color: #94a3b8;
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.cliente-card-table:hover .cliente-edit-icon { opacity: 1; }

/* Edit Client Modal Inputs */
.edit-client-input {
  width: 100%;
  padding: 10px 12px 10px 2.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #1e293b;
  outline: none;
  transition: all 0.15s;
}
.edit-client-input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 4px rgba(2,132,199,0.12);
}
.edit-client-input::placeholder { color: #94a3b8; }
.dark .edit-client-input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .edit-client-input:focus {
  background: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56,189,248,0.15);
}

.input-group {
  display: flex;
  flex-direction: column;
}
.input-wrapper {
  position: relative;
}
.input-wrapper .input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  transition: color 0.2s ease;
}
.input-wrapper input:focus ~ .input-icon {
  color: #0284c7;
}
.dark .input-wrapper input:focus ~ .input-icon {
  color: #38bdf8;
}

.edit-client-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  display: block;
  text-transform: uppercase;
}
.dark .edit-client-label {
  color: #94a3b8;
}

/* Dialog Container */
.edit-client-dialog {
  background: #ffffff;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(15, 23, 42, 0.05);
}
.dark .edit-client-dialog {
  background: #0f172a;
  border-color: rgba(255,255,255,0.05);
}

/* Header Gradient */
.modal-header-gradient {
  background: linear-gradient(135deg, #0f172a 0%, #0369a1 50%, #0284c7 100%);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header-gradient h3,
.modal-header-gradient p {
  color: inherit;
}
.modal-header-gradient h3 {
  color: #ffffff !important;
}
.modal-header-gradient p {
  color: #bae6fd !important;
}

/* Edit Field Modal (Generic) */
.edit-field-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  margin: 16px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(15, 23, 42, 0.05);
  position: relative;
}
.dark .edit-field-dialog {
  background: #0f172a;
  border-color: rgba(255,255,255,0.05);
}

.edit-field-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #f1f5f9;
  border: none;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}
.edit-field-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.dark .edit-field-close {
  background: #1e293b;
  color: #94a3b8;
}
.dark .edit-field-close:hover {
  background: #334155;
  color: #fff;
}

.edit-field-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.edit-field-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.edit-field-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
}
.dark .edit-field-title {
  color: #f1f5f9;
}

.edit-field-body {
  padding: 20px 24px;
}

.edit-field-textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  outline: none;
  resize: vertical;
  transition: all 0.15s;
  font-family: inherit;
  line-height: 1.5;
}
.edit-field-textarea:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 4px rgba(2,132,199,0.1);
}
.edit-field-textarea::placeholder {
  color: #94a3b8;
}
.dark .edit-field-textarea {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .edit-field-textarea:focus {
  background: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56,189,248,0.12);
}

.edit-field-footer {
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.edit-field-btn-cancel {
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.edit-field-btn-cancel:hover {
  background: #e2e8f0;
}
.dark .edit-field-btn-cancel {
  color: #94a3b8;
  background: #1e293b;
}
.dark .edit-field-btn-cancel:hover {
  background: #334155;
}

.edit-field-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.edit-field-btn-save:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}
.edit-field-btn-save:active {
  transform: translateY(0);
}

/* Badge Valor/Pago Cell */
.badge-valor-pago {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 10px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 110px;
}
.badge-valor-pago:hover {
  background-color: #f0f9ff;
  border-color: #0284c7;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(2,132,199,0.1);
}
.dark .badge-valor-pago {
  background-color: rgba(30,41,59,0.5);
  border-color: rgba(51,65,85,0.5);
}
.dark .badge-valor-pago:hover {
  background-color: rgba(12,26,46,0.8);
  border-color: #38bdf8;
}

.valor-row-main {
  display: flex;
  align-items: center;
  gap: 6px;
}

.valor-icon {
  width: 14px;
  height: 14px;
  color: #64748b;
  flex-shrink: 0;
}
.dark .valor-icon {
  color: #94a3b8;
}

.valor-monto-main {
  font-weight: 700;
  font-size: 0.88rem;
  color: #0f172a;
}
.dark .valor-monto-main {
  color: #f1f5f9;
}

.valor-check-icon {
  width: 14px;
  height: 14px;
  color: #16a34a;
  flex-shrink: 0;
}

.valor-progress-track {
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 4px;
}
.dark .valor-progress-track {
  background: #334155;
}

.valor-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0284c7, #0ea5e9);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.valor-saldo-sub {
  font-size: 0.7rem;
  font-weight: 600;
  color: #d97706;
  margin-top: 2px;
}
.dark .valor-saldo-sub {
  color: #fbbf24;
}

/* Payment Modal */
.payment-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 420px;
  margin: 16px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(15, 23, 42, 0.05);
}
.dark .payment-dialog {
  background: #0f172a;
  border-color: rgba(255,255,255,0.05);
}

.payment-header {
  background: linear-gradient(135deg, #0f172a 0%, #0369a1 50%, #0284c7 100%);
  padding: 24px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.payment-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.payment-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff !important;
  margin: 0;
}

.payment-subtitle {
  font-size: 0.8rem;
  color: #bae6fd !important;
  margin: 0;
}

.payment-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.payment-close-btn:hover {
  background: rgba(239, 68, 68, 0.6);
  transform: rotate(90deg);
}

.payment-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dark .payment-body {
  background: #0f172a;
}

.payment-input-group {
  display: flex;
  flex-direction: column;
}

.payment-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  letter-spacing: 0.6px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.dark .payment-label {
  color: #94a3b8;
}

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

.payment-input-prefix {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-weight: 700;
  font-size: 0.9rem;
  pointer-events: none;
  z-index: 1;
}

.payment-input {
  width: 100%;
  padding: 10px 14px 10px 32px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #1e293b;
  outline: none;
  transition: all 0.15s;
}
.payment-input:focus {
  background: #ffffff;
  border-color: #0284c7;
  box-shadow: 0 0 0 4px rgba(2,132,199,0.12);
}
.payment-input::placeholder {
  color: #cbd5e1;
}
.dark .payment-input {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.dark .payment-input:focus {
  background: #0f172a;
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56,189,248,0.15);
}

/* Balance Cards */
.payment-balance-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.payment-balance-pending {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.dark .payment-balance-pending {
  background: rgba(220,38,38,0.1);
  border-color: rgba(220,38,38,0.2);
}
.payment-balance-pending .payment-balance-icon {
  color: #dc2626;
}
.payment-balance-pending .payment-balance-label {
  color: #dc2626;
}
.payment-balance-pending .payment-balance-amount {
  color: #dc2626;
}

.payment-balance-partial {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.dark .payment-balance-partial {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.2);
}
.payment-balance-partial .payment-balance-icon {
  color: #d97706;
}
.payment-balance-partial .payment-balance-label {
  color: #d97706;
}
.payment-balance-partial .payment-balance-amount {
  color: #d97706;
}

.payment-balance-paid {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.dark .payment-balance-paid {
  background: rgba(22,163,74,0.1);
  border-color: rgba(22,163,74,0.2);
}
.payment-balance-paid .payment-balance-icon {
  color: #16a34a;
}
.payment-balance-paid .payment-balance-label {
  color: #16a34a;
}
.payment-balance-paid .payment-balance-amount {
  color: #16a34a;
}

.payment-balance-icon svg {
  width: 20px;
  height: 20px;
}

.payment-balance-info {
  display: flex;
  flex-direction: column;
}

.payment-balance-label {
  font-size: 0.75rem;
  font-weight: 600;
}

.payment-balance-amount {
  font-size: 1.1rem;
  font-weight: 700;
}

.payment-footer {
  padding: 0 24px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.dark .payment-footer {
  background: #0f172a;
}

.payment-btn-cancel {
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.payment-btn-cancel:hover {
  background: #e2e8f0;
}
.dark .payment-btn-cancel {
  color: #94a3b8;
  background: #1e293b;
}
.dark .payment-btn-cancel:hover {
  background: #334155;
}

.payment-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.payment-btn-save:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}
.payment-btn-save:active {
  transform: translateY(0);
}

/* Close Button */
.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.6);
  transform: rotate(90deg);
}

/* Body */
.modal-body {
  padding: 24px;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dark .modal-body {
  background: #0f172a;
}

/* Footer */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.dark .modal-footer {
  border-top-color: #1e293b;
}

.modal-btn-cancel {
  padding: 10px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-btn-cancel:hover {
  background: #e2e8f0;
}
.dark .modal-btn-cancel {
  color: #94a3b8;
  background: #1e293b;
}
.dark .modal-btn-cancel:hover {
  background: #334155;
}

.modal-btn-save {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}
.modal-btn-save:hover {
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
  transform: translateY(-1px);
}
.modal-btn-save:active {
  transform: translateY(0);
}

/* Razón Social Cell */
.razon-social-cell {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  transition: all 0.2s;
  max-width: 180px;
}
.razon-social-cell:hover {
  background: #f0f9ff;
  border-color: #93c5fd;
}
.dark .razon-social-cell {
  background: #1e293b;
  border-color: #334155;
}
.dark .razon-social-cell:hover {
  background: #0c1a2e;
  border-color: #3b82f6;
}

.razon-social-icon {
  width: 14px;
  height: 14px;
  color: #64748b;
  flex-shrink: 0;
}
.dark .razon-social-icon {
  color: #94a3b8;
}

.razon-social-text {
  display: inline-block;
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}
.dark .razon-social-text {
  color: #e2e8f0;
}

.badge-persona-natural {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  background: #f1f5f9;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  letter-spacing: 0.3px;
}
.dark .badge-persona-natural {
  color: #64748b;
  background: #1e293b;
  border-color: #334155;
}

.sticky-col {
  position: sticky;
  left: 0;
  background: var(--bg-card);
  z-index: 4;
  box-shadow: 3px 0 6px rgba(0,0,0,0.04);
}

/* ============================================================
   STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid;
  white-space: nowrap;
}

.status-Pendiente    { color: var(--status-pending);   background: var(--status-pending-bg);   border-color: var(--status-pending-bdr); }
.status-En.proceso   { color: var(--status-process);   background: var(--status-process-bg);   border-color: var(--status-process-bdr); }
.status-En.revision  { color: var(--status-review);    background: var(--status-review-bg);    border-color: var(--status-review-bdr); }
.status-Entregado    { color: var(--status-delivered); background: var(--status-delivered-bg); border-color: var(--status-delivered-bdr); }
.status-Cancelado    { color: var(--status-cancelled); background: var(--status-cancelled-bg); border-color: var(--status-cancelled-bdr); }

/* ============================================================
   INLINE TABLE CONTROLS
   ============================================================ */
.inline-select {
  background: transparent;
  border: 1px solid transparent;
  padding: 0.2rem 0.35rem;
  border-radius: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
  color: var(--text-main);
}
.inline-select:hover,
.inline-select:focus {
  border-color: var(--border-color);
  background: rgba(0,0,0,0.02);
}
.dark .inline-select:hover,
.dark .inline-select:focus { background: rgba(255,255,255,0.04); }

/* ============================================================
   KANBAN BOARD
   ============================================================ */
.kanban-column {
  min-height: 500px;
  background: rgba(0,71,147,0.012);
  border: 1.5px dashed var(--border-color);
  border-radius: 1rem;
  padding: 0.85rem;
  transition: all 0.2s ease;
}
.dark .kanban-column { background: rgba(255,255,255,0.008); }

.kanban-column.drag-over {
  background: rgba(0,182,235,0.05);
  border-color: var(--accent);
  border-style: solid;
}

.kanban-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  border-radius: 0.75rem;
  padding: 0.9rem;
  margin-bottom: 0.65rem;
  cursor: grab;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.kanban-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0,182,235,0.3);
}
.kanban-card:active { cursor: grabbing; transform: scale(0.98); }

/* ============================================================
   FILE UPLOAD ZONE
   ============================================================ */
.upload-zone {
  border: 2px dashed var(--border-color);
  border-radius: 0.875rem;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: rgba(0,71,147,0.008);
  transition: all 0.2s ease;
}
.upload-zone:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}
.file-upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

[contenteditable="true"] {
  outline: none;
  transition: all 0.2s ease;
  border-radius: 6px;
}

[contenteditable="true"]:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: var(--sidebar-active-bg);
}
.upload-zone.drag-active {
  border-color: var(--accent);
  background: rgba(0,182,235,0.08);
}

/* ============================================================
   THEME TOGGLE SWITCH
   ============================================================ */
.theme-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
  flex-shrink: 0;
}
.theme-switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #CBD5E1;
  transition: 0.3s;
  border-radius: 99px;
}
.slider::before {
  content: '';
  position: absolute;
  height: 14px; width: 14px;
  left: 3px; bottom: 3px;
  background: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .slider { background: var(--accent); }
input:checked + .slider::before { transform: translateX(20px); }

/* ============================================================
   FORM INPUTS
   ============================================================ */
.form-input {
  width: 100%;
  padding: 0.55rem 0.8rem;
  border-radius: 0.5rem;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  outline: none;
  font-size: 0.8rem;
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
}
.form-input::placeholder { color: var(--text-subtle); }
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input.valid   { border-color: #10B981; }
.form-input.invalid { border-color: #EF4444; }

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent);
  box-shadow: var(--shadow-lg);
  border-radius: 0.75rem;
  padding: 0.8rem 1rem;
  min-width: 260px;
  max-width: 340px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  pointer-events: all;
  animation: slideInRight 0.3s cubic-bezier(0.22,1,0.36,1) forwards;
}
.toast-success  { border-left-color: #10B981; }
.toast-warning  { border-left-color: #F59E0B; }
.toast-danger   { border-left-color: #EF4444; }

/* ============================================================
   MODAL BACKDROP
   ============================================================ */
.modal-backdrop {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(10,15,30,0.45);
}

/* ============================================================
   CHART CONTAINERS
   ============================================================ */
.chart-wrapper {
  position: relative;
  width: 100%;
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-gradient {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
  body { background: #FFFFFF !important; color: #000000 !important; }
  aside, header, #btn-new-order, .theme-switch, .toast-container,
  td:last-child, th:last-child, .no-print { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; }
  .table-container { box-shadow: none !important; border: 1px solid #DDD !important; }

  .custom-table td { border-bottom-color: #E2E8F0 !important; }
}

/* ============================================================
   DATE PICKER INPUT — Blue Theme
   ============================================================ */
.date-display-cell {
  border: 1px solid transparent;
  min-width: 110px;
}

.date-display-cell:hover {
  border-color: rgba(0, 71, 147, 0.15);
}

.dark .date-display-cell:hover {
  border-color: rgba(0, 182, 235, 0.25);
}

/* ============================================================
   AUTOCOMPLETE DROPDOWNS — Blue Theme
   ============================================================ */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  max-height: 220px;
  overflow-y: auto;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 71, 147, 0.12), 0 4px 12px rgba(0,0,0,0.06);
  margin-top: 4px;
  padding: 4px;
}

.dark .autocomplete-dropdown {
  background: #0F172A;
  border-color: #1E293B;
  box-shadow: 0 12px 40px rgba(0, 182, 235, 0.08), 0 4px 12px rgba(0,0,0,0.3);
}

.autocomplete-item {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.autocomplete-item:hover {
  background: rgba(0, 71, 147, 0.06);
  color: #004793;
}

.dark .autocomplete-item {
  color: #94A3B8;
}

.dark .autocomplete-item:hover {
  background: rgba(0, 182, 235, 0.1);
  color: #00B6EB;
}

.autocomplete-item.autocomplete-new {
  color: #004793;
  font-weight: 600;
  border-top: 1px solid #F1F5F9;
  margin-top: 2px;
  padding-top: 10px;
}

.dark .autocomplete-item.autocomplete-new {
  color: #00B6EB;
  border-color: #1E293B;
}

.autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 3px;
}

.dark .autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: #334155;
}

/* ============================================================
   SOPORTE VIEW
   ============================================================ */
#view-soporte {
  flex-direction: column;
  background: #f1f5f9;
  overflow-y: auto;
}

#view-soporte:not(.hidden) {
  display: flex;
}


/* ============================================================
   MAIN CONTAINER: flex column so views fill remaining space
   ============================================================ */
#main-scroll-container > main {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100%;
  min-width: 0;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
  align-self: stretch;
}

/* ============================================================
   REVISIONES VIEW
   ============================================================ */
#view-revisiones:not(.hidden) {
  /* Match the standard workspace flow used by Solicitudes de Diseño. */
  display: block !important;
  align-self: stretch;
  margin: 0 !important;
  padding: 1.5rem !important;
  width: calc(100vw - 16rem) !important;
  max-width: calc(100vw - 16rem);
  box-sizing: border-box;
  min-width: 0;
  flex: none !important;
  min-height: 0 !important;
  background: #f1f5f9;
  overflow-x: hidden !important;
  overflow-y: visible !important;
}

#view-revisiones > *:first-child {
  margin-top: 0 !important;
}

#rev-stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

#revisiones-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  width: 100%;
  align-items: start;
}

@media (max-width: 900px) {
  #main-scroll-container { width: 100%; max-width: 100%; }
  #view-revisiones:not(.hidden) { width: 100% !important; max-width: 100%; padding: 1rem !important; }
  #rev-stats-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #revisiones-list { grid-template-columns: 1fr; }
}

.revisiones-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 0%;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
  overflow-y: auto;
  overflow-x: hidden;
}

.soporte-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  padding: 12px;
}

/* ============================================================
   SOPORTE CHAT ANIMATIONS
   ============================================================ */
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   GLOBAL LOADING OVERLAY
   ============================================================ */
.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinLoader 0.7s linear infinite;
}

/* ============================================================
   PLAN FILTERS BUTTONS STYLING
   ============================================================ */
.filter-btn {
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.filter-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ============================================================
   TAILWIND CSS UTILITY FALLBACKS
   These classes are injected so the layout renders correctly
   even when the Tailwind Play CDN (cdn.tailwindcss.com) fails
   to load due to network issues (ERR_NAME_NOT_RESOLVED).
   ============================================================ */

/* --- Display --- */
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.hidden { display: none; }
.table { display: table; }

/* --- Position --- */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.inset-y-0 { top: 0; bottom: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }
.-top-1 { top: -0.25rem; }
.-right-1 { right: -0.25rem; }

/* --- Z-Index --- */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-\[9999\] { z-index: 150000; }

/* --- Flexbox --- */
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.justify-start { justify-content: flex-start; }

/* --- Gap --- */
.gap-1 { gap: 0.25rem; }
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-2\.5 { gap: 0.625rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-y-0\.5 { row-gap: 0.125rem; }

/* --- Width --- */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-2 { width: 0.5rem; }
.w-3 { width: 0.75rem; }
.w-3\.5 { width: 0.875rem; }
.w-4 { width: 1rem; }
.w-4\.5 { width: 1.125rem; }
.w-5 { width: 1.25rem; }
.w-5\.5 { width: 1.375rem; }
.w-6 { width: 1.5rem; }
.w-7 { width: 1.75rem; }
.w-8 { width: 2rem; }
.w-9 { width: 2.25rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-60 { width: 15rem; }
.w-\[320px\] { width: 320px; }
.min-w-0 { min-width: 0; }
.min-w-\[18px\] { min-width: 18px; }
.max-w-xs { max-width: 20rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }

/* --- Height --- */
.h-2 { height: 0.5rem; }
.h-3 { height: 0.75rem; }
.h-3\.5 { height: 0.875rem; }
.h-4 { height: 1rem; }
.h-4\.5 { height: 1.125rem; }
.h-5 { height: 1.25rem; }
.h-5\.5 { height: 1.375rem; }
.h-6 { height: 1.5rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-9 { height: 2.25rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-14 { height: 3.5rem; }
.h-16 { height: 4rem; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.h-\[18px\] { height: 18px; }
.min-h-0 { min-height: 0; }
.min-h-screen { min-height: 100vh; }

/* --- Padding --- */
.p-1 { padding: 0.25rem; }
.p-1\.5 { padding: 0.375rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-1\.5 { padding-left: 0.375rem; padding-right: 0.375rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pt-3 { padding-top: 0.75rem; }
.pb-1 { padding-bottom: 0.25rem; }
.pb-3 { padding-bottom: 0.75rem; }
.pl-3\.5 { padding-left: 0.875rem; }

/* --- Margin --- */
.m-0 { margin: 0; }
.mx-4 { margin-left: 1rem; margin-right: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-0 { margin-left: 0; }

/* --- Overflow --- */
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-auto { overflow: auto; }

/* --- Border Radius --- */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-full { border-radius: 9999px; }

/* --- Border --- */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-transparent { border-color: transparent; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-300 { border-color: #cbd5e1; }

/* --- Background Colors --- */
.bg-white { background-color: #ffffff; }
.bg-black { background-color: #000000; }
.bg-transparent { background-color: transparent; }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-950 { background-color: #020617; }
.bg-red-500 { background-color: #ef4444; }
.bg-amber-500 { background-color: #f59e0b; }
.bg-green-500 { background-color: #22c55e; }
.bg-brand-light { background-color: #F8FAFC; }
.bg-brand-blue { background-color: #004793; }

/* --- Text Colors --- */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-slate-600 { color: #475569; }
.text-slate-700 { color: #334155; }
.text-slate-800 { color: #1e293b; }

/* --- Font Size --- */
.text-\[9px\] { font-size: 9px; }
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* --- Font Weight --- */
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }

/* --- Font Family --- */
.font-sans { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif; }
.font-poppins { font-family: 'Poppins', sans-serif; }

/* --- Tracking & Leading --- */
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-none { line-height: 1; }

/* --- Text Transform --- */
.uppercase { text-transform: uppercase; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-1 { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }

/* --- Opacity --- */
.opacity-0 { opacity: 0; }
.opacity-30 { opacity: 0.3; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* --- Object Fit --- */
.object-cover { object-fit: cover; }
.object-contain { object-fit: contain; }

/* --- Cursor --- */
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }

/* --- Shadow --- */
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); }

/* --- Transition --- */
.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.duration-150 { transition-duration: 150ms; }
.duration-200 { transition-duration: 200ms; }
.duration-250 { transition-duration: 250ms; }
.duration-300 { transition-duration: 300ms; }

/* --- Transform --- */
.-translate-x-full { transform: translateX(-100%); }
.translate-x-0 { transform: translateX(0); }

/* --- Backdrop --- */
.backdrop-blur { backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.backdrop-blur-md { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.backdrop-blur-xs { backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }

/* --- Grid Columns --- */
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }

/* --- Space --- */
.space-y-1 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.space-y-2 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.space-y-2\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.625rem; }
.space-y-3 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.space-y-4 > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.space-x-2 > :not([hidden]) ~ :not([hidden]) { margin-left: 0.5rem; }

/* --- Whitespace & Word --- */
.whitespace-nowrap { white-space: nowrap; }
.break-words { overflow-wrap: break-word; }

/* --- Animations --- */
.animate-scale {
  animation: scaleIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}

/* --- Gradient backgrounds --- */
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-from, transparent), var(--tw-gradient-to, transparent)); }
.from-\[\#004793\] { --tw-gradient-from: #004793; --tw-gradient-to: #004793; }
.to-\[\#00B6EB\] { --tw-gradient-to: #00B6EB; }
.from-brand-blue { --tw-gradient-from: #004793; --tw-gradient-to: #004793; }
.to-brand-cyan { --tw-gradient-to: #00B6EB; }
.from-brand-dark { --tw-gradient-from: #003670; --tw-gradient-to: #003670; }

/* --- Arbitrary values used in the HTML --- */
.bg-brand-darkbg { background-color: #0B0F19; }
.bg-brand-cyan { background-color: #00B6EB; }
.text-brand-blue { color: #004793; }
.text-brand-cyan { color: #00B6EB; }
.border-brand-cyan { border-color: #00B6EB; }

/* --- Scrollbar & selection --- */
.scrollbar-thin { scrollbar-width: thin; }

/* --- Responsive: lg (1024px+) --- */
@media (min-width: 1024px) {
  .lg\:translate-x-0 { transform: translateX(0); }
  .lg\:ml-60 { margin-left: 15rem; }
  .lg\:hidden { display: none; }
  .lg\:block { display: block; }
  .lg\:flex { display: flex; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- Responsive: md (768px+) --- */
@media (min-width: 768px) {
  .md\:block { display: block; }
  .md\:hidden { display: none; }
  .md\:flex { display: flex; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Responsive: sm (640px+) --- */
@media (min-width: 640px) {
  .sm\:block { display: block; }
  .sm\:hidden { display: none; }
  .sm\:flex { display: flex; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Hover states (only when Tailwind is NOT loaded) --- */
.hover\:bg-slate-50:hover { background-color: #f8fafc; }
.hover\:text-slate-800:hover { color: #1e293b; }
.hover\:text-slate-600:hover { color: #475569; }
.hover\:text-red-500:hover { color: #ef4444; }
.hover\:text-red-600:hover { color: #dc2626; }
.hover\:border-brand-cyan:hover { border-color: #00B6EB; }
.hover\:bg-red-500\/10:hover { background-color: rgba(239,68,68,0.1); }
.hover\:from-brand-dark:hover { --tw-gradient-from: #003670; }

/* ============================================================
   ADDITIONAL TAILWIND UTILITY FALLBACKS — VISUAL POLISH
   Missing utilities for line-height, colors, spacing, grids,
   and interactive states used throughout the dashboard.
   ============================================================ */

/* --- Line-Height / Leading --- */
.leading-none { line-height: 1; }
.leading-tight { line-height: 1.25; }
.leading-snug { line-height: 1.375; }
.leading-normal { line-height: 1.5; }
.leading-relaxed { line-height: 1.625; }

/* --- Tracking (letter-spacing) --- */
.tracking-tight { letter-spacing: -0.025em; }
.tracking-normal { letter-spacing: 0em; }
.tracking-widest { letter-spacing: 0.1em; }

/* --- Additional Margin --- */
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }

/* --- Additional Padding --- */
.p-3\.5 { padding: 0.875rem; }
.pl-9 { padding-left: 2.25rem; }
.pr-4 { padding-right: 1rem; }
.pl-1\.5 { padding-left: 0.375rem; }

/* --- Additional Width/Height --- */
.w-2\.5 { width: 0.625rem; }
.w-44 { width: 11rem; }
.h-2\.5 { height: 0.625rem; }
.h-44 { height: 11rem; }
.h-64 { height: 16rem; }

/* --- Space-Y additions --- */
.space-y-1\.5 > :not([hidden]) ~ :not([hidden]) { margin-top: 0.375rem; }
.space-y-6 > :not([hidden]) ~ :not([hidden]) { margin-top: 1.5rem; }

/* --- Text Colors (dashboard) --- */
.text-emerald-500 { color: #10b981; }
.text-red-500 { color: #ef4444; }
.text-purple-500 { color: #8b5cf6; }
.text-blue-500 { color: #3b82f6; }
.text-amber-500 { color: #f59e0b; }
.text-\[\#00B6EB\] { color: #00B6EB; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-450 { color: #7c8fa8; }

/* --- Background Colors (dashboard cards) --- */
.bg-amber-50 { background-color: #fffbeb; }
.bg-purple-50 { background-color: #faf5ff; }
.bg-emerald-50 { background-color: #ecfdf5; }
.bg-blue-50 { background-color: #eff6ff; }
.bg-red-50 { background-color: #fef2f2; }
.bg-slate-50\/50 { background-color: rgba(248,250,252,0.5); }

/* --- Border Colors (additional) --- */
.border-slate-700 { border-color: #334155; }
.border-slate-800 { border-color: #1e293b; }

/* --- Grid: grid-cols-1 --- */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

/* --- Col/Row Span --- */
.col-span-2 { grid-column: span 2 / span 2; }

/* --- Focus states --- */
.focus\:outline-none:focus { outline: 2px solid transparent; outline-offset: 2px; }
.focus\:border-brand-cyan:focus { border-color: #00B6EB; }
.focus\:bg-white:focus { background-color: #ffffff; }

/* --- Active state --- */
.active\:scale-97:active { transform: scale(0.97); }

/* --- Responsive: md grid-cols-5 --- */
@media (min-width: 768px) {
  .md\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .md\:col-span-1 { grid-column: span 1 / span 1; }
}

/* --- Responsive: lg col-span --- */
@media (min-width: 1024px) {
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
}

/* --- Responsive: sm grid-cols additions --- */
@media (min-width: 640px) {
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Hover: shadow-lg --- */
.hover\:shadow-lg:hover { box-shadow: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); }
.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:bg-brand-dark:hover { background-color: #003670; }

/* --- Blur-sm for app wrapper lock state --- */
.blur-sm { filter: blur(4px); }

/* --- Rounded-sm --- */
.rounded-sm { border-radius: 0.125rem; }

/* --- Whitespace --- */
.whitespace-nowrap { white-space: nowrap; }

/* ============================================================
   FLATPICKR CUSTOM THEME - Nextal Graphic (v2)
   ============================================================ */
.flatpickr-calendar {
  border-radius: 16px !important;
  box-shadow: 0 20px 30px -10px rgba(0,0,0,0.18), 0 10px 15px -5px rgba(0,0,0,0.08) !important;
  border: 1px solid #e2e8f0 !important;
  overflow: hidden !important;
  font-family: inherit !important;
  background: #ffffff !important;
  z-index: 150000 !important;
  padding-bottom: 8px !important;
  width: 310px !important;
}
.dayContainer { min-width: 310px !important; max-width: 310px !important; }
.flatpickr-days { border: none !important; padding: 4px 6px 8px !important; }

/* Header */
.flatpickr-months {
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%) !important;
  padding: 12px 16px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  position: relative !important;
  border: none !important;
}
.flatpickr-month { background: transparent !important; height: auto !important; }

/* Month/Year text */
.flatpickr-current-month {
  color: #ffffff !important;
  font-weight: 700 !important;
  font-size: 1rem !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  position: static !important;
  width: auto !important;
  pointer-events: none !important;
}
.flatpickr-current-month span.cur-month,
.flatpickr-current-month input.cur-year {
  color: #ffffff !important;
  font-weight: 700 !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months:after { display: none !important; }
.flatpickr-current-month .flatpickr-monthDropdown-months option {
  color: #1e293b !important;
  background: #fff !important;
}

/* Nav arrows */
.flatpickr-prev-month,
.flatpickr-next-month {
  position: static !important;
  height: 32px !important;
  width: 32px !important;
  padding: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 8px !important;
  transition: all 0.2s ease !important;
  color: #fff !important;
  background: transparent !important;
}
.flatpickr-prev-month:hover,
.flatpickr-next-month:hover {
  background-color: rgba(255,255,255,0.25) !important;
}
.flatpickr-prev-month svg,
.flatpickr-next-month svg {
  fill: #ffffff !important;
  width: 14px !important;
  height: 14px !important;
}

/* Weekdays */
.flatpickr-weekdays {
  background: #ffffff !important;
  border: none !important;
  padding-top: 8px !important;
  margin: 0 !important;
}
span.flatpickr-weekday {
  color: #94a3b8 !important;
  font-weight: 600 !important;
  font-size: 0.75rem !important;
  text-transform: uppercase !important;
  background: transparent !important;
}

/* Days */
span.flatpickr-day {
  border-radius: 10px !important;
  color: #334155 !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  height: 38px !important;
  line-height: 38px !important;
  max-width: 38px !important;
  margin: 1px auto !important;
  border: none !important;
  background: transparent !important;
}
span.flatpickr-day.today {
  border: 1.5px solid #2563eb !important;
  color: #2563eb !important;
  background: transparent !important;
}
span.flatpickr-day.selected,
span.flatpickr-day.selected:hover {
  background: #2563eb !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 10px rgba(37,99,235,0.35) !important;
}
span.flatpickr-day:hover {
  background: #f1f5f9 !important;
}
span.flatpickr-day.prevMonthDay,
span.flatpickr-day.nextMonthDay {
  color: #cbd5e1 !important;
  opacity: 0.5;
}

/* ============================================================
   ASIGNACIÓN DE CREATIVOS - Dropdown con Presencia y Especialidad
   ============================================================ */
.ng-dropdown-menu {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
.ng-dropdown-menu::-webkit-scrollbar { width: 4px; }
.ng-dropdown-menu::-webkit-scrollbar-track { background: transparent; }
.ng-dropdown-menu::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.asign-tab-btn {
  transition: all 0.15s ease;
}
.asign-designer-opt {
  transition: all 0.12s ease;
}

/* Presence dot pulse animation */
@keyframes presencePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.bg-emerald-500 { animation: presencePulse 2s ease-in-out infinite; }

/* ============================================================
   MODAL ASIGNAR CREATIVO
   ============================================================ */
.btn-filtro-modal {
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-filtro-modal.active {
  transform: scale(1.02);
}
#contenedorTarjetasCreativos {
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}
#contenedorTarjetasCreativos::-webkit-scrollbar { width: 5px; }
#contenedorTarjetasCreativos::-webkit-scrollbar-track { background: transparent; }
#contenedorTarjetasCreativos::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }

/* Modal Asignar Diseñador */
.asignar-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  z-index: 100000;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.dark .asignar-dialog {
  background: #0f172a;
}

.asignar-header {
  background: linear-gradient(135deg, #0f172a 0%, #0369a1 50%, #0284c7 100%);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.asignar-header-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.asignar-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff !important;
  margin: 0;
}

.asignar-subtitle {
  font-size: 0.8rem;
  color: #bae6fd !important;
  margin: 0;
}

.asignar-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.asignar-close-btn:hover {
  background: rgba(239, 68, 68, 0.6);
  transform: rotate(90deg);
}

.asignar-filters {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.dark .asignar-filters {
  border-bottom-color: #1e293b;
}

.asignar-designer-list {
  padding: 16px;
  overflow-y: auto;
  max-height: 380px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}
.dark .asignar-designer-list {
  background: rgba(30,41,59,0.3);
}
.asignar-designer-list::-webkit-scrollbar { width: 5px; }
.asignar-designer-list::-webkit-scrollbar-track { background: transparent; }
.asignar-designer-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }

/* Designer Card */
.designer-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.designer-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}
.designer-card-selected {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15) !important;
}
.dark .designer-card {
  background: #0f172a;
  border-color: #1e293b;
}
.dark .designer-card:hover {
  border-color: #38bdf8;
  box-shadow: 0 4px 12px rgba(56,189,248,0.1);
}

.designer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.designer-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.designer-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}
.dark .designer-avatar {
  border-color: #334155;
}

.designer-avatar-fallback {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.designer-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.dark .designer-name {
  color: #f1f5f9;
}

.designer-contact {
  font-size: 0.72rem;
  color: #94a3b8;
  margin: 2px 0 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dark .designer-contact {
  color: #64748b;
}

.designer-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.designer-description {
  font-size: 0.78rem;
  color: #475569;
  line-height: 1.35;
  background-color: #f8fafc;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid #0284c7;
  margin: 0;
}
.dark .designer-description {
  background-color: rgba(30,41,59,0.5);
  color: #94a3b8;
  border-left-color: #38bdf8;
}

.designer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.dark .designer-footer {
  border-top-color: #1e293b;
}

.designer-orders-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
}
.dark .designer-orders-count {
  color: #64748b;
}

.designer-btn-assign {
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(2,132,199,0.25);
}
.designer-btn-assign:hover {
  box-shadow: 0 4px 10px rgba(2,132,199,0.35);
  transform: translateY(-1px);
}

.designer-btn-assigned {
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #0284c7;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  cursor: default;
}
.dark .designer-btn-assigned {
  color: #38bdf8;
  background: rgba(56,189,248,0.1);
  border-color: rgba(56,189,248,0.2);
}

.asignar-footer {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}
.dark .asignar-footer {
  border-top-color: #1e293b;
}

.asignar-btn-unassign {
  font-size: 0.75rem;
  font-weight: 600;
  color: #dc2626;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}
.asignar-btn-unassign:hover {
  background: #fef2f2;
}
.dark .asignar-btn-unassign {
  color: #f87171;
}
.dark .asignar-btn-unassign:hover {
  background: rgba(220,38,38,0.1);
}

.asignar-btn-close {
  padding: 8px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}
.asignar-btn-close:hover {
  background: #e2e8f0;
}
.dark .asignar-btn-close {
  color: #94a3b8;
  background: #1e293b;
}
.dark .asignar-btn-close:hover {
  background: #334155;
}

/* ============================================================
   POPUP LOCAL DISEÑADOR (EXCLUSIVO NUEVO PEDIDO)
   ============================================================ */
.popup-disenador-local-dialog {
  background: #ffffff;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  border-radius: 18px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.4);
  z-index: 200001;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  animation: popupLocalScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popupLocalScaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}
.dark .popup-disenador-local-dialog {
  background: #0f172a;
  border-color: #1e293b;
}

.popup-disenador-local-header {
  background: linear-gradient(135deg, #0f172a 0%, #0369a1 50%, #0284c7 100%);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.popup-disenador-local-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.popup-disenador-local-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #ffffff !important;
  margin: 0;
  line-height: 1.2;
}

.popup-disenador-local-subtitle {
  font-size: 0.75rem;
  color: #bae6fd !important;
  margin: 2px 0 0;
}

.popup-disenador-local-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.popup-disenador-local-close:hover {
  background: rgba(239, 68, 68, 0.65);
  transform: rotate(90deg);
}

.popup-disenador-local-search {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #f8fafc;
}
.dark .popup-disenador-local-search {
  border-bottom-color: #1e293b;
  background: rgba(30,41,59,0.4);
}

.popup-disenador-local-search input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  font-size: 0.78rem;
  color: #0f172a;
  outline: none;
  transition: all 0.15s;
  font-family: inherit;
}
.popup-disenador-local-search input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}
.dark .popup-disenador-local-search input {
  background: #0f172a;
  border-color: #334155;
  color: #f1f5f9;
}

.popup-disenador-local-list {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
  max-height: 380px;
}
.dark .popup-disenador-local-list {
  background: rgba(30,41,59,0.3);
}
.popup-disenador-local-list::-webkit-scrollbar { width: 5px; }
.popup-disenador-local-list::-webkit-scrollbar-track { background: transparent; }
.popup-disenador-local-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }

.popup-disenador-local-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.18s;
}
.popup-disenador-local-card:hover {
  border-color: #38bdf8;
  background: #f0f9ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.08);
}
.popup-disenador-local-card-selected {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.15) !important;
  background: #eff6ff !important;
}
.dark .popup-disenador-local-card {
  background: #0f172a;
  border-color: #1e293b;
}
.dark .popup-disenador-local-card:hover {
  border-color: #38bdf8;
  background: rgba(56,189,248,0.06);
  box-shadow: 0 6px 16px rgba(56,189,248,0.08);
}
.dark .popup-disenador-local-card-selected {
  border-color: rgba(59,130,246,0.7) !important;
  background: rgba(59,130,246,0.1) !important;
}

.popup-disenador-local-footer {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
  background: #ffffff;
  gap: 10px;
}
.dark .popup-disenador-local-footer {
  border-top-color: #1e293b;
  background: #0f172a;
}

.popup-disenador-local-unassign {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #dc2626;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.15s;
  font-family: inherit;
}
.popup-disenador-local-unassign:hover {
  background: #fef2f2;
}
.dark .popup-disenador-local-unassign {
  color: #f87171;
}
.dark .popup-disenador-local-unassign:hover {
  background: rgba(220,38,38,0.1);
}

.popup-disenador-local-cancel {
  padding: 8px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.popup-disenador-local-cancel:hover {
  background: #e2e8f0;
}
.dark .popup-disenador-local-cancel {
  color: #94a3b8;
  background: #1e293b;
}
.dark .popup-disenador-local-cancel:hover {
  background: #334155;
}

/* Badge Asignado A */
.badge-asignado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #93c5fd;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.badge-asignado:hover {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(59,130,246,0.15);
}
.dark .badge-asignado {
  background: linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(96,165,250,0.1) 100%);
  border-color: rgba(96,165,250,0.3);
}

.badge-asignado-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-asignado-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.badge-asignado-initials {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.badge-asignado-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e40af;
  white-space: nowrap;
}
.dark .badge-asignado-name {
  color: #93c5fd;
}

.badge-unassigned {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 20px;
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.badge-unassigned:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #64748b;
}
.dark .badge-unassigned {
  background: rgba(30,41,59,0.5);
  border-color: rgba(51,65,85,0.5);
  color: #64748b;
}
.dark .badge-unassigned:hover {
  background: rgba(30,41,59,0.8);
  color: #94a3b8;
}

/* Cell Costo Diseñador */
.cell-costo-disenador {
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
}
.dark .cell-costo-disenador {
  color: #94a3b8;
}

/* Badge Pago Disenador/Asesor */
.badge-pago-dis {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.badge-pago-dis:hover {
  opacity: 0.8;
}

.badge-pago-ok {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.dark .badge-pago-ok {
  background: rgba(22,163,74,0.15);
  color: #4ade80;
  border-color: rgba(74,222,128,0.2);
}

.badge-pago-pend {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
}
.dark .badge-pago-pend {
  background: rgba(245,158,11,0.15);
  color: #fbbf24;
  border-color: rgba(251,191,36,0.2);
}

/* ============================================================
   CREATIVOS DIRECTORY
   ============================================================ */
.creative-card {
  display: flex;
  min-height: 284px;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.045);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.creative-card:hover { border-color: rgba(0, 182, 235, 0.42); box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08); transform: translateY(-2px); }
.creative-card-action { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 10px; color: #64748b; background: #f8fafc; cursor: pointer; transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease; }
.creative-card-action:hover { color: #004793; background: #e8f0fb; border-color: #bfdbfe; transform: translateY(-1px); }
.creative-card-action-danger:hover { color: #dc2626; background: #fef2f2; border-color: #fecaca; }
.creative-role { display: inline-flex; margin-top: 4px; padding: 3px 9px; border: 1px solid #bae6fd; border-radius: 7px; background: #f0f9ff; color: #0284c7; font-size: 11px; font-weight: 700; line-height: 1.2; }
.creative-status { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border: 2px solid #fff; border-radius: 50%; background: #94a3b8; }
.creative-status.is-active { background: #10b981; }
.creative-contact { padding-top: 12px; border-top: 1px solid #f1f5f9; color: #64748b; font-size: 12px; line-height: 1.7; }
.creative-contact p { margin: 0; }
.creative-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: auto; padding-top: 2px; }
.creative-metric { position: relative; display: flex; min-height: 76px; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; padding: 12px; border: 1px solid #eef2f7; border-radius: 14px; background: #f8fafc; }
.creative-metric::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: #00b6eb; }
.creative-metric-balance { border-color: #fef3c7; background: #fffbeb; }
.creative-metric-balance::before { background: #f59e0b; }
.creative-primary-action { display: inline-flex; align-items: center; gap: 6px; padding: 11px 16px; border: 0; border-radius: 12px; background: #0284c7; color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 4px 12px rgba(2, 132, 199, .18); cursor: pointer; transition: background .2s ease, transform .2s ease, box-shadow .2s ease; }
.creative-primary-action:hover { background: #0369a1; box-shadow: 0 6px 16px rgba(2, 132, 199, .24); transform: translateY(-1px); }
.dark .creative-card { background: #131e2e; border-color: rgba(255,255,255,.08); }
.dark .creative-role { border-color: rgba(14,165,233,.35); background: rgba(14,165,233,.12); color: #7dd3fc; }
.dark .creative-contact { border-color: rgba(255,255,255,.08); color: #94a3b8; }
.dark .creative-metric { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.04); }
.dark .creative-metric-balance { border-color: rgba(245,158,11,.25); background: rgba(245,158,11,.08); }
@media (prefers-reduced-motion: reduce) { .creative-card, .creative-card-action, .creative-primary-action { transition: none; } .creative-card:hover, .creative-card-action:hover, .creative-primary-action:hover { transform: none; } }

/* Mantiene el directorio de Creativos en tarjetas compactas aun cuando las utilidades de grid se cargan despues. */
@media (min-width: 768px) { #creativos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1280px) { #creativos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { #creativos-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Escritorio: el men� forma parte del layout y nunca tapa el espacio de trabajo. */
@media (min-width: 1024px) {
  #app-wrapper { display: flex !important; }
  #app-sidebar {
    position: static !important;
    inset: auto !important;
    flex: 0 0 16rem !important;
    width: 16rem !important;
    min-width: 16rem !important;
    height: 100% !important;
    transform: none !important;
  }
  #main-scroll-container {
    display: flex !important;
    flex: 1 1 auto !important;
    width: calc(100vw - 16rem) !important;
    max-width: calc(100vw - 16rem) !important;
    min-width: 0 !important;
  }
  #main-scroll-container > main,
  #view-creativos:not(.hidden) {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
  }
}

/* Modal de Creativos: siempre centrado sobre toda la ventana. */
#modal-creativo {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
}
#modal-creativo:not(.hidden) {
  display: grid !important;
  place-items: center !important;
  padding: 20px !important;
}
#modal-creativo > div:last-child {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: min(100%, 448px) !important;
  max-height: calc(100dvh - 40px) !important;
  margin: 0 !important;
  transform: none !important;
}
/* Referencia del plan en Solicitudes. */
.pedidos-table .plan-number-badge { display:inline-flex; align-items:center; align-self:flex-start; margin-top:2px; padding:3px 8px; border:1px solid #86efac; border-radius:999px; background:#dcfce7; color:#166534; font-size:.62rem; font-weight:800; line-height:1.15; letter-spacing:.02em; white-space:nowrap; }
.dark .pedidos-table .plan-number-badge { border-color:rgba(74,222,128,.35); background:rgba(22,163,74,.18); color:#86efac; }
