/* ==========================================================================
   EVA SEGURA | HAUTE CONTENT STUDIO & MARKETING COMMAND CENTER
   Design System: NOIR & ROSE ULTRA-LUXURY (Estilo Architectural & High-End Editorial)
   Paleta: Deep Obsidian Black, Hot Luxury Pink, Rose Gold, Champagne & Wine
   ========================================================================== */

:root {
  /* Tipografías de Alto Prestigio */
  --font-serif: 'Playfair Display', Didot, 'Bodoni MT', Georgia, serif;
  --font-editorial: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Lienzo & Superficies Noir */
  --bg-body: #08070a;
  --bg-card: #120e15;
  --bg-card-subtle: #18131c;
  --bg-hover: #231928;
  --border-color: rgba(244, 114, 182, 0.20);
  --border-subtle: rgba(244, 114, 182, 0.10);
  --border-focus: #f43f8e;

  /* Tipografía de Alto Contraste */
  --text-main: #fcf8fa;
  --text-muted: #c4a9b7;
  --text-light: #8a7380;

  /* Acentos Rosas de Lujo & Oro Champagne */
  --pink-primary: #f43f8e;
  --pink-rose: #fb7185;
  --pink-deep: #be123c;
  --pink-light: rgba(244, 63, 142, 0.12);
  --pink-border: rgba(244, 63, 142, 0.35);

  --rose-gold: #f4a7b9;
  --rose-gold-dark: #d97786;
  --rose-gold-light: rgba(244, 167, 185, 0.12);

  --gold: #e5c158;
  --gold-dark: #b89635;
  --gold-light: rgba(229, 193, 88, 0.12);
  --gold-border: rgba(229, 193, 88, 0.35);

  --blush: #fbcfe8;
  --blush-dark: #f472b6;
  --blush-light: rgba(251, 207, 232, 0.08);

  --sage: #6ee7b7;
  --sage-dark: #10b981;
  --sage-light: rgba(110, 231, 183, 0.12);

  --slate: #94a3b8;
  --slate-dark: #64748b;
  --slate-light: rgba(148, 163, 184, 0.12);

  /* Estados de Producción de Contenido (Joyas en Fondo Oscuro) */
  --status-idea: #c084fc;
  --status-idea-bg: rgba(192, 132, 252, 0.14);
  --status-copy: #fbbf24;
  --status-copy-bg: rgba(251, 191, 36, 0.14);
  --status-design: #38bdf8;
  --status-design-bg: rgba(56, 189, 248, 0.14);
  --status-review: #fb7185;
  --status-review-bg: rgba(251, 113, 133, 0.14);
  --status-ready: #34d399;
  --status-ready-bg: rgba(52, 211, 153, 0.14);
  --status-published: #94a3b8;
  --status-published-bg: rgba(148, 163, 184, 0.14);

  /* Radios & Curvas Arquitectónicas */
  --radius-xs: 8px;
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 26px;
  --radius-full: 9999px;

  /* Sombras y Halos de Neón Rosa */
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.6);
  --shadow-soft: 0 10px 30px -6px rgba(0, 0, 0, 0.8), 0 0 1px rgba(244, 114, 182, 0.25);
  --shadow-hover: 0 16px 40px -8px rgba(0, 0, 0, 0.9), 0 0 20px rgba(244, 63, 142, 0.28);
  --shadow-modal: 0 28px 70px -10px rgba(0, 0, 0, 0.95), 0 0 35px rgba(244, 63, 142, 0.25);

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Modo Claro de Apoyo (si se alterna) */
[data-theme="light"] {
  --bg-body: #faf6f2;
  --bg-card: #ffffff;
  --bg-card-subtle: #fbf6f3;
  --bg-hover: #f7ebe6;
  --border-color: rgba(244, 114, 182, 0.3);
  --border-subtle: rgba(244, 114, 182, 0.15);
  --text-main: #1d1419;
  --text-muted: #6b5762;
  --text-light: #9c8591;
  --shadow-sm: 0 4px 14px rgba(180, 80, 110, 0.08);
  --shadow-soft: 0 10px 30px -6px rgba(180, 80, 110, 0.12);
  --shadow-hover: 0 16px 40px -8px rgba(180, 80, 110, 0.2);
}

/* ==========================================================================
   RESET & ESTILO GLOBAL NOIR
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  background-image: 
    radial-gradient(at 15% 10%, rgba(244, 63, 142, 0.14) 0px, transparent 45%),
    radial-gradient(at 85% 15%, rgba(190, 24, 93, 0.10) 0px, transparent 45%),
    radial-gradient(at 50% 85%, rgba(244, 63, 142, 0.07) 0px, transparent 55%),
    radial-gradient(at 85% 85%, rgba(229, 193, 88, 0.05) 0px, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100%;
  width: 100%;
  position: relative;
}

::selection {
  background: var(--pink-primary);
  color: #ffffff;
}

/* Scrollbar ultrafina de lujo */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #08070a;
}
::-webkit-scrollbar-thumb {
  background: rgba(244, 114, 182, 0.3);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--pink-primary);
}

/* ==========================================================================
   CABECERA PRINCIPAL (MARQUESINA HIGH-END NOIR & ROSE)
   ========================================================================== */
.agency-header {
  background: rgba(10, 8, 12, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 22px 36px 18px 36px;
  position: sticky;
  top: 0;
  z-index: 95;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7);
  transition: var(--transition);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

/* Insignia de Alta Dirección (Kicker Letter-spacing de Revista) */
.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink-rose);
  background: rgba(244, 63, 142, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.3);
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 6px;
  box-shadow: 0 0 15px rgba(244, 63, 142, 0.15);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-title .brand-dot,
.brand-title span {
  color: var(--pink-primary);
  font-size: 1.5rem;
  filter: drop-shadow(0 0 10px rgba(244, 63, 142, 0.7));
}

.brand-title .brand-subname {
  font-family: var(--font-editorial);
  font-style: italic;
  font-weight: 500;
  font-size: 2rem;
  color: var(--pink-rose);
  letter-spacing: 0.02em;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.02em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   FILA DE KPIS FINANCIEROS Y OPERATIVOS (TARJETAS LUXURY BLACK & ROSE)
   ========================================================================== */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin-top: 20px;
}

.kpi-card {
  background: linear-gradient(135deg, #181119 0%, #201321 60%, #150e18 100%);
  border: 1px solid rgba(244, 63, 142, 0.45);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(244, 63, 142, 0.22);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  color: #ffffff;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(244, 63, 142, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--pink-rose);
  box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.95), 0 0 28px rgba(244, 63, 142, 0.4);
}

.kpi-card:active {
  transform: translateY(-1px);
}

.kpi-card .kpi-label {
  color: var(--pink-rose);
  letter-spacing: 0.12em;
  font-weight: 800;
}

.kpi-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.mrr-privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--pink-rose);
  background: rgba(244, 63, 142, 0.14);
  border: 1px solid rgba(244, 63, 142, 0.4);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
  white-space: nowrap;
}

.mrr-privacy-pill:hover,
.kpi-card-mrr:hover .mrr-privacy-pill {
  background: rgba(244, 63, 142, 0.28);
  border-color: var(--pink-primary);
  box-shadow: 0 0 10px rgba(244, 63, 142, 0.35);
  transform: scale(1.04);
}

.mrr-privacy-pill.revealed {
  color: var(--gold);
  background: rgba(229, 193, 88, 0.14);
  border-color: rgba(229, 193, 88, 0.45);
}

.kpi-card .kpi-value {
  background: linear-gradient(135deg, #ffffff 0%, #fbcfe8 45%, #e5c158 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.7rem;
  font-weight: 800;
  text-shadow: 0 0 24px rgba(244, 63, 142, 0.35);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.kpi-card .kpi-value.mrr-hidden {
  letter-spacing: 0.24em;
  font-size: 1.55rem;
  opacity: 0.88;
  cursor: pointer;
}

.kpi-card .kpi-value.mrr-revealed {
  animation: mrrFadeIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

@keyframes mrrFadeIn {
  0% {
    opacity: 0;
    transform: translateY(3px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.kpi-card .kpi-sub {
  color: rgba(255, 255, 255, 0.75);
}

.kpi-card .kpi-icon {
  background: rgba(244, 63, 142, 0.15);
  border: 1px solid rgba(244, 63, 142, 0.45);
  box-shadow: 0 0 16px rgba(244, 63, 142, 0.3);
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.08);
  border-color: var(--pink-rose);
}

/* Tarjeta MRR en Cartera de Clientes: Joya de la Corona VIP (Black Titanium & Oro Rosa) */
.client-card-mrr-summary {
  background: linear-gradient(135deg, #181119 0%, #201321 60%, #150e18 100%) !important;
  border: 1px solid rgba(244, 63, 142, 0.45) !important;
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.9), 0 0 20px rgba(244, 63, 142, 0.22) !important;
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.client-card-mrr-summary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink-primary), var(--gold)) !important;
  opacity: 1;
}

.client-card-mrr-summary::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -30%;
  width: 170px;
  height: 170px;
  background: radial-gradient(circle, rgba(244, 63, 142, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.client-card-mrr-summary:hover {
  border-color: var(--pink-rose) !important;
  box-shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.95), 0 0 28px rgba(244, 63, 142, 0.4) !important;
  transform: translateY(-4px);
}

/* Iconos de los KPIs */
.kpi-icon {
  font-size: 1.6rem;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 63, 142, 0.15);
  border: 1px solid rgba(244, 63, 142, 0.45);
  box-shadow: 0 0 16px rgba(244, 63, 142, 0.3);
  flex-shrink: 0;
  transition: var(--transition);
}

.kpi-card:hover .kpi-icon {
  transform: scale(1.08);
  border-color: var(--pink-rose);
}

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

.kpi-label {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--pink-rose);
}

.kpi-value {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  background: linear-gradient(135deg, #ffffff 0%, #fbcfe8 45%, #e5c158 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-sub {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 2px;
}

/* Barra de Meta Financiera Rosa Luminosa */
.goal-progress-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
  margin-top: 8px;
  overflow: hidden;
}

.goal-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--pink-primary), var(--pink-rose));
  border-radius: var(--radius-full);
  box-shadow: 0 0 12px rgba(244, 63, 142, 0.75);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   BARRA DE NAVEGACIÓN ENTRE SECCIONES (TABS FLOTANTES NOIR & ROSE)
   ========================================================================== */
.agency-nav-bar {
  background: rgba(10, 8, 12, 0.90);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border-color);
  padding: 8px 36px;
  position: sticky;
  top: 154px;
  z-index: 90;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  transition: var(--transition);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #ffffff;
  background: rgba(244, 63, 142, 0.12);
  border-color: rgba(244, 114, 182, 0.25);
}

/* Pestaña Activa: Cápsula Satén Rosa Neón de Lujo */
.nav-tab-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  border-color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(244, 63, 142, 0.45);
}

.tab-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.nav-tab-btn.active .tab-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: transparent;
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL & TOOLBARS
   ========================================================================== */
.app-container {
  max-width: 1520px;
  width: 100%;
  margin: 0 auto;
  padding: 34px 36px 90px 36px;
  box-sizing: border-box;
  overflow-x: hidden;
}

.tab-view {
  display: none;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  animation: luxuryFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-view.active {
  display: block;
}

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

.view-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  min-width: 290px;
}

.search-input-wrap input {
  width: 100%;
  padding: 11px 18px 11px 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(18, 14, 21, 0.85);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--text-main);
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.search-input-wrap input:focus {
  border-color: var(--pink-primary);
  background: rgba(24, 18, 28, 0.95);
  box-shadow: 0 0 0 3px rgba(244, 63, 142, 0.25), 0 0 16px rgba(244, 63, 142, 0.2);
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pink-rose);
  pointer-events: none;
  font-size: 0.95rem;
}

.filter-select {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(18, 14, 21, 0.85);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.filter-select:focus {
  border-color: var(--pink-primary);
  box-shadow: 0 0 0 3px rgba(244, 63, 142, 0.25);
}

.filter-select option {
  background: #181119;
  color: #ffffff;
  padding: 8px 12px;
}

/* ==========================================================================
   BOTONES DE LUJO (HAUTE COUTURE JEWEL BUTTONS - ESTILO REFERENCIA)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 24px;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

/* Botón Primario: Rosa Satinado Neón de Alto Impacto */
.btn-primary {
  background: linear-gradient(135deg, var(--pink-primary) 0%, var(--pink-deep) 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(244, 63, 142, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fb7185 0%, #be123c 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(244, 63, 142, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-secondary {
  background: rgba(22, 16, 25, 0.9);
  border-color: var(--border-color);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: rgba(32, 22, 36, 0.95);
  border-color: var(--pink-primary);
  color: var(--pink-rose);
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(244, 63, 142, 0.25);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-muted);
}

.btn-outline:hover {
  background: rgba(244, 63, 142, 0.1);
  border-color: var(--pink-primary);
  color: #ffffff;
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.78rem;
}

.btn-xs {
  padding: 5px 14px;
  font-size: 0.72rem;
}

.btn-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: rgba(20, 15, 24, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
  background: rgba(35, 24, 40, 0.95);
  border-color: var(--pink-primary);
  transform: scale(1.08);
  box-shadow: 0 0 16px rgba(244, 63, 142, 0.35);
}

.btn-group {
  display: inline-flex;
  background: rgba(16, 12, 18, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.btn-group-item {
  padding: 8px 18px;
  font-size: 0.80rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.btn-group-item.active {
  background: linear-gradient(135deg, rgba(244, 63, 142, 0.25), rgba(190, 24, 93, 0.25));
  color: #ffffff;
  border: 1px solid var(--pink-primary);
  box-shadow: 0 0 14px rgba(244, 63, 142, 0.25);
  font-weight: 700;
}

/* Paneles y Cards */
.card-panel {
  background: rgba(18, 14, 21, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card-panel:hover {
  box-shadow: var(--shadow-soft);
  border-color: rgba(244, 114, 182, 0.3);
}

.card-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 14px;
  flex-wrap: wrap;
}

.card-panel-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   VISTA 1: DASHBOARD EJECUTIVO & ACCIONES DE HOY
   ========================================================================== */
.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 28px;
}

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

/* Power Hour Widget (Banner Concierge de Lujo en Negro y Rosa) */
.power-hour-box {
  background: linear-gradient(135deg, rgba(32, 16, 28, 0.85) 0%, rgba(20, 13, 24, 0.9) 100%);
  border: 1px solid rgba(244, 63, 142, 0.4);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 28px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 25px rgba(244, 63, 142, 0.15);
  position: relative;
  overflow: hidden;
}

.power-hour-box::before {
  content: "✦";
  position: absolute;
  top: 16px;
  right: 22px;
  font-size: 2.4rem;
  color: rgba(244, 63, 142, 0.25);
  pointer-events: none;
}

.power-hour-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.power-hour-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
}

.power-hour-title span:first-child {
  color: var(--pink-primary);
  filter: drop-shadow(0 0 8px rgba(244, 63, 142, 0.6));
}

.power-hour-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.power-hour-item {
  background: rgba(18, 13, 22, 0.85);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--pink-primary);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.power-hour-item:hover {
  transform: translateX(6px);
  border-color: var(--pink-primary);
  box-shadow: 0 4px 20px rgba(244, 63, 142, 0.2);
}

.lead-action-pill {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(229, 193, 88, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

/* Lista de Entregas Urgentes */
.urgent-deliveries-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.delivery-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  background: rgba(22, 17, 26, 0.8);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
  gap: 14px;
}

.delivery-item:hover {
  background: rgba(28, 21, 33, 0.95);
  border-color: var(--pink-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.delivery-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.delivery-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.delivery-title {
  font-weight: 600;
  font-size: 0.92rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.delivery-client {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Quick Action Buttons Grid (Cajetines Joya) */
.quick-agency-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.quick-action-btn {
  background: rgba(18, 14, 22, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.quick-action-btn:hover {
  background: rgba(26, 19, 31, 0.95);
  border-color: var(--pink-primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.quick-action-icon {
  font-size: 1.6rem;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 63, 142, 0.12);
  border: 1px solid rgba(244, 114, 182, 0.25);
  margin-bottom: 6px;
  color: var(--pink-primary);
}

.quick-action-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.quick-action-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Capacidad y Medidor Operativo */
.capacity-card {
  background: rgba(18, 14, 22, 0.85);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  margin-top: 20px;
}

.capacity-meter {
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, var(--pink-rose));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
  box-shadow: 0 0 10px rgba(244, 63, 142, 0.5);
}

.capacity-fill.high {
  background: linear-gradient(90deg, #e5c158, #f59e0b);
}

.capacity-fill.saturated {
  background: linear-gradient(90deg, #f43f8e, #ef4444);
}

/* ==========================================================================
   VISTA 2: CARTERA DE CLIENTES (ESTILO "FEATURED SELECTION" DE LA IMAGEN)
   ========================================================================== */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 26px;
}

.client-card {
  background: rgba(18, 14, 22, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Línea de acento superior estilo Alta Joyería */
.client-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink-primary), var(--gold));
  opacity: 0.85;
}

.client-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--pink-primary);
}

.client-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.client-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
}

.client-niche {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--pink-rose);
  margin-top: 4px;
}

.client-badge-status {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.status-activo {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-onboarding {
  background: rgba(229, 193, 88, 0.15);
  color: var(--gold);
  border: 1px solid var(--gold-border);
}

.status-pausado {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Métricas del Cliente (Cajita Estilo Precio de Propiedad) */
.client-kpis-mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  background: rgba(12, 9, 15, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 18px 0;
}

.client-kpi-item {
  display: flex;
  flex-direction: column;
}

.client-kpi-label {
  font-size: 0.68rem;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.client-kpi-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-serif);
}

.client-services-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 18px;
}

.service-tag {
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(244, 63, 142, 0.10);
  border: 1px solid rgba(244, 114, 182, 0.25);
  color: var(--pink-rose);
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

/* Enlaces rápidos del cliente */
.client-quick-links {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  align-items: center;
  justify-content: space-between;
}

.link-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  background: rgba(24, 17, 28, 0.8);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.link-icon-btn:hover {
  background: rgba(35, 23, 40, 0.95);
  border-color: var(--pink-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

/* ==========================================================================
   VISTA 3: CONTENT PLANNER STUDIO (KANBAN & CALENDARIO NOIR)
   ========================================================================== */
.kanban-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  overflow-x: auto;
  min-height: 620px;
  padding-bottom: 24px;
}

@media (max-width: 1360px) {
  .kanban-board {
    grid-template-columns: repeat(6, minmax(270px, 1fr));
  }
}

.kanban-column {
  background: rgba(16, 12, 20, 0.75);
  backdrop-filter: blur(14px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  min-height: 500px;
  max-height: calc(100vh - 230px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.kanban-col-header {
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(22, 16, 26, 0.9);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.col-title-group {
  display: flex;
  align-items: center;
  gap: 9px;
}

.col-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px currentColor;
}

.col-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.col-count {
  font-size: 0.74rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.10);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  color: var(--pink-rose);
  border: 1px solid rgba(244, 114, 182, 0.2);
}

.kanban-cards-list {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  flex: 1;
}

/* Tarjeta de Publicación en Kanban (Estilo Editorial Chic) */
.post-card {
  background: rgba(22, 16, 26, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--pink-primary);
}

.post-card-client {
  font-size: 0.70rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gold);
}

.post-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.post-card-hook {
  font-family: var(--font-editorial);
  font-size: 0.88rem;
  font-style: italic;
  color: var(--pink-rose);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background: rgba(244, 63, 142, 0.08);
  border: 1px dashed rgba(244, 114, 182, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  line-height: 1.45;
}

.post-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-light);
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.post-format-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 700;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

/* Calendario Editorial Mensual (Estilo Revista Noir) */
.calendar-editorial-grid {
  background: rgba(18, 14, 22, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.cal-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.cal-month-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--pink-rose);
  margin-bottom: 12px;
}

.cal-days-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.cal-day-cell {
  background: rgba(14, 11, 18, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  min-height: 110px;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 10px;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
}

.cal-day-cell:hover {
  background: rgba(24, 18, 30, 0.95);
  border-color: var(--pink-primary);
  box-shadow: var(--shadow-sm);
}

.cal-day-cell.other-month {
  opacity: 0.25;
}

.cal-day-cell.is-today {
  border: 1.5px solid var(--pink-primary);
  background: rgba(244, 63, 142, 0.12);
  box-shadow: 0 0 16px rgba(244, 63, 142, 0.35), inset 0 0 10px rgba(244, 63, 142, 0.08);
}

.cal-day-num {
  font-size: 0.82rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-day-cell.is-today .cal-day-num {
  color: var(--pink-rose);
}

.cal-day-cell.is-today .cal-day-num::after {
  content: "HOY";
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  background: var(--pink-primary);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-weight: 800;
}

.cal-posts-container {
  min-width: 0;
  width: 100%;
  overflow-y: auto;
  max-height: 80px;
}

.cal-post-chip {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
  cursor: pointer;
  transition: var(--transition);
}

.cal-post-chip:hover {
  transform: translateY(-1px);
  filter: brightness(1.15);
}

/* ==========================================================================
   VISTA 4: MÁQUINA DE CAPTACIÓN & PIPELINE DE VENTAS
   ========================================================================== */
.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 18px;
  overflow-x: auto;
  min-height: 540px;
  padding-bottom: 24px;
}

@media (max-width: 1360px) {
  .pipeline-board {
    grid-template-columns: repeat(6, minmax(270px, 1fr));
  }
}

.lead-card {
  background: rgba(22, 16, 26, 0.95);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lead-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--pink-primary);
}

.lead-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.lead-business-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.02rem;
  color: #ffffff;
}

.lead-fee-badge {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--gold);
  background: rgba(229, 193, 88, 0.14);
  border: 1px solid var(--gold-border);
  padding: 2px 9px;
  border-radius: var(--radius-full);
}

.lead-contact-person {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.lead-notes-preview {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  background: rgba(14, 11, 18, 0.8);
  border: 1px dashed var(--border-color);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lead-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--text-light);
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.followup-alert {
  color: #f43f8e;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(244, 63, 142, 0.4);
}

/* ==========================================================================
   VISTA 5: KIT DE VENTAS, GUIONES & OBJECIONES (PAPELERÍA NOIR)
   ========================================================================== */
.scripts-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.script-accordion-item {
  background: rgba(18, 14, 22, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.script-accordion-item:hover {
  border-color: var(--pink-primary);
}

.script-header {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(22, 16, 26, 0.95);
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  transition: var(--transition);
}

.script-header:hover {
  background: rgba(30, 21, 35, 0.98);
  color: var(--pink-rose);
}

.script-body {
  padding: 0 24px 24px 24px;
  display: none;
  font-size: 0.90rem;
  color: var(--text-main);
  line-height: 1.65;
}

.script-body.open {
  display: block;
  animation: luxuryFadeIn 0.22s ease-out;
}

.copyable-box {
  background: rgba(12, 9, 15, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin-top: 14px;
  position: relative;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  white-space: pre-wrap;
  color: var(--text-main);
  line-height: 1.65;
}

.btn-copy-script {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(244, 63, 142, 0.15);
  border: 1px solid rgba(244, 114, 182, 0.4);
  border-radius: var(--radius-full);
  padding: 5px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.btn-copy-script:hover {
  background: var(--pink-primary);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(244, 63, 142, 0.5);
}

/* ==========================================================================
   VISTA 6: PLAYBOOK ESTRATÉGICO & SOPS
   ========================================================================== */
.sops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 26px;
  margin-top: 24px;
}

.sop-card {
  background: rgba(18, 14, 22, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-sm);
}

.sop-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 5px;
}

.sop-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.10);
  border-radius: var(--radius-full);
  margin: 16px 0;
  overflow: hidden;
}

.sop-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--pink-primary));
  border-radius: var(--radius-full);
  width: 0%;
  transition: width 0.4s ease;
  box-shadow: 0 0 10px rgba(244, 63, 142, 0.5);
}

.sop-steps-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sop-step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}

.sop-checkbox {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--pink-primary);
}

.step-details {
  display: flex;
  flex-direction: column;
}

.step-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.step-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ==========================================================================
   MODALES (FROSTED LUXURY GLASS & NOIR OVERLAY)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 3, 5, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: luxuryFadeIn 0.24s ease-out;
}

.modal-card {
  background: #140f17;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 34px;
  box-shadow: var(--shadow-modal);
  position: relative;
}

.modal-card.wide {
  max-width: 880px;
}

.modal-card.extra-wide {
  max-width: 1060px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
}

.close-modal-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-subtle);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.close-modal-btn:hover {
  background: rgba(244, 63, 142, 0.2);
  color: #ffffff;
  border-color: var(--pink-primary);
}

/* Formularios en Modales */
.form-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

label {
  font-size: 0.80rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
}

input, select, textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(10, 8, 12, 0.85);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: #ffffff;
  outline: none;
  transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--pink-primary);
  background: rgba(18, 14, 22, 0.95);
  box-shadow: 0 0 0 3px rgba(244, 63, 142, 0.25), 0 0 16px rgba(244, 63, 142, 0.2);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   BANCO DE HOOKS & GENERADOR DE PROPUESTAS
   ========================================================================== */
.hook-categories-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.hook-chip {
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(22, 16, 26, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.hook-chip.active {
  background: linear-gradient(135deg, var(--pink-primary), var(--pink-deep));
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 16px rgba(244, 63, 142, 0.4);
}

.hooks-grid-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.hook-result-item {
  background: rgba(18, 14, 22, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  transition: var(--transition);
}

.hook-result-item:hover {
  background: rgba(26, 19, 31, 0.95);
  border-color: var(--pink-primary);
  box-shadow: 0 0 16px rgba(244, 63, 142, 0.15);
}

.hook-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.45;
}

/* Propuestas Comerciales */
.proposal-box {
  background: rgba(18, 14, 22, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.proposal-tier-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(12, 9, 15, 0.75);
}

.proposal-tier-card.selected {
  border-color: var(--pink-primary);
  background: rgba(28, 19, 33, 0.95);
  box-shadow: 0 0 24px rgba(244, 63, 142, 0.3);
}

/* ==========================================================================
   SINCRONIZACIÓN & TOASTS NOTIFICACIONES
   ========================================================================== */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  background: rgba(20, 15, 24, 0.85);
  border: 1px solid var(--border-subtle);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.sync-badge.saving .sync-dot {
  background: var(--gold);
  box-shadow: 0 0 10px rgba(229, 193, 88, 0.8);
  animation: luxuryPulse 1.2s infinite;
}

.sync-badge.error .sync-dot {
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.8);
}

@keyframes luxuryPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: linear-gradient(135deg, #181119 0%, #2a1526 100%);
  color: #ffffff;
  padding: 16px 26px;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  border: 1px solid var(--pink-primary);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.85), 0 0 20px rgba(244, 63, 142, 0.35);
  z-index: 200;
  display: none;
  animation: slideUpLuxury 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* ==========================================================================
   ESTILOS DE IMPRESIÓN (PDF & PROPUESTAS FORMALES)
   ========================================================================== */
@media print {
  .agency-header, .agency-nav-bar, .view-toolbar, .modal-actions, .btn, .close-modal-btn {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .modal-overlay {
    position: static !important;
    background: none !important;
    padding: 0 !important;
  }
  .modal-card {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 0 !important;
  }
}

/* ==========================================================================
   PANTALLA DE ACCESO Y BLOQUEO POR CONTRASEÑA (HAUTE LOCK SCREEN)
   ========================================================================== */
.auth-lock-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, rgba(32, 19, 33, 0.98) 0%, rgba(10, 7, 11, 0.99) 100%);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.auth-lock-overlay.unlocked {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-lock-card {
  background: linear-gradient(145deg, rgba(28, 20, 30, 0.96) 0%, rgba(18, 12, 19, 0.98) 100%);
  border: 1px solid rgba(244, 63, 142, 0.45);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -10px rgba(0, 0, 0, 0.95), 0 0 35px rgba(244, 63, 142, 0.25);
  max-width: 440px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  position: relative;
  animation: authFadeInScale 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-brand-badge {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 16px;
  display: inline-block;
}

.auth-lock-icon-wrap {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: rgba(244, 63, 142, 0.14);
  border: 1px solid rgba(244, 63, 142, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.85rem;
  box-shadow: 0 0 22px rgba(244, 63, 142, 0.35);
  animation: lockFloat 3s ease-in-out infinite;
}

@keyframes lockFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.auth-lock-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
}

.auth-lock-subtitle {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-bottom: 26px;
  line-height: 1.45;
}

.auth-input-group {
  text-align: left;
  margin-bottom: 18px;
}

.auth-input-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink-rose);
  margin-bottom: 8px;
}

.auth-password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-input {
  width: 100%;
  padding: 13px 46px 13px 16px;
  background: rgba(14, 10, 15, 0.92);
  border: 1px solid rgba(244, 63, 142, 0.35);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: #ffffff;
  outline: none;
  transition: var(--transition);
}

.auth-password-input:focus {
  border-color: var(--pink-primary);
  box-shadow: 0 0 0 3px rgba(244, 63, 142, 0.25), 0 0 16px rgba(244, 63, 142, 0.3);
}

.auth-show-pwd-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.15rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s, transform 0.2s;
  color: var(--text-main);
  padding: 4px;
}

.auth-show-pwd-btn:hover {
  opacity: 1;
  transform: scale(1.1);
}

.auth-error-message {
  padding: 11px 16px;
  background: rgba(244, 63, 94, 0.16);
  border: 1px solid rgba(244, 63, 94, 0.45);
  border-radius: var(--radius-sm);
  color: #fb7185;
  font-size: 0.86rem;
  font-weight: 600;
  margin-bottom: 18px;
  text-align: left;
  animation: shakeError 0.35s ease;
}

.auth-submit-btn {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.auth-remember-row {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--text-light);
}

.auth-remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.auth-remember-label input[type="checkbox"] {
  accent-color: var(--pink-primary);
  cursor: pointer;
}

@keyframes authFadeInScale {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

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

/* ==========================================================================
   DISEÑO 100% RESPONSIVE & OPTIMIZACIÓN MÓVIL (HAUTE MOBILE EXPERIENCE)
   ========================================================================== */

/* Prevenir overflow horizontal global en móviles */
html, body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

/* TABLETS Y PORTÁTILES COMPACTOS (<= 1024px) */
@media (max-width: 1024px) {
  .app-container {
    padding: 24px 20px 80px 20px;
  }
  
  .agency-header {
    position: static;
    padding: 18px 20px 14px 20px;
  }

  .agency-nav-bar {
    position: sticky;
    top: 0;
    z-index: 95;
    padding: 8px 18px;
    background: rgba(10, 8, 12, 0.96);
  }

  .kpi-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .dash-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .clients-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
  }
}

/* SMARTPHONES Y TABLETS VERTICALES (<= 768px) */
@media (max-width: 768px) {
  /* Estructura Base y Prevención de Desbordamiento */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
  }

  /* Cabecera y Marca */
  .agency-header {
    position: static;
    padding: 14px 12px 10px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .brand-badge {
    font-size: 0.58rem;
    letter-spacing: 0.10em;
    padding: 3px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .brand-title {
    font-size: 1.45rem;
    line-height: 1.2;
    flex-wrap: wrap;
    gap: 4px;
    max-width: 100%;
    word-break: break-word;
  }

  .brand-title .brand-subname {
    font-size: 1.35rem;
  }

  .brand-subtitle {
    font-size: 0.74rem;
    line-height: 1.35;
    max-width: 100%;
  }

  /* Acciones de Cabecera (Botones táctiles) */
  .header-actions {
    width: 100%;
    max-width: 100%;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: wrap;
  }

  .header-actions .btn {
    padding: 6px 10px;
    font-size: 0.72rem;
    flex: 1 1 auto;
    text-align: center;
    justify-content: center;
    box-sizing: border-box;
  }

  .header-actions .btn-icon {
    padding: 6px 10px;
    font-size: 0.88rem;
    flex: 0 0 auto;
  }

  .sync-badge {
    font-size: 0.68rem;
    padding: 4px 8px;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* KPIs en Móvil: Cuadrícula compacta 2x2 que encaja 100% */
  .kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin-top: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .kpi-card {
    padding: 12px 8px !important;
    gap: 8px !important;
    border-radius: var(--radius-sm) !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .kpi-card .kpi-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    font-size: 1rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .kpi-card .kpi-label {
    font-size: 0.60rem !important;
    letter-spacing: 0.03em !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .kpi-card .kpi-value {
    font-size: 1.15rem !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .kpi-card .kpi-value.mrr-hidden {
    font-size: 1.05rem !important;
    letter-spacing: 0.12em !important;
  }

  .kpi-card .kpi-sub {
    font-size: 0.65rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
  }

  .mrr-privacy-pill {
    font-size: 0.55rem !important;
    padding: 1px 4px !important;
  }

  /* Barra de Pestañas Móvil: Desplazamiento horizontal fluido */
  .agency-nav-bar {
    position: sticky;
    top: 0;
    z-index: 95;
    padding: 6px 8px;
    background: rgba(10, 8, 12, 0.96);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .nav-tabs {
    gap: 6px;
    padding: 2px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    width: 100%;
  }

  .nav-tabs::-webkit-scrollbar {
    display: none;
  }

  .nav-tab-btn {
    padding: 6px 11px;
    font-size: 0.76rem;
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
    border-radius: var(--radius-full);
  }

  .tab-badge {
    font-size: 0.58rem;
    padding: 1px 5px;
  }

  /* Contenedor Principal */
  .app-container {
    padding: 14px 10px 60px 10px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  .tab-view {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Dashboard Grid y Paneles de Control */
  .dash-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .dash-grid > div {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .card-panel {
    padding: 16px 12px !important;
    margin-bottom: 14px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .card-panel-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .card-panel-header .btn {
    width: 100% !important;
    justify-content: center !important;
    font-size: 0.76rem !important;
    padding: 9px 12px !important;
    box-sizing: border-box !important;
  }

  .card-panel-title {
    font-size: 1.12rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }

  /* Entregas Inmediatas / Publicaciones Urgentes */
  .urgent-deliveries-list {
    gap: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .delivery-item {
    padding: 12px 10px !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-sm) !important;
    justify-content: space-between !important;
  }

  .delivery-left {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    gap: 8px !important;
    overflow: hidden !important;
  }

  .delivery-text-wrap,
  .delivery-left > div {
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }

  .delivery-badge {
    font-size: 0.62rem !important;
    padding: 3px 7px !important;
    flex-shrink: 0 !important;
    border-radius: var(--radius-xs) !important;
  }

  .delivery-title {
    font-size: 0.80rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: block !important;
  }

  .delivery-client {
    font-size: 0.68rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    display: block !important;
  }

  .delivery-format-tag,
  .delivery-item > div:last-child {
    flex-shrink: 0 !important;
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    margin-left: 4px !important;
  }

  /* Acciones Rápidas (Cuadrícula Joya 2 Columnas que Encaja 100%) */
  .quick-agency-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .quick-action-btn {
    padding: 12px 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    border-radius: var(--radius-sm) !important;
    gap: 4px !important;
  }

  .quick-action-icon {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    font-size: 1.2rem !important;
    margin-bottom: 2px !important;
    border-radius: var(--radius-xs) !important;
  }

  .quick-action-title {
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .quick-action-desc {
    font-size: 0.68rem !important;
    line-height: 1.25 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }

  /* Power Hour de Ventas en Móvil */
  .power-hour-box {
    padding: 16px 12px !important;
    margin-bottom: 14px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .power-hour-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .power-hour-title {
    font-size: 1.08rem !important;
    line-height: 1.3 !important;
    word-break: break-word !important;
  }

  .power-hour-item {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 12px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .power-hour-info,
  .power-hour-item > div:first-child {
    width: 100% !important;
    min-width: 0 !important;
  }

  .power-hour-lead-header,
  .power-hour-item > div:first-child > div:first-child {
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .power-hour-lead-name {
    word-break: break-word !important;
    font-size: 0.88rem !important;
  }

  .power-hour-actions,
  .power-hour-item > div:last-child {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
  }

  .power-hour-actions .btn,
  .power-hour-actions a,
  .power-hour-item > div:last-child .btn,
  .power-hour-item > div:last-child a {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 8px 10px !important;
    font-size: 0.74rem !important;
  }

  /* Barras de Herramientas y Filtros */
  .view-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    margin-bottom: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .toolbar-left, 
  .toolbar-right {
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 8px !important;
  }

  .filter-select,
  .search-input-wrap {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  .filter-select {
    padding: 9px 14px !important;
    font-size: 0.80rem !important;
  }

  .btn-group {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .btn-group .btn,
  .btn-group .btn-group-item {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
    font-size: 0.78rem !important;
    padding: 8px 10px !important;
  }

  .toolbar-right .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 10px 14px !important;
    font-size: 0.80rem !important;
    box-sizing: border-box !important;
  }

  /* Content Studio: Kanban Móvil con Swipe Horizontal y Snap */
  .kanban-board {
    grid-template-columns: repeat(6, minmax(240px, 80vw)) !important;
    gap: 12px !important;
    padding-bottom: 16px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .kanban-column {
    scroll-snap-align: start !important;
    min-height: 380px !important;
    max-height: 68vh !important;
    border-radius: var(--radius-sm) !important;
  }

  /* Calendario Editorial en Móvil */
  .calendar-editorial-grid {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .cal-weekdays,
  .cal-days-grid {
    min-width: 540px !important;
  }

  .cal-day-cell {
    min-height: 80px !important;
    padding: 6px !important;
  }

  .cal-nav-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }

  .cal-month-title {
    font-size: 1.15rem !important;
  }

  /* Cartera de Clientes en Móvil */
  .clients-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .client-card {
    padding: 16px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .client-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .client-card-mrr-summary #clientViewMrr {
    font-size: 1.5rem !important;
  }

  .client-kpis-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    padding: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .client-kpi-item {
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .client-kpi-val {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 0.80rem !important;
  }

  .client-quick-links {
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    justify-content: space-between !important;
  }

  .client-quick-links .link-icon-btn,
  .client-quick-links .btn {
    font-size: 0.72rem !important;
    padding: 5px 9px !important;
  }

  /* Pipeline de Ventas en Móvil */
  .pipeline-board {
    grid-template-columns: repeat(6, minmax(240px, 80vw)) !important;
    gap: 12px !important;
    padding-bottom: 16px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .pipeline-column {
    scroll-snap-align: start !important;
    min-height: 380px !important;
    max-height: 68vh !important;
  }

  /* SOPs en Móvil */
  .sops-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .sop-card {
    padding: 16px 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Modales en Móvil (Formato Bottom Sheet Táctil) */
  .modal-overlay {
    padding: 8px !important;
    align-items: flex-end !important;
  }

  .modal-card,
  .modal-card.wide,
  .modal-card.extra-wide {
    padding: 20px 14px !important;
    max-height: 90vh !important;
    border-radius: 18px 18px 10px 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
  }

  .modal-header h3 {
    font-size: 1.15rem !important;
  }

  .form-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    font-size: 16px !important; /* Previene auto-zoom molesto en iOS Safari */
  }

  .modal-actions {
    flex-direction: column-reverse !important;
    gap: 8px !important;
    margin-top: 18px !important;
    padding-top: 12px !important;
    width: 100% !important;
  }

  .modal-actions .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  /* Pantalla de Bloqueo en Móvil */
  .auth-lock-card {
    padding: 24px 14px !important;
    max-width: 95% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .auth-lock-title {
    font-size: 1.5rem !important;
  }

  .auth-lock-subtitle {
    font-size: 0.76rem !important;
    margin-bottom: 18px !important;
  }

  .auth-password-input {
    padding: 11px 40px 11px 12px !important;
    font-size: 16px !important;
    box-sizing: border-box !important;
  }

  .auth-submit-btn {
    padding: 12px !important;
    font-size: 0.90rem !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Toast en Móvil */
  .toast {
    left: 10px !important;
    right: 10px !important;
    bottom: 12px !important;
    text-align: center !important;
    font-size: 0.80rem !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
  }
}

/* TELÉFONOS MUY COMPACTOS (<= 380px) */
@media (max-width: 380px) {
  .quick-agency-actions {
    grid-template-columns: 1fr !important;
  }

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

  .brand-title {
    font-size: 1.30rem !important;
  }

  .brand-title .brand-subname {
    font-size: 1.20rem !important;
  }
}
